Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

CONT'D:straight line detection

Hi again!
I did the hough implementation in C as a dll. Works fast and good i added it to labview by call library function. But still it is not exactly what i want.
The problem is that my images are of different brightness, and only when i threshold them appropriately does the transform work correctly. Otherwise i cant get any useful info from it because most of the points 'vote' for lines passing through them.
I want in my VI not to enter the threshold. I cant also calculate it as % of overall brightness because i can loose the scratch (line) i am looking for.
Do you have any idea how to solve that problem?
For me it seems impossible without supplying the threshold, or improving hardware so that the images acquired are all of similar bri
ghtness and the same threshold can be applied to all.
Thanks,
hope somebody can give some hints, but it looks hard.
Andru (CZ)
0 Kudos
Message 1 of 4
(3,445 Views)
Andru-

Have you already looked into the auto-thresholding algorithms that are available with Vision? The one you want to use is probably AutoThresholdB.vi. It allows you to automatically choose a threshold value based on your choice of statistical methods. For more information on auto thresholding look at the help for this example.

Also I would recommend posting your hough implementation and LabVIEW code as an example program so that others with the same problem can benifit from your work.

Dustin
0 Kudos
Message 2 of 4
(3,445 Views)
Dustin!
Thanx again a lot for your help. I used moments based method for my images. It is the only one that seems to work, but i still had to increase the lower threshold by 4-5 gray levels. Anyway, it seems to work.
As to posting it, i think i could do it, even though i am doing it for the company, but am only working as a trainee. right now i have two solution - one hough based, the other just calculates the particle's max intercept and elongation factor, and judging on that it is possible to determine whether or not it is a scratch(line).
Do you know wwhere i can post my sources? i guess here at ni developer zone.
greetings,
andrew
0 Kudos
Message 3 of 4
(3,445 Views)
No problem- I'm glad it worked out for you. You can submit your code here. Or you can go to NI Developer Zone >> Developer Exchange >> Code Library >> Submit New Example Code.
0 Kudos
Message 4 of 4
(3,445 Views)