From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Reading an ROI in an array?

Solved!
Go to solution

I have existing directories of TIFFs with which I need to do target tracking.  Attached is an example of the start of a VI to read the images into an array so I can process them.

 

To generate a rectangle for 'IMAQ Extract' I need to drag an ROI in the first frame of the array so I have a place to start.  BUT, I don't see how to then obtain the ROI parameters.  I looked at the "Pattern Matching Example.vi" in the ...\Labview 2010\examples\Vision\... subdirectory and I think I kind of see how they're doing the ROI with a SINGLE image but I can't figure how to do the same with the array.

 

What am I missing here?  I'd figure that an ROI should be frame-size-dependent only and have no reference to the array index, but I don't see anything in the array's property node.

 

Thanks for any help!

0 Kudos
Message 1 of 3
(2,928 Views)
Solution
Accepted by topic author sjn

You have to get the reference to the Array Element and then cast it to the specific reference type.  Then you will be able to read the ROI property which will be common to all elements in the array.

 

Of course, you must have an ROI drawn before the property will return anything.

Randall Pursley
0 Kudos
Message 2 of 3
(2,915 Views)

Y'know, it sounds so easy when you say it...  Smiley Happy

I 'fell down' on the 'To More Specific Class' function (having never encountered its use before).

 

Thank you!

0 Kudos
Message 3 of 3
(2,904 Views)