OpenCV Q&A Forum - RSS feedhttp://answers.opencv.org/questions/OpenCV answersenCopyright <a href="http://www.opencv.org">OpenCV foundation</a>, 2012-2018.Mon, 30 Mar 2015 02:41:26 -05003D coordinates of two points in room and angle between themhttp://answers.opencv.org/question/58641/3d-coordinates-of-two-points-in-room-and-angle-between-them/ I have a room with 4 cameras. Each camera is in an upper corner in this room. (non-parallel stereo!)<br>
I will have different points which can be detected with these cameras. Let's assume there are only two.<br>
Now my question is as follow:<br>
How can I calibrate all **4 cameras** so I can determine real world coordinates of each point?<br>
After I will find out where the points are (X1/Y1/Z1) and (X2/Y2/Z2) I will be able to determine the angle between them but this is not the problem part.<br>
<br>
My assumtion is this like:<br>
- I thought to calibrate each pair of cams (i.e. 1 <-> 2 <-> 3 <-> 4 <-> 1)
- with stereoCalibrate I would get rvec, tvec and then the fundamental matrix
- I thought to simply use the chessboard which would be seen with every camera at the same time
- after getting rvec, tvec, F I could reproject a 2D Point from every image (cam-1, cam-2 a.s.o.) and I could verify if every single reprojection is the same in 3D
<br>
It will be very helpful for me to know if my idea to solve my problem is correct and where are the aspects which can be done more easier and more correct.
P.S.: I have done homography for just 2D and with Z=0 but the problem here is more complex for me.Sun, 29 Mar 2015 15:46:59 -0500http://answers.opencv.org/question/58641/3d-coordinates-of-two-points-in-room-and-angle-between-them/Answer by FooBar for <p>I have a room with 4 cameras. Each camera is in an upper corner in this room. (non-parallel stereo!)<br/>
I will have different points which can be detected with these cameras. Let's assume there are only two.<br/>
Now my question is as follow:<br/>
How can I calibrate all <strong>4 cameras</strong> so I can determine real world coordinates of each point?<br/>
After I will find out where the points are (X1/Y1/Z1) and (X2/Y2/Z2) I will be able to determine the angle between them but this is not the problem part.<br/>
<br/>
My assumtion is this like:<br/></p>
<ul>
<li>I thought to calibrate each pair of cams (i.e. 1 <-> 2 <-> 3 <-> 4 <-> 1)</li>
<li>with stereoCalibrate I would get rvec, tvec and then the fundamental matrix</li>
<li>I thought to simply use the chessboard which would be seen with every camera at the same time</li>
<li>after getting rvec, tvec, F I could reproject a 2D Point from every image (cam-1, cam-2 a.s.o.) and I could verify if every single reprojection is the same in 3D
<br/></li>
</ul>
<p>It will be very helpful for me to know if my idea to solve my problem is correct and where are the aspects which can be done more easier and more correct.</p>
<p>P.S.: I have done homography for just 2D and with Z=0 but the problem here is more complex for me.</p>
http://answers.opencv.org/question/58641/3d-coordinates-of-two-points-in-room-and-angle-between-them/?answer=58654#post-id-58654 Your approach with pair wise calibration looks ok, but you loose much of the possible accuracy if you just use two cameras to get the position of a point even if you see it in 3 or even four cameras.
What you probably need is a better optimizer like g2o or ceres. With these solvers, you can optimize the position of all cameras globally. Otherwise, you will have contradictions in your system. With your pairwise calibrations, you should be able to compute the Trafo T14 (from camera 1 to camera 4) as concatenation of T12, T23 and T34. But this product will not be the same as if you just calibrate the offset between Camera 1 and Camera 4.
So you can approach this problem with these methods but this is not the way how motion capture systems work and you will need a better approach if you want to get accurate results. Mon, 30 Mar 2015 02:41:26 -0500http://answers.opencv.org/question/58641/3d-coordinates-of-two-points-in-room-and-angle-between-them/?answer=58654#post-id-58654