Visual Servoing Platform  version 3.1.0
Brightness and contrast adjustment

Functions

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

Detailed Description

Brightness and contrast adjustment.

Function Documentation

◆ adjust() [1/4]

void vp::adjust ( vpImage< unsigned char > &  I,
const double  alpha,
const 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.

Definition at line 80 of file vpImgproc.cpp.

References vpImage< Type >::performLut().

Referenced by vp::adjust().

◆ adjust() [2/4]

void vp::adjust ( const vpImage< unsigned char > &  I1,
vpImage< unsigned char > &  I2,
const double  alpha,
const 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.

Definition at line 103 of file vpImgproc.cpp.

References vp::adjust().

◆ adjust() [3/4]

void vp::adjust ( vpImage< vpRGBa > &  I,
const double  alpha,
const 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.

Definition at line 121 of file vpImgproc.cpp.

References vpRGBa::A, vpRGBa::B, vpRGBa::G, vpImage< Type >::performLut(), and vpRGBa::R.

◆ adjust() [4/4]

void vp::adjust ( const vpImage< vpRGBa > &  I1,
vpImage< vpRGBa > &  I2,
const double  alpha,
const 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.

Definition at line 147 of file vpImgproc.cpp.

References vp::adjust().

◆ clahe() [1/2]

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

Adjust the contrast of a grayscale image locally using the Contrast Limited Adaptative Histogram Equalization method. The limit parameter allows to limit the slope of the transformation function to prevent the overamplification 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.

Definition at line 224 of file vpCLAHE.cpp.

References vpImage< Type >::getHeight(), vpImage< Type >::getWidth(), and vpImage< Type >::resize().

Referenced by vp::clahe().

◆ clahe() [2/2]

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

Adjust the contrast of a color image locally using the Contrast Limited Adaptative Histogram Equalization method. The limit parameter allows to limit the slope of the transformation function to prevent the overamplification 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.

Definition at line 489 of file vpCLAHE.cpp.

References vpImage< Type >::bitmap, vp::clahe(), vpImage< Type >::getHeight(), vpImage< Type >::getWidth(), vpImage< Type >::resize(), and vpImageConvert::split().