How to Filter Text in an Image
When trying to read an image where a barcode is surrounded by a large number of irrelevant text, the presence of said text may lead to incorrect positioning, and slow down the execution speed of DBR
. DBR
handles such scenarios by utilizing the built-in TextFilterModes
.
Let us consider the following image
For this image, we can set TextFilterModes
to TFM_GENERAL_CONTOUR
and observe through the intermediate result, IRT_TEXT_ZONE
. For easier demonstration purposes, we have merged the result of the IRT_TEXT_ZONE
onto the binarized result. As it shown in the following images, the algorithm has recognized almost all the characters.
Next, these words are excluded, and we are left with the optimized image as shown below
The process of text filtering will not be performed when using the positioning methods LM_CONNECTED_BLOCKS
and LM_SCAN_DIRECTLY
. Therefore, if DBR only performs LM_CONNECTED_BLOCKS
and LM_SCAN_DIRECTLY
positioning, the intermediate result IRT_TEXT_ZONE
will be empty data.
Sample Template
{
"Version":"3.0",
"ImageParameterContentArray":[
{
"NAME":"Test1",
"BarcodeFormatIds":["BF_ALL"],
"LocalizationModes":["LM_LINES"],
"TextFilterModes":[
{
"Mode":"TFM_GENERAL_CONTOUR"
}
]
}
]
}