Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I get "IMAQ Line Fit" stable (with the same points)

How can I get "IMAQ Line Fit" stable (with the same points)


I my vision applications I use a lot off times "IMAQ Line Fit"
some times the results are not Stable.


See vi and word document attached.

 

When I take the same points but in a other order (sort)
then suddenly all points are used.


In this case I was looking for a edge in vertical direction (Y).
I found the points but "IMAQ Line Fit" did not function well.
I tried changing all settings like pixel radius and minimum score and
also threshold and so on. But no result.
Then I sorted the points reversed and that worked. See vi.

 

I use labview Labview 8.6.0 and IMAQ machine vision.

 

Maybe this problem is solved in a newer version.

 

Please let me know.

 

Thanks

Download All
0 Kudos
Message 1 of 12
(4,915 Views)

A other sample off How can I get "IMAQ Line Fit" stable (with the same 5 points , one outlier !!)

 

I my vision applications I use a lot off times "IMAQ Line Fit"
some times the results are not Stable.


See vi and word document attached.


There are only 5 points used from my application.
 

When I take the same points but in a other order (sort)
then suddenly all points are used.


In this case I was looking for a edge in vertical direction (X).
I found the points but "IMAQ Line Fit" did not function well.
I tried changing all settings like pixel radius and minimum score and
also threshold and so on.
with pixel radius i got different results (not all good !!)
Then I sorted the points another way and that worked. See vi.

 

I use labview Labview 8.6.0 and IMAQ machine vision.

 

Maybe this problem is solved in a newer version.


Please let me know.

 

Thanks

0 Kudos
Message 2 of 12
(4,866 Views)
There are too many noisy points and not enought points that lie along the actual line. Reducing the pixel radius input to 5 or below will reduce the number of noisy points and allow IMAQ Fit Line to fit the line.That is why you need to choose higher value for the Pixel radius (In your case higher than 100) to include every noisy points to drow a correct line.I checked your vi. If you remove the "reverse 1D array" after "sort 1D array" in the case structure for "sort X reverse?"then you don't need turn the "sort X reverse?"on to get the line. You just need to optimize the pixel redius.See the attachments   
0 Kudos
Message 3 of 12
(4,819 Views)

Thank You for your reaction Hossein,

 

This "one application" uses "Line fit" about 20 000 000 times a day.

about 200 will go wrong. With your setting the the "Line fit" for this occasion will work but others will go wrong.

 

A algorithm should be:

1e Stable, when using the same points and settings the result MUST be the same. How the points are sorted should not matter.

2e Accuracy

3e Speed

4e Testing. Is very difficult but al least close points and the same points and sorting ... should be done

 

 

NI now as made a " IMAQ Line Fit" Problem CAR (Corrective Action request) 298016.

so in the future there will be a update.

 

In the mean while a made a line fit which uses Bisquare option from Linear Fit.vi :

 

  from C:\Program Files\National Instruments\LabVIEW 8.6\vi.lib\analysis\6fits.llb

 

This is a temporary fix because "IMAQ Fit Line VI" is not so stable.
Because outliers should be rejected only Bisquare does this reasonable.
This program does NOT USE "Minimum Score" and "Pixel Radius"
Valid fit = When there are enough points within Outlier_Distance.
Algorithm steps:
- Determine if line is more horizontal then vertical, Compare DeltaX with DeltaY
- If DeltaX <= DeltaY then SWAP X Y and later Swap back
- Sort Points at on X value
- First : Bisquare Linear Fit
- Calculate distances to the found line for all points
- Inliers: Points within Outlier_distance
- Outliers: Points outside Outlier_Distance
- Only use Inlier Points
- Check again if DeltaX < DeltaY then SWAP X Y later SWAP back again
- Second : Bisquare Linear Fit only with the Inlier Points
- Results are from the second fit
Warning : This Program is Not so accurate and Not so fast

 

See attachments it is in labview 8.6

 

If some has a improvement please let me know.

 

Thanks

 

 

 

 

 

 

Download All
0 Kudos
Message 4 of 12
(4,800 Views)

Hello,

 

As you mentioned in your feedback, this problem is solved in LabVIEW 2010 SP1 which is explained in the CAR that you gave it to me. Last month we released the 2011 version of LabVIEW with more stability and functionality. To make your system stronger and more powerful we advise you to upgrade your system to version 2011. With this version beside solving your problem you prevent happening another problems which maybe will happened in the future.

 

Good luck

 

Beste regards,

 

Hossein

0 Kudos
Message 5 of 12
(4,785 Views)

Thank You for your reaction Hossein,

 

But I did not mention that the problem is solved.

There is a CAR (298016) for this problem but till now it is not solved.

 

For bug fixes 2010: https://www.ni.com/en/support/documentation/bugs/10/archived--labview-2010-bug-fixes.html

For bug fixes 2011: https://www.ni.com/en/support/documentation/bugs/11/archived--labview-2011-bug-fixes.html

 

Maybe you saw it somewhere then please let me know.

 

Kind Regards,

Toine Roetman

0 Kudos
Message 6 of 12
(4,779 Views)

You are correct. You didn't mentioned that the problem is solved in CAR 298016 but I have an access to this CAR and I could see that this bug is fixed in LabVIIEW 2010 SP1.

Besides I tested your vi with LabVIEW 2010 and 2011 both and it seems to work. You could check and test your vi by going to link below and download the evaluation version of new version of LabVIEW for free.

https://www.ni.com/en/support/downloads/software-products/download.labview.html

 

I hope that it will be useful.

 

Best regards,

 

Hossein

 

0 Kudos
Message 7 of 12
(4,770 Views)

Thanks Hossein,

 

I can not find anywhere this CAR is solved. I did not have mail from NI that it is solved so :

Please send me the link.

I tried "IMAQ Line Fit" in labview 2010 SP1 and it still has the same problem.

So please send me the vi from 2010 SP1 from you use.

 

With Kind Regards,

Toine Roetman

0 Kudos
Message 8 of 12
(4,759 Views)

Hi Toine,

 

I used your vi's that you posted before and I attached them below with estra TEST.vi. I made that TEST.vi to itrate your vi more than 300 times and you can runhowmany you will. If you want you can send me all your vi's that you tested with LV2010 that I can check it for you too. 

The Link of that CAR is just for the NI employees and I think that you don't have an access to it. But its link is given below.

 

http://nippm.natinst.com/itg/web/knta/crt/RequestDetail.jsp?REQUEST_ID=298016

 

Good luck and hear from you.

 

Regards,

 

Hossein

Download All
0 Kudos
Message 9 of 12
(4,755 Views)

Hi Hossein,

 

I tested labview2010 sp1 with the vi's a attached.

The "IMAQ Line Fit" is still NOT STABLE (with the same points).

In fact there is no change at all.

 

I do not have access to the link you posted

I think the Cold-war is over so please copy the text from the link here so everyone can read it.

 

With kind regards,

Toine Roetman

 

 

 

0 Kudos
Message 10 of 12
(4,745 Views)