LineWidth(Pixels) Is Different Value Than X Resolution of Image

Updated Aug 10, 2018

Reported In

Software

  • LabVIEW

Driver

  • NI-IMAQ

Issue Details

I am using IMAQ GetImagePixelPtr.vi and the LineWidth(Pixels) output is not equal to the horizontal pixel count that I get from the X Resolution output that I get from IMAQ GetImageInfo.viWhy is there a discrepancy between LineWidth(Pixels) and X Resolution?  X Resolution returns the value that I am expecting for my image.

Solution

The value of LineWidth(Pixels) will not always be the same as the value of Resolution, because LineWidth(Pixels) is the sum of the X Resolution of the image, the borders of the image, and the left and right alignments of the image, as shown in the following figure. This number may not match the horizontal size of the image and may be larger than X Resolution.

Additional Information

The X Resolution and LineWidth(Pixels) value will be the same only if your image has zero border and the X Resolution is a multiple of 64 for x86/x64 platforms for images with 8-bit depth.  This is because alignment is set to 64 bytes on x86/x64 platforms for memory optimization.  For PowerPC and CompactRIOs 32 byte alignment is used.

WAS THIS ARTICLE HELPFUL?

Not Helpful