Color Correction module#

Detailed Description#

Classes#

Name

Description

class cv::ccm::ColorCorrectionModel

Core class of ccm model. View details

Enumerations#

Enum of the possible types of ccm. View details

Macbeth and Vinyl ColorChecker with 2deg D50. View details

View details

Enum of possible functions to calculate the distance between colors. View details

Enum of the possible types of initial method. View details

Linearization transformation type. View details

Enumeration Type Documentation#

CcmType#

enum cv::ccm::CcmType

#include <opencv2/photo/ccm.hpp>

Enum of the possible types of ccm.

Enumerator:

CCM_LINEAR
Python: cv.ccm.CCM_LINEAR

Uses a \(3\times3\) matrix to linearly transform RGB values without offsets.

CCM_AFFINE
Python: cv.ccm.CCM_AFFINE

Uses a \(4\times3\) matrix to affine transform RGB values with both scaling and offset terms.

ColorCheckerType#

enum cv::ccm::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#

enum cv::ccm::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#

enum cv::ccm::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 LCh 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#

enum cv::ccm::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:

    $
                           M_{CCM}=
                           \begin{bmatrix}
                           k_R & 0 & 0\\
                           0 & k_G & 0\\
                           0 & 0 & k_B\\
                           \end{bmatrix}
                           $

where

 $
                           k_R=mean(R_{li}')/mean(R_{li})\\
                           k_G=mean(G_{li}')/mean(G_{li})\\
                           k_B=mean(B_{li}')/mean(B_{li})
                           $

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#

enum cv::ccm::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 )

#include <opencv2/photo/ccm.hpp>

Python:

cv.ccm.gammaCorrection(src, gamma[, dst]) -> dst

Applies gamma correction to the input image.

Parameters

  • src — Input image.

  • dst — Output image.

  • gamma — Gamma correction greater than zero.

read()#

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

#include <opencv2/photo/ccm.hpp>

write()#

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

#include <opencv2/photo/ccm.hpp>