get_bar_code_object — Access iconic objects that were created during the search or decoding of bar code symbols.
With the operator get_bar_code_object, iconic objects created during the last call of the operator find_bar_code can be accessed. Besides the name of the object (ObjectName), the bar code model (BarCodeHandle) must be passed to get_bar_code_object. In addition, in CandidateHandle an index to a single decoded symbol or a single symbol candidate must be passed. Alternatively, CandidateHandle can be set to 'all' and then all objects of the decoded symbols or symbol candidates are returned.
Depending on the option selected in ObjectName parameter the following objects are returned:
The regions of successfully decoded symbols are returned. When choosing 'all' as CandidateHandle, the regions of all decoded symbols are retrieved. The order of the returned objects is the same as in find_bar_code. If there is a total of n decoded symbols CandidateHandle can be chosen in between 0 and (n-1) to get the region of the respective decoded symbol.
The regions of potential bar codes are returned. If there is a total of n decoded symbols out of a total of m candidates then CandidateHandle can be chosen between 0 and (m-1). With CandidateHandle between 0 and (n-1) the original segmented region of the respective decoded symbol is retrieved. With CandidateHandle between n and (m-1) the region of the potential or undecodable symbol is returned. In addition, CandidateHandle can be set to 'all' to retrieve all candidate regions at the same time.
The XLD contours representing the particular detected bars in the scanlines applied on the candidate regions are returned. Note that the scanlines can be fetched only if the bar code was decoded by find_bar_code or decode_bar_code_rectangle2 in 'persistence' mode (see set_bar_code_param for further details). 'scanlines_all' represents all scanlines that find_bar_code would place in order to decode a bar code. 'scanlines_valid' represents only those scanlines that could be successfully decoded. For single row bar codes, there will be at least one 'scanlines_valid' if the symbol was successfully decoded. The default number of scanlines that has to be valid can be adjusted with set_bar_code_param with the parameter 'min_identical_scanlines'. There will be no 'scanlines_valid' if the symbol was not decoded. For stacked bar codes (e.g. 'GS1 DataBar Stacked' and 'GS1 DataBar Expanded Stacked') this rule applies similarly, but on a per-symbol-row basis rather then per-symbol. get_bar_code_object returns each scanline as separate XLD contour. If 'all' is used as CandidateHandle, all scanlines in all candidate regions will be returned. If only scanlines of a certain candidate region should be returned, the candidate number must be specified in CandidateHandle. Please note that the XLD contours returned by 'scanlines_all' and 'scanlines_valid' are meant for visualization purposes and hence consist of many XLD points. Double lines are used between edges that the bar code reader recognized as bar, whereas single lines are used for white spaces. Additional information about each scanline can be obtained with get_bar_code_result with the parameter 'status'. The '_plain' variants 'scanlines_all_plain' and 'scanlines_valid_plain' return the described scanlines in a plain format. Every edge found is returned as a point of an XLD contour. For every scanline a new XLD contour is created. Scanlines for which no edges could be found are omitted.
A bar code model BarCodeHandle cannot be shared between two or more user's threads. Different bar code models can be used independently and safely in different threads.
Objects that are created as intermediate results during the detection or evaluation of bar codes.
Handle of the bar code model.
Indicating the bar code results respectively candidates for which the data is required.
Default value: 'all'
Suggested values: 0, 1, 2, 'all'
Name of the iconic object to return.
Default value: 'candidate_regions'
List of values: 'candidate_regions', 'scanlines_all', 'scanlines_all_plain', 'scanlines_valid', 'scanlines_valid_plain', 'symbol_regions'
The operator get_bar_code_object returns the value 2 (H_MSG_TRUE) if the given parameters are correct and the requested objects are available for the last symbol search. Otherwise, an exception will be raised.