OpenCV Q&A Forum - RSS feedhttp://answers.opencv.org/questions/OpenCV answersenCopyright <a href="http://www.opencv.org">OpenCV foundation</a>, 2012-2018.Fri, 01 Jun 2018 00:14:14 -0500Improve accuracy about calculation of transformationhttp://answers.opencv.org/question/192592/improve-accuracy-about-calculation-of-transformation/ I'm trying to get a rigid transformation from a model body to a camera center(The model was binded on the camera.So the transformation between them is rigid.In fact,it's a OptiTrack model binded on a Kinect v1).The model body defined a coordinate system called `BODY`.The camera defined a coordinate system called `CAM`.The aruco marker defined a coordinate system called `MARKER`.
The OptiTrack SDK give me the high precision transformation from `BODY` to `MARKER`,marked as `tf_b2m`.I'm using opencv `solvePnP` to get the transformation from `MARKER` to `CAM`,marked as `tf_m2c`.So i could get the transformation from `BODY` to `CAM` `tf_b2c=tf_m2c*tf_b2m`.
Theoretically,the `tf_b2c` should be a constant transformation.But i get about `(+-10mm,+-5mm,+-2mm)` in translation vector,`(+-5 degree,+-1 degree,+-0.5 degree)` in rotation euler angle.
Now i think the such big error because of `solvePnP` or `camera calibration`.I'm using Kinect v1 with resolution `640x480`.And i'm using the opencv 3.4.0 to calibrate the Kinect several times and get stable intrinsic parameters.
Please give some help about improve accuracy of camera calibration or solvePnP.
And any idea is appreciated.
Thanks a lot!Wed, 30 May 2018 03:52:52 -0500http://answers.opencv.org/question/192592/improve-accuracy-about-calculation-of-transformation/Comment by zdczdcc for <p>I'm trying to get a rigid transformation from a model body to a camera center(The model was binded on the camera.So the transformation between them is rigid.In fact,it's a OptiTrack model binded on a Kinect v1).The model body defined a coordinate system called <code>BODY</code>.The camera defined a coordinate system called <code>CAM</code>.The aruco marker defined a coordinate system called <code>MARKER</code>.</p>
<p>The OptiTrack SDK give me the high precision transformation from <code>BODY</code> to <code>MARKER</code>,marked as <code>tf_b2m</code>.I'm using opencv <code>solvePnP</code> to get the transformation from <code>MARKER</code> to <code>CAM</code>,marked as <code>tf_m2c</code>.So i could get the transformation from <code>BODY</code> to <code>CAM</code> <code>tf_b2c=tf_m2c*tf_b2m</code>.</p>
<p>Theoretically,the <code>tf_b2c</code> should be a constant transformation.But i get about <code>(+-10mm,+-5mm,+-2mm)</code> in translation vector,<code>(+-5 degree,+-1 degree,+-0.5 degree)</code> in rotation euler angle.</p>
<p>Now i think the such big error because of <code>solvePnP</code> or <code>camera calibration</code>.I'm using Kinect v1 with resolution <code>640x480</code>.And i'm using the opencv 3.4.0 to calibrate the Kinect several times and get stable intrinsic parameters.
Please give some help about improve accuracy of camera calibration or solvePnP.</p>
<p>And any idea is appreciated.
Thanks a lot!</p>
http://answers.opencv.org/question/192592/improve-accuracy-about-calculation-of-transformation/?comment=192739#post-id-192739Hi,ya.Hi Tetragramm.Thanks for your help!I've solved the problem.The reason is that the OptiTrack sent me worse track result with highlight face on the Kinect.Finally,i used the Kinect v1,calibrated by OpenCV 3.4.0,in 640x480 resolution,detected aruco markers(modified the algorithm by myself) get about `(+-3mm,+-1mm,+-0.5mm)` and `(+-0.3 degree,+-0.2 degree,+-0.3 degree)`.Hope could help someone.Fri, 01 Jun 2018 00:07:49 -0500http://answers.opencv.org/question/192592/improve-accuracy-about-calculation-of-transformation/?comment=192739#post-id-192739Comment by zdczdcc for <p>I'm trying to get a rigid transformation from a model body to a camera center(The model was binded on the camera.So the transformation between them is rigid.In fact,it's a OptiTrack model binded on a Kinect v1).The model body defined a coordinate system called <code>BODY</code>.The camera defined a coordinate system called <code>CAM</code>.The aruco marker defined a coordinate system called <code>MARKER</code>.</p>
<p>The OptiTrack SDK give me the high precision transformation from <code>BODY</code> to <code>MARKER</code>,marked as <code>tf_b2m</code>.I'm using opencv <code>solvePnP</code> to get the transformation from <code>MARKER</code> to <code>CAM</code>,marked as <code>tf_m2c</code>.So i could get the transformation from <code>BODY</code> to <code>CAM</code> <code>tf_b2c=tf_m2c*tf_b2m</code>.</p>
<p>Theoretically,the <code>tf_b2c</code> should be a constant transformation.But i get about <code>(+-10mm,+-5mm,+-2mm)</code> in translation vector,<code>(+-5 degree,+-1 degree,+-0.5 degree)</code> in rotation euler angle.</p>
<p>Now i think the such big error because of <code>solvePnP</code> or <code>camera calibration</code>.I'm using Kinect v1 with resolution <code>640x480</code>.And i'm using the opencv 3.4.0 to calibrate the Kinect several times and get stable intrinsic parameters.
Please give some help about improve accuracy of camera calibration or solvePnP.</p>
<p>And any idea is appreciated.
Thanks a lot!</p>
http://answers.opencv.org/question/192592/improve-accuracy-about-calculation-of-transformation/?comment=192740#post-id-192740Hi Tetragramm,the kinect v1's IFOV=0.095875.The IFOV covers about `500 mm * 0.095875 degree / 62 degree=0.773185mm`.I want to make the x-axis'e error smaller.Is it necessary to use a high resolution camera or other method.Fri, 01 Jun 2018 00:14:14 -0500http://answers.opencv.org/question/192592/improve-accuracy-about-calculation-of-transformation/?comment=192740#post-id-192740Comment by Tetragramm for <p>I'm trying to get a rigid transformation from a model body to a camera center(The model was binded on the camera.So the transformation between them is rigid.In fact,it's a OptiTrack model binded on a Kinect v1).The model body defined a coordinate system called <code>BODY</code>.The camera defined a coordinate system called <code>CAM</code>.The aruco marker defined a coordinate system called <code>MARKER</code>.</p>
<p>The OptiTrack SDK give me the high precision transformation from <code>BODY</code> to <code>MARKER</code>,marked as <code>tf_b2m</code>.I'm using opencv <code>solvePnP</code> to get the transformation from <code>MARKER</code> to <code>CAM</code>,marked as <code>tf_m2c</code>.So i could get the transformation from <code>BODY</code> to <code>CAM</code> <code>tf_b2c=tf_m2c*tf_b2m</code>.</p>
<p>Theoretically,the <code>tf_b2c</code> should be a constant transformation.But i get about <code>(+-10mm,+-5mm,+-2mm)</code> in translation vector,<code>(+-5 degree,+-1 degree,+-0.5 degree)</code> in rotation euler angle.</p>
<p>Now i think the such big error because of <code>solvePnP</code> or <code>camera calibration</code>.I'm using Kinect v1 with resolution <code>640x480</code>.And i'm using the opencv 3.4.0 to calibrate the Kinect several times and get stable intrinsic parameters.
Please give some help about improve accuracy of camera calibration or solvePnP.</p>
<p>And any idea is appreciated.
Thanks a lot!</p>
http://answers.opencv.org/question/192592/improve-accuracy-about-calculation-of-transformation/?comment=192736#post-id-192736My question is, what is the instantaneous FOV of the camera? IE: if it's 60 degrees total FOV, with a resolution of 640, then the IFOV is 0.093 degrees. And also, what pixel spot size on the marker? IE: at that distance, the IFOV covers x millimeters, or whatever unit is appropriate.Thu, 31 May 2018 16:57:29 -0500http://answers.opencv.org/question/192592/improve-accuracy-about-calculation-of-transformation/?comment=192736#post-id-192736Comment by ya_ocv_user for <p>I'm trying to get a rigid transformation from a model body to a camera center(The model was binded on the camera.So the transformation between them is rigid.In fact,it's a OptiTrack model binded on a Kinect v1).The model body defined a coordinate system called <code>BODY</code>.The camera defined a coordinate system called <code>CAM</code>.The aruco marker defined a coordinate system called <code>MARKER</code>.</p>
<p>The OptiTrack SDK give me the high precision transformation from <code>BODY</code> to <code>MARKER</code>,marked as <code>tf_b2m</code>.I'm using opencv <code>solvePnP</code> to get the transformation from <code>MARKER</code> to <code>CAM</code>,marked as <code>tf_m2c</code>.So i could get the transformation from <code>BODY</code> to <code>CAM</code> <code>tf_b2c=tf_m2c*tf_b2m</code>.</p>
<p>Theoretically,the <code>tf_b2c</code> should be a constant transformation.But i get about <code>(+-10mm,+-5mm,+-2mm)</code> in translation vector,<code>(+-5 degree,+-1 degree,+-0.5 degree)</code> in rotation euler angle.</p>
<p>Now i think the such big error because of <code>solvePnP</code> or <code>camera calibration</code>.I'm using Kinect v1 with resolution <code>640x480</code>.And i'm using the opencv 3.4.0 to calibrate the Kinect several times and get stable intrinsic parameters.
Please give some help about improve accuracy of camera calibration or solvePnP.</p>
<p>And any idea is appreciated.
Thanks a lot!</p>
http://answers.opencv.org/question/192592/improve-accuracy-about-calculation-of-transformation/?comment=192652#post-id-192652Always need to consider relative error. I don't know the distance of your object from camera, but 5 degree doesn't seem very large. I remember that when I tried this task, I saw complains about precision. Search existing answers on the topic and you will be able to estimate the state of the art for this function. You can start looking to the right side of the screen right now. Also calibrateCamera() returns reprojection error. This is a guidance on what you can expect from this method.Thu, 31 May 2018 01:24:28 -0500http://answers.opencv.org/question/192592/improve-accuracy-about-calculation-of-transformation/?comment=192652#post-id-192652Comment by zdczdcc for <p>I'm trying to get a rigid transformation from a model body to a camera center(The model was binded on the camera.So the transformation between them is rigid.In fact,it's a OptiTrack model binded on a Kinect v1).The model body defined a coordinate system called <code>BODY</code>.The camera defined a coordinate system called <code>CAM</code>.The aruco marker defined a coordinate system called <code>MARKER</code>.</p>
<p>The OptiTrack SDK give me the high precision transformation from <code>BODY</code> to <code>MARKER</code>,marked as <code>tf_b2m</code>.I'm using opencv <code>solvePnP</code> to get the transformation from <code>MARKER</code> to <code>CAM</code>,marked as <code>tf_m2c</code>.So i could get the transformation from <code>BODY</code> to <code>CAM</code> <code>tf_b2c=tf_m2c*tf_b2m</code>.</p>
<p>Theoretically,the <code>tf_b2c</code> should be a constant transformation.But i get about <code>(+-10mm,+-5mm,+-2mm)</code> in translation vector,<code>(+-5 degree,+-1 degree,+-0.5 degree)</code> in rotation euler angle.</p>
<p>Now i think the such big error because of <code>solvePnP</code> or <code>camera calibration</code>.I'm using Kinect v1 with resolution <code>640x480</code>.And i'm using the opencv 3.4.0 to calibrate the Kinect several times and get stable intrinsic parameters.
Please give some help about improve accuracy of camera calibration or solvePnP.</p>
<p>And any idea is appreciated.
Thanks a lot!</p>
http://answers.opencv.org/question/192592/improve-accuracy-about-calculation-of-transformation/?comment=192643#post-id-192643I think + - 2mm is good,too.But the x-axis,y-axis has big errors.How could you get such precision(+ - 2mm)?By using industrial undistorted camera calibrated by the factory or normal camera calibrated by yourself.And you got such precision in 640x480 or higher image resolution.I'm confused about this.Wed, 30 May 2018 21:05:52 -0500http://answers.opencv.org/question/192592/improve-accuracy-about-calculation-of-transformation/?comment=192643#post-id-192643Comment by ya_ocv_user for <p>I'm trying to get a rigid transformation from a model body to a camera center(The model was binded on the camera.So the transformation between them is rigid.In fact,it's a OptiTrack model binded on a Kinect v1).The model body defined a coordinate system called <code>BODY</code>.The camera defined a coordinate system called <code>CAM</code>.The aruco marker defined a coordinate system called <code>MARKER</code>.</p>
<p>The OptiTrack SDK give me the high precision transformation from <code>BODY</code> to <code>MARKER</code>,marked as <code>tf_b2m</code>.I'm using opencv <code>solvePnP</code> to get the transformation from <code>MARKER</code> to <code>CAM</code>,marked as <code>tf_m2c</code>.So i could get the transformation from <code>BODY</code> to <code>CAM</code> <code>tf_b2c=tf_m2c*tf_b2m</code>.</p>
<p>Theoretically,the <code>tf_b2c</code> should be a constant transformation.But i get about <code>(+-10mm,+-5mm,+-2mm)</code> in translation vector,<code>(+-5 degree,+-1 degree,+-0.5 degree)</code> in rotation euler angle.</p>
<p>Now i think the such big error because of <code>solvePnP</code> or <code>camera calibration</code>.I'm using Kinect v1 with resolution <code>640x480</code>.And i'm using the opencv 3.4.0 to calibrate the Kinect several times and get stable intrinsic parameters.
Please give some help about improve accuracy of camera calibration or solvePnP.</p>
<p>And any idea is appreciated.
Thanks a lot!</p>
http://answers.opencv.org/question/192592/improve-accuracy-about-calculation-of-transformation/?comment=192619#post-id-192619You think + - 2 mm and + - 0.5 degree are big errors? I worked with solvePnP and your values look typical.Wed, 30 May 2018 07:42:11 -0500http://answers.opencv.org/question/192592/improve-accuracy-about-calculation-of-transformation/?comment=192619#post-id-192619