# OpenPose 3D reconstruction from saved RGB stereoscopic video

**URL:** <https://forum.opencv.org/t/openpose-3d-reconstruction-from-saved-rgb-stereoscopic-video/4185>\
**Category:** Python\
**Tags:** calib3d, openpose\
**Created:** [July 6, 2021, 3:18am UTC](https://forum.opencv.org/t/openpose-3d-reconstruction-from-saved-rgb-stereoscopic-video/4185 "2021-07-06T03:18:48Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Khalid\_Hussain](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/khalid_hussain/32/2563_2.png) [@Khalid\_Hussain](https://forum.opencv.org/u/Khalid_Hussain)\
**Post date:** [July 6, 2021, 3:18am UTC](https://forum.opencv.org/t/openpose-3d-reconstruction-from-saved-rgb-stereoscopic-video/4185/1 "2021-07-06T03:18:48Z")

</div>

I want to display several (x,y,z) keypoints of several body parts in [OpenPose by CMU](https://github.com/CMU-Perceptual-Computing-Lab/openpose) from a 3D reconstruction of saved, inputted video frames from a synchronized left and right camera. All of the tutorials I have seen seem to only work with developing a 3D reconstruction in real-time & from connected FLIR cameras, which I do not want to do; I would like to use my own videos/image frames. Is this possible in OpenPose, or does it only support a real-time feed from 2+ cameras?

---

<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 6, 2021, 5:36am UTC](https://forum.opencv.org/t/openpose-3d-reconstruction-from-saved-rgb-stereoscopic-video/4185/2 "2021-07-06T05:36:18Z")

</div>

the openpose network(s) you can use in opencv’s dnn run on _single_ images, you don’t need a stereo pair at all.

also they compute only 2d (x,y) landmarks, not 3d points

have a look at [the example code here](https://github.com/opencv/opencv/blob/master/samples/dnn/openpose.cpp)

you probably came [across this](https://github.com/CMU-Perceptual-Computing-Lab/openpose/blob/master/doc/advanced/3d_reconstruction_module.md), but i’m afraid, we can’t help much with it.

---

<div class="post-metadata">

**Author:** ![Khalid\_Hussain](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/khalid_hussain/32/2563_2.png) [@Khalid\_Hussain](https://forum.opencv.org/u/Khalid_Hussain)\
**Post date:** [July 6, 2021, 5:50am UTC](https://forum.opencv.org/t/openpose-3d-reconstruction-from-saved-rgb-stereoscopic-video/4185/3 "2021-07-06T05:50:11Z")

</div>

Yes, I am aware of this, however I wish to utilize stereo pairs to get the z position of someone’s hand, therefore I would need (x,y,z) points for this. I believe a 3d reconstruction from stereo pairs/a disparity map would help achieve this.

---

<div class="post-metadata">

**Author:** ![Khalid\_Hussain](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/khalid_hussain/32/2563_2.png) [@Khalid\_Hussain](https://forum.opencv.org/u/Khalid_Hussain)\
**Post date:** [July 6, 2021, 5:51am UTC](https://forum.opencv.org/t/openpose-3d-reconstruction-from-saved-rgb-stereoscopic-video/4185/4 "2021-07-06T05:51:44Z")

</div>

Apologies, I just saw the edit you made with the extra link - yes, that is exactly what I am trying to reproduce, but not in real-time

---

<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 6, 2021, 5:53am UTC](https://forum.opencv.org/t/openpose-3d-reconstruction-from-saved-rgb-stereoscopic-video/4185/5 "2021-07-06T05:53:32Z")

</div>

i did not dive into the code yet, but they seem to expect a stereo calibration. did you do this before recording your stereo sequences ?

---

<div class="post-metadata">

**Author:** ![Khalid\_Hussain](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/khalid_hussain/32/2563_2.png) [@Khalid\_Hussain](https://forum.opencv.org/u/Khalid_Hussain)\
**Post date:** [July 6, 2021, 6:05am UTC](https://forum.opencv.org/t/openpose-3d-reconstruction-from-saved-rgb-stereoscopic-video/4185/6 "2021-07-06T06:05:05Z")

</div>

Yes, both cameras are calibrated, and I have the intrinsic parameters of both cameras.

---

<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 6, 2021, 6:15am UTC](https://forum.opencv.org/t/openpose-3d-reconstruction-from-saved-rgb-stereoscopic-video/4185/7 "2021-07-06T06:15:37Z")

</div>

there is no 3d network there, right ?  
z is _triangulated_ from 2 2d openpose networks (running on each stereo image pair)

in other words, maybe it could also be done in opencv !

---

<div class="post-metadata">

**Author:** ![Khalid\_Hussain](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/khalid_hussain/32/2563_2.png) [@Khalid\_Hussain](https://forum.opencv.org/u/Khalid_Hussain)\
**Post date:** [July 6, 2021, 6:19am UTC](https://forum.opencv.org/t/openpose-3d-reconstruction-from-saved-rgb-stereoscopic-video/4185/8 "2021-07-06T06:19:13Z")

</div>

Huh, I actually hadn’t considered that, I will have to look into how I can triangulate the position of z for each possible point in space & from each stereo pair in OpenCV; are there any starter code that I can look at that you can suggest?

---

<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 6, 2021, 6:20am UTC](https://forum.opencv.org/t/openpose-3d-reconstruction-from-saved-rgb-stereoscopic-video/4185/9 "2021-07-06T06:20:54Z")

</div>

have not found yet, how/where [the triangulation](https://github.com/CMU-Perceptual-Computing-Lab/openpose/tree/master/src/openpose/3d) is called from …

btw, i find stuff [from mono images](http://andreasaristidou.com/3dMotionReconstruction.html) even more interesting 🙂

---

<div class="post-metadata">

**Author:** ![Khalid\_Hussain](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/khalid_hussain/32/2563_2.png) [@Khalid\_Hussain](https://forum.opencv.org/u/Khalid_Hussain)\
**Post date:** [July 6, 2021, 6:27am UTC](https://forum.opencv.org/t/openpose-3d-reconstruction-from-saved-rgb-stereoscopic-video/4185/10 "2021-07-06T06:27:35Z")

</div>

Okay I will take a look through the repo!
