Modules | |
Rank Filter | |
High Pass Filter | |
Low Pass Filter | |
Convolutions | |
Functions | |
void | imgf (image *a, image *b, void(*func)()) |
Arbitrary 3×3 Operator of an Image Variable. More... | |
Functions in this group use more than the input data at same pixel position to calculate an output pixel value, for example functions which do some filtering, such as sobel or pyramid, or convolution.
The function makes it possible to calculate any arbitrary 3×3 filter operation of the image variable a
. The result is stored in the image variable b
, which may be identical with a
. If the format of the image variables (dx
, dy
) is not identical, then the format of the result variable b
is used. In particular, this means that the result of the operation is not defined if the image format of a
is smaller than that of b
. ( a->dx < b->dx or a->dy < b->dy) It is recommended to work with identical image formats, i.e. a->dx = b->dx and a->dy = b->dy.
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 (using sobel() as example), but at a cost of memory and processing time:
The nature of the filter operation is specified by providing a pointer to the basic function to be executed. For the available basic functions there are macros, which make it easier to call the function.
The following macros are based on this function: sobel(), vc_laplace(), mx(), mn().
Of course, you can write your own basic functions. Pass their address (function pointer) to imgf().