Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

How to resize pixels in Vision.

Highlighted
I use the Vision Tools for Ultrasound-Imaging. I have the data in a 2D-Array (220x2502). In x-direction one pixel equals 128 us and in y-direction 1 pixel equals 6.15 us. If I display this picture, I get a very long one, because I don't know, how to tell IMAQ Vision that one pixel in y-direction has to be smaller. Can somebody tell me, how to do this? Thanks in advance.
0 Kudos
Message 1 of 2
(1,778 Views)
Highlighted
You can't display an image without using square pixels. If you want to make this image contain square pixels, you are going to have to resample the image.

A quick method is to use IMAQ Extract to reduce the y resolution by an integer factor. A factor of 21 would give you roughly square pixels.

Another possibility is duplicating the x pixels using IMAQ Expand, once again using the factor of 21.

A third possibility would be a combination of the two. Try Extracting with a y factor of 7, then Expanding with an x factor of 3.

You could also use IMAQ Resample to do all this in a single step, and it can handle non-integer factors. Just figure out what the size (resolution) of the final image should be, and it will interpolate to give you what you want.

Bruce
Bruce Ammons
Ammons Engineering
Message 2 of 2
(1,778 Views)