Foundation (CVFoundation.dll) 14.0
Image Manipulation Functions

Functions

cvbres_t AddGaussNoise (IMG ImgIn, double Mean, double StdDev, long Seed, IMG &ImgOut)
 Add gaussian distributed noise to the image. More...
 
cvbres_t AddUniformNoise (IMG ImgIn, double Lowest, double Highest, long Seed, IMG &ImgOut)
 Add uniformly distributed noise to the image. More...
 
cvbres_t CreateFilterTestImage (long Width, long Height, long Dimension, long BitsPerPixel, cvbbool_t Signed, cvbbool_t Float, IMG &ImgOut)
 Creates an image with concentric circles with a frequency that increases as the radius of the circles increases. More...
 
cvbres_t CreateGreyRamp (long Width, long Height, long Dimension, long BitsPerPixel, cvbbool_t Signed, cvbbool_t Float, double Offset, double Slope, cvbbool_t AxisHorizontal, cvbbool_t AxisVertical, IMG &ImgOut)
 Creates an n-channel image that can be used as a test image to examine the effect of applying different image processing functions. More...
 
cvbres_t DistanceTransformation (IMG ImgIn, long Index, TFilterMask MaskSize, TDistanceNorm Norm, IMG &ImgOut)
 Calculates the distance to the closest pixel in the source image with value zero for all non-zero pixels in the input image. More...
 
cvbres_t EuclideanDistanceTransform (IMG ImgIn, cvbdim_t Index, IMG &ImgOut)
 Calculates the Euclidean distance to the closest pixel in the source image with value zero for all non-zero pixels in the input image. More...
 
cvbres_t FastMarchingDistanceTransform (IMG ImgIn, cvbdim_t Index, float Radius, IMG &ImgOut)
 Calculates the distance to the closest pixel in the source image with value zero for all non-zero pixels in the input image using the fast marching method. More...
 
cvbres_t InitializeImageRect (IMG ImgIn, long left, long top, long right, long bottom, double *ValuesIn)
 Initialises the pixels in a rectangular area of interest with values from an array. More...
 
cvbres_t LocalEigenValuesAndVectors (IMG ImgIn, long Index, TFilterMask DerivatorSize, TFilterMask BlurSize, IMG &ImgLambda1, IMG &ImgLambda2, IMG &ImgEV1X, IMG &ImgEV1Y, IMG &ImgEV2X, IMG &ImgEV2Y)
 Computes, for every pixel in the input image, both eigen vectors and eigen values of the matrix More...
 
cvbres_t LocalMinEigenValues (IMG ImgIn, long Index, TFilterMask DerivatorSize, TFilterMask BlurSize, IMG &ImgLambdaMin)
 Computes, for every pixel in the input image the minimum eigen vector of the matrix More...
 
cvbres_t PyramidDownSample (IMG ImgIn, IMG &ImgOut)
 Down-samples an image in the sense of a Gaussian pyramid. More...
 
cvbres_t PyramidUpSample (IMG ImgIn, IMG &ImgOut)
 Up-samples an image in the sense of a Gaussian pyramid. More...
 
cvbres_t SwapRGBChannels (IMG ImgIn, long Order[3], IMG &ImgOut)
 Changes the plane order of a multi-planar image in memory. More...
 

Detailed Description

Function Documentation

◆ AddGaussNoise()

cvbres_t AddGaussNoise ( IMG  ImgIn,
double  Mean,
double  StdDev,
long  Seed,
IMG ImgOut 
)

Add gaussian distributed noise to the image.

This function generates random noise with Gaussian distribution that has the mean value 
and standard deviation and adds it to a source image. The resulting pixel values that exceed the
image data range are saturated to the respective data-range limits. To obtain an image which contains pure noise
with Gaussian distribution, call \ref AddGaussNoise using a source image with zero (black) data as input. \n\n
Sample: Image with added gaussian noise with mean = 32 and stddev = 32:
<table border="0">
<tr> <td> <img class="ToDisplay" src="Bracket.gif" align="left"  alt="Bracket original"> </td>

Bracket Gauss

Parameters
[in]ImgInHandle of image object.
[in]MeanMean of the gaussian distribution.
[in]StdDevStandard deviation of the gaussian distribution.
[in]SeedInitial seed value for the pseudo-random number generator.
[out]ImgOutHandle of result image.
Returns
0 : OK
< 0: an error occurred.
Supported platforms:
Win32
Win64
Related Topics:
AddUniformNoise

◆ AddUniformNoise()

cvbres_t AddUniformNoise ( IMG  ImgIn,
double  Lowest,
double  Highest,
long  Seed,
IMG ImgOut 
)

