I would like to see your suggestion about this:
I’m working on an application that recognizes labels on postal items.
Attached below are two sample files. One of them has a white label on a relatively dark background, and the other - a similar white label on a much lighter background.
Currently, I apply a color mask in the range of 200 to 255 for each of the color channels, then a threshold on the resultim and recognize the contours with cv2.findContours(). (i’m skipping the filtering stuff of the found contours, minAreaRect() and so on here)
This approach gives very good results for files with a darker background, but not so good in cases where the background is lighter - then the mask covers a large part of the package, leading to wrong results.
If you look at the file with a light background, it is clear that the label is clearly outlined and visible to the human eye, and I would like to know how to find it with better accuracy.
What would you advise me for a solution that would work on many different photos?
Maybe fine-tuned canny-edge detection or may be deep-learning approach?
Thanks in advance!