LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I IMAQ ROI to view only the region of interest?

Solved!
Go to solution

Hello,

 

I'm having trouble acquiring data in only my region of interest using IMAQ ROI. When I try to select a region of interest (i.e. - a region of 10 x 5 pixels), and display only that region, I get an output of the correct image size, but with all black pixels.  My code is attached.  I believe the error is coming from the IMAQ Extract Tetragon VI.  Since I'm not inputing any options for that VI, the default fill value is 0 (black). How should I change my code in order to select a region, and view the image in that region?  Any help is appreciated. Thanks.

0 Kudos
Message 1 of 6
(4,890 Views)

Hi Harry 1947,

 

It looks like you have everything set up correctly from what I can see of the code.  The only thing I'm not sure about is what type of processing you are doing after the selection for the ROI (not shown in image).  It looks like you are still passing the image reference to the rest of the vi.  If you are doing some image manipulation afterwards it could be affecting the ROI output.

 

Would it be possible to post this vi?  That will help narrow down what might be wrong.

 

Thanks,

 

 

Justin D.

Applications Engineer
National Instruments
0 Kudos
Message 2 of 6
(4,858 Views)

VI is attached.  Some of the vi's within are custom from Hamamatsu for our cameras (i.e. - tm_getnextframe.vi & tm_startcapture_a.vi).  

0 Kudos
Message 3 of 6
(4,851 Views)

Thanks a lot for the vi.

 

I don't see anything immediately that might be causing the problem.

What type of image are you aqcuiring?  I see that you are converting the image to 8 bit before the ROI.  Have you tried converting it within the for loop as well? (after the "get next frame vi").

Justin D.

Applications Engineer
National Instruments
0 Kudos
Message 4 of 6
(4,814 Views)
Solution
Accepted by topic author Harry1947

Your problem is probably with the type cast function.  The image data seems to be 16-bit.  The type cast function doesn't rescale this data, it just truncated the upper byte.  Since you are using the same image reference in two places, the image reference now refers to an 8-bit image (since that is what you type casted it to) by the time you get to the for loop so the upper byte is lost.

Randall Pursley
Message 5 of 6
(4,782 Views)

Thanks. Problem solved!

0 Kudos
Message 6 of 6
(4,767 Views)