Add uniformly distributed noise to the image.

This function generates noise with uniform distribution over the range [low, high] and adds them to a source image. \n
The resulting pixel values that exceed the image data range are saturated to the respective data-range limits.
To obtain an image which contains pure noise with uniform distribution, 
call \ref AddUniformNoise using a source image with zero (black) data as input.  \n\n
Sample: Image with added uniform noise between 0 and 64:
<table border="0">
<tr> <td> <img class="ToDisplay" src="Bracket.gif" align="left"  alt="Bracket original"> </td>

Bracket Uniform

Parameters
[in]ImgInHandle of image object.
[in]LowestLower bound for the uniformly distributed noise values.
[in]HighestUpper bound for the uniformly distributed noise values.
[in]SeedInitial seed value for the pseudo-random number generator.
[out]ImgOutHandle of result image.
Returns
0 : OK
< 0: an error occurred.
Supported platforms:
Win32
Win64
Related Topics:
AddGaussNoise

◆ CreateFilterTestImage()

cvbres_t CreateFilterTestImage ( long  Width,
long  Height,
long  Dimension,
long  BitsPerPixel,
cvbbool_t  Signed,
cvbbool_t  Float,
IMG ImgOut 
)

Creates an image with concentric circles with a frequency that increases as the radius of the circles increases.

Such an image may be useful to test the characteristics (especially the anisotropy) of an image filter:
<table border="0">
<tr> <td> <img class="ToDisplay" src="FilterTest384x384.gif" align="left"  alt="Test filter image"> </td>
Parameters
[in]WidthWidth of the image to be created.
[in]HeightHeight of the image to be created.
[in]DimensionNumber of planes in the image to be created (1 for monochrome, 3 for RGB image...).
[in]BitsPerPixelNumber of bits per pixel of the output image.
Attention: Only 8 bits, 16 bits and 32 bits are allowed!
[in]SignedTRUE indicates a signed image, FALSE creates an unsigned image.
[in]FloatTRUE creates a floating point image, FALSE an image with integer values.
[out]ImgOutHandle of result image.
Returns
0 : OK
< 0: an error occurred.
Supported platforms:
Win32
Win64

◆ CreateGreyRamp()

cvbres_t CreateGreyRamp ( long  Width,
long  Height,
long  Dimension,
long  BitsPerPixel,
cvbbool_t  Signed,
cvbbool_t  Float,
double  Offset,
double  Slope,
cvbbool_t  AxisHorizontal,
cvbbool_t  AxisVertical,
IMG ImgOut 
)

Creates an n-channel image that can be used as a test image to examine the effect of applying different image processing functions.

The destination image pixel values are computed according to one of the following formula: \n\n
Horizontal-only ramp:\n
&nbsp; &nbsp; dst(x,y) = offset + slope * x\n
Vertical-only ramp:\n
&nbsp; &nbsp; dst(x,y) = offset + slope * y \n
Horizontal and vertical ramp: \n
&nbsp; &nbsp; dst(x,y) = offset + slope * x * y
<table border="0">
<tr> <td> <img class="ToDisplay" src="ImageRamp.gif" align="left"  alt="Test range image"> </td>
Attention
The linear transform coefficients offset and slope have floating-point values. The computed pixel values that exceed the image data range are saturated to the respective data-range limits.
Parameters
[in]WidthWidth of the image to be created.
[in]HeightHeight of the image to be created.
[in]DimensionNumber of planes in the image to be created (1 for monochrome, 3 for RGB image...).
[in]BitsPerPixelNumber of bits per pixel of the output image.
Attention: Only 8 bits, 16 bits and 32 bits are allowed!
[in]SignedTRUE indicates a signed image, FALSE creates an unsigned image.
[in]FloatTRUE creates a floating point image, FALSE an image with integer values.
[in]OffsetGray-wedge offset value.
[in]SlopeGray-wedge slope coefficient.
[in]AxisHorizontalSpecifies the horizontal direction of the image intensity ramp.
[in]AxisVerticalSpecifies the vertical direction of the image intensity ramp.
[out]ImgOutHandle of result image.
Returns
0 : OK
< 0: an error occurred.
Supported platforms:
Win32
Win64

◆ DistanceTransformation()

cvbres_t DistanceTransformation ( IMG  ImgIn,
long  Index,
TFilterMask  MaskSize,
TDistanceNorm  Norm,
IMG ImgOut 
)

Calculates the distance to the closest pixel in the source image with value zero for all non-zero pixels in the input image.

