Merge pull request #12948 from catree:add_drawFrameAxes
This commit is contained in:
@@ -1,11 +1,7 @@
|
||||
#include <iostream>
|
||||
#include <opencv2/opencv_modules.hpp>
|
||||
#ifdef HAVE_OPENCV_ARUCO
|
||||
#include <opencv2/core.hpp>
|
||||
#include <opencv2/videoio.hpp>
|
||||
#include <opencv2/highgui.hpp>
|
||||
#include <opencv2/calib3d.hpp>
|
||||
#include <opencv2/aruco.hpp>
|
||||
|
||||
using namespace std;
|
||||
using namespace cv;
|
||||
@@ -187,10 +183,3 @@ int main(int argc, char *argv[])
|
||||
|
||||
return 0;
|
||||
}
|
||||
#else
|
||||
int main()
|
||||
{
|
||||
std::cerr << "FATAL ERROR: This sample requires opencv_aruco module (from opencv_contrib)" << std::endl;
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
+2
-12
@@ -1,11 +1,8 @@
|
||||
#include <iostream>
|
||||
#include <opencv2/opencv_modules.hpp>
|
||||
#ifdef HAVE_OPENCV_ARUCO
|
||||
#include <opencv2/core.hpp>
|
||||
#include <opencv2/imgproc.hpp>
|
||||
#include <opencv2/highgui.hpp>
|
||||
#include <opencv2/calib3d.hpp>
|
||||
#include <opencv2/aruco.hpp>
|
||||
|
||||
using namespace std;
|
||||
using namespace cv;
|
||||
@@ -98,8 +95,8 @@ void homographyFromCameraDisplacement(const string &img1Path, const string &img2
|
||||
|
||||
Mat img1_copy_pose = img1.clone(), img2_copy_pose = img2.clone();
|
||||
Mat img_draw_poses;
|
||||
aruco::drawAxis(img1_copy_pose, cameraMatrix, distCoeffs, rvec1, tvec1, 2*squareSize);
|
||||
aruco::drawAxis(img2_copy_pose, cameraMatrix, distCoeffs, rvec2, tvec2, 2*squareSize);
|
||||
drawFrameAxes(img1_copy_pose, cameraMatrix, distCoeffs, rvec1, tvec1, 2*squareSize);
|
||||
drawFrameAxes(img2_copy_pose, cameraMatrix, distCoeffs, rvec2, tvec2, 2*squareSize);
|
||||
hconcat(img1_copy_pose, img2_copy_pose, img_draw_poses);
|
||||
imshow("Chessboard poses", img_draw_poses);
|
||||
|
||||
@@ -202,10 +199,3 @@ int main(int argc, char *argv[])
|
||||
|
||||
return 0;
|
||||
}
|
||||
#else
|
||||
int main()
|
||||
{
|
||||
std::cerr << "FATAL ERROR: This sample requires opencv_aruco module (from opencv_contrib)" << std::endl;
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
#include <opencv2/core.hpp>
|
||||
#include <opencv2/imgproc.hpp>
|
||||
#include <opencv2/highgui.hpp>
|
||||
#include <opencv2/stitching.hpp>
|
||||
|
||||
using namespace std;
|
||||
using namespace cv;
|
||||
|
||||
@@ -1,11 +1,8 @@
|
||||
#include <iostream>
|
||||
#include <opencv2/opencv_modules.hpp>
|
||||
#ifdef HAVE_OPENCV_ARUCO
|
||||
#include <opencv2/core.hpp>
|
||||
#include <opencv2/imgproc.hpp>
|
||||
#include <opencv2/calib3d.hpp>
|
||||
#include <opencv2/highgui.hpp>
|
||||
#include <opencv2/aruco.hpp>
|
||||
|
||||
using namespace std;
|
||||
using namespace cv;
|
||||
@@ -97,10 +94,3 @@ int main(int argc, char *argv[])
|
||||
|
||||
return 0;
|
||||
}
|
||||
#else
|
||||
int main()
|
||||
{
|
||||
std::cerr << "FATAL ERROR: This sample requires opencv_aruco module (from opencv_contrib)" << std::endl;
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1,11 +1,8 @@
|
||||
#include <iostream>
|
||||
#include <opencv2/opencv_modules.hpp>
|
||||
#ifdef HAVE_OPENCV_ARUCO
|
||||
#include <opencv2/core.hpp>
|
||||
#include <opencv2/imgproc.hpp>
|
||||
#include <opencv2/calib3d.hpp>
|
||||
#include <opencv2/highgui.hpp>
|
||||
#include <opencv2/aruco.hpp>
|
||||
|
||||
using namespace std;
|
||||
using namespace cv;
|
||||
@@ -121,7 +118,7 @@ void poseEstimationFromCoplanarPoints(const string &imgPath, const string &intri
|
||||
//! [display-pose]
|
||||
Mat rvec;
|
||||
Rodrigues(R, rvec);
|
||||
aruco::drawAxis(img_pose, cameraMatrix, distCoeffs, rvec, tvec, 2*squareSize);
|
||||
drawFrameAxes(img_pose, cameraMatrix, distCoeffs, rvec, tvec, 2*squareSize);
|
||||
imshow("Pose from coplanar points", img_pose);
|
||||
waitKey();
|
||||
//! [display-pose]
|
||||
@@ -156,10 +153,3 @@ int main(int argc, char *argv[])
|
||||
|
||||
return 0;
|
||||
}
|
||||
#else
|
||||
int main()
|
||||
{
|
||||
std::cerr << "FATAL ERROR: This sample requires opencv_aruco module (from opencv_contrib)" << std::endl;
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user