Quantcast
Channel: OpenCV Q&A Forum - RSS feed
Viewing all articles
Browse latest Browse all 41027

Detect boxes on shelf Android OpenCV

$
0
0
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: 1. grayscale 2. bilateral filter (or GaussianBlur, but I've found that using bilateral filter is better to preserve edges) 3. adaptive threshold 4. dilate (don't know if it's necessary) 5. canny 6. 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 ![source](http://i.stack.imgur.com/ykWzK.jpg) 2) [grayscale](http://i.stack.imgur.com/6JjXz.png) 3) [filtered (gaussianBlur in this case)](http://i.stack.imgur.com/rDoaj.png) 4) [adaptive threshold](http://i.stack.imgur.com/ctWsk.png) 5) [dilation](http://i.stack.imgur.com/xxwRn.png) 6) canny ![image description](http://i.stack.imgur.com/OJ7RU.png) 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! **EDIT:** A possible solution to that specific image could be (is really raw in this example cause i've done it manually ;) ): ![image description](/upfiles/14540839289790068.jpg) And this app has to detect boxes and cans possibly, because ithout perspective (i.e. assume that I have images in front of the shelf), cans are viewed as boxes.

Viewing all articles
Browse latest Browse all 41027

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>