Foundation (CVFoundation.dll) 15.0
Arithmetic Functions

Functions

cvbres_t AbsoluteImage (IMG ImgIn, IMG &ImgOut)
 Computes absolute pixel values of a source image and places them into the destination image. More...
 
cvbres_t AddConstant (IMG ImgIn, double Values[], cvbbool_t ScaleResults, IMG &ImgOut)
 Adds a constant to pixel values of the input image. More...
 
cvbres_t AddConstantComplex (IMG ImgIn, double ValuesRe[], double ValuesIm[], BOOL ScaleResults, IMG &ImgOut)
 Adds a constant value to the input image which is complex. More...
 
cvbres_t AddImages (IMG ImgIn1, IMG ImgIn2, cvbbool_t ScaleResults, IMG &ImgOut)
 Add the pixel values of both input images to obtain the output image. More...
 
cvbres_t AndConstant (IMG ImgIn, long Values[], IMG &ImgOut)
 Performs a bitwise AND operation of each pixel with a constant. More...
 
cvbres_t AndImages (IMG ImgIn1, IMG ImgIn2, IMG &ImgOut)
 Performs a bitwise AND operation between the corresponding pixels of the two input images. More...
 
cvbres_t DivideConstant (IMG ImgIn, double Values[], IMG &ImgOut)
 Divides pixel values of the input image by a constant value. More...
 
cvbres_t DivideConstantComplex (IMG ImgIn, double ValuesRe[], double ValuesIm[], IMG &ImgOut)
 Divides a constant value to the input image which is complex. More...
 
cvbres_t DivideImages (IMG ImgIn1, IMG ImgIn2, long UpShift, IMG &ImgOut)
 Divides pixel values of the ImgIn2 by the corresponding pixel values of the ImgIn1 to obtain the output image. More...
 
cvbres_t DownShift (IMG ImgIn, long Values[], IMG &ImgOut)
 Decreases the intensity of pixels in the source buffer by shifting the bits in each pixel to the right (down). More...
 
cvbres_t MultiplyConstant (IMG ImgIn, double Values[], cvbbool_t ScaleResults, IMG &ImgOut)
 Multiply a constant to pixel values of the input image. More...
 
cvbres_t MultiplyImages (IMG ImgIn1, IMG ImgIn2, cvbbool_t ScaleResults, IMG &ImgOut)
 Multiplies the pixel values of both input images to obtain the output image. More...
 
cvbres_t NegateImage (IMG ImgIn, IMG &ImgOut)
 Performs a bitwise NOT operation on each pixel of the source image (calculates the bitwise complement of the image). More...
 
cvbres_t OrConstant (IMG ImgIn, long Values[], IMG &ImgOut)
 Performs a bitwise inclusive OR operation between each pixel and a constant. More...
 
cvbres_t OrImages (IMG ImgIn1, IMG ImgIn2, IMG &ImgOut)
 Performs bitwise inclusive OR operation between between the corresponding pixels of the two input images. More...
 
cvbres_t SquareImage (IMG ImgIn, cvbbool_t ScaleResults, IMG &ImgOut)
 Squares the pixel values of the input image to obtain the output image. More...
 
cvbres_t SquareRootImage (IMG ImgIn, cvbbool_t ScaleResults, IMG &ImgOut)
 Computes square roots of pixel values of the source image and writes them into the destination image. More...
 
cvbres_t SubtractConstant (IMG ImgIn, double Values[], IMG &ImgOut)
 Subtracts a constant to pixel values of the input image. More...
 
cvbres_t SubtractConstantAbsolute (IMG ImgIn, double Values[], IMG &ImgOut)
 Calculates the absolute pixel-wise difference between the source image and a scalar value. More...
 
cvbres_t SubtractImages (IMG ImgIn1, IMG ImgIn2, IMG &ImgOut)
 Subtracts the pixel values of ImgIn1 from the values of ImgIn2, to obtain the output image. More...
 
cvbres_t SubtractImagesAbsolute (IMG ImgIn1, IMG ImgIn2, IMG &ImgOut)
 Calculates the absolute pixel-wise difference between two images. More...
 
cvbres_t UpShift (IMG ImgIn, long Values[], IMG &ImgOut)
 Changes the intensity of pixels in the source buffer by shifting the bits in each pixel to the left (up). More...
 
cvbres_t XorConstant (IMG ImgIn, long Values[], IMG &ImgOut)
 Performs a bitwise XOR (exclusive OR) operation between each pixel and a constant. More...
 
cvbres_t XorImages (IMG ImgIn1, IMG ImgIn2, IMG &ImgOut)
 Performs bitwise XOR (exclusive OR) operation between between the corresponding pixels of the two input images. More...
 

Detailed Description

Function Documentation

◆ AbsoluteImage()

cvbres_t AbsoluteImage ( IMG  ImgIn,
IMG ImgOut 
)

Computes absolute pixel values of a source image and places them into the destination image.

This function takes the absolute value of each channel in each pixel of the source image and places the result into a destination image. The whole image is been used.

Parameters
[in]ImgInImage handle of input image.
[out]ImgOutImage handle of result image.
Returns
0 : OK
< 0: an error occurred.
Supported platforms:
Win32
Win64

◆ AddConstant()

cvbres_t AddConstant ( IMG  ImgIn,
double  Values[],
cvbbool_t  ScaleResults,
IMG ImgOut 
)

Adds a constant to pixel values of the input image.

A positive value brightens the image (increases the intensity) and a negative value darkens the image (decreases the intensity).

Parameters
[in]ImgInHandle of image object.
[in]ValuesConstant value to add to image pixel values or constant vector in case of multi-channel images (the number of elements in the array have to be equal the number of planes in the input image).
Attention: Visual Basic users should build an array and pass the first element of that array to the function.
[in]ScaleResultsTRUE indicates that the resulting pixel values are divided to scale them to the allowable gray value range under the untested assumption that the added constant(s) is/are in the allowable range as well.
FALSE means that the resulting gray values will be cut off at the maximum allowable gray value.
[out]ImgOutImage handle of result image.
Returns
0 : OK
< 0: an error occurred.
Supported platforms:
Win32
Win64
Related Topics:
AddImages

◆ AddConstantComplex()

cvbres_t AddConstantComplex ( IMG  ImgIn,
double  ValuesRe[],
double  ValuesIm[],
BOOL  ScaleResults,
IMG ImgOut 
)

Adds a constant value to the input image which is complex.

A positive value brightens the image (increases the intensity) and a negative value darkens the image (decreases the intensity). The function processes both real and imaginary parts of pixel values.

Parameters
[in]ImgInHandle of image object.
[in]ValuesReConstant value (real part) to add to image pixel values or constant vector in case of multi-channel images (the number of elements in the array have to be equal the number of planes in the input image).
Attention: Visual Basic users should build an array and pass the first element of that array to the function.
[in]ValuesImConstant value (imaginary part) to add to image pixel values or constant vector in case of multi-channel images (the number of elements in the array have to be equal the number of planes in the input image).
Attention: Visual Basic users should build an array and pass the first element of that array to the function.
[in]ScaleResultsTRUE indicates that the resulting pixel values are divided to scale them to the allowable gray value range under the untested assumption that the added constant(s) is/are in the allowable range as well.
FALSE means that the resulting gray values will be cut off at the maximum allowable gray value.
[out]ImgOutImage handle of result image.
Returns
0 : OK
< 0: an error occurred.
Supported platforms:
Win32
Win64
Related Topics:
AddImages, AddConstant

◆ AddImages()

cvbres_t AddImages ( IMG  ImgIn1,
IMG  ImgIn2,
cvbbool_t  ScaleResults,
IMG ImgOut 
)

Add the pixel values of both input images to obtain the output image.

If the sizes of the two input images differ, the result image will contain the biggest rectangle common to both input images.

Parameters
[in]ImgIn1Handle of first image object.
[in]ImgIn2Handle of the second image object.
Attention: Needs to be either compatible (same dimension) with the first image, or a floating point image.
[in]ScaleResultsTRUE indicates that the resulting pixel values are divided to fit the dynamic range of the image.
FALSE means that the resulting gray values will be cut off at the maximum allowable gray value.
[out]ImgOutImage handle of result image.
Returns
0 : OK
< 0: an error occurred.
Supported platforms:
Win32
Win64
Related Topics:
AddConstant

◆ AndConstant()

cvbres_t AndConstant ( IMG  ImgIn,
long  Values[],
IMG ImgOut 
)

Performs a bitwise AND operation of each pixel with a constant.

Parameters
[in]ImgInHandle of image object.
[in]ValuesConstant value for bitwise AND operation or constant vector in case of multi-channel images (the number of elements in the array have to be equal the number of planes in the input image).
Attention: Visual Basic users should build an array and pass the first element of that array to the function.
[out]ImgOutImage handle of result image.
Returns
0 : OK
< 0: an error occurred.
Supported platforms:
Win32
Win64
Related Topics:
AndImages

◆ AndImages()

cvbres_t AndImages ( IMG  ImgIn1,
IMG  ImgIn2,
IMG ImgOut 
)

Performs a bitwise AND operation between the corresponding pixels of the two input images.

If the sizes of the two input images differ, the result image will contain the biggest rectangle common to both input images.
Parameters
[in]ImgIn1Handle of first image object.
[in]ImgIn2Handle of the second image object.
Attention: Needs to be either compatible (same dimension and data type) with the first image.
[out]ImgOutImage handle of result image.
Returns
0 : OK
< 0: an error occurred.
Supported platforms:
Win32
Win64
Related Topics:
AndConstant

◆ DivideConstant()

cvbres_t DivideConstant ( IMG  ImgIn,
double  Values[],
IMG ImgOut 
)

Divides pixel values of the input image by a constant value.

Attention
All elements in the constant vector must be different from 0.
Parameters
[in]ImgInHandle of image object.
[in]ValuesDivides pixel values by a constant value or in case of multi-channel images by a constant vector (the number of elements in the array have to be equal the number of planes in the input image).
Attention: Visual Basic users should build an array and pass the first element of that array to the function.
[out]ImgOutImage handle of result image.
Returns
0 : OK
< 0: an error occurred.
Supported platforms:
Win32
Win64
Related Topics:
DivideImages

◆ DivideConstantComplex()

cvbres_t DivideConstantComplex ( IMG  ImgIn,
double  ValuesRe[],
double  ValuesIm[],
IMG ImgOut 
)

Divides a constant value to the input image which is complex.

The function processes both real and imaginary parts of pixel values.

Attention
All elements in the constant vectors must be different from 0.
Parameters
[in]ImgInHandle of image object.
[in]ValuesReConstant value (real part) to divide to image pixel values or constant vector in case of multi-channel images (the number of elements in the array have to be equal the number of planes in the input image).
Attention: Visual Basic users should build an array and pass the first element of that array to the function.
[in]ValuesImConstant value (imaginary part) to divide to image pixel values or constant vector in case of multi-channel images (the number of elements in the array have to be equal the number of planes in the input image).
Attention: Visual Basic users should build an array and pass the first element of that array to the function.
[out]ImgOutImage handle of result image.
Returns
0 : OK
< 0: an error occurred.
Supported platforms:
Win32
Win64
Related Topics:
DivideImages, DivideConstant

◆ DivideImages()

cvbres_t DivideImages ( IMG  ImgIn1,
IMG  ImgIn2,
long  UpShift,
IMG ImgOut 
)

Divides pixel values of the ImgIn2 by the corresponding pixel values of the ImgIn1 to obtain the output image.

If the sizes of the two input images differ, the result image will contain the biggest rectangle common to both input images. The result values are very small values therefore the parameter UpShift gives the possibility to do a bit-shift to get more reasonable values.

Parameters
[in]ImgIn1Handle of first image object.
[in]ImgIn2Handle of the second image object.
Attention: Needs to be either compatible (same dimension and data type) with the first image, or a floating point image.
[in]UpShiftValue for the bit-shift operation.
[out]ImgOutImage handle of result image.
Returns
0 : OK
< 0: an error occurred.
Supported platforms:
Win32
Win64
Related Topics:
DivideConstant

◆ DownShift()

cvbres_t DownShift ( IMG  ImgIn,
long  Values[],
IMG ImgOut 
)

Decreases the intensity of pixels in the source buffer by shifting the bits in each pixel to the right (down).

The positions vacated after shifting the bits are filled with the sign bit.
A downshift by 1 effectively means a multiplication by 2 - therefore DownShift is a quick way to multiply pixel values by powers of 2.

Parameters
[in]ImgInHandle of image object.
[in]ValuesConstant value for the downshift or constant vector in case of multi-channel images (the number of elements in the array have to be equal the number of planes in the input image).
Attention: Visual Basic users should build an array and pass the first element of that array to the function.
[out]ImgOutImage handle of result image.
Returns
0 : OK
< 0: an error occurred.
Supported platforms:
Win32
Win64
Related Topics:
UpShift

◆ MultiplyConstant()

cvbres_t MultiplyConstant ( IMG  ImgIn,
double  Values[],
cvbbool_t  ScaleResults,
IMG ImgOut 
)

Multiply a constant to pixel values of the input image.

Parameters
[in]ImgInHandle of image object.
[in]ValuesConstant value to multiply to image pixel values or constant vector in case of multi-channel images (the number of elements in the array have to be equal the number of planes in the input image).
Attention: Visual Basic users should build an array and pass the first element of that array to the function.
[in]ScaleResultsTRUE indicates that the resulting pixel values are divided to scale them to the allowable gray value range under the untested assumption that the added constant(s) is/are in the allowable range as well.
FALSE means that the resulting gray values will be cut off at the maximum allowable gray value.
[out]ImgOutImage handle of result image.
Returns
0 : OK
< 0: an error occurred.
Supported platforms:
Win32
Win64
Related Topics:
MultiplyImages

◆ MultiplyImages()

cvbres_t MultiplyImages ( IMG  ImgIn1,
IMG  ImgIn2,
cvbbool_t  ScaleResults,
IMG ImgOut 
)

Multiplies the pixel values of both input images to obtain the output image.

If the sizes of the two input images differ, the result image will contain the biggest rectangle common to both input images.

Parameters
[in]ImgIn1Handle of first image object.
[in]ImgIn2Handle of the second image object.
Attention: Needs to be either compatible (same dimension and data type) with the first image.
[in]ScaleResultsTRUE indicates that the resulting pixel values are divided to fit the dynamic range of the image.
FALSE means that the resulting gray values will be cut off at the maximum allowable gray value.
[out]ImgOutImage handle of result image.
Returns
0 : OK
< 0: an error occurred.
Supported platforms:
Win32
Win64
Related Topics:
MultiplyConstant

◆ NegateImage()

cvbres_t NegateImage ( IMG  ImgIn,
IMG ImgOut 
)

Performs a bitwise NOT operation on each pixel of the source image (calculates the bitwise complement of the image).

Parameters
[in]ImgInHandle of image object.
[out]ImgOutImage handle of result image.
Returns
0 : OK
< 0: an error occurred.
Supported platforms:
Win32
Win64

◆ OrConstant()

cvbres_t OrConstant ( IMG  ImgIn,
long  Values[],
IMG ImgOut 
)

