├── .gitattributes ├── .gitignore ├── .vscode └── settings.json ├── LICENSE ├── README.md ├── _config.yml ├── doc ├── Azure Kinect body tracking joints _ Microsoft Docs.pdf ├── Biomechanical validation of upper-body and lower-body joint movements of kinect motion capture data for rehab treatments.pdf ├── Burger-CameraCalibration-20160516.pdf ├── Investigating the impact of a motion capture system on microsoft kinect v2 recordings.pdf ├── Mean Shift A Robust Approach Toward Feature Space Analysis (2002).pdf ├── Performance analysis of a generalized motion capture system using microsoft kinect 2.0 (2017).pdf ├── Real-Time Human Pose Recognition in Parts from Single Depth Images (2013).pdf ├── Using Kinect to Develop a Smart Meeting Room.pdf ├── Yoga posture recognition by detecting human joint points in real time using microsoft kinect.pdf ├── [1] Arun_least-squares fitting of 3-D point sets.pdf ├── [2] Burger-CameraCalibration-20160516 (Zhang's).pdf ├── [3] Performance analysis of a generalized motion capture system using microsoft kinect 2.0 (2017).pdf ├── [4] Yoga posture recognition by detecting human joint points in real time using microsoft kinect.pdf ├── [doc] Azure Kinect body tracking joints _ Microsoft Docs.pdf ├── [doc] how-to-use_commands.pdf ├── [doc] kinect_specs.pdf ├── abstract_SIGGRAPH2020.pdf ├── arun.pdf ├── gait joint feature based person identification (kinect v2).pdf ├── horn-quat.pdf ├── how-to-use_commands.pdf ├── kinect_documentation.pdf ├── kinect_specs.pdf └── poster_SIGGRAPH2020.pdf ├── lib_k4abt ├── AzureKinectDK_Fw_1.6.102075014.bin ├── libdepthengine.so.2.0 └── libstdc++.so.6 ├── matlab └── extrinsic_calculation │ ├── joints_sync_1.csv │ ├── joints_sync_2.csv │ ├── joints_sync_tf.csv │ ├── output.txt │ └── rt_cal.m ├── res ├── 3_random_min1.gif ├── bodyjoints_labeled.png ├── calibration_stage.png ├── check_confident_devices.png ├── chessboard.png ├── configuration.png ├── flowchart_black.png ├── lighting_master.png ├── occlusion_0.png ├── occlusion_1.png ├── snapshot_2_dev.png ├── snapshot_3_dev.png ├── synced.png ├── test_environment.png └── testsetup.png ├── script ├── increaseusbmb.sh ├── install_kinect_sensor_sdk.sh ├── install_ros_melodic.sh └── opencv_install_mediapipe_google.sh └── src ├── Makefile ├── MultiDeviceCapturer.h ├── colors.h ├── multi.cpp ├── no_trans.cpp ├── one.cpp ├── src (visual studio) ├── kinect_body.cpp ├── kinect_body_test.cpp ├── kinect_body_test.vcxproj ├── kinect_body_test.vcxproj.filters ├── kinect_body_test.vcxproj.user ├── packages.config └── x64 │ ├── Debug │ ├── desktop.ini │ ├── kinect_body_test.log │ ├── kinect_body_test.obj.enc │ ├── kinect_body_test.tlog │ │ ├── CL.command.1.tlog │ │ ├── CL.read.1.tlog │ │ ├── CL.write.1.tlog │ │ ├── desktop.ini │ │ ├── kinect_body_test.lastbuildstate │ │ ├── kinect_body_test.write.1u.tlog │ │ ├── link.command.1.tlog │ │ ├── link.read.1.tlog │ │ └── link.write.1.tlog │ ├── kinect_body_test.vcxproj.CopyComplete │ ├── vc142.idb │ └── vc142.pdb │ └── desktop.ini ├── sync.cpp ├── sync.hpp ├── transformation.h ├── two.cpp └── two.hpp /.gitattributes: -------------------------------------------------------------------------------- 1 | *.onnx filter=lfs diff=lfs merge=lfs -text 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Prerequisites 2 | *.d 3 | 4 | # Compiled Object files 5 | *.slo 6 | *.lo 7 | *.o 8 | *.obj 9 | 10 | # Precompiled Headers 11 | *.gch 12 | *.pch 13 | 14 | # Compiled Dynamic libraries 15 | *.so 16 | *.dylib 17 | *.dll 18 | 19 | # Fortran module files 20 | *.mod 21 | *.smod 22 | 23 | # Compiled Static libraries 24 | *.lai 25 | *.la 26 | *.a 27 | *.lib 28 | 29 | # Executables 30 | *.exe 31 | *.out 32 | *.app 33 | 34 | # dnn model 35 | *.onnx 36 | 37 | # vs code cache 38 | .vscode 39 | 40 | **/Azure-Kinect-Sensor-SDK/** 41 | **/Azure-Kinect-Samples/** -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "python.pythonPath": "/home/jongoh/anaconda3/envs/opencv/bin/python" 3 | } -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 Andy Jeong 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # A Low-Cost Motion Capture System using Synchronized Azure Kinect Systems 2 | 3 | by [Jongoh Jeong (Andy)](mailto:jeong2cu@gmail.com), [Yue Wang (Leo)](mailto:leowang1996@gmail.com), [Professor Mili Shah](mailto:mili.shah@cooper.edu) (Advisor) 4 | 5 | **Abstract** 6 | 7 | Body joint estimation from a single vision system poses limitations in the cases of occlusion and illumination changes, while current motion capture (MOCAP) systems may be expensive. This synchronized Azure Kinect-based MOCAP system serves as a remedy to both of these problems by creating a low-cost, portable, accurate body-tracking system. 8 | 9 | _Keywords_: Motion capture (MOCAP) system, synchronization, Kinect, body-tracking 10 | 11 | > See [Azure.com/Kinect](https://Azure.com/kinect) for device info and available documentation. 12 | 13 | > Link to submitted poster to ACM SIGGRAPH'20: [Poster](doc/poster_SIGGRAPH2020.pdf) 14 | 15 | > Link to submitted abstract to ACM SIGGRAPH'20: [Abstract](doc/abstract_SIGGRAPH2020.pdf) 16 | 17 | (Received 4 feedback; 3 neutral, 1 slight negative) 18 | 19 | > Link to documentation: [Documentation](doc/kinect_documentation.pdf) 20 | 21 | ### Demo 22 | 23 | > Check out the outcomes on some various movements! 24 | > Note: this demo experiences some offset due to a parallax problem (devices are at a lower height than the human). 25 | 26 | ![Demo](res/3_random_min1.gif) 27 | 28 | ## Overview 29 | > Flowchart 30 | 31 | ![Flowchart](res/flowchart_black.png) 32 | 33 | ## System Setup 34 | 35 | ### Hardware 36 | 37 | - [Azure Kinect DK](https://www.microsoft.com/en-us/p/azure-kinect-dk/8pp5vxmd9nhq?activetab=pivot%3aoverviewtab) 38 | - Ubuntu 18.04 / Windows PC machine with USB3.0+ support 39 | - USB Hub for multi-device connection (Targus 4-Port USB 3.0): [Link](https://www.amazon.com/Targus-4-Port-SuperSpeed-Adapter-ACH119US/dp/B005MR5HGI?th=1) 40 | - USB 3.0 Extension Cable for multi-device connection: [Link](https://www.amazon.com/gp/product/B00DMFFL2W/?th=1) 41 | - Audio Jack Cables for multi-device connection: [Link](https://www.amazon.com/Cable-Ruaeoda-3-5mm-Stereo-Audio/dp/B076S1DMXT/ref=sr_1_4?keywords=10m+3.5+jack+audio+aux+cable&qid=1579036893&s=electronics&sr=1-4) 42 | 43 | ### Software 44 | 45 | - Azure Kinect Senor SDK (K4A) (`-lk4a`) 46 | - Azure Kinect Body Tracking SDK (K4ABT) (`-lk4abt`) 47 | - OpenCV (`` `pkg-config --cflags --libs opencv` ``) 48 | 49 | ### Building 50 | 51 | ```bash 52 | g++ file.cpp -lk4a -lk4abt `pkg-config --cflags --libs opencv` -o program // compile 53 | ./program // execute 54 | 55 | // running on a single device 56 | make one && make onerun 57 | // running on two synchronized devices 58 | sudo bash ./script/increaseusbmb.sh // change USB memory bandwidth size 59 | make two && make tworun 60 | // running on three synchronized devices 61 | sudo bash ./script/increaseusbmb.sh // change USB memory bandwidth size 62 | make sync && make syncrun 63 | ``` 64 | 65 | ## Test Setup 66 | 67 | > Configuration 68 | 69 | - [Daisy-chain configuration](https://docs.microsoft.com/en-us/azure/Kinect-dk/media/multicam-sync-daisychain.png): supports connection of 2+ subordinate mode devices to a single master mode device (RS-232) 70 | 71 | > Testing Environment 72 | 73 | ![Configuration](res/testsetup.png) 74 | 75 | > Camera Calibration to capture synchronous images 76 | > 77 | > - reference: green screen example from Azure Kinect SDK examples on its GitHub repository 78 | 79 | ![calibration](res/calibration_stage.png) 80 | 81 | ## Outcomes 82 | 83 | With multiple devices in place, joint estimation is still performed as if there is no occlusion or lighting effect. 84 | The following videos and images are tested in the test setup shown above. 85 | 86 | > Videos Samples 87 | > 88 | > - [3-Device System, Occlusion at Subordinate Device 1](https://drive.google.com/open?id=1aI-claeftAODyKptgQAlp-xUNikidXkd) 89 | > - [3-Device System, Occlusion at Subordinate Device 0](https://drive.google.com/open?id=1Het_abi7CdyeqTbc__DtbvoWLhRd6bSf) 90 | > - [3-Device System, Different Illumination at Master Device](https://drive.google.com/open?id=13--C80KyPnNHy97qZYbnvLx_eqKF4sFo) 91 | 92 | > - [2-Device System, Armbend](https://drive.google.com/open?id=1rNm08ENJNz7gC7qcjfLROrGfcWG34cxD) 93 | > - [3-Device System, Armbend](https://drive.google.com/open?id=1kvbwZNJAQP5ep4wQ99Aks_qvyKswSmLm) 94 | 95 | > - [2-Device System, Standing](https://drive.google.com/open?id=1R2_ukCFXL8e6FQaPcC5eoixONgsErfYw) 96 | > - [3-Device System, Standing](https://drive.google.com/open?id=1v21fsoo8cYNsnlP9tcl4umf7r20Sj9_Q) 97 | 98 | --- 99 | 100 | > 2-Device | 3 -Device Systems 101 | 102 | ![2-device](res/snapshot_2_dev.png) | ![3-device](res/snapshot_3_dev.png) 103 | 104 | #### Synchronization 105 | 106 | > - on the right: joint angles for angles designated as below 107 | 108 | ![Sycned](res/synced.png) 109 | 110 | ![Body Joints Labeled](res/bodyjoints_labeled.png) 111 | 112 | #### Occlusion / Illumination Effect Verification with 3-Device System 113 | 114 | > Occlusion at Subordinate Device 0 | Occlusion at Subordinate Device 1 | Varying Illumination at Master Device 115 | 116 | ![occlusion-sub0](res/occlusion_0.png) | ![occlusion-sub0](res/occlusion_1.png) | ![illumination](res/lighting_master.png) 117 | 118 | > Example of selection of data streams by confidence levels per joint 119 | 120 | ![selection_by_confidence](res/check_confident_devices.png) 121 | 122 | ## Azure Kinect SDK Details 123 | 124 | **Azure Kinect SDK** is a cross platform (Linux and Windows) user mode SDK to read data from your Azure Kinect device. 125 | 126 | The Azure Kinect SDK enables you to get the most out of your Azure Kinect camera. Features include: 127 | 128 | - Depth camera access 129 | - RGB camera access and control (e.g. exposure and white balance) 130 | - Motion sensor (gyroscope and accelerometer) access 131 | - Synchronized Depth-RGB camera streaming with configurable delay between cameras 132 | - External device synchronization control with configurable delay offset between devices 133 | - Camera frame meta-data access for image resolution, timestamp and temperature 134 | - Device calibration data access 135 | 136 | ## Current Work 137 | 138 | ##### 1. Gait Analysis on Exoskeletons 139 | 140 | > OpenPose, AlphPose, Kinect, Vicon MOCAP system 141 | 142 | ##### 2. Graphical Visualization of Tracked Body Joints 143 | 144 | > Media art collaboration 145 | 146 | ##### 3. Drone Movement Synchronzation from Human Pose 147 | 148 | > Control of drone system (crazyflie) 149 | 150 | 151 | ## Star History 152 | 153 | [![Stargazers repo roster for @andyj1/kinect](https://bytecrank.com/nastyox/reporoster/php/stargazersSVG.php?user=andyj1&repo=kinect)]([https://github.com/NVlabs/MambaVision](https://github.com/andyj1/kinect)/stargazers) 154 | 155 | 156 | [![Star History Chart](https://api.star-history.com/svg?repos=andyj1/kinect&type=Date)](https://star-history.com/#andyj1/kinect&Date) 157 | -------------------------------------------------------------------------------- /_config.yml: -------------------------------------------------------------------------------- 1 | theme: jekyll-theme-minimal -------------------------------------------------------------------------------- /doc/Azure Kinect body tracking joints _ Microsoft Docs.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andyj1/kinect/10d9334ec047587331191e779f019e58c51ee519/doc/Azure Kinect body tracking joints _ Microsoft Docs.pdf -------------------------------------------------------------------------------- /doc/Biomechanical validation of upper-body and lower-body joint movements of kinect motion capture data for rehab treatments.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andyj1/kinect/10d9334ec047587331191e779f019e58c51ee519/doc/Biomechanical validation of upper-body and lower-body joint movements of kinect motion capture data for rehab treatments.pdf -------------------------------------------------------------------------------- /doc/Burger-CameraCalibration-20160516.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andyj1/kinect/10d9334ec047587331191e779f019e58c51ee519/doc/Burger-CameraCalibration-20160516.pdf -------------------------------------------------------------------------------- /doc/Investigating the impact of a motion capture system on microsoft kinect v2 recordings.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andyj1/kinect/10d9334ec047587331191e779f019e58c51ee519/doc/Investigating the impact of a motion capture system on microsoft kinect v2 recordings.pdf -------------------------------------------------------------------------------- /doc/Mean Shift A Robust Approach Toward Feature Space Analysis (2002).pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andyj1/kinect/10d9334ec047587331191e779f019e58c51ee519/doc/Mean Shift A Robust Approach Toward Feature Space Analysis (2002).pdf -------------------------------------------------------------------------------- /doc/Performance analysis of a generalized motion capture system using microsoft kinect 2.0 (2017).pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andyj1/kinect/10d9334ec047587331191e779f019e58c51ee519/doc/Performance analysis of a generalized motion capture system using microsoft kinect 2.0 (2017).pdf -------------------------------------------------------------------------------- /doc/Real-Time Human Pose Recognition in Parts from Single Depth Images (2013).pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andyj1/kinect/10d9334ec047587331191e779f019e58c51ee519/doc/Real-Time Human Pose Recognition in Parts from Single Depth Images (2013).pdf -------------------------------------------------------------------------------- /doc/Using Kinect to Develop a Smart Meeting Room.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andyj1/kinect/10d9334ec047587331191e779f019e58c51ee519/doc/Using Kinect to Develop a Smart Meeting Room.pdf -------------------------------------------------------------------------------- /doc/Yoga posture recognition by detecting human joint points in real time using microsoft kinect.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andyj1/kinect/10d9334ec047587331191e779f019e58c51ee519/doc/Yoga posture recognition by detecting human joint points in real time using microsoft kinect.pdf -------------------------------------------------------------------------------- /doc/[1] Arun_least-squares fitting of 3-D point sets.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andyj1/kinect/10d9334ec047587331191e779f019e58c51ee519/doc/[1] Arun_least-squares fitting of 3-D point sets.pdf -------------------------------------------------------------------------------- /doc/[2] Burger-CameraCalibration-20160516 (Zhang's).pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andyj1/kinect/10d9334ec047587331191e779f019e58c51ee519/doc/[2] Burger-CameraCalibration-20160516 (Zhang's).pdf -------------------------------------------------------------------------------- /doc/[3] Performance analysis of a generalized motion capture system using microsoft kinect 2.0 (2017).pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andyj1/kinect/10d9334ec047587331191e779f019e58c51ee519/doc/[3] Performance analysis of a generalized motion capture system using microsoft kinect 2.0 (2017).pdf -------------------------------------------------------------------------------- /doc/[4] Yoga posture recognition by detecting human joint points in real time using microsoft kinect.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andyj1/kinect/10d9334ec047587331191e779f019e58c51ee519/doc/[4] Yoga posture recognition by detecting human joint points in real time using microsoft kinect.pdf -------------------------------------------------------------------------------- /doc/[doc] Azure Kinect body tracking joints _ Microsoft Docs.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andyj1/kinect/10d9334ec047587331191e779f019e58c51ee519/doc/[doc] Azure Kinect body tracking joints _ Microsoft Docs.pdf -------------------------------------------------------------------------------- /doc/[doc] how-to-use_commands.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andyj1/kinect/10d9334ec047587331191e779f019e58c51ee519/doc/[doc] how-to-use_commands.pdf -------------------------------------------------------------------------------- /doc/[doc] kinect_specs.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andyj1/kinect/10d9334ec047587331191e779f019e58c51ee519/doc/[doc] kinect_specs.pdf -------------------------------------------------------------------------------- /doc/abstract_SIGGRAPH2020.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andyj1/kinect/10d9334ec047587331191e779f019e58c51ee519/doc/abstract_SIGGRAPH2020.pdf -------------------------------------------------------------------------------- /doc/arun.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andyj1/kinect/10d9334ec047587331191e779f019e58c51ee519/doc/arun.pdf -------------------------------------------------------------------------------- /doc/gait joint feature based person identification (kinect v2).pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andyj1/kinect/10d9334ec047587331191e779f019e58c51ee519/doc/gait joint feature based person identification (kinect v2).pdf -------------------------------------------------------------------------------- /doc/horn-quat.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andyj1/kinect/10d9334ec047587331191e779f019e58c51ee519/doc/horn-quat.pdf -------------------------------------------------------------------------------- /doc/how-to-use_commands.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andyj1/kinect/10d9334ec047587331191e779f019e58c51ee519/doc/how-to-use_commands.pdf -------------------------------------------------------------------------------- /doc/kinect_documentation.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andyj1/kinect/10d9334ec047587331191e779f019e58c51ee519/doc/kinect_documentation.pdf -------------------------------------------------------------------------------- /doc/kinect_specs.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andyj1/kinect/10d9334ec047587331191e779f019e58c51ee519/doc/kinect_specs.pdf -------------------------------------------------------------------------------- /doc/poster_SIGGRAPH2020.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andyj1/kinect/10d9334ec047587331191e779f019e58c51ee519/doc/poster_SIGGRAPH2020.pdf -------------------------------------------------------------------------------- /lib_k4abt/AzureKinectDK_Fw_1.6.102075014.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andyj1/kinect/10d9334ec047587331191e779f019e58c51ee519/lib_k4abt/AzureKinectDK_Fw_1.6.102075014.bin -------------------------------------------------------------------------------- /lib_k4abt/libdepthengine.so.2.0: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andyj1/kinect/10d9334ec047587331191e779f019e58c51ee519/lib_k4abt/libdepthengine.so.2.0 -------------------------------------------------------------------------------- /lib_k4abt/libstdc++.so.6: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andyj1/kinect/10d9334ec047587331191e779f019e58c51ee519/lib_k4abt/libstdc++.so.6 -------------------------------------------------------------------------------- /matlab/extrinsic_calculation/joints_sync_1.csv: -------------------------------------------------------------------------------- 1 | ,,Position,,,Orientation,,,,Confidence Level 2 | Body ID,Joint #,x,y,z,x,y,z,w 3 | 1,0,-200.678,112.839,667.025,0.641216,-0.323177,0.140086,-0.681744,Medium confidence in joint pose, 4 | 1,1,-197.868,-25.0862,705.697,0.699011,-0.309517,0.168125,-0.622348,Medium confidence in joint pose, 5 | 1,2,-178.534,-136.662,722.905,0.709838,-0.383277,0.165894,-0.567193,Medium confidence in joint pose, 6 | 1,3,-126.473,-299.272,758.201,0.753037,-0.368739,0.196096,-0.508442,Medium confidence in joint pose, 7 | 1,4,-117.434,-263.043,770.657,0.641578,-0.658224,-0.390518,-0.05113,Medium confidence in joint pose, 8 | 1,5,-38.2491,-211.556,835.91,0.494188,-0.287232,-0.572956,0.587365,Medium confidence in joint pose, 9 | 1,6,-115.157,-9.67854,886.703,0.363281,-0.398589,-0.501904,0.6762,Medium confidence in joint pose, 10 | 1,7,-193.071,156.356,854.221,0.0440186,0.601521,0.796627,-0.0402539,The joint is not observed(likely due to occlusion) - predicted joint pose, 11 | 1,8,-208.025,231.145,841.462,0.0368458,0.463196,0.884246,-0.0469085,The joint is not observed(likely due to occlusion) - predicted joint pose, 12 | 1,9,-257.329,301.928,832.037,0.0368458,0.463196,0.884246,-0.0469085,The joint is not observed(likely due to occlusion) - predicted joint pose, 13 | 1,10,-277.248,222.438,804.491,0.184106,-0.277604,-0.591482,0.734295,The joint is not observed(likely due to occlusion) - predicted joint pose, 14 | 1,11,-153.802,-281.832,735.371,0.628396,0.629193,-0.0875982,0.448955,Medium confidence in joint pose, 15 | 1,12,-215.219,-329.781,664.078,0.10515,0.862877,-0.492486,0.0429412,Medium confidence in joint pose, 16 | 1,13,-330.818,-139.641,623.902,-0.0851914,-0.653038,0.74876,-0.0751195,The joint is not observed(likely due to occlusion) - predicted joint pose, 17 | 1,14,-305.813,42.4021,581.333,0.605134,0.333621,-0.556489,-0.461335,The joint is not observed(likely due to occlusion) - predicted joint pose, 18 | 1,15,-298.941,117.069,545.135,0.521528,0.420148,-0.494427,-0.554099,The joint is not observed(likely due to occlusion) - predicted joint pose, 19 | 1,16,-290.158,201.802,540.861,0.521528,0.420148,-0.494427,-0.554099,The joint is not observed(likely due to occlusion) - predicted joint pose, 20 | 1,17,-242.59,138.544,605.507,0.0529681,-0.612136,0.78053,0.115136,The joint is not observed(likely due to occlusion) - predicted joint pose, 21 | 1,18,-155.257,129.201,722.081,-0.167374,0.335747,0.0983414,0.921732,Medium confidence in joint pose, 22 | 1,19,75.7446,207.168,512.511,0.574532,-0.343235,0.0680372,-0.739914,Medium confidence in joint pose, 23 | 1,20,107.762,482.746,380.47,-0.47793,0.36526,-0.0507959,0.797238,The joint is not observed(likely due to occlusion) - predicted joint pose, 24 | 1,21,219.871,490.858,280.472,0.902591,-0.224577,0.288359,-0.227474,The joint is not observed(likely due to occlusion) - predicted joint pose, 25 | 1,22,-241.637,98.085,617.379,0.938215,0.0585083,0.2107,0.268208,Medium confidence in joint pose, 26 | 1,23,4.79466,267.629,500.487,0.70354,0.150308,0.158688,0.676208,Medium confidence in joint pose, 27 | 1,24,15.6995,577.859,494.275,0.786732,0.143981,0.195818,0.56743,The joint is not observed(likely due to occlusion) - predicted joint pose, 28 | 1,25,131.423,621.487,432.112,0.159167,0.245741,0.0367423,0.955472,The joint is not observed(likely due to occlusion) - predicted joint pose, 29 | 1,26,-99.8351,-358.992,763.424,0.783752,-0.372086,0.218619,-0.446644,Medium confidence in joint pose, 30 | 1,27,-16.0447,-356.665,665.311,0.783752,-0.372086,0.218619,-0.446644,Medium confidence in joint pose, 31 | 1,28,-5.03809,-381.574,701.072,0.870021,-0.108518,0.417692,0.238372,Medium confidence in joint pose, 32 | 1,29,-26.9934,-379.098,800.452,0.446644,0.218619,0.372086,0.783752,Medium confidence in joint pose, 33 | 1,30,-33.8006,-393.457,672.886,0.870021,-0.108518,0.417692,0.238372,Medium confidence in joint pose, 34 | 1,31,-120.951,-428.775,720.092,0.783752,-0.372086,0.218619,-0.446644,Medium confidence in joint pose, 35 | 1,0,-200.671,112.843,667.041,0.641216,-0.323187,0.140065,-0.681744,Medium confidence in joint pose, 36 | 1,1,-197.859,-25.0826,705.719,0.69901,-0.309529,0.168106,-0.622348,Medium confidence in joint pose, 37 | 1,2,-178.524,-136.659,722.932,0.709839,-0.383284,0.165856,-0.567198,Medium confidence in joint pose, 38 | 1,3,-126.46,-299.267,758.24,0.753038,-0.368749,0.196059,-0.508447,Medium confidence in joint pose, 39 | 1,4,-117.422,-263.037,770.695,0.641554,-0.658232,-0.390543,-0.0511363,Medium confidence in joint pose, 40 | 1,5,-38.2407,-211.546,835.951,0.494179,-0.28722,-0.572976,0.587359,Medium confidence in joint pose, 41 | 1,6,-115.156,-9.67012,886.75,0.363274,-0.398581,-0.501927,0.676192,Medium confidence in joint pose, 42 | 1,7,-193.076,156.365,854.273,0.0440158,0.60151,0.796637,-0.0402321,The joint is not observed(likely due to occlusion) - predicted joint pose, 43 | 1,8,-208.032,231.155,841.516,0.0368466,0.463184,0.884254,-0.0468865,The joint is not observed(likely due to occlusion) - predicted joint pose, 44 | 1,9,-257.338,301.938,832.093,0.0368466,0.463184,0.884254,-0.0468865,The joint is not observed(likely due to occlusion) - predicted joint pose, 45 | 1,10,-277.255,222.448,804.543,0.184094,-0.2776,-0.591502,0.734284,The joint is not observed(likely due to occlusion) - predicted joint pose, 46 | 1,11,-153.788,-281.829,735.408,0.628405,0.629166,-0.0875936,0.448982,Medium confidence in joint pose, 47 | 1,12,-215.201,-329.784,664.113,0.105161,0.862879,-0.492477,0.0429785,Medium confidence in joint pose, 48 | 1,13,-330.804,-139.647,623.92,-0.0851888,-0.653043,0.748752,-0.0751582,The joint is not observed(likely due to occlusion) - predicted joint pose, 49 | 1,14,-305.801,42.3963,581.342,0.605135,0.333623,-0.556513,-0.461303,The joint is not observed(likely due to occlusion) - predicted joint pose, 50 | 1,15,-298.929,117.062,545.139,0.521534,0.420155,-0.49445,-0.554068,The joint is not observed(likely due to occlusion) - predicted joint pose, 51 | 1,16,-290.148,201.796,540.861,0.521534,0.420155,-0.49445,-0.554068,The joint is not observed(likely due to occlusion) - predicted joint pose, 52 | 1,17,-242.581,138.542,605.514,0.0529701,-0.61215,0.780524,0.1151,The joint is not observed(likely due to occlusion) - predicted joint pose, 53 | 1,18,-155.25,129.208,722.097,-0.167377,0.335722,0.098362,0.921738,Medium confidence in joint pose, 54 | 1,19,75.764,207.175,512.536,0.574538,-0.343224,0.0680077,-0.739918,Medium confidence in joint pose, 55 | 1,20,107.782,482.754,380.488,-0.477935,0.365245,-0.0507684,0.797243,The joint is not observed(likely due to occlusion) - predicted joint pose, 56 | 1,21,219.899,490.866,280.494,0.902598,-0.224585,0.288329,-0.227474,The joint is not observed(likely due to occlusion) - predicted joint pose, 57 | 1,22,-241.629,98.0857,617.394,0.938221,0.0584857,0.210662,0.268221,Medium confidence in joint pose, 58 | 1,23,4.81081,267.636,500.52,0.703539,0.15027,0.158665,0.676222,Medium confidence in joint pose, 59 | 1,24,15.7081,577.87,494.303,0.786734,0.143947,0.195791,0.567445,The joint is not observed(likely due to occlusion) - predicted joint pose, 60 | 1,25,131.437,621.5,432.148,0.159159,0.245698,0.0367471,0.955485,The joint is not observed(likely due to occlusion) - predicted joint pose, 61 | 1,26,-99.82,-358.987,763.468,0.783755,-0.372096,0.218579,-0.44665,Medium confidence in joint pose, 62 | 1,27,-16.0228,-356.663,665.359,0.783755,-0.372096,0.218579,-0.44665,Medium confidence in joint pose, 63 | 1,28,-5.01758,-381.57,701.122,0.870028,-0.108553,0.41767,0.238369,Medium confidence in joint pose, 64 | 1,29,-26.9792,-379.09,800.501,0.44665,0.218579,0.372096,0.783755,Medium confidence in joint pose, 65 | 1,30,-33.7784,-393.455,672.934,0.870028,-0.108553,0.41767,0.238369,Medium confidence in joint pose, 66 | 1,31,-120.931,-428.774,720.137,0.783755,-0.372096,0.218579,-0.44665,Medium confidence in joint pose, 67 | 1,0,-198.422,118.009,674.035,0.630923,-0.343214,0.153598,-0.678637,Medium confidence in joint pose, 68 | 1,1,-195.416,-21.8913,715.082,0.688369,-0.328314,0.183297,-0.62029,Medium confidence in joint pose, 69 | 1,2,-176.383,-135.482,733.15,0.708359,-0.384999,0.164337,-0.568327,Medium confidence in joint pose, 70 | 1,3,-123.668,-300.865,770.056,0.751654,-0.370581,0.194682,-0.509691,Medium confidence in joint pose, 71 | 1,4,-114.42,-263.932,782.529,0.639321,-0.659333,-0.392193,-0.0522786,Medium confidence in joint pose, 72 | 1,5,-34.1558,-211.312,849.181,-0.480854,0.298406,0.588312,-0.577601,Medium confidence in joint pose, 73 | 1,6,-115.353,-6.52897,899.115,0.335871,-0.42515,-0.504385,0.672335,Medium confidence in joint pose, 74 | 1,7,-193.628,160.403,854.967,0.0499785,0.607315,0.791876,-0.0400351,The joint is not observed(likely due to occlusion) - predicted joint pose, 75 | 1,8,-207.606,236.649,841.315,0.0414332,0.44528,0.893099,-0.0488257,The joint is not observed(likely due to occlusion) - predicted joint pose, 76 | 1,9,-260.602,306.54,830.937,0.0414332,0.44528,0.893099,-0.0488257,The joint is not observed(likely due to occlusion) - predicted joint pose, 77 | 1,10,-280.562,224.838,803.324,0.17045,-0.267076,-0.585714,0.746027,The joint is not observed(likely due to occlusion) - predicted joint pose, 78 | 1,11,-151.443,-283.205,746.7,0.631055,0.62448,-0.0823262,0.452789,Medium confidence in joint pose, 79 | 1,12,-213.405,-333.583,674.74,0.0838248,0.862873,-0.496299,0.0459398,Medium confidence in joint pose, 80 | 1,13,-329.208,-138.231,637.343,-0.0657992,-0.670177,0.736021,-0.0693364,The joint is not observed(likely due to occlusion) - predicted joint pose, 81 | 1,14,-311.341,49.4152,600.905,0.677252,0.168674,-0.519218,-0.493246,The joint is not observed(likely due to occlusion) - predicted joint pose, 82 | 1,15,-308.219,116.759,549.551,0.53647,0.290236,-0.462386,-0.643554,The joint is not observed(likely due to occlusion) - predicted joint pose, 83 | 1,16,-286,200.007,538.912,0.53647,0.290236,-0.462386,-0.643554,The joint is not observed(likely due to occlusion) - predicted joint pose, 84 | 1,17,-240.834,142.589,606.425,-0.00109429,-0.59812,0.785728,0.157744,The joint is not observed(likely due to occlusion) - predicted joint pose, 85 | 1,18,-149.257,134.749,727.491,-0.162388,0.333428,0.101777,0.923091,Medium confidence in joint pose, 86 | 1,19,87.9582,210.643,515.24,0.563983,-0.343333,0.0608122,-0.748564,Medium confidence in joint pose, 87 | 1,20,128.017,487.761,375.943,-0.456332,0.375752,-0.057929,0.804497,The joint is not observed(likely due to occlusion) - predicted joint pose, 88 | 1,21,240.244,489.301,271.772,0.892456,-0.227108,0.300871,-0.247833,The joint is not observed(likely due to occlusion) - predicted joint pose, 89 | 1,22,-242.756,102.913,625.832,0.944176,0.0538946,0.206943,0.250601,Medium confidence in joint pose, 90 | 1,23,15.0703,264.892,506.922,0.698617,0.148729,0.153514,0.682823,Medium confidence in joint pose, 91 | 1,24,21.5085,580.83,503.324,0.77716,0.156665,0.203315,0.574579,The joint is not observed(likely due to occlusion) - predicted joint pose, 92 | 1,25,136.609,628.582,437.589,0.147316,0.260016,0.0332021,0.953723,The joint is not observed(likely due to occlusion) - predicted joint pose, 93 | 1,26,-96.6509,-361.661,775.738,0.782986,-0.384821,0.215398,-0.438691,Medium confidence in joint pose, 94 | 1,27,-12.6722,-359.622,674.765,0.782986,-0.384821,0.215398,-0.438691,Medium confidence in joint pose, 95 | 1,28,-0.517868,-384.017,711.513,0.863856,-0.1198,0.424419,0.243453,Medium confidence in joint pose, 96 | 1,29,-21.6565,-379.908,812.874,0.438691,0.215398,0.384821,0.782986,Medium confidence in joint pose, 97 | 1,30,-29.9004,-397.256,683.445,0.863856,-0.1198,0.424419,0.243453,Medium confidence in joint pose, 98 | 1,31,-117.272,-433.968,733.326,0.782986,-0.384821,0.215398,-0.438691,Medium confidence in joint pose, 99 | 1,0,-198.422,118.009,674.035,0.630923,-0.343214,0.153598,-0.678637,Medium confidence in joint pose, 100 | 1,1,-195.416,-21.8913,715.082,0.688369,-0.328314,0.183297,-0.62029,Medium confidence in joint pose, 101 | 1,2,-176.383,-135.482,733.15,0.708359,-0.384999,0.164337,-0.568327,Medium confidence in joint pose, 102 | 1,3,-123.668,-300.865,770.056,0.751654,-0.370581,0.194682,-0.509691,Medium confidence in joint pose, 103 | 1,4,-114.42,-263.932,782.529,0.639321,-0.659333,-0.392193,-0.0522786,Medium confidence in joint pose, 104 | 1,5,-34.1558,-211.312,849.181,-0.480854,0.298406,0.588312,-0.577601,Medium confidence in joint pose, 105 | 1,6,-115.353,-6.52897,899.115,0.335871,-0.42515,-0.504385,0.672335,Medium confidence in joint pose, 106 | 1,7,-193.628,160.403,854.967,0.0499785,0.607315,0.791876,-0.0400351,The joint is not observed(likely due to occlusion) - predicted joint pose, 107 | 1,8,-207.606,236.649,841.315,0.0414332,0.44528,0.893099,-0.0488257,The joint is not observed(likely due to occlusion) - predicted joint pose, 108 | 1,9,-260.602,306.54,830.937,0.0414332,0.44528,0.893099,-0.0488257,The joint is not observed(likely due to occlusion) - predicted joint pose, 109 | 1,10,-280.562,224.838,803.324,0.17045,-0.267076,-0.585714,0.746027,The joint is not observed(likely due to occlusion) - predicted joint pose, 110 | 1,11,-151.443,-283.205,746.7,0.631055,0.62448,-0.0823262,0.452789,Medium confidence in joint pose, 111 | 1,12,-213.405,-333.583,674.74,0.0838248,0.862873,-0.496299,0.0459398,Medium confidence in joint pose, 112 | 1,13,-329.208,-138.231,637.343,-0.0657992,-0.670177,0.736021,-0.0693364,The joint is not observed(likely due to occlusion) - predicted joint pose, 113 | 1,14,-311.341,49.4152,600.905,0.677252,0.168674,-0.519218,-0.493246,The joint is not observed(likely due to occlusion) - predicted joint pose, 114 | 1,15,-308.219,116.759,549.551,0.53647,0.290236,-0.462386,-0.643554,The joint is not observed(likely due to occlusion) - predicted joint pose, 115 | 1,16,-286,200.007,538.912,0.53647,0.290236,-0.462386,-0.643554,The joint is not observed(likely due to occlusion) - predicted joint pose, 116 | 1,17,-240.834,142.589,606.425,-0.00109429,-0.59812,0.785728,0.157744,The joint is not observed(likely due to occlusion) - predicted joint pose, 117 | 1,18,-149.257,134.749,727.491,-0.162388,0.333428,0.101777,0.923091,Medium confidence in joint pose, 118 | 1,19,87.9582,210.643,515.24,0.563983,-0.343333,0.0608122,-0.748564,Medium confidence in joint pose, 119 | 1,20,128.017,487.761,375.943,-0.456332,0.375752,-0.057929,0.804497,The joint is not observed(likely due to occlusion) - predicted joint pose, 120 | 1,21,240.244,489.301,271.772,0.892456,-0.227108,0.300871,-0.247833,The joint is not observed(likely due to occlusion) - predicted joint pose, 121 | 1,22,-242.756,102.913,625.832,0.944176,0.0538946,0.206943,0.250601,Medium confidence in joint pose, 122 | 1,23,15.0703,264.892,506.922,0.698617,0.148729,0.153514,0.682823,Medium confidence in joint pose, 123 | 1,24,21.5085,580.83,503.324,0.77716,0.156665,0.203315,0.574579,The joint is not observed(likely due to occlusion) - predicted joint pose, 124 | 1,25,136.609,628.582,437.589,0.147316,0.260016,0.0332021,0.953723,The joint is not observed(likely due to occlusion) - predicted joint pose, 125 | 1,26,-96.6509,-361.661,775.738,0.782986,-0.384821,0.215398,-0.438691,Medium confidence in joint pose, 126 | 1,27,-12.6722,-359.622,674.765,0.782986,-0.384821,0.215398,-0.438691,Medium confidence in joint pose, 127 | 1,28,-0.517868,-384.017,711.513,0.863856,-0.1198,0.424419,0.243453,Medium confidence in joint pose, 128 | 1,29,-21.6565,-379.908,812.874,0.438691,0.215398,0.384821,0.782986,Medium confidence in joint pose, 129 | 1,30,-29.9004,-397.256,683.445,0.863856,-0.1198,0.424419,0.243453,Medium confidence in joint pose, 130 | 1,31,-117.272,-433.968,733.326,0.782986,-0.384821,0.215398,-0.438691,Medium confidence in joint pose, 131 | 1,0,-198.422,118.009,674.035,0.630923,-0.343214,0.153598,-0.678637,Medium confidence in joint pose, 132 | 1,1,-195.416,-21.8913,715.082,0.688369,-0.328314,0.183297,-0.62029,Medium confidence in joint pose, 133 | 1,2,-176.383,-135.482,733.15,0.708359,-0.384999,0.164337,-0.568327,Medium confidence in joint pose, 134 | 1,3,-123.668,-300.865,770.056,0.751654,-0.370581,0.194682,-0.509691,Medium confidence in joint pose, 135 | 1,4,-114.42,-263.932,782.529,0.639321,-0.659333,-0.392193,-0.0522786,Medium confidence in joint pose, 136 | 1,5,-34.1558,-211.312,849.181,-0.480854,0.298406,0.588312,-0.577601,Medium confidence in joint pose, 137 | 1,6,-115.353,-6.52897,899.115,0.335871,-0.42515,-0.504385,0.672335,Medium confidence in joint pose, 138 | 1,7,-193.628,160.403,854.967,0.0499785,0.607315,0.791876,-0.0400351,The joint is not observed(likely due to occlusion) - predicted joint pose, 139 | 1,8,-207.606,236.649,841.315,0.0414332,0.44528,0.893099,-0.0488257,The joint is not observed(likely due to occlusion) - predicted joint pose, 140 | 1,9,-260.602,306.54,830.937,0.0414332,0.44528,0.893099,-0.0488257,The joint is not observed(likely due to occlusion) - predicted joint pose, 141 | 1,10,-280.562,224.838,803.324,0.17045,-0.267076,-0.585714,0.746027,The joint is not observed(likely due to occlusion) - predicted joint pose, 142 | 1,11,-151.443,-283.205,746.7,0.631055,0.62448,-0.0823262,0.452789,Medium confidence in joint pose, 143 | 1,12,-213.405,-333.583,674.74,0.0838248,0.862873,-0.496299,0.0459398,Medium confidence in joint pose, 144 | 1,13,-329.208,-138.231,637.343,-0.0657992,-0.670177,0.736021,-0.0693364,The joint is not observed(likely due to occlusion) - predicted joint pose, 145 | 1,14,-311.341,49.4152,600.905,0.677252,0.168674,-0.519218,-0.493246,The joint is not observed(likely due to occlusion) - predicted joint pose, 146 | 1,15,-308.219,116.759,549.551,0.53647,0.290236,-0.462386,-0.643554,The joint is not observed(likely due to occlusion) - predicted joint pose, 147 | 1,16,-286,200.007,538.912,0.53647,0.290236,-0.462386,-0.643554,The joint is not observed(likely due to occlusion) - predicted joint pose, 148 | 1,17,-240.834,142.589,606.425,-0.00109429,-0.59812,0.785728,0.157744,The joint is not observed(likely due to occlusion) - predicted joint pose, 149 | 1,18,-149.257,134.749,727.491,-0.162388,0.333428,0.101777,0.923091,Medium confidence in joint pose, 150 | 1,19,87.9582,210.643,515.24,0.563983,-0.343333,0.0608122,-0.748564,Medium confidence in joint pose, 151 | 1,20,128.017,487.761,375.943,-0.456332,0.375752,-0.057929,0.804497,The joint is not observed(likely due to occlusion) - predicted joint pose, 152 | 1,21,240.244,489.301,271.772,0.892456,-0.227108,0.300871,-0.247833,The joint is not observed(likely due to occlusion) - predicted joint pose, 153 | 1,22,-242.756,102.913,625.832,0.944176,0.0538946,0.206943,0.250601,Medium confidence in joint pose, 154 | 1,23,15.0703,264.892,506.922,0.698617,0.148729,0.153514,0.682823,Medium confidence in joint pose, 155 | 1,24,21.5085,580.83,503.324,0.77716,0.156665,0.203315,0.574579,The joint is not observed(likely due to occlusion) - predicted joint pose, 156 | 1,25,136.609,628.582,437.589,0.147316,0.260016,0.0332021,0.953723,The joint is not observed(likely due to occlusion) - predicted joint pose, 157 | 1,26,-96.6509,-361.661,775.738,0.782986,-0.384821,0.215398,-0.438691,Medium confidence in joint pose, 158 | 1,27,-12.6722,-359.622,674.765,0.782986,-0.384821,0.215398,-0.438691,Medium confidence in joint pose, 159 | 1,28,-0.517868,-384.017,711.513,0.863856,-0.1198,0.424419,0.243453,Medium confidence in joint pose, 160 | 1,29,-21.6565,-379.908,812.874,0.438691,0.215398,0.384821,0.782986,Medium confidence in joint pose, 161 | 1,30,-29.9004,-397.256,683.445,0.863856,-0.1198,0.424419,0.243453,Medium confidence in joint pose, 162 | 1,31,-117.272,-433.968,733.326,0.782986,-0.384821,0.215398,-0.438691,Medium confidence in joint pose, 163 | 1,0,-198.422,118.009,674.035,0.630923,-0.343214,0.153598,-0.678637,Medium confidence in joint pose, 164 | 1,1,-195.416,-21.8913,715.082,0.688369,-0.328314,0.183297,-0.62029,Medium confidence in joint pose, 165 | 1,2,-176.383,-135.482,733.15,0.708359,-0.384999,0.164337,-0.568327,Medium confidence in joint pose, 166 | 1,3,-123.668,-300.865,770.056,0.751654,-0.370581,0.194682,-0.509691,Medium confidence in joint pose, 167 | 1,4,-114.42,-263.932,782.529,0.639321,-0.659333,-0.392193,-0.0522786,Medium confidence in joint pose, 168 | 1,5,-34.1558,-211.312,849.181,-0.480854,0.298406,0.588312,-0.577601,Medium confidence in joint pose, 169 | 1,6,-115.353,-6.52897,899.115,0.335871,-0.42515,-0.504385,0.672335,Medium confidence in joint pose, 170 | 1,7,-193.628,160.403,854.967,0.0499785,0.607315,0.791876,-0.0400351,The joint is not observed(likely due to occlusion) - predicted joint pose, 171 | 1,8,-207.606,236.649,841.315,0.0414332,0.44528,0.893099,-0.0488257,The joint is not observed(likely due to occlusion) - predicted joint pose, 172 | 1,9,-260.602,306.54,830.937,0.0414332,0.44528,0.893099,-0.0488257,The joint is not observed(likely due to occlusion) - predicted joint pose, 173 | 1,10,-280.562,224.838,803.324,0.17045,-0.267076,-0.585714,0.746027,The joint is not observed(likely due to occlusion) - predicted joint pose, 174 | 1,11,-151.443,-283.205,746.7,0.631055,0.62448,-0.0823262,0.452789,Medium confidence in joint pose, 175 | 1,12,-213.405,-333.583,674.74,0.0838248,0.862873,-0.496299,0.0459398,Medium confidence in joint pose, 176 | 1,13,-329.208,-138.231,637.343,-0.0657992,-0.670177,0.736021,-0.0693364,The joint is not observed(likely due to occlusion) - predicted joint pose, 177 | 1,14,-311.341,49.4152,600.905,0.677252,0.168674,-0.519218,-0.493246,The joint is not observed(likely due to occlusion) - predicted joint pose, 178 | 1,15,-308.219,116.759,549.551,0.53647,0.290236,-0.462386,-0.643554,The joint is not observed(likely due to occlusion) - predicted joint pose, 179 | 1,16,-286,200.007,538.912,0.53647,0.290236,-0.462386,-0.643554,The joint is not observed(likely due to occlusion) - predicted joint pose, 180 | 1,17,-240.834,142.589,606.425,-0.00109429,-0.59812,0.785728,0.157744,The joint is not observed(likely due to occlusion) - predicted joint pose, 181 | 1,18,-149.257,134.749,727.491,-0.162388,0.333428,0.101777,0.923091,Medium confidence in joint pose, 182 | 1,19,87.9582,210.643,515.24,0.563983,-0.343333,0.0608122,-0.748564,Medium confidence in joint pose, 183 | 1,20,128.017,487.761,375.943,-0.456332,0.375752,-0.057929,0.804497,The joint is not observed(likely due to occlusion) - predicted joint pose, 184 | 1,21,240.244,489.301,271.772,0.892456,-0.227108,0.300871,-0.247833,The joint is not observed(likely due to occlusion) - predicted joint pose, 185 | 1,22,-242.756,102.913,625.832,0.944176,0.0538946,0.206943,0.250601,Medium confidence in joint pose, 186 | 1,23,15.0703,264.892,506.922,0.698617,0.148729,0.153514,0.682823,Medium confidence in joint pose, 187 | 1,24,21.5085,580.83,503.324,0.77716,0.156665,0.203315,0.574579,The joint is not observed(likely due to occlusion) - predicted joint pose, 188 | 1,25,136.609,628.582,437.589,0.147316,0.260016,0.0332021,0.953723,The joint is not observed(likely due to occlusion) - predicted joint pose, 189 | 1,26,-96.6509,-361.661,775.738,0.782986,-0.384821,0.215398,-0.438691,Medium confidence in joint pose, 190 | 1,27,-12.6722,-359.622,674.765,0.782986,-0.384821,0.215398,-0.438691,Medium confidence in joint pose, 191 | 1,28,-0.517868,-384.017,711.513,0.863856,-0.1198,0.424419,0.243453,Medium confidence in joint pose, 192 | 1,29,-21.6565,-379.908,812.874,0.438691,0.215398,0.384821,0.782986,Medium confidence in joint pose, 193 | 1,30,-29.9004,-397.256,683.445,0.863856,-0.1198,0.424419,0.243453,Medium confidence in joint pose, 194 | 1,31,-117.272,-433.968,733.326,0.782986,-0.384821,0.215398,-0.438691,Medium confidence in joint pose, 195 | 1,0,-199.214,123.537,678.203,0.649654,-0.315379,0.123919,-0.680536,Medium confidence in joint pose, 196 | 1,1,-194.606,-18.7477,719.206,0.697618,-0.305487,0.146619,-0.631276,Medium confidence in joint pose, 197 | 1,2,-175.661,-133.674,740.66,0.711226,-0.368213,0.164232,-0.575851,Medium confidence in joint pose, 198 | 1,3,-125.215,-303.201,775.554,0.755115,-0.353857,0.193231,-0.516961,Medium confidence in joint pose, 199 | 1,4,-115.684,-266.111,789.344,0.636418,-0.652248,-0.406237,-0.0672048,Medium confidence in joint pose, 200 | 1,5,-37.2296,-213.359,861.131,-0.465148,0.337254,0.602221,-0.554281,Medium confidence in joint pose, 201 | 1,6,-115.203,-1.81994,903.9,0.311559,-0.47729,-0.498603,0.653086,Medium confidence in joint pose, 202 | 1,7,-182.661,168.226,843.668,-0.0618195,0.541984,0.825788,-0.143198,The joint is not observed(likely due to occlusion) - predicted joint pose, 203 | 1,8,-210.24,242.652,833.969,-0.0809165,0.423326,0.89245,-0.133341,The joint is not observed(likely due to occlusion) - predicted joint pose, 204 | 1,9,-266.633,312.386,836.799,-0.0809165,0.423326,0.89245,-0.133341,The joint is not observed(likely due to occlusion) - predicted joint pose, 205 | 1,10,-284.173,224.998,803.696,0.183356,-0.215615,-0.542539,0.790912,The joint is not observed(likely due to occlusion) - predicted joint pose, 206 | 1,11,-152.575,-284.344,751.536,0.626948,0.634284,-0.108614,0.439117,Medium confidence in joint pose, 207 | 1,12,-217.089,-329.427,675.83,0.0930915,0.861919,-0.491624,0.0820704,Medium confidence in joint pose, 208 | 1,13,-334.731,-134.847,621.349,-0.066978,-0.693797,0.709397,-0.104477,The joint is not observed(likely due to occlusion) - predicted joint pose, 209 | 1,14,-329.207,54.4091,574.541,0.533091,0.316458,-0.630532,-0.46701,The joint is not observed(likely due to occlusion) - predicted joint pose, 210 | 1,15,-305.663,128.119,536.792,-0.428517,-0.436565,0.55419,0.564498,The joint is not observed(likely due to occlusion) - predicted joint pose, 211 | 1,16,-283.476,213.464,538.373,-0.428517,-0.436565,0.55419,0.564498,The joint is not observed(likely due to occlusion) - predicted joint pose, 212 | 1,17,-245.135,138.733,605.563,0.0990228,-0.506267,0.854821,0.0562931,The joint is not observed(likely due to occlusion) - predicted joint pose, 213 | 1,18,-154.522,141.794,736.533,-0.31101,0.330259,0.0530066,0.889602,Medium confidence in joint pose, 214 | 1,19,41.0849,314.108,530.234,0.557666,-0.331377,0.0459325,-0.759663,The joint is not observed(likely due to occlusion) - predicted joint pose, 215 | 1,20,91.4079,592.964,386.554,-0.446877,0.360062,-0.040649,0.817927,The joint is not observed(likely due to occlusion) - predicted joint pose, 216 | 1,21,210.56,590.348,286.572,0.895081,-0.228248,0.277538,-0.264017,The joint is not observed(likely due to occlusion) - predicted joint pose, 217 | 1,22,-239.516,107.075,625.605,0.949564,0.0292408,0.19962,0.240053,Medium confidence in joint pose, 218 | 1,23,27.8244,262.343,504.376,0.711652,0.122915,0.159849,0.672972,Medium confidence in joint pose, 219 | 1,24,41.6658,582.473,484.446,0.787266,0.1273,0.200023,0.569209,The joint is not observed(likely due to occlusion) - predicted joint pose, 220 | 1,25,161.719,626.82,420.367,0.158381,0.236869,0.0514798,0.957162,The joint is not observed(likely due to occlusion) - predicted joint pose, 221 | 1,26,-98.7042,-365.436,780.576,0.782886,-0.359684,0.220862,-0.457097,Medium confidence in joint pose, 222 | 1,27,-10.502,-363.513,680.468,0.782886,-0.359684,0.220862,-0.457097,Medium confidence in joint pose, 223 | 1,28,-0.307468,-390.13,717.182,0.8768,-0.0981617,0.410508,0.230368,Medium confidence in joint pose, 224 | 1,29,-24.4966,-388.667,819.625,0.457097,0.220862,0.359684,0.782886,Medium confidence in joint pose, 225 | 1,30,-29.8912,-401.219,687.403,0.8768,-0.0981617,0.410508,0.230368,Medium confidence in joint pose, 226 | 1,31,-121.591,-436.312,734.273,0.782886,-0.359684,0.220862,-0.457097,Medium confidence in joint pose, 227 | 1,0,-188.783,126.893,667.374,0.617191,-0.355292,0.154137,-0.684898,Medium confidence in joint pose, 228 | 1,1,-188.268,-15.8136,713.24,0.671344,-0.341436,0.18279,-0.631907,Medium confidence in joint pose, 229 | 1,2,-172.147,-132.447,735.543,0.69762,-0.368139,0.157797,-0.594054,Medium confidence in joint pose, 230 | 1,3,-128.129,-304.849,775.721,0.743012,-0.354299,0.186811,-0.536196,Medium confidence in joint pose, 231 | 1,4,-117.351,-267.381,788.986,0.626187,-0.665009,-0.398079,-0.084772,Medium confidence in joint pose, 232 | 1,5,-37.0346,-216.54,862.408,-0.459633,0.351321,0.615459,-0.535277,Medium confidence in joint pose, 233 | 1,6,-113.8,-1.8836,906.444,0.236709,-0.548932,-0.448207,0.664645,Medium confidence in joint pose, 234 | 1,7,-169.394,155.326,805.597,-0.147718,0.853995,0.440812,-0.233573,Medium confidence in joint pose, 235 | 1,8,-126.494,218.04,777.806,-0.270516,0.278035,0.919956,-0.0565503,Medium confidence in joint pose, 236 | 1,9,-189.958,267.261,820.139,-0.270516,0.278035,0.919956,-0.0565503,The joint is not observed(likely due to occlusion) - predicted joint pose, 237 | 1,10,-254.54,223.283,801.099,0.285395,0.00112511,-0.467843,0.836463,The joint is not observed(likely due to occlusion) - predicted joint pose, 238 | 1,11,-154.651,-285.348,750.477,0.636109,0.611784,-0.118209,0.455095,Medium confidence in joint pose, 239 | 1,12,-216.289,-333.341,672.331,0.0394403,0.857576,-0.504427,0.0925237,Medium confidence in joint pose, 240 | 1,13,-328.423,-130.389,625.375,-0.00753389,-0.649377,0.753786,-0.100297,The joint is not observed(likely due to occlusion) - predicted joint pose, 241 | 1,14,-297.538,62.5065,597.428,0.769095,0.0412534,-0.40218,-0.495018,The joint is not observed(likely due to occlusion) - predicted joint pose, 242 | 1,15,-315.077,126.984,541.537,0.516369,0.194259,-0.354562,-0.754926,The joint is not observed(likely due to occlusion) - predicted joint pose, 243 | 1,16,-280.162,208.85,535.035,0.516369,0.194259,-0.354562,-0.754926,The joint is not observed(likely due to occlusion) - predicted joint pose, 244 | 1,17,-238.396,153.037,611.217,0.105131,-0.631085,0.728841,0.243864,The joint is not observed(likely due to occlusion) - predicted joint pose, 245 | 1,18,-136.922,144.317,721.003,-0.181594,0.370376,0.0955014,0.905939,Medium confidence in joint pose, 246 | 1,19,84.974,231.194,483.611,0.58412,-0.372105,0.0887859,-0.715862,Medium confidence in joint pose, 247 | 1,20,98.0517,521.271,345.695,-0.497222,0.40663,-0.0909682,0.761017,The joint is not observed(likely due to occlusion) - predicted joint pose, 248 | 1,21,200.422,538.912,227.438,0.891075,-0.22539,0.346083,-0.188178,The joint is not observed(likely due to occlusion) - predicted joint pose, 249 | 1,22,-235.549,111.181,619.014,0.956333,0.0339247,0.187052,0.222009,Medium confidence in joint pose, 250 | 1,23,43.8185,258.122,503.864,0.717989,0.122704,0.14506,0.669621,Medium confidence in joint pose, 251 | 1,24,63.6761,582.041,489.58,0.784196,0.127931,0.178788,0.580263,The joint is not observed(likely due to occlusion) - predicted joint pose, 252 | 1,25,186.564,630.659,430.356,0.148327,0.222396,0.0360187,0.962934,The joint is not observed(likely due to occlusion) - predicted joint pose, 253 | 1,26,-103.751,-368.622,782.745,0.777629,-0.374626,0.215126,-0.456803,Medium confidence in joint pose, 254 | 1,27,-15.2436,-369.392,680.794,0.777629,-0.374626,0.215126,-0.456803,Medium confidence in joint pose, 255 | 1,28,-4.4901,-395.043,718.715,0.872875,-0.112783,0.417018,0.226858,Medium confidence in joint pose, 256 | 1,29,-28.2366,-390.368,822.443,0.456803,0.215126,0.374626,0.777629,Medium confidence in joint pose, 257 | 1,30,-34.5633,-407.419,689.182,0.872875,-0.112783,0.417018,0.226858,Medium confidence in joint pose, 258 | 1,31,-126.775,-441.955,738.405,0.777629,-0.374626,0.215126,-0.456803,Medium confidence in joint pose, 259 | 1,0,-188.783,126.893,667.374,0.617191,-0.355292,0.154137,-0.684898,Medium confidence in joint pose, 260 | 1,1,-188.268,-15.8136,713.24,0.671344,-0.341436,0.18279,-0.631907,Medium confidence in joint pose, 261 | 1,2,-172.147,-132.447,735.543,0.69762,-0.368139,0.157797,-0.594054,Medium confidence in joint pose, 262 | 1,3,-128.129,-304.849,775.721,0.743012,-0.354299,0.186811,-0.536196,Medium confidence in joint pose, 263 | 1,4,-117.351,-267.381,788.986,0.626187,-0.665009,-0.398079,-0.084772,Medium confidence in joint pose, 264 | 1,5,-37.0346,-216.54,862.408,-0.459633,0.351321,0.615459,-0.535277,Medium confidence in joint pose, 265 | 1,6,-113.8,-1.8836,906.444,0.236709,-0.548932,-0.448207,0.664645,Medium confidence in joint pose, 266 | 1,7,-169.394,155.326,805.597,-0.147718,0.853995,0.440812,-0.233573,Medium confidence in joint pose, 267 | 1,8,-126.494,218.04,777.806,-0.270516,0.278035,0.919956,-0.0565503,The joint is not observed(likely due to occlusion) - predicted joint pose, 268 | 1,9,-189.958,267.261,820.139,-0.270516,0.278035,0.919956,-0.0565503,The joint is not observed(likely due to occlusion) - predicted joint pose, 269 | 1,10,-254.54,223.283,801.099,0.285395,0.00112511,-0.467843,0.836463,Medium confidence in joint pose, 270 | 1,11,-154.651,-285.348,750.477,0.636109,0.611784,-0.118209,0.455095,Medium confidence in joint pose, 271 | 1,12,-216.289,-333.341,672.331,0.0394403,0.857576,-0.504427,0.0925237,Medium confidence in joint pose, 272 | 1,13,-328.423,-130.389,625.375,-0.00753389,-0.649377,0.753786,-0.100297,The joint is not observed(likely due to occlusion) - predicted joint pose, 273 | 1,14,-297.538,62.5065,597.428,0.769095,0.0412534,-0.40218,-0.495018,The joint is not observed(likely due to occlusion) - predicted joint pose, 274 | 1,15,-315.077,126.984,541.537,0.516369,0.194259,-0.354562,-0.754926,The joint is not observed(likely due to occlusion) - predicted joint pose, 275 | 1,16,-280.162,208.85,535.035,0.516369,0.194259,-0.354562,-0.754926,The joint is not observed(likely due to occlusion) - predicted joint pose, 276 | 1,17,-238.396,153.037,611.217,0.105131,-0.631085,0.728841,0.243864,The joint is not observed(likely due to occlusion) - predicted joint pose, 277 | 1,18,-136.922,144.317,721.003,-0.181594,0.370376,0.0955014,0.905939,Medium confidence in joint pose, 278 | 1,19,84.974,231.194,483.611,0.58412,-0.372105,0.0887859,-0.715862,Medium confidence in joint pose, 279 | 1,20,98.0517,521.271,345.695,-0.497222,0.40663,-0.0909682,0.761017,The joint is not observed(likely due to occlusion) - predicted joint pose, 280 | 1,21,200.422,538.912,227.438,0.891075,-0.22539,0.346083,-0.188178,The joint is not observed(likely due to occlusion) - predicted joint pose, 281 | 1,22,-235.549,111.181,619.014,0.956333,0.0339247,0.187052,0.222009,Medium confidence in joint pose, 282 | 1,23,43.8185,258.122,503.864,0.717989,0.122704,0.14506,0.669621,Medium confidence in joint pose, 283 | 1,24,63.6761,582.041,489.58,0.784196,0.127931,0.178788,0.580263,The joint is not observed(likely due to occlusion) - predicted joint pose, 284 | 1,25,186.564,630.659,430.356,0.148327,0.222396,0.0360187,0.962934,The joint is not observed(likely due to occlusion) - predicted joint pose, 285 | 1,26,-103.751,-368.622,782.745,0.777629,-0.374626,0.215126,-0.456803,Medium confidence in joint pose, 286 | 1,27,-15.2436,-369.392,680.794,0.777629,-0.374626,0.215126,-0.456803,Medium confidence in joint pose, 287 | 1,28,-4.4901,-395.043,718.715,0.872875,-0.112783,0.417018,0.226858,Medium confidence in joint pose, 288 | 1,29,-28.2366,-390.368,822.443,0.456803,0.215126,0.374626,0.777629,Medium confidence in joint pose, 289 | 1,30,-34.5633,-407.419,689.182,0.872875,-0.112783,0.417018,0.226858,Medium confidence in joint pose, 290 | 1,31,-126.775,-441.955,738.405,0.777629,-0.374626,0.215126,-0.456803,Medium confidence in joint pose, 291 | 1,0,-241.535,115.979,659.477,0.63187,-0.427569,0.158327,-0.626783,Medium confidence in joint pose, 292 | 1,1,-217.918,-25.5084,712.513,0.665168,-0.418281,0.181449,-0.591328,Medium confidence in joint pose, 293 | 1,2,-189.212,-140.248,743.486,0.699955,-0.418808,0.170831,-0.552702,Medium confidence in joint pose, 294 | 1,3,-128.18,-310.908,785.763,0.742023,-0.40376,0.203867,-0.494791,Medium confidence in joint pose, 295 | 1,4,-118.464,-271.492,796.602,0.632437,-0.662986,-0.399928,-0.0230492,Medium confidence in joint pose, 296 | 1,5,-35.2506,-210.081,862.337,-0.473514,0.331078,0.62833,-0.520935,Medium confidence in joint pose, 297 | 1,6,-113.98,5.34548,921.584,0.167037,-0.591074,-0.393756,0.683876,Medium confidence in joint pose, 298 | 1,7,-162.783,143.318,787.001,-0.0653232,0.868071,0.483916,-0.0895038,Medium confidence in joint pose, 299 | 1,8,-115.771,209.982,774.37,-0.108986,0.296934,0.948447,-0.02,The joint is not observed(likely due to occlusion) - predicted joint pose, 300 | 1,9,-189.865,262.559,792.419,-0.108986,0.296934,0.948447,-0.02,The joint is not observed(likely due to occlusion) - predicted joint pose, 301 | 1,10,-134.105,105.515,723.474,0.520422,-0.670528,0.515397,-0.11798,Medium confidence in joint pose, 302 | 1,11,-159.135,-293.951,762.403,0.640772,0.624871,-0.0478311,0.443464,Medium confidence in joint pose, 303 | 1,12,-227.013,-351.282,693.013,0.148579,0.854448,-0.487748,0.0997183,Medium confidence in joint pose, 304 | 1,13,-348.741,-157.248,616.897,-0.106419,-0.640806,0.746557,-0.143855,The joint is not observed(likely due to occlusion) - predicted joint pose, 305 | 1,14,-317.315,29.2302,547.785,-0.447729,-0.502985,0.599381,0.432768,The joint is not observed(likely due to occlusion) - predicted joint pose, 306 | 1,15,-303.336,115.911,533.983,-0.408583,-0.552986,0.553586,0.469903,The joint is not observed(likely due to occlusion) - predicted joint pose, 307 | 1,16,-298.371,206.615,540.113,-0.408583,-0.552986,0.553586,0.469903,The joint is not observed(likely due to occlusion) - predicted joint pose, 308 | 1,17,-250.193,121.062,603.168,0.16131,-0.54618,0.820046,0.0564892,The joint is not observed(likely due to occlusion) - predicted joint pose, 309 | 1,18,-184.001,142.701,705.144,-0.362606,0.41349,0.0523669,0.833547,Medium confidence in joint pose, 310 | 1,19,-48.415,335.291,455.547,0.55975,-0.41349,0.0528187,-0.716181,The joint is not observed(likely due to occlusion) - predicted joint pose, 311 | 1,20,-38.1128,612.577,280.691,0.508231,-0.427328,0.045669,-0.746329,The joint is not observed(likely due to occlusion) - predicted joint pose, 312 | 1,21,65.5425,628.625,159.084,0.888435,-0.271896,0.32855,-0.169735,The joint is not observed(likely due to occlusion) - predicted joint pose, 313 | 1,22,-293.417,91.8833,618.298,0.900188,0.0423654,0.335656,0.27423,Medium confidence in joint pose, 314 | 1,23,-79.4111,270.885,419.1,0.730986,0.165487,0.294966,0.592679,The joint is not observed(likely due to occlusion) - predicted joint pose, 315 | 1,24,-38.4959,590.415,341.191,0.767921,0.17433,0.331859,0.519399,The joint is not observed(likely due to occlusion) - predicted joint pose, 316 | 1,25,63.177,623.707,239.282,0.180072,0.362813,0.111832,0.907433,The joint is not observed(likely due to occlusion) - predicted joint pose, 317 | 1,26,-98.2621,-373.855,792.556,0.746779,-0.43483,0.235206,-0.444885,Medium confidence in joint pose, 318 | 1,27,-19.7309,-384.669,679.904,0.746779,-0.43483,0.235206,-0.444885,Medium confidence in joint pose, 319 | 1,28,-4.47767,-407.167,719.444,0.842633,-0.141155,0.473787,0.213471,Medium confidence in joint pose, 320 | 1,29,-17.1526,-392.471,826.37,0.444885,0.235206,0.43483,0.746779,Medium confidence in joint pose, 321 | 1,30,-38.1582,-422.425,694.114,0.842633,-0.141155,0.473787,0.213471,Medium confidence in joint pose, 322 | 1,31,-126.036,-452.47,757.278,0.746779,-0.43483,0.235206,-0.444885,Medium confidence in joint pose, 323 | -------------------------------------------------------------------------------- /matlab/extrinsic_calculation/joints_sync_tf.csv: -------------------------------------------------------------------------------- 1 | ,,Position,,,Orientation,,,,Confidence Level 2 | Body ID,Joint #,x,y,z,x,y,z,w 3 | 1,0,-178.107,101.278,663.653,0.740819,-0.448822,0.160995,-0.473104,Medium confidence in joint pose, 4 | 1,1,-183.648,-23.2967,703.352,0.7394,-0.449302,0.159651,-0.475319,Medium confidence in joint pose, 5 | 1,2,-187.254,-123.038,734.719,0.769449,-0.415482,0.166652,-0.455576,Medium confidence in joint pose, 6 | 1,3,-183.456,-276.808,775.969,0.803505,-0.40078,0.199434,-0.392404,Medium confidence in joint pose, 7 | 1,4,-175.502,-245.404,791.562,0.69664,-0.584274,-0.416265,0.00630969,Medium confidence in joint pose, 8 | 1,5,-132.897,-219.586,883.832,0.502439,-0.312611,-0.69336,0.411195,Medium confidence in joint pose, 9 | 1,6,-159.363,-30.7883,952.706,-0.171407,0.656437,0.384142,-0.626216,Medium confidence in joint pose, 10 | 1,7,-63.8799,76.1255,861.072,0.371341,0.617208,0.690051,-0.0706363,Medium confidence in joint pose, 11 | 1,8,-14.1082,119.738,836.379,0.354797,0.496096,0.781668,-0.130392,The joint is not observed(likely due to occlusion) - predicted joint pose, 12 | 1,9,18.1902,172.495,786.824,0.354797,0.496096,0.781668,-0.130392,The joint is not observed(likely due to occlusion) - predicted joint pose, 13 | 1,10,-27.5364,111.58,765.99,0.0117026,-0.522629,-0.418742,0.742548,The joint is not observed(likely due to occlusion) - predicted joint pose, 14 | 1,11,-194.061,-257.26,747.384,0.567542,0.692603,-0.0154642,0.444924,Medium confidence in joint pose, 15 | 1,12,-226.13,-282.397,659.946,0.231834,0.929335,-0.276221,0.0793248,Medium confidence in joint pose, 16 | 1,13,-293.388,-129.436,538.547,0.178043,0.731029,-0.636834,0.168346,The joint is not observed(likely due to occlusion) - predicted joint pose, 17 | 1,14,-212.636,9.69182,476.867,0.712854,0.310249,-0.548748,-0.307345,The joint is not observed(likely due to occlusion) - predicted joint pose, 18 | 1,15,-175.829,61.6991,435.341,0.652984,0.395825,-0.490613,-0.419801,The joint is not observed(likely due to occlusion) - predicted joint pose, 19 | 1,16,-145.876,131.451,417.816,0.652984,0.395825,-0.490613,-0.419801,The joint is not observed(likely due to occlusion) - predicted joint pose, 20 | 1,17,-145.553,89.8927,501.397,0.0629214,0.708762,-0.701925,-0.0316098,The joint is not observed(likely due to occlusion) - predicted joint pose, 21 | 1,18,-149.054,118.393,721.415,0.626656,-0.466597,0.0608726,-0.621196,Medium confidence in joint pose, 22 | 1,19,-31.0634,355.377,594.333,0.777828,-0.42989,0.191425,-0.416576,The joint is not observed(likely due to occlusion) - predicted joint pose, 23 | 1,20,-61.4374,626.615,529,0.766339,-0.421084,0.159011,-0.458398,The joint is not observed(likely due to occlusion) - predicted joint pose, 24 | 1,21,38.4153,696.815,465.874,0.869036,-0.185402,0.404681,0.215953,The joint is not observed(likely due to occlusion) - predicted joint pose, 25 | 1,22,-204.305,85.8444,611.566,0.649325,0.0330056,0.488158,0.582228,The joint is not observed(likely due to occlusion) - predicted joint pose, 26 | 1,23,-63.0295,299.924,469.232,0.485224,0.152749,0.46474,0.724736,The joint is not observed(likely due to occlusion) - predicted joint pose, 27 | 1,24,-44.6335,567.415,376.84,0.512288,0.154053,0.500997,0.680317,The joint is not observed(likely due to occlusion) - predicted joint pose, 28 | 1,25,50.7395,605.263,302.972,-0.113956,0.467126,0.24792,0.841037,The joint is not observed(likely due to occlusion) - predicted joint pose, 29 | 1,26,-172.935,-334.628,787.652,0.793703,-0.412484,0.210979,-0.394183,Medium confidence in joint pose, 30 | 1,27,-68.142,-364.394,742.645,0.793703,-0.412484,0.210979,-0.394183,Medium confidence in joint pose, 31 | 1,28,-81.1529,-385.532,775.349,0.839962,-0.142486,0.440855,0.282503,Medium confidence in joint pose, 32 | 1,29,-137.552,-367.991,847.173,0.394183,0.210979,0.412484,0.793703,Medium confidence in joint pose, 33 | 1,30,-95.2114,-390.868,740.069,0.839962,-0.142486,0.440855,0.282503,Medium confidence in joint pose, 34 | 1,31,-191.271,-393.727,741.043,0.793703,-0.412484,0.210979,-0.394183,Medium confidence in joint pose, 35 | 1,0,-178.763,101.622,663.933,0.740864,-0.448383,0.160729,-0.473539,Medium confidence in joint pose, 36 | 1,1,-184.254,-23.2966,703.706,0.739393,-0.448879,0.159339,-0.475833,Medium confidence in joint pose, 37 | 1,2,-187.837,-123.309,735.143,0.769467,-0.414608,0.16567,-0.456699,Medium confidence in joint pose, 38 | 1,3,-184.156,-277.469,776.584,0.803613,-0.399987,0.198386,-0.393523,Medium confidence in joint pose, 39 | 1,4,-176.251,-245.972,792.237,0.695696,-0.584293,-0.417832,0.00495723,Medium confidence in joint pose, 40 | 1,5,-134.03,-219.898,884.927,-0.497821,0.319323,0.69314,-0.412025,Medium confidence in joint pose, 41 | 1,6,-159.281,-29.6623,951.863,-0.166399,0.662244,0.379266,-0.624421,Medium confidence in joint pose, 42 | 1,7,-61.743,75.3689,859.379,0.375176,0.618198,0.686759,-0.0737342,Medium confidence in joint pose, 43 | 1,8,-11.3865,118.514,834.513,0.3579,0.496594,0.779231,-0.134543,The joint is not observed(likely due to occlusion) - predicted joint pose, 44 | 1,9,21.4197,170.857,784.517,0.3579,0.496594,0.779231,-0.134543,The joint is not observed(likely due to occlusion) - predicted joint pose, 45 | 1,10,-25.2098,110.599,764.023,0.0136757,-0.523043,-0.415266,0.744173,The joint is not observed(likely due to occlusion) - predicted joint pose, 46 | 1,11,-194.679,-257.884,747.872,0.567683,0.691885,-0.0169077,0.445808,Medium confidence in joint pose, 47 | 1,12,-226.447,-283.136,660.075,0.231393,0.928875,-0.277597,0.0811656,Medium confidence in joint pose, 48 | 1,13,-293.177,-129.816,537.906,0.176795,0.729728,-0.638252,0.169924,The joint is not observed(likely due to occlusion) - predicted joint pose, 49 | 1,14,-211.672,9.53864,476.446,0.710998,0.311703,-0.550645,-0.30678,The joint is not observed(likely due to occlusion) - predicted joint pose, 50 | 1,15,-174.566,61.7009,435.01,0.650889,0.397988,-0.491908,-0.419495,The joint is not observed(likely due to occlusion) - predicted joint pose, 51 | 1,16,-144.557,131.712,417.693,0.650889,0.397988,-0.491908,-0.419495,The joint is not observed(likely due to occlusion) - predicted joint pose, 52 | 1,17,-144.893,90.1985,501.432,0.0597335,0.709825,-0.701185,-0.0303466,The joint is not observed(likely due to occlusion) - predicted joint pose, 53 | 1,18,-149.78,118.809,721.915,0.626862,-0.465918,0.0606001,-0.621524,Medium confidence in joint pose, 54 | 1,19,-31.5782,356.644,594.812,0.778455,-0.429163,0.191318,-0.416202,The joint is not observed(likely due to occlusion) - predicted joint pose, 55 | 1,20,-62.7654,628.553,529.44,0.767211,-0.420242,0.159157,-0.457661,The joint is not observed(likely due to occlusion) - predicted joint pose, 56 | 1,21,37.1808,699.425,466.416,0.869132,-0.184696,0.40419,0.217087,The joint is not observed(likely due to occlusion) - predicted joint pose, 57 | 1,22,-204.898,86.1242,611.649,0.64954,0.0332903,0.488138,0.581989,The joint is not observed(likely due to occlusion) - predicted joint pose, 58 | 1,23,-63.3327,301.019,469.221,0.485071,0.153289,0.464562,0.724838,The joint is not observed(likely due to occlusion) - predicted joint pose, 59 | 1,24,-45.3671,569.373,376.927,0.511884,0.155018,0.50122,0.680238,The joint is not observed(likely due to occlusion) - predicted joint pose, 60 | 1,25,50.1445,607.627,302.872,-0.11419,0.467966,0.2474,0.840691,The joint is not observed(likely due to occlusion) - predicted joint pose, 61 | 1,26,-173.639,-335.435,788.366,0.793609,-0.412066,0.210109,-0.395273,Medium confidence in joint pose, 62 | 1,27,-68.4272,-365.314,743.59,0.793609,-0.412066,0.210109,-0.395273,Medium confidence in joint pose, 63 | 1,28,-81.5769,-386.486,776.353,0.840666,-0.142805,0.439944,0.281666,Medium confidence in joint pose, 64 | 1,29,-138.351,-368.85,848.178,0.395273,0.210109,0.412066,0.793609,Medium confidence in joint pose, 65 | 1,30,-95.5616,-391.859,740.938,0.840666,-0.142805,0.439944,0.281666,Medium confidence in joint pose, 66 | 1,31,-191.879,-394.721,741.614,0.793609,-0.412066,0.210109,-0.395273,Medium confidence in joint pose, 67 | 1,0,-165.784,115.892,670.276,0.714564,-0.475394,0.173231,-0.483105,Medium confidence in joint pose, 68 | 1,1,-174.836,-19.9918,714.894,0.705486,-0.478523,0.164389,-0.496268,Medium confidence in joint pose, 69 | 1,2,-184.272,-128.061,751.744,0.762373,-0.387419,0.137773,-0.499712,Medium confidence in joint pose, 70 | 1,3,-193.139,-295.799,798.634,0.799991,-0.375123,0.168397,-0.436966,Medium confidence in joint pose, 71 | 1,4,-184.046,-261.694,816.078,0.64807,-0.594389,-0.475654,-0.0214637,Medium confidence in joint pose, 72 | 1,5,-148.088,-223.092,918.072,-0.422442,0.35238,0.746431,-0.37445,Medium confidence in joint pose, 73 | 1,6,-187.582,-10.8652,969.786,-0.0419127,0.772953,0.289612,-0.56295,Medium confidence in joint pose, 74 | 1,7,-46.4745,46.9903,862.772,0.150756,0.624409,0.743347,-0.186606,Medium confidence in joint pose, 75 | 1,8,-8.38257,107.777,833.843,0.132927,0.553286,0.7977,-0.199698,The joint is not observed(likely due to occlusion) - predicted joint pose, 76 | 1,9,12.8898,182.721,795.572,0.132927,0.553286,0.7977,-0.199698,The joint is not observed(likely due to occlusion) - predicted joint pose, 77 | 1,10,-29.4624,113.874,766.031,0.152114,-0.470178,-0.40846,0.767433,The joint is not observed(likely due to occlusion) - predicted joint pose, 78 | 1,11,-200.874,-274.232,766.261,0.572675,0.666099,-0.0765475,0.471694,Medium confidence in joint pose, 79 | 1,12,-225.919,-300.858,667.148,0.208174,0.90811,-0.321161,0.169871,Medium confidence in joint pose, 80 | 1,13,-264.361,-138.332,514.622,-0.104623,-0.65266,0.708408,-0.24748,The joint is not observed(likely due to occlusion) - predicted joint pose, 81 | 1,14,-140.524,-3.20914,469.888,0.132519,0.966175,-0.208704,-0.073391,The joint is not observed(likely due to occlusion) - predicted joint pose, 82 | 1,15,-186.518,62.897,448.658,0.150467,0.814385,-0.560205,-0.0175267,The joint is not observed(likely due to occlusion) - predicted joint pose, 83 | 1,16,-176.439,146.126,432.844,0.150467,0.814385,-0.560205,-0.0175267,The joint is not observed(likely due to occlusion) - predicted joint pose, 84 | 1,17,-157.006,66.787,533.707,0.392712,-0.558971,0.702814,-0.198447,The joint is not observed(likely due to occlusion) - predicted joint pose, 85 | 1,18,-128.747,133.365,731.002,0.590606,-0.550341,0.081445,-0.584531,Medium confidence in joint pose, 86 | 1,19,-25.3586,387.358,563.041,0.736216,-0.502206,0.239441,-0.385283,The joint is not observed(likely due to occlusion) - predicted joint pose, 87 | 1,20,-70.0004,684.328,497.717,0.724814,-0.50237,0.209286,-0.422454,The joint is not observed(likely due to occlusion) - predicted joint pose, 88 | 1,21,21.2556,759.567,404.675,0.814773,-0.207657,0.497945,0.212309,The joint is not observed(likely due to occlusion) - predicted joint pose, 89 | 1,22,-199.181,100.136,615.516,0.683262,0.0470299,0.495869,0.533905,The joint is not observed(likely due to occlusion) - predicted joint pose, 90 | 1,23,-22.6525,320.814,462.778,0.495742,0.191037,0.459921,0.71149,The joint is not observed(likely due to occlusion) - predicted joint pose, 91 | 1,24,1.00134,619.842,382.335,0.523773,0.198796,0.514059,0.649527,The joint is not observed(likely due to occlusion) - predicted joint pose, 92 | 1,25,101.506,661.044,296.482,-0.0842513,0.508012,0.225509,0.827026,The joint is not observed(likely due to occlusion) - predicted joint pose, 93 | 1,26,-186.21,-359.462,812.939,0.792685,-0.403666,0.205972,-0.407774,Medium confidence in joint pose, 94 | 1,27,-71.0989,-392.72,764.937,0.792685,-0.403666,0.205972,-0.407774,Medium confidence in joint pose, 95 | 1,28,-85.9795,-415.932,800.451,0.848853,-0.13979,0.431079,0.272174,Medium confidence in joint pose, 96 | 1,29,-148.577,-396.626,878.417,0.407774,0.205972,0.403666,0.792685,Medium confidence in joint pose, 97 | 1,30,-100.931,-421.461,761.596,0.848853,-0.13979,0.431079,0.272174,Medium confidence in joint pose, 98 | 1,31,-206.151,-423.765,761.322,0.792685,-0.403666,0.205972,-0.407774,Medium confidence in joint pose, 99 | 1,0,-178.279,124.175,658.702,0.701899,-0.48886,0.19057,-0.481703,Medium confidence in joint pose, 100 | 1,1,-187.227,-12.8392,706.161,0.692092,-0.492586,0.180722,-0.49569,Medium confidence in joint pose, 101 | 1,2,-197.006,-121.752,745.293,0.765387,-0.389093,0.143326,-0.492185,Medium confidence in joint pose, 102 | 1,3,-200.873,-290.607,797.519,0.802392,-0.376346,0.174067,-0.429221,Medium confidence in joint pose, 103 | 1,4,-195.248,-255.066,814.787,0.652877,-0.58997,-0.474874,-0.0134908,Medium confidence in joint pose, 104 | 1,5,-170.562,-210.458,919.436,-0.420807,0.345552,0.763762,-0.346673,Medium confidence in joint pose, 105 | 1,6,-232.941,1.20038,963.56,-0.0177319,0.801654,0.245134,-0.544928,Medium confidence in joint pose, 106 | 1,7,-72.4224,41.9016,872.74,0.0916985,0.645771,0.720097,-0.236709,Medium confidence in joint pose, 107 | 1,8,-32.7313,104.27,846.602,0.208133,0.937627,0.23752,-0.145329,Medium confidence in joint pose, 108 | 1,9,52.6685,108.439,867.376,0.208133,0.937627,0.23752,-0.145329,Medium confidence in joint pose, 109 | 1,10,13.142,73.9929,859.453,-0.359026,0.866609,0.234234,-0.255391,Medium confidence in joint pose, 110 | 1,11,-206.872,-270.18,763.411,0.567449,0.66538,-0.0624674,0.481009,Medium confidence in joint pose, 111 | 1,12,-220.627,-304.574,662.932,0.196818,0.900118,-0.328474,0.207737,Medium confidence in joint pose, 112 | 1,13,-235.451,-151.842,492.567,-0.0752823,-0.638037,0.714855,-0.276088,The joint is not observed(likely due to occlusion) - predicted joint pose, 113 | 1,14,-105.998,-14.3899,462.096,0.130637,0.9685,-0.183105,-0.106841,The joint is not observed(likely due to occlusion) - predicted joint pose, 114 | 1,15,-157.927,47.416,437.37,0.159019,0.849978,-0.499055,-0.0565151,The joint is not observed(likely due to occlusion) - predicted joint pose, 115 | 1,16,-162.818,131.544,417.91,0.159019,0.849978,-0.499055,-0.0565151,The joint is not observed(likely due to occlusion) - predicted joint pose, 116 | 1,17,-150.168,58.1538,521.755,0.41664,-0.637692,0.64502,-0.060904,The joint is not observed(likely due to occlusion) - predicted joint pose, 117 | 1,18,-144.874,143.92,722.005,0.586335,-0.561905,0.102082,-0.574502,Medium confidence in joint pose, 118 | 1,19,-40.3743,404.676,556.599,0.717985,-0.51458,0.247787,-0.397879,The joint is not observed(likely due to occlusion) - predicted joint pose, 119 | 1,20,-78.7497,703.023,475.484,0.706384,-0.520767,0.231389,-0.419861,The joint is not observed(likely due to occlusion) - predicted joint pose, 120 | 1,21,16.6665,778.603,383.531,0.800032,-0.205194,0.526674,0.201144,The joint is not observed(likely due to occlusion) - predicted joint pose, 121 | 1,22,-208.401,106.369,601.618,0.679494,0.0636194,0.518265,0.515404,The joint is not observed(likely due to occlusion) - predicted joint pose, 122 | 1,23,-23.9493,329.702,452.808,0.522036,0.196319,0.483765,0.674469,The joint is not observed(likely due to occlusion) - predicted joint pose, 123 | 1,24,21.3149,626.887,359.275,0.537734,0.208895,0.525505,0.625339,The joint is not observed(likely due to occlusion) - predicted joint pose, 124 | 1,25,130.166,664.624,279.107,-0.0573003,0.523201,0.226365,0.819595,The joint is not observed(likely due to occlusion) - predicted joint pose, 125 | 1,26,-191.642,-354.186,814.756,0.785941,-0.416586,0.212087,-0.404687,Medium confidence in joint pose, 126 | 1,27,-70.642,-385.614,776.115,0.785941,-0.416586,0.212087,-0.404687,Medium confidence in joint pose, 127 | 1,28,-87.5333,-408.176,811.935,0.841901,-0.144603,0.444539,0.269588,Medium confidence in joint pose, 128 | 1,29,-157.225,-387.688,885.282,0.404687,0.212087,0.416586,0.785941,Medium confidence in joint pose, 129 | 1,30,-99.5691,-415.944,771.842,0.841901,-0.144603,0.444539,0.269588,Medium confidence in joint pose, 130 | 1,31,-205.791,-422.162,764.011,0.785941,-0.416586,0.212087,-0.404687,Medium confidence in joint pose, 131 | 1,0,-178.915,124.729,659.602,0.702294,-0.487299,0.189697,-0.483051,Medium confidence in joint pose, 132 | 1,1,-187.866,-12.4836,706.838,0.692919,-0.490841,0.180335,-0.496404,Medium confidence in joint pose, 133 | 1,2,-197.455,-121.602,745.714,0.764609,-0.388665,0.142023,-0.494108,Medium confidence in joint pose, 134 | 1,3,-201.758,-290.621,797.848,0.80177,-0.376024,0.172734,-0.431201,Medium confidence in joint pose, 135 | 1,4,-195.935,-255.088,815.14,0.651218,-0.592078,-0.474526,-0.0135646,Medium confidence in joint pose, 136 | 1,5,-170.285,-210.502,919.668,-0.414599,0.351425,0.762885,-0.350163,Medium confidence in joint pose, 137 | 1,6,-230.122,2.54361,961.479,-0.0131319,0.80393,0.24329,-0.542526,Medium confidence in joint pose, 138 | 1,7,-69.4196,41.7644,870.026,0.107267,0.638352,0.728484,-0.224304,Medium confidence in joint pose, 139 | 1,8,-30.4414,104.308,843.06,0.217074,0.941783,0.226332,-0.121231,Medium confidence in joint pose, 140 | 1,9,54.1024,107.184,867.522,0.217074,0.941783,0.226332,-0.121231,Medium confidence in joint pose, 141 | 1,10,15.9078,73.9201,858.35,-0.350732,0.870523,0.247273,-0.240901,The joint is not observed(likely due to occlusion) - predicted joint pose, 142 | 1,11,-207.81,-270.127,763.754,0.568353,0.664765,-0.0655997,0.480374,Medium confidence in joint pose, 143 | 1,12,-222.011,-303.982,663.064,0.19925,0.89542,-0.335013,0.215146,Medium confidence in joint pose, 144 | 1,13,-233.036,-151.283,492.139,-0.0737214,-0.630292,0.718848,-0.28382,The joint is not observed(likely due to occlusion) - predicted joint pose, 145 | 1,14,-100.776,-16.1403,462.457,0.119331,0.97107,-0.179279,-0.103161,The joint is not observed(likely due to occlusion) - predicted joint pose, 146 | 1,15,-153.537,45.0942,437.844,0.145379,0.868065,-0.470724,-0.0612122,The joint is not observed(likely due to occlusion) - predicted joint pose, 147 | 1,16,-164.541,128.574,417.797,0.145379,0.868065,-0.470724,-0.0612122,The joint is not observed(likely due to occlusion) - predicted joint pose, 148 | 1,17,-151.437,55.9519,519.906,-0.435443,0.655321,-0.615939,0.0395328,The joint is not observed(likely due to occlusion) - predicted joint pose, 149 | 1,18,-145.324,144.335,722.919,0.59226,-0.55431,0.098525,-0.576421,Medium confidence in joint pose, 150 | 1,19,-41.455,406.47,558.795,0.722537,-0.509212,0.240214,-0.401174,The joint is not observed(likely due to occlusion) - predicted joint pose, 151 | 1,20,-79.7285,704.619,475.975,0.713706,-0.511055,0.220636,-0.425167,The joint is not observed(likely due to occlusion) - predicted joint pose, 152 | 1,21,17.7082,780.442,386.167,0.808884,-0.205875,0.51215,0.202544,The joint is not observed(likely due to occlusion) - predicted joint pose, 153 | 1,22,-209.205,107.049,602.507,0.678515,0.0652229,0.519808,0.51494,The joint is not observed(likely due to occlusion) - predicted joint pose, 154 | 1,23,-26.2599,331.163,452.456,0.523264,0.196789,0.485439,0.672174,The joint is not observed(likely due to occlusion) - predicted joint pose, 155 | 1,24,19.6978,628.463,358.787,0.538971,0.207643,0.524414,0.625608,The joint is not observed(likely due to occlusion) - predicted joint pose, 156 | 1,25,128.436,666.172,278.26,-0.0566111,0.521549,0.226468,0.820667,The joint is not observed(likely due to occlusion) - predicted joint pose, 157 | 1,26,-192.692,-354.299,815.01,0.784699,-0.416514,0.208591,-0.408967,Medium confidence in joint pose, 158 | 1,27,-71.8608,-386.826,776.401,0.784699,-0.416514,0.208591,-0.408967,Medium confidence in joint pose, 159 | 1,28,-88.944,-409.183,812.303,0.844049,-0.147023,0.442016,0.265682,Medium confidence in joint pose, 160 | 1,29,-158.513,-387.94,885.667,0.408967,0.208591,0.416514,0.784699,Medium confidence in joint pose, 161 | 1,30,-101.057,-416.953,772.199,0.844049,-0.147023,0.442016,0.265682,Medium confidence in joint pose, 162 | 1,31,-207.41,-422.331,764.387,0.784699,-0.416514,0.208591,-0.408967,Medium confidence in joint pose, 163 | 1,0,-178.939,124.735,659.538,0.702292,-0.487276,0.189671,-0.483087,Medium confidence in joint pose, 164 | 1,1,-187.887,-12.4805,706.79,0.692913,-0.490818,0.180306,-0.496446,Medium confidence in joint pose, 165 | 1,2,-197.475,-121.601,745.678,0.764608,-0.388593,0.141959,-0.494184,Medium confidence in joint pose, 166 | 1,3,-201.786,-290.625,797.831,0.801776,-0.375957,0.172665,-0.431276,Medium confidence in joint pose, 167 | 1,4,-195.973,-255.087,815.124,0.651191,-0.592063,-0.474577,-0.013724,Medium confidence in joint pose, 168 | 1,5,-170.383,-210.494,919.67,-0.414583,0.351532,0.762912,-0.350016,Medium confidence in joint pose, 169 | 1,6,-230.249,2.55789,961.471,-0.0132313,0.804021,0.243228,-0.542416,Medium confidence in joint pose, 170 | 1,7,-69.4939,41.7923,870.096,0.106882,0.639092,0.72796,-0.224081,Medium confidence in joint pose, 171 | 1,8,-30.4337,104.342,843.252,0.216674,0.942164,0.225148,-0.121195,Medium confidence in joint pose, 172 | 1,9,54.0917,107.048,867.813,0.216674,0.942164,0.225148,-0.121195,Medium confidence in joint pose, 173 | 1,10,15.8459,73.9145,858.649,-0.351432,0.870643,0.246929,-0.239797,Medium confidence in joint pose, 174 | 1,11,-207.825,-270.133,763.73,0.568362,0.66472,-0.0656984,0.480412,Medium confidence in joint pose, 175 | 1,12,-221.982,-304.001,663.032,0.199229,0.895357,-0.335126,0.215255,Medium confidence in joint pose, 176 | 1,13,-232.92,-151.308,492.079,-0.0736466,-0.630171,0.718928,-0.283907,The joint is not observed(likely due to occlusion) - predicted joint pose, 177 | 1,14,-100.632,-16.1654,462.453,0.119285,0.97107,-0.179389,-0.103024,The joint is not observed(likely due to occlusion) - predicted joint pose, 178 | 1,15,-153.383,45.0709,437.806,0.145291,0.868042,-0.470808,-0.0611005,The joint is not observed(likely due to occlusion) - predicted joint pose, 179 | 1,16,-164.38,128.553,417.745,0.145291,0.868042,-0.470808,-0.0611005,The joint is not observed(likely due to occlusion) - predicted joint pose, 180 | 1,17,-151.328,55.9353,519.872,-0.435545,0.65526,-0.615923,0.0396581,The joint is not observed(likely due to occlusion) - predicted joint pose, 181 | 1,18,-145.369,144.354,722.866,0.592255,-0.554278,0.0985044,-0.576461,Medium confidence in joint pose, 182 | 1,19,-41.4775,406.499,558.737,0.722542,-0.509186,0.240184,-0.401216,The joint is not observed(likely due to occlusion) - predicted joint pose, 183 | 1,20,-79.7659,704.649,475.866,0.71371,-0.511027,0.220606,-0.425208,The joint is not observed(likely due to occlusion) - predicted joint pose, 184 | 1,21,17.6947,780.479,386.075,0.808916,-0.205876,0.512109,0.202518,The joint is not observed(likely due to occlusion) - predicted joint pose, 185 | 1,22,-209.212,107.044,602.433,0.678542,0.0652158,0.519785,0.514928,The joint is not observed(likely due to occlusion) - predicted joint pose, 186 | 1,23,-26.2452,331.18,452.402,0.523287,0.196781,0.485417,0.672174,The joint is not observed(likely due to occlusion) - predicted joint pose, 187 | 1,24,19.6953,628.494,358.714,0.538992,0.207645,0.524399,0.625601,The joint is not observed(likely due to occlusion) - predicted joint pose, 188 | 1,25,128.454,666.214,278.206,-0.0565916,0.52154,0.226456,0.820677,The joint is not observed(likely due to occlusion) - predicted joint pose, 189 | 1,26,-192.72,-354.303,815.005,0.784708,-0.416447,0.208526,-0.40905,Medium confidence in joint pose, 190 | 1,27,-71.8634,-386.825,776.451,0.784708,-0.416447,0.208526,-0.40905,Medium confidence in joint pose, 191 | 1,28,-88.9615,-409.182,812.35,0.844115,-0.147023,0.441923,0.26563,Medium confidence in joint pose, 192 | 1,29,-158.569,-387.935,885.685,0.40905,0.208526,0.416447,0.784708,Medium confidence in joint pose, 193 | 1,30,-101.057,-416.957,772.239,0.844115,-0.147023,0.441923,0.26563,Medium confidence in joint pose, 194 | 1,31,-207.412,-422.345,764.38,0.784708,-0.416447,0.208526,-0.40905,Medium confidence in joint pose, 195 | 1,0,-184.164,135.353,660.815,0.702331,-0.485954,0.190348,-0.484094,Medium confidence in joint pose, 196 | 1,1,-191.087,-2.86532,706.759,0.692903,-0.48952,0.180979,-0.497496,Medium confidence in joint pose, 197 | 1,2,-199.091,-112.836,744.603,0.764149,-0.386854,0.142677,-0.496048,Medium confidence in joint pose, 198 | 1,3,-201.132,-282.974,794.974,0.801468,-0.374166,0.173241,-0.433171,Medium confidence in joint pose, 199 | 1,4,-195.958,-247.447,812.751,0.651242,-0.591944,-0.474565,-0.016552,Medium confidence in joint pose, 200 | 1,5,-171.805,-203.453,918.265,-0.415103,0.353275,0.763058,-0.347316,Medium confidence in joint pose, 201 | 1,6,-235.338,8.76983,962.321,-0.0159345,0.805135,0.242524,-0.541004,Medium confidence in joint pose, 202 | 1,7,-74.1403,51.8611,872.343,0.103212,0.660383,0.707151,-0.230605,Medium confidence in joint pose, 203 | 1,8,-32.525,114.007,847.839,0.214908,0.943545,0.214222,-0.132839,Medium confidence in joint pose, 204 | 1,9,52.556,115.777,871.462,0.214908,0.943545,0.214222,-0.132839,The joint is not observed(likely due to occlusion) - predicted joint pose, 205 | 1,10,12.4525,83.6684,861.825,-0.355846,0.874029,0.230717,-0.237098,The joint is not observed(likely due to occlusion) - predicted joint pose, 206 | 1,11,-207.292,-262.133,760.97,0.568755,0.664959,-0.0681144,0.479278,The joint is not observed(likely due to occlusion) - predicted joint pose, 207 | 1,12,-220.454,-295.123,659.518,0.19946,0.894108,-0.33836,0.215174,The joint is not observed(likely due to occlusion) - predicted joint pose, 208 | 1,13,-232.398,-140.2,489.752,-0.0740212,-0.627879,0.720891,-0.28391,The joint is not observed(likely due to occlusion) - predicted joint pose, 209 | 1,14,-101.349,-2.65735,462.16,0.115543,0.971102,-0.180519,-0.104989,The joint is not observed(likely due to occlusion) - predicted joint pose, 210 | 1,15,-155.353,58.0945,438.201,0.142207,0.868703,-0.470087,-0.0644213,The joint is not observed(likely due to occlusion) - predicted joint pose, 211 | 1,16,-168.287,141.823,419.272,0.142207,0.868703,-0.470087,-0.0644213,The joint is not observed(likely due to occlusion) - predicted joint pose, 212 | 1,17,-154.175,67.44,520.984,-0.438378,0.652004,-0.617718,0.0337552,The joint is not observed(likely due to occlusion) - predicted joint pose, 213 | 1,18,-151.171,154.938,724.707,0.592372,-0.552873,0.0994263,-0.57753,Medium confidence in joint pose, 214 | 1,19,-50.5085,421.265,563.448,0.722857,-0.507636,0.240608,-0.402357,The joint is not observed(likely due to occlusion) - predicted joint pose, 215 | 1,20,-93.4062,720.425,483.119,0.714211,-0.509275,0.221112,-0.426205,The joint is not observed(likely due to occlusion) - predicted joint pose, 216 | 1,21,3.56348,799.089,394.493,0.809969,-0.204279,0.511227,0.202155,The joint is not observed(likely due to occlusion) - predicted joint pose, 217 | 1,22,-213.915,117.692,603.202,0.67926,0.0663131,0.519046,0.514588,The joint is not observed(likely due to occlusion) - predicted joint pose, 218 | 1,23,-33.5225,347.008,455.86,0.524174,0.197575,0.484452,0.671947,The joint is not observed(likely due to occlusion) - predicted joint pose, 219 | 1,24,8.07617,646.815,365.071,0.53989,0.208435,0.523426,0.625379,The joint is not observed(likely due to occlusion) - predicted joint pose, 220 | 1,25,116.898,687.209,285.239,-0.0558049,0.521419,0.225204,0.821152,The joint is not observed(likely due to occlusion) - predicted joint pose, 221 | 1,26,-191.166,-346.88,811.538,0.78445,-0.41456,0.20929,-0.411067,Medium confidence in joint pose, 222 | 1,27,-69.246,-377.227,773.274,0.78445,-0.41456,0.20929,-0.411067,Medium confidence in joint pose, 223 | 1,28,-86.2775,-400.319,808.906,0.845358,-0.145148,0.441129,0.264022,Medium confidence in joint pose, 224 | 1,29,-156.853,-380.914,882.246,0.411067,0.20929,0.41456,0.78445,Medium confidence in joint pose, 225 | 1,30,-98.0389,-407.83,768.515,0.845358,-0.145148,0.441129,0.264022,Medium confidence in joint pose, 226 | 1,31,-204.557,-414.737,759.891,0.78445,-0.41456,0.20929,-0.411067,Medium confidence in joint pose, 227 | 1,0,-169.488,132.553,654.534,0.705952,-0.475147,0.191429,-0.489103,Medium confidence in joint pose, 228 | 1,1,-180.651,-9.07683,705.139,0.695533,-0.47906,0.181416,-0.50381,Medium confidence in joint pose, 229 | 1,2,-192.409,-121.511,747.054,0.760784,-0.385517,0.151334,-0.499682,Medium confidence in joint pose, 230 | 1,3,-200.011,-296.439,802.052,0.798405,-0.37214,0.181762,-0.437063,Medium confidence in joint pose, 231 | 1,4,-191.243,-259.828,819.359,0.649933,-0.592458,-0.475754,-0.0154554,Medium confidence in joint pose, 232 | 1,5,-156.301,-211.856,924.625,-0.416386,0.354691,0.762315,-0.345965,Medium confidence in joint pose, 233 | 1,6,-207.723,11.812,968.2,-0.0182856,0.805302,0.2417,-0.54105,Medium confidence in joint pose, 234 | 1,7,-46.2906,45.7375,862.228,0.133242,0.653441,0.70812,-0.23201,Medium confidence in joint pose, 235 | 1,8,-1.51648,104.994,828.912,0.245926,0.947833,0.173292,-0.105367,The joint is not observed(likely due to occlusion) - predicted joint pose, 236 | 1,9,86.1928,96.5947,852.995,0.245926,0.947833,0.173292,-0.105367,The joint is not observed(likely due to occlusion) - predicted joint pose, 237 | 1,10,43.9348,66.492,847.058,-0.328083,0.89628,0.217186,-0.204633,The joint is not observed(likely due to occlusion) - predicted joint pose, 238 | 1,11,-207.934,-274.994,767.132,0.572758,0.675794,-0.0780411,0.457339,The joint is not observed(likely due to occlusion) - predicted joint pose, 239 | 1,12,-233.027,-306.263,663.442,0.218301,0.886169,-0.360805,0.192012,The joint is not observed(likely due to occlusion) - predicted joint pose, 240 | 1,13,-248.18,-143.294,490.625,-0.100265,-0.606725,0.739839,-0.272893,The joint is not observed(likely due to occlusion) - predicted joint pose, 241 | 1,14,-101.845,-15.6793,449.134,0.0937783,0.980297,-0.0958316,-0.145049,The joint is not observed(likely due to occlusion) - predicted joint pose, 242 | 1,15,-168.553,38.3686,431.512,0.148814,0.833539,-0.524766,-0.0876809,The joint is not observed(likely due to occlusion) - predicted joint pose, 243 | 1,16,-169.714,126.948,416.9,0.148814,0.833539,-0.524766,-0.0876809,The joint is not observed(likely due to occlusion) - predicted joint pose, 244 | 1,17,-150.358,49.344,520.745,-0.427863,0.651096,-0.625105,-0.04745,The joint is not observed(likely due to occlusion) - predicted joint pose, 245 | 1,18,-131.101,152.34,718.38,0.608751,-0.541258,0.109383,-0.569647,Medium confidence in joint pose, 246 | 1,19,-35.0999,426.118,544.149,0.720028,-0.50351,0.226787,-0.420244,The joint is not observed(likely due to occlusion) - predicted joint pose, 247 | 1,20,-60.2372,733.677,447.306,0.708594,-0.510308,0.215905,-0.436882,The joint is not observed(likely due to occlusion) - predicted joint pose, 248 | 1,21,39.2804,804.117,346.241,0.813492,-0.208746,0.508241,0.190647,The joint is not observed(likely due to occlusion) - predicted joint pose, 249 | 1,22,-204.103,114.711,596.963,0.676534,0.079376,0.498917,0.535801,The joint is not observed(likely due to occlusion) - predicted joint pose, 250 | 1,23,-23.361,351.762,437.526,0.550384,0.181433,0.471413,0.664778,The joint is not observed(likely due to occlusion) - predicted joint pose, 251 | 1,24,44.7658,652.217,328.434,0.566957,0.191321,0.505848,0.621348,The joint is not observed(likely due to occlusion) - predicted joint pose, 252 | 1,25,159.326,680.466,242.95,-0.0337503,0.496986,0.224648,0.837496,The joint is not observed(likely due to occlusion) - predicted joint pose, 253 | 1,26,-192.007,-362.791,819.42,0.783484,-0.407335,0.21882,-0.41515,Medium confidence in joint pose, 254 | 1,27,-70.8279,-400.924,771.326,0.783484,-0.407335,0.21882,-0.41515,Medium confidence in joint pose, 255 | 1,28,-86.9952,-423.661,809.542,0.847562,-0.1333,0.442759,0.260451,Medium confidence in joint pose, 256 | 1,29,-153.288,-399.412,890.174,0.41515,0.21882,0.407335,0.783484,Medium confidence in joint pose, 257 | 1,30,-102.478,-431.003,768.801,0.847562,-0.1333,0.442759,0.260451,Medium confidence in joint pose, 258 | 1,31,-213.22,-432.432,767.743,0.783484,-0.407335,0.21882,-0.41515,Medium confidence in joint pose, 259 | 1,0,-169.44,133.692,652.105,0.703134,-0.477649,0.196254,-0.488813,Medium confidence in joint pose, 260 | 1,1,-180.771,-10.3753,703.941,0.690638,-0.482426,0.184198,-0.506316,Medium confidence in joint pose, 261 | 1,2,-193.589,-124.48,747.305,0.755956,-0.391167,0.154465,-0.501656,Medium confidence in joint pose, 262 | 1,3,-202.336,-302.078,804.653,0.793751,-0.377521,0.185336,-0.439418,Medium confidence in joint pose, 263 | 1,4,-193.15,-264.731,821.974,0.647624,-0.59647,-0.473975,-0.0124493,Medium confidence in joint pose, 264 | 1,5,-157.844,-214.464,928.559,-0.414526,0.357628,0.761925,-0.346036,Medium confidence in joint pose, 265 | 1,6,-210.753,13.7066,969.686,-0.0136339,0.808438,0.234215,-0.539802,Medium confidence in joint pose, 266 | 1,7,-44.6706,44.5942,863.381,0.0890785,0.662903,0.708618,-0.224691,Medium confidence in joint pose, 267 | 1,8,-0.592957,108.379,834.134,0.207776,0.957705,0.156144,-0.123492,Medium confidence in joint pose, 268 | 1,9,88.567,97.711,858.285,0.207776,0.957705,0.156144,-0.123492,The joint is not observed(likely due to occlusion) - predicted joint pose, 269 | 1,10,46.7255,65.8063,848.949,-0.365657,0.887332,0.186964,-0.209718,The joint is not observed(likely due to occlusion) - predicted joint pose, 270 | 1,11,-210.326,-280.466,768.953,0.580167,0.675792,-0.0737441,0.448635,The joint is not observed(likely due to occlusion) - predicted joint pose, 271 | 1,12,-237.142,-312.675,663.827,0.233538,0.87954,-0.374609,0.177588,The joint is not observed(likely due to occlusion) - predicted joint pose, 272 | 1,13,-249.449,-144.123,490.185,-0.120882,-0.595277,0.748043,-0.26733,The joint is not observed(likely due to occlusion) - predicted joint pose, 273 | 1,14,-96.9819,-18.7194,446.816,0.0931227,0.97982,-0.0797589,-0.157859,The joint is not observed(likely due to occlusion) - predicted joint pose, 274 | 1,15,-167.138,33.6729,429.674,0.158479,0.815342,-0.549205,-0.092064,The joint is not observed(likely due to occlusion) - predicted joint pose, 275 | 1,16,-163.388,123.937,415.808,0.158479,0.815342,-0.549205,-0.092064,The joint is not observed(likely due to occlusion) - predicted joint pose, 276 | 1,17,-144.625,45.7074,521.4,-0.416487,0.646329,-0.636809,-0.0571942,The joint is not observed(likely due to occlusion) - predicted joint pose, 277 | 1,18,-130.411,154,717.077,0.614587,-0.541175,0.127805,-0.559534,Medium confidence in joint pose, 278 | 1,19,-40.7639,439.499,546.368,0.711978,-0.505865,0.230938,-0.428783,The joint is not observed(likely due to occlusion) - predicted joint pose, 279 | 1,20,-59.6647,752.564,446.188,0.702331,-0.512134,0.223384,-0.441077,The joint is not observed(likely due to occlusion) - predicted joint pose, 280 | 1,21,42.5804,823.303,343.559,0.812043,-0.204812,0.514842,0.183234,The joint is not observed(likely due to occlusion) - predicted joint pose, 281 | 1,22,-204.634,115.38,593.516,0.666193,0.0943978,0.505909,0.539751,The joint is not observed(likely due to occlusion) - predicted joint pose, 282 | 1,23,-28.2605,363.125,432.433,0.559157,0.183271,0.48083,0.650044,The joint is not observed(likely due to occlusion) - predicted joint pose, 283 | 1,24,49.8199,665.341,317.261,0.570661,0.198981,0.516016,0.607025,The joint is not observed(likely due to occlusion) - predicted joint pose, 284 | 1,25,165.814,691.059,228.463,-0.0210245,0.509541,0.226397,0.829862,The joint is not observed(likely due to occlusion) - predicted joint pose, 285 | 1,26,-194.577,-369.538,822.831,0.77651,-0.413594,0.224015,-0.419272,Medium confidence in joint pose, 286 | 1,27,-71.9207,-410.155,773.559,0.77651,-0.413594,0.224015,-0.419272,Medium confidence in joint pose, 287 | 1,28,-88.4764,-432.854,812.684,0.845546,-0.134053,0.450858,0.252606,Medium confidence in joint pose, 288 | 1,29,-155.279,-406.833,894.915,0.419272,0.224015,0.413594,0.77651,Medium confidence in joint pose, 289 | 1,30,-104.519,-440.4,771.331,0.845546,-0.134053,0.450858,0.252606,Medium confidence in joint pose, 290 | 1,31,-217.268,-440.499,770.777,0.77651,-0.413594,0.224015,-0.419272,Medium confidence in joint pose, 291 | 1,0,-201.65,127.433,638.856,0.694389,-0.491092,0.208459,-0.482905,Medium confidence in joint pose, 292 | 1,1,-196.35,-13.8683,698.143,0.682772,-0.495885,0.196784,-0.499195,Medium confidence in joint pose, 293 | 1,2,-195.054,-125.821,748.045,0.754566,-0.399077,0.162393,-0.494971,Medium confidence in joint pose, 294 | 1,3,-183.347,-300.124,813.588,0.791829,-0.384769,0.193873,-0.432866,Medium confidence in joint pose, 295 | 1,4,-171.985,-261.721,826.65,0.648926,-0.59554,-0.473525,0.00117866,Medium confidence in joint pose, 296 | 1,5,-116.302,-203.24,919.242,-0.406393,0.361011,0.76277,-0.350283,Medium confidence in joint pose, 297 | 1,6,-168.133,25.8424,954.446,-0.0138997,0.807375,0.245545,-0.53634,Medium confidence in joint pose, 298 | 1,7,-28.435,58.8505,816.139,0.0632456,0.651172,0.724752,-0.216126,Medium confidence in joint pose, 299 | 1,8,2.66931,125.24,777.751,0.192542,0.969648,0.0952503,-0.116782,The joint is not observed(likely due to occlusion) - predicted joint pose, 300 | 1,9,93.3644,108.452,788.543,0.192542,0.969648,0.0952503,-0.116782,The joint is not observed(likely due to occlusion) - predicted joint pose, 301 | 1,10,55.4922,75.3664,790.656,-0.390322,0.893503,0.152801,-0.1611,The joint is not observed(likely due to occlusion) - predicted joint pose, 302 | 1,11,-200.105,-280.678,779.799,0.58145,0.681436,-0.0640529,0.439839,The joint is not observed(likely due to occlusion) - predicted joint pose, 303 | 1,12,-249.07,-318.758,685.318,0.244729,0.875984,-0.378764,0.171164,The joint is not observed(likely due to occlusion) - predicted joint pose, 304 | 1,13,-301.956,-159.879,510.619,-0.139381,-0.605851,0.737398,-0.264126,The joint is not observed(likely due to occlusion) - predicted joint pose, 305 | 1,14,-171.091,-33.3337,423.403,0.12496,0.966921,-0.0606302,-0.213947,The joint is not observed(likely due to occlusion) - predicted joint pose, 306 | 1,15,-245.501,15.4982,427.697,0.218817,0.79044,-0.560194,-0.116222,The joint is not observed(likely due to occlusion) - predicted joint pose, 307 | 1,16,-243.652,104.373,406.964,0.218817,0.79044,-0.560194,-0.116222,The joint is not observed(likely due to occlusion) - predicted joint pose, 308 | 1,17,-200.762,31.3536,510.437,-0.373688,0.668039,-0.626391,-0.14736,The joint is not observed(likely due to occlusion) - predicted joint pose, 309 | 1,18,-148.653,151.447,691.35,0.619235,-0.54401,0.15454,-0.544719,Medium confidence in joint pose, 310 | 1,19,-115.268,438.617,504.815,0.697401,-0.512869,0.238367,-0.440204,The joint is not observed(likely due to occlusion) - predicted joint pose, 311 | 1,20,-154.631,745.828,394.401,0.684657,-0.523698,0.236504,-0.448388,The joint is not observed(likely due to occlusion) - predicted joint pose, 312 | 1,21,-78.987,809.85,267.509,0.804757,-0.203869,0.53234,0.165585,The joint is not observed(likely due to occlusion) - predicted joint pose, 313 | 1,22,-249.44,105.78,591.519,0.639417,0.118135,0.533047,0.541342,The joint is not observed(likely due to occlusion) - predicted joint pose, 314 | 1,23,-138.699,356.367,383.999,0.556788,0.192144,0.510988,0.626067,The joint is not observed(likely due to occlusion) - predicted joint pose, 315 | 1,24,-94.0848,648.549,232.192,0.56565,0.203254,0.537741,0.591238,The joint is not observed(likely due to occlusion) - predicted joint pose, 316 | 1,25,-4.65591,668.439,115.787,-0.0133926,0.527787,0.238767,0.815016,The joint is not observed(likely due to occlusion) - predicted joint pose, 317 | 1,26,-168.954,-366.199,832.443,0.76804,-0.427084,0.22817,-0.419108,Medium confidence in joint pose, 318 | 1,27,-60.0965,-408.734,758.873,0.76804,-0.427084,0.22817,-0.419108,Medium confidence in joint pose, 319 | 1,28,-66.66,-428.962,802.021,0.839441,-0.140653,0.463335,0.246733,Medium confidence in joint pose, 320 | 1,29,-113.333,-398.305,895.574,0.419108,0.22817,0.427084,0.76804,Medium confidence in joint pose, 321 | 1,30,-91.5533,-439.323,766.076,0.839441,-0.140653,0.463335,0.246733,Medium confidence in joint pose, 322 | 1,31,-201.235,-440.514,791.533,0.76804,-0.427084,0.22817,-0.419108,Medium confidence in joint pose, 323 | -------------------------------------------------------------------------------- /matlab/extrinsic_calculation/rt_cal.m: -------------------------------------------------------------------------------- 1 | % computes Rotation and Translation matrices from two pos+orientation streams 2 | % transforms data stream 1 (sub) onto data stream 2 (main) 3 | % SUBORDINATE --> MAIN data space 4 | 5 | clear all;clc;close all; 6 | %% import data 7 | % extract positional and quarternion components 8 | 9 | % data stream 1: SUBORDINATE 1 10 | n_joints = 32; 11 | % WINDOWS 12 | % file1='joints_sync_2.csv'; 13 | % data1=xlsread(file1); 14 | % mainpos1 = data1(:,3:5); 15 | % mainorientation1 = data1(:,6:9); 16 | 17 | % LINUX 18 | maindata1 = readtable('joints_sync_1.csv','Format','auto','ReadRowNames',false); 19 | mainpos1 = table2array(maindata1(:,3:5)); 20 | mainorientation1 = table2array(maindata1(:,6:9)); 21 | 22 | % data stream 2: MAIN 23 | % WINDOWS 24 | % file2='joints_sync_2.csv'; 25 | % subdata2=xlsread(file2); 26 | % subpos2 = data2(:,3:5); 27 | % suborientation2 = data2(:,6:9); 28 | 29 | % LINUX 30 | subdata2 = readtable('joints_sync_2.csv','Format','auto','ReadRowNames',false); 31 | subpos2 = table2array(subdata2(:,3:5)); 32 | suborientation2 = table2array(subdata2(:,6:9)); 33 | 34 | %% if transformed joint points are available, visualize 35 | % data stream 3: SUBORDINATE TRANSFORMED 36 | subdata2_tf = readtable('joints_sync_tf.csv','Format','auto','ReadRowNames',false); 37 | subpos2_tf = table2array(subdata2_tf(:,3:5)); 38 | suborientation2_tf = table2array(subdata2_tf(:,6:9)); 39 | 40 | f1 = figure('Position',[300 300 2100 600]); 41 | for frame = 0:round(size(subpos2_tf,1)/32)-1 42 | startidx = frame*n_joints; 43 | 44 | % perform transformation here 45 | [R_1,t_1] = arun(subpos2(frame*n_joints+1:frame*n_joints+n_joints,:)',mainpos1(frame*n_joints+1:frame*n_joints+n_joints,:)'); 46 | R_1 47 | t_1' 48 | subpos2_all = subpos2(startidx+1:startidx+n_joints, 1:3); 49 | subpos2_tran = R_1*subpos2_all'+t_1; 50 | subpos2_tran = subpos2_tran'; 51 | 52 | figure(f1); 53 | subplot(131); 54 | scatter3(mainpos1(startidx+1:startidx+n_joints,1),mainpos1(startidx+1:startidx+n_joints,2),mainpos1(startidx+1:startidx+n_joints,3),'g'); hold on; 55 | scatter3(subpos2(startidx+1:startidx+n_joints,1),subpos2(startidx+1:startidx+n_joints,2),subpos2(startidx+1:startidx+n_joints,3),'b'); hold off; 56 | % legend('mainpos1 orig','subpos2 orig'); 57 | title('original'); 58 | 59 | subplot(132); 60 | scatter3(mainpos1(startidx+1:startidx+n_joints,1),mainpos1(startidx+1:startidx+n_joints,2),mainpos1(startidx+1:startidx+n_joints,3),'g'); hold on; 61 | scatter3(subpos2_tf(startidx+1:startidx+n_joints,1),subpos2_tf(startidx+1:startidx+n_joints,2),subpos2_tf(startidx+1:startidx+n_joints,3),'b'); hold off; 62 | % legend('mainpos1 orig','subpos2 tf'); 63 | title('transformed'); 64 | 65 | subplot(133); 66 | scatter3(mainpos1(startidx+1:startidx+n_joints,1),mainpos1(startidx+1:startidx+n_joints,2),mainpos1(startidx+1:startidx+n_joints,3),'g'); hold on; 67 | scatter3(subpos2_tran(:,1),subpos2_tran(:,2),subpos2_tran(:,3),'b'); hold off; 68 | % legend('mainpos1 orig','subpos2 transformed'); 69 | title('supposed to be transformed like this...'); 70 | 71 | sgtitle(sprintf("frame: %i",frame)); 72 | 73 | pause(1); 74 | 75 | end 76 | 77 | %% 3dof data 78 | figure('Position',[300 300 1600 600]); 79 | % frame = 20; % indicate which frame to look at 80 | for frame = 0:round(size(subpos2,1)/32)-1 81 | startidx = frame*n_joints; 82 | [R_1,t_1] = arun(subpos2(frame*n_joints+1:frame*n_joints+n_joints,:)',mainpos1(frame*n_joints+1:frame*n_joints+n_joints,:)'); 83 | R_1 84 | t_1' 85 | subpos2_all = subpos2(startidx+1:startidx+n_joints, 1:3); 86 | subpos2_tran = R_1*subpos2_all'+t_1; 87 | subpos2_tran = subpos2_tran'; 88 | 89 | 90 | figure(1); 91 | subplot(121); 92 | scatter3(mainpos1(startidx+1:startidx+n_joints,1),mainpos1(startidx+1:startidx+n_joints,2),mainpos1(startidx+1:startidx+n_joints,3),'g'); hold on; 93 | scatter3(subpos2(startidx+1:startidx+n_joints,1),subpos2(startidx+1:startidx+n_joints,2),subpos2(startidx+1:startidx+n_joints,3),'b'); hold off; 94 | legend('mainpos1 orig','subpos2 orig'); 95 | title('original'); 96 | 97 | subplot(122); 98 | scatter3(mainpos1(startidx+1:startidx+n_joints,1),mainpos1(startidx+1:startidx+n_joints,2),mainpos1(startidx+1:startidx+n_joints,3),'g'); hold on; 99 | scatter3(subpos2_tran(:,1),subpos2_tran(:,2),subpos2_tran(:,3),'m'); hold off; 100 | legend('mainpos1 orig','subpos2 transformed'); 101 | title('transformed'); 102 | end 103 | 104 | %% 6dof data 105 | % A=zeros(n_joints*4,4); 106 | % B=zeros(n_joints*4,4); 107 | % for i=1:n_joints 108 | % Q1=quater2rot(suborientation1(i,:)); 109 | % [U1,S1,V1] = svd(Q1); 110 | % R1=U1*V1'; 111 | % t1=subpos1(i,:)'; 112 | % A(4*i-3:4*i,:)=[R1 t1; 113 | % zeros(1,3) 1]; 114 | % Q2=quater2rot(suborientation2(i,:)); 115 | % [U2,S2,V2] = svd(Q2); 116 | % R2=U2*V2'; 117 | % t2=subpos2(i,:)'; 118 | % B(4*i-3:4*i,:)=[R2 t2; 119 | % zeros(1,3) 1]; 120 | % % R21=R2'*R1; 121 | % % t21(:,i)=-R2'*t1+R2'*t2; 122 | % R21=R1*R2'; 123 | % t21(:,i)=-R1*R2'*t2+t1; 124 | % 125 | % end 126 | % 127 | % t_2=t21' 128 | % t_2_ave=mean(t_2) 129 | 130 | %% Utility Functions 131 | function R=quater2rot(Rq) 132 | 133 | i=Rq(1); 134 | j=Rq(2); 135 | k=Rq(3); 136 | r=Rq(4); 137 | R=[1-2*(j^2+k^2) 2*(i*j-k*r) 2*(i*k+j*r) 138 | 2*(i*j+k*r) 1-2*(i^2+k^2) 2*(j*k-i*r) 139 | 2*(i*k-j*k) 2*(j*k+i*r) 1-2*(i^2+j^2) 140 | ]; 141 | end 142 | 143 | function [R,t] = arun(A,B) 144 | % Usage:: transforms A space onto B space 145 | % 146 | % Registers two sets of 3DoF data 147 | % Assumes A and B are d,n sets of data 148 | % where d is the dimension of the system 149 | % typically d = 2,3 150 | % and n is the number of points 151 | % typically n>3 152 | % 153 | % Mili Shah 154 | % July 2014 155 | 156 | [d, n]=size(A); 157 | 158 | %Mean Center Data 159 | Ac = mean(A,2); % mean x,y,z for data stream 1 160 | Bc = mean(B,2); % mean x,y,z for data stream 2 161 | 162 | % find deviation from mean position (x,y,z) 163 | % ** A and B dimensions: 3x32 (= (x,y,z) by number of joints) 164 | A = A-repmat(Ac,1,n); 165 | B = B-repmat(Bc,1,n); 166 | 167 | % compute optimal rotation via SVD 168 | [u,s,v] = svd(A*B'); 169 | u 170 | v 171 | % size(A*B') % 3x3 172 | R = v*u'; 173 | % size(R) % 3x3 174 | if det(R)<0, disp('Warning: R is a reflection'); end 175 | 176 | %Calculate Optimal Translation 177 | t = Bc - R*Ac; 178 | end 179 | -------------------------------------------------------------------------------- /res/3_random_min1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andyj1/kinect/10d9334ec047587331191e779f019e58c51ee519/res/3_random_min1.gif -------------------------------------------------------------------------------- /res/bodyjoints_labeled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andyj1/kinect/10d9334ec047587331191e779f019e58c51ee519/res/bodyjoints_labeled.png -------------------------------------------------------------------------------- /res/calibration_stage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andyj1/kinect/10d9334ec047587331191e779f019e58c51ee519/res/calibration_stage.png -------------------------------------------------------------------------------- /res/check_confident_devices.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andyj1/kinect/10d9334ec047587331191e779f019e58c51ee519/res/check_confident_devices.png -------------------------------------------------------------------------------- /res/chessboard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andyj1/kinect/10d9334ec047587331191e779f019e58c51ee519/res/chessboard.png -------------------------------------------------------------------------------- /res/configuration.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andyj1/kinect/10d9334ec047587331191e779f019e58c51ee519/res/configuration.png -------------------------------------------------------------------------------- /res/flowchart_black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andyj1/kinect/10d9334ec047587331191e779f019e58c51ee519/res/flowchart_black.png -------------------------------------------------------------------------------- /res/lighting_master.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andyj1/kinect/10d9334ec047587331191e779f019e58c51ee519/res/lighting_master.png -------------------------------------------------------------------------------- /res/occlusion_0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andyj1/kinect/10d9334ec047587331191e779f019e58c51ee519/res/occlusion_0.png -------------------------------------------------------------------------------- /res/occlusion_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andyj1/kinect/10d9334ec047587331191e779f019e58c51ee519/res/occlusion_1.png -------------------------------------------------------------------------------- /res/snapshot_2_dev.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andyj1/kinect/10d9334ec047587331191e779f019e58c51ee519/res/snapshot_2_dev.png -------------------------------------------------------------------------------- /res/snapshot_3_dev.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andyj1/kinect/10d9334ec047587331191e779f019e58c51ee519/res/snapshot_3_dev.png -------------------------------------------------------------------------------- /res/synced.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andyj1/kinect/10d9334ec047587331191e779f019e58c51ee519/res/synced.png -------------------------------------------------------------------------------- /res/test_environment.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andyj1/kinect/10d9334ec047587331191e779f019e58c51ee519/res/test_environment.png -------------------------------------------------------------------------------- /res/testsetup.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andyj1/kinect/10d9334ec047587331191e779f019e58c51ee519/res/testsetup.png -------------------------------------------------------------------------------- /script/increaseusbmb.sh: -------------------------------------------------------------------------------- 1 | sudo sh -c 'echo 2048 > /sys/module/usbcore/parameters/usbfs_memory_mb' 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /script/install_kinect_sensor_sdk.sh: -------------------------------------------------------------------------------- 1 | git clone --recursive https://github.com/microsoft/Azure-Kinect-Sensor-SDK.git 2 | cd Azure-Kinect-Sensor-SDK 3 | git checkout release/1.3.x 4 | 5 | sudo dpkg --add-architecture amd64 6 | sudo apt update 7 | sudo apt install -y \ 8 | pkg-config \ 9 | ninja-build \ 10 | doxygen \ 11 | clang \ 12 | gcc-multilib \ 13 | g++-multilib \ 14 | python3 \ 15 | nasm 16 | 17 | sudo apt install -y \ 18 | libgl1-mesa-dev \ 19 | libsoundio-dev \ 20 | libvulkan-dev \ 21 | libx11-dev \ 22 | libxcursor-dev \ 23 | libxinerama-dev \ 24 | libxrandr-dev \ 25 | libusb-1.0-0-dev \ 26 | libssl-dev \ 27 | libudev-dev \ 28 | mesa-common-dev \ 29 | uuid-dev 30 | 31 | ninja-build 32 | sudo apt-get install ninja-build 33 | 34 | openssl 35 | sudo apt-get install libssl-dev 36 | 37 | 38 | x11 39 | sudo apt-get install libx11-dev 40 | 41 | 42 | randr library 43 | sudo apt-get install xorg-dev libglu1-mesa-dev 44 | 45 | mkdir build && cd build 46 | cmake .. -GNinja 47 | ninja 48 | 49 | install libk4a1.3 (most 50 | download depth engine file libdepthengine.so.2.0 recent) 51 | link: https://drive.google.com/open?id=1nryM1mghLDAp64F-RMdruirotcDH7U6c 52 | copy to /Azure-Kinect-Sensor-SDK/build/bin 53 | 54 | copy rules so one can use without being 'root' 55 | sudo cp ../scripts/99-k4a.rules /etc/udev/rules.d/ 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /script/install_ros_melodic.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Apache License 2.0 3 | # Copyright (c) 2017, ROBOTIS CO., LTD. 4 | 5 | echo "" 6 | echo "[Note] Target OS version >>> Ubuntu 18.04.x (bionic)" 7 | echo "[Note] Target ROS version >>> ROS Melodic Morenia" 8 | echo "[Note] Catkin workspace >>> $HOME/catkin_ws" 9 | echo "" 10 | echo "PRESS [ENTER] TO CONTINUE THE INSTALLATION" 11 | echo "IF YOU WANT TO CANCEL, PRESS [CTRL] + [C]" 12 | read 13 | 14 | echo "[Set the target OS, ROS version and name of catkin workspace]" 15 | name_os_version=${name_os_version:="bionic"} 16 | name_ros_version=${name_ros_version:="melodic"} 17 | name_catkin_workspace=${name_catkin_workspace:="catkin_ws"} 18 | 19 | echo "[Update the package lists and upgrade them]" 20 | sudo apt-get update -y 21 | sudo apt-get upgrade -y 22 | 23 | echo "[Install build environment, the chrony, ntpdate and set the ntpdate]" 24 | sudo apt-get install -y chrony ntpdate build-essential 25 | sudo ntpdate ntp.ubuntu.com 26 | 27 | echo "[Add the ROS repository]" 28 | if [ ! -e /etc/apt/sources.list.d/ros-latest.list ]; then 29 | #sudo sh -c "echo \"deb http://packages.ros.org/ros/ubuntu ${name_os_version} main\" > /etc/apt/sources.list.d/ros-latest.list" 30 | sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list' 31 | fi 32 | 33 | echo "[Download the ROS keys]" 34 | roskey=`apt-key list | grep "Open Robotics"` 35 | if [ -z "$roskey" ]; then 36 | sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654 37 | fi 38 | 39 | echo "[Check the ROS keys]" 40 | roskey=`apt-key list | grep "Open Robotics"` 41 | if [ -n "$roskey" ]; then 42 | echo "[ROS key exists in the list]" 43 | else 44 | echo "[Failed to receive the ROS key, aborts the installation]" 45 | exit 0 46 | fi 47 | 48 | echo "[Update the package lists and upgrade them]" 49 | sudo apt-get update -y 50 | sudo apt-get upgrade -y 51 | 52 | echo "[Install the ros-desktop-full and all rqt plugins]" 53 | sudo apt-get install -y ros-$name_ros_version-desktop-full ros-$name_ros_version-rqt-* 54 | 55 | echo "[Initialize rosdep]" 56 | sudo sh -c "rosdep init" 57 | rosdep update 58 | 59 | echo "[Environment setup and getting rosinstall]" 60 | source /opt/ros/$name_ros_version/setup.sh 61 | sudo apt-get install -y python-rosinstall 62 | 63 | echo "[Make the catkin workspace and test the catkin_make]" 64 | mkdir -p $HOME/$name_catkin_workspace/src 65 | cd $HOME/$name_catkin_workspace/src 66 | catkin_init_workspace 67 | cd $HOME/$name_catkin_workspace 68 | catkin_make 69 | 70 | echo "[Set the ROS evironment]" 71 | sh -c "echo \"alias eb='nano ~/.bashrc'\" >> ~/.bashrc" 72 | sh -c "echo \"alias sb='source ~/.bashrc'\" >> ~/.bashrc" 73 | sh -c "echo \"alias gs='git status'\" >> ~/.bashrc" 74 | sh -c "echo \"alias gp='git pull'\" >> ~/.bashrc" 75 | sh -c "echo \"alias cw='cd ~/$name_catkin_workspace'\" >> ~/.bashrc" 76 | sh -c "echo \"alias cs='cd ~/$name_catkin_workspace/src'\" >> ~/.bashrc" 77 | sh -c "echo \"alias cm='cd ~/$name_catkin_workspace && catkin_make'\" >> ~/.bashrc" 78 | 79 | sh -c "echo \"source /opt/ros/$name_ros_version/setup.bash\" >> ~/.bashrc" 80 | sh -c "echo \"source ~/$name_catkin_workspace/devel/setup.bash\" >> ~/.bashrc" 81 | 82 | sh -c "echo \"export ROS_MASTER_URI=http://localhost:11311\" >> ~/.bashrc" 83 | sh -c "echo \"export ROS_HOSTNAME=localhost\" >> ~/.bashrc" 84 | 85 | source $HOME/.bashrc 86 | 87 | echo "[Complete!!!]" 88 | exit 0 89 | -------------------------------------------------------------------------------- /script/opencv_install_mediapipe_google.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright 2019 The MediaPipe Authors. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # ========================================================================= 16 | # 17 | # Script to build OpenCV from source code and modify the MediaPipe opencv config. 18 | # Note that this script only has been tested on Debian 9 and Ubuntu 16.04. 19 | # usage: 20 | # $ cd 21 | # $ chmod +x ./setup_opencv.sh 22 | # $ ./setup_opencv.sh 23 | set -e 24 | 25 | opencv_build_file="$( cd "$(dirname "$0")" ; pwd -P )"/third_party/opencv_linux.BUILD 26 | echo $opencv_build_file 27 | 28 | echo "Installing OpenCV from source" 29 | sudo apt update && sudo apt install build-essential git 30 | sudo apt install cmake ffmpeg libavformat-dev libdc1394-22-dev libgtk2.0-dev \ 31 | libjpeg-dev libpng-dev libswscale-dev libtbb2 libtbb-dev \ 32 | libtiff-dev 33 | rm -rf /tmp/build_opencv 34 | mkdir /tmp/build_opencv 35 | cd /tmp/build_opencv 36 | git clone https://github.com/opencv/opencv_contrib.git 37 | git clone https://github.com/opencv/opencv.git 38 | mkdir opencv/release 39 | cd opencv/release 40 | cmake .. -DCMAKE_BUILD_TYPE=RELEASE -DCMAKE_INSTALL_PREFIX=/usr/local \ 41 | -DBUILD_TESTS=OFF -DBUILD_PERF_TESTS=OFF -DBUILD_opencv_ts=OFF \ 42 | -DOPENCV_EXTRA_MODULES_PATH=/tmp/build_opencv/opencv_contrib/modules \ 43 | -DBUILD_opencv_aruco=OFF -DBUILD_opencv_bgsegm=OFF -DBUILD_opencv_bioinspired=OFF \ 44 | -DBUILD_opencv_ccalib=OFF -DBUILD_opencv_datasets=OFF -DBUILD_opencv_dnn=OFF \ 45 | -DBUILD_opencv_dnn_objdetect=OFF -DBUILD_opencv_dpm=OFF -DBUILD_opencv_face=OFF \ 46 | -DBUILD_opencv_fuzzy=OFF -DBUILD_opencv_hfs=OFF -DBUILD_opencv_img_hash=OFF \ 47 | -DBUILD_opencv_js=OFF -DBUILD_opencv_line_descriptor=OFF -DBUILD_opencv_phase_unwrapping=OFF \ 48 | -DBUILD_opencv_plot=OFF -DBUILD_opencv_quality=OFF -DBUILD_opencv_reg=OFF \ 49 | -DBUILD_opencv_rgbd=OFF -DBUILD_opencv_saliency=OFF -DBUILD_opencv_shape=OFF \ 50 | -DBUILD_opencv_structured_light=OFF -DBUILD_opencv_surface_matching=OFF \ 51 | -DBUILD_opencv_world=OFF -DBUILD_opencv_xobjdetect=OFF -DBUILD_opencv_xphoto=OFF 52 | make -j 16 53 | sudo make install 54 | rm -rf /tmp/build_opencv 55 | echo "OpenCV has been built. You can find the header files and libraries in /usr/local/include/opencv4/opencv2 and /usr/local/lib" 56 | 57 | # Modify the build file. 58 | echo "Modifying MediaPipe opencv config" 59 | sed -i "s/lib\/x86_64-linux-gnu/local\/lib/g" $opencv_build_file 60 | sed -i "20i \ \"local/lib/libopencv_optflow.so*\"," $opencv_build_file 61 | sed -i "/includes =/d" $opencv_build_file 62 | sed -i "/hdrs =/d" $opencv_build_file 63 | line_to_insert=$(grep -n 'linkstatic =' $opencv_build_file | awk -F ":" '{print $1}')'i' 64 | sed -i "$line_to_insert \ includes = [\"local\/include\/opencv4\/\"]," $opencv_build_file 65 | sed -i "$line_to_insert \ hdrs = glob([\"local\/include\/opencv4\/\*\*\/\*\.h\*\"])," $opencv_build_file 66 | 67 | echo "Done" 68 | -------------------------------------------------------------------------------- /src/Makefile: -------------------------------------------------------------------------------- 1 | K4A_FLAGS = -lk4a 2 | K4ABT_FLAGS = -lk4abt 3 | OPENCV_FLAGS = `pkg-config --cflags --libs opencv` 4 | OUTPUT_FILENAME = program 5 | 6 | # 1 device 7 | one: 8 | g++ one.cpp $(K4A_FLAGS) $(K4ABT_FLAGS) $(OPENCV_FLAGS) -o $(OUTPUT_FILENAME) 9 | 10 | onerun: 11 | ./$(OUTPUT_FILENAME) 12 | 13 | # transformed, not projected, synced, 2 devices 14 | # multi: 15 | # g++ multi.cpp $(K4A_FLAGS) $(K4ABT_FLAGS) $(OPENCV_FLAGS) -o $(OUTPUT_FILENAME) 16 | 17 | # multirun: 18 | # ./$(OUTPUT_FILENAME) 2 9 6 15 19 | 20 | # transformed, projected, synced, 2 devices 21 | two: 22 | g++ two.cpp $(K4A_FLAGS) $(K4ABT_FLAGS) $(OPENCV_FLAGS) -o $(OUTPUT_FILENAME) 23 | 24 | tworun: 25 | ./$(OUTPUT_FILENAME) 2 9 6 15 26 | 27 | # transformed, projected, synced, 3 devices 28 | sync: 29 | g++ sync.cpp $(K4A_FLAGS) $(K4ABT_FLAGS) $(OPENCV_FLAGS) -o $(OUTPUT_FILENAME) 30 | 31 | syncrun: 32 | ./$(OUTPUT_FILENAME) 3 9 6 15 -------------------------------------------------------------------------------- /src/MultiDeviceCapturer.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | #pragma once 4 | 5 | #include 6 | #include 7 | #include // std::setw 8 | #include 9 | #include 10 | #include 11 | 12 | using namespace std; 13 | 14 | // This is the maximum difference between when we expected an image's timestamp to be and when it actually occurred. 15 | // TODO waiting on a firmware update to be returned to 50 16 | constexpr std::chrono::microseconds MAX_ALLOWABLE_TIME_OFFSET_ERROR_FOR_IMAGE_TIMESTAMP(33000); 17 | // constexpr std::chrono::microseconds MAX_ALLOWABLE_TIME_OFFSET_ERROR_FOR_IMAGE_TIMESTAMP(50); 18 | 19 | constexpr int64_t WAIT_FOR_SYNCHRONIZED_CAPTURE_TIMEOUT = 60000; 20 | 21 | static void log_lagging_time(string lagger, k4a::capture &master, k4a::capture &sub) 22 | { 23 | std::cout << std::setw(6) << lagger << " lagging: mc:" << std::setw(6) 24 | << master.get_color_image().get_device_timestamp().count() << "us sc:" << std::setw(6) 25 | << sub.get_color_image().get_device_timestamp().count() << "us\n"; 26 | } 27 | 28 | static void log_synced_image_time(k4a::capture &master, k4a::capture &sub) 29 | { 30 | std::cout << "Sync'd capture: mc:" << std::setw(6) << master.get_color_image().get_device_timestamp().count() 31 | << "us sc:" << std::setw(6) << sub.get_color_image().get_device_timestamp().count() << "us\n"; 32 | } 33 | 34 | class MultiDeviceCapturer 35 | { 36 | public: 37 | // Set up all the devices. Note that the index order isn't necessarily preserved, because we might swap with master 38 | MultiDeviceCapturer(const vector &device_indices, int32_t color_exposure_usec, int32_t powerline_freq) 39 | { 40 | bool master_found = false; 41 | if (device_indices.size() == 0) 42 | { 43 | cerr << "Capturer must be passed at least one camera!\n "; 44 | exit(1); 45 | } 46 | for (uint32_t i : device_indices) 47 | { 48 | k4a::device next_device = k4a::device::open(i); // construct a device using this index 49 | // If you want to synchronize cameras, you need to manually set both their exposures 50 | next_device.set_color_control(K4A_COLOR_CONTROL_EXPOSURE_TIME_ABSOLUTE, 51 | K4A_COLOR_CONTROL_MODE_MANUAL, 52 | color_exposure_usec); 53 | // This setting compensates for the flicker of lights due to the frequency of AC power in your region. If 54 | // you are in an area with 50 Hz power, this may need to be updated (check the docs for 55 | // k4a_color_control_command_t) 56 | next_device.set_color_control(K4A_COLOR_CONTROL_POWERLINE_FREQUENCY, 57 | K4A_COLOR_CONTROL_MODE_MANUAL, 58 | powerline_freq); 59 | // We treat the first device found with a sync out cable attached as the master. If it's not supposed to be, 60 | // unplug the cable from it. Also, if there's only one device, just use it 61 | if ((next_device.is_sync_out_connected() && !master_found) || device_indices.size() == 1) 62 | { 63 | master_device = std::move(next_device); 64 | master_found = true; 65 | } 66 | else if (!next_device.is_sync_in_connected() && !next_device.is_sync_out_connected()) 67 | { 68 | cerr << "Each device must have sync in or sync out connected!\n "; 69 | exit(1); 70 | } 71 | else if (!next_device.is_sync_in_connected()) 72 | { 73 | cerr << "Non-master camera found that doesn't have the sync in port connected!\n "; 74 | exit(1); 75 | } 76 | else 77 | { 78 | subordinate_devices.emplace_back(std::move(next_device)); 79 | } 80 | } 81 | if (!master_found) 82 | { 83 | cerr << "No device with sync out connected found!\n "; 84 | exit(1); 85 | } 86 | } 87 | 88 | // configs[0] should be the master, the rest subordinate 89 | void start_devices(const k4a_device_configuration_t &master_config, const k4a_device_configuration_t &sub_config) 90 | { 91 | // Start by starting all of the subordinate devices. They must be started before the master! 92 | for (k4a::device &d : subordinate_devices) 93 | { 94 | d.start_cameras(&sub_config); 95 | } 96 | // Lastly, start the master device 97 | master_device.start_cameras(&master_config); 98 | } 99 | 100 | // Blocks until we have synchronized captures stored in the output. First is master, rest are subordinates 101 | std::vector get_synchronized_captures(const k4a_device_configuration_t &sub_config, 102 | bool compare_sub_depth_instead_of_color = false) 103 | { 104 | // Dealing with the synchronized cameras is complex. The Azure Kinect DK: 105 | // (a) does not guarantee exactly equal timestamps between depth and color or between cameras (delays can 106 | // be configured but timestamps will only be approximately the same) 107 | // (b) does not guarantee that, if the two most recent images were synchronized, that calling get_capture 108 | // just once on each camera will still be synchronized. 109 | // There are several reasons for all of this. Internally, devices keep a queue of a few of the captured images 110 | // and serve those images as requested by get_capture(). However, images can also be dropped at any moment, and 111 | // one device may have more images ready than another device at a given moment, et cetera. 112 | // 113 | // Also, the process of synchronizing is complex. The cameras are not guaranteed to exactly match in all of 114 | // their timestamps when synchronized (though they should be very close). All delays are relative to the master 115 | // camera's color camera. To deal with these complexities, we employ a fairly straightforward algorithm. Start 116 | // by reading in two captures, then if the camera images were not taken at roughly the same time read a new one 117 | // from the device that had the older capture until the timestamps roughly match. 118 | 119 | // The captures used in the loop are outside of it so that they can persist across loop iterations. This is 120 | // necessary because each time this loop runs we'll only update the older capture. 121 | // The captures are stored in a vector where the first element of the vector is the master capture and 122 | // subsequent elements are subordinate captures 123 | std::vector captures(subordinate_devices.size() + 1); // add 1 for the master 124 | size_t current_index = 0; 125 | master_device.get_capture(&captures[current_index], std::chrono::milliseconds{ K4A_WAIT_INFINITE }); 126 | ++current_index; 127 | for (k4a::device &d : subordinate_devices) 128 | { 129 | d.get_capture(&captures[current_index], std::chrono::milliseconds{ K4A_WAIT_INFINITE }); 130 | ++current_index; 131 | } 132 | 133 | // If there are no subordinate devices, just return captures which only has the master image 134 | if (subordinate_devices.empty()) 135 | { 136 | return captures; 137 | } 138 | 139 | bool have_synced_images = false; 140 | std::chrono::system_clock::time_point start = std::chrono::system_clock::now(); 141 | while (!have_synced_images) 142 | { 143 | // Timeout if this is taking too long 144 | int64_t duration_ms = 145 | std::chrono::duration_cast(std::chrono::system_clock::now() - start).count(); 146 | if (duration_ms > WAIT_FOR_SYNCHRONIZED_CAPTURE_TIMEOUT) 147 | { 148 | cerr << "ERROR: Timedout waiting for synchronized captures\n"; 149 | exit(1); 150 | } 151 | 152 | k4a::image master_color_image = captures[0].get_color_image(); 153 | std::chrono::microseconds master_color_image_time = master_color_image.get_device_timestamp(); 154 | 155 | for (size_t i = 0; i < subordinate_devices.size(); ++i) 156 | { 157 | k4a::image sub_image; 158 | if (compare_sub_depth_instead_of_color) 159 | { 160 | sub_image = captures[i + 1].get_depth_image(); // offset of 1 because master capture is at front 161 | } 162 | else 163 | { 164 | sub_image = captures[i + 1].get_color_image(); // offset of 1 because master capture is at front 165 | } 166 | 167 | if (master_color_image && sub_image) 168 | { 169 | std::chrono::microseconds sub_image_time = sub_image.get_device_timestamp(); 170 | // The subordinate's color image timestamp, ideally, is the master's color image timestamp plus the 171 | // delay we configured between the master device color camera and subordinate device color camera 172 | std::chrono::microseconds expected_sub_image_time = 173 | master_color_image_time + 174 | std::chrono::microseconds{ sub_config.subordinate_delay_off_master_usec } + 175 | std::chrono::microseconds{ sub_config.depth_delay_off_color_usec }; 176 | std::chrono::microseconds sub_image_time_error = sub_image_time - expected_sub_image_time; 177 | // The time error's absolute value must be within the permissible range. So, for example, if 178 | // MAX_ALLOWABLE_TIME_OFFSET_ERROR_FOR_IMAGE_TIMESTAMP is 2, offsets of -2, -1, 0, 1, and -2 are 179 | // permitted 180 | if (sub_image_time_error < -MAX_ALLOWABLE_TIME_OFFSET_ERROR_FOR_IMAGE_TIMESTAMP) 181 | { 182 | // Example, where MAX_ALLOWABLE_TIME_OFFSET_ERROR_FOR_IMAGE_TIMESTAMP is 1 183 | // time t=1 t=2 t=3 184 | // actual timestamp x . . 185 | // expected timestamp . . x 186 | // error: 1 - 3 = -2, which is less than the worst-case-allowable offset of -1 187 | // the subordinate camera image timestamp was earlier than it is allowed to be. This means the 188 | // subordinate is lagging and we need to update the subordinate to get the subordinate caught up 189 | string sub_name = "sub"; 190 | sub_name.append(": ").append(to_string(i)); 191 | log_lagging_time(sub_name, captures[0], captures[i + 1]); 192 | subordinate_devices[i].get_capture(&captures[i + 1], 193 | std::chrono::milliseconds{ K4A_WAIT_INFINITE }); 194 | break; 195 | } 196 | else if (sub_image_time_error > MAX_ALLOWABLE_TIME_OFFSET_ERROR_FOR_IMAGE_TIMESTAMP) 197 | { 198 | // Example, where MAX_ALLOWABLE_TIME_OFFSET_ERROR_FOR_IMAGE_TIMESTAMP is 1 199 | // time t=1 t=2 t=3 200 | // actual timestamp . . x 201 | // expected timestamp x . . 202 | // error: 3 - 1 = 2, which is more than the worst-case-allowable offset of 1 203 | // the subordinate camera image timestamp was later than it is allowed to be. This means the 204 | // subordinate is ahead and we need to update the master to get the master caught up 205 | log_lagging_time("master", captures[0], captures[i + 1]); 206 | master_device.get_capture(&captures[0], std::chrono::milliseconds{ K4A_WAIT_INFINITE }); 207 | break; 208 | } 209 | else 210 | { 211 | // These captures are sufficiently synchronized. If we've gotten to the end, then all are 212 | // synchronized. 213 | if (i == subordinate_devices.size() - 1) 214 | { 215 | log_synced_image_time(captures[0], captures[i + 1]); 216 | have_synced_images = true; // now we'll finish the for loop and then exit the while loop 217 | } 218 | } 219 | } 220 | else if (!master_color_image) 221 | { 222 | std::cout << "Master image was bad!\n"; 223 | master_device.get_capture(&captures[0], std::chrono::milliseconds{ K4A_WAIT_INFINITE }); 224 | break; 225 | } 226 | else if (!sub_image) 227 | { 228 | std::cout << "Subordinate image was bad!" << endl; 229 | subordinate_devices[i].get_capture(&captures[i + 1], 230 | std::chrono::milliseconds{ K4A_WAIT_INFINITE }); 231 | break; 232 | } 233 | } 234 | } 235 | // if we've made it to here, it means that we have synchronized captures. 236 | return captures; 237 | } 238 | 239 | const k4a::device &get_master_device() const 240 | { 241 | return master_device; 242 | } 243 | 244 | const k4a::device &get_subordinate_device_by_index(size_t i) const 245 | { 246 | // devices[0] is the master. There are only devices.size() - 1 others. So, indices greater or equal are invalid 247 | if (i >= subordinate_devices.size()) 248 | { 249 | cerr << "Subordinate index too large!\n "; 250 | exit(1); 251 | } 252 | return subordinate_devices[i]; 253 | } 254 | 255 | private: 256 | // Once the constuctor finishes, devices[0] will always be the master 257 | k4a::device master_device; 258 | std::vector subordinate_devices; 259 | }; 260 | -------------------------------------------------------------------------------- /src/colors.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | using namespace cv; 6 | #ifndef COLORS_H 7 | #define COLORS_H 8 | 9 | namespace color 10 | { 11 | 12 | #define COLORS_aliceblue Scalar(255,248,240) 13 | #define COLORS_antiquewhite Scalar(215,235,250) 14 | #define COLORS_aqua Scalar(255,255,0) 15 | #define COLORS_aquamarine Scalar(212,255,127) 16 | #define COLORS_azure Scalar(255,255,240) 17 | #define COLORS_beige Scalar(220,245,245) 18 | #define COLORS_bisque Scalar(196,228,255) 19 | #define COLORS_black Scalar(0,0,0) 20 | #define COLORS_blanchedalmond Scalar(205,235,255) 21 | #define COLORS_blue Scalar(255,0,0) 22 | #define COLORS_blueviolet Scalar(226,43,138) 23 | #define COLORS_brown Scalar(42,42,165) 24 | #define COLORS_burlywood Scalar(135,184,222) 25 | #define COLORS_cadetblue Scalar(160,158,95) 26 | #define COLORS_chartreuse Scalar(0,255,127) 27 | #define COLORS_chocolate Scalar(30,105,210) 28 | #define COLORS_coral Scalar(80,127,255) 29 | #define COLORS_cornflowerblue Scalar(237,149,100) 30 | #define COLORS_cornsilk Scalar(220,248,255) 31 | #define COLORS_crimson Scalar(60,20,220) 32 | #define COLORS_cyan Scalar(255,255,0) 33 | #define COLORS_darkblue Scalar(139,0,0) 34 | #define COLORS_darkcyan Scalar(139,139,0) 35 | #define COLORS_darkgoldenrod Scalar(11,134,184) 36 | #define COLORS_darkgray Scalar(169,169,169) 37 | #define COLORS_darkgreen Scalar(0,100,0) 38 | #define COLORS_darkgrey Scalar(169,169,169) 39 | #define COLORS_darkkhaki Scalar(107,183,189) 40 | #define COLORS_darkmagenta Scalar(139,0,139) 41 | #define COLORS_darkolivegreen Scalar(47,107,85) 42 | #define COLORS_darkorange Scalar(0,140,255) 43 | #define COLORS_darkorchid Scalar(204,50,153) 44 | #define COLORS_darkred Scalar(0,0,139) 45 | #define COLORS_darksalmon Scalar(122,150,233) 46 | #define COLORS_darkseagreen Scalar(143,188,143) 47 | #define COLORS_darkslateblue Scalar(139,61,72) 48 | #define COLORS_darkslategray Scalar(79,79,47) 49 | #define COLORS_darkslategrey Scalar(79,79,47) 50 | #define COLORS_darkturquoise Scalar(209,206,0) 51 | #define COLORS_darkviolet Scalar(211,0,148) 52 | #define COLORS_deeppink Scalar(147,20,255) 53 | #define COLORS_deepskyblue Scalar(255,191,0) 54 | #define COLORS_dimgray Scalar(105,105,105) 55 | #define COLORS_dimgrey Scalar(105,105,105) 56 | #define COLORS_dodgerblue Scalar(255,144,30) 57 | #define COLORS_firebrick Scalar(34,34,178) 58 | #define COLORS_floralwhite Scalar(240,250,255) 59 | #define COLORS_forestgreen Scalar(34,139,34) 60 | #define COLORS_fuchsia Scalar(255,0,255) 61 | #define COLORS_gainsboro Scalar(220,220,220) 62 | #define COLORS_ghostwhite Scalar(255,248,248) 63 | #define COLORS_gold Scalar(0,215,255) 64 | #define COLORS_goldenrod Scalar(32,165,218) 65 | #define COLORS_gray Scalar(128,128,128) 66 | #define COLORS_green Scalar(0,128,0) 67 | #define COLORS_greenyellow Scalar(47,255,173) 68 | #define COLORS_grey Scalar(128,128,128) 69 | #define COLORS_honeydew Scalar(240,255,240) 70 | #define COLORS_hotpink Scalar(180,105,255) 71 | #define COLORS_indianred Scalar(92,92,205) 72 | #define COLORS_indigo Scalar(130,0,75) 73 | #define COLORS_ivory Scalar(240,255,255) 74 | #define COLORS_khaki Scalar(140,230,240) 75 | #define COLORS_lavender Scalar(250,230,230) 76 | #define COLORS_lavenderblush Scalar(245,240,255) 77 | #define COLORS_lawngreen Scalar(0,252,124) 78 | #define COLORS_lemonchiffon Scalar(205,250,255) 79 | #define COLORS_lightblue Scalar(230,216,173) 80 | #define COLORS_lightcoral Scalar(128,128,240) 81 | #define COLORS_lightcyan Scalar(255,255,224) 82 | #define COLORS_lightgoldenrodyellow Scalar(210,250,250) 83 | #define COLORS_lightgray Scalar(211,211,211) 84 | #define COLORS_lightgreen Scalar(144,238,144) 85 | #define COLORS_lightgrey Scalar(211,211,211) 86 | #define COLORS_lightpink Scalar(193,182,255) 87 | #define COLORS_lightsalmon Scalar(122,160,255) 88 | #define COLORS_lightseagreen Scalar(170,178,32) 89 | #define COLORS_lightskyblue Scalar(250,206,135) 90 | #define COLORS_lightslategray Scalar(153,136,119) 91 | #define COLORS_lightslategrey Scalar(153,136,119) 92 | #define COLORS_lightsteelblue Scalar(222,196,176) 93 | #define COLORS_lightyellow Scalar(224,255,255) 94 | #define COLORS_lime Scalar(0,255,0) 95 | #define COLORS_limegreen Scalar(50,205,50) 96 | #define COLORS_linen Scalar(230,240,250) 97 | #define COLORS_magenta Scalar(255,0,255) 98 | #define COLORS_maroon Scalar(0,0,128) 99 | #define COLORS_mediumaquamarine Scalar(170,205,102) 100 | #define COLORS_mediumblue Scalar(205,0,0) 101 | #define COLORS_mediumorchid Scalar(211,85,186) 102 | #define COLORS_mediumpurple Scalar(219,112,147) 103 | #define COLORS_mediumseagreen Scalar(113,179,60) 104 | #define COLORS_mediumslateblue Scalar(238,104,123) 105 | #define COLORS_mediumspringgreen Scalar(154,250,0) 106 | #define COLORS_mediumturquoise Scalar(204,209,72) 107 | #define COLORS_mediumvioletred Scalar(133,21,199) 108 | #define COLORS_midnightblue Scalar(112,25,25) 109 | #define COLORS_mintcream Scalar(250,255,245) 110 | #define COLORS_mistyrose Scalar(225,228,255) 111 | #define COLORS_moccasin Scalar(181,228,255) 112 | #define COLORS_navajowhite Scalar(173,222,255) 113 | #define COLORS_navy Scalar(128,0,0) 114 | #define COLORS_oldlace Scalar(230,245,253) 115 | #define COLORS_olive Scalar(0,128,128) 116 | #define COLORS_olivedrab Scalar(35,142,107) 117 | #define COLORS_orange Scalar(0,165,255) 118 | #define COLORS_orangered Scalar(0,69,255) 119 | #define COLORS_orchid Scalar(214,112,218) 120 | #define COLORS_palegoldenrod Scalar(170,232,238) 121 | #define COLORS_palegreen Scalar(152,251,152) 122 | #define COLORS_paleturquoise Scalar(238,238,175) 123 | #define COLORS_palevioletred Scalar(147,112,219) 124 | #define COLORS_papayawhip Scalar(213,239,255) 125 | #define COLORS_peachpuff Scalar(185,218,255) 126 | #define COLORS_peru Scalar(63,133,205) 127 | #define COLORS_pink Scalar(203,192,255) 128 | #define COLORS_plum Scalar(221,160,221) 129 | #define COLORS_powderblue Scalar(230,224,176) 130 | #define COLORS_purple Scalar(128,0,128) 131 | #define COLORS_red Scalar(0,0,255) 132 | #define COLORS_rosybrown Scalar(143,143,188) 133 | #define COLORS_royalblue Scalar(225,105,65) 134 | #define COLORS_saddlebrown Scalar(19,69,139) 135 | #define COLORS_salmon Scalar(114,128,250) 136 | #define COLORS_sandybrown Scalar(96,164,244) 137 | #define COLORS_seagreen Scalar(87,139,46) 138 | #define COLORS_seashell Scalar(238,245,255) 139 | #define COLORS_sienna Scalar(45,82,160) 140 | #define COLORS_silver Scalar(192,192,192) 141 | #define COLORS_skyblue Scalar(235,206,135) 142 | #define COLORS_slateblue Scalar(205,90,106) 143 | #define COLORS_slategray Scalar(144,128,112) 144 | #define COLORS_slategrey Scalar(144,128,112) 145 | #define COLORS_snow Scalar(250,250,255) 146 | #define COLORS_springgreen Scalar(127,255,0) 147 | #define COLORS_steelblue Scalar(180,130,70) 148 | #define COLORS_tan Scalar(140,180,210) 149 | #define COLORS_teal Scalar(128,128,0) 150 | #define COLORS_thistle Scalar(216,191,216) 151 | #define COLORS_tomato Scalar(71,99,255) 152 | #define COLORS_turquoise Scalar(208,224,64) 153 | #define COLORS_violet Scalar(238,130,238) 154 | #define COLORS_wheat Scalar(179,222,245) 155 | #define COLORS_white Scalar(255,255,255) 156 | #define COLORS_whitesmoke Scalar(245,245,245) 157 | #define COLORS_yellow Scalar(0,255,255) 158 | #define COLORS_yellowgreen Scalar(50,205,154) 159 | } 160 | 161 | #endif -------------------------------------------------------------------------------- /src/one.cpp: -------------------------------------------------------------------------------- 1 | // 11.20.2019 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | #include 11 | #include 12 | 13 | #include 14 | #include 15 | #include 16 | 17 | // Handle to a k4a body tracking frame. 18 | #include 19 | 20 | #include 21 | #include 22 | #include 23 | #include 24 | 25 | #include "colors.h" 26 | // Json 27 | // #include 28 | 29 | #define FRAME_COUNT 1000 30 | #define VERIFY(result, error) \ 31 | if(result != K4A_RESULT_SUCCEEDED) \ 32 | { \ 33 | printf("%s \n - (File: %s, Function: %s, Line: %d)\n", error, __FILE__, __FUNCTION__, __LINE__); \ 34 | exit(1); \ 35 | }; 36 | 37 | using namespace std; 38 | using namespace cv; 39 | using namespace color; 40 | 41 | static cv::Mat color_to_opencv(const k4a::image &im); 42 | void arun(Mat &main, Mat &secondary, Mat &R, Mat &T); 43 | std::vector computeJointAngles(k4abt_body_t body); 44 | string confidenceEnumMapping(k4abt_joint_confidence_level_t confidence_level); 45 | vector print_body_information(k4abt_body_t body); 46 | void crossproduct (cv::Vec3f &ans, cv::Vec3f &p1, cv::Vec3f &p2); 47 | 48 | 49 | static int ANGLE_FRAME_ROW_COUNT = 0; 50 | static vector values; 51 | 52 | string confidenceEnumMapping(k4abt_joint_confidence_level_t confidence_level) 53 | { 54 | string resultString; 55 | switch (confidence_level) 56 | { 57 | case K4ABT_JOINT_CONFIDENCE_NONE: // 0 58 | resultString += "The joint is out of range(too far from depth camera)"; 59 | break; 60 | case K4ABT_JOINT_CONFIDENCE_LOW: // 1 61 | resultString += "The joint is not observed(likely due to occlusion) - predicted joint pose"; 62 | break; 63 | case K4ABT_JOINT_CONFIDENCE_MEDIUM: 64 | resultString += "Medium confidence in joint pose"; 65 | break; 66 | // beyond this will be supported later 67 | case K4ABT_JOINT_CONFIDENCE_HIGH: 68 | resultString += "High confidence in joint pose"; 69 | break; 70 | default: 71 | break; 72 | } 73 | return resultString; 74 | } 75 | 76 | vector print_body_information(k4abt_body_t body) 77 | { 78 | for (int i = 0; i < (int)K4ABT_JOINT_COUNT; i++) 79 | { 80 | k4a_float3_t position = body.skeleton.joints[i].position; 81 | k4a_quaternion_t orientation = body.skeleton.joints[i].orientation; 82 | k4abt_joint_confidence_level_t confidence_level = body.skeleton.joints[i].confidence_level; 83 | 84 | values.push_back(i); // joint 85 | values.push_back(position.v[0]); 86 | values.push_back(position.v[1]); 87 | values.push_back(position.v[2]); 88 | values.push_back(orientation.v[0]); 89 | values.push_back(orientation.v[1]); 90 | values.push_back(orientation.v[2]); 91 | values.push_back(orientation.v[3]); 92 | values.push_back(confidence_level); 93 | } 94 | return values; 95 | } 96 | 97 | 98 | void crossproduct (cv::Vec3f &ans, cv::Vec3f &p1, cv::Vec3f &p2) 99 | { 100 | ans[0] = p1[1]*p2[2] -p1[2]*p2[1]; 101 | ans[1] = p1[0]*p2[2] -p1[2]*p2[0]; 102 | ans[2] = p1[0]*p2[1] -p1[1]*p2[0]; 103 | } 104 | std::vector computeJointAngles(k4abt_body_t avg_body) 105 | { 106 | // plot angles from 3D positions 107 | // A: 12-13-14 108 | cv::Vec3f a1(avg_body.skeleton.joints[12].position.v[0] - avg_body.skeleton.joints[13].position.v[0], \ 109 | avg_body.skeleton.joints[12].position.v[1] - avg_body.skeleton.joints[13].position.v[1], \ 110 | avg_body.skeleton.joints[12].position.v[2] - avg_body.skeleton.joints[13].position.v[2]); 111 | cv::Vec3f a2(avg_body.skeleton.joints[13].position.v[0] - avg_body.skeleton.joints[14].position.v[0], \ 112 | avg_body.skeleton.joints[13].position.v[1] - avg_body.skeleton.joints[14].position.v[1], \ 113 | avg_body.skeleton.joints[13].position.v[2] - avg_body.skeleton.joints[14].position.v[2]); 114 | cv::Vec3f across; 115 | crossproduct(across, a1, a2); 116 | float adot = a1.dot(a2); 117 | float A = atan2(norm(across), adot); 118 | 119 | // B: 5-6-7 120 | cv::Vec3f b1(avg_body.skeleton.joints[5].position.v[0] - avg_body.skeleton.joints[6].position.v[0], \ 121 | avg_body.skeleton.joints[5].position.v[1] - avg_body.skeleton.joints[6].position.v[1], \ 122 | avg_body.skeleton.joints[5].position.v[2] - avg_body.skeleton.joints[6].position.v[2]); 123 | cv::Vec3f b2(avg_body.skeleton.joints[6].position.v[0] - avg_body.skeleton.joints[7].position.v[0], \ 124 | avg_body.skeleton.joints[6].position.v[1] - avg_body.skeleton.joints[7].position.v[1], \ 125 | avg_body.skeleton.joints[6].position.v[2] - avg_body.skeleton.joints[7].position.v[2]); 126 | cv::Vec3f bcross; 127 | crossproduct(bcross, b1, b2); 128 | float bdot = b1.dot(b2); 129 | float B = atan2(norm(bcross), bdot); 130 | 131 | // C: 11-12-13 132 | cv::Vec3f c1(avg_body.skeleton.joints[11].position.v[0] - avg_body.skeleton.joints[12].position.v[0], \ 133 | avg_body.skeleton.joints[11].position.v[1] - avg_body.skeleton.joints[12].position.v[1], \ 134 | avg_body.skeleton.joints[11].position.v[2] - avg_body.skeleton.joints[12].position.v[2]); 135 | cv::Vec3f c2(avg_body.skeleton.joints[12].position.v[0] - avg_body.skeleton.joints[13].position.v[0], \ 136 | avg_body.skeleton.joints[12].position.v[1] - avg_body.skeleton.joints[13].position.v[1], \ 137 | avg_body.skeleton.joints[12].position.v[2] - avg_body.skeleton.joints[13].position.v[2]); 138 | cv::Vec3f ccross; 139 | crossproduct(ccross, c1, c2); 140 | float cdot = c1.dot(c2); 141 | float C = atan2(norm(ccross), cdot); 142 | 143 | // D: 4-5-6 144 | cv::Vec3f d1(avg_body.skeleton.joints[4].position.v[0] - avg_body.skeleton.joints[5].position.v[0], \ 145 | avg_body.skeleton.joints[4].position.v[1] - avg_body.skeleton.joints[5].position.v[1], \ 146 | avg_body.skeleton.joints[4].position.v[2] - avg_body.skeleton.joints[5].position.v[2]); 147 | cv::Vec3f d2(avg_body.skeleton.joints[5].position.v[0] - avg_body.skeleton.joints[6].position.v[0], \ 148 | avg_body.skeleton.joints[5].position.v[1] - avg_body.skeleton.joints[6].position.v[1], \ 149 | avg_body.skeleton.joints[5].position.v[2] - avg_body.skeleton.joints[6].position.v[2]); 150 | cv::Vec3f dcross; 151 | crossproduct(dcross, d1, d2); 152 | float ddot = d1.dot(d2); 153 | float D = atan2(norm(dcross), ddot); 154 | 155 | // E: 1-0-22 156 | cv::Vec3f e1(avg_body.skeleton.joints[1].position.v[0] - avg_body.skeleton.joints[0].position.v[0], \ 157 | avg_body.skeleton.joints[1].position.v[1] - avg_body.skeleton.joints[0].position.v[1], \ 158 | avg_body.skeleton.joints[1].position.v[2] - avg_body.skeleton.joints[0].position.v[2]); 159 | cv::Vec3f e2(avg_body.skeleton.joints[0].position.v[0] - avg_body.skeleton.joints[22].position.v[0], \ 160 | avg_body.skeleton.joints[0].position.v[1] - avg_body.skeleton.joints[22].position.v[1], \ 161 | avg_body.skeleton.joints[0].position.v[2] - avg_body.skeleton.joints[22].position.v[2]); 162 | cv::Vec3f ecross; 163 | crossproduct(ecross, e1, e2); 164 | float edot = e1.dot(e2); 165 | float E = atan2(norm(ecross), edot); 166 | 167 | // F: 1-0-18 168 | cv::Vec3f f1(avg_body.skeleton.joints[1].position.v[0] - avg_body.skeleton.joints[0].position.v[0], \ 169 | avg_body.skeleton.joints[1].position.v[1] - avg_body.skeleton.joints[0].position.v[1], \ 170 | avg_body.skeleton.joints[1].position.v[2] - avg_body.skeleton.joints[0].position.v[2]); 171 | cv::Vec3f f2(avg_body.skeleton.joints[0].position.v[0] - avg_body.skeleton.joints[18].position.v[0], \ 172 | avg_body.skeleton.joints[0].position.v[1] - avg_body.skeleton.joints[18].position.v[1], \ 173 | avg_body.skeleton.joints[0].position.v[2] - avg_body.skeleton.joints[18].position.v[2]); 174 | cv::Vec3f fcross; 175 | crossproduct(fcross, f1, f2); 176 | float fdot = f1.dot(f2); 177 | float F = atan2(norm(fcross), fdot); 178 | 179 | // G: 0-22-23 180 | cv::Vec3f g1(avg_body.skeleton.joints[0].position.v[0] - avg_body.skeleton.joints[22].position.v[0], \ 181 | avg_body.skeleton.joints[0].position.v[1] - avg_body.skeleton.joints[22].position.v[1], \ 182 | avg_body.skeleton.joints[0].position.v[2] - avg_body.skeleton.joints[22].position.v[2]); 183 | cv::Vec3f g2(avg_body.skeleton.joints[22].position.v[0] - avg_body.skeleton.joints[23].position.v[0], \ 184 | avg_body.skeleton.joints[22].position.v[1] - avg_body.skeleton.joints[23].position.v[1], \ 185 | avg_body.skeleton.joints[22].position.v[2] - avg_body.skeleton.joints[23].position.v[2]); 186 | cv::Vec3f gcross; 187 | crossproduct(gcross, g1, g2); 188 | float gdot = g1.dot(g2); 189 | float G = atan2(norm(gcross), gdot); 190 | 191 | // H: 0-18-19 192 | cv::Vec3f h1(avg_body.skeleton.joints[0].position.v[0] - avg_body.skeleton.joints[18].position.v[0], \ 193 | avg_body.skeleton.joints[0].position.v[1] - avg_body.skeleton.joints[18].position.v[1], \ 194 | avg_body.skeleton.joints[0].position.v[2] - avg_body.skeleton.joints[18].position.v[2]); 195 | cv::Vec3f h2(avg_body.skeleton.joints[18].position.v[0] - avg_body.skeleton.joints[19].position.v[0], \ 196 | avg_body.skeleton.joints[18].position.v[1] - avg_body.skeleton.joints[19].position.v[1], \ 197 | avg_body.skeleton.joints[18].position.v[2] - avg_body.skeleton.joints[19].position.v[2]); 198 | cv::Vec3f hcross; 199 | crossproduct(hcross, h1, h2); 200 | float hdot = h1.dot(h2); 201 | float H = atan2(norm(hcross), hdot); 202 | 203 | // I: 22-23-24 204 | cv::Vec3f i1(avg_body.skeleton.joints[22].position.v[0] - avg_body.skeleton.joints[23].position.v[0], \ 205 | avg_body.skeleton.joints[22].position.v[1] - avg_body.skeleton.joints[23].position.v[1], \ 206 | avg_body.skeleton.joints[22].position.v[2] - avg_body.skeleton.joints[23].position.v[2]); 207 | cv::Vec3f i2(avg_body.skeleton.joints[23].position.v[0] - avg_body.skeleton.joints[24].position.v[0], \ 208 | avg_body.skeleton.joints[23].position.v[1] - avg_body.skeleton.joints[24].position.v[1], \ 209 | avg_body.skeleton.joints[23].position.v[2] - avg_body.skeleton.joints[24].position.v[2]); 210 | cv::Vec3f icross; 211 | crossproduct(icross, i1, i2); 212 | float idot = i1.dot(i2); 213 | float I = atan2(norm(icross), idot); 214 | 215 | // J: 18-19-20 216 | cv::Vec3f j1(avg_body.skeleton.joints[18].position.v[0] - avg_body.skeleton.joints[19].position.v[0], \ 217 | avg_body.skeleton.joints[18].position.v[1] - avg_body.skeleton.joints[19].position.v[1], \ 218 | avg_body.skeleton.joints[18].position.v[2] - avg_body.skeleton.joints[19].position.v[2]); 219 | cv::Vec3f j2(avg_body.skeleton.joints[19].position.v[0] - avg_body.skeleton.joints[20].position.v[0], \ 220 | avg_body.skeleton.joints[19].position.v[1] - avg_body.skeleton.joints[20].position.v[1], \ 221 | avg_body.skeleton.joints[19].position.v[2] - avg_body.skeleton.joints[20].position.v[2]); 222 | cv::Vec3f jcross; 223 | crossproduct(jcross, j1, j2); 224 | float jdot = j1.dot(j2); 225 | float J = atan2(norm(jcross), jdot); 226 | 227 | // K: 23-24-25 228 | cv::Vec3f k1(avg_body.skeleton.joints[23].position.v[0] - avg_body.skeleton.joints[24].position.v[0], \ 229 | avg_body.skeleton.joints[23].position.v[1] - avg_body.skeleton.joints[24].position.v[1], \ 230 | avg_body.skeleton.joints[23].position.v[2] - avg_body.skeleton.joints[24].position.v[2]); 231 | cv::Vec3f k2(avg_body.skeleton.joints[24].position.v[0] - avg_body.skeleton.joints[25].position.v[0], \ 232 | avg_body.skeleton.joints[24].position.v[1] - avg_body.skeleton.joints[25].position.v[1], \ 233 | avg_body.skeleton.joints[24].position.v[2] - avg_body.skeleton.joints[25].position.v[2]); 234 | cv::Vec3f kcross; 235 | crossproduct(kcross, k1, k2); 236 | float kdot = k1.dot(k2); 237 | float K = atan2(norm(kcross), kdot); 238 | 239 | // L: 19-20-21 240 | cv::Vec3f l1(avg_body.skeleton.joints[19].position.v[0] - avg_body.skeleton.joints[20].position.v[0], \ 241 | avg_body.skeleton.joints[19].position.v[1] - avg_body.skeleton.joints[20].position.v[1], \ 242 | avg_body.skeleton.joints[19].position.v[2] - avg_body.skeleton.joints[20].position.v[2]); 243 | cv::Vec3f l2(avg_body.skeleton.joints[20].position.v[0] - avg_body.skeleton.joints[21].position.v[0], \ 244 | avg_body.skeleton.joints[20].position.v[1] - avg_body.skeleton.joints[21].position.v[1], \ 245 | avg_body.skeleton.joints[20].position.v[2] - avg_body.skeleton.joints[21].position.v[2]); 246 | cv::Vec3f lcross; 247 | crossproduct(lcross, l1, l2); 248 | float ldot = l1.dot(l2); 249 | float L = atan2(norm(lcross), ldot); 250 | 251 | vector angles = {A,B,C,D,E,F,G,H,I,J,K,L}; 252 | for (int ii = 0; ii joint_angles = computeJointAngles(body); 344 | 345 | if (joint_angles.size() > 0) 346 | { 347 | int offset = 0; 348 | int index = 0; 349 | string angle; 350 | ofstream outfile_angles; 351 | outfile_angles.open("../saved_data/joints_single_angles.csv", ios::out|ios::app); 352 | outfile_angles << to_string(ANGLE_FRAME_ROW_COUNT) << ","; 353 | for(std::vector::iterator it = joint_angles.begin(); it != joint_angles.end(); it++) 354 | { 355 | outfile_angles << *it*180/M_PI << ","; 356 | angle = (char)(index+65); 357 | 358 | std::cout << *it*180/M_PI << std::endl; 359 | 360 | // cv::putText(cv_main_color_image, angle+": "+to_string(*it*180/M_PI), cv::Point(cv_main_color_image.cols-200, 30+offset), FONT_HERSHEY_DUPLEX, 1, COLORS_darkorange, 1); 361 | offset += 30; 362 | index++; 363 | } 364 | ANGLE_FRAME_ROW_COUNT++; 365 | outfile_angles << std::endl; 366 | outfile_angles.close(); 367 | 368 | // plot joints 369 | // std::vector dataMain; 370 | // Mat mainstream(3, K4ABT_JOINT_COUNT, CV_32F); 371 | // std::vector main_points; 372 | 373 | 374 | // // convert to point coordinates and 375 | // for (int joint=0; joint < (int)K4ABT_JOINT_COUNT; joint++) 376 | // { 377 | // // for visualization of only using master vs. all averaged 378 | // main_points.push_back(cv::Point3f(body.skeleton.joints[joint].position.v[0],body.skeleton.joints[joint].position.v[1],body.skeleton.joints[joint].position.v[2])); 379 | // } 380 | // // Compute R, T from secondary to main coordinate space 381 | // Mat R; 382 | // Mat T; 383 | // arun(mainstream,mainstream, R, T); // R: [3x3], T: [1x3] 384 | 385 | // // Create zero distortion 386 | // cv::Mat distCoeffs(4,1,CV_32F); 387 | // distCoeffs.at(0) = 0; 388 | // distCoeffs.at(1) = 0; 389 | // distCoeffs.at(2) = 0; 390 | // distCoeffs.at(3) = 0; 391 | 392 | // std::vector projectedPointsMain, projectedPointsAvg; 393 | // cv::Mat rvecR(3,1,cv::DataType::type);//rodrigues rotation matrix 394 | // cv::Rodrigues(R,rvecR); 395 | 396 | // std::cerr << "projecting 3-D to 2-D..." << std::endl; 397 | // cv::projectPoints(main_points, rvecR, T, Mat(main_intrinsic_matrix), distCoeffs, projectedPointsMain); 398 | } 399 | 400 | } 401 | 402 | 403 | 404 | } 405 | else 406 | { 407 | // It should never hit timeout when K4A_WAIT_INFINITE is set. 408 | std::cout << "Error! Pop body frame result time out!" << std::endl; 409 | break; 410 | } 411 | } 412 | else 413 | { 414 | // It should never hit time out when K4A_WAIT_INFINITE is set. 415 | std::cout << "Error! Get depth frame time out!" << std::endl; 416 | break; 417 | } 418 | } while (frame_count < FRAME_COUNT); 419 | std::cout << "Finished body tracking processing!" << std::endl; 420 | 421 | } 422 | catch (const std::exception & e) 423 | { 424 | std::cerr << "Failed with exception:" << std::endl 425 | << " " << e.what() << std::endl; 426 | return 1; 427 | } 428 | 429 | return 0; 430 | } 431 | 432 | 433 | 434 | 435 | 436 | static cv::Mat color_to_opencv(const k4a::image &im) 437 | { 438 | cv::Mat cv_image_with_alpha(im.get_height_pixels(), im.get_width_pixels(), CV_8UC4, (void *)im.get_buffer()); 439 | cv::Mat cv_image_no_alpha; 440 | cv::cvtColor(cv_image_with_alpha, cv_image_no_alpha, cv::COLOR_BGRA2BGR); 441 | return cv_image_no_alpha; 442 | } 443 | 444 | 445 | void arun(cv::Mat &streamfrom, cv::Mat &streamto, cv::Mat &R, cv::Mat &T) 446 | { 447 | // find mean across the row (all joints for each x,y,z) 448 | cv::Mat avg_streamfrom, avg_streamto; // main, secondary: [3x32] 449 | cv::reduce(streamfrom, avg_streamfrom, 1, CV_REDUCE_AVG); // avg_main: [3x1] 450 | cv::reduce(streamto, avg_streamto, 1, CV_REDUCE_AVG); 451 | 452 | // find deviations from the mean 453 | cv::Mat rep_avg_streamfrom, rep_avg_streamto; 454 | cv::repeat(avg_streamfrom, 1, K4ABT_JOINT_COUNT, rep_avg_streamfrom); // rep_avg_main: [3x32] 455 | cv::repeat(avg_streamto, 1, K4ABT_JOINT_COUNT, rep_avg_streamto); 456 | 457 | cv::Mat streamfrom_sub, streamto_sub; 458 | cv::subtract(streamfrom, rep_avg_streamfrom, streamfrom_sub); 459 | cv::subtract(streamto, rep_avg_streamto, streamto_sub); 460 | 461 | // take singular value decomposition and compute R and T matrices 462 | Mat s, u, v; 463 | cv::SVDecomp(streamfrom_sub * streamto_sub.t(), s, u, v); 464 | v = v.t(); 465 | R = v * u.t(); 466 | double det = cv::determinant(R); 467 | 468 | // std::cout << "determinant: "<= 0) 470 | { 471 | // T = avg_main - (R * avg_secondary); // T: [3x1] 472 | subtract(avg_streamto, (R * avg_streamfrom), T); 473 | } 474 | else 475 | { 476 | T = cv::Mat(1, 3, CV_32F, cv::Scalar(1, 1, 1)); 477 | } 478 | // R: [3x3], T: [3x1] 479 | // std::cout << endl << "R "< 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | #include 11 | #include 12 | 13 | #include 14 | #include 15 | #include 16 | 17 | // Handle to a k4a body tracking frame. 18 | #include 19 | 20 | // Json 21 | #include 22 | 23 | #define FRAME_COUNT 1000 24 | #define VERIFY(result, error) \ 25 | if(result != K4A_RESULT_SUCCEEDED) \ 26 | { \ 27 | printf("%s \n - (File: %s, Function: %s, Line: %d)\n", error, __FILE__, __FUNCTION__, __LINE__); \ 28 | exit(1); \ 29 | }; 30 | 31 | using namespace std; 32 | 33 | static vector values; 34 | 35 | string confidenceEnumMapping(k4abt_joint_confidence_level_t confidence_level) 36 | { 37 | string resultString; 38 | switch (confidence_level) 39 | { 40 | case K4ABT_JOINT_CONFIDENCE_NONE: // 0 41 | resultString += "The joint is out of range(too far from depth camera)"; 42 | break; 43 | case K4ABT_JOINT_CONFIDENCE_LOW: // 1 44 | resultString += "The joint is not observed(likely due to occlusion) - predicted joint pose"; 45 | break; 46 | case K4ABT_JOINT_CONFIDENCE_MEDIUM: 47 | resultString += "Medium confidence in joint pose"; 48 | break; 49 | // beyond this will be supported later 50 | case K4ABT_JOINT_CONFIDENCE_HIGH: 51 | resultString += "High confidence in joint pose"; 52 | break; 53 | default: 54 | break; 55 | } 56 | return resultString; 57 | } 58 | 59 | vector print_body_information(k4abt_body_t body) 60 | { 61 | for (int i = 0; i < (int)K4ABT_JOINT_COUNT; i++) 62 | { 63 | k4a_float3_t position = body.skeleton.joints[i].position; 64 | k4a_quaternion_t orientation = body.skeleton.joints[i].orientation; 65 | k4abt_joint_confidence_level_t confidence_level = body.skeleton.joints[i].confidence_level; 66 | 67 | values.push_back(i); // joint 68 | values.push_back(position.v[0]); 69 | values.push_back(position.v[1]); 70 | values.push_back(position.v[2]); 71 | values.push_back(orientation.v[0]); 72 | values.push_back(orientation.v[1]); 73 | values.push_back(orientation.v[2]); 74 | values.push_back(orientation.v[3]); 75 | values.push_back(confidence_level); 76 | } 77 | return values; 78 | } 79 | 80 | #undef main 81 | int main() 82 | { 83 | 84 | // output file stream 85 | ofstream outfile; 86 | outfile.open("./joints_output.csv", ios::out, ios::trunc); 87 | outfile << ",,Position,,,Orientation,,,,Confidence Level" << endl; 88 | outfile << "Body ID," << "Joint #," << "x,y,z," << "x,y,z,w" << endl; 89 | 90 | try 91 | { 92 | k4a_device_configuration_t device_config = K4A_DEVICE_CONFIG_INIT_DISABLE_ALL; 93 | device_config.depth_mode = K4A_DEPTH_MODE_NFOV_UNBINNED; 94 | 95 | k4a::device device = k4a::device::open(0); 96 | device.start_cameras(&device_config); 97 | k4a::calibration sensor_calibration = device.get_calibration(device_config.depth_mode, device_config.color_resolution); 98 | k4abt::tracker tracker = k4abt::tracker::create(sensor_calibration); 99 | 100 | int frame_count = 0; 101 | do 102 | { 103 | k4a::capture sensor_capture; 104 | if (device.get_capture(&sensor_capture, std::chrono::milliseconds(K4A_WAIT_INFINITE))) 105 | { 106 | frame_count++; 107 | 108 | std::cout << "Start processing frame " << frame_count << std::endl; 109 | 110 | if (!tracker.enqueue_capture(sensor_capture)) 111 | { 112 | // It should never hit timeout when K4A_WAIT_INFINITE is set. 113 | std::cout << "Error! Add capture to tracker process queue timeout!" << std::endl; 114 | break; 115 | } 116 | 117 | k4abt::frame body_frame = tracker.pop_result(); 118 | if (body_frame != nullptr) 119 | { 120 | size_t num_bodies = body_frame.get_num_bodies(); 121 | std::cout << num_bodies << " bodies detected!" << std::endl; 122 | 123 | for (size_t i = 0; i < num_bodies; i++) 124 | { 125 | k4abt_body_t body = body_frame.get_body(i); 126 | 127 | // print information 128 | for (int i = 0; i < (int) K4ABT_JOINT_COUNT; i++) 129 | { 130 | k4a_float3_t position = body.skeleton.joints[i].position; 131 | k4a_quaternion_t orientation = body.skeleton.joints[i].orientation; 132 | k4abt_joint_confidence_level_t confidence_level = body.skeleton.joints[i].confidence_level; 133 | 134 | //outfile << *(it) << "," << *(it + 1) << "," << *(it + 2) << "," << *(it + 3) << "," << *(it + 4) << "," << *(it + 5) << "," << *(it + 6) << "," << *(it + 7) << "," << confidenceEnumMapping (int(*(it + 8))) << "," << endl; 135 | if (outfile.is_open()) 136 | { 137 | outfile << body.id << "," << i << "," << position.v[0] << "," << position.v[1] << "," << position.v[2] << "," << orientation.v[0] << "," << orientation.v[1] << "," << orientation.v[2] << "," << orientation.v[3] << "," << confidenceEnumMapping(confidence_level) << "," << endl; 138 | } 139 | 140 | } 141 | } 142 | } 143 | else 144 | { 145 | // It should never hit timeout when K4A_WAIT_INFINITE is set. 146 | std::cout << "Error! Pop body frame result time out!" << std::endl; 147 | break; 148 | } 149 | } 150 | else 151 | { 152 | // It should never hit time out when K4A_WAIT_INFINITE is set. 153 | std::cout << "Error! Get depth frame time out!" << std::endl; 154 | break; 155 | } 156 | } while (frame_count < FRAME_COUNT); 157 | std::cout << "Finished body tracking processing!" << std::endl; 158 | 159 | } 160 | catch (const std::exception & e) 161 | { 162 | std::cerr << "Failed with exception:" << std::endl 163 | << " " << e.what() << std::endl; 164 | return 1; 165 | } 166 | 167 | return 0; 168 | } 169 | -------------------------------------------------------------------------------- /src/src (visual studio)/kinect_body_test.cpp: -------------------------------------------------------------------------------- 1 | //#include 2 | //#include 3 | //#include 4 | //#include 5 | //#include 6 | // 7 | //// NuGet Package: Microsoft.Azure.Kinect.Sensor 8 | //#include 9 | //#include 10 | //#include 11 | // 12 | //// Kinect Body Tracking SDK: "C:\Program Files\Azure Kinect Body Tracking SDK\sdk\include" 13 | //#include 14 | // 15 | //// Handle to a k4a body tracking frame. 16 | //#include 17 | // 18 | //// Json 19 | //#include 20 | // 21 | //#define FRAME_COUNT 1 22 | // 23 | //#define VERIFY(result, error) \ 24 | // if(result != K4A_RESULT_SUCCEEDED) \ 25 | // { \ 26 | // printf("%s \n - (File: %s, Function: %s, Line: %d)\n", error, __FILE__, __FUNCTION__, __LINE__); \ 27 | // exit(1); \ 28 | // }; 29 | // 30 | //using namespace std; 31 | // 32 | //string confidenceEnumMapping(k4abt_joint_confidence_level_t confidence_level) 33 | //{ 34 | // string resultString; 35 | // switch (confidence_level) 36 | // { 37 | // case K4ABT_JOINT_CONFIDENCE_NONE: // 0 38 | // resultString += "The joint is out of range(too far from depth camera)"; 39 | // break; 40 | // case K4ABT_JOINT_CONFIDENCE_LOW: // 1 41 | // resultString += "The joint is not observed(likely due to occlusion) - predicted joint pose"; 42 | // break; 43 | // case K4ABT_JOINT_CONFIDENCE_MEDIUM: 44 | // resultString += "Medium confidence in joint pose"; 45 | // break; 46 | // // beyond this will be supported later 47 | // case K4ABT_JOINT_CONFIDENCE_HIGH: 48 | // resultString += "High confidence in joint pose"; 49 | // break; 50 | // default: 51 | // break; 52 | // } 53 | // return resultString; 54 | //} 55 | // 56 | // 57 | //#undef main 58 | //int main() 59 | //{ 60 | // try 61 | // { 62 | // k4a_device_t device = NULL; 63 | // VERIFY(k4a_device_open(0, &device), "Open K4A Device failed!"); 64 | // 65 | // // Start camera. Make sure depth camera is enabled. 66 | // k4a_device_configuration_t deviceConfig = K4A_DEVICE_CONFIG_INIT_DISABLE_ALL; 67 | // deviceConfig.depth_mode = K4A_DEPTH_MODE_NFOV_UNBINNED; 68 | // deviceConfig.color_resolution = K4A_COLOR_RESOLUTION_OFF; 69 | // VERIFY(k4a_device_start_cameras(device, &deviceConfig), "Start K4A cameras failed!"); 70 | // 71 | // k4a_calibration_t sensor_calibration; 72 | // VERIFY(k4a_device_get_calibration(device, deviceConfig.depth_mode, deviceConfig.color_resolution, &sensor_calibration), 73 | // "Get depth camera calibration failed!"); 74 | // 75 | // k4abt_tracker_t tracker = NULL; 76 | // k4abt_tracker_configuration_t tracker_config = K4ABT_TRACKER_CONFIG_DEFAULT; 77 | // VERIFY(k4abt_tracker_create(&sensor_calibration, tracker_config, &tracker), "Body tracker initialization failed!"); 78 | // 79 | // // output file stream 80 | // ofstream outfile; 81 | // outfile.open("./joint_info.csv", ios::out, ios::trunc); 82 | // 83 | // int frame_count = 0; 84 | // do 85 | // { 86 | // printf("device getting capture...\n"); 87 | // k4a_capture_t sensor_capture; 88 | // int32_t TIMEOUT_IN_MS = 1000; 89 | // k4a_wait_result_t get_capture_result = k4a_device_get_capture(device, &sensor_capture, K4A_WAIT_INFINITE); // TIMEOUT_IN_MS 90 | // if (get_capture_result == K4A_WAIT_RESULT_SUCCEEDED) 91 | // { 92 | // std::cout << "Start processing frame " << frame_count << std::endl; 93 | // 94 | // frame_count++; 95 | // k4a_wait_result_t queue_capture_result = k4abt_tracker_enqueue_capture(tracker, sensor_capture, K4A_WAIT_INFINITE); 96 | // 97 | // k4a_capture_release(sensor_capture); // Remember to release the sensor capture once you finish using it 98 | // if (queue_capture_result == K4A_WAIT_RESULT_TIMEOUT) 99 | // { 100 | // // It should never hit timeout when K4A_WAIT_INFINITE is set. 101 | // printf("Error! Add capture to tracker process queue timeout!\n"); 102 | // break; 103 | // } 104 | // else if (queue_capture_result == K4A_WAIT_RESULT_FAILED) 105 | // { 106 | // printf("Error! Add capture to tracker process queue failed!\n"); 107 | // break; 108 | // } 109 | // 110 | // printf("body tracker being created...\n"); 111 | // // real-time processing 112 | // k4abt_frame_t body_frame = NULL; 113 | // k4a_wait_result_t pop_frame_result = k4abt_tracker_pop_result(tracker, &body_frame, K4A_WAIT_INFINITE); 114 | // if (pop_frame_result == K4A_WAIT_RESULT_SUCCEEDED) 115 | // { 116 | // 117 | // // Successfully popped the body tracking result. Start your processing 118 | // size_t num_bodies = k4abt_frame_get_num_bodies(body_frame); 119 | // printf("%zu bodies are detected!\n", num_bodies); 120 | // 121 | // // access body ID 122 | // /*for (size_t i = 0; i < num_bodies; i++) 123 | // { 124 | // k4abt_skeleton_t skeleton; 125 | // k4abt_frame_get_body_skeleton(body_frame, i, &skeleton); 126 | // uint32_t id = k4abt_frame_get_body_id(body_frame, i); 127 | // }*/ 128 | // 129 | // // access body index map 130 | // //k4a_image_t body_index_map = k4abt_frame_get_body_index_map(body_frame); 131 | // //// Do your work with the body index map 132 | // //k4a_image_release(body_index_map); 133 | // 134 | // // access input capture 135 | // //k4a_capture_t input_capture = k4abt_frame_get_capture(body_frame); 136 | // //// Do your work with the input capture 137 | // //k4a_capture_release(input_capture); 138 | // 139 | // 140 | // // loop through all body joints 141 | // for (size_t index = 0; index < num_bodies; index++) 142 | // { 143 | // k4abt_skeleton_t skeleton; 144 | // k4a_result_t result = k4abt_frame_get_body_skeleton(body_frame, index, &skeleton); 145 | // if (result != K4A_RESULT_FAILED) 146 | // { 147 | // if (outfile.is_open()) 148 | // { 149 | // outfile << "[Position] Vector array," << long float(*(&skeleton)->joints->position.v) << endl; 150 | // outfile << "[Position] (x-y-z) coordinate," << long float((&skeleton)->joints->position.xyz.x) << ", " << long float((&skeleton)->joints->position.xyz.y) << ", " << long float((&skeleton)->joints->position.xyz.z) << endl; 151 | // 152 | // outfile << "[orientation] (x-y-z-w)," << long float((&skeleton)->joints->orientation.wxyz.x) << ", " << long float((&skeleton)->joints->orientation.wxyz.y) << ", " << long float((&skeleton)->joints->orientation.wxyz.z) << ", " << long float((&skeleton)->joints->orientation.wxyz.w) << endl; 153 | // outfile << "[orientation] Vector array," << *(&skeleton)->joints->orientation.v << endl; 154 | // 155 | // outfile << "[confidence level]," << (&skeleton)->joints->confidence_level << ", " << confidenceEnumMapping((&skeleton)->joints->confidence_level) << endl; 156 | // 157 | // } 158 | // // type float 159 | // printf("[Position] Vector array: %i \n", (&skeleton)->joints->position.v); 160 | // printf("[Position] (x,y,z) coordinate: (%i,%i,%i) \n", (&skeleton)->joints->position.xyz.x, (&skeleton)->joints->position.xyz.y, (&skeleton)->joints->position.xyz.z); 161 | // 162 | // printf("[orientation] (x,y,z,w): (%i,%i,%i,%i) \n", (&skeleton)->joints->orientation.wxyz.x, (&skeleton)->joints->orientation.wxyz.y, (&skeleton)->joints->orientation.wxyz.z, (&skeleton)->joints->orientation.wxyz.w); 163 | // printf("[orientation] Vector array: %i \n", *(&skeleton)->joints->orientation.v); 164 | // 165 | // printf("[confidence level]: %i \n", (&skeleton)->joints->confidence_level); 166 | // } 167 | // } 168 | // 169 | // 170 | // 171 | // // End processing 172 | // k4abt_frame_release(body_frame); // Remember to release the body frame once you finish using it 173 | // } 174 | // else if (pop_frame_result == K4A_WAIT_RESULT_TIMEOUT) 175 | // { 176 | // // It should never hit timeout when K4A_WAIT_INFINITE is set. 177 | // printf("Error! Pop body frame result timeout!\n"); 178 | // break; 179 | // } 180 | // else 181 | // { 182 | // printf("Pop body frame result failed!\n"); 183 | // break; 184 | // } 185 | // } 186 | // else if (get_capture_result == K4A_WAIT_RESULT_TIMEOUT) 187 | // { 188 | // // It should never hit time out when K4A_WAIT_INFINITE is set. 189 | // printf("Error! Get depth frame time out!\n"); 190 | // break; 191 | // } 192 | // else 193 | // { 194 | // printf("Get depth capture returned error: %d\n", get_capture_result); 195 | // break; 196 | // } 197 | // 198 | // } while (frame_count < FRAME_COUNT); 199 | // 200 | // printf("Finished body tracking processing!\n"); 201 | // k4abt_tracker_shutdown(tracker); 202 | // k4abt_tracker_destroy(tracker); 203 | // k4a_device_stop_cameras(device); 204 | // k4a_device_close(device); 205 | // } 206 | // catch (const std::exception& e) 207 | // { 208 | // std::cerr << "Failed with exception:" << std::endl 209 | // << " " << e.what() << std::endl; 210 | // return 1; 211 | // } 212 | // return 0; 213 | //} -------------------------------------------------------------------------------- /src/src (visual studio)/kinect_body_test.vcxproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Debug 6 | Win32 7 | 8 | 9 | Release 10 | Win32 11 | 12 | 13 | Debug 14 | x64 15 | 16 | 17 | Release 18 | x64 19 | 20 | 21 | 22 | 16.0 23 | {70B15987-3195-44CF-B23E-B3273A24A802} 24 | Win32Proj 25 | kinectbodytest 26 | 10.0 27 | 28 | 29 | 30 | Application 31 | true 32 | v142 33 | Unicode 34 | 35 | 36 | Application 37 | false 38 | v142 39 | true 40 | Unicode 41 | 42 | 43 | Application 44 | true 45 | v142 46 | Unicode 47 | 48 | 49 | Application 50 | false 51 | v142 52 | true 53 | Unicode 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | true 75 | C:\Program Files\Azure Kinect Body Tracking SDK\sdk\include;D:\Kinect\opencv\build\install\include\opencv2;C:\Program Files\Microsoft SDKs\Kinect\v2.0_1409\inc;$(IncludePath) 76 | D:\Kinect\opencv\build\install\x64\vc16\lib;C:\Program Files\Microsoft SDKs\Kinect\v2.0_1409\Lib\x64;$(LibraryPath) 77 | 78 | 79 | true 80 | 81 | 82 | false 83 | 84 | 85 | false 86 | 87 | 88 | 89 | 90 | 91 | Level3 92 | Disabled 93 | true 94 | _DEBUG;_CONSOLE;%(PreprocessorDefinitions) 95 | true 96 | D:\Kinect\kinect_vc_test\kinect_simple;D:\Kinect\json\include 97 | 98 | 99 | Console 100 | true 101 | 102 | 103 | 104 | 105 | 106 | 107 | Level3 108 | Disabled 109 | true 110 | WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) 111 | true 112 | 113 | 114 | Console 115 | true 116 | 117 | 118 | 119 | 120 | 121 | 122 | Level3 123 | MaxSpeed 124 | true 125 | true 126 | true 127 | WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) 128 | true 129 | 130 | 131 | Console 132 | true 133 | true 134 | true 135 | 136 | 137 | 138 | 139 | 140 | 141 | Level3 142 | MaxSpeed 143 | true 144 | true 145 | true 146 | NDEBUG;_CONSOLE;%(PreprocessorDefinitions) 147 | true 148 | 149 | 150 | Console 151 | true 152 | true 153 | true 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. 173 | 174 | 175 | 176 | 177 | 178 | 179 | -------------------------------------------------------------------------------- /src/src (visual studio)/kinect_body_test.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;ipp;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /src/src (visual studio)/kinect_body_test.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /src/src (visual studio)/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /src/src (visual studio)/x64/Debug/desktop.ini: -------------------------------------------------------------------------------- 1 | [.ShellClassInfo] 2 | InfoTip=This folder is shared online. 3 | IconFile=C:\Program Files\Google\Drive\googledrivesync.exe 4 | IconIndex=16 5 | -------------------------------------------------------------------------------- /src/src (visual studio)/x64/Debug/kinect_body_test.log: -------------------------------------------------------------------------------- 1 |  kinect_body.cpp 2 | kinect_body_test.vcxproj -> D:\Kinect\kinect_vc_test\kinect_test2\x64\Debug\kinect_body_test.exe 3 | -------------------------------------------------------------------------------- /src/src (visual studio)/x64/Debug/kinect_body_test.obj.enc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andyj1/kinect/10d9334ec047587331191e779f019e58c51ee519/src/src (visual studio)/x64/Debug/kinect_body_test.obj.enc -------------------------------------------------------------------------------- /src/src (visual studio)/x64/Debug/kinect_body_test.tlog/CL.command.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andyj1/kinect/10d9334ec047587331191e779f019e58c51ee519/src/src (visual studio)/x64/Debug/kinect_body_test.tlog/CL.command.1.tlog -------------------------------------------------------------------------------- /src/src (visual studio)/x64/Debug/kinect_body_test.tlog/CL.read.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andyj1/kinect/10d9334ec047587331191e779f019e58c51ee519/src/src (visual studio)/x64/Debug/kinect_body_test.tlog/CL.read.1.tlog -------------------------------------------------------------------------------- /src/src (visual studio)/x64/Debug/kinect_body_test.tlog/CL.write.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andyj1/kinect/10d9334ec047587331191e779f019e58c51ee519/src/src (visual studio)/x64/Debug/kinect_body_test.tlog/CL.write.1.tlog -------------------------------------------------------------------------------- /src/src (visual studio)/x64/Debug/kinect_body_test.tlog/desktop.ini: -------------------------------------------------------------------------------- 1 | [.ShellClassInfo] 2 | InfoTip=This folder is shared online. 3 | IconFile=C:\Program Files\Google\Drive\googledrivesync.exe 4 | IconIndex=16 5 | -------------------------------------------------------------------------------- /src/src (visual studio)/x64/Debug/kinect_body_test.tlog/kinect_body_test.lastbuildstate: -------------------------------------------------------------------------------- 1 | #TargetFrameworkVersion=v4.0:PlatformToolSet=v142:EnableManagedIncrementalBuild=false:VCToolArchitecture=Native32Bit:WindowsTargetPlatformVersion=10.0 2 | Debug|x64|D:\Kinect\kinect_vc_test\kinect_test2\| 3 | -------------------------------------------------------------------------------- /src/src (visual studio)/x64/Debug/kinect_body_test.tlog/kinect_body_test.write.1u.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andyj1/kinect/10d9334ec047587331191e779f019e58c51ee519/src/src (visual studio)/x64/Debug/kinect_body_test.tlog/kinect_body_test.write.1u.tlog -------------------------------------------------------------------------------- /src/src (visual studio)/x64/Debug/kinect_body_test.tlog/link.command.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andyj1/kinect/10d9334ec047587331191e779f019e58c51ee519/src/src (visual studio)/x64/Debug/kinect_body_test.tlog/link.command.1.tlog -------------------------------------------------------------------------------- /src/src (visual studio)/x64/Debug/kinect_body_test.tlog/link.read.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andyj1/kinect/10d9334ec047587331191e779f019e58c51ee519/src/src (visual studio)/x64/Debug/kinect_body_test.tlog/link.read.1.tlog -------------------------------------------------------------------------------- /src/src (visual studio)/x64/Debug/kinect_body_test.tlog/link.write.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andyj1/kinect/10d9334ec047587331191e779f019e58c51ee519/src/src (visual studio)/x64/Debug/kinect_body_test.tlog/link.write.1.tlog -------------------------------------------------------------------------------- /src/src (visual studio)/x64/Debug/kinect_body_test.vcxproj.CopyComplete: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andyj1/kinect/10d9334ec047587331191e779f019e58c51ee519/src/src (visual studio)/x64/Debug/kinect_body_test.vcxproj.CopyComplete -------------------------------------------------------------------------------- /src/src (visual studio)/x64/Debug/vc142.idb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andyj1/kinect/10d9334ec047587331191e779f019e58c51ee519/src/src (visual studio)/x64/Debug/vc142.idb -------------------------------------------------------------------------------- /src/src (visual studio)/x64/Debug/vc142.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andyj1/kinect/10d9334ec047587331191e779f019e58c51ee519/src/src (visual studio)/x64/Debug/vc142.pdb -------------------------------------------------------------------------------- /src/src (visual studio)/x64/desktop.ini: -------------------------------------------------------------------------------- 1 | [.ShellClassInfo] 2 | InfoTip=This folder is shared online. 3 | IconFile=C:\Program Files\Google\Drive\googledrivesync.exe 4 | IconIndex=16 5 | -------------------------------------------------------------------------------- /src/sync.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include "transformation.h" 5 | #include "MultiDeviceCapturer.h" 6 | #include "colors.h" 7 | 8 | using namespace color; 9 | using namespace cv; 10 | using namespace std; 11 | 12 | class sync{ 13 | 14 | public: 15 | 16 | // ideally, we could generalize this to many OpenCV types 17 | static cv::Mat color_to_opencv(const k4a::image &im); 18 | static cv::Mat depth_to_opencv(const k4a::image &im); 19 | static cv::Matx33f calibration_to_color_camera_matrix(const k4a::calibration &cal); 20 | static Transformation get_depth_to_color_transformation_from_calibration(const k4a::calibration &cal); 21 | static k4a::calibration construct_device_to_device_calibration(const k4a::calibration &main_cal, 22 | const k4a::calibration &secondary_cal, 23 | const Transformation &secondary_to_main); 24 | static vector calibration_to_color_camera_dist_coeffs(const k4a::calibration &cal); 25 | static bool find_chessboard_corners_helper(const cv::Mat &main_color_image, 26 | const cv::Mat &secondary_color_image, 27 | const cv::Size &chessboard_pattern, 28 | vector &main_chessboard_corners, 29 | vector &secondary_chessboard_corners); 30 | static Transformation stereo_calibration(const k4a::calibration &main_calib, 31 | const k4a::calibration &secondary_calib, 32 | const vector> &main_chessboard_corners_list, 33 | const vector> &secondary_chessboard_corners_list, 34 | const cv::Size &image_size, 35 | const cv::Size &chessboard_pattern, 36 | float chessboard_square_length); 37 | static k4a_device_configuration_t get_master_config(); 38 | static k4a_device_configuration_t get_subordinate_config(); 39 | static Transformation calibrate_devices(MultiDeviceCapturer &capturer, 40 | const k4a_device_configuration_t &main_config, 41 | const k4a_device_configuration_t &secondary_config, 42 | const cv::Size &chessboard_pattern, 43 | float chessboard_square_length, 44 | double calibration_timeout); 45 | static k4a::image create_depth_image_like(const k4a::image &im); 46 | 47 | // custom functions 48 | void print_body_index_map_middle_line(k4a::image body_index_map); 49 | k4a_float3_t get_average_position_xyz(k4a_float3_t main_position, k4a_float3_t secondary_position, int main_or_secondary); 50 | k4a_quaternion_t get_average_quaternion_xyzw(k4a_quaternion_t main_quaternion, k4a_quaternion_t secondary_quaternion, int main_or_secondar); 51 | int get_average_confidence(k4abt_joint_confidence_level_t mainCI, k4abt_joint_confidence_level_t secondaryCI); 52 | string confidenceEnumMapping(k4abt_joint_confidence_level_t confidence_level); 53 | 54 | void processData(k4abt_body_t main_body, vector> secondary_body_vector, cv::Mat &main, cv::Matx33f main_intrinsic_matrix, vector validSubDevices); 55 | void transform_body(k4abt_body_t& main_body, k4abt_body_t& secondary_body); 56 | void arun(Mat& main, Mat& secondary, Mat& R, Mat& T); 57 | void plotBody(k4abt_body_t main_body, k4abt_body_t avg_body, cv::Mat main, cv::Matx33f main_intrinsic_matrix, int num_subordinates); 58 | std::vector computeJointAngles(k4abt_body_t avg_body); 59 | 60 | private: 61 | 62 | }; -------------------------------------------------------------------------------- /src/transformation.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | #pragma once 4 | 5 | #include 6 | 7 | struct Transformation 8 | { 9 | cv::Matx33d R; 10 | cv::Vec3d t; 11 | 12 | // Construct an identity transformation. 13 | Transformation() : R(cv::Matx33d::eye()), t(0., 0., 0.) {} 14 | 15 | // Construct from H 16 | Transformation(const cv::Matx44d &H) : R(H.get_minor<3, 3>(0, 0)), t(H(0, 3), H(1, 3), H(2, 3)) {} 17 | 18 | // Create homogeneous matrix from this transformation 19 | cv::Matx44d to_homogeneous() const 20 | { 21 | return cv::Matx44d( 22 | // row 1 23 | R(0, 0), 24 | R(0, 1), 25 | R(0, 2), 26 | t(0), 27 | // row 2 28 | R(1, 0), 29 | R(1, 1), 30 | R(1, 2), 31 | t(1), 32 | // row 3 33 | R(2, 0), 34 | R(2, 1), 35 | R(2, 2), 36 | t(2), 37 | // row 4 38 | 0, 39 | 0, 40 | 0, 41 | 1); 42 | } 43 | 44 | // Construct a transformation equivalent to this transformation followed by the second transformation 45 | Transformation compose_with(const Transformation &second_transformation) const 46 | { 47 | // get this transform 48 | cv::Matx44d H_1 = to_homogeneous(); 49 | // get the transform to be composed with this one 50 | cv::Matx44d H_2 = second_transformation.to_homogeneous(); 51 | // get the combined transform 52 | cv::Matx44d H_3 = H_1 * H_2; 53 | return Transformation(H_3); 54 | } 55 | }; 56 | -------------------------------------------------------------------------------- /src/two.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include "transformation.h" 5 | #include "MultiDeviceCapturer.h" 6 | #include "colors.h" 7 | 8 | using namespace color; 9 | using namespace cv; 10 | using namespace std; 11 | 12 | class sync{ 13 | 14 | public: 15 | 16 | // ideally, we could generalize this to many OpenCV types 17 | static cv::Mat color_to_opencv(const k4a::image &im); 18 | static cv::Mat depth_to_opencv(const k4a::image &im); 19 | static cv::Matx33f calibration_to_color_camera_matrix(const k4a::calibration &cal); 20 | static Transformation get_depth_to_color_transformation_from_calibration(const k4a::calibration &cal); 21 | static k4a::calibration construct_device_to_device_calibration(const k4a::calibration &main_cal, 22 | const k4a::calibration &secondary_cal, 23 | const Transformation &secondary_to_main); 24 | static vector calibration_to_color_camera_dist_coeffs(const k4a::calibration &cal); 25 | static bool find_chessboard_corners_helper(const cv::Mat &main_color_image, 26 | const cv::Mat &secondary_color_image, 27 | const cv::Size &chessboard_pattern, 28 | vector &main_chessboard_corners, 29 | vector &secondary_chessboard_corners); 30 | static Transformation stereo_calibration(const k4a::calibration &main_calib, 31 | const k4a::calibration &secondary_calib, 32 | const vector> &main_chessboard_corners_list, 33 | const vector> &secondary_chessboard_corners_list, 34 | const cv::Size &image_size, 35 | const cv::Size &chessboard_pattern, 36 | float chessboard_square_length); 37 | static k4a_device_configuration_t get_master_config(); 38 | static k4a_device_configuration_t get_subordinate_config(); 39 | static Transformation calibrate_devices(MultiDeviceCapturer &capturer, 40 | const k4a_device_configuration_t &main_config, 41 | const k4a_device_configuration_t &secondary_config, 42 | const cv::Size &chessboard_pattern, 43 | float chessboard_square_length, 44 | double calibration_timeout); 45 | static k4a::image create_depth_image_like(const k4a::image &im); 46 | 47 | // custom functions 48 | void print_body_index_map_middle_line(k4a::image body_index_map); 49 | k4a_float3_t get_average_position_xyz(k4a_float3_t main_position, k4a_float3_t secondary_position, int main_or_secondary); 50 | k4a_quaternion_t get_average_quaternion_xyzw(k4a_quaternion_t main_quaternion, k4a_quaternion_t secondary_quaternion, int main_or_secondar); 51 | int get_average_confidence(k4abt_joint_confidence_level_t mainCI, k4abt_joint_confidence_level_t secondaryCI); 52 | string confidenceEnumMapping(k4abt_joint_confidence_level_t confidence_level); 53 | 54 | void print_body_information(k4abt_body_t main_body, k4abt_body_t secondary_body, cv::Mat& main, cv::Mat& secondary, cv::Matx33f main_intrinsic_matrix); 55 | void plotBody(std::vector dataMain, std::vector dataSecondary, std::vector dataAvg, cv::Mat main, cv::Mat secondary); 56 | void transform_body(k4abt_body_t& main_body, k4abt_body_t& secondary_body); 57 | void arun(Mat& main, Mat& secondary, Mat& R, Mat& T); 58 | 59 | private: 60 | 61 | }; --------------------------------------------------------------------------------