Kerberos
Kerberos

Reputation: 1256

Getting numbers from camera device

I would like to get the numbers from an image of a basketball scoreboard received from a camera device, by using OCR or any other algorithm. The input image is similiar to this:

enter image description here

How can I get the best result? Which algorithm should I use?

Upvotes: 1

Views: 276

Answers (1)

Spektre
Spektre

Reputation: 51893

  1. extract bright orange-red pixels only and binarize

    so pixels near the Redish/Orange color above some threshold intensity are white the rest is black pixel.

  2. remove gaps between segments by morphologic operators

    enlarge white pixels area few times to cover the gaps between dot segments so digits will become single object

  3. segmentate digits (for example by flood fill)

    find first white pixel and flood fill recolor it to object 1 ID, then find next white pixel and recolor it to object 2 ID and so on until no more white pixels left. You can remember bbox of each object and filter out objects not matching digit properties: (aspect ratio, size, density)

  4. OCR each digit and reconstruct text based on digit position

    see OCR and character similarity

If your camera is fixed you can manually hardcode the digits regions elliminating the need for bullet #3. Also you can use the black areas to determine digit areas as the border is black...

Upvotes: 1

Related Questions