UPC scanning

Well, I’ve finished with the easy bit. I’ve written code to grab a frame from the webcam and do a bit of postprocessing. The postprocessing looks like a good step towards making barcode recognition easier. I’m only working on this at nights so far, so I figure coping with the poor lighting I have in my study bodes well for the future.

Here’s a webcam grab:
barcode_colour
Here’s the same grab, converted to greyscale:
barcode_grey
Here’s the same grab, with the output range normalized (and the colour histogram biased by about 20 to get rid of the low frequency colours at the extrema):
barcode_greypostprocess
Note: these images are cropped from larger images, so if you look at the histogram you probably won’t see the same thing I’m seeing.

Now for the hard part: writing the code to recognise the barcode.

Leave a comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.