Better character isolation

asked 2017-07-02 06:00:41 -0500

Cole gravatar image

Hi,

I am trying to process an image, and extract the characters from it. Please see the following link for current work in progress: http://imgur.com/a/FfqwJ

At the moment, these are the steps I have followed:

  1. Take original image, convert to hsv, get a mask of the yellow regions using inRange( )
  2. Extract the yellow marker regions ( see the link above )
  3. Take the yellow region image, convert to grayscale
  4. Dilate and erode the grayscale image
  5. Threshold the image using cv2.threshold( image, 110, 255, cv2.THRESH_BINARY )
  6. run findContours on the threshold image to identify the characters
  7. Create a bounding box around the contours to isolate the characters based on width, height, position
  8. Extract each character individually.

As you can see from the two images, the thresholding is not working so well for the first image, but is good for the second. If I change my thresholding value to where the first image becomes cleaner, then the second image becomes much worse.

I am hoping someone can suggest some other methods to help me process the images more reliably.

Any help would be greatly appreciated.

edit retag flag offensive close merge delete