NormalizeImage

Normalize an image regarding its value range (e.g. stretch pixel values [50..150] to full range [0..255]) or scale the values regarding a specific normalization (e.g. L2-norm).

Syntax

Definition:

HRESULT NormalizeImage(
    HRESULT                hrPrev,
    ITcVnImage*            ipSrcImage,
    ITcVnImage*&           ipDestImage,
    double                 fAlpha = 0,
    double                 fBeta = 255,
    ETcVnNormalizationType eNormType = NT_MINMAX,
    ETcVnElementType       eDestType = TCVN_ET_SAME_AS_SOURCE,
    ITcVnImage*            ipMask = nullptr
)

Parameters

Name

Type

Default

Description

hrPrev

HRESULT

 

HRESULT indicating the result of previous operations (If SUCCEEDED(hrPrev) equals false, no operation is executed.)

ipSrcImage

ITcVnImage*

 

Source image

ipDestImage

ITcVnImage*&

 

Destination image (An appropriate destination image will be created if required.)

fAlpha

double

0

Lower range boundary (in case of normalizing the value range) or value to normalize to (||ipDestImage|| = fAlpha)

fBeta

double

255

Upper range boundary (in case of normalizing the value range)

eNormType

ETcVnNormalizationType

NT_MINMAX

Normalization type (only INF, L1, L2 or MINMAX)

eDestType

ETcVnElementType

TCVN_ET_SAME_AS_SOURCE

Destination image depth (usually SAME_AS_SOURCE)

ipMask

ITcVnImage*

nullptr

Mask to restrict the normalization to specific pixel positions (set 0 to normalize the whole image)

NormalizeImage 1: Return value

HRESULT

Required License

TC3 Vision Base

System Requirements

Development environment

Target platform

PLC libraries to include

TwinCAT V3.1. 4024.44 or later

PC or CX (x64) with PL50, e.g. Intel 4-core Atom CPU

Tc3_Vision