# Stereo camera location

**URL:** <https://forum.opencv.org/t/stereo-camera-location/6928>\
**Category:** Uncategorized\
**Created:** [January 1, 2022, 8:06pm UTC](https://forum.opencv.org/t/stereo-camera-location/6928 "2022-01-01T20:06:19Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Just](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/just/32/2649_2.png) [@Just](https://forum.opencv.org/u/Just)\
**Post date:** [January 1, 2022, 8:06pm UTC](https://forum.opencv.org/t/stereo-camera-location/6928/1 "2022-01-01T20:06:19Z")

</div>

Am using a fixed checkerboard pattern to calculate the individual poses of two different cameras on a rigid rig and then plot their individual relative motion. Since the rig is rigid the relative x,y,z motion should be the same. I get good results for x and z but not y as shown in the image below. Does anyone know the reason why the measurements in the y-position are not the same? Note the coordinate system is x- right, y- down, and z- out of the plane.

 ![que](https://us1.discourse-cdn.com/flex020/uploads/opencv/original/2X/4/4fadef86bc3152cc0128d846c361797829dbe8f3.png)

---

<div class="post-metadata">

**Author:** ![darioc](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/darioc/32/3012_2.png) [@darioc](https://forum.opencv.org/u/darioc)\
**Post date:** [January 4, 2022, 11:12am UTC](https://forum.opencv.org/t/stereo-camera-location/6928/2 "2022-01-04T11:12:21Z")

</div>

I think more details are necessary.

- In order to quantify the error, what are the measurement units of the axis in the plot? What x and y represents?
- How do you get the relative pose in other frames after the calibration? Or are you evaluating the relative pose on the same calibration images?

This could be dependant on a higher calibration error in getting the extrinsics, or an estimation error on the relative pose after the calibration, or on a wrong physical setup.  
Very difficult to understand this error without having many more details.

---

<div class="post-metadata">

**Author:** ![Just](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/just/32/2649_2.png) [@Just](https://forum.opencv.org/u/Just)\
**Post date:** [January 12, 2022, 4:12am UTC](https://forum.opencv.org/t/stereo-camera-location/6928/3 "2022-01-12T04:12:10Z")

</div>

The measurements are in pixels. the x-axis just represents a set of measurements while the y axis is the change in the value of the particular cartesian coordinate. The camera calibration has very low reprojection error for each camera. For each set of messurments am calculating the relative pose for each camera as below:

 ![Untitled](https://us1.discourse-cdn.com/flex020/uploads/opencv/original/2X/d/d7e36e233bc7720633fec6d040449be3854c6bd4.png)

From there am extracting the change in x,y,z of the camera position which should be the same for each coordinate but somehow the y-coordinate is not consistent. Note that am getting the pose of the camera from a checkerboard pattern using solvePNP. I have no worries about the calibration or pose calculation.

---

<div class="post-metadata">

**Author:** ![crackwitz](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/crackwitz/32/14_2.png) [@crackwitz](https://forum.opencv.org/u/crackwitz)\
**Post date:** [January 12, 2022, 10:16am UTC](https://forum.opencv.org/t/stereo-camera-location/6928/4 "2022-01-12T10:16:32Z")

</div>

I don’t see what might be going on so allow me to suggest a generic approach.

you probably tried to place everything exactly and aligned well… yet there will be small imperfections.

to debug this… ruin it all! make it messy. put things at weird angles. then you’ll see where the neatness hides mistakes in the math (if there are any).

---

<div class="post-metadata">

**Author:** ![darioc](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/darioc/32/3012_2.png) [@darioc](https://forum.opencv.org/u/darioc)\
**Post date:** [January 12, 2022, 11:35am UTC](https://forum.opencv.org/t/stereo-camera-location/6928/5 "2022-01-12T11:35:02Z")

</div>

I would suggest also to:

- manually look at the chessboard appearance on these frames, to see if the error is that one coming from corner detection in case of strong perspective views (high rotation, stretching of squares, and other perspective effects);
- repeat the process of estimating the pose with an Aruco board, which could increase the achieved precision.
