Re: Extract en recognize barcode from image file.
- From: Kaz Kylheku <kkylheku@xxxxxxxxx>
- Date: Thu, 10 Apr 2008 19:27:58 -0700 (PDT)
On Apr 10, 3:30 pm, kura...@xxxxxxxxx wrote:
Hi there!!!
I've been working on recognizing EAN barcodes from images.
[ snip ]
I haven't been successful yet.
Send the image to a laser printer, and pop up a dialog box telling the
user to get a commercial scanner + software.
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
Rotate the image? Hough transform? What?
How does laser scanning work? it cris-crosses the image with a
laserbeam that is rapidly deflected by mirrors. The beam scatters with
an intensity that depends on the amount of pigmentation in the bar
code. Fluctuations in the reflected intensity are captured; from this
signal, the data packet is detected, if possible. Garbage signals are
rejected by error detection. There are patterns in the signal which
indicate the start and end of data, and patterns that code the digits.
You could simulate this lasert beam traversal of the image at various
angles using, guess what, the Bresenham line drawing algorithm.
Averaging a few surrounding pixels along the way would give you the
intensity signal to feed to the receiver arlgorithm.
Just like the laser scanner at the grocery checkout counter, you can
try several crossings at a number of orientations, until you can
successfully decode a piece of data.
There is no need whatsoever to rotate the image.
Doh?
Four orienations might be enough: - \ | /. Eight is probably better.
This pattern could be tried at various horizontal and vertical
displacements across the image.
I don't have the slighest idea at how to do to extract the rectangular
zone of the barcode and then averaging the lines.
No such depth image recognition is required.
You aren't writing software to read car license plates from security
camera output!
Remember, bar codes were deliberately designed to make scanning easy.
.
- References:
- [OpenCV] Extract en recognize barcode from image file.
- From: kurapix
- [OpenCV] Extract en recognize barcode from image file.
- Prev by Date: Re: what is NULL pointer dereferencing
- Next by Date: Re: #define a macro that #includes
- Previous by thread: Re: Extract en recognize barcode from image file.
- Next by thread: How to be a better C programmer?
- Index(es):
Relevant Pages
|