tile_images_offsettile_images_offsetTileImagesOffsetTileImagesOffsettile_images_offset (算子)

名称

tile_images_offsettile_images_offsetTileImagesOffsetTileImagesOffsettile_images_offset — 将多个图像对象平铺成具有明确定位信息的大图像。

签名

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

Herror tile_images_offset(const Hobject Images, Hobject* TiledImage, const Hlong OffsetRow, const Hlong OffsetCol, const Hlong Row1, const Hlong Col1, const Hlong Row2, const Hlong Col2, const Hlong Width, const Hlong Height)

Herror T_tile_images_offset(const Hobject Images, Hobject* TiledImage, const Htuple OffsetRow, const Htuple OffsetCol, const Htuple Row1, const Htuple Col1, const Htuple Row2, const Htuple Col2, const Htuple Width, const Htuple Height)

void TileImagesOffset(const HObject& Images, HObject* TiledImage, const HTuple& OffsetRow, const HTuple& OffsetCol, const HTuple& Row1, const HTuple& Col1, const HTuple& Row2, const HTuple& Col2, const HTuple& Width, const HTuple& Height)

HImage HImage::TileImagesOffset(const HTuple& OffsetRow, const HTuple& OffsetCol, const HTuple& Row1, const HTuple& Col1, const HTuple& Row2, const HTuple& Col2, Hlong Width, Hlong Height) const

HImage HImage::TileImagesOffset(Hlong OffsetRow, Hlong OffsetCol, Hlong Row1, Hlong Col1, Hlong Row2, Hlong Col2, Hlong Width, Hlong Height) const

static void HOperatorSet.TileImagesOffset(HObject images, out HObject tiledImage, HTuple offsetRow, HTuple offsetCol, HTuple row1, HTuple col1, HTuple row2, HTuple col2, HTuple width, HTuple height)

HImage HImage.TileImagesOffset(HTuple offsetRow, HTuple offsetCol, HTuple row1, HTuple col1, HTuple row2, HTuple col2, int width, int height)

HImage HImage.TileImagesOffset(int offsetRow, int offsetCol, int row1, int col1, int row2, int col2, int width, int height)

def tile_images_offset(images: HObject, offset_row: MaybeSequence[int], offset_col: MaybeSequence[int], row_1: MaybeSequence[int], col_1: MaybeSequence[int], row_2: MaybeSequence[int], col_2: MaybeSequence[int], width: int, height: int) -> HObject

描述

tile_images_offsettile_images_offsetTileImagesOffsetTileImagesOffsetTileImagesOffsettile_images_offset tiles multiple input image objects, which must contain the same number of channels, into a large image. The input image object ImagesImagesImagesImagesimagesimages contains Num images, which may be of different size. The output image TiledImageTiledImageTiledImageTiledImagetiledImagetiled_image contains as many channels as the input images. The size of the output image is determined by the parameters WidthWidthWidthWidthwidthwidth and HeightHeightHeightHeightheightheight. The position of the upper left corner of the input images in the output images is determined by the parameters OffsetRowOffsetRowOffsetRowOffsetRowoffsetRowoffset_row and OffsetColOffsetColOffsetColOffsetColoffsetColoffset_col. 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 Row1Row1Row1Row1row1row_1, Col1Col1Col1Col1col1col_1, Row2Row2Row2Row2row2row_2, and Col2Col2Col2Col2col2col_2 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 OffsetRowOffsetRowOffsetRowOffsetRowoffsetRowoffset_row and OffsetColOffsetColOffsetColOffsetColoffsetColoffset_col 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 ImagesImagesImagesImagesimagesimages overwrites the image data of the image with the lower index. The domain of TiledImageTiledImageTiledImageTiledImagetiledImagetiled_image is obtained by copying the domains of ImagesImagesImagesImagesimagesimages to the corresponding locations in the output image.

注意

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

执行信息

参数

