Thursday, August 11, 2005 3:16 PM triplez

C# Home: Contest 4 - Digits Recognition

Contest 4: Digits Recognition

Difficulty: Advanced
Time Frame: 4 August - 4 September - 2005
Status: Open
Managed by: Iliya Yordanov

Problem

You will be given an uncompressed .bmp image file. In this image, there will be a number of digits from 0 to 9.

All the digits will be aligned in a single row. The font will be Verdana. The font size will vary from 18 to 30. The background of the image will be white (background == RGB(255, 255, 255)). There will be nothing else in the image, but the digits on a white background.

The digit's color will be black (digits color == RGB(0, 0, 0)). The digits can start in any part of the image, and the space between them can vary. There will never be digits overlapping, and all digits will be inside the image (no half displayed digits or what-so-ever). The size of the image file can vary, too.

You will have to write a function, that given full path to the image file, will return as string the digits inside the image. The string should not contain any whitespaces!
Example:

For the example above, your function should return this string:
104
More examples:

Should return: 31



Should return: 02467322

Note:

- The input will always be valid!
- There will always be at least one digit in the image.

Filed under:

# re: C# Home: Contest 4 - Digits Recognition

Friday, August 12, 2005 7:21 PM by hannes

It seems like a fun one.

I wonder whether all methods would attempt to find the rectangle around each digit? That would be my strategy, the rest should be easy.

# re: C# Home: Contest 4 - Digits Recognition

Saturday, August 13, 2005 12:16 AM by triplez

The rectangle is the size of the image. LOL! :P It's the image border displayed to show you the border. In actual fact it's the size of the actual image.