Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Image not displayed correctly in image control at small zoom level

Solved!
Go to solution

I am displaying an image in an image control with a zoom factor of ~0.015 and it appears as shown in image 1.jpg.  When I zoom in a little more to ~0.016 the image is displayed correctly as shown in image 2.jpg.  Both images are attached.

 

Why is the image displayed as a "grey strip" in the first image?  What do I need to do to have the image displayed correctly at any zoom factor?  I am using LV 2011 with the associated vision development module on Windows 7.

 

Thanks,

Jonathan-LV

Download All
0 Kudos
Message 1 of 18
(5,263 Views)

Strange.  You might want to consider using integer zoom factors.  They have always worked well for me.  It is a different property, and you have to set the X and Y factors separately.  I believe positive integers zoom in, negative integers zoom out.

 

Bruce

Bruce Ammons
Ammons Engineering
0 Kudos
Message 2 of 18
(5,260 Views)

Hi Bruce,

Thanks for the suggestion.  Unfortunately I need to be able to zoom to non-integer zoom factors because I am working with large images and the user needs to be able to see the entire image displayed on the image control.

 

Thanks,

Jonathan-LV

0 Kudos
Message 3 of 18
(5,241 Views)

Hi Jonathan,

 

You can zoom out with ZoomInteger. If you read the LabVIEW help article about ZoomInteger, it says that a ZoomInteger value of -n is the equivalent of zooming to 1/n, so you could give that a try. Are you doing proper error handling in your VI? I would recommend using a Simple Error Handler when you modify the properties of that image, in order to check to see if you're generating any errors that could go otherwise unnoticed. 

 

Best,

Dan N

Applications Engineer

National Instruments 

0 Kudos
Message 4 of 18
(5,217 Views)

Hi Dan,

I tried the ZoomInteger with the same results as the ZoomSingle, grey strip.  I also checked my error cluster and I am not getting an error.  I'm thinking this is something associated with the Image control...  Any other ideas?  I need to find a solution for this...

 

Thanks,

Jonathan-LV

0 Kudos
Message 5 of 18
(5,203 Views)

Hi Jonathan,

 

Have you tried setting the ZoomToFit property to true?

 

Also, I'm curious what your application is. It may be that LabVIEW is graying out your image because of some built in anti-aliasing that prevents it from zooming out too far. Since your application seems to just be displaying a picture as a color reference, you could try resizing your picture from the incredibly large size that it is to a smaller size, for display purposes. Give that a try and let me know if it works out for you.

 

Best,

Dan N

Applications Engineer

National Instruments

0 Kudos
Message 6 of 18
(5,183 Views)

Hi Dan,

I tried the ZoomToFit property and it resulted in the same thing, grey strip.  As far as the anti-aliasing maybe you can talk with your R&D department about that.  I don't know why this is happening...  I need the entire image displayed in the picture control.  When I zoom out to that level it results in the grey strip.  Has your R&D department ever seen anything like this?  It seems like this issue is in the image control and the code for the control is not exposed to me.  Your help is appreciated.

 

Thanks,

Jonathan-LV

0 Kudos
Message 7 of 18
(5,177 Views)

Hi Jonathan,

 

Did you try resizing your image dimensions, as I suggested in my previous post? Anti-aliasing is an expected behavior; as you zoom out, the image has to be resampled in order to be displayed properly. At some point, LabVIEW assumes that the image has been resampled to the point where it no longer resembles the initial image, and so it greys the image out. In the case of your image, that is not the case. As I said, I believe an acceptable workaround would be to use IMAQ resample to half or quarter the pixel dimensions of your image, at which point it should be able to be displayed at a higher zoom factor. 

 

Best,

Dan N

Applications Engineer

National Instruments 

0 Kudos
Message 8 of 18
(5,166 Views)

Hi Dan,

Resizing the image dimensions will not work.  I display the full resolution image because the user needs to choose an ROI for analysis.  The analysis must be performed on the full resolution image.

 

I appreciate the suggestions for workarounds.  However, it would be most helpful if you could find out why the image control is displaying the image as a grey strip.  Is this a bug in the image control or is there something that I need to do programatically to show the image correctly?

 

Thanks,

Jonathan-LV

0 Kudos
Message 9 of 18
(5,160 Views)

Hi Jonathan,

 

So, in the realm of workarounds, there are ways that you can modify the ROI to the original prescaled image. However, before we get to that point, I would like to look at your code. I have been unable to reproduce this issue on my end thus far, and would like to see what specifically you are doing on your end.

 

Best,

Dan N

Applications Engineer

National Instruments 

0 Kudos
Message 10 of 18
(5,146 Views)