Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions modules/mcc/include/opencv2/mcc/ccm.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,13 @@ class CV_EXPORTS_W ColorCorrectionModel
*/
CV_WRAP ColorCorrectionModel(const Mat& src, Mat colors, COLOR_SPACE ref_cs, Mat colored);

/** @brief Set the reference color using a built-in (CONST_COLOR) reference color chart.
* This lets you change the reference color patch data after you’ve constructed
* the model or at any time.
@param output original color values
*/
void getColorMatrix(CONST_COLOR constcolor, Mat& output);

/** @brief set ColorSpace
@note It should be some RGB color space;
Supported list of color cards:
Expand Down
10 changes: 10 additions & 0 deletions modules/mcc/src/ccm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ class ColorCorrectionModel::Impl

void getColor(Mat& img_, bool islinear = false);
void getColor(CONST_COLOR constcolor);
void getColorMatrix(CONST_COLOR constcolor, Mat& output);
void getColor(Mat colors_, COLOR_SPACE cs_, Mat colored_);
void getColor(Mat colors_, COLOR_SPACE ref_cs_);

Expand Down Expand Up @@ -302,6 +303,11 @@ void ColorCorrectionModel::Impl::getColor(CONST_COLOR constcolor)
{
dst = (GetColor::getColor(constcolor));
}
void ColorCorrectionModel::Impl::getColorMatrix(CONST_COLOR constcolor, Mat& output)
{
dst = (GetColor::getColor(constcolor));
output = dst->colors;
}
void ColorCorrectionModel::Impl::getColor(Mat colors_, COLOR_SPACE ref_cs_)
{
dst.reset(new Color(colors_, *GetCS::getInstance().get_cs(ref_cs_)));
Expand All @@ -310,6 +316,10 @@ void ColorCorrectionModel::Impl::getColor(Mat colors_, COLOR_SPACE cs_, Mat colo
{
dst.reset(new Color(colors_, *GetCS::getInstance().get_cs(cs_), colored_));
}
void ColorCorrectionModel::getColorMatrix(CONST_COLOR constcolor, Mat& output)
{
p->getColorMatrix(constcolor, output);
}
ColorCorrectionModel::ColorCorrectionModel(const Mat& src_, CONST_COLOR constcolor)
: p(std::make_shared<Impl>())
{
Expand Down