devdhruvsingh/open-cv ? reverse-engineered prompt
Reverse engineered prompt
Build me a Python app that can count rice grains from either a photo or a live camera feed. It should show the detected grains clearly on screen, draw boxes around them, and give me the final count in a simple way. I want it to work well with both single grains and grains that are touching, so please include a smarter separation step for overlapping pieces instead of only basic contour detection.
It would be great if the app can also work with my phone camera through DroidCam and with an OBS virtual camera, and if you can make it easy to test on sample rice images too. Please keep the code clean and split the main counting logic, preprocessing, live camera, and image testing into sensible parts. If you need to look up current OpenCV or camera setup details online, go ahead.