Tesseract [OCR] - only numbers and euro symbol - image

At the moment I'm using tesseract a.tif output nobatch digits to parse an image that contains only numbers.
I'm in the need of parsing an image that contains numbers and Euro symbol. How can I do that with tesseract?

Modify the file digits under tessdata\configs to include the € symbol.

Related

ZPL Barcode missing front 2 digit

I am trying to print an EAN barcode vertically on a label with below ZPL code:
^FO895,273^BY3^BUB,200,Y,N
^FO895,261^FD9827755779090^FS
I'm expecting the output as 9827755779090. However, it prints out as 277557790900.
It cuts off the first 2 digit(98) and adds (0) on the final digit. Can I know how do I fix my code?
^BE is the EAN command. It will calculate the check digit for you.
^BE; EAN-13 Bar Code. Description: The ^BE command is similar to the
UPC-A bar code. It is widely used throughout Europe and Japan in the
retail marketplace. The EAN-13 bar code has 12 data characters, one
more data character than the UPC-A code. An EAN-13 symbol contains the
same number of bars as the UPC-A, but encodes a 13th digit into a
parity pattern of the left-hand six digits. This 13th digit, in
combination with the 12th digit, represents a country code. • ^BE
supports fixed print ratios. • Field data (^FD) is limited to exactly
12 characters. ZPL II automatically truncates or pads on the left with
zeros to achieve the required number of characters.
Here is the fixed code (with changed ^FO).
^XA
^FO95,273^BY3^BEB,200,Y,N
^FD9827755779090^FS
^XZ
You are feeding the barcode more data than the specification is set for.
Plus, you are not creating an EAN code, but a UPC(12).
Specification :
UPC (technically refers to UPC-A) consists of 12 digits
Specification of ZPL II on UPC-A (code ^BU) section 5.34 specifically states:
^FD : exactly 11 characters. ZPL II auto-truncates or pads ON THE LEFT with 0 to achieve required number of characters.
(I added italics)
So you get
^FO895,261^FD9827755779090^FS
----------- << these 11 digits
It just so happens that the UPC checksum of 27755779090 is 0
This is why you would get same result for ^FO895,261^FD999999988889827755779090^FS
To get exactly what you want, use
^FO895,261^FD98277557790^FS
.. this will get a checksum of 4

Two word with the same representation in UTF-8 have different representation in ASCII

I have a Farsi word that if shown in UTF-8 coding is like this:
"خطاب"
I have two versions of this word, both in Notepad++ in UTF-8 are shown as above.
But if I look at them in ANSI mode then I see:
ïºïºŽï»„ﺧ
and for the other one I see:
خطاب
How come the same words have such a different representation in ANSI format? When I use PIL in Python to draw these, the result is correct for one of these and not correct for the other.
I appreciate any help on this.
In Unicode you can represent some character in more than one way.
In this case, these Arabic characters are represented with code points from the Arabic Presentation Forms-B Block in the first case, and with code points from the regular Arabic Block in the second case.
If you convert the text
ïºïºŽï»„ﺧ
to a byte stream, you get
EFBA0F EFBA8E EFBB84 EFBAA7
Notice that you are not seeing a character representing the 0F byte in the text above, because it's a non-visual character.
Now that byte stream is representing a UTF-8-encoded text. Decoding it will give you the following Unicode code points:
FE8F FE8E FEC4 FEA7
You can match those in the Arabic Presentation Forms-B Block to form your Farsi text:
خطاب
You can do the same process for the other text: خطاب gives you the byte stream D8AE D8B7 D8A7 D8A8, which represents UTF-8-encoded text, which decoded gives you the Unicode code points 062e 0637 0627 0628, which matched to the regular Arabic Block gives you again the text خطاب.

how notepad++ picture extended chars

I'm working with binary data and want to find out that is wrong.
I use notepad++ to preview binary, I have set View->Show Symbol->Show All Characters to see all chars, but there still exists some chars I cannot identify, e.g. â©ÎÅ. The problem is that ASCII has strong standart for number 0 to 127, extended ASCII may be picturing in many ways, so I have problem with chars what represents numbers 128 to 255.
Is there any table of notepad++ extended chars or some option to make it show symbol code instead of symbol.
Maybe not solution for you, but in PSPad and SynWrite editors you can:
create text-converter (INI file) which changes ASCII 127..255 to strings like <127>...<255> or others
apply this converter to text.
Text converter usage is described in help of both apps.

ZPL - Barcode Missing a digit when printed

I am trying to print a Code 128 barcode on a label using the following the piece of ZPL with a Zebra ZP 450 printer:
^BY3^BCN,112,N^FO090,660^FD>;>89102100^FS
I'm expecting the barcode to scan as "9102100". However, when I scan the printed barcode, it reads as "910210" -- cutting off the final digit.
If I change the last digit, it is still cut off. But if I add more digits onto the end, e.g. "9102100357", the barcode correctly reads as "9102100357".
Why am I "losing" a digit in this particular case?
The >; inside of your ^FD block is telling the code 128 barcode to go into a subset (subset C in this case) which forces the data in the barcode to be numeric pairs (00 - 99). Any data that is not supplied in numeric pairs is ignored. If you put a letter in there, it will ignore that pair. In your case 9102100 has an odd number of numbers, so it ignores the last one. If for example, you add another 0, it will put all the letters in the barcode.
The ;> which puts the barcode in Subset C is not the default. Subset B or :> is the default which will allow any character to be encoded in the barcode. So you can replace the ;> with :>, or just remove the ;> entirely, and it will print out properly.
Check out the ^BC documentation in the ZPL programming manual for more information about Code 128 subsets and data validation
See pg 92 of the ZPL Programming Guide.
This issue may have been fixed in the firmware update, see below:
Example: This is an example with the mode parameter set to D*:
^XA
^PON
^LH0,0
^BY2,2.5,145
^FO218,343
^BCB,,Y,N,N,D
^FD(91)0005886>8(10)0000410549>8(99)05^FS
^XZ
D* — When trying to print the last Application Identifier with an odd number of characters, a problem
existed when printing EAN128 bar codes using Mode D. The problem was fixed in firmware version
V60.13.0.6."

Convert EAN-8 to EAN-13

I have an 8 digit EAN code which I would like to convert to an EAN-13 code.
Do you know of any algorithm on how to calculate this?
Or is it simply adding five zeros to the beginning of the EAN-8?
E.g. EAN-8(1234 5678) becomes EAN-13(00000 1234 5678)?
Adding five leading zeros to a valid EAN-8 will give you a valid EAN-13.
EAN-8 is just another name for GTIN-8, and EAN-13 is another name for GTIN-13. You can always convert shorter GTINs to longer GTINs by left-padding them with zeros, see http://en.wikipedia.org/wiki/Global_Trade_Item_Number#Format.
EAN-8 is a short version of EAN-13, composed by 7 digits and 1 check digit.
There is no conversion available between EAN-8 and EAN-13 sorry :(

Resources