ni.com is currently experiencing slowness/issues due to ongoing maintenance.
Support teams are actively working on the soonest resolution.
ni.com is currently experiencing slowness/issues due to ongoing maintenance.
Support teams are actively working on the soonest resolution.
12-29-2014 02:32 PM - edited 12-29-2014 02:34 PM
Hello,
I'm trying to create a rectangular ROI based on two points A(x1,y1) and B(x2,y2). A and B change between frames so I need the rectangle to move along with them. Is there a non-convoluted way of accomplishing this? As of now it seems I would need to calculate the angle between them and continously update that along with the 'left', 'right', 'top' and 'bottom' coordinates. Any suggestions?
Just to clarify, the idea is that A and B are the midpoints of the short sides of the rectangle (respectively).
Thank you,
Solved! Go to Solution.
12-30-2014 09:55 AM
Hi Tkassis,
Based on your mentioning of the angle between the midpoints you talked about, it seems like you're also describing a rotated rectangle. I think the way you are already doing it is the best way to accomplish this - with the IMAQ Convert Rectangle to ROI VI.
12-31-2014 03:13 PM
Thank you but the rotated rectangle didn't actually work form me. I ended up using some trigonometry to do it. It works well now. I basically calculated the 4 corners of my rectangle and how they move with my moving ROI then then used the Extract Tetragon VI to get my ROI.