简体   繁体   English

MATLAB:如何找到与飞机相对应的无穷远线的图像?

[英]MATLAB: How to find the image of the line at infinity corresponding to a plane?

There is an image of two separated papers on the floor. 地板上有两张分开的纸的图像。

How to find the image of the line at infinity corresponding to the plane of the floor? 如何找到对应于地板平面的无限远线的图像?

See the image at: (larger) 查看图片:( 更大)

PIC

Anyone has some idea on how to start with MATLAB? 任何人都对如何从MATLAB开始有所了解?

Thank you, 谢谢,

I'm not going to go into matlab specific bits but wil talk about the algorithm I'd use. 我不打算进入matlab特定的位,但我会谈谈我使用的算法。

Considering only one piece of paper the algorithm goes something like this. 只考虑一张纸,算法就是这样的。

  1. Find the corners of the paper 找到纸张的角落
  2. Choose one set of parallel edges and find their intersection in the image call this point P1 选择一组平行边,并在此点P1的图像调用中找到它们的交点
  3. Find the intersection point of the other pair of parallel edges. 找到另一对平行边的交点。 Call this P2. 叫这个P2。
  4. Your horizon line (or line at infinity) is the line joining P1 and P2 (extending beyond them) 您的地平线(或无穷远处的线)是连接P1和P2的线(超出它们)

However I'm not sure how robust this will be to 但是我不确定这会有多强大

  1. Image processing artifacts 图像处理工件
  2. Not perfectly rectangular paper. 不完美的矩形纸。
  3. Numerical issues. 数值问题。

You should be able to use both pieces to get an improved approximation to the solution. 您应该能够使用这两个部分来获得解决方案的改进近似值。 For example you could calculate P1 and P2 for both pieces and finding the line of best fit through the 4 points. 例如,您可以计算两个部分的P1和P2,并通过4个点找到最佳拟合线。

Hope this gives you some ideas. 希望这会给你一些想法。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM