Visual Servoing Platform  version 3.6.1 under development (2024-12-12)
Brightness and contrast adjustment

Functions

VISP_EXPORT void VISP_NAMESPACE_NAME::adjust (VISP_NAMESPACE_ADDRESSING vpImage< unsigned char > &I, double alpha, double beta)
 
VISP_EXPORT void VISP_NAMESPACE_NAME::adjust (const VISP_NAMESPACE_ADDRESSING vpImage< unsigned char > &I1, VISP_NAMESPACE_ADDRESSING vpImage< unsigned char > &I2, double alpha, double beta)
 
VISP_EXPORT void VISP_NAMESPACE_NAME::adjust (VISP_NAMESPACE_ADDRESSING vpImage< VISP_NAMESPACE_ADDRESSING vpRGBa > &I, const double alpha, double beta)
 
VISP_EXPORT void VISP_NAMESPACE_NAME::adjust (const VISP_NAMESPACE_ADDRESSING vpImage< VISP_NAMESPACE_ADDRESSING vpRGBa > &I1, VISP_NAMESPACE_ADDRESSING vpImage< VISP_NAMESPACE_ADDRESSING vpRGBa > &I2, double alpha, double beta)
 
VISP_EXPORT void VISP_NAMESPACE_NAME::clahe (const VISP_NAMESPACE_ADDRESSING vpImage< unsigned char > &I1, VISP_NAMESPACE_ADDRESSING vpImage< unsigned char > &I2, int blockRadius=150, int bins=256, float slope=3.0f, bool fast=true)
 
VISP_EXPORT void VISP_NAMESPACE_NAME::clahe (const VISP_NAMESPACE_ADDRESSING vpImage< VISP_NAMESPACE_ADDRESSING vpRGBa > &I1, VISP_NAMESPACE_ADDRESSING vpImage< VISP_NAMESPACE_ADDRESSING vpRGBa > &I2, int blockRadius=150, int bins=256, float slope=3.0f, bool fast=true)
 

Detailed Description

Brightness and contrast adjustment.

Function Documentation

◆ adjust() [1/4]

VISP_EXPORT void VISP_NAMESPACE_NAME::adjust ( const VISP_NAMESPACE_ADDRESSING vpImage< unsigned char > &  I1,
VISP_NAMESPACE_ADDRESSING vpImage< unsigned char > &  I2,
double  alpha,
double  beta 
)

Adjust the brightness of a grayscale image such as the new intensity is alpha x old_intensity + beta.

Parameters
I1: The original grayscale image.
I2: The grayscale image after adjusting pixel intensities.
alpha: Multiplication coefficient.
beta: Constant value added to the old intensity.

◆ adjust() [2/4]

VISP_EXPORT void VISP_NAMESPACE_NAME::adjust ( const VISP_NAMESPACE_ADDRESSING vpImage< VISP_NAMESPACE_ADDRESSING vpRGBa > &  I1,
VISP_NAMESPACE_ADDRESSING vpImage< VISP_NAMESPACE_ADDRESSING vpRGBa > &  I2,
double  alpha,
double  beta 
)

Adjust the brightness of a color image such as the new intensity is alpha x old_intensity + beta.

Parameters
I1: The original color image.
I2: The color image after adjusting pixel intensities.
alpha: Multiplication coefficient.
beta: Constant value added to the old intensity.

◆ adjust() [3/4]

VISP_EXPORT void VISP_NAMESPACE_NAME::adjust ( VISP_NAMESPACE_ADDRESSING vpImage< unsigned char > &  I,
double  alpha,
double  beta 
)

Adjust the brightness of a grayscale image such as the new intensity is alpha x old_intensity + beta.

Parameters
I: The grayscale image to adjust the brightness.
alpha: Multiplication coefficient.
beta: Constant value added to the old intensity.
Examples
testImgproc.cpp, and tutorial-brightness-adjustment.cpp.

Referenced by VISP_NAMESPACE_NAME::adjust().

◆ adjust() [4/4]

VISP_EXPORT void VISP_NAMESPACE_NAME::adjust ( VISP_NAMESPACE_ADDRESSING vpImage< VISP_NAMESPACE_ADDRESSING vpRGBa > &  I,
const double  alpha,
double  beta 
)

Adjust the brightness of a color image such as the new intensity is alpha x old_intensity + beta.

Parameters
I: The color image to adjust the brightness.
alpha: Multiplication coefficient.
beta: Constant value added to the old intensity.

◆ clahe() [1/2]

VISP_EXPORT void VISP_NAMESPACE_NAME::clahe ( const VISP_NAMESPACE_ADDRESSING vpImage< unsigned char > &  I1,
VISP_NAMESPACE_ADDRESSING vpImage< unsigned char > &  I2,
int  blockRadius = 150,
int  bins = 256,
float  slope = 3.0f,
bool  fast = true 
)

Adjust the contrast of a grayscale image locally using the Contrast Limited Adaptive Histogram Equalization method. The limit parameter allows to limit the slope of the transformation function to prevent the over amplification of noise. This method is a transcription of the CLAHE ImageJ plugin code by Stephan Saalfeld.

Parameters
I1: The first grayscale image.
I2: The second grayscale image after application of the CLAHE method.
blockRadius: The size (2*blockRadius+1) of the local region around a pixel for which the histogram is equalized. This size should be larger than the size of features to be preserved.
bins: The number of histogram bins used for histogram equalization (between 1 and 256). The number of histogram bins should be smaller than the number of pixels in a block.
slope: Limits the contrast stretch in the intensity transfer function. Very large values will let the histogram equalization do whatever it wants to do, that is result in maximal local contrast. The value 1 will result in the original image.
fast: Use the fast but less accurate version of the filter. The fast version does not evaluate the intensity transfer function for each pixel independently but for a grid of adjacent boxes of the given block size only and interpolates for locations in between.
Examples
testImgproc.cpp, and tutorial-contrast-sharpening.cpp.

Referenced by VISP_NAMESPACE_NAME::clahe().

◆ clahe() [2/2]

VISP_EXPORT void VISP_NAMESPACE_NAME::clahe ( const VISP_NAMESPACE_ADDRESSING vpImage< VISP_NAMESPACE_ADDRESSING vpRGBa > &  I1,
VISP_NAMESPACE_ADDRESSING vpImage< VISP_NAMESPACE_ADDRESSING vpRGBa > &  I2,
int  blockRadius = 150,
int  bins = 256,
float  slope = 3.0f,
bool  fast = true 
)

Adjust the contrast of a color image locally using the Contrast Limited Adaptive Histogram Equalization method. The limit parameter allows to limit the slope of the transformation function to prevent the over amplification of noise. This method is a transcription of the CLAHE ImageJ plugin code by Stephan Saalfeld.

Parameters
I1: The first color image.
I2: The second color image after application of the CLAHE method.
blockRadius: The size (2*blockRadius+1) of the local region around a pixel for which the histogram is equalized. This size should be larger than the size of features to be preserved.
bins: The number of histogram bins used for histogram equalization (between 1 and 256). The number of histogram bins should be smaller than the number of pixels in a block.
slope: Limits the contrast stretch in the intensity transfer function. Very large values will let the histogram equalization do whatever it wants to do, that is result in maximal local contrast. The value 1 will result in the original image.
fast: Use the fast but less accurate version of the filter. The fast version does not evaluate the intensity transfer function for each pixel independently but for a grid of adjacent boxes of the given block size only and interpolates for locations in between.