02-28-2011 10:02 AM
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.
Solved! Go to Solution.
03-01-2011 03:19 PM
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,
03-01-2011 03:43 PM
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).
03-02-2011 02:36 PM
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").
03-04-2011 10:01 AM - edited 03-04-2011 10:09 AM
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.
03-04-2011 03:06 PM
Thanks. Problem solved!