nareshmlx/opencv-pr huggingface dataset:
**File:** modules/photo/include/opencv2/photo/ccm.hpp
**Change Type:** added
**Context:** PR #27051: Adding color correction module to photo module from opencv_contrib

**Code Changes:**
```diff
@@ -0,0 +1,322 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html.
+//
+// Author: Longbu Wang <wanglongbu@huawei.com.com>
+//         Jinheng Zhang <zhangjinheng1@huawei.com>
+//         Chenqi Shan <shanchenqi@huawei.com>
+
+#ifndef OPENCV_PHOTO_CCM_HPP
```

Review comment:
``` CV_WRAP Mat getSrcLinearRGB() const; CV_WRAP Mat getRefLinearRGB() const; ```
**File:** modules/photo/include/opencv2/photo/ccm.hpp
**Change Type:** added
**Context:** PR #27051: Adding color correction module to photo module from opencv_contrib

**Code Changes:**
```diff
@@ -0,0 +1,322 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html.
+//
+// Author: Longbu Wang <wanglongbu@huawei.com.com>
+//         Jinheng Zhang <zhangjinheng1@huawei.com>
+//         Chenqi Shan <shanchenqi@huawei.com>
+
+#ifndef OPENCV_PHOTO_CCM_HPP
```

Review comment:
We use all capital letters for constant names.
**File:** modules/photo/include/opencv2/photo/ccm.hpp
**Change Type:** added
**Context:** PR #27051: Adding color correction module to photo module from opencv_contrib

**Code Changes:**
```diff
@@ -0,0 +1,322 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html.
+//
+// Author: Longbu Wang <wanglongbu@huawei.com.com>
+//         Jinheng Zhang <zhangjinheng1@huawei.com>
+//         Chenqi Shan <shanchenqi@huawei.com>
+
+#ifndef OPENCV_PHOTO_CCM_HPP
```

Review comment:
The same note about capital letters, e.g. `COLOR_SPACE_AppleRGB` -> `COLOR_SPACE_APPLE_RGB`
**File:** modules/photo/include/opencv2/photo/ccm.hpp
**Change Type:** added
**Context:** PR #27051: Adding color correction module to photo module from opencv_contrib

**Code Changes:**
```diff
@@ -0,0 +1,322 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html.
+//
+// Author: Longbu Wang <wanglongbu@huawei.com.com>
+//         Jinheng Zhang <zhangjinheng1@huawei.com>
+//         Chenqi Shan <shanchenqi@huawei.com>
+
+#ifndef OPENCV_PHOTO_CCM_HPP
```

Review comment:
please use `int` for `constcolor`. Unfortunately not all bindings generators support enums for now.
**File:** modules/photo/include/opencv2/photo/ccm.hpp
**Change Type:** added
**Context:** PR #27051: Adding color correction module to photo module from opencv_contrib

**Code Changes:**
```diff
@@ -0,0 +1,322 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html.
+//
+// Author: Longbu Wang <wanglongbu@huawei.com.com>
+//         Jinheng Zhang <zhangjinheng1@huawei.com>
+//         Chenqi Shan <shanchenqi@huawei.com>
+
+#ifndef OPENCV_PHOTO_CCM_HPP
```

Review comment:
Also please use InputArray here and bellow. It allows to add non-cpu branches in future without API change.
**File:** modules/photo/include/opencv2/photo/ccm.hpp
**Change Type:** added
**Context:** PR #27051: Adding color correction module to photo module from opencv_contrib

**Code Changes:**
```diff
@@ -0,0 +1,322 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html.
+//
+// Author: Longbu Wang <wanglongbu@huawei.com.com>
+//         Jinheng Zhang <zhangjinheng1@huawei.com>
+//         Chenqi Shan <shanchenqi@huawei.com>
+
+#ifndef OPENCV_PHOTO_CCM_HPP
```

Review comment:
InputArray, OutputArray?
**File:** modules/photo/include/opencv2/photo/ccm.hpp
**Change Type:** added
**Context:** PR #27051: Adding color correction module to photo module from opencv_contrib

**Code Changes:**
```diff
@@ -0,0 +1,322 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html.
+//
+// Author: Longbu Wang <wanglongbu@huawei.com.com>
+//         Jinheng Zhang <zhangjinheng1@huawei.com>
+//         Chenqi Shan <shanchenqi@huawei.com>
+
+#ifndef OPENCV_PHOTO_CCM_HPP
```

