int index;
};
-
+
+#if 0
class CV_EXPORTS AlgorithmImpl;
/*!
Ptr<AlgorithmImpl> impl;
};
-
+#endif
+
}
#endif // __cplusplus
return out;
}
-template<typename _Tp> struct AlgorithmParamType {};
+/*template<typename _Tp> struct AlgorithmParamType {};
template<> struct AlgorithmParamType<int> { enum { type = CV_PARAM_TYPE_INT }; };
template<> struct AlgorithmParamType<double> { enum { type = CV_PARAM_TYPE_REAL }; };
template<> struct AlgorithmParamType<string> { enum { type = CV_PARAM_TYPE_STRING }; };
template<typename _Tp> void Algorithm::setParamRange(int propId, const _Tp& minVal, const _Tp& maxVal)
{
setParamRange_(propId, AlgorithmParamType<_Tp>::type, &minVal, &maxVal);
-}
+}*/
}
BinaryFunc sccvtfunc = getConvertFunc(scdepth, CV_32S);
sccvtfunc(lb.data, 0, 0, 0, (uchar*)ilbuf, 0, Size(cn, 1), 0);
sccvtfunc(ub.data, 0, 0, 0, (uchar*)iubuf, 0, Size(cn, 1), 0);
- int minval = getMinVal(depth), maxval = getMaxVal(depth);
+ int minval = cvRound(getMinVal(depth)), maxval = cvRound(getMaxVal(depth));
for( int k = 0; k < cn; k++ )
{
a = (y >= 0 ? CV_PI*0.5 : CV_PI*1.5) -
x*y*(y2 + 0.43157974*x2)/(y2*y2 + x2*(0.76443945*y2 + 0.05831938*x2) + (float)DBL_EPSILON);
}
- angle[i] = a*scale;
+ angle[i] = (float)(a*scale);
}
}
{
const WT* _m = m;
for( int j = 0; j < cn; j++, _m += cn + 1 )
- dst[j] = src[j]*_m[j] + _m[cn];
+ dst[j] = saturate_cast<T>(src[j]*_m[j] + _m[cn]);
}
}
}
__m128i z = _mm_setzero_si128();
while( i < len0 )
{
- blockSize = std::min(len0 - j, blockSize0);
+ blockSize = std::min(len0 - i, blockSize0);
__m128i s = _mm_setzero_si128();
for( j = 0; j <= blockSize - 16; j += 16 )
{
{
template<typename T, typename ST, typename QT>
-void integral_( const T* src, size_t srcstep, ST* sum, size_t sumstep,
- QT* sqsum, size_t sqsumstep, ST* tilted, size_t tiltedstep,
+void integral_( const T* src, size_t _srcstep, ST* sum, size_t _sumstep,
+ QT* sqsum, size_t _sqsumstep, ST* tilted, size_t _tiltedstep,
Size size, int cn )
{
int x, y, k;
- srcstep /= sizeof(T);
- sumstep /= sizeof(ST);
- tiltedstep /= sizeof(ST);
- sqsumstep /= sizeof(QT);
+ int srcstep = (int)(_srcstep/sizeof(T));
+ int sumstep = (int)(_sumstep/sizeof(ST));
+ int tiltedstep = (int)(_tiltedstep/sizeof(ST));
+ int sqsumstep = (int)(_sqsumstep/sizeof(QT));
size.width *= cn;
}
-int CV_CalcBackProjectTest::validate_test_results( int test_case_idx )
+int CV_CalcBackProjectTest::validate_test_results( int /*test_case_idx*/ )
{
int code = cvtest::TS::OK;
s[0] = Point2f(0,0);
d[0] = Point2f(0,0);
- s[1] = Point2f(src.cols-1,0);
- d[1] = Point2f(dst.cols-1,0);
- s[2] = Point2f(src.cols-1,src.rows-1);
- d[2] = Point2f(dst.cols-1,dst.rows-1);
- s[3] = Point2f(0,src.rows-1);
- d[3] = Point2f(0,dst.rows-1);
+ s[1] = Point2f(src.cols-1.f,0);
+ d[1] = Point2f(dst.cols-1.f,0);
+ s[2] = Point2f(src.cols-1.f,src.rows-1.f);
+ d[2] = Point2f(dst.cols-1.f,dst.rows-1.f);
+ s[3] = Point2f(0,src.rows-1.f);
+ d[3] = Point2f(0,dst.rows-1.f);
float buf[16];
Mat tmp( 1, 16, CV_32FC1, buf );
};
-class BackgroundSubtractorMOG2 : public BackgroundSubtractor
+class CV_EXPORTS BackgroundSubtractorMOG2 : public BackgroundSubtractor
{
public:
//! the default constructor
vector<Point2f> mpts_1, mpts_2;
matches2points(matches_popcount, kpts_1, kpts_2, mpts_1, mpts_2); //Extract a list of the (x,y) location of the matches
vector<uchar> outlier_mask;
- Mat H = findHomography(Mat(mpts_2), Mat(mpts_1), outlier_mask, RANSAC, 1);
+ Mat H = findHomography(mpts_2, mpts_1, RANSAC, 1, outlier_mask);
Mat outimg;
drawMatches(im2, kpts_2, im1, kpts_1, matches_popcount, outimg, Scalar::all(-1), Scalar::all(-1),
kmeans(points, clusterCount, labels,
TermCriteria( CV_TERMCRIT_EPS+CV_TERMCRIT_ITER, 10, 1.0),
- 3, KMEANS_PP_CENTERS, ¢ers);
+ 3, KMEANS_PP_CENTERS, centers);
img = Scalar::all(0);
stereoRectify(cameraMatrix[0], distCoeffs[0],
cameraMatrix[1], distCoeffs[1],
imageSize, R, T, R1, R2, P1, P2, Q,
- 1, imageSize, &validRoi[0], &validRoi[1]);
+ CALIB_ZERO_DISPARITY, 1, imageSize, &validRoi[0], &validRoi[1]);
fs.open("extrinsics.yml", CV_STORAGE_WRITE);
if( fs.isOpened() )
fs["R"] >> R;
fs["T"] >> T;
- stereoRectify( M1, D1, M2, D2, img_size, R, T, R1, R2, P1, P2, Q, -1, img_size, &roi1, &roi2 );
+ stereoRectify( M1, D1, M2, D2, img_size, R, T, R1, R2, P1, P2, Q, CALIB_ZERO_DISPARITY, -1, img_size, &roi1, &roi2 );
Mat map11, map12, map21, map22;
initUndistortRectifyMap(M1, D1, R1, P1, img_size, CV_16SC2, map11, map12);
if (matches.size() > 5)
{
- Mat H = findHomography(Mat(train_pts), Mat(query_pts), match_mask, RANSAC, 4);
+ Mat H = findHomography(train_pts, query_pts, RANSAC, 4, match_mask);
if (countNonZero(Mat(match_mask)) > 15)
{
H_prev = H;
cv::gpu::morphologyEx(src, dst, CV_MOP_OPEN, element);\r
else\r
cv::gpu::morphologyEx(src, dst, CV_MOP_CLOSE, element);\r
- imshow("Open/Close",dst);\r
+ imshow("Open/Close",(Mat)dst);\r
}\r
\r
// callback function for erode/dilate trackbar\r
cv::gpu::erode(src, dst, element);\r
else\r
cv::gpu::dilate(src, dst, element);\r
- imshow("Erode/Dilate",dst);\r
+ imshow("Erode/Dilate",(Mat)dst);\r
}\r
\r
\r
\r
\r
void InitSolvePnpRansac()\r
-{
- Mat object; gen(object, 1, 4, CV_32FC3, Scalar::all(0), Scalar::all(100));
- Mat image; gen(image, 1, 4, CV_32FC2, Scalar::all(0), Scalar::all(100));
- Mat rvec, tvec;
+{\r
+ Mat object; gen(object, 1, 4, CV_32FC3, Scalar::all(0), Scalar::all(100));\r
+ Mat image; gen(image, 1, 4, CV_32FC2, Scalar::all(0), Scalar::all(100));\r
+ Mat rvec, tvec;\r
gpu::solvePnPRansac(object, image, Mat::eye(3, 3, CV_32F), Mat(), rvec, tvec);\r
}\r
\r
{\r
InitSolvePnpRansac();\r
\r
- for (int num_points = 5000; num_points <= 300000; num_points = int(num_points * 3.76))
- {
- SUBTEST << "num_points " << num_points;
-
- Mat object; gen(object, 1, num_points, CV_32FC3, Scalar::all(10), Scalar::all(100));
- Mat image; gen(image, 1, num_points, CV_32FC2, Scalar::all(10), Scalar::all(100));
- Mat camera_mat; gen(camera_mat, 3, 3, CV_32F, 0.5, 1);
- camera_mat.at<float>(0, 1) = 0.f;
- camera_mat.at<float>(1, 0) = 0.f;
- camera_mat.at<float>(2, 0) = 0.f;
- camera_mat.at<float>(2, 1) = 0.f;
-
- Mat rvec, tvec;
- const int num_iters = 200;
- const float max_dist = 2.0f;
- vector<int> inliers_cpu, inliers_gpu;
-
- CPU_ON;
- solvePnPRansac(object, image, camera_mat, Mat(), rvec, tvec, false, num_iters,
- max_dist, int(num_points * 0.05), &inliers_cpu);
- CPU_OFF;
-
- GPU_ON;
- gpu::solvePnPRansac(object, image, camera_mat, Mat(), rvec, tvec, false, num_iters,
- max_dist, int(num_points * 0.05), &inliers_gpu);
+ for (int num_points = 5000; num_points <= 300000; num_points = int(num_points * 3.76))\r
+ {\r
+ SUBTEST << "num_points " << num_points;\r
+\r
+ Mat object; gen(object, 1, num_points, CV_32FC3, Scalar::all(10), Scalar::all(100));\r
+ Mat image; gen(image, 1, num_points, CV_32FC2, Scalar::all(10), Scalar::all(100));\r
+ Mat camera_mat; gen(camera_mat, 3, 3, CV_32F, 0.5, 1);\r
+ camera_mat.at<float>(0, 1) = 0.f;\r
+ camera_mat.at<float>(1, 0) = 0.f;\r
+ camera_mat.at<float>(2, 0) = 0.f;\r
+ camera_mat.at<float>(2, 1) = 0.f;\r
+\r
+ Mat rvec, tvec;\r
+ const int num_iters = 200;\r
+ const float max_dist = 2.0f;\r
+ vector<int> inliers_cpu, inliers_gpu;\r
+\r
+ CPU_ON;\r
+ solvePnPRansac(object, image, camera_mat, Mat(), rvec, tvec, false, num_iters, \r
+ max_dist, int(num_points * 0.05), inliers_cpu);\r
+ CPU_OFF;\r
+\r
+ GPU_ON;\r
+ gpu::solvePnPRansac(object, image, camera_mat, Mat(), rvec, tvec, false, num_iters,\r
+ max_dist, int(num_points * 0.05), &inliers_gpu);\r
GPU_OFF;\r
}\r
}
\ No newline at end of file