# How to obtain a high precision depth map

**URL:** <https://community.stereolabs.com/t/how-to-obtain-a-high-precision-depth-map/713>\
**Category:** Uncategorized\
**Created:** [December 3, 2021, 1:32pm UTC](https://community.stereolabs.com/t/how-to-obtain-a-high-precision-depth-map/713 "2021-12-03T13:32:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![LY-leyou](https://community.stereolabs.com/letter_avatar_proxy/v4/letter/l/4af34b/32.png) [@LY-leyou](https://community.stereolabs.com/u/LY-leyou)\
**Post date:** [December 3, 2021, 1:32pm UTC](https://community.stereolabs.com/t/how-to-obtain-a-high-precision-depth-map/713/1 "2021-12-03T13:32:10Z")

</div>

What do the numbers in the array information printed out by the depth map mean? The array I printed out is all integers, ranging from 0 to 11, which feels wrong. Does the number represent the distance between the camera and the object? If so, what is its unit? Is there a good way to get a high accuracy depth map?

---

<div class="post-metadata">

**Author:** ![adujardin](https://community.stereolabs.com/user_avatar/community.stereolabs.com/adujardin/32/4125_2.png) [@adujardin](https://community.stereolabs.com/u/adujardin)\
**Post date:** [December 3, 2021, 1:36pm UTC](https://community.stereolabs.com/t/how-to-obtain-a-high-precision-depth-map/713/2 "2021-12-03T13:36:41Z")

</div>

To get the depth map values you should use [`retrieveMeasure` function](https://www.stereolabs.com/docs/api/classsl_1_1Camera.html#a9e0773c0c14ce5156c1fa2fde501c13e), I suspect you displayed value from the normalized depth map image for display ([`retrieveImage`](https://www.stereolabs.com/docs/api/classsl_1_1Camera.html#a01dce4f0af6f8959a9c974ffaca656b5)).

The unit can be set with [`InitParameters::coordinate_units`](https://www.stereolabs.com/docs/api/structsl_1_1InitParameters.html#a75cb1e715c1be19c591d21fa2591b421) passed to the Camera::open function. The default is millimeters.

---

<div class="post-metadata">

**Author:** ![LY-leyou](https://community.stereolabs.com/letter_avatar_proxy/v4/letter/l/4af34b/32.png) [@LY-leyou](https://community.stereolabs.com/u/LY-leyou)\
**Post date:** [December 20, 2021, 2:21am UTC](https://community.stereolabs.com/t/how-to-obtain-a-high-precision-depth-map/713/3 "2021-12-20T02:21:39Z")

</div>

Ok, thank you. I want to merge the RGB image with the depth map of the image to make a new image. Now the question is how can the depth map be saved with high precision? Is there a code to save both the depth information and RGB information of a frame directly from the video?
