Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Set ROI dimensions dynamicaly in VBAI

Solved!
Go to solution

Is there a way to set the ROI dimensions dynamically (ie, using the calculator or Set Variable step) in VBAI without any additional software license and/or scripting?

 

Using an integer variable calculated in an earlier step, I'd like to change the width of the ROI to match that integer value before the ROI is used in a latter step for another inspection.

0 Kudos
Message 1 of 5
(4,704 Views)

Check out the ROI step (at the bottom of the second palette). This is exactly what this step is meant for and then you can use the produced ROI in any sunsequent step.

0 Kudos
Message 2 of 5
(4,699 Views)

Thanks for the reply....

 

I haven't been able to figure out a way to feed variables into that ROI.  Once I define it, I haven't been able to figure out how to change the shape during runtime based on variables.

 

For example... if I create a Circle ROI, and then I want to use a calculated X variable and calculated Y variable from earlier to determine the Width (x) and Height (y) of the ROI before I use that ROI in the next step for a different inspection tool.

0 Kudos
Message 3 of 5
(4,688 Views)
Solution
Accepted by topic author bjk10

Hi bjk10,

 

Once you've created a Create Region of Interest step, go to the coordinates tab. You'll see that you can enter a numerical value for the different measurements, but if you use the drop-down menu you can also select measurements from previous steps.  For example, I had a Find Edges step before creating my ROI, so I have an option "Find Edges 1 - Find Edge[1].X Position (Pixel)". If you want to base your ROI on previous measurements, just make sure you set up those steps first so you have these options to select from.

 

I hope this helps!

Emily C
Applications Engineer
National Instruments
0 Kudos
Message 4 of 5
(4,677 Views)

Emily-C,

 

I see it now.  Thanks.

0 Kudos
Message 5 of 5
(4,672 Views)