Subj : Re: writing a software barcode reader To : comp.programming From : Thad Smith Date : Thu Oct 06 2005 12:13 pm Eric.Medlin@gmail.com wrote: > > I am writing software that will read a bar code from a 1bit tiff. It > will need to return the barcode numbers, magnification, and bar width > reduction. However I am having a hard time trying to determine the > magnification and the bar width reduction. The sample bar code I am > reading starts with 30 1's then 60 0's then 29 1's. This is the left > hand guard bars. I have no clue why the 1's are not the same length. > Has anyone else noticed similar things when examing barcodes bit by > bit? Remeber this is being read from the actual 1 bit tiff file that > will be printed this is not data from a hand held scanner. I never > expected to find any noise, but it looks like I might. Or maybe it is > just round off errors from the software that created the barcode. I would assume round-off errors associated with scaling. > Any > way from this I thought I could compute the magnification and bar width > reduction. The file is 2400dpi so with no bar width reduction or > magnification a module should be 31 dots. So the first two modules > should be 62. The first two in the actually bar code are 90. If we > take 90/62 we get 1.4516. I know the barcode was created with a 145% > magnification, so this seems correct. Now to find the bar code width > reduction. With 145% magnification the first module should be 45 dots. > So, (45-30)/2400 equals 0.00625. I know the bar code was created with > a bar width reduction of 0.007. That is close, but not perfect. Has > anyone else done this and if so how? Not here, but the closeness of the match suggests that you have the correct approach. Thad .