fixed build problems on Windows

This commit is contained in:
Vadim Pisarevsky
2011-04-18 15:14:32 +00:00
parent e58de551c5
commit 9a991a2e10
17 changed files with 60 additions and 58 deletions

View File

@@ -118,7 +118,7 @@ int main(int ac, char ** av)
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),

View File

@@ -54,7 +54,7 @@ int main( int /*argc*/, char** /*argv*/ )
kmeans(points, clusterCount, labels,
TermCriteria( CV_TERMCRIT_EPS+CV_TERMCRIT_ITER, 10, 1.0),
3, KMEANS_PP_CENTERS, &centers);
3, KMEANS_PP_CENTERS, centers);
img = Scalar::all(0);

View File

@@ -230,7 +230,7 @@ StereoCalib(const vector<string>& imagelist, Size boardSize, bool useCalibrated=
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() )

View File

@@ -178,7 +178,7 @@ int main(int argc, char** argv)
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);

View File

@@ -182,7 +182,7 @@ int main(int ac, char ** av)
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;

View File

@@ -41,7 +41,7 @@ void OpenClose(int, void*)
cv::gpu::morphologyEx(src, dst, CV_MOP_OPEN, element);
else
cv::gpu::morphologyEx(src, dst, CV_MOP_CLOSE, element);
imshow("Open/Close",dst);
imshow("Open/Close",(Mat)dst);
}
// callback function for erode/dilate trackbar
@@ -54,7 +54,7 @@ void ErodeDilate(int, void*)
cv::gpu::erode(src, dst, element);
else
cv::gpu::dilate(src, dst, element);
imshow("Erode/Dilate",dst);
imshow("Erode/Dilate",(Mat)dst);
}

View File

@@ -784,10 +784,10 @@ TEST(projectPoints)
void InitSolvePnpRansac()
{
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;
{
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;
gpu::solvePnPRansac(object, image, Mat::eye(3, 3, CV_32F), Mat(), rvec, tvec);
}
@@ -796,31 +796,31 @@ TEST(solvePnPRansac)
{
InitSolvePnpRansac();
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))
{
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);
GPU_OFF;
}
}