# Opencv camera calibration

**URL:** <https://forum.opencv.org/t/opencv-camera-calibration/24388>\
**Category:** C++\
**Tags:** calib3d\
**Created:** [March 16, 2026, 2:01am UTC](https://forum.opencv.org/t/opencv-camera-calibration/24388 "2026-03-16T02:01:16Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![GaoDa](https://avatars.discourse-cdn.com/v4/letter/g/eb8c5e/32.png) [@GaoDa](https://forum.opencv.org/u/GaoDa)\
**Post date:** [March 16, 2026, 2:01am UTC](https://forum.opencv.org/t/opencv-camera-calibration/24388/1 "2026-03-16T02:01:16Z")

</div>

As I can see in the offical document，the param discoff of the function “cameracalibration” can only take concern about the tilt angle of the image sensor. If I want to calculate the roll/yaw angle of that，how to do?

---

<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:** [March 16, 2026, 9:57am UTC](https://forum.opencv.org/t/opencv-camera-calibration/24388/2 "2026-03-16T09:57:56Z")

</div>

you speak of _extrinsic_ camera calibration, i.e. estimating its pose in the world.

_intrinsic_ camera calibration does not do that. it only estimates the optical parameters, which are the camera matrix and distortion coefficients.

---

<div class="post-metadata">

**Author:** ![GaoDa](https://avatars.discourse-cdn.com/v4/letter/g/eb8c5e/32.png) [@GaoDa](https://forum.opencv.org/u/GaoDa)\
**Post date:** [March 17, 2026, 8:38am UTC](https://forum.opencv.org/t/opencv-camera-calibration/24388/3 "2026-03-17T08:38:15Z")

</div>

First of all, thanks so much for your reply.

In my current situation, a image sensor is placed at a certain position and is fixed with screws. Its length and width are 43 cm. I want to know if it will have movements in the Roll and Yaw directions when it rotates around a point light source, but I only see the Tilt direction in the camera calibration function parameters.

In other words, I want to add a 3x3 matrix representing the rotation of the imaging sensor itself to the leftmost part of the projection matrix provided by OpenCV. How can I solve for this matrix? Could you please offer some suggestions? Does OpenCV have such a function?

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

Just like the projection matrix shown in the above figure.

---

<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:** [March 18, 2026, 9:50am UTC](https://forum.opencv.org/t/opencv-camera-calibration/24388/4 "2026-03-18T09:50:40Z")

</div>

I have read of formulations where the camera matrix includes skew coefficients with the f\_x and f\_y coefficients to complete the upper left 2 \times 2 part of the camera matrix.

If it’s really just rotation, that should be in the pose matrix (the 3 \times 4 matrix), i.e. extrinsic.

---

<div class="post-metadata">

**Author:** ![GaoDa](https://avatars.discourse-cdn.com/v4/letter/g/eb8c5e/32.png) [@GaoDa](https://forum.opencv.org/u/GaoDa)\
**Post date:** [May 19, 2026, 9:00am UTC](https://forum.opencv.org/t/opencv-camera-calibration/24388/5 "2026-05-19T09:00:43Z")

</div>

So far, after I have acquired a lot of knowledge, it seems that this rotation really needs to be included in the pose matrix (the 3 ×4 matrix).  
I have found such a projection matrix as follows. All the rotation operations are placed in the external matrix.

 ![image](https://us1.discourse-cdn.com/flex020/uploads/opencv/original/2X/7/725815af0770ad6a71e92ee63a3b752c749c72a8.png)

Currently, I am using OpenCV and Ceres to perform optimization, based on a three-dimensional calibration phantom. There are about 10 metal balls in the phantom. The specific positions of these balls relative to the center are known. What algorithm should I use to achieve a good match between the 3D points in space and the 2D points in the image? Could you please give me some suggestions in this regard?

Thanks very much!

---

<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:** [May 19, 2026, 10:13am UTC](https://forum.opencv.org/t/opencv-camera-calibration/24388/6 "2026-05-19T10:13:00Z")

</div>

what algorithm… the problem is probably a numerical optimization. the problem is too complex for closed form solutions.

so pick any optimization algorithm, formulate your minimization problem in whatever way the algorithm needs it, and run the algorithm.

I’m not a mathematician. I am not in a position to advise on such things.
