Domanda

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

È stato utile?

Soluzione

this blog post is very good in explaining how to find a rectangle with the hough transform and it has also some c++ code with opencv 2 API.

The approach is to find lines, intersect them, and find the rectangle. In your case you will have more rectangles and so it's a little bit more complicated..

But if you manage to obtain such image.. why don't use just some threshold and find connected regions (aka blob)?

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top