TcVnParamsWalshBarcodeDetection

Parameters for bar code detection based on the Walsh transform.

Syntax

Definition:

struct TcVnParamsWalshBarcodeDetection
{
    ULONG                  nMaxBarDistance;
    float                  fMinAspectRatio;
    float                  fMaxAspectRatio;
    ULONG                  nIntensityDifference;
    LONG                   nMinArea;
    LONG                   nChannelIndex;
    ULONG                  nWalshFilterNum;
    float                  fOutlierReductionFactor;
    float                  fBarConnectionFactor;
    float                  fRegionFilterFactor;
    float                  fPostProcessingResizeFactor;
    ETcVnInterpolationType eInterpolationType;
};

Parameters

Name

Type

Default

Description

nMaxBarDistance

ULONG

8

Maximum distance between two consecutive dark or bright bars in pixels

fMinAspectRatio

float

1.0f

Minimum aspect ratio (width / height) of valid code regions

fMaxAspectRatio

float

5.0f

Maximum aspect ratio (width / height) of valid code regions

nIntensityDifference

ULONG

100

Approximate mean difference of dark and bright code pixels

nMinArea

LONG

-1

Expected minimum code area in pixels (-1: use an automatic guess based on nMaxBarDistance)

nChannelIndex

LONG

-1

Choose the index of a specific color channel (e.g., 0 = red, 1 = green, 2 = blue) or automatic graylevel conversion (-1). Using automatic graylevel conversion, 3-channel images and 4-channel images are considered as RGB and RGBA images, respectively, and converted to graylevel images before processing. For images with another number of channels the first one (index 0) is selected.

nWalshFilterNum

ULONG

5

Number of Walsh filters to be used (higher values may result in improved results but require more time to compute)

fOutlierReductionFactor

float

1.0f

Factor to control outlier reduction (Higher values reduce the number of outlier pixels but may disturb the barcodes to be localized.)

fBarConnectionFactor

float

1.0f

Factor to control bar linking (Higher values reduce the number of outlier pixels but may disturb the barcodes to be localized.)

fRegionFilterFactor

float

1.0f

Factor to control the rejection of small regions and region parts (Higher values reduce the number of found code regions, adjust their shape and increase the computation time.)

fPostProcessingResizeFactor

float

0.5f

Factor to control resizing before post-processiong (Smaller values reduce the required computation time but may deteriorate the results.)

eInterpolationType

ETcVnInterpolationType

IT_BILINEAR

Image rotation interpolation type (TCVN_IT_BILINEAR recommended for most cases)