Functions | |
I32 | median3 (image *src, image *dst) |
3×3 Median Filter. More... | |
I32 | pmed5x5 (image *src, image *dst) |
5×5 Pseudo Median Filter with Horizontal/Vertical Separation. More... | |
I32 | pmed7x7 (image *src, image *dst) |
7×7 Pseudo Median Filter with Horizontal/Vertical Separation. More... | |
I32 | median1xN (image *src, image *dst, I32 my) |
1×N Median Filter. More... | |
I32 | medianNx1 (image *src, image *dst, I32 mx) |
N×1 Median Filter. More... | |
I32 | vc_median_anisotropic_1x9 (image *vec, image *out) |
Anisotropic 1×9 Median Filter at a Vector Image. More... | |
I32 | vc_median_anisotropic_1x9_padded (image *vec, image *out) |
Anisotropic 1×9 Median Filter at a Vector Image, padded with 0. More... | |
I32 | maxMxN (image *src, image *dst, I32 mx, I32 my) |
Moving Maximum (Dilation) Filter. More... | |
I32 | minMxN (image *src, image *dst, I32 mx, I32 my) |
Moving Minimum (Erosion) Filter. More... | |
The function calculates the moving maximum filter (grey value dilation) with a filter kernel of size (mx
, my
). It is possible to set either mx
or my
to one, in which case a linear horizontal or vertical structuring element is used. It is not possible to use this function in-place, i.e src
and dst
must be different. The execution time is independent of the mask size. The function returns the standard error code.
src | Source Image. |
dst | Destination Image. |
mx,my | Filter Size. |
dx
Bytes of Heap Memory. ERR_TYPE | if src or dst Image is no Grey Image. |
ERR_PARAM | if mx not in [1,dx] or my not in [1,dy]. |
ERR_PARAM | if src->st = dst->st. |
ERR_MEMORY | if Memory Allocation Fails. |
ERR_NONE | on Success. |
ERR_TYPE | if src or dst Image is no Grey Image. |
ERR_PARAM | if mx not in [1,dx] or my not in [1,dy]. |
ERR_PARAM | if src->st = dst->st. |
ERR_MEMORY | if Memory Allocation Fails. |
ERR_NONE | on Success. |
The function calculates the moving minimum filter (grey value erosion) with a filter kernel of size (mx
, my
). It is possible to set either mx
or my
to one, in which case a linear horizontal or vertical structuring element is used. It is not possible to use this function in-place, i.e src
and dst
must be different. The exection time is independent of the mask size. The function returns the standard error code.
src | Source Image. |
dst | Destination Image. |
mx,my | Filter Size. |
dx
Bytes of Heap Memory. ERR_TYPE | if src or dst Image is no Grey Image. |
ERR_PARAM | if mx not in [1,dx] or my not in [1,dy]. |
ERR_PARAM | if src->st = dst->st. |
ERR_MEMORY | if Memory Allocation Fails. |
ERR_NONE | on Success. |
ERR_TYPE | if src or dst Image is no Grey Image. |
ERR_PARAM | if mx not in [1,dx] or my not in [1,dy]. |
ERR_PARAM | if src->st = dst->st. |
ERR_MEMORY | if Memory Allocation Fails. |
ERR_NONE | on Success. |
a | Source Image. |
b | Destination Image, May be Identical. |
The median3() now fills the complete output image b
instead of a previous version.
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 simple approach to register the output pixel position to the center position and interpolation at the border comes with the following code, but at a cost of memory and processing time:
ERR_TYPE | if src or dst image is no grey compatible image. |
The function performs a 5×5 median filter for an image variable src
. The filter consists of a 1×5 and a 5×1 median which are executed in sequence. The result of the operation will be stored in image dst
.
ERR_TYPE | if src or dst Image is no Grey Image. |
ERR_NONE | on Success. |
The function performs a 7×7 median filter for an image variable src
. The filter consists of a 1×7 and a 7×1 median which are executed in sequence. The result of the operation will be stored in image dst
.
ERR_TYPE | if src or dst image is not grey compatible. |
ERR_NONE | on Success. |
src | Source Image |
dst | Destination Image, May be identical. |
my | Filter Size |
src | Source Image |
dst | Destination Image, May be identical. |
mx | Filter Size |
The function makes it possible to calculate an anisotropic 1×9 median filter operation at a vector image. Therefore the direction at the center pixel of a 9×9 frame will define the angle of the 1×9 pixel line through that point which selects the points whose magnitudes will be medianized for that pixel, and the direction of the winning median pixel is copied to the output.
Note that the output pixel position is equal to the top left pixel position of the 9×9 matrix. The advantage of that positioning is the ability to use the input image as the output image. Also note that the last nine columns and the last nine rows of the image contain meaningless data.
vec | Source image of type IMAGE_VECTOR. |
out | Destination image of type IMAGE_VECTOR. |
The function makes it possible to calculate an anisotropic 1×9 median filter operation at a vector image, see vc_median_anisotropic_1x9() for more information.
The input image is padded by a 4-pixel-border filled with 0 at the st channel, with 0x80 at the ccmp1 channel compatible to the gradient_3x3_thresh() meaning of direction. This is only relevant if the vector input is 0 at its border frame, so there may be dir 0x80s used for magnitude 0(!) at the border.
The result is as big as the input image.
vec | Source image of type IMAGE_VECTOR. |
out | Destination image of type IMAGE_VECTOR. |