I have been asked to recognize a barcode like the attached, which is an ITF code with a red vertical line at the start and end. It has been suggested that making a modified binarizer that treats red and black differently may be a workable way to approach this.
Has anyone made a binarizer that finds only black, or filters out colour components of an image? Thanks in advance for any help you can give me in solving this problem.
Thanks.
Neal
You could try to adjust the minimum 'quiet space' :
https://github.com/zxing/zxing/blob/master/core/src/main/java/com/google/zxing/oned/ITFReader.java#L213
'removing' the red line can be done in this section :
https://github.com/zxing/zxing/blob/master/core/src/main/java/com/google/zxing/RGBLuminanceSource.java#L44
Check if you have a 'reddish' color and in that case replace it with a white color.
Thanks. I was able to improve recognition by preprocessing the YUV frames and adding the U channel to the Y channel, increasing the brightness of the Red areas of the image.
Seems to help a lot. Thanks for the hints.
Neal