×
MENU
Resource Base
Table of contents

Thanks for downloading Dynamsoft Barcode Reader Package!

Your download will start shortly. If your download does not begin, click here to retry.

How to filter text in an image

When trying to read an image where a barcode is surrounded by a large number of irrelevant characters, the presence of these words 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

text filter sample

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.

text zone img

Next, these words are excluded, and we are left with the optimized image as shown below

binary img after text filter

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"
			}
		]
	}
	]
}

This page is compatible for:

Version 7.5

Is this page helpful?

YesYes NoNo

latest version

    • Latest Version
    • version 8.1.2
    • version 8.0
    • version 7.6
    • version 7.5
    Change +
    © 2003–2020 Dynamsoft. All rights reserved.
    Privacy Statement / Site Map / Home / Purchase / Support