decode_bar_code_rectangle2 T_decode_bar_code_rectangle2 DecodeBarCodeRectangle2 DecodeBarCodeRectangle2 decode_bar_code_rectangle2 (算子)
名称
decode_bar_code_rectangle2 T_decode_bar_code_rectangle2 DecodeBarCodeRectangle2 DecodeBarCodeRectangle2 decode_bar_code_rectangle2 — 解码矩形内的条形码符号。
签名
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 )
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)
static void HOperatorSet .DecodeBarCodeRectangle2 (HObject image , HTuple barCodeHandle , HTuple codeType , HTuple row , HTuple column , HTuple phi , HTuple length1 , HTuple length2 , out HTuple decodedDataStrings )
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 )
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]]) -> str
描述
算子 decode_bar_code_rectangle2 decode_bar_code_rectangle2 DecodeBarCodeRectangle2 DecodeBarCodeRectangle2 DecodeBarCodeRectangle2 decode_bar_code_rectangle2 uses the bar code
model specified by BarCodeHandle BarCodeHandle BarCodeHandle BarCodeHandle barCodeHandle bar_code_handle to decode a bar code at
a given position within the image Image Image Image Image image image .
BarCodeHandle BarCodeHandle BarCodeHandle BarCodeHandle barCodeHandle bar_code_handle must be created with
create_bar_code_model create_bar_code_model CreateBarCodeModel CreateBarCodeModel CreateBarCodeModel create_bar_code_model , its parameters can be set with
set_bar_code_param set_bar_code_param SetBarCodeParam SetBarCodeParam SetBarCodeParam set_bar_code_param 。The position of the bar code is given
as an arbitrarily oriented rectangle. Contrary to
find_bar_code find_bar_code FindBarCode FindBarCode FindBarCode find_bar_code , where the decoding is preceded by a time
consuming search for candidate regions,
decode_bar_code_rectangle2 decode_bar_code_rectangle2 DecodeBarCodeRectangle2 DecodeBarCodeRectangle2 DecodeBarCodeRectangle2 decode_bar_code_rectangle2 scans the provided region directly
for bar codes. The rectangular region is defined by the parameters
Row Row Row Row row row and Column Column Column Column column column for the center, Phi Phi Phi Phi phi phi for
the orientation and Length1 Length1 Length1 Length1 length1 length_1 and Length2 Length2 Length2 Length2 length2 length_2 for the
half edge lengths (see gen_rectangle2 gen_rectangle2 GenRectangle2 GenRectangle2 GenRectangle2 gen_rectangle2 ). The angle Phi Phi Phi Phi phi phi
also determines the reading direction and is defined as the angle
between the reading direction of the bar code and the horizontal
image axis. The angle is positive in counter clockwise direction and
is given in radians as in gen_rectangle2 gen_rectangle2 GenRectangle2 GenRectangle2 GenRectangle2 gen_rectangle2 。Note that the angle
unit deviates from the conventions in get_bar_code_result get_bar_code_result GetBarCodeResult GetBarCodeResult GetBarCodeResult get_bar_code_result and
set_bar_code_param set_bar_code_param SetBarCodeParam SetBarCodeParam SetBarCodeParam set_bar_code_param where angles are given in degrees.
Phi Phi Phi Phi phi phi can be in the range of
[
].
The reading direction is perpendicular to the bars of the bar code.
Bar codes with a reading direction
are also returned.
Multiple regions for decoding can be given by supplying tuples for
Row Row Row Row row row , Column Column Column Column column column , Phi Phi Phi Phi phi phi , Length1 Length1 Length1 Length1 length1 length_1 and
Length2 Length2 Length2 Length2 length2 length_2 。
The rectangle should cover completely the bar code and the quiet zones.
Regions that are too big will be decoded, if there is no disturbing
pattern within these regions and the height (Length2 Length2 Length2 Length2 length2 length_2 ) is
small enough such that scanlines can be placed sufficiently dense.
Rectangles that are too short in reading direction (Length1 Length1 Length1 Length1 length1 length_1 )
cannot be decoded.
decode_bar_code_rectangle2 decode_bar_code_rectangle2 DecodeBarCodeRectangle2 DecodeBarCodeRectangle2 DecodeBarCodeRectangle2 decode_bar_code_rectangle2 can be used if the position of
the bar code is already known in advance. For example, the candidate
regions found by find_bar_code find_bar_code FindBarCode FindBarCode FindBarCode find_bar_code and get_bar_code_object get_bar_code_object GetBarCodeObject GetBarCodeObject GetBarCodeObject get_bar_code_object
could be reused with a different code type (see the following example).
Multiple bar code types can be specified for CodeType CodeType CodeType CodeType codeType code_type . See
section Autodiscrimination for find_bar_code find_bar_code FindBarCode FindBarCode FindBarCode find_bar_code 。
Further aspects of the actual decoding are explained with the operator
find_bar_code find_bar_code FindBarCode FindBarCode FindBarCode find_bar_code 。
执行信息
多线程类型:可重入(与非独占算子并行运行)。
多线程作用域:全局(可从任何线程调用)。
在内部数据级别上自动并行化。
此算子支持取消超时和中断。
此算子修改后续输入参数的状态:
在执行此算子时,若该参数值需在多个线程间使用,则必须对其访问进行同步。
参数
Image Image Image Image image image (输入对象) singlechannelimage → object HImage HObject HImage Hobject (byte)
输入图像。
BarCodeHandle BarCodeHandle BarCodeHandle BarCodeHandle barCodeHandle bar_code_handle (输入控制,状态被修改) barcode → HBarCode , HTuple HHandle HTuple Htuple (handle) (IntPtr ) (HHandle ) (handle )
Handle of the bar code model.
CodeType CodeType CodeType CodeType codeType code_type (输入控制) string(-array) → HTuple MaybeSequence[str] HTuple Htuple (string) (string ) (HString ) (char* )
Type of the searched bar code.
默认值:
'EAN-13'
"EAN-13"
"EAN-13"
"EAN-13"
"EAN-13"
"EAN-13"
值列表:
'2/5 Industrial' "2/5 Industrial" "2/5 Industrial" "2/5 Industrial" "2/5 Industrial" "2/5 Industrial" , '2/5 Interleaved' "2/5 Interleaved" "2/5 Interleaved" "2/5 Interleaved" "2/5 Interleaved" "2/5 Interleaved" , 'Codabar' "Codabar" "Codabar" "Codabar" "Codabar" "Codabar" , 'Code 128' "Code 128" "Code 128" "Code 128" "Code 128" "Code 128" , 'Code 39' "Code 39" "Code 39" "Code 39" "Code 39" "Code 39" , 'Code 93' "Code 93" "Code 93" "Code 93" "Code 93" "Code 93" , 'EAN-13 Add-On 2' "EAN-13 Add-On 2" "EAN-13 Add-On 2" "EAN-13 Add-On 2" "EAN-13 Add-On 2" "EAN-13 Add-On 2" , 'EAN-13 Add-On 5' "EAN-13 Add-On 5" "EAN-13 Add-On 5" "EAN-13 Add-On 5" "EAN-13 Add-On 5" "EAN-13 Add-On 5" , 'EAN-13' "EAN-13" "EAN-13" "EAN-13" "EAN-13" "EAN-13" , 'EAN-8 Add-On 2' "EAN-8 Add-On 2" "EAN-8 Add-On 2" "EAN-8 Add-On 2" "EAN-8 Add-On 2" "EAN-8 Add-On 2" , 'EAN-8 Add-On 5' "EAN-8 Add-On 5" "EAN-8 Add-On 5" "EAN-8 Add-On 5" "EAN-8 Add-On 5" "EAN-8 Add-On 5" , 'EAN-8' "EAN-8" "EAN-8" "EAN-8" "EAN-8" "EAN-8" , 'GS1 DataBar Expanded Stacked' "GS1 DataBar Expanded Stacked" "GS1 DataBar Expanded Stacked" "GS1 DataBar Expanded Stacked" "GS1 DataBar Expanded Stacked" "GS1 DataBar Expanded Stacked" , 'GS1 DataBar Expanded' "GS1 DataBar Expanded" "GS1 DataBar Expanded" "GS1 DataBar Expanded" "GS1 DataBar Expanded" "GS1 DataBar Expanded" , 'GS1 DataBar Limited' "GS1 DataBar Limited" "GS1 DataBar Limited" "GS1 DataBar Limited" "GS1 DataBar Limited" "GS1 DataBar Limited" , 'GS1 DataBar Omnidir' "GS1 DataBar Omnidir" "GS1 DataBar Omnidir" "GS1 DataBar Omnidir" "GS1 DataBar Omnidir" "GS1 DataBar Omnidir" , 'GS1 DataBar Stacked Omnidir' "GS1 DataBar Stacked Omnidir" "GS1 DataBar Stacked Omnidir" "GS1 DataBar Stacked Omnidir" "GS1 DataBar Stacked Omnidir" "GS1 DataBar Stacked Omnidir" , 'GS1 DataBar Stacked' "GS1 DataBar Stacked" "GS1 DataBar Stacked" "GS1 DataBar Stacked" "GS1 DataBar Stacked" "GS1 DataBar Stacked" , 'GS1 DataBar Truncated' "GS1 DataBar Truncated" "GS1 DataBar Truncated" "GS1 DataBar Truncated" "GS1 DataBar Truncated" "GS1 DataBar Truncated" , 'GS1-128' "GS1-128" "GS1-128" "GS1-128" "GS1-128" "GS1-128" , 'MSI' "MSI" "MSI" "MSI" "MSI" "MSI" , 'PharmaCode' "PharmaCode" "PharmaCode" "PharmaCode" "PharmaCode" "PharmaCode" , 'UPC-A Add-On 2' "UPC-A Add-On 2" "UPC-A Add-On 2" "UPC-A Add-On 2" "UPC-A Add-On 2" "UPC-A Add-On 2" , 'UPC-A Add-On 5' "UPC-A Add-On 5" "UPC-A Add-On 5" "UPC-A Add-On 5" "UPC-A Add-On 5" "UPC-A Add-On 5" , 'UPC-A' "UPC-A" "UPC-A" "UPC-A" "UPC-A" "UPC-A" , 'UPC-E Add-On 2' "UPC-E Add-On 2" "UPC-E Add-On 2" "UPC-E Add-On 2" "UPC-E Add-On 2" "UPC-E Add-On 2" , 'UPC-E Add-On 5' "UPC-E Add-On 5" "UPC-E Add-On 5" "UPC-E Add-On 5" "UPC-E Add-On 5" "UPC-E Add-On 5" , 'UPC-E' "UPC-E" "UPC-E" "UPC-E" "UPC-E" "UPC-E" , 'auto' "auto" "auto" "auto" "auto" "auto"
Row Row Row Row row row (输入控制) rectangle2.center.y(-array) → HTuple MaybeSequence[Union[int, float]] HTuple Htuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong)
中心列索引。
默认值:
50.0
Column Column Column Column column column (输入控制) rectangle2.center.x(-array) → HTuple MaybeSequence[Union[int, float]] HTuple Htuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong)
中心列索引。
默认值:
100.0
Phi Phi Phi Phi phi phi (输入控制) rectangle2.angle.rad(-array) → HTuple MaybeSequence[Union[int, float]] HTuple Htuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong)
Orientation of rectangle in radians.
默认值:
0.0
建议值:
0.0, 0.785398, 1.570796, 3.1415926
Length1 Length1 Length1 Length1 length1 length_1 (输入控制) rectangle2.hwidth(-array) → HTuple MaybeSequence[Union[int, float]] HTuple Htuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong)
Half of the length of the rectangle along the reading
direction of the bar code.
默认值:
200.0
Length2 Length2 Length2 Length2 length2 length_2 (输入控制) rectangle2.hheight(-array) → HTuple MaybeSequence[Union[int, float]] HTuple Htuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong)
Half of the length of the rectangle perpendicular to
the reading direction of the bar code.
默认值:
100.0
DecodedDataStrings DecodedDataStrings DecodedDataStrings DecodedDataStrings decodedDataStrings decoded_data_strings (输出控制) string(-array) → HTuple Sequence[str] HTuple Htuple (string) (string ) (HString ) (char* )
Data strings of all successfully decoded bar codes.
示例(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_rectangle2 decode_bar_code_rectangle2 DecodeBarCodeRectangle2 DecodeBarCodeRectangle2 DecodeBarCodeRectangle2 decode_bar_code_rectangle2 在给定的参数正确时返回值 2 ( H_MSG_TRUE )。否则,将抛出异常。
可能的前趋
create_bar_code_model create_bar_code_model CreateBarCodeModel CreateBarCodeModel CreateBarCodeModel create_bar_code_model ,
set_bar_code_param set_bar_code_param SetBarCodeParam SetBarCodeParam SetBarCodeParam set_bar_code_param ,
smallest_rectangle2 smallest_rectangle2 SmallestRectangle2 SmallestRectangle2 SmallestRectangle2 smallest_rectangle2
可能的后继
get_bar_code_result get_bar_code_result GetBarCodeResult GetBarCodeResult GetBarCodeResult get_bar_code_result ,
get_bar_code_object get_bar_code_object GetBarCodeObject GetBarCodeObject GetBarCodeObject get_bar_code_object ,
clear_bar_code_model clear_bar_code_model ClearBarCodeModel ClearBarCodeModel ClearBarCodeModel clear_bar_code_model
替代
find_bar_code find_bar_code FindBarCode FindBarCode FindBarCode find_bar_code
另见
gen_rectangle2 gen_rectangle2 GenRectangle2 GenRectangle2 GenRectangle2 gen_rectangle2
模块
条形码