# Calibrate projector without chess board

**URL:** <https://forum.opencv.org/t/calibrate-projector-without-chess-board/5015>\
**Category:** Uncategorized\
**Tags:** calib3d\
**Created:** [September 1, 2021, 9:38am UTC](https://forum.opencv.org/t/calibrate-projector-without-chess-board/5015 "2021-09-01T09:38:10Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Egon](https://avatars.discourse-cdn.com/v4/letter/e/3ec8ea/32.png) [@Egon](https://forum.opencv.org/u/Egon)\
**Post date:** [September 1, 2021, 9:38am UTC](https://forum.opencv.org/t/calibrate-projector-without-chess-board/5015/1 "2021-09-01T09:38:10Z")

</div>

Hi.  
I would like to calibrate a projector to get a undistorted image on surface.  
It is not possible to project a chess board because of many shadowed areas.  
I have projected a grid 5x7 and measured the distortion manually in pixel for x any y. (See table below)

Now I need a way to calculate the InputArrays cameraMatrix and distCoeffs which are used in cv::undistort(…) -function.

Is there a way (in C++) to do this with the available parameters in table?

Thanks Egon

| X | Y | deviation X | deviation y |
| --- | --- | --- | --- |
| 118 | 146 | -4 | -4 |
| 345 | 146 | -3,5 | -1 |
| 572 | 146 | -1 | 0 |
| 799 | 146 | 1 | -1 |
| 1026 | 146 | 0 | -2,5 |
| 1253 | 146 | -2 | 2 |
| 1480 | 146 | -2 | 0,5 |
| 118 | 373 | 0,5 | -4,5 |
| 345 | 373 | 1,5 | 1 |
| 572 | 373 | 3,5 | 3 |
| 799 | 373 | 5 | -1 |
| 1026 | 373 | 4,5 | -3,5 |
| 1253 | 373 | 2 | 0,5 |
| 1480 | 373 | 1 | 2,5 |
| 118 | 600 | 0 | -4 |
| 345 | 600 | 0 | 4 |
| 572 | 600 | 0 | 4,5 |
| 799 | 600 | 0 | 0 |
| 1026 | 600 | 0 | -6 |
| 1253 | 600 | 0 | -1,5 |
| 1480 | 600 | 0 | 0,5 |
| 118 | 827 | -0,5 | -2 |
| 345 | 827 | -2,5 | 3,5 |
| 572 | 827 | -3,5 | 3 |
| 799 | 827 | -5,5 | -0,5 |
| 1026 | 827 | -5 | -4 |
| 1253 | 827 | -2,5 | -1,5 |
| 1480 | 827 | -2 | -0,5 |
| 118 | 1054 | -2,5 | 1 |
| 345 | 1054 | -2,5 | 3 |
| 572 | 1054 | -2,5 | 1,5 |
| 799 | 1054 | -2,5 | -2 |
| 1026 | 1054 | -2,5 | -2 |
| 1253 | 1054 | -2 | 0 |
| 1480 | 1054 | -3 | -3,5 |

---

<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:** [September 1, 2021, 11:40am UTC](https://forum.opencv.org/t/calibrate-projector-without-chess-board/5015/2 "2021-09-01T11:40:56Z")

</div>

I’d recommend plotting that data, with some exaggeration, to see what’s going on.

---

<div class="post-metadata">

**Author:** ![Egon](https://avatars.discourse-cdn.com/v4/letter/e/3ec8ea/32.png) [@Egon](https://forum.opencv.org/u/Egon)\
**Post date:** [September 1, 2021, 12:03pm UTC](https://forum.opencv.org/t/calibrate-projector-without-chess-board/5015/3 "2021-09-01T12:03:06Z")

</div>

The numbers in the table are only an example. They may not be correct.  
My question is how can I generate “cameraMatrix” and “distCoeffs” from such a table.

---

<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:** [September 1, 2021, 2:34pm UTC](https://forum.opencv.org/t/calibrate-projector-without-chess-board/5015/4 "2021-09-01T14:34:28Z")

</div>

that is _one view_.

that’s certainly insufficient to calculate a camera matrix.
