Documentation
Table of contents

LineExtractionModes

Parameter LineExtractionModes specifies the algorithm used to extract lines. It currently consist of LEM_GENERAL and LEM_MARGIN_BASED. Each mode representing a different way to extract lines.

Example

{
    "LineExtractionModes":
    [
        {
            "Mode": "LEM_GENERAL"
        },
        {
            "Mode": "LEM_MARGIN_BASED" 
        }
    ]
}

Parameter Summary

LineExtractionModes consist one or more mode objects. Each mode object contains a candidate mode and other mode arguments.

Mode Arguments

Mode Argument Name Mode Argument Summary
Mode
(Required)
Description
Specifies a mode for line extraction.
Type
String
Candidate Mode List
LEM_GENERAL
LEM_MARGIN_BASED
Default Value
["LEM_GENERAL"]

Default Setting

If the LineExtractionModes is not configured in your template file, the following setting will be used as the default setting.

{
    "LineExtractionModes" : 
    [
        {
            "Mode" : "LEM_GENERAL"
        }
    ]
}

Candidate Modes Introduction

LEM_GENERAL

Designed for the senarios where the document background colour is distinct from the environment background colour. In these scenarios, contours of the document bounaries are clear enough on the binary images. As a result, the line segments can be easily extracted from the image.

LEM_MARGIN_BASED

Designed for the senarios where the background colour is similar to the environment background colour. For these scenarios, it is hard to get distinct contours of document boundaries with general binarization process. When the mode LEM_MARGIN_BASED is enabled, the library will implement different parameters for the binarization mode to separate the document contents and the background areas. The line segments of the document boundaries will be extracted from the margin between document contents and the background areas.

This page is compatible for:

Is this page helpful?

YesYes NoNo

In this article: