OpenCV
Open Source Computer Vision
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Color Correction module

Detailed Description

Classes

class  cv::ccm::ColorCorrectionModel
 Core class of ccm model. More...
 

Enumerations

enum  cv::ccm::CcmType {
  cv::ccm::CCM_LINEAR ,
  cv::ccm::CCM_AFFINE
}
 Enum of the possible types of ccm. More...
 
enum  cv::ccm::ColorCheckerType {
  cv::ccm::COLORCHECKER_MACBETH ,
  cv::ccm::COLORCHECKER_VINYL ,
  cv::ccm::COLORCHECKER_DIGITAL_SG
}
 Macbeth and Vinyl ColorChecker with 2deg D50. More...
 
enum  cv::ccm::ColorSpace {
  cv::ccm::COLOR_SPACE_SRGB ,
  cv::ccm::COLOR_SPACE_SRGBL ,
  cv::ccm::COLOR_SPACE_ADOBE_RGB ,
  cv::ccm::COLOR_SPACE_ADOBE_RGBL ,
  cv::ccm::COLOR_SPACE_WIDE_GAMUT_RGB ,
  cv::ccm::COLOR_SPACE_WIDE_GAMUT_RGBL ,
  cv::ccm::COLOR_SPACE_PRO_PHOTO_RGB ,
  cv::ccm::COLOR_SPACE_PRO_PHOTO_RGBL ,
  cv::ccm::COLOR_SPACE_DCI_P3_RGB ,
  cv::ccm::COLOR_SPACE_DCI_P3_RGBL ,
  cv::ccm::COLOR_SPACE_APPLE_RGB ,
  cv::ccm::COLOR_SPACE_APPLE_RGBL ,
  cv::ccm::COLOR_SPACE_REC_709_RGB ,
  cv::ccm::COLOR_SPACE_REC_709_RGBL ,
  cv::ccm::COLOR_SPACE_REC_2020_RGB ,
  cv::ccm::COLOR_SPACE_REC_2020_RGBL ,
  cv::ccm::COLOR_SPACE_XYZ_D65_2 ,
  cv::ccm::COLOR_SPACE_XYZ_D50_2 ,
  cv::ccm::COLOR_SPACE_XYZ_D65_10 ,
  cv::ccm::COLOR_SPACE_XYZ_D50_10 ,
  cv::ccm::COLOR_SPACE_XYZ_A_2 ,
  cv::ccm::COLOR_SPACE_XYZ_A_10 ,
  cv::ccm::COLOR_SPACE_XYZ_D55_2 ,
  cv::ccm::COLOR_SPACE_XYZ_D55_10 ,
  cv::ccm::COLOR_SPACE_XYZ_D75_2 ,
  cv::ccm::COLOR_SPACE_XYZ_D75_10 ,
  cv::ccm::COLOR_SPACE_XYZ_E_2 ,
  cv::ccm::COLOR_SPACE_XYZ_E_10 ,
  cv::ccm::COLOR_SPACE_LAB_D65_2 ,
  cv::ccm::COLOR_SPACE_LAB_D50_2 ,
  cv::ccm::COLOR_SPACE_LAB_D65_10 ,
  cv::ccm::COLOR_SPACE_LAB_D50_10 ,
  cv::ccm::COLOR_SPACE_LAB_A_2 ,
  cv::ccm::COLOR_SPACE_LAB_A_10 ,
  cv::ccm::COLOR_SPACE_LAB_D55_2 ,
  cv::ccm::COLOR_SPACE_LAB_D55_10 ,
  cv::ccm::COLOR_SPACE_LAB_D75_2 ,
  cv::ccm::COLOR_SPACE_LAB_D75_10 ,
  cv::ccm::COLOR_SPACE_LAB_E_2 ,
  cv::ccm::COLOR_SPACE_LAB_E_10
}
 
enum  cv::ccm::DistanceType {
  cv::ccm::DISTANCE_CIE76 ,
  cv::ccm::DISTANCE_CIE94_GRAPHIC_ARTS ,
  cv::ccm::DISTANCE_CIE94_TEXTILES ,
  cv::ccm::DISTANCE_CIE2000 ,
  cv::ccm::DISTANCE_CMC_1TO1 ,
  cv::ccm::DISTANCE_CMC_2TO1 ,
  cv::ccm::DISTANCE_RGB ,
  cv::ccm::DISTANCE_RGBL
}
 Enum of possible functions to calculate the distance between colors. More...
 
enum  cv::ccm::InitialMethodType {
  cv::ccm::INITIAL_METHOD_WHITE_BALANCE ,
  cv::ccm::INITIAL_METHOD_LEAST_SQUARE
}
 Enum of the possible types of initial method. More...
 
enum  cv::ccm::LinearizationType {
  cv::ccm::LINEARIZATION_IDENTITY ,
  cv::ccm::LINEARIZATION_GAMMA ,
  cv::ccm::LINEARIZATION_COLORPOLYFIT ,
  cv::ccm::LINEARIZATION_COLORLOGPOLYFIT ,
  cv::ccm::LINEARIZATION_GRAYPOLYFIT ,
  cv::ccm::LINEARIZATION_GRAYLOGPOLYFIT
}
 Linearization transformation type. More...
 

Functions

void cv::ccm::gammaCorrection (InputArray src, OutputArray dst, double gamma)
 Applies gamma correction to the input image.
 
void cv::ccm::read (const cv::FileNode &node, ColorCorrectionModel &ccm, const ColorCorrectionModel &defaultValue=ColorCorrectionModel())
 
void cv::ccm::write (cv::FileStorage &fs, const std::string &, const ColorCorrectionModel &ccm)
 

Enumeration Type Documentation

◆ CcmType

#include <opencv2/photo/ccm.hpp>

Enum of the possible types of ccm.

Enumerator
CCM_LINEAR 
Python: cv.ccm.CCM_LINEAR

Uses a 3×3 matrix to linearly transform RGB values without offsets.

CCM_AFFINE 
Python: cv.ccm.CCM_AFFINE

Uses a 4×3 matrix to affine transform RGB values with both scaling and offset terms.

◆ ColorCheckerType

#include <opencv2/photo/ccm.hpp>

Macbeth and Vinyl ColorChecker with 2deg D50.

Enumerator
COLORCHECKER_MACBETH 
Python: cv.ccm.COLORCHECKER_MACBETH

Macbeth ColorChecker.

COLORCHECKER_VINYL 
Python: cv.ccm.COLORCHECKER_VINYL

DKK ColorChecker.

COLORCHECKER_DIGITAL_SG 
Python: cv.ccm.COLORCHECKER_DIGITAL_SG

DigitalSG ColorChecker with 140 squares.

◆ ColorSpace

#include <opencv2/photo/ccm.hpp>

Enumerator
COLOR_SPACE_SRGB 
Python: cv.ccm.COLOR_SPACE_SRGB

https://en.wikipedia.org/wiki/SRGB , RGB color space

COLOR_SPACE_SRGBL 
Python: cv.ccm.COLOR_SPACE_SRGBL

https://en.wikipedia.org/wiki/SRGB , linear RGB color space

COLOR_SPACE_ADOBE_RGB 
Python: cv.ccm.COLOR_SPACE_ADOBE_RGB

https://en.wikipedia.org/wiki/Adobe_RGB_color_space , RGB color space

COLOR_SPACE_ADOBE_RGBL 
Python: cv.ccm.COLOR_SPACE_ADOBE_RGBL

https://en.wikipedia.org/wiki/Adobe_RGB_color_space , linear RGB color space

COLOR_SPACE_WIDE_GAMUT_RGB 
Python: cv.ccm.COLOR_SPACE_WIDE_GAMUT_RGB

https://en.wikipedia.org/wiki/Wide-gamut_RGB_color_space , RGB color space

COLOR_SPACE_WIDE_GAMUT_RGBL 
Python: cv.ccm.COLOR_SPACE_WIDE_GAMUT_RGBL

https://en.wikipedia.org/wiki/Wide-gamut_RGB_color_space , linear RGB color space

COLOR_SPACE_PRO_PHOTO_RGB 
Python: cv.ccm.COLOR_SPACE_PRO_PHOTO_RGB

https://en.wikipedia.org/wiki/ProPhoto_RGB_color_space , RGB color space

COLOR_SPACE_PRO_PHOTO_RGBL 
Python: cv.ccm.COLOR_SPACE_PRO_PHOTO_RGBL

https://en.wikipedia.org/wiki/ProPhoto_RGB_color_space , linear RGB color space

COLOR_SPACE_DCI_P3_RGB 
Python: cv.ccm.COLOR_SPACE_DCI_P3_RGB

https://en.wikipedia.org/wiki/DCI-P3 , RGB color space

COLOR_SPACE_DCI_P3_RGBL 
Python: cv.ccm.COLOR_SPACE_DCI_P3_RGBL

https://en.wikipedia.org/wiki/DCI-P3 , linear RGB color space

COLOR_SPACE_APPLE_RGB 
Python: cv.ccm.COLOR_SPACE_APPLE_RGB

http://www.brucelindbloom.com/index.html?WorkingSpaceInfo.html , RGB color space

COLOR_SPACE_APPLE_RGBL 
Python: cv.ccm.COLOR_SPACE_APPLE_RGBL

http://www.brucelindbloom.com/index.html?WorkingSpaceInfo.html , linear RGB color space

COLOR_SPACE_REC_709_RGB 
Python: cv.ccm.COLOR_SPACE_REC_709_RGB

https://en.wikipedia.org/wiki/Rec._709 , RGB color space

COLOR_SPACE_REC_709_RGBL 
Python: cv.ccm.COLOR_SPACE_REC_709_RGBL

https://en.wikipedia.org/wiki/Rec._709 , linear RGB color space

COLOR_SPACE_REC_2020_RGB 
Python: cv.ccm.COLOR_SPACE_REC_2020_RGB

https://en.wikipedia.org/wiki/Rec._2020 , RGB color space

COLOR_SPACE_REC_2020_RGBL 
Python: cv.ccm.COLOR_SPACE_REC_2020_RGBL

https://en.wikipedia.org/wiki/Rec._2020 , linear RGB color space

COLOR_SPACE_XYZ_D65_2 
Python: cv.ccm.COLOR_SPACE_XYZ_D65_2

https://en.wikipedia.org/wiki/CIE_1931_color_space , XYZ color space, D65 illuminant, 2 degree

COLOR_SPACE_XYZ_D50_2 
Python: cv.ccm.COLOR_SPACE_XYZ_D50_2

https://en.wikipedia.org/wiki/CIE_1931_color_space , XYZ color space, D50 illuminant, 2 degree

COLOR_SPACE_XYZ_D65_10 
Python: cv.ccm.COLOR_SPACE_XYZ_D65_10

https://en.wikipedia.org/wiki/CIE_1931_color_space , XYZ color space, D65 illuminant, 10 degree

COLOR_SPACE_XYZ_D50_10 
Python: cv.ccm.COLOR_SPACE_XYZ_D50_10

https://en.wikipedia.org/wiki/CIE_1931_color_space , XYZ color space, D50 illuminant, 10 degree

COLOR_SPACE_XYZ_A_2 
Python: cv.ccm.COLOR_SPACE_XYZ_A_2

https://en.wikipedia.org/wiki/CIE_1931_color_space , XYZ color space, A illuminant, 2 degree

COLOR_SPACE_XYZ_A_10 
Python: cv.ccm.COLOR_SPACE_XYZ_A_10

https://en.wikipedia.org/wiki/CIE_1931_color_space , XYZ color space, A illuminant, 10 degree

COLOR_SPACE_XYZ_D55_2 
Python: cv.ccm.COLOR_SPACE_XYZ_D55_2

https://en.wikipedia.org/wiki/CIE_1931_color_space , XYZ color space, D55 illuminant, 2 degree

COLOR_SPACE_XYZ_D55_10 
Python: cv.ccm.COLOR_SPACE_XYZ_D55_10

https://en.wikipedia.org/wiki/CIE_1931_color_space , XYZ color space, D55 illuminant, 10 degree

COLOR_SPACE_XYZ_D75_2 
Python: cv.ccm.COLOR_SPACE_XYZ_D75_2

https://en.wikipedia.org/wiki/CIE_1931_color_space , XYZ color space, D75 illuminant, 2 degree

COLOR_SPACE_XYZ_D75_10 
Python: cv.ccm.COLOR_SPACE_XYZ_D75_10

https://en.wikipedia.org/wiki/CIE_1931_color_space , XYZ color space, D75 illuminant, 10 degree

COLOR_SPACE_XYZ_E_2 
Python: cv.ccm.COLOR_SPACE_XYZ_E_2

https://en.wikipedia.org/wiki/CIE_1931_color_space , XYZ color space, E illuminant, 2 degree

COLOR_SPACE_XYZ_E_10 
Python: cv.ccm.COLOR_SPACE_XYZ_E_10

https://en.wikipedia.org/wiki/CIE_1931_color_space , XYZ color space, E illuminant, 10 degree

COLOR_SPACE_LAB_D65_2 
Python: cv.ccm.COLOR_SPACE_LAB_D65_2

https://en.wikipedia.org/wiki/CIELAB_color_space , Lab color space, D65 illuminant, 2 degree

COLOR_SPACE_LAB_D50_2 
Python: cv.ccm.COLOR_SPACE_LAB_D50_2

https://en.wikipedia.org/wiki/CIELAB_color_space , Lab color space, D50 illuminant, 2 degree

COLOR_SPACE_LAB_D65_10 
Python: cv.ccm.COLOR_SPACE_LAB_D65_10

https://en.wikipedia.org/wiki/CIELAB_color_space , Lab color space, D65 illuminant, 10 degree

COLOR_SPACE_LAB_D50_10 
Python: cv.ccm.COLOR_SPACE_LAB_D50_10

https://en.wikipedia.org/wiki/CIELAB_color_space , Lab color space, D50 illuminant, 10 degree

COLOR_SPACE_LAB_A_2 
Python: cv.ccm.COLOR_SPACE_LAB_A_2

https://en.wikipedia.org/wiki/CIELAB_color_space , Lab color space, A illuminant, 2 degree

COLOR_SPACE_LAB_A_10 
Python: cv.ccm.COLOR_SPACE_LAB_A_10

https://en.wikipedia.org/wiki/CIELAB_color_space , Lab color space, A illuminant, 10 degree

COLOR_SPACE_LAB_D55_2 
Python: cv.ccm.COLOR_SPACE_LAB_D55_2

https://en.wikipedia.org/wiki/CIELAB_color_space , Lab color space, D55 illuminant, 2 degree

COLOR_SPACE_LAB_D55_10 
Python: cv.ccm.COLOR_SPACE_LAB_D55_10

https://en.wikipedia.org/wiki/CIELAB_color_space , Lab color space, D55 illuminant, 10 degree

COLOR_SPACE_LAB_D75_2 
Python: cv.ccm.COLOR_SPACE_LAB_D75_2

https://en.wikipedia.org/wiki/CIELAB_color_space , Lab color space, D75 illuminant, 2 degree

COLOR_SPACE_LAB_D75_10 
Python: cv.ccm.COLOR_SPACE_LAB_D75_10

https://en.wikipedia.org/wiki/CIELAB_color_space , Lab color space, D75 illuminant, 10 degree

COLOR_SPACE_LAB_E_2 
Python: cv.ccm.COLOR_SPACE_LAB_E_2

https://en.wikipedia.org/wiki/CIELAB_color_space , Lab color space, E illuminant, 2 degree

COLOR_SPACE_LAB_E_10 
Python: cv.ccm.COLOR_SPACE_LAB_E_10

https://en.wikipedia.org/wiki/CIELAB_color_space , Lab color space, E illuminant, 10 degree

◆ DistanceType

#include <opencv2/photo/ccm.hpp>

