Functions | |
I32 | ff3 (image *a, image *b, I32 c[3][3], I32 sh) |
3×3 Convolution Filter at an Image. More... | |
I32 | ff5 (image *a, image *b, I32 c[5][5], I32 sh) |
5×5 Convolution Filter at an Image. More... | |
I32 | ff5y (image *a, image *b, I32 *h, I32 *v, I32 sh) |
5×5 Convolution Filter with Horizontal/Vertical Separation. More... | |
I32 | ff7y (image *a, image *b, I32 *h, I32 *v, I32 sh) |
7×7 Convolution Filter with Horizontal/Vertical Separation. More... | |
The function makes it possible to calculate 3×3 filter operations of the image variable a
. In contrast to imgf(), this is always a convolution with a 3×3 mask. The two-dimensional array c
[3][3] contains the coefficients for the convolution. Mask:
c[0][0] | c[0][1] | c[0][2] |
c[1][0] | c[1][1] | c[2][2] |
c[2][0] | c[2][1] | c[3][2] |
The convolution with the mask is executed, the magnitude is calculated, and the result is shifted sh
bits. sh=0
means no shift, sh=1
means multiply by 2, sh=-1
is equivalent to dividing by 2, etc.
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.
a | Source Image. |
b | Destination Image. |
c | The Filter Kernel. |
sh | Shift Value. |
ERR_TYPE | if a or b Image is no Grey Image. |
ERR_NONE | on Success |
The function performs the 5×5 filter operation of image variable a
with arbitrary mask c
[5][5]. The result is stored in image b
. The two-dimensional array c
[5][5] contains the coefficients for the convolution mask. Mask:
c[0][0] | c[0][1] | c[0][2] | c[0][3] | c[0][4] |
c[1][0] | c[1][1] | c[1][2] | c[1][3] | c[1][4] |
c[2][0] | c[2][1] | c[2][2] | c[2][3] | c[2][4] |
c[3][0] | c[3][1] | c[3][2] | c[3][3] | c[3][4] |
c[4][0] | c[4][1] | c[4][2] | c[4][3] | c[4][4] |
The convolution with the mask is executed, the magnitude is calculated, and the result is shifted sh
bits. sh=0
means no shift, sh=1
means multiply by 2, sh=-1
is equivalent to dividing by 2, etc.
The function performs a 5×5 filter operation of image variable a
. The filter consists of a 1×5 and a 5×1 mask which are executed in sequence. The horizontal 5×1 mask is specified with array h
[5], the vertical 1×5 mask is specified with array v
[5]. The result of the operation will be stored in image b
.
Horizontal mask:
h[0] | h[1] | h[2] | h[3] | h[4] |
Vertical mask:
v[0] |
v[1] |
v[2] |
v[3] |
v[4] |
The convolution with both masks is executed, the magnitude is calculated, and the result is shifted sh
bits. sh=0
means no shift, sh=1
means multiply by 2, sh=-1
is equivalent to dividing by 2, etc.
ERR_TYPE | if a or b Image is no Grey Image. |
ERR_NONE | on Success. |
The function performs a 7×7 filter operation of image variable a
. The filter consists of a 1×7 and a 7×1 mask which are executed in sequence. The horizontal 7×1 mask is specified with array h
[7], the vertical 1×7 mask is specified with array v
[7]. The result of the operation will be stored in image b
.
Horizontal mask:
h[0] | h[1] | h[2] | h[3] | h[4] | h[5] | h[6] |
Vertical mask:
v[0] |
v[1] |
v[2] |
v[3] |
v[4] |
v[5] |
v[6] |
The convolution with both masks is executed, the magnitude is calculated, and the result is shifted sh
bits. sh=0
means no shift, sh=1
means multiply by 2, sh=-1
is equivalent to dividing by 2, etc.
ERR_TYPE | if src or dst Image is no Grey Image. |
ERR_NONE | on Success. |