Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

VBAI failed calculation

I'm trying to calculate the (x,y) position of points on a given image.  So far I've been able to find the values of a fixed amount of points, using the 'Calculator' function.
 
  Ex.  The program is configured to find and display 6 (x,y) coordinates, for 6 dots.
 
The problem is when there are less than 6 dots.  If this occurs, then none of the values are displayed to the screen at the end of the inspection.
 
  Ex. There are 3 dots, 6 (x,y) values are displayed, but all read 0's
 
It would be acceptable if there were 3 values that were correctly printed in this case, and the rest were 0's... but I have been unable to accomplish this.  This is one instance where I've found VBAI to be some what limited in its features (granted I am using a trial version).  I understand that VBAI code can be exported into LabVIEW for further development, but I was curious if anyone knew how to get around this problem, with only a VBAI application?

Message Edited by systems_eng on 06-20-2006 06:00 PM

0 Kudos
Message 1 of 8
(4,146 Views)

System,

Thanks for your post.  There are several ways to calculate the postion of a particle in Vision Builder.  I am a little confused as to the probelm you are seeing.  Could you please post your VBAI script as well as a couple of screen shots detailing the problem?

Thanks,

Scott Savage
National Instruments
Applications Engineering
www.ni.com/support

0 Kudos
Message 2 of 8
(4,127 Views)
I'm not entirely sure how to add an inspection file.  When I went to refrence the project, all I found was this folder in my program files > vision builder > products folder, with the following contents:

<<Inspect.bin>>
<<13310691.vi>>
<<13055506.png>>
<<info.txt>>
 
I'm not sure if you can look at my project from these files, or if  you need more.  I also added a screen shot that helps demonstrate my problem when I got to display the values.  (The inspection is programmed to find and display the coordinates of 6 bright dots.  When there are less than 6 dots detected, all the values are displayed as 0's).
 
Thanks for the Help.
 
 
Download All
0 Kudos
Message 3 of 8
(4,123 Views)
Systems,
 
Thanks for replying.  Exporting the VBAI script is not very straight forward.  Goto File>>Open and select the inspection in question from the pop up box.  In that same box, there is a "Tools" option in the top right hand corner.  Select Tools>>Export Inspection.  Then follow the same procedure to attach to the Dev Zone post.
 
Also, take a few more screen shots of the cases when you have more than 2 dots.  From what I have here, it looks like you have a program that locates 2 dots, but I do not see an image or the case when it works (ie finds the 6 dots you described earlier).  To make sure we are still on the same page, could you take a couple screen shots and put them in word and add some descripts for each?  If the shot is not very obvious as to the bug you are seeing, please use Autoshapes in word to circle the areas you are concerned with.  I can look at the documents (and show them to R&D) with the script to determine and reproduce the error on our end.  Then I will be able to tell you when to change in the script or if it is a bug our developers need to address.
 
Thanks,
 
Scott Savage
National Instruments
Applications Engineering
0 Kudos
Message 4 of 8
(4,101 Views)
Okay, so I created a detailed word document that goes through some of the problems that I'm seeing, I hope I described the problem well enough.  As for exporting the project, I followed your directions, but it exported the same files as before:

(inspect.bin, 13310691.vi, 13055506.png, info.txt)
 
So, I'll leave you with this problem description report.  Thanks again.
0 Kudos
Message 5 of 8
(4,091 Views)
Systems,
 
Thanks again for your reply.  This word document is very complete!!  Thanks for taking the time to document what you are seeing.  Now I understand what you were experiencing.  It looks like VBAI may be incorrectly storing results in memory when it doesn't find all of the points (all 6 dots).  This is not a know issue to the best of my knowledge, but I will get in touch with R&D as soon as possible and see what they say.  To recreate the running program for them, I may need a JPG of the 6 dots senerio since I do not have the same setup as you.  I'll let you know what I find out.
 
Thanks,
 
Scott Savage
National Instruments
Applications Engineering
0 Kudos
Message 6 of 8
(4,078 Views)
Thanks for the input.  Here's the image that i'm currently using.
 
 
0 Kudos
Message 7 of 8
(4,069 Views)
System,

I managed to track down one of developers on our R&D team.  The behavior you are seeing is expected behavior for VBAI.  If the calculate step expects 12 inputs and you only give it 6 or less, then it will not run and simply output the default values for all the outputs.  If there are less than six points, then you would need to set the options to have the pattern step fail for that instance, and make another step to handle other cases.

By the way, the latest version of VBAI allows you to overcome all of these difficulties.  I can't say any more but be on the look out soon :).

Thanks,

Scott Savage
National Instruments
Applications Engineering
www.ni.com/support

0 Kudos
Message 8 of 8
(4,027 Views)