Skip to content

decode_bar_code_rectangle2DecodeBarCodeRectangle2DecodeBarCodeRectangle2decode_bar_code_rectangle2T_decode_bar_code_rectangle2🔗

説明🔗

decode_bar_code_rectangle2DecodeBarCodeRectangle2DecodeBarCodeRectangle2decode_bar_code_rectangle2T_decode_bar_code_rectangle2 — 矩形内の1次元バーコードシンボルをデコードする。

書式🔗

decode_bar_code_rectangle2( image Image, barcode BarCodeHandle, string CodeType, rectangle2.center.y Row, rectangle2.center.x Column, rectangle2.angle.rad Phi, rectangle2.hwidth Length1, rectangle2.hheight Length2, out string DecodedDataStrings )void DecodeBarCodeRectangle2( const HObject& Image, const HTuple& BarCodeHandle, const HTuple& CodeType, const HTuple& Row, const HTuple& Column, const HTuple& Phi, const HTuple& Length1, const HTuple& Length2, HTuple* DecodedDataStrings )static void HOperatorSet.DecodeBarCodeRectangle2( HObject image, HTuple barCodeHandle, HTuple codeType, HTuple row, HTuple column, HTuple phi, HTuple length1, HTuple length2, out HTuple decodedDataStrings )def decode_bar_code_rectangle2( image: HObject, bar_code_handle: HHandle, code_type: MaybeSequence[str], row: MaybeSequence[Union[int, float]], column: MaybeSequence[Union[int, float]], phi: MaybeSequence[Union[int, float]], length_1: MaybeSequence[Union[int, float]], length_2: MaybeSequence[Union[int, float]] ) -> Sequence[str]

def decode_bar_code_rectangle2_s( image: HObject, bar_code_handle: HHandle, code_type: MaybeSequence[str], row: MaybeSequence[Union[int, float]], column: MaybeSequence[Union[int, float]], phi: MaybeSequence[Union[int, float]], length_1: MaybeSequence[Union[int, float]], length_2: MaybeSequence[Union[int, float]] ) -> strHerror T_decode_bar_code_rectangle2( const Hobject Image, const Htuple BarCodeHandle, const Htuple CodeType, const Htuple Row, const Htuple Column, const Htuple Phi, const Htuple Length1, const Htuple Length2, Htuple* DecodedDataStrings )

HTuple HBarCode::DecodeBarCodeRectangle2( const HImage& Image, const HTuple& CodeType, const HTuple& Row, const HTuple& Column, const HTuple& Phi, const HTuple& Length1, const HTuple& Length2 ) const

HString HBarCode::DecodeBarCodeRectangle2( const HImage& Image, const HString& CodeType, double Row, double Column, double Phi, double Length1, double Length2 ) const

HString HBarCode::DecodeBarCodeRectangle2( const HImage& Image, const char* CodeType, double Row, double Column, double Phi, double Length1, double Length2 ) const

HString HBarCode::DecodeBarCodeRectangle2( const HImage& Image, const wchar_t* CodeType, double Row, double Column, double Phi, double Length1, double Length2 ) const (Windows only)

HTuple HImage::DecodeBarCodeRectangle2( const HBarCode& BarCodeHandle, const HTuple& CodeType, const HTuple& Row, const HTuple& Column, const HTuple& Phi, const HTuple& Length1, const HTuple& Length2 ) const

HString HImage::DecodeBarCodeRectangle2( const HBarCode& BarCodeHandle, const HString& CodeType, double Row, double Column, double Phi, double Length1, double Length2 ) const

HString HImage::DecodeBarCodeRectangle2( const HBarCode& BarCodeHandle, const char* CodeType, double Row, double Column, double Phi, double Length1, double Length2 ) const

HString HImage::DecodeBarCodeRectangle2( const HBarCode& BarCodeHandle, const wchar_t* CodeType, double Row, double Column, double Phi, double Length1, double Length2 ) const (Windows only)

HTuple HBarCode.DecodeBarCodeRectangle2( HImage image, HTuple codeType, HTuple row, HTuple column, HTuple phi, HTuple length1, HTuple length2 )

string HBarCode.DecodeBarCodeRectangle2( HImage image, string codeType, double row, double column, double phi, double length1, double length2 )

HTuple HImage.DecodeBarCodeRectangle2( HBarCode barCodeHandle, HTuple codeType, HTuple row, HTuple column, HTuple phi, HTuple length1, HTuple length2 )

