Minos (MinosCVC.dll) 14.0
Filter Functions

Functions

cvbbool_t ButterWorth (IMG imgIn, short highPass, double gain, cvbval_t addOffset, cvbval_t order, double cutOff, IMG &imgOut)
 Calculates a band pass filtered image. More...
 
cvbbool_t FilterDilate (IMG imgIn, IMG &imgOut)
 Calculates a gray scale dilation of the input image with a 3x3 filter mask. More...
 
cvbbool_t FilterEdge2x2 (IMG imgIn, IMG &imgOut)
 Creates an edge-filtered version of the input image. More...
 
cvbbool_t FilterEdge3x3 (IMG imgIn, IMG &imgOut)
 Creates an edge-filtered version of the input image. More...
 
cvbbool_t FilterErode (IMG imgIn, IMG &imgOut)
 Calculates a gray scale erosion of the input image with a 3x3 filter mask. More...
 
cvbbool_t FilterLaplace3x3 (IMG imgIn, IMG &imgOut)
 Creates a Laplace-filtered image. More...
 
cvbbool_t FilterLow2x2 (IMG imgIn, IMG &imgOut)
 Creates a blurred version of the input image. More...
 
cvbbool_t FilterLow3x3 (IMG imgIn, IMG &imgOut)
 Creates a blurred version of the input image. More...
 
cvbbool_t FilterLow5x5 (IMG imgIn, IMG &imgOut)
 Creates a blurred version of the input image. More...
 
cvbbool_t FilterPyramid3x3 (IMG imgIn, IMG &imgOut)
 Applies a binomial low pass filter and downscales the image by a factor of 2 in width and height. More...
 
cvbbool_t FilterPyramid4x4 (IMG imgIn, IMG &imgOut)
 Applies a binomial low pass filter and downscales the image by a factor of 2 in width and height. More...
 
cvbbool_t FilterPyramid5x5 (IMG imgIn, IMG &imgOut)
 Applies a binomial low pass filter and downscales the image by a factor of 2 in width and height. More...
 
cvbbool_t FilterSharpen (IMG imgIn, IMG &imgOut)
 Creates a sharpened version of the input image. More...
 
cvbbool_t FilterUser2x2 (IMG imgIn, const TFilterDef &filterDef, IMG &imgOut)
 Creates an image by applying a 2x2 linear convolution filter to the input image. More...
 
cvbbool_t FilterUser3x3 (IMG imgIn, const TFilterDef &filterDef, IMG &imgOut)
 Creates an image by applying a 3x3 linear convolution filter to the input image. More...
 
cvbbool_t FilterUser5x5 (IMG imgIn, const TFilterDef &filterDef, IMG &imgOut)
 Creates an image by applying a 5x5 linear convolution filter to the input image. More...
 

Detailed Description

Function Documentation

◆ ButterWorth()

cvbbool_t ButterWorth ( IMG  imgIn,
short  highPass,
double  gain,
cvbval_t  addOffset,
cvbval_t  order,
double  cutOff,
IMG &  imgOut 
)

Calculates a band pass filtered image.

This function uses the 1st or 2nd order Butterworth pass filter to process the input images. Butterworth filters can act as hight or low pass filters and have a fairly flat frequency response. They are not very computationally expensive, making them a good alternative to FFT-based band pass filtering.

original Butterworth 1st order Butterworth 2nd order

(both example images use the following parameters: highPass = TRUE, gain = 1.0, addOffset = 128, cutOff = 10)

Parameters
[in]imgInHandle to the input image.
[in]highPassWhen set to TRUE the filter acts as a high pass filter, when set to FALSE it will act as a low pass filter.
[in]gainMagnitude of the frequency response.
[in]addOffsetOffset to be added to the result.
[in]orderOrder of the butter-worth filter. Must be either 1 or 2.
[in]cutOffCut-off parameter.
[out]imgOutReceives the handle of the newly created output image. Remember to dispose of the output image with ReleaseObject from the CVCImg.dll once it is no longer needed.
Returns
TRUE if the filter function succeeded, FALSE otherwise. Possible reasons for failure are:
  • imgIn does not refer to a valid image
  • imgIn has more than 8 bits per pixel in at least one plane
  • creation of the output image failed due to insufficient memory

◆ FilterDilate()

cvbbool_t FilterDilate ( IMG  imgIn,
IMG &  imgOut 
)

Calculates a gray scale dilation of the input image with a 3x3 filter mask.

The dilation is one of the basic morphology operations. It is based on scanning every location in the input image with a structural element (in this case simply a rectangle) and setting the corresponding pixel value in the output image to the brightest value found in the structural element.

