0

if my picture contains distorted rectangle(as shown in image A,B) then how could I detect number of good or complete rectangles(in image C) For example if apply square.c from sample it answers 2 or 3 nos. of rectangles?

image link: https://picasaweb.google.com/108974049756701500543/October262011#5667724653724229138

If I find corners and right angles then I am wrong. I think, This approach wont work.

user1014212
  • 1
  • 1
  • 3

1 Answers1

0

In image processing, B is usually consider a pretty good rectangle. You could use "moments" but I suspect rectangle B will still score like a pretty good result.

See the following links that treats the same subject

Finding location of rectangles in an image with OpenCV

How to recognize rectangles in this image?

Community
  • 1
  • 1
Martin
  • 282
  • 2
  • 6
  • Yes, you are right that's why this is little tricky and cant go for approach with angles. :( – user1014212 Oct 26 '11 at 13:51
  • Another aproach could be to find the difference between the surface of the objects you find and their bounding boxes this could give you an indication if the objects boundary diverge from their theoretical edges... – Martin Oct 26 '11 at 14:25
  • Hello Martin, Sorry to come to your point little late. I dont get you exactly. If you can explain me by giving some examples or is there any Q'n asked before like this or any web link? – user1014212 Oct 30 '11 at 23:09
  • Find all the shapes in the image and calculate their area. Take the bounding box of each shapes in the image and calculate there area. If the area of a given shape differs by more than an arbitrary threshold from the area of its bounding box, the shape doesn't have a regular contour. – Martin Oct 31 '11 at 10:47