Improve poor quality TIF image prior to barcode recognition
-
keith_rigg
- Posts: 4
- Joined: 2013-06-25T00:36:18-07:00
- Authentication code: 6789
- Contact:
Improve poor quality TIF image prior to barcode recognition
Hi All,
I have a large batch of TIF images - each of which contain Code 39 barcodes that I need use to index the documents.
I'm using ZBAR (zbarimg) to process the images and detect the barcode - but I'm only achieving a low success rate (3567 out of 10849 - approx. 32%).
I thought it may be possible to use IM to carryout our some pre-processing to improve the image quality prior to ZBAR attempting to recognise the barcode.
I've checked a number of the images that have failed - and they look to be low quality images with jagged edges etc.
Any help or thoughts on how this could be achieved would appreciated.
Thanks.
I have a large batch of TIF images - each of which contain Code 39 barcodes that I need use to index the documents.
I'm using ZBAR (zbarimg) to process the images and detect the barcode - but I'm only achieving a low success rate (3567 out of 10849 - approx. 32%).
I thought it may be possible to use IM to carryout our some pre-processing to improve the image quality prior to ZBAR attempting to recognise the barcode.
I've checked a number of the images that have failed - and they look to be low quality images with jagged edges etc.
Any help or thoughts on how this could be achieved would appreciated.
Thanks.
Re: Improve poor quality TIF image prior to barcode recognit
I would recomend posting some sample images.
-
keith_rigg
- Posts: 4
- Joined: 2013-06-25T00:36:18-07:00
- Authentication code: 6789
- Contact:
Re: Improve poor quality TIF image prior to barcode recognit
I've posted some examples (cropped to only include the barcode) to my Dropbox account - should allow public access;Bonzo wrote:I would recomend posting some sample images.
https://www.dropbox.com/sh/526dogq322xgir8/NQ9lfyhOus
Thanks.
-
Coscript Consulting
- Posts: 6
- Joined: 2013-06-21T06:43:23-07:00
- Authentication code: 6789
- Location: Philadelphia, PA
- Contact:
Re: Improve poor quality TIF image prior to barcode recognit
You can try to apply motion blur in vertical direction.
convert -motion-blur 10x7+90 4772088.tif 4772088blur.tif
convert -motion-blur 10x7+90 4772088.tif 4772088blur.tif
-
keith_rigg
- Posts: 4
- Joined: 2013-06-25T00:36:18-07:00
- Authentication code: 6789
- Contact:
Re: Improve poor quality TIF image prior to barcode recognit
Thank you - I've tried that and still get 0 out of 7 which is a shame.
I've uploaded the 'converted' images to a sub-folder called "motion-blur".
The original 7 images are in a folder called "Original".
Also - I've done some testing using 'zbarcam' & 'zbarimg' - using 'zbarimg' to process the images, I get 0 out of 7 barcodes.
But by opening the image on-screen, and using 'zbarcam' to scan the image (via a webcam pointing at my monitor) I'm able to recognise 6 out of 7 barcodes.
See following screen shot for further information: https://www.dropbox.com/s/491kwgava8aht ... images.jpg
This seems to suggest enlarging the barcode would help (and maybe cropping the image) as the image is displayed larger on-screen when scanning with the webcam?!?
Any further ideas?
Thanks.
I've uploaded the 'converted' images to a sub-folder called "motion-blur".
The original 7 images are in a folder called "Original".
Also - I've done some testing using 'zbarcam' & 'zbarimg' - using 'zbarimg' to process the images, I get 0 out of 7 barcodes.
But by opening the image on-screen, and using 'zbarcam' to scan the image (via a webcam pointing at my monitor) I'm able to recognise 6 out of 7 barcodes.
See following screen shot for further information: https://www.dropbox.com/s/491kwgava8aht ... images.jpg
This seems to suggest enlarging the barcode would help (and maybe cropping the image) as the image is displayed larger on-screen when scanning with the webcam?!?
Any further ideas?
Thanks.
Re: Improve poor quality TIF image prior to barcode recognit
I'm curious if scaling them up then back down with a specific method http://www.imagemagick.org/Usage/filter/ and/or this http://www.imagemagick.org/Usage/resize ... ive-resize would get you usable results. This is a tricky thing to do with low res images, the old blood from a stone thing.
-
Coscript Consulting
- Posts: 6
- Joined: 2013-06-21T06:43:23-07:00
- Authentication code: 6789
- Location: Philadelphia, PA
- Contact:
Re: Improve poor quality TIF image prior to barcode recognit
Compile the latest development version of ZBAR. It recognizes 6 out of 7 files unmodified.
The last one is recognized after applying some vertical blur
convert -motion-blur 30x30-90 4774438.tif 4774438blur.tif
Please contact me directly if you need further assistance with compiling, scripting, or
custom programming.
The last one is recognized after applying some vertical blur
convert -motion-blur 30x30-90 4774438.tif 4774438blur.tif
Please contact me directly if you need further assistance with compiling, scripting, or
custom programming.
-
keith_rigg
- Posts: 4
- Joined: 2013-06-25T00:36:18-07:00
- Authentication code: 6789
- Contact:
Re: Improve poor quality TIF image prior to barcode recognit
Thank you - could you confirm the version of ZBAR you used?
I'm running what I believe to be the latest release - 0.10
I'm running what I believe to be the latest release - 0.10
-
Coscript Consulting
- Posts: 6
- Joined: 2013-06-21T06:43:23-07:00
- Authentication code: 6789
- Location: Philadelphia, PA
- Contact:
Re: Improve poor quality TIF image prior to barcode recognit
$ ./zbarimg/zbarimg --version
0.10
$ hg tip
changeset: 362:38e78368283d
tag: tip
user: spadix@users.sourceforge.net
date: Sun Oct 14 23:02:08 2012 -0700
summary: Added tag iPhoneSDK-1.3.1 for changeset 5eb3c8786845
I'm running the current development version on 64-bit GNU/Linux.
The version displayed by the program was, probably, not updated.
0.10
$ hg tip
changeset: 362:38e78368283d
tag: tip
user: spadix@users.sourceforge.net
date: Sun Oct 14 23:02:08 2012 -0700
summary: Added tag iPhoneSDK-1.3.1 for changeset 5eb3c8786845
I'm running the current development version on 64-bit GNU/Linux.
The version displayed by the program was, probably, not updated.
Who is online
Users browsing this forum: Google [Bot], Semrush [Bot] and 16 guests