Dilation effectively expands bright structures in the image (in this case, because a 3x3 mask is used, by 1 pixel in every direction). Dilation followed by an erosion (FilterErode) can be used for closing small holes dark pixels in bright objects) in objects.

original dilated
Parameters
[in]imgInHandle to the input image.
[out]imgOutReceives the handle of the newly created output image. Remember to dispose of the output image with ReleaseObject from the CVCImg.dll once it is no longer needed.
Returns
TRUE if the filter function succeeded, FALSE otherwise. Possible reasons for failure are:
  • imgIn does not refer to a valid image
  • imgIn has more than 8 bits per pixel in at least one plane
  • creation of the output image failed due to insufficient memory
See also
FilterErode

◆ FilterEdge2x2()

cvbbool_t FilterEdge2x2 ( IMG  imgIn,
IMG &  imgOut 
)

Creates an edge-filtered version of the input image.

The output value for position (x,y) is calculated according to:

(effectively the maximum norm over the two Roberts filters). The results are clamped to the range [0...255].

original low pass filtered
Parameters
[in]imgInHandle to the input image.
[out]imgOutReceives the handle of the newly created output image. Remember to dispose of the output image with ReleaseObject from the CVCImg.dll once it is no longer needed.
Returns
TRUE if the filter function succeeded, FALSE otherwise. Possible reasons for failure are:
  • imgIn does not refer to a valid image
  • imgIn has more than 8 bits per pixel in at least one plane
  • creation of the output image failed due to insufficient memory
See also
FilterEdge3x3

◆ FilterEdge3x3()

cvbbool_t FilterEdge3x3 ( IMG  imgIn,
IMG &  imgOut 
)

Creates an edge-filtered version of the input image.

The output value for position (x,y) is calculated according to:

The results are clamped to the range [0...255].

original low pass filtered
Parameters
[in]imgInHandle to the input image.
[out]imgOutReceives the handle of the newly created output image. Remember to dispose of the output image with ReleaseObject from the CVCImg.dll once it is no longer needed.
Returns
TRUE if the filter function succeeded, FALSE otherwise. Possible reasons for failure are:
  • imgIn does not refer to a valid image
  • imgIn has more than 8 bits per pixel in at least one plane
  • creation of the output image failed due to insufficient memory
See also
FilterEdge2x2

◆ FilterErode()

cvbbool_t FilterErode ( IMG  imgIn,
IMG &  imgOut 
)

Calculates a gray scale erosion of the input image with a 3x3 filter mask.

The erosion is one of the basic morphology operations. It is based on scanning every location in the input image with a structural element (in this case simply a rectangle) and setting the corresponding pixel value in the output image to the darkest value found in the structural element.

Erosion effectively expands dark structures in the image (in this case, because a 3x3 mask is used, by 1 pixel in every direction). Erosion followed by a dilation (FilterDilate) can be used for removing bright spots in otherwise dark objects.

original dilated
Parameters
[in]imgInHandle to the input image.
[out]imgOutReceives the handle of the newly created output image. Remember to dispose of the output image with ReleaseObject from the CVCImg.dll once it is no longer needed.
Returns
TRUE if the filter function succeeded, FALSE otherwise. Possible reasons for failure are:
  • imgIn does not refer to a valid image
  • imgIn has more than 8 bits per pixel in at least one plane
  • creation of the output image failed due to insufficient memory
See also
FilterDilate

◆ FilterLaplace3x3()

cvbbool_t FilterLaplace3x3 ( IMG  imgIn,
IMG &  imgOut 
)

Creates a Laplace-filtered image.

The convolution kernel for the Laplace filter is

0-10
-14-1
0-10

The results will be offset by 128 and clamped to the range [0...255].

original Laplace-filtered
Parameters
[in]imgInHandle to the input image.
[out]imgOutReceives the handle of the newly created output image. Remember to dispose of the output image with ReleaseObject from the CVCImg.dll once it is no longer needed.
Returns
TRUE if the filter function succeeded, FALSE otherwise. Possible reasons for failure are:
  • imgIn does not refer to a valid image
  • imgIn has more than 8 bits per pixel in at least one plane
  • creation of the output image failed due to insufficient memory

◆ FilterLow2x2()

cvbbool_t FilterLow2x2 ( IMG  imgIn,
IMG &  imgOut 
)

Creates a blurred version of the input image.

This function blurs the image data of the input image with the convolution kernel

1/41/4
1/41/4

For a stronger blurring effect try FilterLow3x3 or FilterLow5x5.

