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)
-ocv_warnings_disable(CMAKE_CXX_FLAGS -Wmissing-declarations -Wunused-parameter /wd4100 /wd4244 /wd4706 /wd4127 /wd4701 /wd4018 /wd4267 /wd4306 /wd4305 /wd4312 /wd4311)
+ocv_warnings_disable(CMAKE_CXX_FLAGS -Wmissing-declarations -Wunused-parameter /wd4100 /wd4244 /wd4706 /wd4127 /wd4701 /wd4018 /wd4267 /wd4306 /wd4305 /wd4312 /wd4311 /wd4703)
if(UNIX AND (CMAKE_COMPILER_IS_GNUCXX OR CV_ICC))
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
OCV_OPTION(ENABLE_OMIT_FRAME_POINTER "Enable -fomit-frame-pointer for GCC" ON IF CMAKE_COMPILER_IS_GNUCXX )
OCV_OPTION(ENABLE_POWERPC "Enable PowerPC for GCC" ON IF (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_SYSTEM_PROCESSOR MATCHES powerpc.*) )
OCV_OPTION(ENABLE_FAST_MATH "Enable -ffast-math (not recommended for GCC 4.6.x)" OFF IF (CMAKE_COMPILER_IS_GNUCXX AND (X86 OR X86_64)) )
-OCV_OPTION(ENABLE_SSE "Enable SSE instructions" ON IF (MSVC OR CMAKE_COMPILER_IS_GNUCXX AND (X86 OR X86_64)) )
-OCV_OPTION(ENABLE_SSE2 "Enable SSE2 instructions" ON IF (MSVC OR CMAKE_COMPILER_IS_GNUCXX AND (X86 OR X86_64)) )
-OCV_OPTION(ENABLE_SSE3 "Enable SSE3 instructions" ON IF (MSVC OR CV_ICC OR CMAKE_COMPILER_IS_GNUCXX AND (X86 OR X86_64)) )
+OCV_OPTION(ENABLE_SSE "Enable SSE instructions" ON IF ((MSVC OR CMAKE_COMPILER_IS_GNUCXX) AND (X86 OR X86_64)) )
+OCV_OPTION(ENABLE_SSE2 "Enable SSE2 instructions" ON IF ((MSVC OR CMAKE_COMPILER_IS_GNUCXX) AND (X86 OR X86_64)) )
+OCV_OPTION(ENABLE_SSE3 "Enable SSE3 instructions" ON IF ((CV_ICC OR CMAKE_COMPILER_IS_GNUCXX) AND (X86 OR X86_64)) )
OCV_OPTION(ENABLE_SSSE3 "Enable SSSE3 instructions" OFF IF (CMAKE_COMPILER_IS_GNUCXX AND (X86 OR X86_64)) )
-OCV_OPTION(ENABLE_SSE41 "Enable SSE4.1 instructions" OFF IF (CV_ICC OR CMAKE_COMPILER_IS_GNUCXX AND (X86 OR X86_64)) )
+OCV_OPTION(ENABLE_SSE41 "Enable SSE4.1 instructions" OFF IF ((CV_ICC OR CMAKE_COMPILER_IS_GNUCXX) AND (X86 OR X86_64)) )
OCV_OPTION(ENABLE_SSE42 "Enable SSE4.2 instructions" OFF IF (CMAKE_COMPILER_IS_GNUCXX AND (X86 OR X86_64)) )
OCV_OPTION(ENABLE_NOISY_WARNINGS "Show all warnings even if they are too noisy" OFF )
OCV_OPTION(OPENCV_WARNINGS_ARE_ERRORS "Treat warnings as errors" OFF )
CV_INIT_ALGORITHM(FastFeatureDetector, "Feature2D.FAST",
obj.info()->addParam(obj, "threshold", obj.threshold);
obj.info()->addParam(obj, "nonmaxSuppression", obj.nonmaxSuppression);
- obj.info()->addParam(obj, "type", obj.type, static_cast<int>(FastFeatureDetector::TYPE_9_16)));
+ obj.info()->addParam(obj, "type", obj.type));
///////////////////////////////////////////////////////////////////////////////////////////////////////////
vector<KeyPoint> keypoints1;
vector<KeyPoint> keypoints2;
- FAST(gray1, keypoints1, 30, type);
- FAST(gray2, keypoints2, 30, type);
+ FAST(gray1, keypoints1, 30, true, type);
+ FAST(gray2, keypoints2, 30, true, type);
for(size_t i = 0; i < keypoints1.size(); ++i)
{
int CV_KDTreeTest_CPP::checkFindBoxed()
{
- vector<float> min( dims, minValue), max(dims, maxValue);
+ vector<float> min( dims, static_cast<float>(minValue)), max(dims, static_cast<float>(maxValue));
vector<int> indices;
tr->findOrthoRange( min, max, indices );
// TODO check indices
const int emax = 20;
Mat neighbors2( neighbors.size(), CV_32SC1 );
int j;
- vector<float> min(points.cols, minValue);
- vector<float> max(points.cols, maxValue);
+ vector<float> min(points.cols, static_cast<float>(minValue));
+ vector<float> max(points.cols, static_cast<float>(maxValue));
for( int pi = 0; pi < points.rows; pi++ )
{
// 1st way
Mat generateHomography(float angle)
{
// angle - rotation around Oz in degrees
- float angleRadian = angle * CV_PI / 180.;
+ float angleRadian = static_cast<float>(angle * CV_PI / 180);
Mat H = Mat::eye(3, 3, CV_32FC1);
H.at<float>(0,0) = H.at<float>(1,1) = std::cos(angleRadian);
H.at<float>(0,1) = -std::sin(angleRadian);
// angle - rotation around Oz in degrees
float diag = std::sqrt(static_cast<float>(srcImage.cols * srcImage.cols + srcImage.rows * srcImage.rows));
Mat LUShift = Mat::eye(3, 3, CV_32FC1); // left up
- LUShift.at<float>(0,2) = -srcImage.cols/2;
- LUShift.at<float>(1,2) = -srcImage.rows/2;
+ LUShift.at<float>(0,2) = static_cast<float>(-srcImage.cols/2);
+ LUShift.at<float>(1,2) = static_cast<float>(-srcImage.rows/2);
Mat RDShift = Mat::eye(3, 3, CV_32FC1); // right down
RDShift.at<float>(0,2) = diag/2;
RDShift.at<float>(1,2) = diag/2;
static
float calcCirclesIntersectArea(const Point2f& p0, float r0, const Point2f& p1, float r1)
{
- float c = norm(p0 - p1), sqr_c = c * c;
+ float c = static_cast<float>(norm(p0 - p1)), sqr_c = c * c;
float sqr_r0 = r0 * r0;
float sqr_r1 = r1 * r1;
float minR = std::min(r0, r1);
float maxR = std::max(r0, r1);
if(c + minR <= maxR)
- return CV_PI * minR * minR;
+ return static_cast<float>(CV_PI * minR * minR);
float cos_halfA0 = (sqr_r0 + sqr_c - sqr_r1) / (2 * r0 * c);
float cos_halfA1 = (sqr_r1 + sqr_c - sqr_r0) / (2 * r1 * c);
float A0 = 2 * acos(cos_halfA0);
float A1 = 2 * acos(cos_halfA1);
- return 0.5 * sqr_r0 * (A0 - sin(A0)) +
- 0.5 * sqr_r1 * (A1 - sin(A1));
+ return 0.5f * sqr_r0 * (A0 - sin(A0)) +
+ 0.5f * sqr_r1 * (A1 - sin(A1));
}
static
float calcIntersectRatio(const Point2f& p0, float r0, const Point2f& p1, float r1)
{
float intersectArea = calcCirclesIntersectArea(p0, r0, p1, r1);
- float unionArea = CV_PI * (r0 * r0 + r1 * r1) - intersectArea;
+ float unionArea = static_cast<float>(CV_PI) * (r0 * r0 + r1 * r1) - intersectArea;
return intersectArea / unionArea;
}
matches.clear();
vector<uchar> usedMask(keypoints1.size(), 0);
- for(size_t i0 = 0; i0 < keypoints0.size(); i0++)
+ for(int i0 = 0; i0 < static_cast<int>(keypoints0.size()); i0++)
{
int nearestPointIndex = -1;
float maxIntersectRatio = 0.f;
if(intersectRatio > maxIntersectRatio)
{
maxIntersectRatio = intersectRatio;
- nearestPointIndex = i1;
+ nearestPointIndex = static_cast<int>(i1);
}
}
const int maxAngle = 360, angleStep = 15;
for(int angle = 0; angle < maxAngle; angle += angleStep)
{
- Mat H = rotateImage(image0, angle, image1, mask1);
+ Mat H = rotateImage(image0, static_cast<float>(angle), image1, mask1);
vector<KeyPoint> keypoints1;
featureDetector->detect(image1, keypoints1, mask1);
const int maxAngle = 360, angleStep = 15;
for(int angle = 0; angle < maxAngle; angle += angleStep)
{
- Mat H = rotateImage(image0, angle, image1, mask1);
+ Mat H = rotateImage(image0, static_cast<float>(angle), image1, mask1);
vector<KeyPoint> keypoints1;
- rotateKeyPoints(keypoints0, H, angle, keypoints1);
+ rotateKeyPoints(keypoints0, H, static_cast<float>(angle), keypoints1);
Mat descriptors1;
descriptorExtractor->compute(image1, keypoints1, descriptors1);
keyPointMatchesCount++;
// Check does this inlier have consistent sizes
- const float maxSizeDiff = 0.8;//0.9f; // grad
+ const float maxSizeDiff = 0.8f;//0.9f; // grad
float size0 = keypoints0[matches[m].trainIdx].size;
float size1 = osiKeypoints1[matches[m].queryIdx].size;
CV_Assert(size0 > 0 && size1 > 0);
resize(image0, image1, Size(), 1./scale, 1./scale);
vector<KeyPoint> keypoints1;
- scaleKeyPoints(keypoints0, keypoints1, 1./scale);
+ scaleKeyPoints(keypoints0, keypoints1, 1.0f/scale);
Mat descriptors1;
descriptorExtractor->compute(image1, keypoints1, descriptors1);
case HALF_SIZE:\r
if (i > map_x.cols*0.25 && i < map_x.cols*0.75 && j > map_x.rows*0.25 && j < map_x.rows*0.75)\r
{\r
- map_x.at<float>(j,i) = 2 * (i - map_x.cols * 0.25) + 0.5;\r
- map_y.at<float>(j,i) = 2 * (j - map_x.rows * 0.25) + 0.5;\r
+ map_x.at<float>(j,i) = 2 * (i - map_x.cols * 0.25f) + 0.5f;\r
+ map_y.at<float>(j,i) = 2 * (j - map_x.rows * 0.25f) + 0.5f;\r
}\r
else\r
{\r
}\r
break;\r
case UPSIDE_DOWN:\r
- map_x.at<float>(j,i) = i;\r
- map_y.at<float>(j,i) = map_x.rows - j;\r
+ map_x.at<float>(j,i) = static_cast<float>(i);\r
+ map_y.at<float>(j,i) = static_cast<float>(map_x.rows - j);\r
break;\r
case REFLECTION_X:\r
- map_x.at<float>(j,i) = map_x.cols - i;\r
- map_y.at<float>(j,i) = j;\r
+ map_x.at<float>(j,i) = static_cast<float>(map_x.cols - i);\r
+ map_y.at<float>(j,i) = static_cast<float>(j);\r
break;\r
case REFLECTION_BOTH:\r
- map_x.at<float>(j,i) = map_x.cols - i;\r
- map_y.at<float>(j,i) = map_x.rows - j;\r
+ map_x.at<float>(j,i) = static_cast<float>(map_x.cols - i);\r
+ map_y.at<float>(j,i) = static_cast<float>(map_x.rows - j);\r
break;\r
} // end of switch\r
}\r
const bool doSort = GET_PARAM(1);\r
\r
const float rho = 1.0f;\r
- const float theta = CV_PI / 180.0f;\r
+ const float theta = static_cast<float>(CV_PI / 180.0);\r
const int threshold = 300;\r
\r
cv::RNG rng(123456789);\r
int d = a - b;
return lo <= d && d <= hi;
}
+
+ private:
+ InInterval& operator=(const InInterval&);
+
+
};
GreedyLabeling(cv::Mat img)
int cc = -1;
int* dist_labels = (int*)labels.data;
- int pitch = labels.step1();
+ int pitch = static_cast<int>(labels.step1());
unsigned char* source = (unsigned char*)image.data;
int width = image.cols;
*top++ = dot::make(p.x, p.y + 1);
//top
- if( p.y > 0 && dl[-pitch] == -1 && inInt(sp[0], sp[-image.step1()]))
+ if( p.y > 0 && dl[-pitch] == -1 && inInt(sp[0], sp[-static_cast<int>(image.step1())]))
*top++ = dot::make(p.x, p.y - 1);
p = *--top;
{\r
string inputFile = perf::TestBase::getDataPath(GET_PARAM(0));\r
int cn = GET_PARAM(1);\r
- double learningRate = GET_PARAM(2);\r
+ float learningRate = static_cast<float>(GET_PARAM(2));\r
\r
cv::VideoCapture cap(inputFile);\r
ASSERT_TRUE(cap.isOpened());\r
#include <fstream>
#include <iostream>
#include <memory>
+#include <functional>
#if defined WIN32 || defined _WIN32
#define WIN32_LEAN_AND_MEAN
break;
case MOG:
- mog(d_frame, d_fgmask, 0.01);
+ mog(d_frame, d_fgmask, 0.01f);
break;
case MOG2:
break;
case MOG:
- mog(d_frame, d_fgmask, 0.01);
+ mog(d_frame, d_fgmask, 0.01f);
mog.getBackgroundImage(d_bgimg);
break;
if (!bgimg.empty())
imshow("mean background image", bgimg);
- char key = waitKey(30);
+ int key = waitKey(30);
if (key == 27)
break;
}
cv::gpu::MOG_GPU d_mog;\r
cv::gpu::GpuMat d_foreground;\r
\r
- d_mog(d_frame, d_foreground, 0.01);\r
+ d_mog(d_frame, d_foreground, 0.01f);\r
\r
while (!TestSystem::instance().stop())\r
{\r
\r
TestSystem::instance().gpuOn();\r
\r
- d_mog(d_frame, d_foreground, 0.01);\r
+ d_mog(d_frame, d_foreground, 0.01f);\r
\r
TestSystem::instance().gpuOff();\r
}\r