OpenCV  4.3.0
Open Source Computer Vision
Functions
The module brings implementations of intensity transformation algorithms to adjust image contrast.

Functions

void cv::intensity_transform::autoscaling (const Mat input, Mat &output)
 Given an input bgr or grayscale image, apply autoscaling on domain [0, 255] to increase the contrast of the input image and return the resulting image. More...
 
void cv::intensity_transform::contrastStretching (const Mat input, Mat &output, const int r1, const int s1, const int r2, const int s2)
 Given an input bgr or grayscale image, apply linear contrast stretching on domain [0, 255] and return the resulting image. More...
 
void cv::intensity_transform::gammaCorrection (const Mat input, Mat &output, const float gamma)
 Given an input bgr or grayscale image and constant gamma, apply power-law transformation, a.k.a. gamma correction to the image on domain [0, 255] and return the resulting image. More...
 
void cv::intensity_transform::logTransform (const Mat input, Mat &output)
 Given an input bgr or grayscale image and constant c, apply log transformation to the image on domain [0, 255] and return the resulting image. More...
 

Detailed Description

Namespace for all functions is cv::intensity_trasnform.

Supported Algorithms

Reference from following book and websites:

Function Documentation

◆ autoscaling()

void cv::intensity_transform::autoscaling ( const Mat  input,
Mat output 
)
Python:
None=cv.intensity_transform.autoscaling(input, output)

#include <opencv2/intensity_transform.hpp>

Given an input bgr or grayscale image, apply autoscaling on domain [0, 255] to increase the contrast of the input image and return the resulting image.

Parameters
inputinput bgr or grayscale image.
outputresulting image of autoscaling.

◆ contrastStretching()

void cv::intensity_transform::contrastStretching ( const Mat  input,
Mat output,
const int  r1,
const int  s1,
const int  r2,
const int  s2 
)
Python:
None=cv.intensity_transform.contrastStretching(input, output, r1, s1, r2, s2)

#include <opencv2/intensity_transform.hpp>

Given an input bgr or grayscale image, apply linear contrast stretching on domain [0, 255] and return the resulting image.

Parameters
inputinput bgr or grayscale image.
outputresulting image of contrast stretching.
r1x coordinate of first point (r1, s1) in the transformation function.
s1y coordinate of first point (r1, s1) in the transformation function.
r2x coordinate of second point (r2, s2) in the transformation function.
s2y coordinate of second point (r2, s2) in the transformation function.

◆ gammaCorrection()

void cv::intensity_transform::gammaCorrection ( const Mat  input,
Mat output,
const float  gamma 
)
Python:
None=cv.intensity_transform.gammaCorrection(input, output, gamma)

#include <opencv2/intensity_transform.hpp>

Given an input bgr or grayscale image and constant gamma, apply power-law transformation, a.k.a. gamma correction to the image on domain [0, 255] and return the resulting image.

Parameters
inputinput bgr or grayscale image.
outputresulting image of gamma corrections.
gammaconstant in c*r^gamma where r is pixel value.

◆ logTransform()

void cv::intensity_transform::logTransform ( const Mat  input,
Mat output 
)
Python:
None=cv.intensity_transform.logTransform(input, output)

#include <opencv2/intensity_transform.hpp>

Given an input bgr or grayscale image and constant c, apply log transformation to the image on domain [0, 255] and return the resulting image.

Parameters
inputinput bgr or grayscale image.
outputresulting image of log transformations.