Wednesday, January 5, 2011

Contours samples

Connected Component

  • Use of binary thresholding: Make dark objects the foreground (white) when threshold is less than 128 and vice versa.

Fit Ellipse (fitellipse)

  • The ellipse drawn by the second of the two consecutive calls to ellipse() mostly overlaps the first one.


Convex Hull - where is ConvexityDefects()?

  • ConvexHull() and isContourConvex() are now C++ wrapper function for cvConvexHull2() and cvCheckContourConvexity()respectively.
  • There is no C++ wrapper for cvConvexityDefects(). The function requires the hull points be indices to the contour points. This implicitly relates all the hull points to the corresponding contour points. Is this how 'defect' searching works? 
  • In some cases the [sklansky82] algorithm have trouble finding convex hull from a polygon, how does that apply to general set of points?
    http://cgm.cs.mcgill.ca/~athens/cs601/


findSquares

  • Basic Idea: 
    Approximate the contours with polygon for the straight edges. Criteria of being a 'square': polygon edge count is 4,  area at least 1000 pixels, maximum angle between edges is close to 90.
  • Techniques
    • Use Law-of-Cosine to determine angle between two edges, with Cartesian origin at the edge joint.
    • The closer the angle is to 90 degree, the nearer the cosine value to 0.
    • Parameterize epsilon value to approxPolyDP() as a fraction of the contour length.
    • Reduce noise of source image with a sequence of downsampling-upsampling with Pyramid function.
    • Choose 0 as low-threshold for Canny to combine edges.
    • 'Dilate' the post-Canny image to remove 'holes' between edges.
    • Discover as many squares in a picture by iterating all color planes, intensity threshold values and

No comments:

Post a Comment