Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Inconsistent Caliper (NI Vision) results Assistance mode to VI mode

Hello All,

 

Am new to this forum with some expectation, and contribution! Currently expecting some reasonable explanation or even better if I get to know how to find it ?

 

I am using LabVIEW 8.6 alongwith Machine Vision 8.6

 

I developed image processing algorithm using NI Assistance and built a VI so that it will give caliper results (angle measurements), that will be used for further processing in a VI.

 

When I am in NI Vision Assistant mode, I have angles as :

175.96177.52156.37156.27304.94

When I am using it as VI, I have angles output as :

176.047177.52156.412156.271305.038

 

May I know, why the results differ, even though its the same image ?

 

Awaiting a response. 

 

Thanks and Regards,

Tirthankar De 

 

0 Kudos
Message 1 of 19
(5,381 Views)

Hi Tirthankar De,

 

Most likely these results are due to slightly different values in the VI and the VA Script (especially in edge detection, etc).  Was the VI edited in any way?  I have tried a similar process, and recieved the exact same values in Vision Assistant and the generated LabVIEW VI.

Chris Bolin
LabVIEW Partner Program, CLA
Message 2 of 19
(5,358 Views)

Let me clarify by example.

 

I have attached the results of caliper obtained in NI Vision Assistance on Image - Freak.jpg (2nd image in table below)

 

I have attached the results of caliper obtained when NI Vision Assistance is used as a subVI on the same Image - Freak.jpg (2nd image in table below).

 

The results are distant apart as seen below!

 

ImageVission Assistance as SubVINI Vision Assistance
1176.867176.78
178.838275.96
165.788165.9
164.60961.04
182.301182.74
2343.25177.37
342.202176.78
342.959138.69
345.598138.82
18.892187.02

 

 

Both are same as the NI Vision Assistance creates a subVI using the same script and pattern templates, then why the difference ?

 

Could anyone throw light on this ?

 

Awaiting a reason!

 

Thanks and Regards,

Tirthankar De

0 Kudos
Message 3 of 19
(5,329 Views)
In your Vision Assistant Express VI, are you opening the same Script file as in Vision Assistant?  Could you post that *.scr file, along with the image you are inspecting?
Chris Bolin
LabVIEW Partner Program, CLA
Message 4 of 19
(5,306 Views)

Let me clarify.

 

1] I open a blank VI and move to the Block Diagram.

2] I right click on mouse to get Function menu, from where I browse through Vision and Motion >> Vision Express and select Vision Assistance

3] A VI is placed in the block diagram and the Vision Assistance module opens to give an empty window.

4] I load the algorithm file - 13035767.scr (attached. Also attached is the template used for pattern matching - you may need to specify path for template while using)

5] I load the image under test (Many images attached for reference in Images directory)

6] In Select Controls, I select the output of last block (Caliper 2) - that has all angle measurements.

7] I note down the output (angle measurements) of last block (Caliper 2) and click on Finish.

8] The NI Vision Assistance creates a VI for me to use in my current VI application.

9] I feed same images to the newly created VI and note down the output (Caliper 2) while in SubVI.

10] On comparision of results, I find them to be not matching (inconsistency) with each other (Step 9 and 7).

 

May I know the reason for this (Step 10) ? 

 

Attachment: 1] SCR file, 2] Images, 3] Template Image (Pattern matching)

 

 

Awaiting your response.

 

 

Thanks and Regards,

Tirthankar De

 

0 Kudos
Message 5 of 19
(5,301 Views)

ADDENUM:

 

Let say we save the blank VI (not so blank after step 9) as A.vi and later use it (A.vi) in another VI as a SubVI the results go haywire!

A.vi has following terminals defined:

Terminal 1] Input string (command instruction of test scenario)

Terminal 2] Output string (automated test result comments)

Terminal 3] Output boolean (pass/fail status)

 

Also there are logics which interpret the string and perform actions:

1] Interpret on which gauge to perform reading.

2] Prompt user to select image (as am currently developing the base logic before integrating with actual camera).

3] Feed image to the SubVI created by Vision Assistance using the algorithm attached earlier.

4] Get angle mesurements as output of the SubVI and then interpret for position of gauge and compare with set value.

5] Output test comments and result (pass/fail).

 

Let me know if you need more details or if am not making sense.

 

Thanks and Regards,

Tirthankar De

0 Kudos
Message 6 of 19
(5,294 Views)

Hi Tirthankar De!

 

 

Thank you for the files.  I have tried the VA script, and I do see a small discrepency between the LabVIEW Express VI and the VA environment.

 

My error was less than 0.4%; which image produced the drastic difference you were seeing?

 

 


Vision Assistant LabVIEW calling VA Express VI % Error
Angle 3 Points (6,10,7) 177.52 177.47 0.028%
Angle 3 Points (8,10,9) 179.81 179.81 0.000%
Angle/Horizontal (10,6) 172.26 172.21 0.029%
Angle/Horizontal (10,8) 171.99 171.99 0.000%
Angle 3 Points (11,12,10) 180.87 180.23 0.355%
Chris Bolin
LabVIEW Partner Program, CLA
Message 7 of 19
(5,269 Views)
Hi Chris! Thanks for your response. So I guess the subtle difference still exists! Is this subtle difference valid or is it an anomaly of NI Vision which I have to live with?  I have deduced for the drastic differences and come up with two scenarios, with one as solved! Scenario-1] The Image under test is given to IMAQ Dispose VI and as well to the Vision Assistant VI. So who gets the Image first is not determined, hence chances of the Image being destroyed before the Vision can complete its process is higher.Solution: Connect Image out of Vision Assistant VI to IMAQ Dispose, or in short connect Image to IMAQ Dispose when done with Image!

Attachment: For visual understanding have attached a zip file (Scenario01.zip) containing TestSubVI.PNG and PortionOfVisionSubVI.PNG.

Conclusion: This was a mistake on my part!

 Scenario-2] The Vision Assistant is unable to get a match in the Image, so caliper unable able to determine some measurements. When LabVIEW calling VA Express VI, its able to give all measurements but is significantly different.For illustration purpose I have attached the VA script, 5 images and also the Template Image used for pattern matching.

Variations between Vision Assistant and LabVIEW calling VA Express VI is also attached.

Attachment: I have attached a zip file (Scenario01.zip) containing VAScript.scr, all pictures in "Pictures" folder, FuelLevelCenter.png and Differences.PNG.

Conclusion: This is still unsolved!!

 

Awaiting a response. Thanks and Regards,Tirthankar De 

 

Message Edited by Imagineer on 12-04-2008 12:18 PM
Download All
0 Kudos
Message 8 of 19
(5,257 Views)

Hi Tirthankar,

 

I was able to reproduce your results exactly.  I will keep looking into this and see what i can find.  If you could test a few things, that would be great.

 

The current script has many different functions: Rake, Set Coordinate System, LUT, Gray Morphology, Pattern Matching, and Caliper.  Does this discrepancy happen when some of these functions are not used?  Does it seem to follow a specific function

Chris Bolin
LabVIEW Partner Program, CLA
Message 9 of 19
(5,235 Views)

Hi Tirthankar De,

 

Our Vision R&D team is looking at this now.  I will update you as soon as I have any more information.

 

Thanks so much for all your troubleshooting!

Chris Bolin
LabVIEW Partner Program, CLA
Message 10 of 19
(5,170 Views)