read_sequenceReadSequenceReadSequenceread_sequenceread_sequence
説明
read_sequenceReadSequenceReadSequenceread_sequenceread_sequence — フォーマットを持たない画像を読み込む。
書式
read_sequence( out image Image, integer HeaderSize, extent.x SourceWidth, extent.y SourceHeight, point.y StartRow, point.x StartColumn, extent.x DestWidth, extent.y DestHeight, string PixelType, string BitOrder, string ByteOrder, string Pad, integer Index, filename.read FileName )void ReadSequence( HObject* Image, const HTuple& HeaderSize, const HTuple& SourceWidth, const HTuple& SourceHeight, const HTuple& StartRow, const HTuple& StartColumn, const HTuple& DestWidth, const HTuple& DestHeight, const HTuple& PixelType, const HTuple& BitOrder, const HTuple& ByteOrder, const HTuple& Pad, const HTuple& Index, const HTuple& FileName )static void HOperatorSet.ReadSequence( out HObject image, HTuple headerSize, HTuple sourceWidth, HTuple sourceHeight, HTuple startRow, HTuple startColumn, HTuple destWidth, HTuple destHeight, HTuple pixelType, HTuple bitOrder, HTuple byteOrder, HTuple pad, HTuple index, HTuple fileName )def read_sequence( header_size: int, source_width: int, source_height: int, start_row: int, start_column: int, dest_width: int, dest_height: int, pixel_type: str, bit_order: str, byte_order: str, pad: str, index: int, file_name: str ) -> HObject
Herror read_sequence( Hobject* Image, const Hlong HeaderSize, const Hlong SourceWidth, const Hlong SourceHeight, const Hlong StartRow, const Hlong StartColumn, const Hlong DestWidth, const Hlong DestHeight, const char* PixelType, const char* BitOrder, const char* ByteOrder, const char* Pad, const Hlong Index, const char* FileName )
Herror T_read_sequence( Hobject* Image, const Htuple HeaderSize, const Htuple SourceWidth, const Htuple SourceHeight, const Htuple StartRow, const Htuple StartColumn, const Htuple DestWidth, const Htuple DestHeight, const Htuple PixelType, const Htuple BitOrder, const Htuple ByteOrder, const Htuple Pad, const Htuple Index, const Htuple FileName )
void HImage::ReadSequence( Hlong HeaderSize, Hlong SourceWidth, Hlong SourceHeight, Hlong StartRow, Hlong StartColumn, Hlong DestWidth, Hlong DestHeight, const HString& PixelType, const HString& BitOrder, const HString& ByteOrder, const HString& Pad, Hlong Index, const HString& FileName )
void HImage::ReadSequence( Hlong HeaderSize, Hlong SourceWidth, Hlong SourceHeight, Hlong StartRow, Hlong StartColumn, Hlong DestWidth, Hlong DestHeight, const char* PixelType, const char* BitOrder, const char* ByteOrder, const char* Pad, Hlong Index, const char* FileName )
void HImage::ReadSequence( Hlong HeaderSize, Hlong SourceWidth, Hlong SourceHeight, Hlong StartRow, Hlong StartColumn, Hlong DestWidth, Hlong DestHeight, const wchar_t* PixelType, const wchar_t* BitOrder, const wchar_t* ByteOrder, const wchar_t* Pad, Hlong Index, const wchar_t* FileName ) (Windows only)
void HImage.ReadSequence( int headerSize, int sourceWidth, int sourceHeight, int startRow, int startColumn, int destWidth, int destHeight, string pixelType, string bitOrder, string byteOrder, string pad, int index, string fileName )
説明
オペレーター read_sequenceReadSequence はファイルからのフォーマットさ
れていない画像データを読み込み、“適切な”画像を返します。画像デー
タはピクセルごと、直線ごとに連続している必要があります。
長さ HeaderSizeheaderSizeheader_size バイトをもつ任意のファイルヘッダはスキッ
プされます。パラメーター SourceWidthsourceWidthsource_width と
SourceHeightsourceHeightsource_height は画像サイズを示します。
DestWidthdestWidthdest_width と DestHeightdestHeightdest_height は画像サイズを示します。
最も単純な場合、これらのパラメーターは同じとなります。しかし、エリ
アも読み込むことが可能です。要求する画像エリアの左上隅は、
StartRowstartRowstart_row と StartColumnstartColumnstart_column によって決まります。
ピクセルタイプ 'bit'"bit"、'byte'"byte"、'short'"short"(
16 ビット、符号なし)、'signed_short'"signed_short"(16 ビット、符号あ
り)、'long'"long"(32 ビット、符号あり)、
'swapped_long'"swapped_long"(32 ビット、上位下位交換)、および
'real'"real"(32 ビット浮動小数点数)がサポートされています。さ
らに、3 つのバイト(赤、緑、青
の連続)が画像ファイルに埋め込まれている場合、オペレーター
read_sequenceReadSequence は、RGB 画像の要素の抽出を可能にします。赤の
構成要素に対して画素タイプ 'r_byte'"r_byte" が選ばれなければなら
ず、同様に緑と青の構成要素についてもそれぞれ 'g_byte'"g_byte" ま
たは 'b_byte'"b_byte" が選ばれなければなりません。
'MSBFirst'"MSBFirst"(most significant bit first の略)またはその逆
('LSBFirst'"LSBFirst")は、ビット順序(BitOrderbitOrderbit_order)に対して
選定可能です。バイト順序(ByteOrderbyteOrderbyte_order)'MSBFirst'"MSBFirst"
(most significant byte first)もしくは 'LSBFirst'"LSBFirst" も同様
に処理されます。
最後に、アライメント(Padpadpad)を直線 :'byte'"byte"、
'short'"short"、または 'long'"long" の最後に設定することがで
きます。全部の画像シーケンスがファイルに保存される場合、1 つの画像
(インデックス 1 で始まる)はパラメーター Indexindexindex により選
定できます。
画像ファイルは、カレントディレクトリ(環境変数 HALCONIMAGES
で指定された)と HALCON の画像ディレクトリから検索されます。
HALCON の画像ディレクトリは UNIX 環境の場合はデフォルトでは
'.' と '/usr/local/halcon/images' に設定されてお
り、オペレーター set_systemSetSystem で変更することができます。画像
ディレクトリは複数指定することが可能です。その場合、各ディレクトリ
をコロンで区切って指定します。
またサーチパスを環境変数 HALCONIMAGES ('image_dir'"image_dir" と同
じ構造)で設定することができます。例えば、以下のとおりです。
setenv HALCONIMAGES "/usr/images:/usr/local/halcon/images"
*
HALCON はサブディレクトリ 'images' (プログラム例の画
像)でも画像を検索することができます。環境変数 HALCONROOT は
HALCON ディレクトリで使用されます。
注意
ピクセル型 'real'"real" のファイルが読み込まれ、そのバイト順序
が(ファイル内に格納されたデータのバイト順序と異なって)不正確であ
れば、浮動小数点の例外の結果としてプログラムエラーが発生し、クラッ
シュします。
実行情報
実行情報
パラメーター
Imageimageimage (output_object) image → object (byte / int2 / uint2 / int4)HObject (byte / int2 / uint2 / int4)HImage (byte / int2 / uint2 / int4)HObject (byte / int2 / uint2 / int4)Hobject * (byte / int2 / uint2 / int4)
読み込まれる画像
ファイルヘッダに対するバイト数
初期値: 00
値域: 0 ≤ HeaderSize
SourceWidthsourceWidthsource_width (input_control) extent.x → (integer)HTuple (Hlong)HTuple (int / long)intHtuple (Hlong)
フィールド画像の画像列数
初期値: 512512
値域: 1 ≤ SourceWidth
SourceHeightsourceHeightsource_height (input_control) extent.y → (integer)HTuple (Hlong)HTuple (int / long)intHtuple (Hlong)
フィールド画像の画像行数
初期値: 512512
値域: 1 ≤ SourceHeight
StartRowstartRowstart_row (input_control) point.y → (integer)HTuple (Hlong)HTuple (int / long)intHtuple (Hlong)
画像エリア (行) の開始点
初期値: 00
値域: 0 ≤ StartRow
制限: StartRow < SourceHeight
StartColumnstartColumnstart_column (input_control) point.x → (integer)HTuple (Hlong)HTuple (int / long)intHtuple (Hlong)
画像エリア (列) の開始点
初期値: 00
値域: 0 ≤ StartColumn
制限: StartColumn < SourceWidth
DestWidthdestWidthdest_width (input_control) extent.x → (integer)HTuple (Hlong)HTuple (int / long)intHtuple (Hlong)
出力画像の画像列数
初期値: 512512
値域: 1 ≤ DestWidth
制限: DestWidth <= SourceWidth
DestHeightdestHeightdest_height (input_control) extent.y → (integer)HTuple (Hlong)HTuple (int / long)intHtuple (Hlong)
出力画像の画像行数
初期値: 512512
値域: 1 ≤ DestHeight
制限: DestHeight <= SourceHeight
PixelTypepixelTypepixel_type (input_control) string → (string)HTuple (HString)HTuple (string)strHtuple (char*)
ピクセル値の型
初期値: 'byte'"byte"
値のリスト: 'b_byte', 'bit', 'byte', 'g_byte', 'long', 'r_byte', 'real', 'short', 'signed_short', 'swapped_long'"b_byte", "bit", "byte", "g_byte", "long", "r_byte", "real", "short", "signed_short", "swapped_long"
BitOrderbitOrderbit_order (input_control) string → (string)HTuple (HString)HTuple (string)strHtuple (char*)
1 バイト内のビットシーケンス
初期値: 'MSBFirst'"MSBFirst"
値のリスト: 'LSBFirst', 'MSBFirst'"LSBFirst", "MSBFirst"
ByteOrderbyteOrderbyte_order (input_control) string → (string)HTuple (HString)HTuple (string)strHtuple (char*)
1 つの ‘short’ 単位内のバイトシーケンス
初期値: 'MSBFirst'"MSBFirst"
値のリスト: 'LSBFirst', 'MSBFirst'"LSBFirst", "MSBFirst"
Padpadpad (input_control) string → (string)HTuple (HString)HTuple (string)strHtuple (char*)
1 つの画像行(配列) 範囲内のデータ単位
初期値: 'byte'"byte"
値のリスト: 'byte', 'long', 'short'"byte", "long", "short"
Indexindexindex (input_control) integer → (integer)HTuple (Hlong)HTuple (int / long)intHtuple (Hlong)
ファイルにおける画像数
初期値: 11
値域: 1 ≤ Index (lin)
FileNamefileNamefile_name (input_control) filename.read → (string)HTuple (HString)HTuple (string)strHtuple (char*)
入力ファイルの名前
結果
パラメーター値が正しい場合、オペレーター read_sequenceReadSequence は
値 2 (H_MSG_TRUE) を返します。それ以外の場合には例外が発生します。
他のオペレーターとの組み合わせ
組み合わせ
後処理の候補
disp_imageDispImage, count_channelsCountChannels, decompose3Decompose3, write_imageWriteImage, rgb1_to_grayRgb1ToGray
他の選択候補
read_imageReadImage
関連項目
read_imageReadImage
モジュール
Foundation