Distinguishing between white and luminous objects
Hi,
Update: Sample Image -
=============
I am trying to detect moving white LEDs (non-blinking, always ON) but am having some difficulties when it comes to distinguishing the LEDs from a white object of similar size. The issue is that some of the LEDs appear smaller than the other's (due to varying distances from the camera) and hence making it hard to distinguish them from random white specks.
I did attempt to use sparse optical flow but the issue is with drone's jerky movement, the optical flow tracking loses the points easily.
My current thresholding method: I am currently using simple HSV based thresholding followed by erosion/dilation to detect the LEDs and then fit a contour + bounding rectangle around it.
My question: Is there some colour space (something like LAB perhaps as seen in this tutorial ?) that allows one to distinguish between white coloured and luminous objects ?
Your problem sounds interesting enough. Did you know that in HSV mode, white pixels have a red hue by default? Perhaps you need to differentiate between an almost white with a blue hue, and white with a red hue.
do you have some sample images so we can see what you mean (for example if leds are saturated)
Hi, thanks for replying, I have updated the question with sample images. My main issue is avoiding clutter gets harder as LEDs are at varying distances from the camera.
Hi, thanks for replying, I have updated the question with sample images. My main issue is avoiding random white specks gets harder as LEDs are at varying distances (and hence some appear smaller) to the camera.
1st reduce shutter time or close diafragma so image gets a lot darker (the white background is almost saturated) 2nd look for the 4 most brightest spots (combination V and Blue)
If you have the skills replace the white leds for IR leds and put IR fiter in front of the camera (possible need to remove ir cut-off filter from the camera)
Hi,
My experiment is using LED in visible spectrum, IR leds would have been easy to detect (although I dont see much support in openCV for that ). And how can I reduce shutter time ? These are network/IP cameras.
Hello, did anyone find a decent solution for this ? I tried using sparse optical flow on the HSV thresholded image, but it gives quite poor results as it only tracks corners very well. I also tried a few other thigns like image histogram equalization ... but they didnt work either.
can you close the diafragma more ? And then add the darker images to the question. The problem you have now is saturation of the leds.
If you want to do it the lazy way use threshold (252,252,252) on the BGR image.
Hi, I would prefer a more robust solution .... I thought this would have been a common problem, but seems that is not the case...