string HImage.DecodeBarCodeRectangle2( HBarCode barCodeHandle, string codeType, double row, double column, double phi, double length1, double length2 )

説明🔗

decode_bar_code_rectangle2DecodeBarCodeRectangle2 オペレーターは、 BarCodeHandlebarCodeHandlebar_code_handle によって指定された1次元バーコードモデルを使用して、 Imageimageimage 画像の指定された位置の1次元バーコードをデコードします。 BarCodeHandlebarCodeHandlebar_code_handle は create_bar_code_modelCreateBarCodeModel を使用して 作成する必要があり、そのパラメーターは set_bar_code_paramSetBarCodeParam を使用して設定できます。1次元バーコードの位置は、 任意の方向の矩形として与えられます。デコード前に時間をかけて 候補領域の検出が行われる find_bar_codeFindBarCode とは異なり、 decode_bar_code_rectangle2DecodeBarCodeRectangle2 は指定された領域を直接スキャン して1次元バーコードを検出します。矩形領域は、Rowrowrow パラメーターと Columncolumncolumn パラメーターを使用して中心点が定義され、 Phiphiphi を使用して方向が定義され、Length1length1length_1 と Length2length2length_2 を使用して各辺の半分の長さが定義されます( gen_rectangle2GenRectangle2 を参照してください)。角度 Phiphiphi も 読み取り方向を決定し、1次元バーコードの読み取り方向と水平画像軸間の角度 として定義されます。この角度は反時計回りが正で、 gen_rectangle2GenRectangle2 にラジアン[rad]で指定します。角度の単位は、角度 を度[deg]で指定する get_bar_code_resultGetBarCodeResult と set_bar_code_paramSetBarCodeParam の場合と異なります。Phiphiphi には、 \([-\pi, +\pi]\)の 範囲の値を指定できます。 読み取り方向は1次元バーコードのバーに垂直です。 読み取り方向 \(\textrm{Phi} + \pi\) を含む 1次元バーコードも返されます。 Rowrowrow、Columncolumncolumn、Phiphiphi、Length1length1length_1、および Length2length2length_2 の tuple によって、複数のデコード領域を指定 することもできます。

矩形は、1次元バーコードとクワイエットゾーンを完全に含んでいる必要があります。 領域内に紛らわしいパターンがなければ、領域範囲が大きすぎてもデコード可能です。 また、高さ(Length2length2length_2)が小さい場合であっても、ス キャンラインが適切な間隔を確保できていればデコードできます。 読み取り方向の長さ(Length1length1length_1)が短すぎる矩形はデコードでき ません。

decode_bar_code_rectangle2DecodeBarCodeRectangle2 は、1次元バーコードの位置が事前にわ かっている場合に使用できます。例えば、find_bar_codeFindBarCode と get_bar_code_objectGetBarCodeObject によって検出された候補領域を別のバー コードタイプで再利用することもできます(以下の例を参照してください)。

CodeTypecodeTypecode_type には、複数の1次元バーコードタイプを指定できます。 find_bar_codeFindBarCode の自動識別のセクションを参照してください。

実際のデコードに関するその他の内容については、find_bar_codeFindBarCode オペ レーターで説明します。

実行情報🔗

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

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

  • 内部データレベルで自動的に並列演算処理を実施

このオペレータは、タイムアウトと割り込みのキャンセルをサポートします。

このオペレータは以下の入力パラメータの状態を変更します :

このパラメータの値は外部同期なしには複数スレッド間で共有されません。

パラメーター🔗

Imageimageimage (input_object) singlechannelimage → object (byte)HObject (byte)HImage (byte)HObject (byte)Hobject (byte)

入力画像。

BarCodeHandlebarCodeHandlebar_code_handle (input_control, 状態が変更されました) barcode → (handle)HTuple (HHandle)HBarCode, HTuple (IntPtr)HHandleHtuple (handle)

1次元バーコードモデルのハンドル

CodeTypecodeTypecode_type (input_control) string(-array) → (string)HTuple (HString)HTuple (string)MaybeSequence[str]Htuple (char*)

検出された1次元バーコードのタイプ

