Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

zoom factor less than 1

I am reading live image data from a firewire camera and displaying using the picture display. I change binning on my camera, therefor the resolution changes. I want to programmaticlly scale the image to a set picture display size so that when the resolution changes, the image fits entirely in my display. I have scaled the zoom factor property of my picture display by the resolution/display size and am getting bad results...
When the zoom factor becomes less than 1 (the image is larger than the display), the image shows horrible noise, it's like there's bad decimation or something going on, my image is gray-scale and the spots and distortions are unacceptable. Is there a better way I can scale image for my picture display? I have also played around displaying my image as an array in the intensity graph. Can anyone describe the advantages/disadvantages between using the picture display and the intensity graph. I need to display live video from imaq image data type. I do not have the vision toolbox
0 Kudos
Message 1 of 4
(3,702 Views)
blitzcraig,
 
"Is there a better way I can scale image for my picture display?"
 
Yes, the best way to scale the image would be to use "IMAQ Resample.vi".  This VI comes with the Vision Development Module.  If you already have the Vision Development Module, then you should be good to go.  "IMAQ Resample.vi" allows you to select four different types of interpolation, "Zero Order", "Bi-Linear", "Quadratic", and "Cubic Spline".
 
I can't say for sure (I would have to check with R&D), but the Image Display's zoom out probably just removes every other pixel when zooming out, thus creating the bad image.  Using "IMAQ Resample.vi" does a much better job.  And...  "IMAQ Resample.vi" will allow you to resize the image so that it fits perfectly inside your Image Display (no matter the size of the display).
 
If you do not own the Vision Development Module, then you have two options...
1.  Buy the Vision Development Module
2.  Convert your image to a 2D array and write your own resampling algorithm and then display the image on an intensity plot.  If you just display the image on an intensity plot and zoom out, you will find that you are going to have the same issues that you were having before.
 
Writing your own resampling algorithm is not impossible, but might be a bit messy.  I am sure if you google "resampling" you can probably come up with some info on different ways to implement resampling.  The downside to this option is that...
 
1.  You have to write you own algorithm.
2.  The intensity plot is not very fun to work with when trying to display images (compared to the Image Display).
 
I hope I answered all of your questions,
Lorne Hengst
Application Engineer
National Instruments
0 Kudos
Message 2 of 4
(3,660 Views)
thanks for the reply, I do not have the vision toolbox, therefor can not use the resample.vi

I am developing using the intensity graph and autoscaling x & y.  this seems to work fine. 

the problem is when scaling down not zooming out.  zoom out looks fine, zoom in has a poor scaling algorithm and adds distortion to my images.


0 Kudos
Message 3 of 4
(3,646 Views)

blitzcraig,

I think we are playing symantics here.

When the zoom factor is less than 1 I consider that zoom, zooming out.  Which I agree does a poor job of scaling.  My answer still remains the same though.  You can avoid this by writing an algorithm that takes your 2D array and scales it up and down for you gracefully.

Since you do not have the IMAQ Vision development module, you will have write the code to do that on your own, it might not be that complicated though.

Good Luck,
Lorne Hengst
Application Engineer
National Instruments

0 Kudos
Message 4 of 4
(3,620 Views)