Jump to content

Scale an IMAQ image by something other than power of 2?


Recommended Posts

QUOTE(george seifert @ Dec 10 2007, 04:42 PM)

Is it possible to scale an IMAQ image by something other than power of 2? I have two 640 x 480 images that I want to display side by side, but that gets kind of big for some screens. If I shrink the image by a half it's a little too small. I can't seem to find any way to scale the image by say 1/3. Am I missing something?

George

Have you tried the "Zoom (Single)" item on the property node for the display? Setting a value of 0.66 will reduce the size by 1/3, setting 0.1 will reduce the size by factor 10. This is useful if you only want the displöay scaled, but leave the actual image untouched.

To rescale the image itself, you can use the "IMAQ Resample" under the "Image Manipulation" palette.

Shane.

Link to comment

QUOTE(shoneill @ Dec 10 2007, 10:19 AM)

Have you tried the "Zoom (Single)" item on the property node for the display? Setting a value of 0.66 will reduce the size by 1/3, setting 0.1 will reduce the size by factor 10. This is useful if you only want the displöay scaled, but leave the actual image untouched.

To rescale the image itself, you can use the "IMAQ Resample" under the "Image Manipulation" palette.

Shane.

Thanks. I missed that one. Unfortunately both methods introduce some funky artifacts in the image if you scale by something other than a power of 2.

George

Link to comment

QUOTE(george seifert @ Dec 10 2007, 08:30 PM)

Thanks. I missed that one. Unfortunately both methods introduce some funky artifacts in the image if you scale by something other than a power of 2.

George

Funky artifacts? The only funky artifacts I see is the picture getting larger or smaller......... In both methods I listed?

Shane.

Link to comment

QUOTE(shoneill @ Dec 10 2007, 02:08 PM)

Funky artifacts? The only funky artifacts I see is the picture getting larger or smaller......... In both methods I listed?

Shane.

There are evenly spaced little squares (like a grid) over the whole picture. I'm using a grey scale 8 bit image. Maybe that makes a difference.

Yep, both methods yield the same artifacts.

George

Link to comment

QUOTE(george seifert @ Dec 10 2007, 01:30 PM)

Thanks. I missed that one. Unfortunately both methods introduce some funky artifacts in the image if you scale by something other than a power of 2.

Have you tried fiddling with the Interpolation Type option in IMAQ Resample? Zero Order is the default and will be the fastest, but will also be the worst. Bi-linear and Cubic may give you better results, but will be slower.

Link to comment

QUOTE(eaolson @ Dec 10 2007, 02:16 PM)

Have you tried fiddling with the Interpolation Type option in IMAQ Resample? Zero Order is the default and will be the fastest, but will also be the worst. Bi-linear and Cubic may give you better results, but will be slower.

Thanks. The Bi-linear is pretty good. Some slight artifacts, but tolerable. BTW, there aren't any noticeable artifacts with even the Zero Order with a 32 bit image.

George

Link to comment

QUOTE(george seifert @ Dec 10 2007, 03:33 PM)

Thanks. The Bi-linear is pretty good. Some slight artifacts, but tolerable. BTW, there aren't any noticeable artifacts with even the Zero Order with a 32 bit image.

George

When you have to calculate the weighted average of several pixels, the result will be much more smoothly when you have 8 bits per color to distribute your values in, than in 8 bits altogether.

Rolf Kalbermatter

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.