Skip to content

get_image_pointer1GetImagePointer1GetImagePointer1get_image_pointer1get_image_pointer1🔗

説明🔗

get_image_pointer1GetImagePointer1GetImagePointer1get_image_pointer1get_image_pointer1 — あるチャンネルのポインタにアクセスする。

書式🔗

get_image_pointer1( image Image, out pointer Pointer, out string Type, out extent.x Width, out extent.y Height )void GetImagePointer1( const HObject& Image, HTuple* Pointer, HTuple* Type, HTuple* Width, HTuple* Height )static void HOperatorSet.GetImagePointer1( HObject image, out HTuple pointer, out HTuple type, out HTuple width, out HTuple 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]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 )

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

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

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

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

説明🔗

オペレーター get_image_pointer1GetImagePointer1 は画像 Imageimageimage の最 初のチャンネルへのポインタを返します。さらに、画像の型( Typetypetype = ‘byte’、’int2’、’uint2’ など)と画像のサイズ(幅と高 さ)も返します。したがって、そのポインタを利用し HALCON データベース内 の画像データへは、HALCON で使用されるプログラミング言語から直接ア クセスすることができます。 画像は行順、つまり行ごとに線形化され、HALCON 内に格納されます。 データ型が’complex’,’vector_type’の画像は特殊な方法で処理されることに注意 してください。特に’complex’画像は実数と虚数が交互に処理されます。 一方、’vector_field’画像は2つの行列で構成されており、1つは行(row)、もう1つは 列(column)の情報です。 これらはHALCONのデータベース上に順に格納されます。

注意🔗

対応する画像オブジェクトが HALCON データベース内に存在する限り、 get_image_pointer1GetImagePointer1 によって返されるポインタのみが使用され ます。これは HALCON で使用されるプログラミング言語内で対応する変数 が存在する限り有効です。変数が見えなくなった場合には、予期せぬ振る舞いまたは プログラムがクラッシュする可能性があります。

データがポインタを利用し既存の画像に書き込まれる場合、この画像を参照す るすべての画像オブジェクトが修正されます。例えば、画像領域が reduce_domainReduceDomain で制限される場合、完全領域をもつオリジナルの 画像オブジェクトと縮小された領域をもつ画像オブジェクトは、同じ画像 行列を共有します(つまり、get_image_pointer1GetImagePointer1 はどちらの画 像に対しても同じポインタを返します)。この結果、この例では、この 2 つの画像のうちの 1 つが修正され、どちらの画像オブジェクトも影響 を受けます。したがって、ポインタが HALCON で使用されるプログラミング言 語で画像データを書き込むために使用される場合、画像データは例えば、 gen_image1GenImage1 を使用し、単にこの目的のために生成される画像オ ブジェクトへ書き込まれるべきです。

実行情報🔗

実行情報
  • マルチスレッドタイプ: リエントラント(非排他なオペレーターと並列に動作)

  • マルチスレッドスコープ: グローバル(他のスレッドから呼び出される可能性あり)

  • 並列演算処理には未対応

パラメーター🔗

Imageimageimage (input_object) singlechannelimage(-array) → object (byte / direction / cyclic / int1 / int2 / uint2 / int4 / int8 / real / complex / vector_field)HObject (byte / direction / cyclic / int1 / int2 / uint2 / int4 / int8 / real / complex / vector_field)HImage (byte / direction / cyclic / int1 / int2 / uint2 / int4 / int8 / real / complex / vector_field)HObject (byte / direction / cyclic / int1 / int2 / uint2 / int4 / int8 / real / complex / vector_field)Hobject (byte / direction / cyclic / int1 / int2 / uint2 / int4 / int8 / real / complex / vector_field)

入力画像

Pointerpointerpointer (output_control) pointer(-array) → (integer)HTuple (Hlong)HTuple (IntPtr)Sequence[int]Htuple (Hlong)

HALCON データベース内の画像データへのポインタ

Typetypetype (output_control) string(-array) → (string)HTuple (HString)HTuple (string)Sequence[str]Htuple (char*)

画像の型

値のリスト: 'byte', 'complex', 'cyclic', 'direction', 'int1', 'int2', 'int4', 'int8', 'real', 'uint2', 'vector_field_absolute', 'vector_field_relative'"byte", "complex", "cyclic", "direction", "int1", "int2", "int4", "int8", "real", "uint2", "vector_field_absolute", "vector_field_relative"

Widthwidthwidth (output_control) extent.x(-array) → (integer)HTuple (Hlong)HTuple (int / long)Sequence[int]Htuple (Hlong)

画像の幅

Heightheightheight (output_control) extent.y(-array) → (integer)HTuple (Hlong)HTuple (int / long)Sequence[int]Htuple (Hlong)

画像の高さ

例🔗

(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_pointer1GetImagePointer1 は、値 2 (H_MSG_TRUE) を返します。 入力が空だった場合(入力画像が得られない場合)の動作は、オペレー ター set_system('no_object_result',<Result>) で設定されま す。 必要に応じて、例外処理が発生します。

他のオペレーターとの組み合わせ🔗

組み合わせ

前処理の候補

read_imageReadImage

他の選択候補

set_grayvalSetGrayval, get_grayvalGetGrayval, get_image_pointer3GetImagePointer3, get_image_sizeGetImageSize, get_image_typeGetImageType

関連項目

paint_regionPaintRegion, paint_grayPaintGray

モジュール🔗

Foundation