gen_image_interleaved ( : ImageRGB : PixelPointer, ColorFormat, OriginalWidth, OriginalHeight, Alignment, Type, ImageWidth, ImageHeight, StartRow, StartColumn, BitsPerChannel, BitShift : )

Create a three-channel image from a pointer to the interleaved pixels.

The operator gen_image_interleaved creates a three-channel image from an input image, whose pixels are stored line-sequentially in PixelPointer. The size of the input image has to be passed in OriginalWidth and OriginalHeight, the format of the interleaved pixels in ColorFormat.

The output image will be sized ImageWidth * ImageHeight. Together with the coordinates of upper left corner StartRow and StartColumn any section of the input image can be extracted. When a 0 is passed to ImageWidth, ImageHeight, StartRow, and StartColumn, the output image will have the same dimensions as the input image.

Note that the image type Type of the output image ImageRGB has to be chosen such that the whole range of possible color values of the input image can be represented. I.e. gen_image_interleaved does not allow to create a byte image from an input image with ColorFormat rgb48.

When the formats rgb48, bgr48, rgbx64, and bgr64 do not use the full range of 16 bits per channel and pixel, the number of actually used bits should be passed in BitsPerChannel. Furthermore, the pixel values of the input image can be shifted by BitShift bits to the right.

The storage for the new image is newly created by HALCON . Thus, it can be released after the call. Since the type of the parameters (PixelPointer) is generic (long) a ``cast'' must be used for the call.

Possible values for ColorFormat:

'rgb555'
                16 bit rgb triple (5 bit per pixel and channel)

'bgr555'
                16 bit bgr triple (5 bit per pixel and channel)

'rgb565'
                16 bit rgb triple (5 bit per pixel and channel, 6 bit for 
                the green channel)

'bgr565'
                16 bit bgr triple (5 bit per pixel and channel, 6 bit for 
                the green channel)

'rgb'
                24 bit rgb triple (8 bit per pixel and channel)

'bgr'
                24 bit bgr triple (8 bit per pixel and channel)

'rgbx'
                32 bit rgb quadruple (8 bit per pixel and channel)

'bgrx'
                32 bit bgr quadruple (8 bit per pixel and channel)

'rgb48'
                48 bit rgb triple (16 bit per pixel and channel)

'bgr48'
                48 bit bgr triple (16 bit per pixel and channel)

'rgbx64'
                64 bit rgb quadruple (16 bit per pixel and channel)

'bgrx64'
                64 bit bgr quadruple (16 bit per pixel and channel)


Parameters

ImageRGB (output_object)
image -> object : byte / uint2
Created image with new image matrix.

PixelPointer (input_control)
integer -> integer
Pointer to interleaved pixels.

ColorFormat (input_control)
string -> string
Format of the input pixels.
Default value: 'rgb'
List of values: 'rgb', 'bgr', 'rgbx', 'bgrx', 'rgb48', 'bgr48', 'rgbx64', 'bgrx64', 'rgb555', 'bgr555', 'rgb565', 'bgr565'

OriginalWidth (input_control)
extent.x -> integer
Width of input image.
Default value: 512
Suggested values: 128, 256, 512, 1024
Typical range of values: 1 <= OriginalWidth
Minimum increment: 1
Recommended increment: 10

OriginalHeight (input_control)
extent.y -> integer
Height of input image.
Default value: 512
Suggested values: 128, 256, 512, 1024
Typical range of values: 1 <= OriginalHeight
Minimum increment: 1
Recommended increment: 10

Alignment (input_control)
integer -> integer
Reserved.

Type (input_control)
string -> string
Pixel type of output image.
Default value: 'byte'
List of values: 'byte', 'uint2'

ImageWidth (input_control)
rectangle.extent.x -> integer
Width of output image.
Default value: 0
Suggested values: 128, 256, 512, 1024
Typical range of values: 0 <= ImageWidth
Minimum increment: 1
Recommended increment: 10

ImageHeight (input_control)
rectangle.extent.y -> integer
Height of output image.
Default value: 0
Suggested values: 128, 256, 512, 1024
Typical range of values: 0 <= ImageHeight
Minimum increment: 1
Recommended increment: 10

StartRow (input_control)
rectangle.origin.y -> integer
Line number of upper left corner of desired image part.
Default value: 0
Suggested values: -1, 0

StartColumn (input_control)
rectangle.origin.x -> integer
Column number of upper left corner of desired image part.
Default value: 0
Suggested values: -1, 0

BitsPerChannel (input_control)
integer -> integer
Number of used bits per pixel and channel of the output image (-1: All bits are used).
Default value: -1
Suggested values: 5, 8, 10, 12, 16, -1

BitShift (input_control)
integer -> integer
Number of bits that the color values of the input pixels are shifted to the right (only uint2 images).
Default value: 0
Suggested values: 0, 2, 4, 6


Result

If the parameter values are correct, the operator gen_image_interleaved returns the value 2 (H_MSG_TRUE). Otherwise an exception handling is raised.


Parallelization Information

gen_image_interleaved is reentrant and processed without parallelization.


Possible Successors

disp_color


See also

reduce_domain, paint_gray, paint_region, set_grayval


Module

Foundation



Copyright © 1996-2008 MVTec Software GmbH