0

Anyone know how to set ROI based on image bellow?

I used Hough Transform to detect the white line and draw the red line into the image. What I need to do is to set the ROI in the rectangle.

Since Hough Transform unable to get location of each rectangle and the main problem is I cannot defined the location (x,y) manually.

Any solution that able to auto detect the rectangle and set the ROI?

Anyone can give some idea for me or the code can be use?

Please forgive my poor english and thank you.

enter image description here

4

1 回答 1

1

这篇文很好地解释了如何使用霍夫变换找到一个矩形,并且它还有一些带有 opencv 2 API 的 c++ 代码。

方法是找到线,将它们相交,然后找到矩形。在你的情况下,你将有更多的矩形,所以它有点复杂..

但是,如果您设法获得这样的图像.. 为什么不只使用一些阈值并找到连接区域(又名 blob)?

于 2013-08-06T18:28:50.730 回答