Laser pointer ideas?
Good day,
With the help of google and knowledgeable people on this forum I have managed to slap together a crude laser pointer detection script (Thank You). The code I used can be found here.
However, I currently have a 3000mW red laser whose pointer gets picked up by the script easily around maximum 2 meters (6 feet). Beyond that I can still see the pointer on the image (diameter is smaller) but the script does not pick it up. I used an image manipulation program to get the pixels from the image. At distances greater than 2 meters the pixels are a brownish colour (#5d4c3f and #4a4031).
Either I have to hack the code or alternatively I''ll need to get a laser bright enough whose pointer can be picked up to at least 10 meters. However the only laser pointers I can get my hands on are 3000mW.
Any suggestions?
The first pic is one meter away.
You can see the laser dot against the wall near the center of the pic. That is about 4 meters away.
Here is a pic of the green laser pointer:
some example images?
I added pics. Thank you
Normally the pointer is much brighter than the background, so it should be possible to detect it. In fact the problem with the second image is that it's out of focus, so the point is spread into a brown patch. Try to take again the photo with correct focus. Maybe add a bit of brightness.
After a few day's search I found a green laser pointer which is much brighter then the red one. I added a pic for you to see. However I cannot seem to figure out the correct HSV values to recognize the green pointer.
Those 3 pics cannot used daylight using webcam. I recommend used .IR camera similar Raspberry NOIR camera.
@supra56 The daylight has a strong infrared component, so using an IR camera won't help. You need a SWIR (short wave infrared) camera to eliminate the daylight - but it's very expensive. @Danny_00 The green laser looks bright enough. And the image is clear - that's what I've been talking about.
@supra56 I just looked up prices for SWIR cameras and they ARE expensive. I did however manage to "detect" the green of the laser fairly accurately with the lower and upper values at distances up to 30 meters (60ft) but there are still some false detection. Thank you for helping me. I appreciate it.
You can use a Harris detector or a high pass filter to detect a point (and eliminate the other green zones).
If you are thresholding the dot detection for brightness, shape roundness and of a small area, and have an IR bandpass setup, should be well on your way towards where you want to go. You may want to try modifying the IR/visible laser pointer's dot by these factors: blob detectcircular blob detect You are on the right track now find the features that create a software filter and hone your hardware as mentioned above. Whatever hardware you use to filter is best as it wont cost any more CPU cycles.
Thank you @kbarni and @superfly .