Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with VIs exported from Vision Assistant

Hi guys
I have noticed a behavior of VIs exported from Vision Assistant, which I consider a bug. I've experienced the problem with the "Edge Detector" step, but maybe there are others that do the same thing. The output of the Edge Detector can be multiple points - from each processed image a different number of them. Vision Assistant assigns an index to each of the evaluated points, which can later be used in the Caliper step. However, if you add another (maybe different) evaluating step after Edge Detector, these points have indices which are not fixed from image to image. Instead, the indices depend on the number of points evaluated by the first Edge Detector step. So, with each processed image, there is a shift in the point indexing, which could cause a problem in the Caliper step. On one hand, this shift is correctly handled in Vision Assistant itself. On the other one, it is not correctly handled in the exported VIs. The Caliper step (exported as IVA Caliper Sub-VI.vi) always uses fixed point indices for its computations, which causes a bad problem when the indexing changes. I think the best way to overcome this problem would be using a modified version of the usual IVA Add Point Array to Point Array.vi in the exported VIs. This VI would have a new parameter to exactly set the number of points to add to the point array, so that the indexing in the resulting array will always remain the same.
So, is this a bug or a feature? Smiley Tongue
 
Vladimir

View my profile on LinkedIn
0 Kudos
Message 1 of 4
(3,174 Views)
Hello Vladimir,

Thank you for using National Instruments Discussion Forums.  I have been able to reproduce the behavior you are describing when using multiple "Edge Detector" steps followed by a caliper measurement.  You are correct if you use an image other then the one you used to develop your script in Vision Assistant the indices will most likely be off since they are coded into the "Caliper" VI as constants when you have Vision Assistant generate code.  This is not necessarily a "BUG" though this is just a limitation of the code generation to interpret exactly what you would like it to do.  Vision Assistant trys to generate code in the most efficient way according to the current script you have developed.  It does not know that you could be using different detected edge points it just looks at the current points found on the current image you are using.  You could use a modified "IVA Add Point to Point Array.vi" that would allow you to set how many points have to be inserted each time but then the question becomes what do you put in the elements in the array that do not have detected edge points associated with them.  Adding zeros or garbage could result in a very confusing point array.  Instead we leave it up to you to code this functionality in.  Vision Assistant is meant as a starting point not a final application.  Some ideas of things you could do would be to use two point arrays so that way you know that the number of points detected in one point array will not effect the other point array.  If you did use one point array you could use an "Array Size.vi" to determine the number of points that are returned for each "Edge Detector" step and incorporate that into how the caliper measurement indexes the point array.  I hope this information helps.  Thank you very much for the feedback.  Have a great day.

Regards,
Mark T
Applications Engineer
National Instruments

Message 2 of 4
(3,153 Views)

Hello Mark

Maybe you are right that it is better to leave this problem in its current state. However, it would be nice to put a comment into the generated VIs next to the Caliper step, which would say that the indices might be shifted when a different image is being processed. I spent a couple of hours tracking this problem down, and other people might do as well.

Vladimir


View my profile on LinkedIn
0 Kudos
Message 3 of 4
(3,148 Views)
Hello Vladimir,

I agree that this can make it confusing and could potentially cause some major issues with applications if someone is unaware of how Vision Assistant generates the code.  I think you have a great suggestion for improving the documentation of Vision Assistant.  I am going to go ahead and make an internal product suggestion regarding this issue and I encourage you to make one as well.  You can go to the following link to make a suggestion so we can continue to improve upon all of our great software products.  Thank you so much for the feedback.  Have a great day.

Product Suggestion Center

Regards,
Mark T
Applications Engineer
National Instruments
0 Kudos
Message 4 of 4
(3,141 Views)