endif()
ocv_warnings_disable(CMAKE_C_FLAGS -Wno-unused-but-set-variable -Wmissing-prototypes -Wmissing-declarations -Wundef -Wunused -Wsign-compare
- -Wcast-align -Wshadow -Wno-maybe-uninitialized -Wno-pointer-to-int-cast -Wno-int-to-pointer-cast)
+ -Wcast-align -Wshadow -Wno-maybe-uninitialized -Wno-pointer-to-int-cast -Wno-int-to-pointer-cast -Wmisleading-indentation)
ocv_warnings_disable(CMAKE_C_FLAGS -Wunused-parameter) # clang
ocv_warnings_disable(CMAKE_CXX_FLAGS -Wmissing-declarations -Wunused-parameter)
ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4018 /wd4100 /wd4127 /wd4311 /wd4701 /wd4706) # vs2005
ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4703) # vs2012
ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4456 /wd4457 /wd4312) # vs2015
-ocv_warnings_disable(CMAKE_C_FLAGS /wd4267 /wd4244 /wd4018)
+ocv_warnings_disable(CMAKE_C_FLAGS /wd4267 /wd4244 /wd4018 /wd4311 /wd4312)
if(UNIX AND (CMAKE_COMPILER_IS_GNUCXX OR CV_ICC))
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
source_group("Include" FILES ${lib_hdrs} )
source_group("Src" FILES ${lib_srcs})
-ocv_warnings_disable(CMAKE_CXX_FLAGS -Wshadow -Wunused -Wsign-compare -Wundef -Wmissing-declarations -Wuninitialized -Wswitch -Wparentheses -Warray-bounds -Wextra)
-ocv_warnings_disable(CMAKE_CXX_FLAGS -Wdeprecated-declarations)
+ocv_warnings_disable(CMAKE_CXX_FLAGS -Wshadow -Wunused -Wsign-compare -Wundef -Wmissing-declarations -Wuninitialized -Wswitch -Wparentheses -Warray-bounds -Wextra
+ -Wdeprecated-declarations -Wmisleading-indentation)
ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4018 /wd4099 /wd4100 /wd4101 /wd4127 /wd4189 /wd4245 /wd4305 /wd4389 /wd4512 /wd4701 /wd4702 /wd4706 /wd4800) # vs2005
ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4334) # vs2005 Win64
ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4244) # vs2008
add_extra_compiler_option(-Wno-narrowing)
add_extra_compiler_option(-Wno-delete-non-virtual-dtor)
add_extra_compiler_option(-Wno-unnamed-type-template-args)
+ add_extra_compiler_option(-Wno-comment)
add_extra_compiler_option(-Wno-array-bounds)
add_extra_compiler_option(-Wno-aggressive-loop-optimizations)
endif()
q->neighbors[j] = 0;
q->count--;
for(int k = 0; k < 4; k++ )
+ {
if( q0->neighbors[k] == q )
{
q0->neighbors[k] = 0;
q0->count--;
break;
}
- break;
+ }
+ break;
}
}
}
undistortPoints(Mat(pts), upts, M, D, R, P );
for( k = 0; k < N*N; k++ )
+ {
if( upts[k].x < -imgsize.width*eps || upts[k].x > imgsize.width*(1+eps) ||
upts[k].y < -imgsize.height*eps || upts[k].y > imgsize.height*(1+eps) )
{
test_case_idx, pts[k].x, pts[k].y, upts[k].x, upts[k].y);
return false;
}
+ }
// step 2. check that all the points inside ROI belong to the original source image
Mat temp(imgsize, CV_8U), utemp, map1, map2;
typedef PtrStep<float> PtrStepf;
typedef PtrStep<int> PtrStepi;
-
#if defined __GNUC__
- #define __CV_GPU_DEPR_BEFORE__
- #define __CV_GPU_DEPR_AFTER__ __attribute__ ((deprecated))
+ #define CV_GPU_DEPRECATED __attribute__ ((deprecated))
#elif defined(__MSVC__) //|| defined(__CUDACC__)
#pragma deprecated(DevMem2D_)
- #define __CV_GPU_DEPR_BEFORE__ __declspec(deprecated)
- #define __CV_GPU_DEPR_AFTER__
+ #define CV_GPU_DEPRECATED __declspec(deprecated)
#else
- #define __CV_GPU_DEPR_BEFORE__
- #define __CV_GPU_DEPR_AFTER__
+ #define CV_GPU_DEPRECATED
#endif
- template <typename T> struct __CV_GPU_DEPR_BEFORE__ DevMem2D_ : public PtrStepSz<T>
+ template <typename T> struct DevMem2D_ : public PtrStepSz<T>
{
- DevMem2D_() {}
- DevMem2D_(int rows_, int cols_, T* data_, size_t step_) : PtrStepSz<T>(rows_, cols_, data_, step_) {}
+ CV_GPU_DEPRECATED DevMem2D_() {}
+ CV_GPU_DEPRECATED DevMem2D_(int rows_, int cols_, T* data_, size_t step_) : PtrStepSz<T>(rows_, cols_, data_, step_) {}
template <typename U>
- explicit __CV_GPU_DEPR_BEFORE__ DevMem2D_(const DevMem2D_<U>& d) : PtrStepSz<T>(d.rows, d.cols, (T*)d.data, d.step) {}
- } __CV_GPU_DEPR_AFTER__ ;
+ explicit CV_GPU_DEPRECATED DevMem2D_(const DevMem2D_<U>& d) : PtrStepSz<T>(d.rows, d.cols, (T*)d.data, d.step) {}
+ };
typedef DevMem2D_<unsigned char> DevMem2Db;
typedef DevMem2Db DevMem2D;
typedef PtrElemStep_<float> PtrElemStepf;
typedef PtrElemStep_<int> PtrElemStepi;
-//#undef __CV_GPU_DEPR_BEFORE__
-//#undef __CV_GPU_DEPR_AFTER__
+//#undef CV_GPU_DEPRECATED
namespace device
{
template <typename _Tp> operator PtrStep<_Tp>() const;
// Deprecated function
- __CV_GPU_DEPR_BEFORE__ template <typename _Tp> operator DevMem2D_<_Tp>() const __CV_GPU_DEPR_AFTER__;
- __CV_GPU_DEPR_BEFORE__ template <typename _Tp> operator PtrStep_<_Tp>() const __CV_GPU_DEPR_AFTER__;
- #undef __CV_GPU_DEPR_BEFORE__
- #undef __CV_GPU_DEPR_AFTER__
+ template <typename _Tp> CV_GPU_DEPRECATED operator DevMem2D_<_Tp>() const;
+ template <typename _Tp> CV_GPU_DEPRECATED operator PtrStep_<_Tp>() const;
+ #undef CV_GPU_DEPRECATED
/*! includes several bit-fields:
- the magic signature
return classname##_info_var; \
} \
\
- static ::cv::AlgorithmInfo& classname##_info_auto = classname##_info(); \
+ CV_ATTR_USED static ::cv::AlgorithmInfo& classname##_info_auto = classname##_info(); \
\
::cv::AlgorithmInfo* classname::info() const \
{ \
#ifndef __OPENCV_CORE_TYPES_H__
#define __OPENCV_CORE_TYPES_H__
+#if defined(__GNUC__) && !defined(COMPILER_ICC)
+# define CV_ATTR_UNUSED __attribute__((unused))
+# define CV_ATTR_USED __attribute__((used))
+#else
+# define CV_ATTR_UNUSED
+# define CV_ATTR_USED
+#endif
+
+
#if !defined _CRT_SECURE_NO_DEPRECATE && defined _MSC_VER
# if _MSC_VER > 1300
# define _CRT_SECURE_NO_DEPRECATE /* to avoid multiple Visual Studio 2005 warnings */
(seq->count - from_idx)*elem_size );
}
seq->count += to_idx - from_idx;
- if( elem && to_idx > from_idx )
+ if( elem )
memcpy( seq->array + from_idx*elem_size, elem, (to_idx - from_idx)*elem_size );
}
{
virtual void static_delete(void** x)
{
- if (* x) delete (* reinterpret_cast<T**>(x)); *x = NULL;
+ if (* x) { delete (* reinterpret_cast<T**>(x)); *x = NULL; }
}
virtual void copy_from_value(void const* src, void** dest)
{
* @deprecated Use GenericIndex class instead
*/
template <typename T>
-class
-#ifndef _MSC_VER
- FLANN_DEPRECATED
-#endif
- Index_ {
+class Index_ {
public:
typedef typename L2<T>::ElementType ElementType;
typedef typename L2<T>::ResultType DistanceType;
+ FLANN_DEPRECATED
Index_(const Mat& features, const ::cvflann::IndexParams& params);
+ FLANN_DEPRECATED
~Index_();
+ FLANN_DEPRECATED
void knnSearch(const vector<ElementType>& query, vector<int>& indices, vector<DistanceType>& dists, int knn, const ::cvflann::SearchParams& params);
+ FLANN_DEPRECATED
void knnSearch(const Mat& queries, Mat& indices, Mat& dists, int knn, const ::cvflann::SearchParams& params);
+ FLANN_DEPRECATED
int radiusSearch(const vector<ElementType>& query, vector<int>& indices, vector<DistanceType>& dists, DistanceType radius, const ::cvflann::SearchParams& params);
+ FLANN_DEPRECATED
int radiusSearch(const Mat& query, Mat& indices, Mat& dists, DistanceType radius, const ::cvflann::SearchParams& params);
+ FLANN_DEPRECATED
void save(std::string filename)
{
if (nnIndex_L1) nnIndex_L1->save(filename);
if (nnIndex_L2) nnIndex_L2->save(filename);
}
+ FLANN_DEPRECATED
int veclen() const
{
if (nnIndex_L1) return nnIndex_L1->veclen();
if (nnIndex_L2) return nnIndex_L2->veclen();
}
+ FLANN_DEPRECATED
int size() const
{
if (nnIndex_L1) return nnIndex_L1->size();
if (nnIndex_L2) return nnIndex_L2->size();
}
+ FLANN_DEPRECATED
::cvflann::IndexParams getParameters()
{
if (nnIndex_L1) return nnIndex_L1->getParameters();
}
- FLANN_DEPRECATED const ::cvflann::IndexParams* getIndexParameters()
+ FLANN_DEPRECATED
+ const ::cvflann::IndexParams* getIndexParameters()
{
if (nnIndex_L1) return nnIndex_L1->getIndexParameters();
if (nnIndex_L2) return nnIndex_L2->getIndexParameters();
::cvflann::Index< L1<ElementType> >* nnIndex_L1;
};
-#ifdef _MSC_VER
-template <typename T>
-class FLANN_DEPRECATED Index_;
-#endif
template <typename T>
Index_<T>::Index_(const Mat& dataset, const ::cvflann::IndexParams& params)
deviceHandle = open(deviceName, O_RDONLY);
if (deviceHandle != -1) {
/* This device does indeed exist - add it to the total so far */
- // add indexList
- indexList|=(1 << CameraNumber);
- numCameras++;
- }
- if (deviceHandle != -1)
- close(deviceHandle);
+ // add indexList
+ indexList|=(1 << CameraNumber);
+ numCameras++;
+ close(deviceHandle);
+ }
/* Set up to test the next /dev/video source in line */
CameraNumber++;
} /* End while */
bool all = true;
Mat inner = flow(where);
for(int y = 0; y < inner.rows; ++y)
+ {
for(int x = 0; x < inner.cols; ++x)
{
const Point2f f = inner.at<Point2f>(y, x);
double a = atan2(f.y, f.x);
error += fabs(angle - a);
}
- double res = all ? numeric_limits<double>::max() : error / (inner.cols * inner.rows);
+ }
+
+ double res = all ? numeric_limits<double>::max() : error / (inner.cols * inner.rows);
- if (writeError)
- cout << "Error " + name << " = " << res << endl;
+ if (writeError)
+ cout << "Error " + name << " = " << res << endl;
- return res;
+ return res;
}
int dispScaleFactor = datasetsParams[datasetName].dispScaleFactor;
Mat tmp; trueLeftDisp.convertTo( tmp, CV_32FC1, 1.f/dispScaleFactor ); trueLeftDisp = tmp; tmp.release();
if( !trueRightDisp.empty() )
+ {
trueRightDisp.convertTo( tmp, CV_32FC1, 1.f/dispScaleFactor ); trueRightDisp = tmp; tmp.release();
+ }
Mat leftDisp, rightDisp;
int ignBorder = max(runStereoMatchingAlgorithm(leftImg, rightImg, leftDisp, rightDisp, ci), EVAL_IGNORE_BORDER);
vector<int> rank;
vector<int> size;
private:
- DjSets(const DjSets &) {}
- DjSets operator =(const DjSets &);
+ DjSets(const DjSets &); // = delete
+ DjSets& operator =(const DjSets &); // = delete
};
template <typename T>
// Implementation
//
- DjSets DjSets::operator = (const DjSets &/*obj*/)
- {
- //cout << "Invalid DjSets constructor\n";
- CV_Error(-1, "Invalid DjSets constructor\n");
- return *this;
- }
-
DjSets::DjSets(int n) : parent(n), rank(n, 0), size(n, 1)
{
for (int i = 0; i < n; ++i)
}; \
\
int GTEST_TEST_CLASS_NAME_(test_case_name, \
- test_name)::gtest_registering_dummy_ = \
+ test_name)::gtest_registering_dummy_ GTEST_ATTRIBUTE_UNUSED_ = \
GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::AddToRegistry(); \
\
void GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::TestBody() \
#ifdef HAVE_OPENCV_NONFREE
#include "opencv2/nonfree/nonfree.hpp"
+CV_ATTR_USED
static bool makeUseOfNonfree = initModule_nonfree();
#endif
GTEST_TEST_CLASS_NAME_(test_case_name, test_name)); \
}; \
int GTEST_TEST_CLASS_NAME_(test_case_name, \
- test_name)::gtest_registering_dummy_ = \
+ test_name)::gtest_registering_dummy_ GTEST_ATTRIBUTE_UNUSED_ = \
GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::AddToRegistry(); \
void GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::TestBody() \
{ \
GTEST_TEST_CLASS_NAME_(test_case_name, test_name)); \
}; \
int GTEST_TEST_CLASS_NAME_(test_case_name, \
- test_name)::gtest_registering_dummy_ = \
+ test_name)::gtest_registering_dummy_ GTEST_ATTRIBUTE_UNUSED_ = \
GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::AddToRegistry(); \
void GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::TestBody()
# define INSTANTIATE_TEST_CASE_P(prefix, test_case_name, generator) \
::testing::internal::ParamGenerator<test_case_name::ParamType> \
gtest_##prefix##test_case_name##_EvalGenerator_() { return generator; } \
- int gtest_##prefix##test_case_name##_dummy_ = \
+ int gtest_##prefix##test_case_name##_dummy_ GTEST_ATTRIBUTE_UNUSED_ = \
::testing::UnitTest::GetInstance()->parameterized_test_registry(). \
GetTestCasePatternHolder<test_case_name>(\
#test_case_name, __FILE__, __LINE__)->AddTestCaseInstantiation(\
for( i = 0; i < total; i++ )
{
int a = src1[i], b = src2[i];
- if( a < 0 ) a ^= C; if( b < 0 ) b ^= C;
+ if( a < 0 ) { a ^= C; } if( b < 0 ) { b ^= C; }
int diff = std::abs(a - b);
if( realmaxdiff < diff )
{
for( i = 0; i < total; i++ )
{
int64 a = src1[i], b = src2[i];
- if( a < 0 ) a ^= C; if( b < 0 ) b ^= C;
+ if( a < 0 ) { a ^= C; } if( b < 0 ) { b ^= C; }
double diff = fabs((double)a - (double)b);
if( realmaxdiff < diff )
{