POV-Ray : Newsgroups : povray.off-topic : More barcode fun : Re: More barcode fun Server Time
4 Sep 2024 23:23:05 EDT (-0400)
  Re: More barcode fun  
From: Invisible
Date: 30 Oct 2009 09:47:02
Message: <4aeaee56$1@news.povray.org>
Captain Jack wrote:

> I've never tried to implement a scanning algorithm, but it looks like an 
> interesting challenge. Not much novelty in it, I s'pose, although there 
> might be some room to develop more sophisticated two dimensional bar code 
> scanning processes.

The fun part of scanning, of course, is this:

1. You have to figure out where the hell the edges of the barcode are.

2. You have to work out how far away the barcode is, and hence how wide 
each of the bars is.

3. If the barcode has been scanned at an angle, the bar thicknesses may 
be different at one end verses the other end, and you need to compensate 
for this.

4. The barcode might be dirty, and you need to account for and reject 
noise in the signal.

5. You have to figure out which kind of barcode this is.

6. The barcode could be upside down. (E.g., my tape labels have all the 
barcodes actually printed the wrong way round. Go figure.) If so, you 
need to detect this and flip the barcode.

7. The barcode scan could be incomplete. (E.g., the scanner beam goes 
across a corner of the barcode, only picking up some of the bars.)

8. If you're using a 2D *camera* instead of a real laser barcode 
scanner, multiply all of the above issues by 7.

It's not as trivial as it sounds. ;-)

> When I had to make my own code 39, I coded for a specific model of laser 
> printer at 300 dpi, and I translated the tolerances to integer values before 
> I made my translation table, then translated those into the graphics command 
> that drew filled rectangles on the printer. That restricted the size 
> variations I could do, but it kept me from having slight variations in size 
> due to rounding errors; mostly all that was so that I could get the software 
> done and out the door quickly. 

Yeah, well, PostScript makes it fairly easy to draw a few rectangles at 
an exact absolute size on any compatible printer. (The print tolerances, 
however, will vary by model. I'd suspect that, e.g., an inkjet printer 
probably won't print small barcodes with sufficient accuracy.)


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.