From: Tamas Demjen on 2 Feb 2010 17:05 Jack wrote: > Picture Illustration: > > > 1) I have the large rectangle, this emcompasses 1,2,3,4,5 and the > obstacle in solid black > 2) I Know each "large" rectangle is 200x200 pixels > 3) Let say I divide the white spaces into 5 smaller rectangles as shown I have a hard time understanding you, but I believe you want to say that you have a bitmap, and you need to perform edge detection on it. So you can run a gradient operator or Sobel filter, to find the edges in the image: http://en.wikipedia.org/wiki/Sobel_operator In simple terms, the lines are where your pixels switch from black to white. And then run a Hough transform to detect the position and angle of your lines: http://en.wikipedia.org/wiki/Hough_transform http://homepages.inf.ed.ac.uk/rbf/HIPR2/hough.htm http://www.ddj.com/architect/184401736?pgno=10 This is very powerful. The combination of a Sobel filter and a Hough transform lets you find the dominant lines even in a busy photograph. There are other ways to detect lines as well. It's much easier if you are sure that every line is either vertical or horizontal. I've successfully used Hough transform techniques to detect black border in scanned images. I believe you should pick up a good image processing book from your local library. Computer vision is not exactly on topic here at the Microsoft C++ groups. Tom
From: Tamas Demjen on 2 Feb 2010 18:52 Tamas Demjen wrote: > can run a gradient operator or Sobel filter, to find the edges in the > image: > http://en.wikipedia.org/wiki/Sobel_operator Even better, the Canny edge detector: http://homepages.inf.ed.ac.uk/rbf/HIPR2/canny.htm Tom
First
|
Prev
|
Pages: 1 2 Prev: Convert from UINT_PTR to LPVOID Next: float to double conversion warning |