original low pass filtered
Parameters
[in]imgInHandle to the input image.
[out]imgOutReceives the handle of the newly created output image. Remember to dispose of the output image with ReleaseObject from the CVCImg.dll once it is no longer needed.
Returns
TRUE if the filter function succeeded, FALSE otherwise. Possible reasons for failure are:
  • imgIn does not refer to a valid image
  • imgIn has more than 8 bits per pixel in at least one plane
  • creation of the output image failed due to insufficient memory
See also
FilterLow3x3, FilterLow5x5

◆ FilterLow3x3()

cvbbool_t FilterLow3x3 ( IMG  imgIn,
IMG &  imgOut 
)

Creates a blurred version of the input image.

This function blurs the image data of the input image with the convolution kernel

1/162/161/16
2/164/162/16
1/162/161/16

For a weaker blurring effect try FilterLow2x2. For a stronger blurring effect try FilterLow5x5.

original low pass filtered
Parameters
[in]imgInHandle to the input image.
[out]imgOutReceives the handle of the newly created output image. Remember to dispose of the output image with ReleaseObject from the CVCImg.dll once it is no longer needed.
Returns
TRUE if the filter function succeeded, FALSE otherwise. Possible reasons for failure are:
  • imgIn does not refer to a valid image
  • imgIn has more than 8 bits per pixel in at least one plane
  • creation of the output image failed due to insufficient memory
See also
FilterLow2x2, FilterLow5x5

◆ FilterLow5x5()

cvbbool_t FilterLow5x5 ( IMG  imgIn,
IMG &  imgOut 
)

Creates a blurred version of the input image.

This function blurs the image data of the input image with the convolution kernel

14641
41624164
62436246
41624164
14641

For a weaker blurring effect try FilterLow3x3 and FilterLow2x2.

original low pass filtered
Parameters
[in]imgInHandle to the input image.
[out]imgOutReceives the handle of the newly created output image. Remember to dispose of the output image with ReleaseObject from the CVCImg.dll once it is no longer needed.
Returns
TRUE if the filter function succeeded, FALSE otherwise. Possible reasons for failure are:
  • imgIn does not refer to a valid image
  • imgIn has more than 8 bits per pixel in at least one plane
  • creation of the output image failed due to insufficient memory
See also
FilterLow2x2, FilterLow3x3

◆ FilterPyramid3x3()

cvbbool_t FilterPyramid3x3 ( IMG  imgIn,
IMG &  imgOut 
)

Applies a binomial low pass filter and downscales the image by a factor of 2 in width and height.

The low pass filter applied is effectively the same as implemented by the functions FilterLow3x3.

original pyramid
Parameters
[in]imgInHandle to the input image.
[out]imgOutReceives the handle of the newly created output image. Remember to dispose of the output image with ReleaseObject from the CVCImg.dll once it is no longer needed.
Returns
TRUE if the filter function succeeded, FALSE otherwise. Possible reasons for failure are:
  • imgIn does not refer to a valid image
  • imgIn has more than 8 bits per pixel in at least one plane
  • creation of the output image failed due to insufficient memory
See also
FilterPyramid4x4, FilterPyramid5x5

◆ FilterPyramid4x4()

cvbbool_t FilterPyramid4x4 ( IMG  imgIn,
IMG &  imgOut 
)

Applies a binomial low pass filter and downscales the image by a factor of 2 in width and height.

The low pass filter applied is defined by the filter mask

1/643/643/641/64
3/649/649/643/64
3/649/649/643/64
1/643/643/641/64


original pyramid
Parameters
[in]imgInHandle to the input image.
[out]imgOutReceives the handle of the newly created output image. Remember to dispose of the output image with ReleaseObject from the CVCImg.dll once it is no longer needed.
Returns
TRUE if the filter function succeeded, FALSE otherwise. Possible reasons for failure are:
  • imgIn does not refer to a valid image
  • imgIn has more than 8 bits per pixel in at least one plane
  • creation of the output image failed due to insufficient memory
See also
FilterPyramid3x3, FilterPyramid5x5

◆ FilterPyramid5x5()

cvbbool_t FilterPyramid5x5 ( IMG  imgIn,
IMG &  imgOut 
)

Applies a binomial low pass filter and downscales the image by a factor of 2 in width and height.

The low pass filter applied is effectively the same as implemented by the functions FilterLow5x5.

original pyramid
Parameters
[in]imgInHandle to the input image.
[out]imgOutReceives the handle of the newly created output image. Remember to dispose of the output image with ReleaseObject from the CVCImg.dll once it is no longer needed.
Returns
TRUE if the filter function succeeded, FALSE otherwise. Possible reasons for failure are:
  • imgIn does not refer to a valid image
  • imgIn has more than 8 bits per pixel in at least one plane
  • creation of the output image failed due to insufficient memory
