(a nitpick: the challenge asks for "distinct integers": your output for the 1st test is wrong)

It's either you are very lucky, or I'm negative as usual. Just wanted to check at 1st, if the engine applies any heuristics when all glyphs are obviously spaced apart a little (e.g. receipts to be easily readable by the elderly or similar.) I only did a dozen tests with manual image uploading, didn't apply for a free pass key.

use strict; use warnings; use GD; my $width = 1000; my $height = 100; my $image_file = q#output_image.png#; my $image = GD::Image->new($width, $height); my $white = $image->colorAllocate(255, 255, 255); my $black = $image->colorAllocate(0, 0, 0); $image->filledRectangle(0, 0, $width - 1, $height - 1, $white); my $font_path = q#c:/windows/fonts/cour.ttf#; my $font_size = 14; $image->stringFT($black, $font_path, $font_size, 0, 20, 75, '2 5 5 2 5 5 2 5 5'); open TEMP, q/>/, qq/$image_file/; binmode TEMP; print TEMP $image->png; close TEMP;

>>>

****** Result for Image/Page 1 ****** 255 255 255

Obviously not applicable for PWC 329.1. If, as I'd do anyway, the "s" transliteration modifier had been used i.e. string becomes "2 5 5 2 5 5 2 5 5":

****** Result for Image/Page 1 ****** 25525 52 5 5

And another Mars Orbiter kaput. Actually, there are different (wrong) results, i.e. digits groupings, for canvas size and string position as in your example, i.e. it's a factor, too. The reason I changed to larger canvas is because I tried larger font size, at some moment. Then some glyphs are just ignored, up to the point when NO text is found in the image (string as above, 500x500 canvas, 10x50 position, 16 points font, OCR2 engine, auto-enlarge on). Now, YOU ARE LUCKY to get correct results from them.


In reply to Re: OCRing out the Digits by Anonymous Monk
in thread OCRing out the Digits by adamcrussell

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.