Review comment:
`const &` is redundant here. Please use just `double gamma`.
**File:** modules/photo/include/opencv2/photo/ccm.hpp
**Change Type:** added
**Context:** PR #27051: Adding color correction module to photo module from opencv_contrib

**Code Changes:**
```diff
@@ -0,0 +1,322 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html.
+//
+// Author: Longbu Wang <wanglongbu@huawei.com.com>
+//         Jinheng Zhang <zhangjinheng1@huawei.com>
+//         Chenqi Shan <shanchenqi@huawei.com>
+
+#ifndef OPENCV_PHOTO_CCM_HPP
```

Review comment:
The same here and bellow.
**File:** modules/photo/perf/perf_ccm.cpp
**Change Type:** added
**Context:** PR #27051: Adding color correction module to photo module from opencv_contrib
**Review Line:** 20

**Code Changes:**
```diff
+{
+    string path = cvtest::findDataFile("cv/mcc/mcc_ccm_test.yml");
+    FileStorage fs(path, FileStorage::READ);
+    Mat chartsRGB;
+    fs["chartsRGB"] >> chartsRGB;
+    fs.release();
+    ASSERT_FALSE(chartsRGB.empty()) << "chartsRGB is empty after loading from: " << path;
+
+    cv::ccm::ColorCorrectionModel model(
+        chartsRGB.col(1).clone().reshape(3, chartsRGB.rows/3) / 255.0,
+        cv::ccm::COLORCHECKER_MACBETH
```

Review comment:
`ASSERT_FALSE(chartsRGB.empty());`
**File:** modules/photo/test/test_precomp.hpp
**Change Type:** modified
**Context:** PR #27051: Adding color correction module to photo module from opencv_contrib

**Code Changes:**
```diff
@@ -1,11 +1,15 @@
 // This file is part of OpenCV project.
 // It is subject to the license terms in the LICENSE file found in the top-level directory
 // of this distribution and at http://opencv.org/license.html.
-#ifndef __OPENCV_TEST_PRECOMP_HPP__
-#define __OPENCV_TEST_PRECOMP_HPP__
+#ifndef OPENCV_PHOTO_TEST_PRECOMP_HPP
+#define OPENCV_PHOTO_TEST_PRECOMP_HPP
 
 #include "opencv2/ts.hpp"
```

Review comment:
using namespace is very bad practice. It affects everything, even, if the header is not included directly.
**File:** samples/cpp/color_correction_model.cpp
**Change Type:** added
**Context:** PR #27051: Adding color correction module to photo module from opencv_contrib

**Code Changes:**
```diff
@@ -0,0 +1,224 @@
+//! [tutorial]
+#include <opencv2/core.hpp>
+#include <opencv2/highgui.hpp>
+#include <opencv2/imgcodecs.hpp>
+#include <opencv2/imgproc.hpp>
+#include <opencv2/photo.hpp>
+#include <opencv2/objdetect.hpp>
+#include <opencv2/dnn.hpp>
+#include <iostream>
```

Review comment:
Please use FileStorage and read/write methods for the model.
**File:** samples/python/color_correction_model.py
**Change Type:** added
**Context:** PR #27051: Adding color correction module to photo module from opencv_contrib

**Code Changes:**
```diff
@@ -0,0 +1,185 @@
+import cv2 as cv
+import numpy as np
+import argparse
+import sys
+import os
+sys.path.append(os.path.join(os.path.dirname(__file__), ".."))
+from dnn.common import *
+
+def get_args_parser(func_args):
```

Review comment:
Please add couple of python tests. They are executed by CI automatically.
**File:** modules/photo/src/ccm/utils.hpp
**Change Type:** added
**Context:** PR #27051: Adding color correction module to photo module from opencv_contrib
**Review Line:** 39

**Code Changes:**
```diff
+/** @brief multiple the function used to compute an array with n channels
+      mulipied by ccm.
+    @param xyz the input array, type of Mat.
+    @param ccm the ccm matrix to make color correction.
+ */
+Mat multiple(const Mat& xyz, const Mat& ccm);
+
+/** @brief multiple the function used to get the mask of saturated colors,
+            colors between low and up will be choosed.
+    @param src the input array, type of Mat.
+    @param low  the threshold to choose saturated colors
```

Review comment:
Most probably the function may be replaced with cv::transform https://docs.opencv.org/4.x/d2/de8/group__core__array.html#ga393164aa54bb9169ce0a8cc44e08ff22
**File:** modules/photo/src/ccm/utils.hpp
**Change Type:** added
**Context:** PR #27051: Adding color correction module to photo module from opencv_contrib
**Review Line:** 32