初期値: 'EAN-13'"EAN-13"
値のリスト: '2/5 Industrial', '2/5 Interleaved', 'Codabar', 'Code 128', 'Code 39', 'Code 93', 'EAN-13 Add-On 2', 'EAN-13 Add-On 5', 'EAN-13', 'EAN-8 Add-On 2', 'EAN-8 Add-On 5', 'EAN-8', 'GS1 DataBar Expanded Stacked', 'GS1 DataBar Expanded', 'GS1 DataBar Limited', 'GS1 DataBar Omnidir', 'GS1 DataBar Stacked Omnidir', 'GS1 DataBar Stacked', 'GS1 DataBar Truncated', 'GS1-128', 'MSI', 'PharmaCode', 'UPC-A Add-On 2', 'UPC-A Add-On 5', 'UPC-A', 'UPC-E Add-On 2', 'UPC-E Add-On 5', 'UPC-E', 'auto'"2/5 Industrial", "2/5 Interleaved", "Codabar", "Code 128", "Code 39", "Code 93", "EAN-13 Add-On 2", "EAN-13 Add-On 5", "EAN-13", "EAN-8 Add-On 2", "EAN-8 Add-On 5", "EAN-8", "GS1 DataBar Expanded Stacked", "GS1 DataBar Expanded", "GS1 DataBar Limited", "GS1 DataBar Omnidir", "GS1 DataBar Stacked Omnidir", "GS1 DataBar Stacked", "GS1 DataBar Truncated", "GS1-128", "MSI", "PharmaCode", "UPC-A Add-On 2", "UPC-A Add-On 5", "UPC-A", "UPC-E Add-On 2", "UPC-E Add-On 5", "UPC-E", "auto"

Rowrowrow (input_control) rectangle2.center.y(-array) → (real / integer)HTuple (double / Hlong)HTuple (double / int / long)MaybeSequence[Union[int, float]]Htuple (double / Hlong)

中心の行座標(インデックス)

初期値: 50.050.0

Columncolumncolumn (input_control) rectangle2.center.x(-array) → (real / integer)HTuple (double / Hlong)HTuple (double / int / long)MaybeSequence[Union[int, float]]Htuple (double / Hlong)

中心の列座標(インデックス)

初期値: 100.0100.0

Phiphiphi (input_control) rectangle2.angle.rad(-array) → (real / integer)HTuple (double / Hlong)HTuple (double / int / long)MaybeSequence[Union[int, float]]Htuple (double / Hlong)

矩形の方向(単位はラジアン)

初期値: 0.00.0
推奨値: 0.0, 0.785398, 1.570796, 3.14159260.0, 0.785398, 1.570796, 3.1415926

Length1length1length_1 (input_control) rectangle2.hwidth(-array) → (real / integer)HTuple (double / Hlong)HTuple (double / int / long)MaybeSequence[Union[int, float]]Htuple (double / Hlong)

1次元バーコードの読み取り方向に沿った矩形の半分の長さ

初期値: 200.0200.0

Length2length2length_2 (input_control) rectangle2.hheight(-array) → (real / integer)HTuple (double / Hlong)HTuple (double / int / long)MaybeSequence[Union[int, float]]Htuple (double / Hlong)

1次元バーコードの読み取り方向に垂直な矩形の半分の長さ

初期値: 100.0100.0

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

正常にデコードされた1次元バーコードのデータ文字列

例🔗

(HDevelop)


read_image (Image, 'barcode/ean13/ean1301.png')
create_bar_code_model ([], [], BHandle)
find_bar_code (Image, SymReg, BHandle, '2/5 Industrial', Dec)
if (|Dec| == 0)
*     A 2/5 Industrial code wasn't found. Try decoding an EAN-13 code.
    get_bar_code_object (CandReg, BHandle, 'all', 'candidate_regions')
    smallest_rectangle2 (CandReg, R, C, Phi, L1, L2)
    decode_bar_code_rectangle2 (Image, BHandle, 'EAN-13', R, C, Phi, \
                                L1, L2, Dec)
endif

結果🔗

パラメーターが正しければ、オペレーター decode_bar_code_rectangle2DecodeBarCodeRectangle2 は値 2 (H_MSG_TRUE) を返します。 さもなければ、例外処理が発生します。

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

組み合わせ

前処理の候補

create_bar_code_modelCreateBarCodeModel, set_bar_code_paramSetBarCodeParam, smallest_rectangle2SmallestRectangle2

後処理の候補

get_bar_code_resultGetBarCodeResult, get_bar_code_objectGetBarCodeObject, clear_bar_code_modelClearBarCodeModel

他の選択候補

find_bar_codeFindBarCode

関連項目

gen_rectangle2GenRectangle2

モジュール🔗

Bar Code