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

Angie Quijano
  • 4,167
  • 3
  • 25
  • 30
user2649244
  • 111
  • 2
  • 7

1 Answers1

1

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)?

sturkmen
  • 3,495
  • 4
  • 27
  • 63
nkint
  • 11,513
  • 31
  • 103
  • 174
  • thank for urs reply, the blog post is what i want, i will test it later. Can u explain a bit about blob ? Issit anothe library for openCV? – user2649244 Aug 06 '13 at 18:53
  • http://nghiaho.com/?p=1102 this explains blob detection (= find connected regions with opencv from a binary (=thresholded) image). If the answer is what you were looking for mark as right one and if you have question on some other issue open a new question – nkint Aug 07 '13 at 08:08