OpenCV detect numbers

前端 未结 10 767
面向向阳花
面向向阳花 2020-12-25 13:52

I\'m using OpenCV on the iPhone and need to detect numbers in an image. I split the image into smaller images so each image has only one number (1-9). All numbers are printe

10条回答
  •  半阙折子戏
    2020-12-25 14:05

    If the numbers are printed, the job is quite simple, you just need to figure out a nice set of features to match. If the numbers are one font, you can get away with this approach:

    • Extract the number
    • Find the bounding box
    • Scale the image down to something like 10x8, try to match the aspect ratio
    • Do this for a small training set, take the 'average' image for each number

    • For new images, follow the steps above, but the last is just a absolute image difference with each of the number-templates. Then take the sum of the differences (pixels in the difference image). The one with the minimum is your number.

    All above are basic OpenCV operations.

提交回复
热议问题