Functions | |
cvbres_t | FilterBoxMax (IMG ImgIn, long MaskWidth, long MaskHeight, long MaskOffsetX, long MaskOffsetY, IMG &ImgOut) |
Sets each pixel in the output image to the maximum value of all the input image pixel values in the neighborhood. More... | |
cvbres_t | FilterBoxMean (IMG ImgIn, long MaskWidth, long MaskHeight, long MaskOffsetX, long MaskOffsetY, IMG &ImgOut) |
Sets each pixel in the output image to the average of all the input image pixels in the rectangular neighborhood. More... | |
cvbres_t | FilterBoxMedian (IMG ImgIn, long MaskWidth, long MaskHeight, long MaskOffsetX, long MaskOffsetY, IMG &ImgOut) |
Sets each pixel in the output image to the median value of all the input pixel values taken in the neighborhood. More... | |
cvbres_t | FilterBoxMedianCross (IMG ImgIn, TFilterMask MaskType, IMG &ImgOut) |
Sets each pixel in the output image to the median value of all the input pixel values taken in the neighborhood (cross). More... | |
cvbres_t | FilterBoxMin (IMG ImgIn, long MaskWidth, long MaskHeight, long MaskOffsetX, long MaskOffsetY, IMG &ImgOut) |
Sets each pixel in the output image to the minimum value of all the input image pixel values in the neighborhood. More... | |
cvbres_t | FilterCanny (IMG ImgIn, long Index, TCannyEdgeFilter Filtering, long ThresholdLower, long ThresholdUpper, IMG &ImgOut) |
Finds edges in the source image using the Canny algorithm. More... | |
cvbres_t | FilterGauss (IMG ImgIn, TFilterMask MaskSize, IMG &ImgOut) |
Applies a square low-pass Gaussian filter to an area of interest of the image. More... | |
cvbres_t | FilterHiPass (IMG ImgIn, TFilterMask MaskSize, IMG &ImgOut) |
Applies a high-pass filter to an area of interest of the image. More... | |
cvbres_t | FilterLaplace2 (IMG ImgIn, TFilterMask MaskSize, IMG &ImgOut) |
Applies a high-pass Laplace filter to an area of interest of the image. The corresponding filter kernel is a matrix of either 3x3 or 5x5 elements with the following values: More... | |
cvbres_t | FilterLoPass (IMG ImgIn, TFilterMask MaskSize, IMG &ImgOut) |
Applies a low-pass filter to an area of interest of the image. More... | |
cvbres_t | FilterMedianColor (IMG ImgIn, TFilterMask MaskType, IMG &ImgOut) |
Applies the median value considering each color plane. More... | |
cvbres_t | FilterPrewittHorizontal (IMG ImgIn, IMG &ImgOut) |
Applies a horizontal Prewitt operator to an area of interest of the image. More... | |
cvbres_t | FilterPrewittVertical (IMG ImgIn, IMG &ImgOut) |
Applies a vertical Prewitt operator to an area of interest of the image. More... | |
cvbres_t | FilterRobertsDown (IMG ImgIn, IMG &ImgOut) |
Applies a horizontal Roberts operator to an image. More... | |
cvbres_t | FilterRobertsUp (IMG ImgIn, IMG &ImgOut) |
Applies a vertical Roberts operator to an image. More... | |
cvbres_t | FilterScharrHorizontal (IMG ImgIn, IMG &ImgOut) |
Applies a horizontal Scharr operator to an image. More... | |
cvbres_t | FilterScharrVertical (IMG ImgIn, IMG &ImgOut) |
Applies a vertical Scharr operator to an image. More... | |
cvbres_t | FilterSharpening (IMG ImgIn, IMG &ImgOut) |
Applies a sharpening filter to an image. More... | |
cvbres_t | FilterSobelCross (IMG ImgIn, TFilterMask MaskSize, IMG &ImgOut) |
Applies a second cross derivative Sobel operator to an image. More... | |
cvbres_t | FilterSobelHorizontal (IMG ImgIn, TFilterMask MaskSize, IMG &ImgOut) |
Applies a horizontal Sobel operator to an image. More... | |
cvbres_t | FilterSobelHorizontal2ndOrder (IMG ImgIn, TFilterMask MaskSize, IMG &ImgOut) |
Applies a second derivative horizontal Sobel operator to an image. More... | |
cvbres_t | FilterSobelVertical (IMG ImgIn, TFilterMask MaskSize, IMG &ImgOut) |
Applies a vertical Sobel operator to an image. More... | |
cvbres_t | FilterSobelVertical2ndOrder (IMG ImgIn, TFilterMask MaskSize, IMG &ImgOut) |
Applies a second derivative vertical Sobel operator to an image. More... | |
cvbres_t | FilterUserLinear (IMG ImgIn, long KernelWidth, long KernelHeight, long KernelOffsetX, long KernelOffsetY, double KernelValues[], IMG &ImgOut) |
Uses a rectangular kernel of floating-point values to filter an image that consists of integer or floating point data. More... | |
cvbres_t | FilterWiener (IMG ImgIn, long MaskWidth, long MaskHeight, long MaskOffsetX, long MaskOffsetY, double NoiseThreshold, IMG &ImgOut) |
Performs adaptive filtering of an image degraded by constant power additive noise. More... | |
cvbres_t FilterBoxMax | ( | IMG | ImgIn, |
long | MaskWidth, | ||
long | MaskHeight, | ||
long | MaskOffsetX, | ||
long | MaskOffsetY, | ||
IMG & | ImgOut | ||
) |
Sets each pixel in the output image to the maximum value of all the input image pixel values in the neighborhood.
The neighborhood is defined through the of size MaskHeight and MaskWidth and the anchor cell at that pixel.
[in] | ImgIn | Handle of input image. |
[in] | MaskWidth | Width of the mask. |
[in] | MaskHeight | Height of the mask. |
[in] | MaskOffsetX | Offset of the mask center relative to the top left corner of the mask. May be -1 in which case it will be set to width / 2. |
[in] | MaskOffsetY | Offset of the mask center relative to the top left corner of the mask. May be -1 in which case it will be set to height / 2. |
[out] | ImgOut | Image handle of result image. |
cvbres_t FilterBoxMean | ( | IMG | ImgIn, |
long | MaskWidth, | ||
long | MaskHeight, | ||
long | MaskOffsetX, | ||
long | MaskOffsetY, | ||
IMG & | ImgOut | ||
) |
Sets each pixel in the output image to the average of all the input image pixels in the rectangular neighborhood.
The neighborhood is defined through the of size MaskHeight and MaskWidth and the anchor cell at that pixel. This has the effect of smoothing or blurring the input image.
[in] | ImgIn | Handle of input image. |
[in] | MaskWidth | Width of the mask. |
[in] | MaskHeight | Height of the mask. |
[in] | MaskOffsetX | Offset of the mask center relative to the top left corner of the mask. May be -1 in which case it will be set to width / 2. |
[in] | MaskOffsetY | Offset of the mask center relative to the top left corner of the mask. May be -1 in which case it will be set to height / 2. |
[out] | ImgOut | Image handle of result image. |
cvbres_t FilterBoxMedian | ( | IMG | ImgIn, |
long | MaskWidth, | ||
long | MaskHeight, | ||
long | MaskOffsetX, | ||
long | MaskOffsetY, | ||
IMG & | ImgOut | ||
) |
Sets each pixel in the output image to the median value of all the input pixel values taken in the neighborhood.
The neighborhood of the processed pixel is given by the parameters MaskWidth and MaskHeight, centered around MaskOffsetX and MaskOffsetY.
The median is a statistical value that is determined as follows: Consider a neighbourhood of size n = w * h around the pixel being processed.
If you write the values of all the n pixels in that neighbourhood into an array in increasing pixel intensity, then the median of that intensity distribution is the (n/2)th value (the "middle one") if n is odd, or the average of the (n/2-1)th and the (n/2)th value if n is even.
[in] | ImgIn | Handle of input image. |
[in] | MaskWidth | Width of the mask. |
[in] | MaskHeight | Height of the mask. |
[in] | MaskOffsetX | Offset of the mask center relative to the top left corner of the mask. May be -1 in which case it will be set to width / 2. |
[in] | MaskOffsetY | Offset of the mask center relative to the top left corner of the mask. May be -1 in which case it will be set to height / 2. |
[out] | ImgOut | Image handle of result image. |
Sets each pixel in the output image to the median value of all the input pixel values taken in the neighborhood (cross).
The neighborhood of the processed pixel is given by the parameter MaskType.
[in] | ImgIn | Handle of input image. |
[in] | MaskType | Width of mask. Possible values are FM_3x3 and FM_5x5. |
[out] | ImgOut | Image handle of result image. |
cvbres_t FilterBoxMin | ( | IMG | ImgIn, |
long | MaskWidth, | ||
long | MaskHeight, | ||
long | MaskOffsetX, | ||
long | MaskOffsetY, | ||
IMG & | ImgOut | ||
) |
Sets each pixel in the output image to the minimum value of all the input image pixel values in the neighborhood.
The neighborhood is defined through the of size MaskHeight and MaskWidth and the anchor cell at that pixel.
[in] | ImgIn | Handle of input image. |
[in] | MaskWidth | Width of the mask. |
[in] | MaskHeight | Height of the mask. |
[in] | MaskOffsetX | Offset of the mask center relative to the top left corner of the mask. May be -1 in which case it will be set to width / 2. |
[in] | MaskOffsetY | Offset of the mask center relative to the top left corner of the mask. May be -1 in which case it will be set to height / 2. |
[out] | ImgOut | Image handle of result image. |
cvbres_t FilterCanny | ( | IMG | ImgIn, |
long | Index, | ||
TCannyEdgeFilter | Filtering, | ||
long | ThresholdLower, | ||
long | ThresholdUpper, | ||
IMG & | ImgOut | ||
) |
Finds edges in the source image using the Canny algorithm.
The Canny algorithm proposed by J. Canny in "A Computational Approach to Edge Detection", IEEE Trans. on Pattern Analysis and Machine Intelligence 8(6), 1986.
It takes an input image and produces from it an output image, in which all pixels belonging to detected edges are set to white, the rest to black:
| |
The calculation of the output image is a three-staged process:
[in] | ImgIn | Handle of input image. |
[in] | Index | Plane index to process Canny operator on. |
[in] | Filtering | Filtering algorithm to be used for building the derivative image. See TCannyEdgeFilter for possible methods. |
[in] | ThresholdLower | Lower threshold for hysteresis thresholding. |
[in] | ThresholdUpper | Upper threshold for edge detection and hysteresis thresholding. |
[out] | ImgOut | Image handle of result image. |
Applies a square low-pass Gaussian filter to an area of interest of the image.
The corresponding filter kernel is a matrix of either 3x3 or 5x5 elements. \n The 3x3 filter uses the kernel: <table border="0" cellpadding="0"> <tr><td width="50">1/16</td><td width="50">2/16</td><td width="50">1/16</td></tr> <tr><td>2/16</td><td>4/16</td><td>2/16</td></tr> <tr><td>1/16</td><td>2/16</td><td>1/16</td></tr> </table> These filter coefficients correspond to a 2-dimensional Gaussian distribution with a standard deviation of 0.85. \n\n The 5x5 filter uses the kernel: <table border="0" cellpadding="0"> <tr><td width="50">2/571</td><td width="50">7/571</td><td width="50">12/571</td><td width="50">7/571</td><td width="50">2/571</td></tr> <tr><td>7/571</td><td>31/571</td><td>52/571</td><td>31/571</td><td>7/571</td></tr> <tr><td>12/571</td><td>52/571</td><td>127/571</td><td>52/571</td><td>12/571</td></tr> <tr><td>7/571</td><td>31/571</td><td>52/571</td><td>31/571</td><td>7/571</td></tr> <tr><td>2/571</td><td>7/571</td><td>12/571</td><td>7/571</td><td>2/571</td></tr> </table> These filter coefficients correspond to a 2-dimensional Gaussian distribution with a standard deviation of 1.0. \n\n Both filters add an isotropic blur to images: <table border="0"> <tr> <td> <img class="ToDisplay" src="Bracket.gif" align="left" alt="Bracket original"> </td>
[in] | ImgIn | Handle of input image. |
[in] | MaskSize | Mask size to be used. Possible sizes are FM_3x3 and FM_5x5. |
[out] | ImgOut | Image handle of result image. |
Applies a high-pass filter to an area of interest of the image.
The corresponding filter kernel is a matrix of either 3x3 or 5x5 elements with the following values: <table border="0" cellpadding="0"> <tr><td width="50">-1</td><td width="50">-1</td><td width="50">-1</td></tr> <tr><td>-1</td><td>8</td><td>-1</td></tr> <tr><td>-1</td><td>-1</td><td>-1</td></tr> </table> \n <table border="0" cellpadding="0"> <tr><td width="50">-1</td><td width="50">-1</td><td width="50">-1</td><td width="50">-1</td><td width="50">-1</td></tr> <tr><td>-1</td><td>-1</td><td>-1</td><td>-1</td><td>-1</td></tr> <tr><td>-1</td><td>-1</td><td>24</td><td>-1</td><td>-1</td></tr> <tr><td>-1</td><td>-1</td><td>-1</td><td>-1</td><td>-1</td></tr> <tr><td>-1</td><td>-1</td><td>-1</td><td>-1</td><td>-1</td></tr> </table> This filter attenuates low-frequency components and leaves only the high-frequency components in the image: <table border="0"> <tr> <td> <img class="ToDisplay" src="Bracket.gif" align="left" alt="Bracket original"> </td>
Negative values are cut off by this filter. An alternative for this filter that preserves also the negative range of results is the FilterLaplace2 function.
[in] | ImgIn | Handle of input image. |
[in] | MaskSize | Mask size to be used. Possible sizes are FM_3x3 and FM_5x5. |
[out] | ImgOut | Image handle of result image. |
Applies a high-pass Laplace filter to an area of interest of the image. The corresponding filter kernel is a matrix of either 3x3 or 5x5 elements with the following values:
-1 | -1 | 1 |
-1 | 8 | 1 |
-1 | -1 | 1 |
-1 | -3 | -4 | -3 | -1 |
-3 | 0 | 6 | 0 | -3 |
-4 | 6 | 20 | 6 | -4 |
-3 | 0 | 6 | 0 | -3 |
-1 | -3 | -4 | -3 | -1 |
This filter helps locate zero crossings in an image.
| |
Other than the function FilterHiPass, the Laplace also preserves the negative result values that can come out of this filter function by scaling the result values' range and adding 128 to the pixel values.
[in] | ImgIn | Handle of input image. |
[in] | MaskSize | Mask size to be used. Possible sizes are FM_3x3 and FM_5x5. |
[out] | ImgOut | Image handle of result image. |
Applies a low-pass filter to an area of interest of the image.
The corresponding filter kernel is a matrix of either 3x3 or 5x5 elements. \n The 3x3 filter uses the kernel: <table border="0" cellpadding="0"> <tr><td width="50">1/9</td><td width="50">1/9</td><td width="50">1/9</td></tr> <tr><td>1/9</td><td>1/9</td><td>1/9</td></tr> <tr><td>1/9</td><td>1/9</td><td>1/9</td></tr> </table> \n The 5x5 filter uses the kernel: <table border="0" cellpadding="0"> <tr><td width="50">1/25</td><td width="50">1/25</td><td width="50">1/25</td><td width="50">1/25</td><td width="50">1/25</td></tr> <tr><td>1/25</td><td>1/25</td><td>1/25</td><td>1/25</td><td>1/25</td></tr> <tr><td>1/25</td><td>1/25</td><td>1/25</td><td>1/25</td><td>1/25</td></tr> <tr><td>1/25</td><td>1/25</td><td>1/25</td><td>1/25</td><td>1/25</td></tr> <tr><td>1/25</td><td>1/25</td><td>1/25</td><td>1/25</td><td>1/25</td></tr> </table> This filter blurs an image by averaging the pixel values over a neighborhood. In principle it is identical with the #FilterBoxMean function, but limited to 3x3 and 5x5 kernels with a central anchor. <table border="0"> <tr> <td> <img class="ToDisplay" src="Bracket.gif" align="left" alt="Bracket original"> </td>
[in] | ImgIn | Handle of input image. |
[in] | MaskSize | Mask size to be used. Possible sizes are FM_3x3 and FM_5x5. |
[out] | ImgOut | Image handle of result image. |
Applies the median value considering each color plane.
The function #FilterBoxMedian processes the individual color planes separately, and therefore the correlation between the color planes is lost, which results in a change of the colors, which is often not desirable when working with color images. \n For each input pixel, this function computes differences between red (R), green (G), and blue (B) color components of pixels in the mask neighborhood and the input pixel. The distance between the input pixel i and the neighborhood pixel j is formed as the sum of absolute values \n\n abs ( R ( i ) - R ( j )) + abs ( G( i ) - G ( j )) + abs ( B( i ) - B ( j )) \n\n After scanning the entire neighborhood, the function sets the output value for pixel i as the value of the neighborhood pixel with the smallest distance to i. The function #FilterMedianColor supports square masks of size either 3x3 or 5x5 and processes color images only.
[in] | ImgIn | Handle of input image. |
[in] | MaskType | Mask size to be used. Possible sizes are FM_3x3 and FM_5x5. |
[out] | ImgOut | Image handle of result image. |
Applies a horizontal Prewitt operator to an area of interest of the image.
The corresponding kernel is a matrix of 3x3 elements with the following values: <table border="0" cellpadding="0"> <tr><td width="50">1</td><td width="50">1</td><td width="50">1</td></tr> <tr><td>0</td><td>0</td><td>0</td></tr> <tr><td>-1</td><td>-1</td><td>-1</td></tr> </table> This filter has the effect of leaving only positive horizontal edges in the image (negative results of the filtering process are zeroed out). For a filter that preserves the negative and positive values, use the #FilterSobelHorizontal and #FilterScharrHorizontal functions. <table border="0"> <tr> <td> <img class="ToDisplay" src="Bracket.gif" align="left" alt="Bracket original"> </td>
[in] | ImgIn | Handle of input image. |
[out] | ImgOut | Image handle of result image. |
Applies a vertical Prewitt operator to an area of interest of the image.
The corresponding kernel is a matrix of 3x3 elements with the following values: <table border="0" cellpadding="0"> <tr><td width="50">-1</td><td width="50">0</td><td width="50">1</td></tr> <tr><td>-1</td><td>0</td><td>1</td></tr> <tr><td>-1</td><td>0</td><td>1</td></tr> </table> This filter has the effect of leaving only positive vertical edges in the image (negative results of the filtering process are zeroed out). For a filter that preserves the negative and positive values, use the #FilterSobelVertical and #FilterScharrVertical functions. <table border="0"> <tr> <td> <img class="ToDisplay" src="Bracket.gif" align="left" alt="Bracket original"> </td>
[in] | ImgIn | Handle of input image. |
[out] | ImgOut | Image handle of result image. |
Applies a horizontal Roberts operator to an image.
The corresponding kernel is a matrix of 3x3 elements with the following values: <table border="0" cellpadding="0"> <tr><td width="50">0</td><td width="50">0</td><td width="50">0</td></tr> <tr><td>0</td><td>1</td><td>0</td></tr> <tr><td>0</td><td>0</td><td>-1</td></tr> </table> This filter gives the rough approximation of the pixel values' gradient in the horizontal direction negative results of the filtering process are zeroed out). For a filter that preserves the negative and positive values, use the #FilterSobelHorizontal and #FilterScharrHorizontal functions. <table border="0"> <tr> <td> <img class="ToDisplay" src="Bracket.gif" align="left" alt="Bracket original"> </td>
[in] | ImgIn | Handle of input image. |
[out] | ImgOut | Image handle of result image. |
Applies a vertical Roberts operator to an image.
The corresponding kernel is a matrix of 3x3 elements with the following values: <table border="0" cellpadding="0"> <tr><td width="50">0</td><td width="50">0</td><td width="50">0</td></tr> <tr><td>0</td><td>1</td><td>0</td></tr> <tr><td>-1</td><td>0</td><td>0</td></tr> </table> This filter gives the rough approximation of the pixel values' gradient in the vertical direction negative results of the filtering process are zeroed out). For a filter that preserves the negative and positive values, use the #FilterSobelVertical and #FilterScharrVertical functions. <table border="0"> <tr> <td> <img class="ToDisplay" src="Bracket.gif" align="left" alt="Bracket original"> </td>
[in] | ImgIn | Handle of input image. |
[out] | ImgOut | Image handle of result image. |
Applies a horizontal Scharr operator to an image.
The corresponding kernel is a matrix of 3x3 elements with the following values: <table border="0" cellpadding="0"> <tr><td width="50">3</td><td width="50">10</td><td width="50">3</td></tr> <tr><td>0</td><td>0</td><td>0</td></tr> <tr><td>-3</td><td>-10</td><td>-3</td></tr> </table> This filter has the effect of simultaneously enhancing and smoothing horizontal edges of an image. The dynamic range of the output image is adjusted to be 0...255 (with a gray-value of 128 representing zero, values below 128 representing negative filter output and values above 128 representing positive filter output). <table border="0"> <tr> <td> <img class="ToDisplay" src="Bracket.gif" align="left" alt="Bracket original"> </td>
[in] | ImgIn | Handle of input image. |
[out] | ImgOut | Image handle of result image. |
Applies a vertical Scharr operator to an image.
The corresponding kernel is a matrix of 3x3 elements with the following values: <table border="0" cellpadding="0"> <tr><td width="50">3</td><td width="50">0</td><td width="50">-3</td></tr> <tr><td>10</td><td>0</td><td>-10</td></tr> <tr><td>3</td><td>0</td><td>-3</td></tr> </table> This filter has the effect of simultaneously enhancing and smoothing vertical edges of an image. The dynamic range of the output image is adjusted to be 0...255 (with a gray value of 128 representing zero, values below 128 representing negative filter output and values above 128 representing positive filter output). <table border="0"> <tr> <td> <img class="ToDisplay" src="Bracket.gif" align="left" alt="Bracket original"> </td>
[in] | ImgIn | Handle of input image. |
[out] | ImgOut | Image handle of result image. |
Applies a sharpening filter to an image.
The corresponding kernel is a matrix of 3x3 elements with the following values: <table border="0" cellpadding="0"> <tr><td width="50">-1/8</td><td width="50">-1/8</td><td width="50">-1/8</td></tr> <tr><td>-1/8</td><td>16/8</td><td>-1/8</td></tr> <tr><td>-1/8</td><td>-1/8</td><td>-1/8</td></tr> </table> This filter enhances high-frequency components and thereby sharpens an image. <table border="0"> <tr> <td> <img class="ToDisplay" src="Bracket.gif" align="left" alt="Bracket original"> </td>
[in] | ImgIn | Handle of input image. |
[out] | ImgOut | Image handle of result image. |
Applies a second cross derivative Sobel operator to an image.
The corresponding filter kernel is a matrix of either 3x3 or 5x5 elements with the following values: <table border="0" cellpadding="0"> <tr><td width="50">-1</td><td width="50">0</td><td width="50">1</td></tr> <tr><td>0</td><td>0</td><td>0</td></tr> <tr><td>1</td><td>0</td><td>-1</td></tr> </table> \n <table border="0" cellpadding="0"> <tr><td width="50">-1</td><td width="50">-2</td><td width="50">0</td><td width="50">2</td><td width="50">1</td></tr> <tr><td>-2</td><td>-4</td><td>0</td><td>4</td><td>2</td></tr> <tr><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr> <tr><td>2</td><td>4</td><td>0</td><td>-4</td><td>-2</td></tr> <tr><td>1</td><td>2</td><td>0</td><td>-2</td><td>-1</td></tr> </table> This filter has the effect of both enhancing and smoothing diagonal edges of an image. The dynamic range of the output image is adjusted to be 0...255 (with a gray value of 128 representing zero, values below 128 representing negative filter output and values above 128 representing positive filter output). <table border="0"> <tr> <td> <img class="ToDisplay" src="Bracket.gif" align="left" alt="Bracket original"> </td>
[in] | ImgIn | Handle of input image. |
[in] | MaskSize | Mask size to be used. Possible sizes are FM_3x3 and FM_5x5. |
[out] | ImgOut | Image handle of result image. |
Applies a horizontal Sobel operator to an image.
The corresponding filter kernel is a matrix of either 3x3 or 5x5 elements with the following values: <table border="0" cellpadding="0"> <tr><td width="50">1</td><td width="50">2</td><td width="50">1</td></tr> <tr><td>0</td><td>0</td><td>0</td></tr> <tr><td>-1</td><td>-2</td><td>-1</td></tr> </table> \n <table border="0" cellpadding="0"> <tr><td width="50">1</td><td width="50">4</td><td width="50">6</td><td width="50">4</td><td width="50">1</td></tr> <tr><td>2</td><td>8</td><td>12</td><td>8</td><td>2</td></tr> <tr><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr> <tr><td>-2</td><td>-8</td><td>-12</td><td>-8</td><td>-2</td></tr> <tr><td>-1</td><td>-4</td><td>-6</td><td>-4</td><td>-1</td></tr> </table> This filter has the effect of both enhancing and smoothing horizontal edges of an image. The dynamic range of the output image is adjusted to be 0...255 (with a gray value of 128 representing zero, values below 128 representing negative filter output and values above 128 representing positive filter output). <table border="0"> <tr> <td> <img class="ToDisplay" src="Bracket.gif" align="left" alt="Bracket original"> </td>
[in] | ImgIn | Handle of input image. |
[in] | MaskSize | Mask size to be used. Possible sizes are FM_3x3 and #FM_5x5. |
[out] | ImgOut | Image handle of result image. |
Applies a second derivative horizontal Sobel operator to an image.
The corresponding filter kernel is a matrix of either 3x3 or 5x5 elements with the following values: <table border="0" cellpadding="0"> <tr><td width="50">1</td><td width="50">2</td><td width="50">1</td></tr> <tr><td>-2</td><td>-4</td><td>-2</td></tr> <tr><td>1</td><td>2</td><td>1</td></tr> </table> \n <table border="0" cellpadding="0"> <tr><td width="50">1</td><td width="50">4</td><td width="50">6</td><td width="50">4</td><td width="50">1</td></tr> <tr><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr> <tr><td>-2</td><td>-8</td><td>-12</td><td>-8</td><td>-2</td></tr> <tr><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr> <tr><td>1</td><td>4</td><td>6</td><td>4</td><td>1</td></tr> </table> This filter has the effect of both enhancing and smoothing horizontal edges of an image. The dynamic range of the output image is adjusted to be 0...255 (with a gray value of 128 representing zero, values below 128 representing negative filter output and values above 128 representing positive filter output). <table border="0"> <tr> <td> <img class="ToDisplay" src="Bracket.gif" align="left" alt="Bracket original"> </td>
[in] | ImgIn | Handle of input image. |
[in] | MaskSize | Mask size to be used. Possible sizes are FM_3x3 and FM_5x5. |
[out] | ImgOut | Image handle of result image. |
Applies a vertical Sobel operator to an image.
The corresponding filter kernel is a matrix of either 3x3 or 5x5 elements with the following values: <table border="0" cellpadding="0"> <tr><td width="50">-1</td><td width="50">0</td><td width="50">1</td></tr> <tr><td>-2</td><td>0</td><td>2</td></tr> <tr><td>-1</td><td>0</td><td>1</td></tr> </table> \n <table border="0" cellpadding="0"> <tr><td width="50">-1</td><td width="50">-2</td><td width="50">0</td><td width="50">2</td><td width="50">1</td></tr> <tr><td>-4</td><td>-8</td><td>0</td><td>8</td><td>4</td></tr> <tr><td>-6</td><td>-12</td><td>0</td><td>12</td><td>6</td></tr> <tr><td>-4</td><td>-8</td><td>0</td><td>8</td><td>4</td></tr> <tr><td>-1</td><td>-2</td><td>0</td><td>2</td><td>1</td></tr> </table> This filter has the effect of both enhancing and smoothing vertical edges of an image. The dynamic range of the output image is adjusted to be 0...255 (with a gray value of 128 representing zero, values below 128 representing negative filter output and values above 128 representing positive filter output). <table border="0"> <tr> <td> <img class="ToDisplay" src="Bracket.gif" align="left" alt="Bracket original"> </td>
[in] | ImgIn | Handle of input image. |
[in] | MaskSize | Mask size to be used. Possible sizes are FM_3x3 and FM_5x5. |
[out] | ImgOut | Image handle of result image. |
Applies a second derivative vertical Sobel operator to an image.
The corresponding filter kernel is a matrix of either 3x3 or 5x5 elements with the following values: <table border="0" cellpadding="0"> <tr><td width="50">1</td><td width="50">-2</td><td width="50">1</td></tr> <tr><td>2</td><td>-4</td><td>2</td></tr> <tr><td>1</td><td>-2</td><td>1</td></tr> </table> \n <table border="0" cellpadding="0"> <tr><td width="50">1</td><td width="50">0</td><td width="50">-2</td><td width="50">0</td><td width="50">1</td></tr> <tr><td>4</td><td>0</td><td>-8</td><td>0</td><td>4</td></tr> <tr><td>6</td><td>0</td><td>-12</td><td>0</td><td>6</td></tr> <tr><td>4</td><td>0</td><td>-8</td><td>0</td><td>4</td></tr> <tr><td>1</td><td>0</td><td>-2</td><td>0</td><td>1</td></tr> </table> This filter has the effect of both enhancing and smoothing vertical edges of an image. The dynamic range of the output image is adjusted to be 0...255 (with a gray value of 128 representing zero, values below 128 representing negative filter output and values above 128 representing positive filter output). <table border="0"> <tr> <td> <img class="ToDisplay" src="Bracket.gif" align="left" alt="Bracket original"> </td>
[in] | ImgIn | Handle of input image. |
[in] | MaskSize | Mask size to be used. Possible sizes are FM_3x3 and FM_5x5. |
[out] | ImgOut | Image handle of result image. |
cvbres_t FilterUserLinear | ( | IMG | ImgIn, |
long | KernelWidth, | ||
long | KernelHeight, | ||
long | KernelOffsetX, | ||
long | KernelOffsetY, | ||
double | KernelValues[], | ||
IMG & | ImgOut | ||
) |
Uses a rectangular kernel of floating-point values to filter an image that consists of integer or floating point data.
This function sums the products between the kernel coefficients KernelValues and pixel values taken over the source pixel neighborhood defined by KernelWidth and KernelHeight and an anchor cell. The anchor cell is specified by its coordinates KernelOffsetX and KernelOffsetY in the coordinate system associated with the bottom right corner of the kernel. The sum is written to the destination pixel.
With this function, lots of filters may be reproduced that are dealt with in specialized functions.
This is an example of an extreme contrast enhancement done using the FilterUserLinear function with the kernel:
-2 | -2 | -2 |
-2 | 0 | -2 |
-2 | -2 | -2 |
| |
[in] | ImgIn | Handle of input image. |
[in] | KernelWidth | Width of the kernel. |
[in] | KernelHeight | Height of the kernel. |
[in] | KernelOffsetX | Offset of the kernel center relative to the top left corner of the kernel. |
[in] | KernelOffsetY | Offset of the kernel center relative to the top left corner of the kernel. |
[in] | KernelValues | Array of coefficients. Attention: Visual Basic 6 users please generate and fill an array, and pass the first element of the array to this function. |
[out] | ImgOut | Image handle of result image. |
cvbres_t FilterWiener | ( | IMG | ImgIn, |
long | MaskWidth, | ||
long | MaskHeight, | ||
long | MaskOffsetX, | ||
long | MaskOffsetY, | ||
double | NoiseThreshold, | ||
IMG & | ImgOut | ||
) |
Performs adaptive filtering of an image degraded by constant power additive noise.
For each pixel of the input image ImgIn, the function determines the local image mean and variance in the rectangular neighborhood (mask) of size MaskWidth and MaskHeight with the anchor cell centered on the pixel. The deviation from the local average is then diminished according to the local variance and the noise threshold parameters.
The noise threshold parameter may be zero, in which case the function tries to determine itself what local noise threshold to apply.
This normally yields the best results:
| |
[in] | ImgIn | Handle of input image. |
[in] | MaskWidth | Width of the mask. |
[in] | MaskHeight | Height of the mask. |
[in] | MaskOffsetX | Offset of the mask center relative to the top left corner of the mask. |
[in] | MaskOffsetY | Offset of the mask center relative to the top left corner of the mask. |
[in] | NoiseThreshold | Noise threshold to be applied. Allowable values are in the range [0...1]. |
[out] | ImgOut | Image handle of result image. |