Enum of possible functions to calculate the distance between colors.

See https://en.wikipedia.org/wiki/Color_difference for details

Enumerator
DISTANCE_CIE76 
Python: cv.ccm.DISTANCE_CIE76

The 1976 formula is the first formula that related a measured color difference to a known set of CIELAB coordinates.

DISTANCE_CIE94_GRAPHIC_ARTS 
Python: cv.ccm.DISTANCE_CIE94_GRAPHIC_ARTS

The 1976 definition was extended to address perceptual non-uniformities.

DISTANCE_CIE94_TEXTILES 
Python: cv.ccm.DISTANCE_CIE94_TEXTILES
DISTANCE_CIE2000 
Python: cv.ccm.DISTANCE_CIE2000
DISTANCE_CMC_1TO1 
Python: cv.ccm.DISTANCE_CMC_1TO1

In 1984, the Colour Measurement Committee of the Society of Dyers and Colourists defined a difference measure, also based on the L*C*h color model.

DISTANCE_CMC_2TO1 
Python: cv.ccm.DISTANCE_CMC_2TO1
DISTANCE_RGB 
Python: cv.ccm.DISTANCE_RGB

Euclidean distance of rgb color space.

DISTANCE_RGBL 
Python: cv.ccm.DISTANCE_RGBL

Euclidean distance of rgbl color space.

◆ InitialMethodType

#include <opencv2/photo/ccm.hpp>

Enum of the possible types of initial method.

Enumerator
INITIAL_METHOD_WHITE_BALANCE 
Python: cv.ccm.INITIAL_METHOD_WHITE_BALANCE

The white balance method. The initial value is:
MCCM=[kR000kG000kB]
where
kR=mean(Rli)/mean(Rli)kG=mean(Gli)/mean(Gli)kB=mean(Bli)/mean(Bli)

INITIAL_METHOD_LEAST_SQUARE 
Python: cv.ccm.INITIAL_METHOD_LEAST_SQUARE

The least square method is an optimal solution under the linear RGB distance function.

◆ LinearizationType

#include <opencv2/photo/ccm.hpp>

Linearization transformation type.

Enumerator
LINEARIZATION_IDENTITY 
Python: cv.ccm.LINEARIZATION_IDENTITY

no change is made

LINEARIZATION_GAMMA 
Python: cv.ccm.LINEARIZATION_GAMMA

gamma correction; Need assign a value to gamma simultaneously

LINEARIZATION_COLORPOLYFIT 
Python: cv.ccm.LINEARIZATION_COLORPOLYFIT

polynomial fitting channels respectively; Need assign a value to deg simultaneously

LINEARIZATION_COLORLOGPOLYFIT 
Python: cv.ccm.LINEARIZATION_COLORLOGPOLYFIT

logarithmic polynomial fitting channels respectively; Need assign a value to deg simultaneously

LINEARIZATION_GRAYPOLYFIT 
Python: cv.ccm.LINEARIZATION_GRAYPOLYFIT

grayscale polynomial fitting; Need assign a value to deg and dst_whites simultaneously

LINEARIZATION_GRAYLOGPOLYFIT 
Python: cv.ccm.LINEARIZATION_GRAYLOGPOLYFIT

grayscale Logarithmic polynomial fitting; Need assign a value to deg and dst_whites simultaneously

Function Documentation

◆ gammaCorrection()

void cv::ccm::gammaCorrection ( InputArray src,
OutputArray dst,
double gamma )
Python:
cv.ccm.gammaCorrection(src, gamma[, dst]) -> dst

#include <opencv2/photo/ccm.hpp>

Applies gamma correction to the input image.

Parameters
srcInput image.
dstOutput image.
gammaGamma correction greater than zero.

◆ read()

void cv::ccm::read ( const cv::FileNode & node,
ColorCorrectionModel & ccm,
const ColorCorrectionModel & defaultValue = ColorCorrectionModel() )

◆ write()

void cv::ccm::write ( cv::FileStorage & fs,
const std::string & ,
const ColorCorrectionModel & ccm )