IMAQ Cast Image VI
Owning Palette: Image ManagementInstalled With: NI Vision Development ModuleConverts the current image type to the image type specified by Image Type. If you specify a lookup table, the IMAQ Cast Image VI converts the image using a lookup table. If converting from a 16-bit image to an 8-bit image, the VI executes this conversion by shifting the 16-bit pixel values to the right by the specified number of shift operations and then truncating to get an 8-bit value.
Refer to the NI Vision Concepts Manual for more information about converting image types.
Note Refer to Casting Images to learn how the VI casts pixel values when the Image Src type and the Image Type parameter are not the same. |
# Shifts specifies the number of right shifts by which each pixel value in the input image is shifted. This is valid only when converting from a 16-bit image to an 8-bit image. The VI executes this conversion by shifting the 16-bit pixel values to the right by the specified number of shift operations, up to a maximum of 8 shift operations, and then truncating to get an 8-bit value. Enter a value of –1 to ignore the bit depth and shift 0. Enter a value of 0 to use the bit depth to cast the image. Refer to the IMAQ Image Bit Depth VI for information about bit depth. |
|||||||||||||||||
Image Src is a reference to the source image. |
|||||||||||||||||
Image Dst is a reference to the destination image. |
|||||||||||||||||
Lookup Table is an array containing a maximum of 256 elements if Image Src is an 8-bit image or a maximum of 65,536 elements if Image Src is a 16-bit image. The array contains values equal to the index if there are fewer than the amount determined by the image type in Image Src. You can use Lookup Table to calculate a function that gives a relation between a gray-level value and a user value. This input is valid only when converting from an 8-bit image to a 16-bit image, from a 16-bit image to an 8-bit image, or from an 8-bit or 16-bit image to a 32-bit floating-point image. After converting Image Src into a floating-point type image, you can quantify the image or regions in the image using VIs capable of analyzing floating-point type images. |
|||||||||||||||||
error in (no error) describes the error status before this VI or function runs. The default is no error. If an error occurred before this VI or function runs, the VI or function passes the error in value to error out. This VI or function runs normally only if no error occurred before this VI or function runs. If an error occurs while this VI or function runs, it runs normally and sets its own error status in error out. Use the Simple Error Handler or General Error Handler VIs to display the description of the error code. Use error in and error out to check errors and to specify execution order by wiring error out from one node to error in of the next node.
|
|||||||||||||||||
Image Type specifies the image type into which the input image is converted. The following values are valid:
|
|||||||||||||||||
Image Dst Out is a reference to the destination image. If Image Dst is connected, Image Dst Out is the same as Image Dst. Otherwise, Image Dst Out refers to the image referenced by Image Src. |
|||||||||||||||||
error out contains error information. If error in indicates that an error occurred before this VI or function ran, error out contains the same error information. Otherwise, it describes the error status that this VI or function produces. Right-click the error out indicator on the front panel and select Explain Error from the shortcut menu for more information about the error.
|
Examples
Refer to the following for an example of how to use this VI.
- LabVIEW\examples\Vision\2. Functions\Operators\Image Averaging Example.vi