VCLib Documentation  6.12.2

High Pass Filter

Functions

void robert (image *a, image *b)
 Robert’s Cross Operator of an Image Variable. More...
 
I32 box_DoG_filter (image *src, image *dst, I32 nx, I32 ny, I32 kx, I32 ky)
 Simulated Difference-Of-Gaussian Filter Using Average Rectangles. More...
 
I32 box_DoG_filter2 (image *src, image *dst, I32 addC, I32 force, I32 nx, I32 ny, I32 kx, I32 ky)
 Simulated Difference-Of-Gaussian Filter Using Average Rectangles. More...
 
#define sobel(a, b)   imgf(a, b, (void (*)())FL_3x3_SOB_U8P)
 Sobel Filter Routine (Macro). More...
 
#define sobelh(a, b)   imgf(a, b, (void (*)())FL_3x3_SOBH_U8P)
 Horizontal Sobel Filter Routine (Macro). More...
 
#define sobelv(a, b)   imgf(a, b, (void (*)())FL_3x3_SOBV_U8P)
 Vertical Sobel Filter Routine (Macro). More...
 
#define vc_laplace(a, b)   imgf(a, b, (void (*)())FL_3x3_LAP_U8P)
 Laplace Filter Routine (Macro). More...
 
#define mx(a, b)   imgf(a, b, (void (*)())FL_3x3_MAX_U8P)
 Maximum Filter Routine (Macro). More...
 
#define mn(a, b)   imgf(a, b, (void (*)())FL_3x3_MIN_U8P)
 Minimum Filter Routine (Macro). More...
 

Detailed Description

Macro Definition Documentation

◆ sobel

#define sobel (   a,
 
)    imgf(a, b, (void (*)())FL_3x3_SOB_U8P)

The macro calculates the Sobel filter. The Sobel filter is calculated using the following masks:

10-1
20-2
10-1

and

121
000
-1-2-1

The convolution with both masks is executed, the absolute values of both results are added, and the result is divided by 4.

Note that the output pixel position is equal to the top left pixel position of the 3×3 matrix. The advantage of that positioning is the ability to use the input image as the output image. Also note that the last two columns and the last two rows of the image contain meaningless data.

sobel() is a macro which calls imgf() with basic function FL_3x3_SOB_U8P() as an argument.

◆ sobelh

#define sobelh (   a,
 
)    imgf(a, b, (void (*)())FL_3x3_SOBH_U8P)

The macro calculates the Sobel filter in horizontal direction. The Sobel filter is calculated using the following mask:

-1-2-1
000
121

The convolution with the masks is executed and the result is clipped.

Note that the output pixel position is equal to the top left pixel position of the 3×3 matrix. The advantage of that positioning is the ability to use the input image as the output image. Also note that the last two columns and the last two rows of the image contain meaningless data.

sobelh() is a macro which calls imgf() with basic function FL_3x3_SOBH_U8P() as an argument.

◆ sobelv

#define sobelv (   a,
 
)    imgf(a, b, (void (*)())FL_3x3_SOBV_U8P)

The macro calculates the Sobel filter in vertical direction. The Sobel filter is calculated using the following mask:

-101
-202
-101

The convolution with the masks is executed and the result is clipped.

Note that the output pixel position is equal to the top left pixel position of the 3×3 matrix. The advantage of that positioning is the ability to use the input image as the output image. Also note that the last two columns and the last two rows of the image contain meaningless data.

sobelv() is a macro which calls imgf() with basic function FL_3x3_SOBV_U8P() as an argument.

◆ vc_laplace

#define vc_laplace (   a,
 
)    imgf(a, b, (void (*)())FL_3x3_LAP_U8P)

The macro calculates the Laplace filter. The Laplace filter is calculated with the following mask:

010
1-41
010

The convolution with the mask is executed, the magnitude is calculated, and the result is divided by 4.

