Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

How to group two-contour(like i,j,!,?) characters in opencv python?

I'm trying to do the segmentation part of handwriting recognition. So far, my code can correctly identify the characters in an image with handwriting. I want to group the dot from the letters, like i,j,!,?, with its corresponding body. I was thinking of taking note of the next/previous contour's x-value if it's near to the x-value of the current contour but that will just result into false grouping results especially when the dot is drawn very near the next/previous different letter. Anyways, Here is an example of what my code can currently do: dot in letter i separate from body

How to group two-contour(like i,j,!,?) characters in opencv python?

I'm trying to do the segmentation part of handwriting recognition. So far, my code can correctly identify the characters in an image with handwriting. I want to group the dot from the letters, like i,j,!,?, with its corresponding body. I was thinking of taking note of the next/previous contour's x-value if it's near to the x-value of the current contour but that will just result into false grouping results especially when the dot is drawn very near the next/previous different letter. Anyways, Here is an example of what my code can currently do: dot in letter i separate from body

P.S I am using OpenCV Python 3.3.0 Sadly I cannot attach the code for this because it's very long since it's not well-written code but it's pretty straight forward. From a pre-processed image, I extracted the contours using cv2.findContours function. Then, I drew a rectangle on those contours. Now, I want the dot in the character "i" to be in the same contour as its body.