Hi all, i'll repost here a question posted on StackOverflow (without real responses), I'll hope i'll be luckier here!
I'm developing an Android app that recognizes, from a store shelf image, all the boxes (products) present on the shelf.
My approach so far is the following:
- grayscale
- bilateral filter (or GaussianBlur, but I've found that using bilateral filter is better to preserve edges)
- adaptive threshold
- dilate (don't know if it's necessary)
- canny
- findContours
So, if the source image is simple, (like a b/w drawing of a shelf and some boxes) it can detect them, but with real images of shelves it isn't working.
The main problem is that single boxes have different "foreground" colors and logos, and my steps detect also all the edges of the "inner" box (i.e., the colours inside the edges of the box) and gives me totally nosense results. For simplicity I'll show belows my intermediate results and the source image:
1) source
2) grayscale
3) filtered (gaussianBlur in this case)
4) adaptive threshold
5) dilation
6) canny
As you can see, because I cannot remove the foreground of each box, also all the edges given by the logos or text come into play and noises my results.
How can I overcome this problem?
My ony idea is trying to "remove" or decolouring the inner boxes, but i don't konw how to do it! Thanks to all!
P.S. please don't reply with links relative to the already tried tutorials found on this website. They didn't helped me solving the probem. Thanks!