F_VN_CreateBandpassButterworthFilter

F_VN_CreateBandpassButterworthFilter 1:

Creates a bandpass Butterworth filter, which can be applied to a frequency domain image by element-wise multiplication.

Syntax

Definition:

FUNCTION F_VN_CreateBandpassButterworthFilter : HRESULT
VAR_INPUT
    ipFilter         : Reference To ITcVnImage;
    nWidth           : UDINT;
    nHeight          : UDINT;
    bDoublePrecision : BOOL;
    bOriginAtCenter  : BOOL;
    fCutoffDistance  : LREAL;
    fBandWidth       : LREAL;
    nOrder           : UDINT;
    fScale           : LREAL;
    hrPrev           : HRESULT;
END_VAR

F_VN_CreateBandpassButterworthFilter 2: Inputs

Name

Type

Description

ipFilter

Reference To ITcVnImage

Returns the created filter (1 channel of type REAL or LREAL, depending on bDoublePrecision. Non-zero interface pointers are reused.).

nWidth

UDINT

Filter width (even, >= 2, must match the width of the image it is applied to)

nHeight

UDINT

Filter height (even, >= 2, must match the height of the image it is applied to)

bDoublePrecision

BOOL

If true, the filter is generated with double precision (LREAL) instead of single precision (REAL).

bOriginAtCenter

BOOL

If true, the filter origin is shifted to the image center.

fCutoffDistance

LREAL

The cutoff distance of the Butterworth filter (> 0).

fBandWidth

LREAL

The band width of the Butterworth filter (> 0).

nOrder

UDINT

The order of the Butterworth filter (> 0).

fScale

LREAL

The scale factor of the Butterworth filter denominator term (> 0, e.g. 0.414 or 1.0).

hrPrev

HRESULT

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

F_VN_CreateBandpassButterworthFilter 3: 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