The problem of finding a point in the contour
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.
You can use approxPolyDP to get a polygon from a contour