The distance is calculated approximatively using a set of principal distances that is governed by the MaskSize parameter and the distance norm. \n\n
Example: Distance transformation on Bracket.bmp.
To get a suitable input image for the distance transformation, the inverse of the canny edge filter image is used:
<table border="0">
<tr> <td> <img class="ToDisplay" src="Bracket.gif" align="left"  alt="Bracket original"> </td>

Bracket Canny Negative

Bracket Distance

Input image

Inverse of Canny edge filtered image

Distance transformation with L2 norm and 3x3 mask

Parameters
[in]ImgInHandle of image object.
[in]IndexPlane index in the image to work on.
[in]MaskSizeSize of the distance approximator to be used. Possible sizes are FM_3x3 and FM_5x5.
[in]NormNorm to be used to build the approximator. Allowable values are DN_LInf, DN_L1 and DN_L2.
[out]ImgOutHandle of result image.
Returns
0 : OK
< 0: an error occurred.
Supported platforms:
Win32
Win64
Related Topics:
#TDistanceNorm, #TFilterMask, EuclideanDistanceTransform

◆ EuclideanDistanceTransform()

cvbres_t EuclideanDistanceTransform ( IMG  ImgIn,
cvbdim_t  Index,
IMG ImgOut 
)

Calculates the Euclidean distance to the closest pixel in the source image with value zero for all non-zero pixels in the input image.

Parameters
[in]ImgInHandle of image object.
[in]IndexPlane index in the image to work on.
[out]ImgOutHandle of result image. The result image contains floating point values.
Returns
0 : OK
< 0: an error occurred.
Supported platforms:
Win32
Win64
Related Topics:
DistanceTransformation

◆ FastMarchingDistanceTransform()

cvbres_t FastMarchingDistanceTransform ( IMG  ImgIn,
cvbdim_t  Index,
float  Radius,
IMG ImgOut 
)

Calculates the distance to the closest pixel in the source image with value zero for all non-zero pixels in the input image using the fast marching method.

Parameters
[in]ImgInHandle of image object.
[in]IndexPlane index in the image to work on.
[in]RadiusRadius of the neighborhood of the marked area. If the Radius is positive, then the FMM (fast marching method) distance with the negative sign is calculated in the Euclidean radius neighborhood.
[out]ImgOutHandle of result image. The result image contains floating point values.
Returns
0 : OK
< 0: an error occurred.
Supported platforms:
Win32
Win64
Related Topics:
DistanceTransformation

◆ InitializeImageRect()

cvbres_t InitializeImageRect ( IMG  ImgIn,
long  left,
long  top,
long  right,
long  bottom,
double *  ValuesIn 
)

Initialises the pixels in a rectangular area of interest with values from an array.

Parameters
[in]ImgInHandle of image object.
[in]leftLeft edge of the area of interest.
[in]topTop edge of the area of interest.
[in]rightRight edge of the area of interest.
[in]bottomBottom edge of the area of interest.
[in]ValuesInBuffer with intensity values with which to initialize the selected area of interest in the image.
Returns
0 : OK
< 0: an error occurred.
Supported platforms:
Win32
Win64
Related Topics:
Image Dll function InitializeImageArea
Areas and rectangles

◆ LocalEigenValuesAndVectors()

cvbres_t LocalEigenValuesAndVectors ( IMG  ImgIn,
long  Index,
TFilterMask  DerivatorSize,
TFilterMask  BlurSize,
IMG ImgLambda1,
IMG ImgLambda2,
IMG ImgEV1X,
IMG ImgEV1Y,
IMG ImgEV2X,
IMG ImgEV2Y 
)

Computes, for every pixel in the input image, both eigen vectors and eigen values of the matrix

Eigen matrix

 

 


D stands for the derivative operator (it is the Sobel operator that is applied internally here) in x or y direction. Summation occurs over the blur window around a pixel. The output is a set of 6 floating-point images, containing the two eigen values (not sorted by size) and the associated eigen vectors for each pixel of the input image. In cases where the matrix is singular or when one eigen value is much bigger than the other, all 6 output values are set to zero.

This kind of operation is useful when it comes to detecting e. g. curvatures in the image, because the eigen values tend to differ significantly from zero only in regions where the are curved edges. Perfectly straight edges or random noise will result in eigen values close to zero.

