F_VN_RemoveLocalMinima

F_VN_RemoveLocalMinima 1:

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

Syntax

Definition:

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

F_VN_RemoveLocalMinima 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 minima 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_RemoveLocalMinima 3: Return value

HRESULT

Further information

The function F_VN_RemoveLocalMinima removes local minima 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 minima have been removed.

Maximum height

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

Application

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

hr := F_VN_RemoveLocalMinima(
    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