ImagesImagesImagesImagesimagesimages (输入对象)  (multichannel-)image(-array) objectHImageHObjectHImageHobject (byte / direction / cyclic / int1 / int2 / uint2 / int4 / int8 / real)

输入图像。

TiledImageTiledImageTiledImageTiledImagetiledImagetiled_image (输出对象)  (multichannel-)image objectHImageHObjectHImageHobject * (byte / direction / cyclic / int1 / int2 / uint2 / int4 / int8 / real)

Tiled output image.

OffsetRowOffsetRowOffsetRowOffsetRowoffsetRowoffset_row (输入控制)  point.y(-array) HTupleMaybeSequence[int]HTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Row coordinate of the upper left corner of the input images in the output image.

默认值: 0

建议值: 0, 50, 100, 150, 200, 250

OffsetColOffsetColOffsetColOffsetColoffsetColoffset_col (输入控制)  point.x(-array) HTupleMaybeSequence[int]HTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Column coordinate of the upper left corner of the input images in the output image.

默认值: 0

建议值: 0, 50, 100, 150, 200, 250

Row1Row1Row1Row1row1row_1 (输入控制)  rectangle.origin.y(-array) HTupleMaybeSequence[int]HTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Row coordinate of the upper left corner of the copied part of the respective input image.

默认值: -1

建议值: -1, 0, 10, 20, 50, 100, 200, 300, 500

Col1Col1Col1Col1col1col_1 (输入控制)  rectangle.origin.x(-array) HTupleMaybeSequence[int]HTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Column coordinate of the upper left corner of the copied part of the respective input image.

默认值: -1

建议值: -1, 0, 10, 20, 50, 100, 200, 300, 500

Row2Row2Row2Row2row2row_2 (输入控制)  rectangle.corner.y(-array) HTupleMaybeSequence[int]HTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Row coordinate of the lower right corner of the copied part of the respective input image.

默认值: -1

建议值: -1, 0, 10, 20, 50, 100, 200, 300, 500

Col2Col2Col2Col2col2col_2 (输入控制)  rectangle.corner.x(-array) HTupleMaybeSequence[int]HTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Column coordinate of the lower right corner of the copied part of the respective input image.

默认值: -1

建议值: -1, 0, 10, 20, 50, 100, 200, 300, 500

WidthWidthWidthWidthwidthwidth (输入控制)  extent.x HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

输出图像的宽度。

默认值: 512

建议值: 32, 64, 128, 256, 512, 768, 1024, 2048, 4096

HeightHeightHeightHeightheightheight (输入控制)  extent.y HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

输出图像的高度。

默认值: 512

建议值: 32, 64, 128, 256, 512, 525, 1024, 2048, 4096

示例(HDevelop)

* 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, AcqHandle, -1)
    concat_obj (Images, ImageGrabbed, Images)
endfor
tile_images_offset (Images, TiledImage, [0,635], [0,0], [0,0], \
                    [0,5], [474,474], [634,639], 635, 950)

* 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)

结果

tile_images_offsettile_images_offsetTileImagesOffsetTileImagesOffsetTileImagesOffsettile_images_offset 在所有参数正确且执行过程中未发生错误时返回 2 ( H_MSG_TRUE )。如果输入为空则可设置行为通过 set_system(::'no_object_result',<Result>:)set_system("no_object_result",<Result>)SetSystem("no_object_result",<Result>)SetSystem("no_object_result",<Result>)SetSystem("no_object_result",<Result>)set_system("no_object_result",<Result>)。如有必要,则抛出异常。

可能的前趋

append_channelappend_channelAppendChannelAppendChannelAppendChannelappend_channel

替代

tile_channelstile_channelsTileChannelsTileChannelsTileChannelstile_channels, tile_imagestile_imagesTileImagesTileImagesTileImagestile_images

另见

change_formatchange_formatChangeFormatChangeFormatChangeFormatchange_format, crop_partcrop_partCropPartCropPartCropPartcrop_part, crop_rectangle1crop_rectangle1CropRectangle1CropRectangle1CropRectangle1crop_rectangle1

模块

基础