Is it possible to develop an image recognition with OpenMV, that it is possible to detect if a bottle is open or closed? Then perform GPIO.
Is there any code example I can check
Yes, this type of thing is exactly what the system is designed to do and make easy. I don’t have an example for your particular request but I can help you through the code.
Can you please explain your setup? What type of bottle you have? How you plan to detect if it’s open or closed?
The bottles are basically of this type,
I want to detect the lack of white cap. In case the garafa is without cover, I activate an output for example.
What is the average processing time for these situations?
Okay, you can do this… Use the find circles method to detect the bottles/caps. Then for each circle ROI use the get statistics method to get the color value of the circular areas. Get statistics will return the average grayscale value if you do all this in grayscale. You just need to threshold the average then and your good. Drive an I/o pin if the average is outside some range.
The code should run about about 7.5 fps at 160x120. If you go to 80x60 you’ll be able to get about 15 fps. You can probably run at 80x60 if there’s only one bottle under the camera at a time. If you really constrain things you can probably do it at 40x30 pixels for 30 fps or above.
Note, you can achieve a lower res by either working on an ROI in the image or shrinking the whole image. Shrinking the whole image will blur things.