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: 

How to define a rectangle programmatically to use as a RIO

Solved!
Go to solution

Hi, 

 

I'm analysing a video and would like the option to either define a RIO by clicking and dragging on the video window or by using a default region. I've manage to do the click and drag but I can't set the rectangle to be the to corner of the video. Video resolutions change between files so I need to use the info from the width and height to define the coordinates . These values then need to be passed to the IMAQ convert rectangle to RIO. The problem is I cant write to the function in the rectangle data type. I tried a standard cluster of the 5 elements which are in the rectangle data type but this doesn't work. How do I do this? The picture shows the code I have. 

 

thanks 

 

Stephen

Labview 14.0, Labview 12.0
CLAD
Mechanical Engineering Student
0 Kudos
Message 1 of 6
(4,201 Views)
Covert the cluster to array of 4 elements then it will work for you
----------------------------------------------------------------------------------------------------------------
Palanivel Thiruvenkadam | பழனிவேல் திருவெங்கடம்
LabVIEW™ Champion |Certified LabVIEW™ Architect |Certified TestStand Developer

Kidlin's Law -If you can write the problem down clearly then the matter is half solved.
-----------------------------------------------------------------------------------------------------------------
0 Kudos
Message 2 of 6
(4,182 Views)
Solution
Accepted by topic author Stephen1995

use this example to solve yuor problem 

0 Kudos
Message 3 of 6
(4,175 Views)
Solution
Accepted by topic author Stephen1995

@PalanivelThiruvenkadam wrote:
Covert the cluster to array of 4 elements then it will work for you

The above statement has to be reversed to make the concept workROI Selection.PNG

 

----------------------------------------------------------------------------------------------------------------
Palanivel Thiruvenkadam | பழனிவேல் திருவெங்கடம்
LabVIEW™ Champion |Certified LabVIEW™ Architect |Certified TestStand Developer

Kidlin's Law -If you can write the problem down clearly then the matter is half solved.
-----------------------------------------------------------------------------------------------------------------
0 Kudos
Message 4 of 6
(4,153 Views)
Solution
Accepted by topic author Stephen1995
I don't get why you are using Build cluster array instead of Bundle for cluster.
-The input to Rectangle to ROI is cluster of five elements, not cluster of array of five elements.
-no need of making array then converting to cluter.
-Just use bundle the five numbers using https://zone.ni.com/reference/en-XX/help/371361J-01/glang/bundle/
-let me know if that helps.
Thanks
uday
Message 5 of 6
(4,143 Views)

Yes this worked. thanks

Labview 14.0, Labview 12.0
CLAD
Mechanical Engineering Student
0 Kudos
Message 6 of 6
(4,138 Views)