See also
FilterPyramid3x3, FilterPyramid4x4

◆ FilterSharpen()

cvbbool_t FilterSharpen ( IMG  imgIn,
IMG &  imgOut 
)

Creates a sharpened version of the input image.

Sharpened images are effectively high pass images, in this case created with the convolution kernel

0-10
-15-1
0-10

The results are clamped to the range [0...255]. Sharpened images may show more detail, the sharpen filter also amplifies noise (and is therefore usually not a good choice for preprocessing images that are going to be used with Minos).

original sharpened
Parameters
[in]imgInHandle to the input image.
[out]imgOutReceives the handle of the newly created output image. Remember to dispose of the output image with ReleaseObject from the CVCImg.dll once it is no longer needed.
Returns
TRUE if the filter function succeeded, FALSE otherwise. Possible reasons for failure are:
  • imgIn does not refer to a valid image
  • imgIn has more than 8 bits per pixel in at least one plane
  • creation of the output image failed due to insufficient memory

◆ FilterUser2x2()

cvbbool_t FilterUser2x2 ( IMG  imgIn,
const TFilterDef filterDef,
IMG &  imgOut 
)
related

Creates an image by applying a 2x2 linear convolution filter to the input image.

The 2x2 convolution kernel needs to be specified as a TFilterDef structure. In this case, only the central members

c0000c0R00
c000Bc0R0B

and Offst will be evaluated. Result values will be clamped to the range [0...255].

Attention
The Minos filter functions expect the coefficients (but not the Offst member!) in units of 1/1000 so e.g., 1500 means a coefficient value of 1.5
Parameters
[in]imgInHandle to the input image.
[in]filterDefFilter definition. See TFilterDef.
[out]imgOutReceives the handle of the newly created output image. Remember to dispose of the output image with ReleaseObject from the CVCImg.dll once it is no longer needed.
Returns
TRUE if the filter function succeeded, FALSE otherwise. Possible reasons for failure are:
  • imgIn does not refer to a valid image
  • imgIn has more than 8 bits per pixel in at least one plane
  • creation of the output image failed due to insufficient memory
See also
FilterUser3x3, FilterUser5x5

◆ FilterUser3x3()

cvbbool_t FilterUser3x3 ( IMG  imgIn,
const TFilterDef filterDef,
IMG &  imgOut 
)
related

Creates an image by applying a 3x3 linear convolution filter to the input image.

The 3x3 convolution kernel needs to be specified as a TFilterDef structure. In this case, only the central members

c0L0Tc000Tc0R0T
c0L00c0000c0R00
c0L0Bc000Bc0R0B

and Offst will be evaluated. Result values will be clamped to the range [0...255].

Attention
The Minos filter functions expect the coefficients (but not the Offst member!) in units of 1/1000 so e.g., 1500 means a coefficient value of 1.5
Parameters
[in]imgInHandle to the input image.
[in]filterDefFilter definition. See TFilterDef.
[out]imgOutReceives the handle of the newly created output image. Remember to dispose of the output image with ReleaseObject from the CVCImg.dll once it is no longer needed.
Returns
TRUE if the filter function succeeded, FALSE otherwise. Possible reasons for failure are:
  • imgIn does not refer to a valid image
  • imgIn has more than 8 bits per pixel in at least one plane
  • creation of the output image failed due to insufficient memory
See also
FilterUser2x2, FilterUser5x5

◆ FilterUser5x5()

cvbbool_t FilterUser5x5 ( IMG  imgIn,
const TFilterDef filterDef,
IMG &  imgOut 
)
related

Creates an image by applying a 5x5 linear convolution filter to the input image.

The 5x5 convolution kernel needs to be specified as a TFilterDef structure. In this case all coefficient members and Offst will be evaluated. Result values will be clamped to the range [0...255].

Attention
The Minos filter functions expect the coefficients (but not the Offst member!) in units of 1/1000 so e.g., 1500 means a coefficient value of 1.5
Parameters
[in]imgInHandle to the input image.
[in]filterDefFilter definition. See TFilterDef.
[out]imgOutReceives the handle of the newly created output image. Remember to dispose of the output image with ReleaseObject from the CVCImg.dll once it is no longer needed.
Returns
TRUE if the filter function succeeded, FALSE otherwise. Possible reasons for failure are:
  • imgIn does not refer to a valid image
  • imgIn has more than 8 bits per pixel in at least one plane
  • creation of the output image failed due to insufficient memory
See also
FilterUser2x2, FilterUser3x3