Performs a bitwise inclusive OR operation between each pixel and a constant.

Parameters
[in]ImgInHandle of image object.
[in]ValuesConstant value for bitwise inclusive OR operation or constant vector in case of multi-channel images (the number of elements in the array have to be equal the number of planes in the input image).
Attention: Visual Basic users should build an array and pass the first element of that array to the function.
[out]ImgOutImage handle of result image.
Returns
0 : OK
< 0: an error occurred.
Supported platforms:
Win32
Win64
Related Topics:
OrImages, XorImages, XorConstant

◆ OrImages()

cvbres_t OrImages ( IMG  ImgIn1,
IMG  ImgIn2,
IMG ImgOut 
)

Performs bitwise inclusive OR operation between between the corresponding pixels of the two input images.

If the sizes of the two input images differ, the result image will contain the biggest rectangle common to both input images.

Parameters
[in]ImgIn1Handle of first image object.
[in]ImgIn2Handle of the second image object.
Attention: Needs to be either compatible (same dimension and data type) with the first image.
[out]ImgOutImage handle of result image.
Returns
0 : OK
< 0: an error occurred.
Supported platforms:
Win32
Win64
Related Topics:
OrConstant, XorImages, XorConstant

◆ SquareImage()

cvbres_t SquareImage ( IMG  ImgIn,
cvbbool_t  ScaleResults,
IMG ImgOut 
)

Squares the pixel values of the input image to obtain the output image.

Parameters
[in]ImgInHandle of image object.
[in]ScaleResultsTRUE indicates that the resulting pixel values are divided to scale them to the allowable gray value range under the untested assumption that the added constant(s) is/are in the allowable range as well.
FALSE means that the resulting gray values will be cut off at the maximum allowable gray value.
[out]ImgOutImage handle of result image.
Returns
0 : OK
< 0: an error occurred.
Supported platforms:
Win32
Win64
Related Topics:
SquareRootImage

◆ SquareRootImage()

cvbres_t SquareRootImage ( IMG  ImgIn,
cvbbool_t  ScaleResults,
IMG ImgOut 
)

Computes square roots of pixel values of the source image and writes them into the destination image.

Parameters
[in]ImgInHandle of image object.
[in]ScaleResultsTRUE indicates that the resulting pixel values are divided to scale them to the allowable gray value range under the untested assumption that the added constant(s) is/are in the allowable range as well.
FALSE means that the resulting gray values will be cut off at the maximum allowable gray value.
[out]ImgOutImage handle of result image.
Returns
0 : OK
< 0: an error occurred.
Supported platforms:
Win32
Win64
Related Topics:
SquareImage

◆ SubtractConstant()

cvbres_t SubtractConstant ( IMG  ImgIn,
double  Values[],
IMG ImgOut 
)

Subtracts a constant to pixel values of the input image.

Parameters
[in]ImgInHandle of image object.
[in]ValuesConstant value to subtract to image pixel values or constant vector in case of multi-channel images (the number of elements in the array have to be equal the number of planes in the input image).
Attention: Visual Basic users should build an array and pass the first element of that array to the function.
[out]ImgOutImage handle of result image.
Returns
0 : OK
< 0: an error occurred.
Supported platforms:
Win32
Win64
Related Topics:
SubtractImages

◆ SubtractConstantAbsolute()

cvbres_t SubtractConstantAbsolute ( IMG  ImgIn,
double  Values[],
IMG ImgOut 
)

Calculates the absolute pixel-wise difference between the source image and a scalar value.

Parameters
[in]ImgInHandle of image object.
[in]ValuesCalculates absolute difference between image pixel values and constant value or constant vector in case of multi-channel images (the number of elements in the array have to be equal the number of planes in the input image).
Attention: Visual Basic users should build an array and pass the first element of that array to the function.
[out]ImgOutImage handle of result image.
Returns
0 : OK
< 0: an error occurred.
Supported platforms:
Win32
Win64
Related Topics:
SubtractImages, AbsoluteImage, SubtractImagesAbsolute

