diff --git a/modules/mcc/include/opencv2/mcc/ccm.hpp b/modules/mcc/include/opencv2/mcc/ccm.hpp index a3686db473d..efc2b46a513 100644 --- a/modules/mcc/include/opencv2/mcc/ccm.hpp +++ b/modules/mcc/include/opencv2/mcc/ccm.hpp @@ -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: diff --git a/modules/mcc/src/ccm.cpp b/modules/mcc/src/ccm.cpp index aec535e05b4..d4a862a46ac 100644 --- a/modules/mcc/src/ccm.cpp +++ b/modules/mcc/src/ccm.cpp @@ -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_); @@ -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_))); @@ -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()) {