Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Make a Line Fit with Vision Assistant for a polynominal function?!

Solved!
Go to solution

Hello

I do have following problem to solve: I do have a laser spot which draws a line (non linear) to a wall. For this line I need to know the (exact) mathematical

function. Therefore I can get an image of the line but I do not know how I can extract the mathematical function with a line fit for example. If I could "convert"

the line into points I would use the line fit function of LabView which should work without problem.

 

Is there a way to solve the problem with the vision assistant or..?

Thanks in advance

 

 

0 Kudos
Message 1 of 7
(4,949 Views)

Hello,

 

is your image grayscale or color?

 

If color (and assuming the laser is red), then extract the green color plane to get a good contrast between the laser pattern and the background. You can then threshold the image (perhaps inside the user specified ROI for greater robustness) and search for non-zero points, reading the coordinates. Then it should be simple to fit a nonlinear curve to the data, like you said.

 

If grayscale, you could perhaps put a bandpass filter (the basic ones are really, really cheap) in front of the camera (centered at the wavelength of the laser) to improve the contrast (this would pass mostly the laser light to your detector). Then use the same procedure as above (threshold and extract the coordinates).

 

Do you need this real-time or post-processing?

 

Best regards,

K

 


https://decibel.ni.com/content/blogs/kl3m3n



"Kudos: Users may give one another Kudos on the forums for posts that they found particularly helpful or insightful."
0 Kudos
Message 2 of 7
(4,946 Views)

Hello Klemen

yes I do have a red laser and the contrast is pretty good. Therefore I do have no problems on the image itself. There is no need to do it in realtime so I simply store the image and process it afterwards.

Could you explain me how do you search the non-zero points and the coresponding coordinates? I did not find a function in the Vision Assistant therefore.

 

thanks for the help..!

 

Norick

 

 

0 Kudos
Message 3 of 7
(4,943 Views)
Solution
Accepted by topic author Norick_17

Hello,

 

after thresholding, this should work:

 

Example_VI_BD.png

 

False case just goes through...

 

Best regards,

K


https://decibel.ni.com/content/blogs/kl3m3n



"Kudos: Users may give one another Kudos on the forums for posts that they found particularly helpful or insightful."
0 Kudos
Message 4 of 7
(4,938 Views)

Hello Klemen

thank you very much for the example - thats the solution for my problem 🙂

 

Norick

0 Kudos
Message 5 of 7
(4,920 Views)

Hi guys

 

I can't test it right now, but I think this information also works for me. I'm working on my own 3D-laser scanner and I'm in the beginning phase where I'm looking which software I can use to realise this. I worked a little bit with Vision so this is my first pick for the detection of the laser line.

 

So it's possible to detect the line and break it down into several points which I can import into calculation software to calculate the coördinates of the line?

 

PS: I'm not that good with Vision/LabVIEW. Still learning

 

Grtz

Ruts

0 Kudos
Message 6 of 7
(4,915 Views)

Hello,

 

by now I have learned that (almost) anything is possible. 🙂 You can achieve this using Labview, Matlab, C++, etc... In any case, getting the coordinates of a single laser line (single laser line - you don't need to find correspondences, as opposed to multi-line projection) should be really simple. If you place an apropriate filter in front of the camera, it is even simpler!

 

If you want proof it can be done (and the description/procedute I used), check out the link in my signature and search for laser scanner posts (I think there is three of them, if I remember correctly). I have made a really cheap scanner (total cost was around 45 eur). The only problem is that it is not fully calibrated. If you want to make precise distance measurements, you need to calibrate it, for example using a body of known shape. There are quite a few calibration methods - search in papers online.

 

Best regards,

K

 

 


https://decibel.ni.com/content/blogs/kl3m3n



"Kudos: Users may give one another Kudos on the forums for posts that they found particularly helpful or insightful."
0 Kudos
Message 7 of 7
(4,906 Views)