**Code Changes:**
```diff
+
+/** @brief maskCopyTo a function to delete unsatisfied elementwise.
+    @param src the input array, type of Mat.
+    @param mask operation mask that used to choose satisfided elementwise.
+ */
+Mat maskCopyTo(const Mat& src, const Mat& mask);
+
+/** @brief multiple the function used to compute an array with n channels
+      mulipied by ccm.
+    @param xyz the input array, type of Mat.
+    @param ccm the ccm matrix to make color correction.
```

Review comment:
there is Mat.copyTo() with mask support instead of it.
**File:** modules/photo/src/ccm/utils.cpp
**Change Type:** added
**Context:** PR #27051: Adding color correction module to photo module from opencv_contrib

**Code Changes:**
```diff
@@ -0,0 +1,113 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html.
+//
+// Author: Longbu Wang <wanglongbu@huawei.com.com>
+//         Jinheng Zhang <zhangjinheng1@huawei.com>
+//         Chenqi Shan <shanchenqi@huawei.com>
+
+#include "utils.hpp"
```

Review comment:
inRange should be enough instead of it: https://docs.opencv.org/4.x/d2/de8/group__core__array.html#ga48af0ab51e36436c5d04340e036ce981
**File:** samples/python/color_correction_model.py
**Change Type:** added
**Context:** PR #27051: Adding color correction module to photo module from opencv_contrib

**Code Changes:**
```diff
@@ -0,0 +1,185 @@
+import cv2 as cv
+import numpy as np
+import argparse
+import sys
+import os
+sys.path.append(os.path.join(os.path.dirname(__file__), ".."))
+from dnn.common import *
+
+def get_args_parser(func_args):
```

Review comment:
Which location should the test be added? Inside ccm directory or in modules/python/tests ?
**File:** modules/photo/src/ccm/ccm.cpp
**Change Type:** added
**Context:** PR #27051: Adding color correction module to photo module from opencv_contrib
**Review Line:** 15

**Code Changes:**
```diff
+#include "linearize.hpp"
+#include <cmath>
+namespace cv {
+namespace ccm {
+
+class ColorCorrectionModel::Impl
+{
+public:
+    Mat src;
+
+    Color ref = Color();
```

Review comment:
Space line before class.
**File:** doc/tutorials/photo/ccm/color_correction_model.markdown
**Change Type:** added
**Context:** PR #27051: Adding color correction module to photo module from opencv_contrib

**Code Changes:**
```diff
@@ -0,0 +1,53 @@
+Color Correction Model{#tutorial_ccm_color_correction_model}
+===========================
+
+Introduction
+----
+
+The purpose of color correction is to adjust the color response of input and output devices to a known state. The device being calibrated is sometimes called the calibration source; the color space used as the standard is sometimes called the calibration target. Color calibration has been used in many industries, such as television production, games, photography, engineering, chemistry, medicine, etc. Due to the manufacturing process of the input and output equipment, the channel response has nonlinear distortion. In order to correct the picture output of the equipment, it is nessary to calibrate the captured color and the actual color.
+
+In this tutorial you will learn how to use the 'Color Correction Model' to do a color correction in a image.
```

Review comment:
It makes sense to add reference to anym, but not list all variants here. It may change in time, but we always forget about text.
**File:** samples/cpp/color_correction_model.cpp
**Change Type:** added
**Context:** PR #27051: Adding color correction module to photo module from opencv_contrib

**Code Changes:**
```diff
@@ -0,0 +1,224 @@
+//! [tutorial]
+#include <opencv2/core.hpp>
+#include <opencv2/highgui.hpp>
+#include <opencv2/imgcodecs.hpp>
+#include <opencv2/imgproc.hpp>
+#include <opencv2/photo.hpp>
+#include <opencv2/objdetect.hpp>
+#include <opencv2/dnn.hpp>
+#include <iostream>
```

Review comment:
There is a mistake here: `--input=--ccm_file`
**File:** samples/cpp/color_correction_model.cpp
**Change Type:** added
**Context:** PR #27051: Adding color correction module to photo module from opencv_contrib

**Code Changes:**
```diff
@@ -0,0 +1,224 @@
+//! [tutorial]
+#include <opencv2/core.hpp>
+#include <opencv2/highgui.hpp>
+#include <opencv2/imgcodecs.hpp>
+#include <opencv2/imgproc.hpp>
+#include <opencv2/photo.hpp>
+#include <opencv2/objdetect.hpp>
+#include <opencv2/dnn.hpp>
+#include <iostream>
```

