# How to generate calibrationParameters.yml for pointcloud.cpp file?

**URL:** <https://forum.opencv.org/t/how-to-generate-calibrationparameters-yml-for-pointcloud-cpp-file/4485>\
**Category:** C++\
**Tags:** calib3d\
**Created:** [July 27, 2021, 8:46am UTC](https://forum.opencv.org/t/how-to-generate-calibrationparameters-yml-for-pointcloud-cpp-file/4485 "2021-07-27T08:46:28Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ZhangAlex](https://avatars.discourse-cdn.com/v4/letter/z/7ba0ec/32.png) [@ZhangAlex](https://forum.opencv.org/u/ZhangAlex)\
**Post date:** [July 27, 2021, 8:46am UTC](https://forum.opencv.org/t/how-to-generate-calibrationparameters-yml-for-pointcloud-cpp-file/4485/1 "2021-07-27T08:46:28Z")

</div>

In opencv , I read a few camera clibration .cpp files , and projector calibration .cpp files , and their calibration results are different ( probably because of different image\_size , square\_size , and so on ) .  
Can someone tell me , which .cpp file in Opencv , or a website link , can generate the calibrationParameters.yml file , for the pointcloud.cpp file ( here … structured\_light/samples/pointcloud.cpp )  
Thank for your reply very 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:** [July 27, 2021, 6:03pm UTC](https://forum.opencv.org/t/how-to-generate-calibrationparameters-yml-for-pointcloud-cpp-file/4485/2 "2021-07-27T18:03:48Z")

</div>

what cameras are you using? brand, model, full sensor resolution, field of view (diagonal/horizontal/vertical), …

those parameters can’t simply be “generated” from nothing.

---

<div class="post-metadata">

**Author:** ![ZhangAlex](https://avatars.discourse-cdn.com/v4/letter/z/7ba0ec/32.png) [@ZhangAlex](https://forum.opencv.org/u/ZhangAlex)\
**Post date:** [July 28, 2021, 8:21am UTC](https://forum.opencv.org/t/how-to-generate-calibrationparameters-yml-for-pointcloud-cpp-file/4485/3 "2021-07-28T08:21:59Z")

</div>

I thank the calibrationParameters.yml file , would be the output of a C++ program .  
Also , I guess it should a kind of camera calibration program . But I do not know how to get it .

---

<div class="post-metadata">

**Author:** ![berak](https://avatars.discourse-cdn.com/v4/letter/b/85f322/32.png) [@berak](https://forum.opencv.org/u/berak)\
**Post date:** [July 28, 2021, 8:36am UTC](https://forum.opencv.org/t/how-to-generate-calibrationparameters-yml-for-pointcloud-cpp-file/4485/4 "2021-07-28T08:36:43Z")

</div>

the gray code method works with stereo cameras,  
you’re probably expected to [run a stereo calibration](https://github.com/opencv/opencv/blob/master/samples/cpp/stereo_calib.cpp) before,  
which will calculate the missing params

---

<div class="post-metadata">

**Author:** ![ZhangAlex](https://avatars.discourse-cdn.com/v4/letter/z/7ba0ec/32.png) [@ZhangAlex](https://forum.opencv.org/u/ZhangAlex)\
**Post date:** [August 18, 2021, 8:58am UTC](https://forum.opencv.org/t/how-to-generate-calibrationparameters-yml-for-pointcloud-cpp-file/4485/5 "2021-08-18T08:58:15Z")

</div>

berak Moderator :  
Thanks for your reply .  
I will try to do it .  
Thanks again !
