Ask Your Question

Laser pointer in C++

asked 2020-11-10 08:28:09 -0500

iseta gravatar image

Hello, I've been having a bit of trouble finding tutorials on developing a Laser Pointer with C++, if anyone could help me and point me in the right direction. I've found some tutorials and repos on GitHub, but using Python. I wanted to develop using C++ because I want to implement it with Unity3D.

Basically, I want the OpenCV to detect a red laser dot and return its center position. Thanks a lot!

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2020-11-12 07:21:58 -0500

crackwitz gravatar image

this requires a strong laser pointer or a dark room. if you don't have that, the problem becomes harder.

binarize the picture. you can use simple thresholding on the grayscale picture.

then you calculate moments (cv::moments). the centroid of your blob would be the point (m10/m00, m01/m00)

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2020-11-10 08:28:09 -0500

Seen: 115 times

Last updated: Nov 12 '20