Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Two Questions: IMAQ Window resolution can't be larger than display and fully updated images not displaying in IMAQ Window.

I have two questions:

 

First, it seems that it isn't possible to make an IMAQ Window larger the current resolution of the display it is on. Is this correct, or is this a hardware limitation, or is this something I accidentally imposed on myself?

 

Specifically, I can't use my mouse and resize the window larger than the resolution of the monitor. Also, if I try to use a VI to change the window size (WindSize), it pretends to change and then shrinks back to the original size. That said, my VI is approaching the point where there could be a stray WindSize Vi that I am updating and I have forgotten about it and it is causing me this nightmare, so I just wanted to know if I should continue debugging this problem or if its inherent in IMAQ.

 

Second, especially when resizing a cropped image (i.e. with IMAQ Resample), I'll see the Src image instead of the Dst image in the IMAQ Window. Is this, again, a hardware limitation relating to single buffering or the refresh rate of the monitor with relation to how often the buffer is updated? Is there any way to solve this issue in software (quintuple buffering!)

 

Specifically, I crop the image and resize it to fit the IMAQ Window. I realize this is slow (it takes 20 or fewer ms, depending on the hardware its running on) but since the frame rate of the camera is slow (~12fps), the time spent in the resample vi is << than the time spent in the image grab. That said, I still see flickering of images that aren't the resultant image (specifically, it's not an image from a previous capture... instead it is the image prior to being cropped and/or resampled).

 

Thanks!

 

- Chris

Message 1 of 6
(4,329 Views)

Hi Chris,

 

To answer your first question, what do you have wired to WinDraw and WindSize? The likely reason why it shrinks down to the size of your image is because the value for the Resize to Image Size terminal (for WinDraw) is True. Change it to False to keep the window from shrinking down to the size of your image. Also check to see if the value for Get/Set Status (for WindSzie) is set to True. This needs to be set to True to make the window a different size.

 

I'm still looking into the second question. I'll let you know what I find.

0 Kudos
Message 2 of 6
(4,304 Views)

I can be a bit more precise on both issues:

 

The first issue seems to be a Windows issue. I was sure you could resize windows larger than the current resolution in Windows (I seem to recall HD video larger than my screen in a window before), but it's not clear to me that you can anymore. In any event, it's not a big deal, I just resample the images and adjust the window size instead of displaying the camera output at the maximum resolution.

 

The second issue has a few caveats I didn't mention. Specifically, the ghost image doesn't appear all the time. It just appears when I'm doing something with the window (like resizing by manipulating the frame or placing a ROI on top of it or interacting with the ROI). When I do some of those specific things, I'll often see for what is likely just one frame of an image that does not seem to be bending to the will of my resampling VIs.

 

Again thanks for the help.

 

- Chris

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

Hi Chris,

 

You're right about the window size being bigger than the resolution in Windows. It won't let you resize it to be any bigger than that. It sorta makes sense. If the image is larger than the window, you'd be able to see other parts of the image with scroll bars.

 

For the second issue, have you tried to run your application with higlight execution to see where/when these ghost images appear? Depending on how you have coded, it might make sense that these ghost images are happening. Take for example the image below. The external window is recreated each time the program goes throgh the loop. I could manual resize the window but it'll pop back to a 640x480 each time my program gets to the WindDrawVI.

 

Using WindDraw.jpg

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

I think the issue revolves around what's in buffer written to the screen and when. I'm using an NI PXI chassis that is a couple years old. My guess would be that IMAQ doesn't use multiple buffers to store a completed image and an image that it is constructing, and thus when I change the size of the window and force what I must assume is an update it isn't prepared to make, I get an improperly scaled image. This doesn't happen on other, newer machines. My main question was whether there was a way to prevent this from happening (even if it meant delaying the updating of the screen until IMAQ is ready to draw it). Attached is an exaggeration of what is happening. Just running the image capture VI is taxing on the PXI chassis, so running that AND something that records the screen brings it down to 1-4 fps. That said, you can see the premodified image in some of the frames. This doesn't appear to happen on my faster computers and it should't happen based on the code, IMO.

 

Any further help in making this issue less noticable would be appreciated. Much thanks!

 

- Chris

0 Kudos
Message 5 of 6
(4,267 Views)

Is it possible for you to post up a simplified version of your code that does this?

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