The problem of finding a point in the contour

asked 2018-04-02 16:51:09 -0500

Hello everybody! I'm trying to solve the task of character recognition on an image, for this:

  • Using the FindContour method, I search for all image contours and make one large array of points.
  • Then, using the Haris operator, I define the key points on the image.
  • A graph was made from all the key points of a particular letter
  • The direction of traversal is determined by the minimum distance from the first node to the nearest node. As for the correctness, the middle point is calculated. The points are approximated by the linear dependence Ax + By + C = 0

The problem is: the blue portion of the linear approximation and the middle are marked with blue, but now the problem arises that the midpoint of the point (marked in red) is not in the image points array. the true point will be on the arc. I ask you to tell me how to determine the position of the middle of the arc and its coordinates relative to the middle of the straight line P0P2, what are the methods, or do I have to use the Bezier curve?

  • Attached an image of the graph and an enlarged fragment with a problem area.

image description image description

edit retag flag offensive close merge delete


You can use approxPolyDP to get a polygon from a contour

LBerger gravatar imageLBerger ( 2018-04-03 03:25:06 -0500 )edit