K
kurapix
Hi there!!!
I've been working on recognizing EAN barcodes from images. Yes it's
about recognizing barcodes from images but from bars not from the
digit with the help of OCR software but with "Open Computer Vision
library" (OpenCV).
I haven't been successful yet.
Here is my idea at how I should do it :
- Image capture
- Grays levels
- Binarize image
- Search the angle with Hough Transform
- Rotate the image using the found angle.
- Average of several lines for the color of the bars
- Convert to binary digit
- Convert in decimal
(I'm unable to show the lines found with Hough Transform anyway ...
I don't have the slighest idea at how to do to extract the rectangular
zone of the barcode and then averaging the lines.
Then, I have problems with some barcodes with some reflections, some
bars won't be continue bars so ... it inputs errors and dunno how to
correct it (how to reform correctly the bar since some point are
presents).
Here what I have for now :
http://img527.imageshack.us/img527/4182/1barcodeuo0.th.jpg
http://img525.imageshack.us/img525/1876/2levelsofgrayseq3.th.jpg
http://img153.imageshack.us/img153/4425/3binarizexb6.th.jpg
http://img398.imageshack.us/img398/6972/4rotatesz3.th.jpg
I would like to post the source code but it's more than 100 lines ...
When my problem is resolved, I think I'll contribute to the community
by giving out the sources for recognizing a barcode from image.
Help would be much appreciate.
Thank you
Kurapix
P.S. : Sorry for my bad english
I've been working on recognizing EAN barcodes from images. Yes it's
about recognizing barcodes from images but from bars not from the
digit with the help of OCR software but with "Open Computer Vision
library" (OpenCV).
I haven't been successful yet.
Here is my idea at how I should do it :
- Image capture
- Grays levels
- Binarize image
- Search the angle with Hough Transform
- Rotate the image using the found angle.
- Average of several lines for the color of the bars
- Convert to binary digit
- Convert in decimal
(I'm unable to show the lines found with Hough Transform anyway ...
I can rotate the image and all.
I don't have the slighest idea at how to do to extract the rectangular
zone of the barcode and then averaging the lines.
Then, I have problems with some barcodes with some reflections, some
bars won't be continue bars so ... it inputs errors and dunno how to
correct it (how to reform correctly the bar since some point are
presents).
Here what I have for now :
http://img527.imageshack.us/img527/4182/1barcodeuo0.th.jpg
http://img525.imageshack.us/img525/1876/2levelsofgrayseq3.th.jpg
http://img153.imageshack.us/img153/4425/3binarizexb6.th.jpg
http://img398.imageshack.us/img398/6972/4rotatesz3.th.jpg
I would like to post the source code but it's more than 100 lines ...
When my problem is resolved, I think I'll contribute to the community
by giving out the sources for recognizing a barcode from image.
Help would be much appreciate.
Thank you
Kurapix
P.S. : Sorry for my bad english