Review comment:
I would say that if + verbose error message is preferable here. Just exception with assert condition is cryptic for user.
**File:** modules/photo/test/test_ccm.cpp
**Change Type:** added
**Context:** PR #27051: Adding color correction module to photo module from opencv_contrib

**Code Changes:**
```diff
@@ -0,0 +1,302 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html.
+
+#include "test_precomp.hpp"
+
+namespace opencv_test
+{
+namespace
```

Review comment:
FileStorage supports in-memory operations. You can get just strings and compare without disc i/o.
**File:** modules/photo/src/ccm/utils.cpp
**Change Type:** added
**Context:** PR #27051: Adding color correction module to photo module from opencv_contrib

**Code Changes:**
```diff
@@ -0,0 +1,113 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html.
+//
+// Author: Longbu Wang <wanglongbu@huawei.com.com>
+//         Jinheng Zhang <zhangjinheng1@huawei.com>
+//         Chenqi Shan <shanchenqi@huawei.com>
+
+#include "utils.hpp"
```

Review comment:
Why not just cvtColor?
**File:** modules/photo/src/ccm/utils.cpp
**Change Type:** added
**Context:** PR #27051: Adding color correction module to photo module from opencv_contrib
**Review Line:** 111

**Code Changes:**
```diff
+    Mat mask;
+    inRange(src, lower_bound, upper_bound, mask);
+    mask /= 255;
+
+    return mask;
+}
+}
+}  // namespace cv::ccm
```

Review comment:
normalize with NORM_MIN_MAX does the same: https://docs.opencv.org/5.x/d2/de8/group__core__array.html#ga87eef7ee3970f86906d69a92cbf064bd
**File:** modules/photo/src/ccm/linearize.hpp
**Change Type:** added
**Context:** PR #27051: Adding color correction module to photo module from opencv_contrib

**Code Changes:**
```diff
@@ -0,0 +1,260 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html.
+//
+// Author: Longbu Wang <wanglongbu@huawei.com.com>
+//         Jinheng Zhang <zhangjinheng1@huawei.com>
+//         Chenqi Shan <shanchenqi@huawei.com>
+
+#ifndef __OPENCV_CCM_LINEARIZE_HPP__
```

Review comment:
empty line is redundant.
**File:** modules/photo/src/ccm/color.hpp
**Change Type:** added
**Context:** PR #27051: Adding color correction module to photo module from opencv_contrib

**Code Changes:**
```diff
@@ -0,0 +1,108 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html.
+//
+// Author: Longbu Wang <wanglongbu@huawei.com.com>
+//         Jinheng Zhang <zhangjinheng1@huawei.com>
+//         Chenqi Shan <shanchenqi@huawei.com>
+
+#ifndef __OPENCV_CCM_COLOR_HPP__
```

Review comment:
IO object should be passed by reference. I do not see why we need a copy each time.
**File:** modules/photo/src/ccm/color.cpp
**Change Type:** added
**Context:** PR #27051: Adding color correction module to photo module from opencv_contrib

**Code Changes:**
```diff
@@ -0,0 +1,391 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html.
+//
+// Author: Longbu Wang <wanglongbu@huawei.com.com>
+//         Jinheng Zhang <zhangjinheng1@huawei.com>
+//         Chenqi Shan <shanchenqi@huawei.com>
+
+#include "color.hpp"
```

Review comment:
just `history.find`? It's std::map and the key value may appear only once, if it's there.
**File:** modules/photo/src/ccm/color.cpp
**Change Type:** added
**Context:** PR #27051: Adding color correction module to photo module from opencv_contrib

**Code Changes:**
```diff
@@ -0,0 +1,391 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html.
+//
+// Author: Longbu Wang <wanglongbu@huawei.com.com>
+//         Jinheng Zhang <zhangjinheng1@huawei.com>
+//         Chenqi Shan <shanchenqi@huawei.com>
+
+#include "color.hpp"
```

Review comment:
``` if(save) { std::shared_ptr<Color> color = std::make_shared<Color>(ops.run(colors), other); history[other] = color; return *color; } else { return Color(ops.run(colors), other); } ```
**File:** modules/photo/perf/perf_ccm.cpp
**Change Type:** added
**Context:** PR #27051: Adding color correction module to photo module from opencv_contrib

**Code Changes:**
```diff
@@ -0,0 +1,103 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html.
+
+#include "perf_precomp.hpp"
+#include "opencv2/photo.hpp"
+
+namespace opencv_test {
+namespace {
```