◆ SubtractImages()

cvbres_t SubtractImages ( IMG  ImgIn1,
IMG  ImgIn2,
IMG ImgOut 
)

Subtracts the pixel values of ImgIn1 from the values of ImgIn2, to obtain the output image.

If the sizes of the two input images differ, the result image will contain the biggest rectangle common to both input images.

Parameters
[in]ImgIn1Handle of first image object.
[in]ImgIn2Handle of the second image object.
Attention: Needs to be either compatible (same dimension and data type) with the first image, or a floating point image.
[out]ImgOutImage handle of result image.
Returns
0 : OK
< 0: an error occurred.
Supported platforms:
Win32
Win64
Related Topics:
SubtractConstant

◆ SubtractImagesAbsolute()

cvbres_t SubtractImagesAbsolute ( IMG  ImgIn1,
IMG  ImgIn2,
IMG ImgOut 
)

Calculates the absolute pixel-wise difference between two images.

ImgOut = abs (ImgIn1 - ImgIn2)
If the sizes of the two input images differ, the result image will contain the biggest rectangle common to both input images.

Parameters
[in]ImgIn1Handle of first image object.
[in]ImgIn2Handle of the second image object.
Attention: Needs to be either compatible (same dimension and data type) with the first image.
[out]ImgOutImage handle of result image.
Returns
0 : OK
< 0: an error occurred.
Supported platforms:
Win32
Win64
Related Topics:
SubtractImages, AbsoluteImage, SubtractConstantAbsolute

◆ UpShift()

cvbres_t UpShift ( IMG  ImgIn,
long  Values[],
IMG ImgOut 
)

Changes the intensity of pixels in the source buffer by shifting the bits in each pixel to the left (up).

The positions vacated after shifting the bits are filled with zeros.
An upshift by 1 effectively means a multiplication by 2 - therefore UpShift is a quick way to multiply pixel values by powers of 2.

Parameters
[in]ImgInHandle of image object.
[in]ValuesConstant value for the upshift or constant vector in case of multi-channel images (the number of elements in the array have to be equal the number of planes in the input image).
Attention: Visual Basic users should build an array and pass the first element of that array to the function.
[out]ImgOutImage handle of result image.
Returns
0 : OK
< 0: an error occurred.
Supported platforms:
Win32
Win64
Related Topics:
DownShift

◆ XorConstant()

cvbres_t XorConstant ( IMG  ImgIn,
long  Values[],
IMG ImgOut 
)

Performs a bitwise XOR (exclusive OR) operation between each pixel and a constant.

Parameters
[in]ImgInHandle of image object.
[in]ValuesConstant value for bitwise exclusive OR operation or constant vector in case of multi-channel images (the number of elements in the array have to be equal the number of planes in the input image).
Attention: Visual Basic users should build an array and pass the first element of that array to the function.
[out]ImgOutImage handle of result image.
Returns
0 : OK
< 0: an error occurred.
Supported platforms:
Win32
Win64
Related Topics:
OrImages, XorImages, OrConstant

◆ XorImages()

cvbres_t XorImages ( IMG  ImgIn1,
IMG  ImgIn2,
IMG ImgOut 
)

Performs bitwise XOR (exclusive OR) operation between between the corresponding pixels of the two input images.

If the sizes of the two input images differ, the result image will contain the biggest rectangle common to both input images.

Parameters
[in]ImgIn1Handle of first image object.
[in]ImgIn2Handle of the second image object.
Attention: Needs to be either compatible (same dimension and data type) with the first image.
[out]ImgOutImage handle of result image.
Returns
0 : OK
< 0: an error occurred.
Supported platforms:
Win32
Win64
Related Topics:
OrImages, OrConstant, XorConstant