What is happening to the HSV filter?

I am working on writing our vision software. I am running opencv on a raspberry pi (which I couldn’t for the life of me install opencv with GTK2 on so am streaming the camera feeds). I am trying to tune my HSV Threshold so that only the targets are visible. I followed the steps described here, but keep running into issues with flickering. One frame the targets are filtered perfectly, then next and ugly blob has overtaken the image.

The issue can be seen here. Please note I only filtered hue values to exaggerate the effect.

My initial thought is that it is caused by flickering of the light. All automatic exposure features have been turned off (as far as I can tell, v4l2 is a bit confusing), which leaves me to think the LEDs aren’t getting the right power. Right now the LEDs are powered from a 4.3 volt wall adapter wired to a converter (image. I don’t have a multimeter at my house, but they appear to be getting enough power (they hum if I crank it up any louder). I am confused because there isn’t a noticeable flickering in the normal image stream (though there is in the HSV colorspace).

What suggestions do you have? If it is a power issue, I will can power it from the VRM at school tomorrow.

OK - put this down as a wild guess, but worth checking out if you don’t have anything better to work with…

One thing I’m noticing is that the door is illuminated green in your third link, which makes me think you’re using green LEDs to illuminate the targets, but the blobs are red, magenta, and yellow, all of which contain red, and the only one of these with green (yellow) is the smallest. My hunch is that somehow the green light is going out, or being flashed in such a way that the camera doesn’t pick it up. Are you running the green light full duty cycle, or are you reducing the intensity through a duty cycle algorithm? If the latter, you may be trying to process frames with no green illumination.

I am not doing anything special to the green LED (that I know of). The third frame is the contours detected by OpenCV, which are set to be different colors (for sorting out the two types). The first frame is the raw image I am getting from the camera. I think the best plan of action is to test with a better power source tomorrow. Thanks for the help.