Get translation and rotation matrix of an object
来源:互联网 发布:Mac软件删除 编辑:程序博客网 时间:2024/05/29 18:03
转自:https://groups.google.com/forum/#!topic/android-opencv/0ImAjpAL5t4
cvFindExtrinsicCameraParams2 is the old C name of the function. In C++ and Java API it is named solvePnP
Here is a usage example from Java API tests:Mat intrinsics = Mat.eye(3, 3, CvType.CV_32F);intrinsics.put(0, 0, 400);intrinsics.put(1, 1, 400);intrinsics.put(0, 2, 640 / 2);intrinsics.put(1, 2, 480 / 2);List<Point3> points3d = new ArrayList<Point3>();List<Point> points2d = new ArrayList<Point>();int minPnpPointsNum = 4;for (int i = 0; i < minPnpPointsNum; i++) { double x = Math.random() * 100 - 50; double y = Math.random() * 100 - 50; points2d.add(new Point(x, y)); points3d.add(new Point3(0, y, x));}Mat rvec = new Mat();Mat tvec = new Mat();Calib3d.solvePnP(points3d, points2d, intrinsics, new Mat(), rvec, tvec);Mat truth_rvec = new Mat(3, 1, CvType.CV_64F);truth_rvec.put(0, 0, 0, Math.PI / 2, 0);Mat truth_tvec = new Mat(3, 1, CvType.CV_64F);truth_tvec.put(0, 0, -320, -240, 400);assertMatEqual(truth_rvec, rvec, EPS);assertMatEqual(truth_tvec, tvec, EPS);
0 0
- Get translation and rotation matrix of an object
- To get the View matrix from the rotation,translation,scale
- Armadillo sparse matrix get the index of an element
- How to get the published properties of an persistent object
- Smooth Rotation of Object in UNITY
- potential leak of an object allocated and stored into ...
- Rotation Matrix
- getFiled of an object
- The Mathematics of the 3D Rotation Matrix
- 从Homography矩阵得到旋转和平移量(From Homography to Rotation and Translation)
- No. 47 - Search in a Rotation of an Array
- To get the tree list of the objects on which an object depends
- How do I get the name of an object's type in JavaScript
- An Image Viewer with Lossless Rotation, EXIF and Other Goodies
- Object reference not set to an instance of an object.
- Object reference not set to an instance of an object.
- Object reference not set to an instance of an object
- Matrix转rotation
- MYSQL explain详解
- c++ 内联成员函数
- 指定字符串长度的复制
- [360] 《如何保持电力接触网与受电弓亲密接触》
- 一位ACMer过来人的心得
- Get translation and rotation matrix of an object
- 黑马程序员---Objective-C Foundation框架学习笔记之二
- IOS开发—block对外部变量的内存管理
- Ruby正则表达式的一个例子
- windows下DNS手动修改无效
- 动态规划之深入灵魂的解读(非常好)
- 十款最出色的PHP安全开发库中文详细介绍
- linux如何关闭selinux
- DataColumn.Expression 语法