Tracking by chroma in varying light conditions
I've been working with openCV to try to track a green ring. Basically I convert to HSV space, pyramid down twice, blur, then split the channels and equalize the V. Then I merge the channels, set upper and lower bounds for each channel and do an in-range. From there I do some circle detection using a simple Blob detector. All I'm after is the center of this ring as it moves around so I just want that keypoint.
What I find is it works great if I adjust the upper and lower bounds at my desk. Even if I turn off my light or shine a flashlight on it. But then I go out in the hallway under different light and it doesn't work. I can of course adjust it to get it to work.
Am I going about this the wrong way? I was thinking of next trying to run detection at different preset ranges, or a sliding window of ranges to find my circle.
Edit: Adding picture for clarity Tube
How about widening the range of the H-component? Have you checked what H values you get in the hallway (and at your desk) or you just assumed it to be 60+-10 or 15?
I should have recorded the values. I set sliders for everything so I can adjust the range of H and S (and V if I want) and usually get a good result. The problem is then I get too much in my image and my circle detection fails. I realize I have a lot to learn about this.
It would be much easier to give you some hints if you posted some pictures where you want to detect the ring.
Sure I should have done that before. I added to my question up top. This is my tube, depending on the length of the tube you might see light through it like this, or it might be fairly dark in the center. Thank you for your help!