Merge 45027c4683
into 6de28c21f8
commit
f1f5d8e224
32 changed files with 227 additions and 122 deletions
@ -0,0 +1,12 @@ |
||||
set(the_description "Color Correction Module") |
||||
ocv_define_module(ccm |
||||
opencv_core |
||||
opencv_imgproc |
||||
opencv_3d |
||||
opencv_dnn |
||||
opencv_mcc |
||||
WRAP |
||||
python |
||||
) |
||||
add_dependencies(opencv_ccm opencv_mcc) |
||||
include_directories(${OPENCV_EXTRA_MODULES_PATH}/modules/mcc/include) |
@ -0,0 +1,41 @@ |
||||
// 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/ccm.hpp" |
||||
|
||||
namespace opencv_test |
||||
{ |
||||
namespace |
||||
{ |
||||
|
||||
using namespace std; |
||||
using namespace cv::ccm; |
||||
|
||||
PERF_TEST(CV_mcc_perf, infer) { |
||||
// read gold chartsRGB
|
||||
string path = cvtest::findDataFile("cv/mcc/mcc_ccm_test.yml"); |
||||
FileStorage fs(path, FileStorage::READ); |
||||
Mat chartsRGB; |
||||
FileNode node = fs["chartsRGB"]; |
||||
node >> chartsRGB; |
||||
fs.release(); |
||||
|
||||
// compute CCM
|
||||
ColorCorrectionModel model(chartsRGB.col(1).clone().reshape(3, chartsRGB.rows/3) / 255., COLORCHECKER_Macbeth); |
||||
model.run(); |
||||
|
||||
Mat img(1000, 4000, CV_8UC3); |
||||
randu(img, 0, 255); |
||||
img.convertTo(img, CV_64F, 1. / 255.); |
||||
|
||||
TEST_CYCLE() { |
||||
model.infer(img); |
||||
} |
||||
|
||||
SANITY_CHECK_NOTHING(); |
||||
} |
||||
|
||||
} // namespace
|
||||
} // namespace opencv_test
|
@ -0,0 +1,3 @@ |
||||
#include "perf_precomp.hpp" |
||||
|
||||
CV_PERF_TEST_MAIN(ccm) |
@ -0,0 +1,13 @@ |
||||
#ifndef __OPENCV_PERF_PRECOMP_HPP__ |
||||
#define __OPENCV_PERF_PRECOMP_HPP__ |
||||
|
||||
#include "opencv2/ts.hpp" |
||||
#include "opencv2/ccm.hpp" |
||||
|
||||
namespace opencv_test |
||||
{ |
||||
using namespace cv::ccm; |
||||
using namespace perf; |
||||
} |
||||
|
||||
#endif |
@ -0,0 +1,44 @@ |
||||
// 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.
|
||||
|
||||
/*
|
||||
* MIT License |
||||
* |
||||
* Copyright (c) 2018 Pedro Diamel Marrero Fernández |
||||
* |
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy |
||||
* of this software and associated documentation files (the "Software"), to deal |
||||
* in the Software without restriction, including without limitation the rights |
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
||||
* copies of the Software, and to permit persons to whom the Software is |
||||
* furnished to do so, subject to the following conditions: |
||||
* |
||||
* The above copyright notice and this permission notice shall be included in all |
||||
* copies or substantial portions of the Software. |
||||
* |
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
||||
* SOFTWARE. |
||||
*/ |
||||
|
||||
#ifndef _CCM_PRECOMP_HPP |
||||
#define _CCM_PRECOMP_HPP |
||||
|
||||
#include <limits> |
||||
|
||||
#include <opencv2/core.hpp> |
||||
#include <opencv2/imgproc.hpp> |
||||
#include <opencv2/3d.hpp> |
||||
#include <opencv2/dnn.hpp> |
||||
|
||||
#include <vector> |
||||
#include <string> |
||||
|
||||
#include "opencv2/ccm.hpp" |
||||
|
||||
#endif //_MCC_PRECOMP_HPP
|
@ -0,0 +1,7 @@ |
||||
// 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" |
||||
|
||||
CV_TEST_MAIN("cv") |
@ -0,0 +1,17 @@ |
||||
// 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__ |
||||
|
||||
#include "opencv2/ts.hpp" |
||||
#include "opencv2/ts/cuda_test.hpp" |
||||
#include "opencv2/ccm.hpp" |
||||
|
||||
namespace opencv_test |
||||
{ |
||||
using namespace cv::ccm; |
||||
} |
||||
|
||||
#endif |
Loading…
Reference in new issue