LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to determine what image pixels are currently displayed in an Vision Image display after zoom and pan

I am trying to scale to the side of an image display that will show the height of a displayed image (Y axis).  I am using a custom vertical slide to display the scale, however after I zoom the image and then pan around I want my scale to reflect the current minimum and maximum height displayed.  The problem I am having is I cannot find any way to determine what pixels are currently being displayed.  Is there a way to determine some coordinate of what is currently being displayed?

 

Thanks

 

Terry

0 Kudos
Message 1 of 5
(4,114 Views)

Can you share the image which you use (Normal as well as Zoomed)

X and Y Co ordinates wont change if we zoom.

----------------------------------------------------------------------------------------------------------------
Palanivel Thiruvenkadam | பழனிவேல் திருவெங்கடம்
LabVIEW™ Champion |Certified LabVIEW™ Architect |Certified TestStand Developer

Kidlin's Law -If you can write the problem down clearly then the matter is half solved.
-----------------------------------------------------------------------------------------------------------------
0 Kudos
Message 2 of 5
(4,055 Views)

That's a very interesting question.  It clearly should be possible to do this using Property Nodes, but (a) there are not very many of them for an IMAQdx Image, (b) I couldn't find any Help topics for them (Help for the specific Property topic was listed, but greyed out, even with a full license), and (c) the logic didn't always make sense.

 

I was able to determine a number of things in exploring Zoom (and ignoring Pan).  Zooming does not appear to affect the Displayed Image Position, Displayed Image Size, Image Area Position, or Image Area Size.  Indeed, the "Displayed Image" and "Image Area" corresponding properties are identical.  Similarly, Zoom Integer remained fixed at (12, 12) regardless of zooming.  I didn't look at the Image Information String (which did change, and showed "Useful" numbers), but was disappointed to see that Zoom Information Shown is just a cluster of Booleans that governs what is "shown".

 

But I did learn the following through experimentation.  You know that if you have the Zoom Tool selected and click on an Image, it "zooms" it.  What it does appears to be the following:  From the Mouse Position relative to the Image Frame and the "image" inside the Frame, the Pixel is computed (note that the Pixel coordinates appear in the Image Information String).  The Zoom Factor is increased by 1 (from 1 to 2, 2 to 3, etc.), the Image is expanded about the selected Pixel, then the Image is redisplayed, attempting to keep the Selected Pixel at the same spatial location, subject to some boundary-rounding conditions I haven't quite deduced.  [If you click on the central Pixel, you will stay there through multiple zooms, but if you try this near the corner, say (4, 4), you'll see the selected pixel change to (3, 3), (2, 2), etc. as the Zoom increases.]

 

I haven't investigated all the functions in the IMAXdx toolbox (and don't claim to be an "Image Expert" -- I just use some of these tools to view, manipulate, and do simple analysis of images), so there may be other things to do.  I'll be interested to see what turns up on this Post.

 

Bob Schor

0 Kudos
Message 3 of 5
(4,046 Views)

Thanks for having a look at this Bob.  I have still not been able to find a solution to my question. For the purpose of the application that I am working on what I have done is hid the tools for the IMAQ Image display and created my own button for zoom.  This zooms around the center of the image and therefore I can easily calculate how many pixels are displayed above and below the center of the image based on the new zoom level.  I then re-calulate my real world scale values.  This does work for the current application but eventually I would like to be able to pan around at a magnified level and have my scale values update according to the part of the image that is being displayed.

0 Kudos
Message 4 of 5
(4,038 Views)

The post is already very old... But anyway, this should solve the problem.

Message 5 of 5
(1,931 Views)