2.2.3.9.24 matrixbase::FreqFilter

Description

Generation Function to Create Filter

Syntax

int FreqFilter( uint nRows, uint nCols, DWORD dwType = FILTER2D_BUTTERWORTH | FILTER2D_LOW_PASS |FILTER2D_CUTOFF_IN_FRACTION, double dCutOff = 0.5, int nOrder = 1, double dCutOff2 = 0.5 )

Parameters

nRows
[input]number of rows
nCols
[input]number of columns
dwType
[input] Options including 4 fields: window type; filter type; whether to cut the values outside the circle; cutoff is specified in fraction or Fourier pixel. The bit fields are defined in tagFILTER2DWINDOW.
dCutOff
[input]the cutoff value, specified in fraction or Fourier pixel. If in fraction, the value is within range (0, 0.5]; If in Fourier pixel, the value is an arbitrary positive number of double type
nOrder
[input]the filter order for Butterworth
dCutOff2
[input]the second cutoff value for FILTER2D_BAND_PASS or FILTER2D_BAND_BLOCK, should make sure dCutOff2 >= dCutOff

Return

Returns FILTER2DERROR_NO_ERROR on successful and a non-zero error code on failure, see FILTER2DERROR.

Examples

EX1

int matrixbase_FreqFilter_ex1()
{
    matrix        mat;
    int nRet = mat.FreqFilter(32, 32, FILTER2D_GAUSSIAN | FILTER2D_HIGH_PASS | FILTER2D_CUTOFF_IN_FRACTION);
    ASSERT( FILTER2DERROR_NO_ERROR == nRet );
    return nRet;
}

Remark

See Also

Header to Included

origin.h

Reference