# Is it a bug for the tutorial camera calibration with ASYMMETRIC CIRCLES GRID pattern?

**URL:** <https://forum.opencv.org/t/is-it-a-bug-for-the-tutorial-camera-calibration-with-asymmetric-circles-grid-pattern/10757>\
**Category:** Uncategorized\
**Created:** [November 1, 2022, 11:38am UTC](https://forum.opencv.org/t/is-it-a-bug-for-the-tutorial-camera-calibration-with-asymmetric-circles-grid-pattern/10757 "2022-11-01T11:38:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Yixun\_Liu](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/yixun_liu/32/5083_2.png) [@Yixun\_Liu](https://forum.opencv.org/u/Yixun_Liu)\
**Post date:** [November 1, 2022, 11:38am UTC](https://forum.opencv.org/t/is-it-a-bug-for-the-tutorial-camera-calibration-with-asymmetric-circles-grid-pattern/10757/1 "2022-11-01T11:38:42Z")

</div>

Hi,  
In camera\_calibration.cpp under the folder tutorial\_code\calib3d\camera\_calibration, for function runCalibration(), the object points coordinates are calculated as:  
objectPoints[0][s.boardSize.width - 1].x = objectPoints[0][0].x + grid\_width;  
in which the grid\_width is calcualted as:  
grid\_width = s.squareSize \* (s.boardSize.width - 1);

The s.squareSize is half of the distance between two neighboring circle center. I think a factor 2.0 is missing for the grid\_width calculation. In another words, the grid\_width should be:  
grid\_width = 2.0 \* s.squareSize \* (s.boardSize.width - 1);

Yixun

---

<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:** [November 1, 2022, 4:05pm UTC](https://forum.opencv.org/t/is-it-a-bug-for-the-tutorial-camera-calibration-with-asymmetric-circles-grid-pattern/10757/2 "2022-11-01T16:05:21Z")

</div>

no, why?

it’s a checkerboard pattern, right?

---

<div class="post-metadata">

**Author:** ![Yixun\_Liu](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/yixun_liu/32/5083_2.png) [@Yixun\_Liu](https://forum.opencv.org/u/Yixun_Liu)\
**Post date:** [November 5, 2022, 7:25am UTC](https://forum.opencv.org/t/is-it-a-bug-for-the-tutorial-camera-calibration-with-asymmetric-circles-grid-pattern/10757/3 "2022-11-05T07:25:40Z")

</div>

This tutorial code can deal with both chessboard and asymmetric circle patterns. For chessboard pattern the code is correct, but for asymmetric circle pattern the grid\_width calculation is not consistent with the object point coordinate calculation.
