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.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can you crop video to chosen ROI

I have a for loop that reads frames which is a simple way to display a video and manipulate the frames as they pass by. 

 

However, the only way I found to crop a displayed product to your region of interest is

IMAQ select rectangle -> rectangle to ROI-> IMAQ extract -> image out.

 

The problem with this is that when you put it within a for loop it asks for a new ROI every frame. I have 625 frames and this caused a large problem for my program. I can not put the select rectangle out of the loop because it requires the Read Frame data from within.

 

Additionally I would much rather have an image out style display on the front end than to generate a new window.

 

I am perplexed and looking for guidance.

 

thank you.

0 Kudos
Message 1 of 3
(2,659 Views)

Hey agator2,

 

You can alter the program such that you define the rectangle with one image outside of the for loop, the feed that rectangle to the ROI tools inside of the while loop for processing the image. That will stop the program from prompting you for a new rectangle each time. Hope that helps!

John B.
Embedded Networks R&D
National Instruments
Certified LabVIEW Developer
Message 2 of 3
(2,637 Views)

as for me, i'd recommend to use this tool http://www.geovid.com/VidCrop/, it's nice)

Message 3 of 3
(2,602 Views)