how to break the input character into grid format?
Hey, i have been trying to create a program on neural networks using Java lan开发者_运维技巧guage,which will be used for character recognition. we want to use the bitmap image of all 26 characters stored earlier. the problem is in breaking the input character into grid format with variable dimension so that we can overlap it on the pre-created bitmap images.
till now, i haven't been able to get any information related this problem.
You might try and render that character to an image for the overlay/grid (pixels). Getting the size of the character should be possible using FontMetrics.
I'm supposing the following hypothesis:
- You're characters in your target images are of same scale.
- You don't have any transformations (no slant or non linear deformations).
- You have relatively good quality images (no clipping, vigneting, etc).
OK to summarize you have a good setup. I'm not sure if you have issues with training phase or detection phase. But to split characters I propose:
- Binarize your image (use auto threshold to start, using say Otsu).
- Use morphological filtering to split your characters. ex. Erode + Close
- Find your blobs and blob centroids
- Compute the blobs major and minor axis length. You could also find the left,right,top and bottom limits of each blob by using the blob runs.
- Fit a box there.
Hope this helps.
精彩评论