1 diff -Naur opencv-2.4.6.1_SRC_orig/cmake/OpenCVPCHSupport.cmake opencv-2.4.6.1_SRC_modif/cmake/OpenCVPCHSupport.cmake
2 --- opencv-2.4.6.1_SRC_orig/cmake/OpenCVPCHSupport.cmake 2013-07-10 15:49:00.000000000 +0400
3 +++ opencv-2.4.6.1_SRC_modif/cmake/OpenCVPCHSupport.cmake 2016-10-17 17:34:32.000000000 +0300
5 ARGS ${CMAKE_CXX_COMPILER_ARG1} -dumpversion
6 OUTPUT_VARIABLE gcc_compiler_version)
7 #MESSAGE("GCC Version: ${gcc_compiler_version}")
8 - IF(gcc_compiler_version VERSION_GREATER "4.2.-1")
9 + IF(gcc_compiler_version VERSION_GREATER "4.2.-1" AND gcc_compiler_version VERSION_LESS "6.0.0")
10 SET(PCHSupport_FOUND TRUE)
13 diff -Naur opencv-2.4.6.1_SRC_orig/modules/contrib/src/chamfermatching.cpp opencv-2.4.6.1_SRC_modif/modules/contrib/src/chamfermatching.cpp
14 --- opencv-2.4.6.1_SRC_orig/modules/contrib/src/chamfermatching.cpp 2013-07-10 15:49:00.000000000 +0400
15 +++ opencv-2.4.6.1_SRC_modif/modules/contrib/src/chamfermatching.cpp 2016-10-17 18:11:47.000000000 +0300
17 for (int y=0;y<h;++y) {
18 for (int x=0;x<w;++x) {
20 - if (&annotate_img!=NULL) {
21 - annotate_img.at<Vec2i>(y,x)[0]=x;
22 - annotate_img.at<Vec2i>(y,x)[1]=y;
24 + annotate_img.at<Vec2i>(y,x)[0]=x;
25 + annotate_img.at<Vec2i>(y,x)[1]=y;
27 uchar edge_val = edges_img.at<uchar>(y,x);
29 @@ -1005,11 +1003,9 @@
30 if (dt==-1 || dt>dist) {
31 dist_img.at<float>(ny,nx) = dist;
32 q.push(std::make_pair(nx,ny));
34 - if (&annotate_img!=NULL) {
35 - annotate_img.at<Vec2i>(ny,nx)[0]=annotate_img.at<Vec2i>(y,x)[0];
36 - annotate_img.at<Vec2i>(ny,nx)[1]=annotate_img.at<Vec2i>(y,x)[1];
39 + annotate_img.at<Vec2i>(ny,nx)[0]=annotate_img.at<Vec2i>(y,x)[0];
40 + annotate_img.at<Vec2i>(ny,nx)[1]=annotate_img.at<Vec2i>(y,x)[1];
44 @@ -1101,26 +1097,24 @@
45 float cost = (sum_distance/truncate_)/addr.size();
48 - if (&orientation_img!=NULL) {
49 - float* optr = orientation_img.ptr<float>(y)+x;
50 - float sum_orientation = 0;
51 - int cnt_orientation = 0;
53 - for (size_t i=0;i<addr.size();++i) {
55 - if(addr[i] < (orientation_img.cols*orientation_img.rows) - (offset.y*orientation_img.cols + offset.x)){
56 - if (tpl->orientations[i]>=-CV_PI && (*(optr+addr[i]))>=-CV_PI) {
57 - sum_orientation += orientation_diff(tpl->orientations[i], (*(optr+addr[i])));
63 - if (cnt_orientation>0) {
64 - cost = (float)(beta*cost+alpha*(sum_orientation/(2*CV_PI))/cnt_orientation);
68 + float* optr = orientation_img.ptr<float>(y)+x;
69 + float sum_orientation = 0;
70 + int cnt_orientation = 0;
72 + for (size_t i=0;i<addr.size();++i) {
74 + if(addr[i] < (orientation_img.cols*orientation_img.rows) - (offset.y*orientation_img.cols + offset.x)){
75 + if (tpl->orientations[i]>=-CV_PI && (*(optr+addr[i]))>=-CV_PI) {
76 + sum_orientation += orientation_diff(tpl->orientations[i], (*(optr+addr[i])));
82 + if (cnt_orientation>0) {
83 + cost = (float)(beta*cost+alpha*(sum_orientation/(2*CV_PI))/cnt_orientation);
87 ChamferMatcher::Match* istance = new ChamferMatcher::Match();
88 diff -Naur opencv-2.4.6.1_SRC_orig/modules/legacy/src/dpstereo.cpp opencv-2.4.6.1_SRC_modif/modules/legacy/src/dpstereo.cpp
89 --- opencv-2.4.6.1_SRC_orig/modules/legacy/src/dpstereo.cpp 2013-07-10 15:49:00.000000000 +0400
90 +++ opencv-2.4.6.1_SRC_modif/modules/legacy/src/dpstereo.cpp 2016-10-18 10:22:03.257968598 +0300
92 uchar min_val, max_val;
95 -#define CV_IMAX3(a,b,c) ((temp3 = (a) >= (b) ? (a) : (b)),(temp3 >= (c) ? temp3 : (c)))
96 -#define CV_IMIN3(a,b,c) ((temp3 = (a) <= (b) ? (a) : (b)),(temp3 <= (c) ? temp3 : (c)))
97 +#define CV_IMAX3(a,b,c) (std::max(std::max((a), (b)), (c)))
98 +#define CV_IMIN3(a,b,c) (std::min(std::min((a), (b)), (c)))
100 static void icvFindStereoCorrespondenceByBirchfieldDP( uchar* src1, uchar* src2,
103 float _param3, float _param4,
106 - int x, y, i, j, temp3;
109 int dispH = maxDisparity + 3;
111 diff -Naur opencv-2.4.6.1_SRC_orig/modules/ts/include/opencv2/ts/ts_perf.hpp opencv-2.4.6.1_SRC_modif/modules/ts/include/opencv2/ts/ts_perf.hpp
112 --- opencv-2.4.6.1_SRC_orig/modules/ts/include/opencv2/ts/ts_perf.hpp 2013-07-10 15:49:00.000000000 +0400
113 +++ opencv-2.4.6.1_SRC_modif/modules/ts/include/opencv2/ts/ts_perf.hpp 2016-10-17 17:52:29.000000000 +0300
115 INSTANTIATE_TEST_CASE_P(/*none*/, fixture##_##name, params);\
116 void fixture##_##name::PerfTestBody()
118 + #if defined(_MSC_VER) && (_MSC_VER <= 1400)
119 + #define CV_PERF_TEST_MAIN_INTERNALS_ARGS(...) \
120 + while (++argc >= (--argc,-1)) {__VA_ARGS__; break;} /*this ugly construction is needed for VS 2005*/
122 + #define CV_PERF_TEST_MAIN_INTERNALS_ARGS(...) \
126 #define CV_PERF_TEST_MAIN_INTERNALS(modulename, impls, ...) \
127 - while (++argc >= (--argc,-1)) {__VA_ARGS__; break;} /*this ugly construction is needed for VS 2005*/\
128 + CV_PERF_TEST_MAIN_INTERNALS_ARGS(__VA_ARGS__) \
129 ::perf::Regression::Init(#modulename);\
130 ::perf::TestBase::Init(std::vector<std::string>(impls, impls + sizeof impls / sizeof *impls),\