Review comment:
It makes sense to use some popular image size line 1920x1080, or, better, make a parameterized test and benchmark several popular resolutions.
**File:** modules/photo/src/ccm/color.cpp
**Change Type:** added
**Context:** PR #27051: Adding color correction module to photo module from opencv_contrib

**Code Changes:**
```diff
@@ -0,0 +1,391 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html.
+//
+// Author: Longbu Wang <wanglongbu@huawei.com.com>
+//         Jinheng Zhang <zhangjinheng1@huawei.com>
+//         Chenqi Shan <shanchenqi@huawei.com>
+
+#include "color.hpp"
```

Review comment:
`std::shared_ptr` is redundant here. You can just return `Color` object and store it as ColorCorrectionModel::Impl field.
**File:** modules/photo/src/ccm/ccm.cpp
**Change Type:** added
**Context:** PR #27051: Adding color correction module to photo module from opencv_contrib

**Code Changes:**
```diff
@@ -0,0 +1,557 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html.
+//
+// Author: Longbu Wang <wanglongbu@huawei.com.com>
+//         Jinheng Zhang <zhangjinheng1@huawei.com>
+//         Chenqi Shan <shanchenqi@huawei.com>
+
+#include "opencv2/photo.hpp"
```

Review comment:
`dst` is bad name. There are many clashes with method parameter name.
**File:** modules/photo/src/ccm/ccm.cpp
**Change Type:** added
**Context:** PR #27051: Adding color correction module to photo module from opencv_contrib

**Code Changes:**
```diff
@@ -0,0 +1,557 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html.
+//
+// Author: Longbu Wang <wanglongbu@huawei.com.com>
+//         Jinheng Zhang <zhangjinheng1@huawei.com>
+//         Chenqi Shan <shanchenqi@huawei.com>
+
+#include "opencv2/photo.hpp"
```

Review comment:
Also shared_ptr looks redundant here.
**File:** modules/photo/src/ccm/ccm.cpp
**Change Type:** added
**Context:** PR #27051: Adding color correction module to photo module from opencv_contrib

**Code Changes:**
```diff
@@ -0,0 +1,557 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html.
+//
+// Author: Longbu Wang <wanglongbu@huawei.com.com>
+//         Jinheng Zhang <zhangjinheng1@huawei.com>
+//         Chenqi Shan <shanchenqi@huawei.com>
+
+#include "opencv2/photo.hpp"
```

Review comment:
There is `cv::mixChannels` channels to reach the same result faster without extra allocations: https://docs.opencv.org/5.x/d2/de8/group__core__array.html#ga51d768c270a1cdd3497255017c4504be
**File:** modules/photo/src/ccm/ccm.cpp
**Change Type:** added
**Context:** PR #27051: Adding color correction module to photo module from opencv_contrib

**Code Changes:**
```diff
@@ -0,0 +1,557 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html.
+//
+// Author: Longbu Wang <wanglongbu@huawei.com.com>
+//         Jinheng Zhang <zhangjinheng1@huawei.com>
+//         Chenqi Shan <shanchenqi@huawei.com>
+
+#include "opencv2/photo.hpp"
```

Review comment:
No need to spit cv::Mat by channels for it. cv::sum supports channels: https://docs.opencv.org/5.x/d2/de8/group__core__array.html#ga716e10a2dd9e228e4d3c95818f106722
**File:** modules/photo/src/ccm/utils.cpp
**Change Type:** added
**Context:** PR #27051: Adding color correction module to photo module from opencv_contrib

**Code Changes:**
```diff
@@ -0,0 +1,113 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html.
+//
+// Author: Longbu Wang <wanglongbu@huawei.com.com>
+//         Jinheng Zhang <zhangjinheng1@huawei.com>
+//         Chenqi Shan <shanchenqi@huawei.com>
+
+#include "utils.hpp"
```

Review comment:
I propose to convert Gamma correction to public function with InputArray and OutputArray. It's useful independently from the pipeline and also may be significantly optimized with universal intrinsics.
**File:** modules/photo/src/ccm/utils.cpp
**Change Type:** added
**Context:** PR #27051: Adding color correction module to photo module from opencv_contrib
**Review Line:** 16

**Code Changes:**
```diff
+namespace cv {
+namespace ccm {
+
+void gammaCorrection(InputArray _src, OutputArray _dst, double gamma)
+{
+    Mat src = _src.getMat();
+    CV_Assert(gamma > 0);
+
+    double  maxVal;
+    int     depth = src.depth();
+    switch (depth)
```

Review comment:
please add CV_Assert with input type checks at least. The function is public API now and should handle invalid input correctly.