Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
I'm currently using Imagemagick to very successfully deskew images. It'd be AMAZING if i could get it to also remove the barcodes fom my images. Below is an example of what the image would look like. In a REALLY ideal world we'd somehow erase everything except the numbers .
I can't use coordinates as these end up all over the place thanks to being fed by ADF.
Tried a few forum posts based around removing vertical lines, but had no luck.
The trick is to remove the barcode without also removing other important detail. In your example, after denoising, the bars are substantially larger than the text, so removing them and not the text is quite easy. But what else do your images contain? How much do bars vary (in size) between images?
If your results are this clean, then average the image down to one column and threshold to locate the darkest region. Then find the top and bottom of that region and composite a white horizontal strip of that height over that section of the original image.
snibgo wrote: ↑2017-12-01T15:17:50-07:00
The trick is to remove the barcode without also removing other important detail. In your example, after denoising, the bars are substantially larger than the text, so removing them and not the text is quite easy. But what else do your images contain? How much do bars vary (in size) between images?
So nothing else on the image really matters. I'm using a UZN file with Tesseract to recognize only this part of the image.
This image should give a pretty good idea of how much the bars vary in size.
fmw42 wrote: ↑2017-12-01T15:30:11-07:00
If your results are this clean, then average the image down to one column and threshold to locate the darkest region. Then find the top and bottom of that region and composite a white horizontal strip of that height over that section of the original image.
They're not QUITE this clean. This is the lower righthand corner of an 8.5x11 sheet of paper. Is it possible to set a boundary on the functions you've listed?
depthless wrote:They're not QUITE this clean. This is the lower righthand corner of an 8.5x11 sheet of paper. Is it possible to set a boundary on the functions you've listed?
Can you be more specific? Boundary on what?
My method requires that you isolate the region where the barcode exists, since it is distinguished by being the darkest contiguous vertical section in the image. So you would have to crop out this region and then process it, then paste it back in. Not much to be gained this way, since you have to crop manually, unless the barcode is in the same region in all images.