Laser pointer ideas?

asked 2020-07-06 03:16:19 -0600

Danny_00 gravatar image

updated 2020-07-12 04:56:24 -0600

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.

image description

You can see the laser dot against the wall near the center of the pic. That is about 4 meters away.

image description

Here is a pic of the green laser pointer:

image description

edit retag flag offensive close merge delete

Comments

some example images?

kbarni gravatar imagekbarni ( 2020-07-06 04:24:25 -0600 )edit

I added pics. Thank you

Danny_00 gravatar imageDanny_00 ( 2020-07-06 05:16:23 -0600 )edit

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.

kbarni gravatar imagekbarni ( 2020-07-06 09:35:14 -0600 )edit

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.

Danny_00 gravatar imageDanny_00 ( 2020-07-12 04:54:48 -0600 )edit

Those 3 pics cannot used daylight using webcam. I recommend used .IR camera similar Raspberry NOIR camera.

supra56 gravatar imagesupra56 ( 2020-07-12 05:12:02 -0600 )edit

@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.

kbarni gravatar imagekbarni ( 2020-07-12 14:44:21 -0600 )edit

@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.

Danny_00 gravatar imageDanny_00 ( 2020-07-13 00:49:29 -0600 )edit

You can use a Harris detector or a high pass filter to detect a point (and eliminate the other green zones).

kbarni gravatar imagekbarni ( 2020-07-13 04:52:00 -0600 )edit

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.

superfly gravatar imagesuperfly ( 2020-07-13 09:33:28 -0600 )edit

Thank you @kbarni and @superfly .

Danny_00 gravatar imageDanny_00 ( 2020-07-14 06:19:27 -0600 )edit