Name
get_2d_bar_code_posT_get_2d_bar_code_posGet2dBarCodePosget_2d_bar_code_posGet2dBarCodePosGet2dBarCodePos — Extract the data values of the elements (in ECC 200: “modules”) inside a
bar code region (“Data Matrix symbol”) and their positions in the image.
Warning
get_2d_bar_code_posget_2d_bar_code_posGet2dBarCodePosget_2d_bar_code_posGet2dBarCodePosGet2dBarCodePos is obsolete and is only provided for
reasons of backward compatibility. New applications should use the
functionality in the chapter Identification / Data Code for reading 2D data
code symbologies instead (see create_data_code_2d_modelcreate_data_code_2d_modelCreateDataCode2dModelcreate_data_code_2d_modelCreateDataCode2dModelCreateDataCode2dModel).
Herror get_2d_bar_code_pos(Hobject BarCodeRegion, Hobject Image, const HTuple& BarCodeDescr, const HTuple& CodeRegDescr, const HTuple& GenParamNames, const HTuple& GenParamValues, HTuple* BarCodeDimension, HTuple* BarCodeData, HTuple* DataElementRow, HTuple* DataElementCol)
HTuple HRegion::Get2dBarCodePos(const HImage& Image, const HTuple& BarCodeDescr, const HTuple& CodeRegDescr, const HTuple& GenParamNames, const HTuple& GenParamValues, HTuple* BarCodeData, HTuple* DataElementRow, HTuple* DataElementCol) const
HTuple HBarCode2D::Get2dBarCodePos(const HRegion& BarCodeRegion, const HImage& Image, const HTuple& CodeRegDescr, const HTuple& GenParamNames, const HTuple& GenParamValues, HTuple* BarCodeData, HTuple* DataElementRow, HTuple* DataElementCol) const
void Get2dBarCodePos(const HObject& BarCodeRegion, const HObject& Image, const HTuple& BarCodeDescr, const HTuple& CodeRegDescr, const HTuple& GenParamNames, const HTuple& GenParamValues, HTuple* BarCodeDimension, HTuple* BarCodeData, HTuple* DataElementRow, HTuple* DataElementCol)
HTuple HImage::Get2dBarCodePos(const HRegion& BarCodeRegion, const HTuple& BarCodeDescr, const HTuple& CodeRegDescr, const HTuple& GenParamNames, const HTuple& GenParamValues, HTuple* BarCodeData, HTuple* DataElementRow, HTuple* DataElementCol) const
HTuple HRegion::Get2dBarCodePos(const HImage& Image, const HTuple& BarCodeDescr, const HTuple& CodeRegDescr, const HTuple& GenParamNames, const HTuple& GenParamValues, HTuple* BarCodeData, HTuple* DataElementRow, HTuple* DataElementCol) const
void HOperatorSetX.Get2dBarCodePos(
[in] IHUntypedObjectX* BarCodeRegion, [in] IHUntypedObjectX* Image, [in] VARIANT BarCodeDescr, [in] VARIANT CodeRegDescr, [in] VARIANT GenParamNames, [in] VARIANT GenParamValues, [out] VARIANT* BarCodeDimension, [out] VARIANT* BarCodeData, [out] VARIANT* DataElementRow, [out] VARIANT* DataElementCol)
VARIANT HBarCode2DX.Get2dBarCodePos(
[in] IHRegionX* BarCodeRegion, [in] IHImageX* Image, [in] VARIANT BarCodeDescr, [in] VARIANT CodeRegDescr, [in] VARIANT GenParamNames, [in] VARIANT GenParamValues, [out] VARIANT* BarCodeData, [out] VARIANT* DataElementRow, [out] VARIANT* DataElementCol)
VARIANT HImageX.Get2dBarCodePos(
[in] IHRegionX* BarCodeRegion, [in] VARIANT BarCodeDescr, [in] VARIANT CodeRegDescr, [in] VARIANT GenParamNames, [in] VARIANT GenParamValues, [out] VARIANT* BarCodeData, [out] VARIANT* DataElementRow, [out] VARIANT* DataElementCol)
VARIANT HRegionX.Get2dBarCodePos(
[in] IHImageX* Image, [in] VARIANT BarCodeDescr, [in] VARIANT CodeRegDescr, [in] VARIANT GenParamNames, [in] VARIANT GenParamValues, [out] VARIANT* BarCodeData, [out] VARIANT* DataElementRow, [out] VARIANT* DataElementCol)
static void HOperatorSet.Get2dBarCodePos(HObject barCodeRegion, HObject image, HTuple barCodeDescr, HTuple codeRegDescr, HTuple genParamNames, HTuple genParamValues, out HTuple barCodeDimension, out HTuple barCodeData, out HTuple dataElementRow, out HTuple dataElementCol)
HTuple HImage.Get2dBarCodePos(HRegion barCodeRegion, HTuple barCodeDescr, HTuple codeRegDescr, HTuple genParamNames, HTuple genParamValues, out HTuple barCodeData, out HTuple dataElementRow, out HTuple dataElementCol)
HTuple HRegion.Get2dBarCodePos(HImage image, HTuple barCodeDescr, HTuple codeRegDescr, HTuple genParamNames, HTuple genParamValues, out HTuple barCodeData, out HTuple dataElementRow, out HTuple dataElementCol)
get_2d_bar_code_posget_2d_bar_code_posGet2dBarCodePosget_2d_bar_code_posGet2dBarCodePosGet2dBarCodePos extracts the 2D bar code data from a candidate
symbol region given in BarCodeRegionBarCodeRegionBarCodeRegionBarCodeRegionBarCodeRegionbarCodeRegion and the corresponding image
given in ImageImageImageImageImageimage elements. In contrast to get_2d_bar_codeget_2d_bar_codeGet2dBarCodeget_2d_bar_codeGet2dBarCodeGet2dBarCode,
this operator also returns the positions of the data elements in the image
in the parameters DataElementRowDataElementRowDataElementRowDataElementRowDataElementRowdataElementRow and DataElementColDataElementColDataElementColDataElementColDataElementColdataElementCol.
This can be used to check the result of the operator, e.g., by displaying
the data in the real image. For a description of the other parameters, see
get_2d_bar_codeget_2d_bar_codeGet2dBarCodeget_2d_bar_codeGet2dBarCodeGet2dBarCode.
The operator get_2d_bar_code_posget_2d_bar_code_posGet2dBarCodePosget_2d_bar_code_posGet2dBarCodePosGet2dBarCodePos returns error codes to signal
that the candidate region did not contain a valid 2D bar code. As the
region candidates extracted by the operator find_2d_bar_codefind_2d_bar_codeFind2dBarCodefind_2d_bar_codeFind2dBarCodeFind2dBarCode can
perfectly well encompass regions without a bar code, every call to
get_2d_bar_code_posget_2d_bar_code_posGet2dBarCodePosget_2d_bar_code_posGet2dBarCodePosGet2dBarCodePos should be surrounded by error handling
code (see example).
- Multithreading type: reentrant (runs in parallel with non-exclusive operators).
- Multithreading scope: global (may be called from any thread).
- Processed without parallelization.
Region that might contain a bar code.
Description of the 2D bar code class.
Additional parameters describing the bar code
region. They can be used for extracting the data.
List of names of (optional) generic control parameters.
Default value: []
List of values: 'border_width'"border_width""border_width""border_width""border_width""border_width", 'border_width_max'"border_width_max""border_width_max""border_width_max""border_width_max""border_width_max", 'border_width_min'"border_width_min""border_width_min""border_width_min""border_width_min""border_width_min", 'enlarge_region_rad'"enlarge_region_rad""enlarge_region_rad""enlarge_region_rad""enlarge_region_rad""enlarge_region_rad", 'gray_erosion_size'"gray_erosion_size""gray_erosion_size""gray_erosion_size""gray_erosion_size""gray_erosion_size", 'max_line_dist1'"max_line_dist1""max_line_dist1""max_line_dist1""max_line_dist1""max_line_dist1", 'max_line_dist2'"max_line_dist2""max_line_dist2""max_line_dist2""max_line_dist2""max_line_dist2", 'measure_sigma'"measure_sigma""measure_sigma""measure_sigma""measure_sigma""measure_sigma", 'measure_thresh'"measure_thresh""measure_thresh""measure_thresh""measure_thresh""measure_thresh", 'median_mask_rad'"median_mask_rad""median_mask_rad""median_mask_rad""median_mask_rad""median_mask_rad", 'min_cont_len'"min_cont_len""min_cont_len""min_cont_len""min_cont_len""min_cont_len", 'module_rad_ratio'"module_rad_ratio""module_rad_ratio""module_rad_ratio""module_rad_ratio""module_rad_ratio", 'smooth_cont'"smooth_cont""smooth_cont""smooth_cont""smooth_cont""smooth_cont", 'thresh_percent'"thresh_percent""thresh_percent""thresh_percent""thresh_percent""thresh_percent", 'thresh_step_width'"thresh_step_width""thresh_step_width""thresh_step_width""thresh_step_width""thresh_step_width", 'use_grayval_max'"use_grayval_max""use_grayval_max""use_grayval_max""use_grayval_max""use_grayval_max", 'use_grayval_min'"use_grayval_min""use_grayval_min""use_grayval_min""use_grayval_min""use_grayval_min", 'use_grayval_range'"use_grayval_range""use_grayval_range""use_grayval_range""use_grayval_range""use_grayval_range", 'use_grayvals'"use_grayvals""use_grayvals""use_grayvals""use_grayvals""use_grayvals"
List of values of the generic parameters.
Default value: []
Suggested values: 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 'yes'"yes""yes""yes""yes""yes", 'no'"no""no""no""no""no", -1, 1.5, 2.5, 3.5, 4.5, 5.5, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 20, 30, 40, 50
Tuple with the dimension of the extracted symbol.
In the case of ECC 200: data field width,
height, symbol index.
Tuple with the data values of the extracted symbol.
value > 0: logical 1, value < 0: logical 0,
value = 0: module could not be classified.
Tuple with the row positions of the data elements
of the extracted symbol in the image.
Tuple with the column positions of the data elements
of the extracted symbol in the image.
dev_set_check ('~give_error')
get_2d_bar_code_pos (ObjectSelected, Image, BarCodeDescr, \
CodeRegDescr, [], [], BarCodeDimension, BarCodeData, \
DataElementRow, DataElementCol)
err := ErrorCode
dev_set_check ('give_error')
if (err = 2)
idx := 0
dev_update_pc ('off')
dev_update_time ('off')
dev_update_var ('off')
for m := 0 to BarCodeDimension[0]-1 by 1
for n := 0 to BarCodeDimension[1]-1 by 1
if (BarCodeData[idx]>0)
set_color (WindowHandle, 'green')
else
if (BarCodeData[idx]<0)
set_color (WindowHandle, 'red')
else
set_color (WindowHandle, 'blue')
endif
endif
disp_circle (WindowHandle, DataElementRow[idx], \
DataElementCol[idx], 1)
idx := idx+1
endfor
endfor
dev_update_pc ('on')
dev_update_time ('on')
dev_update_var ('on')
decode_2d_bar_code (BarCodeDescr, BarCodeDimension, BarCodeData, \
SymbolCharacters, CorrSymbolData, DecodedData, \
DecodingError, StructuredAppend)
endif
The return value can signal incorrect parameters as well as the failure
to extract a 2D bar code. Such a failure can be due to different causes:
If no surrounding rectangle was found, the operator returns the error
code 8808. Error code 8807 signals that the rectangle does not lie
completely inside the image. If no finder pattern was detected inside the
border search area, the error code 8810 is returned. If the two continuous
lines forming the 'L' of the finder pattern could not be found, the error
code 8809 is returned. In the case of the printing method
'engraved_darkfield'"engraved_darkfield""engraved_darkfield""engraved_darkfield""engraved_darkfield""engraved_darkfield", the error code 8811 signals that none of
the gray value features can separate the test regions, i.e., that modules
cannot be classified.
Data Code