Bracket original
Input image
Eigenvalues 1
Vect1X
Vect1Y
Eigen Value 1 Eigen Vector 1, X component Eigen Vector 1, Y component
Eigenvalues 2
Vect2X
Vect2Y
Eigen Value 2 Eigen Vector 2, X component Eigen Vector 2, Y component
Parameters
[in]ImgInHandle of image object.
[in]IndexPlane index to work on.
[in]DerivatorSizeSize of the kernel of the Sobel operator to be used for the derivation operations internally. Allowable values are FM_3x3, FM_5x5 .
[in]BlurSizeMask size for blurring/summation. Allowable values are FM_3x3, FM_5x5 .
[out]ImgLambda1First eigen values for each pixel of the input image.
Attention: Note that the pixel format is floating point.
[out]ImgLambda2Second eigen values for each pixel of the input image.
Attention: Note that the pixel format is floating point.
[out]ImgEV1XX-component of the eigen vector associated with the first eigen value for each pixel of the input image.
Attention: Note that the pixel format is floating point.
[out]ImgEV1YY-component of the eigen vector associated with the first eigen value for each pixel of the input image.
Attention: Note that the pixel format is floating point.
[out]ImgEV2XX-component of the eigen vector associated with the second eigen value for each pixel of the input image.
Attention: Note that the pixel format is floating point.
[out]ImgEV2YY-component of the eigen vector associated with the second eigen value for each pixel of the input image.
Attention: Note that the pixel format is floating point.
Returns
0 : OK
< 0: an error occurred.
Supported platforms:
Win32
Win64
Related Topics:
TFilterMask, LocalMinEigenValues

◆ LocalMinEigenValues()

cvbres_t LocalMinEigenValues ( IMG  ImgIn,
long  Index,
TFilterMask  DerivatorSize,
TFilterMask  BlurSize,
IMG ImgLambdaMin 
)

Computes, for every pixel in the input image the minimum eigen vector of the matrix

Eigen matrix

 

 


D stands for the derivative operator (it is the Sobel operator that is applied internally here) in x or y direction. Summation occurs over the blur window around a pixel. The output is a floating-point image, containing the smallest of the two eigen values for each pixel of the input image.

This kind of operation is useful when it comes to detecting e. g. curvatures in the image, because the eigen values tend to differ significantly from zero only in regions where the are curved edges. Perfectly straight edges or random noise will result in eigen values close to zero.

Bracket original
Minimum eigen value
Input image Minimum Eigen Values
Parameters
[in]ImgInHandle of image object.
[in]IndexPlane index to work on.
[in]DerivatorSizeSize of the kernel of the Sobel operator to be used for the derivation operations internally. Allowable values are FM_3x3, FM_5x5 .
[in]BlurSizeMask size for blurring/summation. Allowable values are FM_3x3, FM_5x5 .
[out]ImgLambdaMinMinimum eigen values for each pixel of the input image.
Attention: Note that the pixel format is floating point.
Returns
0 : OK
< 0: an error occurred.
Supported platforms:
Win32
Win64
Related Topics:
TFilterMask, LocalEigenValuesAndVectors

◆ PyramidDownSample()

cvbres_t PyramidDownSample ( IMG  ImgIn,
IMG ImgOut 
)

Down-samples an image in the sense of a Gaussian pyramid.

It applies a 5x5 Gaussian Kernel to the image, then down-samples the image by omitting every odd row and column,
producing an output image whose size is halved in each dimension.
Parameters
[in]ImgInHandle of image object.
[out]ImgOutHandle of the result image.
Returns
0 : OK
< 0: an error occurred.
Supported platforms:
Win32
Win64
Related Topics:
PyramidUpSample

◆ PyramidUpSample()

cvbres_t PyramidUpSample ( IMG  ImgIn,
IMG ImgOut 
)

Up-samples an image in the sense of a Gaussian pyramid.

It inserts odd columns and rows filled with 0, then applies a 5x5
Gaussian Kernel multiplied by 4 to the image.
Parameters
[in]ImgInHandle of image object.
[out]ImgOutHandle of the result image.
Returns
0 : OK
< 0: an error occurred.
Supported platforms:
Win32
Win64
Related Topics:
PyramidDownSample

◆ SwapRGBChannels()

cvbres_t SwapRGBChannels ( IMG  ImgIn,
long  Order[3],
IMG ImgOut 
)

Changes the plane order of a multi-planar image in memory.

The change is not virtual - the actual bytes in memory are swapped according to the function parameters. 
The new plane order is determined by the array parameter order.\n\n
For example, if sequence of planes in source image is A, B, C and Order[0]=2, Order[1]=0, Order[2]=1, then the 
order of planes in the destination image will be C, A, B. Some or all components of Order may have the same values. 
Parameters
[in]ImgInHandle of image object.
[in]OrderSequence of the channels in the destination image.
Attention: The size of the array must be 3 and should have o other values than 0, 1 and 2.
[out]ImgOutHandle of result image.
Returns
0 : OK
< 0: an error occurred.
Supported platforms:
Win32
Win64