F_VN_RemoveLocalMaxima

F_VN_RemoveLocalMaxima 1:

Remove local maxima up to a given height from a gray-scale single-channel image.

Syntax

Definition:

FUNCTION F_VN_RemoveLocalMaxima : HRESULT
VAR_INPUT
    ipSrcImage  : ITcVnImage;
    ipDestImage : Reference To ITcVnImage;
    fHeight     : LREAL;
    hrPrev      : HRESULT;
END_VAR

F_VN_RemoveLocalMaxima 2: Inputs

Name

Type

Description

ipSrcImage

ITcVnImage

Source image (USINT, UINT, INT, REAL, or LREAL, 1 channel)

ipDestImage

Reference To ITcVnImage

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

fHeight

LREAL

Maximum height of the maxima to be removed (must be greater than 0)

hrPrev

HRESULT

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

F_VN_RemoveLocalMaxima 3: Return value

HRESULT

Further information

The function F_VN_RemoveLocalMaxima removes local maxima from the input image.

Parameter

Input image

The input image ipSrcImage may only have one channel and must have one of the following element types: USINT, UINT, INT, REAL or LREAL.

Result image

The result image ipDestImage returns the image from which the local maxima have been removed.

Maximum height

The maximum height fHeight defines the height up to which maxima in the input image are removed. The height describes the difference in intensity between the maximum and the value to which the pixels concerned are set. fHeight must be larger than 0.

Application

The removal of local maxima up to a height of 10 looks like this, for example:

hr := F_VN_RemoveLocalMaxima(
    ipSrcImage      :=  ipImageIn,
    ipDestImage     :=  ipImageRes,
    fHeight         :=  10,
    hrPrev          :=  hr
);

Samples

Required License

TC3 Vision Base

System Requirements

Development environment

Target platform

PLC libraries to include

TwinCAT V3.1.4024.54 or later

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

Tc3_Vision