Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Zooming images – zoom to fit width property?

Solved!
Go to solution

I have an inspection system that captures images of varying x size (y is always constant.) I use the Zoom to Fit property node with a boolean on the front panel so the user can see the entire image, and then zoom in with the mouse/cursor. (Shift and left click to zoom out is something they forget and/or find awkward.)

 

The variation in aspect ratio can be significant and on shorter images (smaller X) it results in a lot of white space either side of the picture. My users find this unattractive so I want a function that zooms to fit the X dimension of the image to the space available. Any suggestions on how to do this?

 

BTW, I’m stuck with using LV2015.

0 Kudos
Message 1 of 3
(1,574 Views)
Solution
Accepted by topic author another_novice

There is not a built in function, but you could do it fairly easily.  Use a property node to get the size of the display window, and get the size of the image using the IMAQ Get Size VI.  Divide the two X dimensions to get your zoom factor, and set that using a property node.

 

Bruce

Bruce Ammons
Ammons Engineering
Message 2 of 3
(1,559 Views)

Thanks for the suggestion. Here's what I did. It works great. 

 

another_novice_0-1699369284224.png

 

0 Kudos
Message 3 of 3
(1,495 Views)