get_image_pointer1get_image_pointer1GetImagePointer1GetImagePointer1get_image_pointer1 (算子)

名称

get_image_pointer1get_image_pointer1GetImagePointer1GetImagePointer1get_image_pointer1 — 访问通道的指针。

签名

get_image_pointer1(Image : : : Pointer, Type, Width, Height)

Herror get_image_pointer1(const Hobject Image, Hlong* Pointer, char* Type, Hlong* Width, Hlong* Height)

Herror T_get_image_pointer1(const Hobject Image, Htuple* Pointer, Htuple* Type, Htuple* Width, Htuple* Height)

void GetImagePointer1(const HObject& Image, HTuple* Pointer, HTuple* Type, HTuple* Width, HTuple* Height)

HTuple HImage::GetImagePointer1(HTuple* Type, HTuple* Width, HTuple* Height) const

void* HImage::GetImagePointer1(HString* Type, Hlong* Width, Hlong* Height) const

static void HOperatorSet.GetImagePointer1(HObject image, out HTuple pointer, out HTuple type, out HTuple width, out HTuple height)

HTuple HImage.GetImagePointer1(out HTuple type, out HTuple width, out HTuple height)

IntPtr HImage.GetImagePointer1(out string type, out int width, out int height)

def get_image_pointer1(image: HObject) -> Tuple[Sequence[int], Sequence[str], Sequence[int], Sequence[int]]

def get_image_pointer1_s(image: HObject) -> Tuple[int, str, int, int]

描述

算子 get_image_pointer1get_image_pointer1GetImagePointer1GetImagePointer1GetImagePointer1get_image_pointer1 returns a pointer to the first channel of the image ImageImageImageImageimageimage. Additionally, the image type (TypeTypeTypeTypetypetype = 'byte', 'int2', 'uint2', etc.) and the image size (width and height) are returned. Consequently, a direct access to the image data in the HALCON database via the pointer is possible from the programming language in which HALCON is used. An image is stored in HALCON linearized in row major order, i.e., line by line. Note that the image types 'complex' and 'vector_type' are handled in a specific way. In particular, 'complex' images are interleaved, i.e., the real and the imaginary parts are alternating. In contrast, 'vector_field' images consist of two matrices, one for the rows and one for the columns, which are stored in the HALCON database one after the other.

注意

The pointer returned by get_image_pointer1get_image_pointer1GetImagePointer1GetImagePointer1GetImagePointer1get_image_pointer1 may only be used as long as the corresponding image object exists in the HALCON database. This is the case as long as the corresponding variable in the programming language in which HALCON is used is valid. If this is not observed, unexpected behavior or program crashes may result.

If data is written to an existing image via the pointer, all image objects that reference the image are modified. If, for example, the domain of an image is restricted via reduce_domainreduce_domainReduceDomainReduceDomainReduceDomainreduce_domain, the original image object with the full domain and the image object with the reduced domain share the same image matrix (i.e., get_image_pointer1get_image_pointer1GetImagePointer1GetImagePointer1GetImagePointer1get_image_pointer1 returns the same pointer for both images). Consequently, if one of the two images in this example is modified, both image objects are affected. Therefore, if the pointer is used to write image data in the programming language in which HALCON is used, the image data should be written into an image object that has been created solely for this purpose, e.g., using gen_image1gen_image1GenImage1GenImage1GenImage1gen_image1。For multi-channel input images the type and the pointer of the first channel is returned.

执行信息

参数

ImageImageImageImageimageimage (输入对象)  singlechannelimage(-array) objectHImageHObjectHImageHobject (byte / direction / cyclic / int1 / int2 / uint2 / int4 / int8 / real / complex / vector_field)

输入图像。

PointerPointerPointerPointerpointerpointer (输出控制)  pointer(-array) HTupleSequence[int]HTupleHtuple (integer) (IntPtr) (Hlong) (Hlong)

Pointer to the image data in the HALCON database.

TypeTypeTypeTypetypetype (输出控制)  string(-array) HTupleSequence[str]HTupleHtuple (string) (string) (HString) (char*)

Type of image.

值列表: 'byte'"byte""byte""byte""byte""byte", 'complex'"complex""complex""complex""complex""complex", 'cyclic'"cyclic""cyclic""cyclic""cyclic""cyclic", 'direction'"direction""direction""direction""direction""direction", 'int1'"int1""int1""int1""int1""int1", 'int2'"int2""int2""int2""int2""int2", 'int4'"int4""int4""int4""int4""int4", 'int8'"int8""int8""int8""int8""int8", 'real'"real""real""real""real""real", 'uint2'"uint2""uint2""uint2""uint2""uint2", 'vector_field_absolute'"vector_field_absolute""vector_field_absolute""vector_field_absolute""vector_field_absolute""vector_field_absolute", 'vector_field_relative'"vector_field_relative""vector_field_relative""vector_field_relative""vector_field_relative""vector_field_relative"

WidthWidthWidthWidthwidthwidth (输出控制)  extent.x(-array) HTupleSequence[int]HTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Width of image.

HeightHeightHeightHeightheightheight (输出控制)  extent.y(-array) HTupleSequence[int]HTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Height of image.

示例(C)

Hobject  Image;
char     typ[128];
Hlong     width,height;
unsigned char *ptr;

read_image(&Image,"fabrik");
get_image_pointer1(Image,(Hlong*)&ptr,typ,&width,&height);

结果

算子 get_image_pointer1get_image_pointer1GetImagePointer1GetImagePointer1GetImagePointer1get_image_pointer1 返回值 2 ( H_MSG_TRUE) if exactly one image was passed.当输入为空(无可用输入图像)时可设置行为通过算子 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>)。如有必要,则抛出异常。

可能的前趋

read_imageread_imageReadImageReadImageReadImageread_image

替代

set_grayvalset_grayvalSetGrayvalSetGrayvalSetGrayvalset_grayval, get_grayvalget_grayvalGetGrayvalGetGrayvalGetGrayvalget_grayval, get_image_pointer3get_image_pointer3GetImagePointer3GetImagePointer3GetImagePointer3get_image_pointer3, get_image_sizeget_image_sizeGetImageSizeGetImageSizeGetImageSizeget_image_size, get_image_typeget_image_typeGetImageTypeGetImageTypeGetImageTypeget_image_type

另见

paint_regionpaint_regionPaintRegionPaintRegionPaintRegionpaint_region, paint_graypaint_grayPaintGrayPaintGrayPaintGraypaint_gray

模块

基础