Draw bounding box around transparent bottle
Hi, I am doing a SWM project and I have problems drawing a bounding box around a bottle using morphologyex, canny edge detection, contours and boxpoints.
I have uploaded an image that shows the object I want to draw a bounding box with. The program will run on Raspberry Pi 3 model B, the camera is fixed, it will not be moved, and the background color is lime green. Thanks!
The code I used to draw bounding box is uploaded at github /camproc.py
edit: the problem with the code is that instead of drawing the bounding box around the bottle, it draws a box around random contours like the light coming from outside on the bottom part of the frame, sometimes nothing at all (even adjusting canny threshold and gaussian blur kernel, magnitude, size etc.). I also have tried working with still photos instead of video to no avail. As of now, I'm working with implementing tensorflow within the program. I will train a custom model based from ssdlite_mobilenet COCO with plastic bottles as dataset. I'll use tensorflow to draw the area of detection and calculate the dimensions of the drawn box.
Tensorflow is an alternative solution, but I personally prefer opencv for this as to not hog CPU usage and maintain stable temperature.