diff --git a/apps/haartraining/CMakeLists.txt b/apps/haartraining/CMakeLists.txt index 953be3b7e5..e25f56fc0e 100644 --- a/apps/haartraining/CMakeLists.txt +++ b/apps/haartraining/CMakeLists.txt @@ -1,4 +1,4 @@ -SET(OPENCV_HAARTRAINING_DEPS opencv_core opencv_imgproc opencv_highgui opencv_objdetect opencv_calib3d opencv_video opencv_features2d opencv_flann opencv_legacy) +SET(OPENCV_HAARTRAINING_DEPS opencv_core opencv_imgproc opencv_photo opencv_highgui opencv_objdetect opencv_calib3d opencv_video opencv_features2d opencv_flann opencv_legacy) ocv_check_dependencies(${OPENCV_HAARTRAINING_DEPS}) if(NOT OCV_DEPENDENCIES_FOUND) diff --git a/apps/traincascade/CMakeLists.txt b/apps/traincascade/CMakeLists.txt index f6fa679a9a..72e51b9ea0 100644 --- a/apps/traincascade/CMakeLists.txt +++ b/apps/traincascade/CMakeLists.txt @@ -1,4 +1,4 @@ -set(OPENCV_TRAINCASCADE_DEPS opencv_core opencv_ml opencv_imgproc opencv_objdetect opencv_highgui opencv_calib3d opencv_video opencv_features2d opencv_flann opencv_legacy) +set(OPENCV_TRAINCASCADE_DEPS opencv_core opencv_ml opencv_imgproc opencv_photo opencv_objdetect opencv_highgui opencv_calib3d opencv_video opencv_features2d opencv_flann opencv_legacy) ocv_check_dependencies(${OPENCV_TRAINCASCADE_DEPS}) if(NOT OCV_DEPENDENCIES_FOUND) diff --git a/include/opencv/cv.h b/include/opencv/cv.h index ce0d4e20f8..87fc0f2cfe 100644 --- a/include/opencv/cv.h +++ b/include/opencv/cv.h @@ -62,6 +62,8 @@ #include "opencv2/core/core_c.h" #include "opencv2/imgproc/imgproc_c.h" +#include "opencv2/photo/photo_c.h" + #include "opencv2/video.hpp" #include "opencv2/features2d.hpp" #include "opencv2/flann.hpp" diff --git a/include/opencv/cv.hpp b/include/opencv/cv.hpp index f1c5a1d275..6b579ff91c 100644 --- a/include/opencv/cv.hpp +++ b/include/opencv/cv.hpp @@ -50,6 +50,7 @@ #include "cv.h" #include "opencv2/core.hpp" #include "opencv2/imgproc.hpp" +#include "opencv2/photo.hpp" #include "opencv2/highgui.hpp" #endif diff --git a/include/opencv/cvaux.h b/include/opencv/cvaux.h index 6f8077b949..78777ac1b2 100644 --- a/include/opencv/cvaux.h +++ b/include/opencv/cvaux.h @@ -48,6 +48,8 @@ #include "opencv2/core/core_c.h" #include "opencv2/imgproc/imgproc_c.h" +#include "opencv2/photo/photo_c.h" + #include "opencv2/video.hpp" #include "opencv2/features2d.hpp" #include "opencv2/calib3d.hpp" diff --git a/modules/photo/include/opencv2/photo.hpp b/modules/photo/include/opencv2/photo.hpp index 07e7e098a9..185b8dcc90 100644 --- a/modules/photo/include/opencv2/photo.hpp +++ b/modules/photo/include/opencv2/photo.hpp @@ -46,10 +46,6 @@ #include "opencv2/core.hpp" #include "opencv2/imgproc.hpp" -#include "opencv2/photo/photo_c.h" - -#ifdef __cplusplus - /*! \namespace cv Namespace where all the C++ OpenCV functionality resides */ @@ -59,8 +55,8 @@ namespace cv //! the inpainting algorithm enum { - INPAINT_NS=CV_INPAINT_NS, // Navier-Stokes algorithm - INPAINT_TELEA=CV_INPAINT_TELEA // A. Telea algorithm + INPAINT_NS = 0, // Navier-Stokes algorithm + INPAINT_TELEA = 1 // A. Telea algorithm }; //! restores the damaged image areas using one of the available intpainting algorithms @@ -84,8 +80,6 @@ CV_EXPORTS_W void fastNlMeansDenoisingColoredMulti( InputArrayOfArrays srcImgs, float h = 3, float hColor = 3, int templateWindowSize = 7, int searchWindowSize = 21); -} - -#endif //__cplusplus +} // cv #endif diff --git a/modules/photo/src/denoising.cpp b/modules/photo/src/denoising.cpp index b2349ba273..4d3e6c8f94 100644 --- a/modules/photo/src/denoising.cpp +++ b/modules/photo/src/denoising.cpp @@ -74,7 +74,7 @@ void cv::fastNlMeansDenoising( InputArray _src, OutputArray _dst, float h, src, dst, templateWindowSize, searchWindowSize, h)); break; default: - CV_Error(CV_StsBadArg, + CV_Error(Error::StsBadArg, "Unsupported image format! Only CV_8UC1, CV_8UC2 and CV_8UC3 are supported"); } } @@ -88,7 +88,7 @@ void cv::fastNlMeansDenoisingColored( InputArray _src, OutputArray _dst, Mat dst = _dst.getMat(); if (src.type() != CV_8UC3) { - CV_Error(CV_StsBadArg, "Type of input image should be CV_8UC3!"); + CV_Error(Error::StsBadArg, "Type of input image should be CV_8UC3!"); return; } @@ -118,27 +118,27 @@ static void fastNlMeansDenoisingMultiCheckPreconditions( { int src_imgs_size = (int)srcImgs.size(); if (src_imgs_size == 0) { - CV_Error(CV_StsBadArg, "Input images vector should not be empty!"); + CV_Error(Error::StsBadArg, "Input images vector should not be empty!"); } if (temporalWindowSize % 2 == 0 || searchWindowSize % 2 == 0 || templateWindowSize % 2 == 0) { - CV_Error(CV_StsBadArg, "All windows sizes should be odd!"); + CV_Error(Error::StsBadArg, "All windows sizes should be odd!"); } int temporalWindowHalfSize = temporalWindowSize / 2; if (imgToDenoiseIndex - temporalWindowHalfSize < 0 || imgToDenoiseIndex + temporalWindowHalfSize >= src_imgs_size) { - CV_Error(CV_StsBadArg, + CV_Error(Error::StsBadArg, "imgToDenoiseIndex and temporalWindowSize " "should be choosen corresponding srcImgs size!"); } for (int i = 1; i < src_imgs_size; i++) { if (srcImgs[0].size() != srcImgs[i].size() || srcImgs[0].type() != srcImgs[i].type()) { - CV_Error(CV_StsBadArg, "Input images should have the same size and type!"); + CV_Error(Error::StsBadArg, "Input images should have the same size and type!"); } } } @@ -177,7 +177,7 @@ void cv::fastNlMeansDenoisingMulti( InputArrayOfArrays _srcImgs, OutputArray _ds dst, templateWindowSize, searchWindowSize, h)); break; default: - CV_Error(CV_StsBadArg, + CV_Error(Error::StsBadArg, "Unsupported matrix format! Only uchar, Vec2b, Vec3b are supported"); } } @@ -201,7 +201,7 @@ void cv::fastNlMeansDenoisingColoredMulti( InputArrayOfArrays _srcImgs, OutputAr int src_imgs_size = (int)srcImgs.size(); if (srcImgs[0].type() != CV_8UC3) { - CV_Error(CV_StsBadArg, "Type of input images should be CV_8UC3!"); + CV_Error(Error::StsBadArg, "Type of input images should be CV_8UC3!"); return; } diff --git a/modules/photo/src/inpaint.cpp b/modules/photo/src/inpaint.cpp index ce05fc3d1a..ec91e3c1bf 100644 --- a/modules/photo/src/inpaint.cpp +++ b/modules/photo/src/inpaint.cpp @@ -47,6 +47,7 @@ #include "precomp.hpp" #include "opencv2/imgproc/imgproc_c.h" +#include "opencv2/photo/photo_c.h" #undef CV_MAT_ELEM_PTR_FAST #define CV_MAT_ELEM_PTR_FAST( mat, row, col, pix_size ) \ @@ -782,7 +783,7 @@ cvInpaint( const CvArr* _input_img, const CvArr* _inpaint_mask, CvArr* _output_i cvSet(f,cvScalar(INSIDE,0,0,0),mask); cvSet(t,cvScalar(0,0,0,0),band); - if( flags == CV_INPAINT_TELEA ) + if( flags == cv::INPAINT_TELEA ) { out = cvCreateMat(erows, ecols, CV_8UC1); el_range = cvCreateStructuringElementEx(2*range+1,2*range+1, @@ -799,10 +800,10 @@ cvInpaint( const CvArr* _input_img, const CvArr* _inpaint_mask, CvArr* _output_i icvCalcFMM(out,t,Out,true); icvTeleaInpaintFMM(mask,t,output_img,range,Heap); } - else if (flags == CV_INPAINT_NS) { + else if (flags == cv::INPAINT_NS) { icvNSInpaintFMM(mask,t,output_img,range,Heap); } else { - CV_Error( CV_StsBadArg, "The flags argument must be one of CV_INPAINT_TELEA or CV_INPAINT_NS" ); + CV_Error( cv::Error::StsBadArg, "The flags argument must be one of CV_INPAINT_TELEA or CV_INPAINT_NS" ); } } diff --git a/modules/photo/test/test_inpaint.cpp b/modules/photo/test/test_inpaint.cpp index ef7132d6da..3c341b27a0 100644 --- a/modules/photo/test/test_inpaint.cpp +++ b/modules/photo/test/test_inpaint.cpp @@ -84,8 +84,8 @@ void CV_InpaintTest::run( int ) test.setTo(Scalar::all(255), mask1ch); Mat res1, res2; - inpaint( test, mask1ch, res1, 5, CV_INPAINT_NS ); - inpaint( test, mask1ch, res2, 5, CV_INPAINT_TELEA ); + inpaint( test, mask1ch, res1, 5, INPAINT_NS ); + inpaint( test, mask1ch, res2, 5, INPAINT_TELEA ); Mat diff1, diff2; absdiff( orig, res1, diff1 ); diff --git a/modules/python/src2/cv2.cpp b/modules/python/src2/cv2.cpp index 7455c5c6bb..75c8c2ec09 100644 --- a/modules/python/src2/cv2.cpp +++ b/modules/python/src2/cv2.cpp @@ -24,6 +24,7 @@ #include "opencv2/highgui.hpp" #include "opencv2/highgui/highgui_c.h" +#include "opencv2/photo/photo_c.h" #include "opencv2/opencv_modules.hpp" diff --git a/samples/cpp/inpaint.cpp b/samples/cpp/inpaint.cpp index 1ec00034a9..7690595cc2 100644 --- a/samples/cpp/inpaint.cpp +++ b/samples/cpp/inpaint.cpp @@ -81,7 +81,7 @@ int main( int argc, char** argv ) if( c == 'i' || c == ' ' ) { Mat inpainted; - inpaint(img, inpaintMask, inpainted, 3, CV_INPAINT_TELEA); + inpaint(img, inpaintMask, inpainted, 3, INPAINT_TELEA); imshow("inpainted image", inpainted); } }