CS 7321 Winter 1998

PS#1 Solutions by Rob Orr

Character Recognition Problem


Index


How I solved it

For each vowel and each image, I performed the following steps:

  1. Manually cropped out a representative vowel:
    1. imcrop()
    2. prepared a crop mask for the script to use after it had thinned the vowel
    3. imwrite()
  2. Found where that vowel occurred in the original image:
    1. Thin the vowel template: bwmorph('thin')
    2. Crop the thinned vowel template using the prepared crop mask to give just the vowel frame: imcrop()
    3. Threshold the image: im2bw()
    4. Thicken the image: bwmorph('thicken')
    5. Erode the image with the thinned vowel template: erode()
    6. Cleaned away single pixel occurances (noise): bwmorph('clean')
    7. Dilated the resulting image with the original vowel template: dilate()
  3. Composed the vowel occurance image with the original image to show vowels in red:
    1. Convert vowel occurance image to double, multiply by 2, convert back to uint8
    2. Compose final image: max(original, occurance image)
    3. Display image with special colormap

to TOP


Assumptions and Weaknesses

I made the following assumptions

  1. The vowel that I chose as a template would be representative of every occurance
  2. The vowels in the images would be regular across the images
  3. Vowels occurances would generate larger than single pixel erosions
  4. Techniques that worked well for the single vowel 'e' would work well for all vowels

I think the major weakness of my solutions are:

  1. The vowel templates are not representative!
  2. The vowels are not regular across the images!
  3. The techniques that work for 'e' don't work across all vowels!
  4. The thickening of the images is too aggressive: it produces areas too large for the erosion and we get matches of vowels where they don't really occur

to TOP


Improvements and Possible Future Work

I think that this can be improved by doing the following

to TOP


Results

Image 1

Figure 1: This is the first sample with just the 'e' matched. This came out fairly well.

Image 2

Figure 2: This is the second sample with just the 'e' matched. Again, it came out fairly well but you can see a little overaggressiveness.

Image 3

Figure 3: This is the third sample with just the 'e' matched. No rotation was done but note that it still got 7 of 11 e's (and some false positives).

Image 4

Figure 4: This is the first sample with all the vowels matched. This is terrible.

Image 5

Figure 5: This is the second sample with all vowels matched. Terrible.

Image 6

Figure 6: This is the third sample with all vowels matched. Again, terrible.

to TOP


Source Code