Closed leirn closed 9 years ago
After several tests, it works for the second image using EAN13Speed: false.
It still fails for the third image above. I am using the code : DecodeWorker.postMessage({ImageData: ctx.getImageData(0,0,Canvas.width,Canvas.height).data, Width: Canvas.width, Height: Canvas.height, cmd: "normal", DecodeNr:1, Decode: ["EAN-13"], Ean13Speed:false});
Canvas has the size of the image.
It even works for image below.
Yeah with Ean13Speed on it's less accurate so that's no surprise as for why it doesn't work for the third image I actually know the reason.
It's because of a little defect in the search algorithm I haven't been able to correct, the defect makes it impossible to detect barcodes in the lowest 10 or 5% of the image. So since the third image has a great height and the barcode is at the bottom it won't work.
Thank your for this rapid answer.
I am trying to find a way to make it work anyway. If it is because the barcode is to close to the bottom of the image, why not increase the canva size with something like that :
Canvas.width=Math.floor($("#picture").width() * 1.2); Canvas.height=Math.floor($("#picture").height() * 1.2); // to avoid the issue where it cant find bar in 10% bottom of image ctx.fillStyle="#FFFFFF"; ctx.fillRect(0,0,Canvas.width,Canvas.height); ctx.drawImage(showPicture,0,0,$("#picture").width(),$("#picture").height());
Unfortunatly it's worst. It still works with the 2 smaller one, break the fourth one and still not works with the third one.
Should we make it work, it could be worth including the hack directly in your file ?
Hi,
I also experienced problems with "real world" mobile device photos of barcodes (EAN-13).
The problems seems to be, that the print on this battery is the same color/contrast as the barcode. If I place the barcode on the edge, so the print on the right is not visible anymore, the decoding works.
Yep, it's because of the search algorithm. Tested it with a new algorithm I've been working on and it was no problem. The current one isn't that great, can't find barcodes around the lower 1/8 or 1/10 of the picture for example.
@EddieLa I already took a deeper look into your algorithm and tried to understand it in detail. Is there a communication channel (E-Mail, etc.) where I can ask you some questions about it? For my master's thesis I am analyzing some algorithms. A little help would be awesome :)
Sure I can try to answer some questions depending on available time, just send an email to eddie.larsson245@gmail.com and I'll try to answer as fast as possible.
@EddieLa when do you plan to release the library with the new search algorithm? I'm experiencing the issue with failing to find barcode in real world images as posted by @BobbyJay
Hard to say, it all depends on if I actually can make it faster without sacrificing too much accuracy. Right now it's intolerably slow.
I see @EddieLa . Could you please describe how the library works at the moment, and the new search algorithm? Conceptually that is! (I'm having a hard time understanding the source code)
With the three samples below, BarcodeReader only works with the first one. The two others failed. While I was expected that for the third one, I am surprised for the second one.
Note that the three are detected correctly by this online decoder : http://online-barcode-reader.inliteresearch.com/
Can it evolve to work with the three cases ?