Note that the output pixel position is equal to the top left pixel position of the 3×3 matrix. The advantage of that positioning is the ability to use the input image as the output image. Also note that the last two columns and the last two rows of the image contain meaningless data.

vc_laplace() is a macro which calls imgf() with basic function FL_3x3_LAP_U8P() as an argument.

◆ mx

#define mx (   a,
 
)    imgf(a, b, (void (*)())FL_3x3_MAX_U8P)

The macro calculates the maximum filter. The maximum filter is calculated as follows:

The pixel with the maximum gray scale in a 3×3 window is found. The value of this pixel is used as the result of the filter.

Note that the output pixel position is equal to the top left pixel position of the 3×3 matrix. The advantage of that positioning is the ability to use the input image as the output image. Also note that the last two columns and the last two rows of the image contain meaningless data.

mx() is a macro which calls imgf() with basic function FL_3x3_MAX_U8P() as an argument.

◆ mn

#define mn (   a,
 
)    imgf(a, b, (void (*)())FL_3x3_MIN_U8P)

The macro calculates the minimum filter. The minimum filter is calculated as follows:

The pixel with the minimum gray scale in a 3×3 window is found. The value of this pixel is used as the result of the filter.

Note that the output pixel position is equal to the top left pixel position of the 3×3 matrix. The advantage of that positioning is the ability to use the input image as the output image. Also note that the last two columns and the last two rows of the image contain meaningless data.

mn() is a macro which calls imgf() with basic function FL_3x3_MIN_U8P() as an argument.

Function Documentation

◆ robert()

void robert ( image a,
image b 
)

The function calculates the robert’s cross filter operator of image variable src and outputs the result in image variable dest. The operator uses the following masks:

+1 0
0-1

and

0+1
-1 0

The sum of the absolute values of each mask operation is calculated, the result is right-shifted by 1 (divided by 2) and output to the destination image.

Parameters
aInput Image.
bOutput Image.
Memory Consumption
None.
See also
sobel(), imgf().

◆ box_DoG_filter()

I32 box_DoG_filter ( image src,
image dst,
I32  nx,
I32  ny,
I32  kx,
I32  ky 
)

Approximation of a Differential-Of-Gaussian by 2 "concentric" averaging filters with the internal (smaller) average being subtracted from the larger average.

box_DoG_filter.png
Parameters
srcSource Image Pointer of Type IMAGE_GREY32.
dstDestination Image Pointer of Type IMAGE_GREY.
nx,nyDimensions of the Minuend Box Average.
kx,kyDimensions of the Subtrahend Box Average.
Return values
ERR_TYPEif src->type != IMAGE_GREY32.
ERR_TYPEif dst->type != IMAGE_GREY.
ERR_PARAMif kx or ky > nx or ny, or any < 0.
ERR_PARAMif src->dx or ->dy < 3*nx or 3*ny, or dst->dx or ->dy < 2*nx or 2*ny
ERR_NONEiff OK.

◆ box_DoG_filter2()

I32 box_DoG_filter2 ( image src,
image dst,
I32  addC,
I32  force,
I32  nx,
I32  ny,
I32  kx,
I32  ky 
)

performs integral image computation according to Viola & Jones, 2002

              This function is a more generalized version of the
              "difference of Gaussian" using the weighted addition
              of the 2 "concentric" averaging filters, the
              outside and the inside (kernel) box.
              The result is clipped to the range of [0..255].
Parameters
srcSource Image Pointer of Type IMAGE_GREY32.
dstDestination Image Pointer of Type IMAGE_GREY.
addCadditive constant added to result of multiplication
forcemultiplicative constant multiplied to result of box filter
nx,nyDimensions of the Minuend Box Average.
kx,kyDimensions of the Subtrahend Box Average.
Returns
Standard Error Code.
Return values
ERR_TYPEif src->type != IMAGE_GREY32.
ERR_TYPEif dst->type != IMAGE_GREY.
ERR_PARAMif kx or ky < 0.