Ask Your Question
0

*help* Extracting a laser line

asked 2017-06-06 07:07:16 -0600

mirnyy gravatar image

updated 2017-06-09 09:01:53 -0600

Hello, i have a picture from a laser line and i would like to extract that line out of the image.

Thats the original picture

As the laser line is red, i take the red channel of the image and then searching for the highest intensity in every row:
image description

The problem now is, that there are also some points which doesnt belong to the laser line (if you zoom into the second picture, you can see these points).

Does anyone have an idea for the next steps (to remove the single points and also to extract the lines)?

edit retag flag offensive close merge delete

3 answers

Sort by ยป oldest newest most voted
0

answered 2017-06-09 09:43:13 -0600

clynxi gravatar image

You are correct that the red channel has a high intensity for the red laser line but also everything that is white. To filter for the red you could subtract the green channel from the red channel and you will get much better results. After thresholding you can erode and dilate to get rid of the noise.

edit flag offensive delete link more
0

answered 2019-03-04 20:56:40 -0600

I am working on something else that also requires laser line tracking. Dynamic programming is a pretty good way to solve this problem.

You can play around with my code at:

https://github.com/douglas125/LaserLi...

edit flag offensive delete link more
0

answered 2017-06-12 01:24:15 -0600

Hi,you may try OTSU method to solove the problem. in my code

Mat src = imread("chair.bmp");
vector<Mat> planes;
split(src,planes);
Mat red = planes[2];
Mat temp = planes[2] - planes[0];
threshold(temp,temp,0,255,THRESH_OTSU);
imwrite("reslut.jpg",temp);

the result pic is image description

edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2017-06-06 07:07:16 -0600

Seen: 2,137 times

Last updated: Mar 04 '19