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... | |
#define sobel | ( | a, | |
b | |||
) | imgf(a, b, (void (*)())FL_3x3_SOB_U8P) |
The macro calculates the Sobel filter. The Sobel filter is calculated using the following masks:
1 | 0 | -1 |
2 | 0 | -2 |
1 | 0 | -1 |
and
1 | 2 | 1 |
0 | 0 | 0 |
-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.
#define sobelh | ( | a, | |
b | |||
) | 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 |
0 | 0 | 0 |
1 | 2 | 1 |
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.
#define sobelv | ( | a, | |
b | |||
) | 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:
-1 | 0 | 1 |
-2 | 0 | 2 |
-1 | 0 | 1 |
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.
#define vc_laplace | ( | a, | |
b | |||
) | imgf(a, b, (void (*)())FL_3x3_LAP_U8P) |
The macro calculates the Laplace filter. The Laplace filter is calculated with the following mask:
0 | 1 | 0 |
1 | -4 | 1 |
0 | 1 | 0 |
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.
#define mx | ( | a, | |
b | |||
) | 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.
#define mn | ( | a, | |
b | |||
) | 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.
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.
a | Input Image. |
b | Output Image. |
Approximation of a Differential-Of-Gaussian by 2 "concentric" averaging filters with the internal (smaller) average being subtracted from the larger average.
src | Source Image Pointer of Type IMAGE_GREY32. |
dst | Destination Image Pointer of Type IMAGE_GREY. |
nx,ny | Dimensions of the Minuend Box Average. |
kx,ky | Dimensions of the Subtrahend Box Average. |
ERR_TYPE | if src->type != IMAGE_GREY32. |
ERR_TYPE | if dst->type != IMAGE_GREY. |
ERR_PARAM | if kx or ky > nx or ny, or any < 0. |
ERR_PARAM | if src->dx or ->dy < 3*nx or 3*ny, or dst->dx or ->dy < 2*nx or 2*ny |
ERR_NONE | iff OK. |
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].
src | Source Image Pointer of Type IMAGE_GREY32. |
dst | Destination Image Pointer of Type IMAGE_GREY. |
addC | additive constant added to result of multiplication |
force | multiplicative constant multiplied to result of box filter |
nx,ny | Dimensions of the Minuend Box Average. |
kx,ky | Dimensions of the Subtrahend Box Average. |
ERR_TYPE | if src->type != IMAGE_GREY32. |
ERR_TYPE | if dst->type != IMAGE_GREY. |
ERR_PARAM | if kx or ky < 0. |