Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Is it possible to dynamically adjust the ROI with the mouse during run time?

I have numerous ROI's for different inspection areas.  My customer would like to change the size and position of the various ROI's using the mouse or touchscreen.  Currently, it is quite cumbersome with all of the "Left Right Top Bottom" ROI controls.  PLease help if you have a solution.

 

THANKS!

0 Kudos
Message 1 of 6
(3,550 Views)

I don't really understand the question.  Have you tried using the mouse to grab the corners of the ROI and adjust them?  That is the easiest way.  If you move to the center of the ROI, you can move the whole thing .

 

You might need to select a valid ROI edit tool before being able to edit.

 

You can also draw a new ROI, but that eliminates all existing ROIs unless you hold down a modifier key (shift? Ctrl?  Don't remember...)

 

Bruce

Bruce Ammons
Ammons Engineering
0 Kudos
Message 2 of 6
(3,532 Views)

My program has approximately 30 different inspections, each with a specific defined region checking the integrity of a component.  The system inspects approximately 600 ppm.  Because of the elasticity of the components the inspection areas need to be adjusted slightly to new areas.  Not all need to be adjusted. Over the course of 8 hours, 20% of the regions will be moved slightly to adjust for normal product shifts.  Currently,the ROIs are moved with the normal ROI Descriptor.  I was told you cannot grab a defined ROI and simply move it.   I have been led to believe you could only adjust the ROI size or position using the ROI descriptor.  I hope this is wrong. 

 

Please let me know if I can grab a line in an ROI and adjust it during the inspection.  If it is that simple, it would be GREAT.

 

JJ Roberts

0 Kudos
Message 3 of 6
(3,530 Views)

It might work.  It depends how you are generating the ROIs for display, and it depends how LV handles the ROIs when you edit one of a group.  If they stay in the same order, you could loop through them and compare them to the original ROI and update when necessary.

 

What I did in one of my programs was having a separate zoomed window that displays the ROI for the selected item.  In that window, I can edit or redraw the ROI and it gets combined back with the rest of the ROIs when I am done.

 

Bruce

Bruce Ammons
Ammons Engineering
0 Kudos
Message 4 of 6
(3,527 Views)

Thanks for responding.  I'm fairly new at this so I'm not quite sure what you mean by the "order" and looping through the ROIs.  I thought there was only 1 way to generate the ROI.  I pick a vision tool and then tell it to "create a control" for the roi.  Then I generate it.  They are created in sequence throughout my program in the order I built them on the block diagram.  I feel a little stupid but I'm more used to the Siemens (Acuity) & Cognex products.  This block diagram stuff has been a learning experience for me.

 

Thanks again!

 

JJ

0 Kudos
Message 5 of 6
(3,517 Views)

Are you displaying the ROIs on the image?  Usually to do this, you loop through your list of inspection items and collect the ROI for each item, which gives you an array of ROIs.  In the ROI palette, there is a vi that converts an array of ROIs to a single ROI for display.  You can wire this to the ROI property of the image display to display it onscreen.  You could edit one of these ROIs if you want.  To reverse the process, read the ROI property, then convert the ROI to an array of ROIs (another vi on ROI palette).  These ROIs should still be in the same order as the original ROIs if you are careful.  You could loop through the items and update each ROI with the new ROI.

 

Be careful.  You need to make sure the number of ROIs in the array matches the number of items.  People can accidentally erase all the ROIs on display by drawing a new one, or they might add one or delete one.

 

Bruce

Bruce Ammons
Ammons Engineering
0 Kudos
Message 6 of 6
(3,515 Views)