Skip to content

Commit 6fd758c

Browse files
Added body 3-D reconstruction for 3 FLIR cameras in Windows
1 parent 891795d commit 6fd758c

28 files changed

+1835
-34
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@ MANIFEST-*
7171
3rdparty/windows/caffe/
7272
3rdparty/windows/caffe3rdparty/
7373
3rdparty/windows/opencv/
74+
3rdparty/windows/freeglut/
75+
3rdparty/windows/spinnaker/
7476
# Allowing this file (removed *.user for Qt)
7577
!*.vcxproj.user
7678

doc/installation.md

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@ OpenPose Library - Compilation and Installation
55
1. [Requirements](#requirements)
66
2. [Ubuntu](#ubuntu)
77
3. [Windows](#windows)
8-
4. [Quick Start](#quick-start)
9-
5. [Expected Visual Results](#expected-visual-results)
10-
6. [FAQ](#faq)
8+
4. [OpenPose 3D Demo](#openpose-3d-demo)
9+
5. [Quick Start](#quick-start)
10+
6. [Expected Visual Results](#expected-visual-results)
11+
7. [FAQ](#faq)
1112

1213

1314

@@ -129,6 +130,16 @@ You just need to remove the OpenPose or portable demo folder.
129130
130131
131132
133+
## OpenPose 3D Demo
134+
This is a beta version that makes body pose 3-D reconstruction and rendering. We will not keep updating it nor solving questions/issues about it at the moment. It requires the user to be familiar with camera calibration, i.e. extraction of intrinsic and extrinsic parameters. The Windows steps were tested and worked in the OpenPose 1.0.1 version from the first GitHub commit on July 17th, 2017 in the [oficial repository](https://github.com/CMU-Perceptual-Computing-Lab/openpose).
135+
136+
If you still wanna try our OpenPose 3-D reconstruction demo, see [doc/openpose_3d_reconstruction_demo.md](./openpose_3d_reconstruction_demo.md).
137+
138+
139+
140+
141+
142+
132143
## Quick Start
133144
Check that the library is working properly by using any of the following commands. Note that `examples/media/video.avi` and `examples/media` exist, so you do not need to change the paths. In addition, the following commands assume your terminal (Ubuntu) or cmd (Windows) are located in the OpenPose folder.
134145
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# Running OpenPose 3-D Reconstruction Demo - Windows
2+
This is a beta version that makes body pose 3-D reconstruction and rendering. We will not keep updating it nor solving questions/issues about it at the moment. It requires the user to be familiar with computer vision, in particular with camera calibration, i.e. extraction of intrinsic and extrinsic parameters.
3+
4+
The Windows steps were tested and worked in the OpenPose 1.0.1 version from the last GitHub commit on July 7th, 2017 in the [oficial repository](https://github.com/CMU-Perceptual-Computing-Lab/openpose).
5+
6+
7+
8+
### Hardware
9+
This demo assumes 3 stereo cameras, FLIR company (former Point Grey). Ideally any USB-3 FLIR model should work, but we have only used the following specific specifications:
10+
11+
1. Camera details:
12+
- Blackfly S Color 1.3 MP USB3 Vision (ON Semi PYTHON 1300)
13+
- Model: BFS-U3-13Y3C-C
14+
- 1280x1024 resolution and 170 FPS
15+
- https://www.ptgrey.com/blackfly-s-13-mp-color-usb3-vision-on-semi-python1300
16+
- Hardware trigger synchronization required. For this camera model, see `Blackfly S` section in [https://www.ptgrey.com/tan/11052](https://www.ptgrey.com/tan/11052) or [https://www.ptgrey.com/KB/11052](https://www.ptgrey.com/KB/11052).
17+
- (Ubuntu-only) Open your USB ports following section `Configuring USBFS` in [http://www.ptgrey.com/KB/10685](http://www.ptgrey.com/KB/10685).
18+
- Install the Spinnaker SDK for your operating system: [https://www.ptgrey.com/support/downloads](https://www.ptgrey.com/support/downloads).
19+
2. Fujinon 3 MP Varifocal Lens (3.8-13mm, 3.4x Zoom) for each camera.
20+
- E.g. [https://www.bhphotovideo.com/c/product/736855-REG/Fujinon_DV3_4X3_8SA_1_3_MP_Varifocal_Lens.html](https://www.bhphotovideo.com/c/product/736855-REG/Fujinon_DV3_4X3_8SA_1_3_MP_Varifocal_Lens.html).
21+
3. 4-Port PCI Express (PCIe) USB 3.0 Card Adapter with 4 dedicated channels.
22+
- E.g. [https://www.startech.com/Cards-Adapters/USB-3.0/Cards/PCI-Express-USB-3-Card-4-Dedicated-Channels-4-Port~PEXUSB3S44V](https://www.startech.com/Cards-Adapters/USB-3.0/Cards/PCI-Express-USB-3-Card-4-Dedicated-Channels-4-Port~PEXUSB3S44V).
23+
4. USB 3.0 cable for each FLIR camera.
24+
- From their official website: [https://www.ptgrey.com/5-meter-type-a-to-micro-b-locking-usb-30-cable](https://www.ptgrey.com/5-meter-type-a-to-micro-b-locking-usb-30-cable).
25+
26+
27+
28+
### Calibrate Cameras
29+
You must manually get the intrinsic and extrinsic parameters of your cameras and introduce them on: `openpose3d\cameraParameters.hpp`. We used the 8-distortion-parameter version of OpenCV.
30+
31+
32+
33+
### Windows
34+
1. Open the OpenPose visual studio solution `windows\openpose.sln`.
35+
2. Right-click on `Solution 'OpenPose'` of the `Solution Explorer` window, usually placed at the top-right part of the VS screen.
36+
3. Click on `Properties`. Go to `Configuration Properties` -> `Configuration` and check `Build` for the `OpenPose3DReconstruction` project.
37+
4. Get the last Spinnaker SKD version, i.e. the FLIR camera driver and software:
38+
- Download last Spinnaker SDK: https://www.ptgrey.com/support/downloads
39+
- Copy `{PointGreyParentDirectory}\Point Grey Research\Spinnaker\bin64\vs2015\` as `{OpenPoseDirectory}\3rdparty\windows\spinnaker\bin\`. You can remove all the *.exe files.
40+
- Copy `{PointGreyParentDirectory}\Point Grey Research\Spinnaker\include\` as `{OpenPoseDirectory}\3rdparty\windows\spinnaker\include\`.
41+
- Copy `Spinnaker_v140.lib` and `Spinnakerd_v140.lib` from `{PointGreyParentDirectory}\Point Grey Research\Spinnaker\lib64\vs2015\` into `{OpenPoseDirectory}\3rdparty\windows\spinnaker\lib\`.
42+
- (Optional) Spinnaker SDK overview: https://www.ptgrey.com/spinnaker-sdk
43+
5. Get the last OpenGL Glut library version for the rendering:
44+
- Download the latest `MSVC Package` from http://www.transmissionzero.co.uk/software/freeglut-devel/
45+
- Copy `{freeglutParentDirectory}\freeglut\bin\x64\` as `{OpenPoseDirectory}\3rdparty\windows\freeglut\bin\bin\`.
46+
- Copy `{freeglutParentDirectory}\freeglut\include\` as `{OpenPoseDirectory}\3rdparty\windows\freeglut\include\`.
47+
- Copy `{freeglutParentDirectory}\freeglut\lib\x64\` as `{OpenPoseDirectory}\3rdparty\windows\freeglut\lib\`.
48+
49+
50+
51+
### Ubuntu
52+
We do not support Ubuntu at all for this demo. We did an original and very initial version long ago, but it was highly changed later. In case you need Ubuntu, these are the steps we used for our that original version in Ubuntu 16. Note that they might be several differences to make it work in the current version. Feel free to send us or make a pull request with the updated steps and we will update them, but we will not answer any kind of questions about it.
53+
54+
1. `sudo apt-get install freeglut3-dev`.
55+
2. Compile OpenPose by your own [from https://github.com/CMU-Perceptual-Computing-Lab/openpose](from https://github.com/CMU-Perceptual-Computing-Lab/openpose).
56+
3. Perform `make distribute` on OpenPose, and copy the `include` and `lib` files in [3rdparty/openpose/](3rdparty/openpose/).
57+
4. Copy the `include` and `lib` folders from {OpenPose path}/3rdparty/caffe/distribute/ to [3rdparty/caffe/](3rdparty/caffe/).
58+
5. Copy your Spinnaker desired version `include` and `lib` folders on [3rdparty/spinnaker/](3rdparty/spinnaker/).
59+
6. Open the [rtstereo.pro](rtstereo.pro) file with Qt to have the project ready-to-compile-and-go. If you prefer using your own Makefile file, you can take a look to this Qt file to know which files (basically [src/](src/) and [include/](include/)) and compiler flags used.
60+
1. If using Qt, you will have to manually copy the {OpenPose path}/models folder inside the generated build folder.
61+
7. You must copy the contents of [add_to_bin_file/](add_to_bin_file/) where the final binary file is generated.

include/openpose/core/macros.hpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@
99
#define OP_API __declspec(dllimport)
1010
#endif
1111

12+
//Disable some Windows Warnings
13+
#ifdef _WIN32
14+
#pragma warning ( disable : 4251 ) // XXX needs to have dll-interface to be used by clients of class YYY
15+
#pragma warning( disable: 4275 ) // non dll-interface structXXX used as base
16+
#endif
17+
1218
#define DATUM_BASE_NO_PTR std::vector<Datum>
1319
#define DATUM_BASE std::shared_ptr<DATUM_BASE_NO_PTR>
1420
#define DEFINE_TEMPLATE_DATUM(templateName) template class OP_API templateName<DATUM_BASE>

windows/OpenPose.sln

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,13 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "2_extract_pose_or_heatmat_f
6262
{1848F100-6EC5-4F60-9748-062590ADFE5C} = {1848F100-6EC5-4F60-9748-062590ADFE5C}
6363
EndProjectSection
6464
EndProject
65+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "OpenPose 3D Reconstruction", "OpenPose 3D Reconstruction", "{CB5A0F6C-6DD3-4789-9E6F-9B9B51AE4F10}"
66+
EndProject
67+
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "OpenPose3DReconstruction", "OpenPose3DReconstruction\OpenPose3DReconstruction.vcxproj", "{F31BEEF2-37B0-4B0F-85D3-AD427C56AD72}"
68+
ProjectSection(ProjectDependencies) = postProject
69+
{1848F100-6EC5-4F60-9748-062590ADFE5C} = {1848F100-6EC5-4F60-9748-062590ADFE5C}
70+
EndProjectSection
71+
EndProject
6572
Global
6673
GlobalSection(SolutionConfigurationPlatforms) = preSolution
6774
Debug|x64 = Debug|x64
@@ -130,6 +137,11 @@ Global
130137
{D1E5B5FC-A447-4BCC-8024-C6B6B8061A7D}.Release|x64.ActiveCfg = Release|x64
131138
{D1E5B5FC-A447-4BCC-8024-C6B6B8061A7D}.Release|x64.Build.0 = Release|x64
132139
{D1E5B5FC-A447-4BCC-8024-C6B6B8061A7D}.Release|x86.ActiveCfg = Release|x64
140+
{F31BEEF2-37B0-4B0F-85D3-AD427C56AD72}.Debug|x64.ActiveCfg = Debug|x64
141+
{F31BEEF2-37B0-4B0F-85D3-AD427C56AD72}.Debug|x64.Build.0 = Debug|x64
142+
{F31BEEF2-37B0-4B0F-85D3-AD427C56AD72}.Debug|x86.ActiveCfg = Debug|x64
143+
{F31BEEF2-37B0-4B0F-85D3-AD427C56AD72}.Release|x64.ActiveCfg = Release|x64
144+
{F31BEEF2-37B0-4B0F-85D3-AD427C56AD72}.Release|x86.ActiveCfg = Release|x64
133145
EndGlobalSection
134146
GlobalSection(SolutionProperties) = preSolution
135147
HideSolutionNode = FALSE
@@ -149,5 +161,7 @@ Global
149161
{4A271F39-C60B-4827-9A64-E0EEDD15D082} = {8F1B1B9F-0117-48CD-B9F6-06E1930640C3}
150162
{DA43DA92-141D-4B91-80CE-8A2C5B377683} = {40194B19-A61E-4B91-89CD-A858AC5953A6}
151163
{D1E5B5FC-A447-4BCC-8024-C6B6B8061A7D} = {40194B19-A61E-4B91-89CD-A858AC5953A6}
164+
{CB5A0F6C-6DD3-4789-9E6F-9B9B51AE4F10} = {48ECEE85-ED06-42A5-8068-CBDD92BB6EF4}
165+
{F31BEEF2-37B0-4B0F-85D3-AD427C56AD72} = {CB5A0F6C-6DD3-4789-9E6F-9B9B51AE4F10}
152166
EndGlobalSection
153167
EndGlobal

windows/OpenPose/OpenPose.vcxproj

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
<Optimization>Disabled</Optimization>
5656
<SDLCheck>true</SDLCheck>
5757
<ObjectFileName>$(IntDir)\obj\obj\obj\%(RelativeDir)\%(Filename)%(Extension).obj</ObjectFileName>
58-
<PreprocessorDefinitions>OP_EXPORTS;BOOST_ALL_NO_LIB;CAFFE_VERSION=1.0.0;CMAKE_INTDIR="Release";CMAKE_WINDOWS_BUILD;GLOG_NO_ABBREVIATED_SEVERITIES;GOOGLE_GLOG_DLL_DECL=__declspec(dllimport);GOOGLE_GLOG_DLL_DECL_FOR_UNITTESTS=__declspec(dllimport);H5_BUILT_AS_DYNAMIC_LIB=1;USE_CAFFE;USE_CUDNN;USE_OPENCV;USE_LEVELDB;USE_LMDB;_CRT_SECURE_NO_WARNINGS</PreprocessorDefinitions>
58+
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;BOOST_ALL_NO_LIB;CAFFE_VERSION=1.0.0;CMAKE_WINDOWS_BUILD;GLOG_NO_ABBREVIATED_SEVERITIES;GOOGLE_GLOG_DLL_DECL=__declspec(dllimport);GOOGLE_GLOG_DLL_DECL_FOR_UNITTESTS=__declspec(dllimport);H5_BUILT_AS_DYNAMIC_LIB=1;USE_CAFFE;USE_CUDNN;USE_OPENCV;USE_LEVELDB;USE_LMDB;CMAKE_INTDIR="Debug";OP_EXPORTS</PreprocessorDefinitions>
5959
<MultiProcessorCompilation>true</MultiProcessorCompilation>
6060
</ClCompile>
6161
<CudaCompile>
@@ -75,7 +75,7 @@
7575
<IntrinsicFunctions>true</IntrinsicFunctions>
7676
<SDLCheck>true</SDLCheck>
7777
<AdditionalIncludeDirectories>..\..\include;..\..\3rdparty\windows\opencv\include;..\..\3rdparty\windows\caffe\include;..\..\3rdparty\windows\caffe\include2;..\..\3rdparty\windows\caffe3rdparty\include;..\..\3rdparty\windows\caffe3rdparty\include\boost-1_61;$(CUDA_PATH_V8_0)\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
78-
<PreprocessorDefinitions>OP_EXPORTS;BOOST_ALL_NO_LIB;CAFFE_VERSION=1.0.0;CMAKE_INTDIR="Release";CMAKE_WINDOWS_BUILD;GLOG_NO_ABBREVIATED_SEVERITIES;GOOGLE_GLOG_DLL_DECL=__declspec(dllimport);GOOGLE_GLOG_DLL_DECL_FOR_UNITTESTS=__declspec(dllimport);H5_BUILT_AS_DYNAMIC_LIB=1;USE_CAFFE;USE_CUDNN;USE_OPENCV;USE_LEVELDB;USE_LMDB;_CRT_SECURE_NO_WARNINGS</PreprocessorDefinitions>
78+
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;BOOST_ALL_NO_LIB;CAFFE_VERSION=1.0.0;CMAKE_WINDOWS_BUILD;GLOG_NO_ABBREVIATED_SEVERITIES;GOOGLE_GLOG_DLL_DECL=__declspec(dllimport);GOOGLE_GLOG_DLL_DECL_FOR_UNITTESTS=__declspec(dllimport);H5_BUILT_AS_DYNAMIC_LIB=1;USE_CAFFE;USE_CUDNN;USE_OPENCV;USE_LEVELDB;USE_LMDB;CMAKE_INTDIR="Release";NDEBUG;OP_EXPORTS</PreprocessorDefinitions>
7979
<ObjectFileName>$(IntDir)\obj\obj\obj\%(RelativeDir)\%(Filename)%(Extension).obj</ObjectFileName>
8080
<MultiProcessorCompilation>true</MultiProcessorCompilation>
8181
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
@@ -84,13 +84,14 @@
8484
<Link>
8585
<EnableCOMDATFolding>true</EnableCOMDATFolding>
8686
<OptimizeReferences>true</OptimizeReferences>
87-
<AdditionalDependencies>..\..\3rdparty\windows\caffe\lib\caffe.lib;..\..\3rdparty\windows\caffe\lib\caffeproto.lib;..\..\3rdparty\windows\caffe3rdparty\lib\boost_filesystem-vc140-mt-1_61.lib;..\..\3rdparty\windows\caffe3rdparty\lib\boost_system-vc140-mt-1_61.lib;..\..\3rdparty\windows\caffe3rdparty\lib\caffehdf5.lib;..\..\3rdparty\windows\caffe3rdparty\lib\caffehdf5_hl.lib;..\..\3rdparty\windows\caffe3rdparty\lib\caffezlib.lib;..\..\3rdparty\windows\caffe3rdparty\lib\gflags.lib;..\..\3rdparty\windows\caffe3rdparty\lib\glog.lib;..\..\3rdparty\windows\caffe3rdparty\lib\leveldb.lib;..\..\3rdparty\windows\caffe3rdparty\lib\libopenblas.dll.a;..\..\3rdparty\windows\caffe3rdparty\lib\libprotobuf.lib;..\..\3rdparty\windows\caffe3rdparty\lib\lmdb.lib;..\..\3rdparty\windows\caffe3rdparty\lib\snappy.lib;..\..\3rdparty\windows\opencv\x64\vc14\lib\opencv_world310.lib;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0\lib\x64\cublas.lib;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0\lib\x64\cublas_device.lib;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0\lib\x64\cudart.lib;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0\lib\x64\cudnn.lib;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0\lib\x64\curand.lib;ntdll.lib;shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
88-
<AdditionalLibraryDirectories>$(CUDA_PATH_V8_0)\lib\x64\;$(CudaToolkitLibDir);%(AdditionalLibraryDirectories);</AdditionalLibraryDirectories>
87+
<AdditionalDependencies>..\..\3rdparty\windows\caffe\lib\caffe.lib;..\..\3rdparty\windows\caffe\lib\caffeproto.lib;..\..\3rdparty\windows\caffe3rdparty\lib\boost_filesystem-vc140-mt-1_61.lib;..\..\3rdparty\windows\caffe3rdparty\lib\boost_system-vc140-mt-1_61.lib;..\..\3rdparty\windows\caffe3rdparty\lib\caffehdf5.lib;..\..\3rdparty\windows\caffe3rdparty\lib\caffehdf5_hl.lib;..\..\3rdparty\windows\caffe3rdparty\lib\caffezlib.lib;..\..\3rdparty\windows\caffe3rdparty\lib\gflags.lib;..\..\3rdparty\windows\caffe3rdparty\lib\glog.lib;..\..\3rdparty\windows\caffe3rdparty\lib\leveldb.lib;..\..\3rdparty\windows\caffe3rdparty\lib\libopenblas.dll.a;..\..\3rdparty\windows\caffe3rdparty\lib\libprotobuf.lib;..\..\3rdparty\windows\caffe3rdparty\lib\lmdb.lib;..\..\3rdparty\windows\caffe3rdparty\lib\snappy.lib;..\..\3rdparty\windows\opencv\x64\vc14\lib\opencv_world310.lib;cublas.lib;cublas_device.lib;cudart.lib;cudnn.lib;curand.lib;ntdll.lib;shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
88+
<AdditionalLibraryDirectories>$(CUDA_PATH_V8_0)\lib\x64\;%(AdditionalLibraryDirectories);</AdditionalLibraryDirectories>
8989
</Link>
9090
<CudaCompile>
9191
<CompileOut>$(IntDir)\obj\obj\obj\%(RelativeDir)\%(Filename)%(Extension).obj</CompileOut>
9292
<CodeGeneration>compute_30,sm_30;compute_35,sm_35;compute_50,sm_50;compute_52,sm_52;compute_61,sm_61;compute_61,compute_61</CodeGeneration>
9393
<AdditionalOptions>-gencode=arch=compute_30,code=\"sm_30,compute_30\" -gencode=arch=compute_35,code=\"sm_35,compute_35\" -gencode=arch=compute_50,code=\"sm_50,compute_50\" -gencode=arch=compute_52,code=\"sm_52,compute_52\" -gencode=arch=compute_60,code=\"sm_60,compute_60\" -gencode=arch=compute_61,code=\"sm_61,compute_61\" %(AdditionalOptions)</AdditionalOptions>
94+
<CudaRuntime>Shared</CudaRuntime>
9495
</CudaCompile>
9596
</ItemDefinitionGroup>
9697
<ItemGroup>

0 commit comments

Comments
 (0)