Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I define an ROI programmatically from four points

Solved!
Go to solution

Hi,

 

I am working on a program that detects four edges, and finds the four corners where these lines intersect.  I want to define an ROI from these four points, but am having a hard time finding the right tool.  When I use the rectangle to ROI (Polygon) tool, the lines don't end up matching the edges because it only takes in the upper left and lower right corners along with a rotation, and when it rotates, the ROI rotates off of the corners I input.  How do I simply create an ROI based on four corners?  It seems like this should be a very simple task, but I can't figure it out.


Thanks,

 

Paul

0 Kudos
Message 1 of 5
(3,869 Views)

You have to create a Polygon ROI. Unfortunately, there is no high level VI that lets you create it by just specifying the points, so you have to manually build the ROI descriptor with your array of points.

 

See attached example on how to do it. Hope this helps.

 

Best Regards,

 

-Christophe

Message 2 of 5
(3,843 Views)

Thank you for your reply, Christoph.  Unfortunately, I am running labview 8.6 and was unable to open your example file.

0 Kudos
Message 3 of 5
(3,839 Views)
Solution
Accepted by Hollie Maea

Christophe's example should be exactly what you need. I went ahead and saved it so that you can use it in LabVIEW 8.6.

 

Paul

 

National Instruments | Applications Engineer | www.ni.com/support
Message 4 of 5
(3,833 Views)

Excellent.  Worked perfectly.  Thank you Christophe and Paul.

0 Kudos
Message 5 of 5
(3,827 Views)