tile_images_offset ( Images : TiledImage : OffsetRow, OffsetCol, Row1, Col1, Row2, Col2, Width, Height : )

Tile multiple image objects into a large image with explicit positioning information.

tile_images_offset tiles multiple input image objects, which must contain the same number of channels, into a large image. The input image object Images contains Num images, which may be of different size. The output image TiledImage contains as many channels as the input images. The size of the output image is determined by the parameters Width and Height. The position of the upper left corner of the input images in the output images is determined by the parameters OffsetRow and OffsetCol. Both parameters must contain exactly Num values. Optionally, each input image can be cropped to an arbitrary rectangle that is smaller than the input image. To do so, the parameters Row1, Col1, Row2, and Col2 must be set accordingly. If any of these four parameters is set to -1, the corresponding input image is not cropped. In any case, all four parameters must contain Num values. If the input images are cropped the position parameters OffsetRow and OffsetCol refer to the upper left corner of the cropped image. If the input images overlap each other in the output image (while taking into account their respective domains), the image with the higher index in Images overwrites the image data of the image with the lower index. The domain of TiledImage is obtained by copying the domains of Images to the corresponding locations in the output image.


Attention

If the input images all have the same size and tile the output image exactly, the operator tile_images usually will be slightly faster.


Parameters

Images (input_object)
(multichannel-)image(-array) -> object : byte / direction / cyclic / int1 / int2 / uint2 / int4 / real
Input images.

TiledImage (output_object)
(multichannel-)image -> object : byte / direction / cyclic / int1 / int2 / uint2 / int4 / real
Tiled output image.

OffsetRow (input_control)
point.y(-array) -> integer
Row coordinate of the upper left corner of the input images in the output image.
Default value: 0
Suggested values: 0, 50, 100, 150, 200, 250

OffsetCol (input_control)
point.x(-array) -> integer
Column coordinate of the upper left corner of the input images in the output image.
Default value: 0
Suggested values: 0, 50, 100, 150, 200, 250

Row1 (input_control)
rectangle.origin.y(-array) -> integer
Row coordinate of the upper left corner of the copied part of the respective input image.
Default value: -1
Suggested values: -1, 0, 10, 20, 50, 100, 200, 300, 500

Col1 (input_control)
rectangle.origin.x(-array) -> integer
Column coordinate of the upper left corner of the copied part of the respective input image.
Default value: -1
Suggested values: -1, 0, 10, 20, 50, 100, 200, 300, 500

Row2 (input_control)
rectangle.corner.y(-array) -> integer
Row coordinate of the lower right corner of the copied part of the respective input image.
Default value: -1
Suggested values: -1, 0, 10, 20, 50, 100, 200, 300, 500

Col2 (input_control)
rectangle.corner.x(-array) -> integer
Column coordinate of the lower right corner of the copied part of the respective input image.
Default value: -1
Suggested values: -1, 0, 10, 20, 50, 100, 200, 300, 500

Width (input_control)
extent.x -> integer
Width of the output image.
Default value: 512
Suggested values: 32, 64, 128, 256, 512, 768, 1024, 2048, 4096

Height (input_control)
extent.y -> integer
Height of the output image.
Default value: 512
Suggested values: 32, 64, 128, 256, 512, 525, 1024, 2048, 4096


Example
/* Example 1                                                        */
/* Grab 2 (multi-channel) NTSC images, crop the bottom 5 lines off  */
/* of each image, the right 5 columns off of the first image, and   */
/* the left five lines off of the second image, and put the cropped */
/* images side-by-side.                                             */
gen_empty_obj (Images)
for I := 1 to 2 by 1
    grab_image_async (ImageGrabbed, FGHandle, -1)
    concat_obj (Images, ImageGrabbed, Images)
endfor
tile_images_offset (Images, TiledImage, [0,635], [0,0], [0,0],
                    [0,5], [474,474], [634,639])

/* Example 2                                                        */
/* Enlarge image by 15 rows and columns on all sides                */
EnlargeColsBy := 15
EnlargeRowsBy := 15
get_image_pointer1 (Image, Pointer, Type, WidthImage, HeightImage)
tile_images_offset (Image, EnlargedImage, EnlargeRowsBy, EnlargeColsBy,
                    -1, -1, -1, -1, WidthImage + EnlargeColsBy*2, 
                    HeightImage + EnlargeRowsBy*2)

Result

tile_images_offset returns 2 (H_MSG_TRUE) if all parameters are correct and no error occurs during execution. If the input is empty the behavior can be set via set_system(::'no_object_result',<Result>:). If necessary, an exception handling is raised.


Parallelization Information

tile_images_offset is reentrant and automatically parallelized (on channel level).


Possible Predecessors

append_channel


Alternatives

tile_channels, tile_images


See also

change_format, crop_part, crop_rectangle1


Module

Foundation



Copyright © 1996-2008 MVTec Software GmbH