Dev Center
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 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

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.0

Is this page helpful?

YesYes NoNo

latest version

  • Latest version
  • Version 10.x
    • Version 10.2.0
    • Version 10.0.21
    • Version 10.0.20
    • Version 10.0.10
    • Version 10.0.0
  • Version 9.x
    • Version 9.6.40
    • Version 9.6.33
    • Version 9.6.32
    • Version 9.6.31
    • Version 9.6.30
    • Version 9.6.20
    • Version 9.6.10
    • Version 9.6.0
    • Version 9.4.0
    • Version 9.2.0
    • Version 9.0.0
  • Version 8.x
    • Version 8.8.0
    • Version 8.6.0
    • Version 8.4.0
    • Version 8.2.0
    • Version 8.1.2
    • Version 8.1.0
    • Version 8.0.0
  • Version 7.x
    • Version 7.6.0
    • Version 7.5.0
Change +