From 6fd758c27167e2e7583531b29bc7753e2b677d61 Mon Sep 17 00:00:00 2001 From: Gines Hidalgo Martinez Date: Mon, 17 Jul 2017 01:06:22 -0400 Subject: [PATCH] Added body 3-D reconstruction for 3 FLIR cameras in Windows --- .gitignore | 2 + doc/installation.md | 17 +- doc/openpose_3d_reconstruction_demo.md | 61 ++ include/openpose/core/macros.hpp | 6 + windows/OpenPose.sln | 14 + windows/OpenPose/OpenPose.vcxproj | 9 +- .../OpenPose3DReconstruction.vcxproj | 103 ++++ .../OpenPose3DReconstruction.vcxproj.filters | 48 ++ .../OpenPose3DReconstruction.vcxproj.user | 13 + .../include/openpose3d/cameraParameters.hpp | 48 ++ .../include/openpose3d/datum3D.hpp | 17 + .../include/openpose3d/headers.hpp | 15 + .../include/openpose3d/pointGrey.hpp | 34 ++ .../include/openpose3d/reconstruction3D.hpp | 19 + .../include/openpose3d/renderer.hpp | 25 + .../src/openpose3d.cpp | 230 ++++++++ .../src/pointGrey.cpp | 548 ++++++++++++++++++ .../src/reconstruction3D.cpp | 153 +++++ .../OpenPose3DReconstruction/src/renderer.cpp | 453 +++++++++++++++ windows/OpenPoseDemo/OpenPoseDemo.vcxproj | 6 +- .../TutorialPose/1_extract_from_image.vcxproj | 6 +- ...extract_pose_or_heatmat_from_image.vcxproj | 6 +- .../1_openpose_read_and_display.vcxproj | 6 +- .../2_user_processing_function.vcxproj | 6 +- ...3_user_input_processing_and_output.vcxproj | 6 +- ..._input_processing_output_and_datum.vcxproj | 6 +- .../1_user_asynchronous.vcxproj | 6 +- .../2_user_synchronous.vcxproj | 6 +- 28 files changed, 1835 insertions(+), 34 deletions(-) create mode 100644 doc/openpose_3d_reconstruction_demo.md create mode 100644 windows/OpenPose3DReconstruction/OpenPose3DReconstruction.vcxproj create mode 100644 windows/OpenPose3DReconstruction/OpenPose3DReconstruction.vcxproj.filters create mode 100644 windows/OpenPose3DReconstruction/OpenPose3DReconstruction.vcxproj.user create mode 100644 windows/OpenPose3DReconstruction/include/openpose3d/cameraParameters.hpp create mode 100644 windows/OpenPose3DReconstruction/include/openpose3d/datum3D.hpp create mode 100644 windows/OpenPose3DReconstruction/include/openpose3d/headers.hpp create mode 100644 windows/OpenPose3DReconstruction/include/openpose3d/pointGrey.hpp create mode 100644 windows/OpenPose3DReconstruction/include/openpose3d/reconstruction3D.hpp create mode 100644 windows/OpenPose3DReconstruction/include/openpose3d/renderer.hpp create mode 100644 windows/OpenPose3DReconstruction/src/openpose3d.cpp create mode 100644 windows/OpenPose3DReconstruction/src/pointGrey.cpp create mode 100644 windows/OpenPose3DReconstruction/src/reconstruction3D.cpp create mode 100644 windows/OpenPose3DReconstruction/src/renderer.cpp diff --git a/.gitignore b/.gitignore index fb023561..4caf7e14 100644 --- a/.gitignore +++ b/.gitignore @@ -71,6 +71,8 @@ MANIFEST-* 3rdparty/windows/caffe/ 3rdparty/windows/caffe3rdparty/ 3rdparty/windows/opencv/ +3rdparty/windows/freeglut/ +3rdparty/windows/spinnaker/ # Allowing this file (removed *.user for Qt) !*.vcxproj.user diff --git a/doc/installation.md b/doc/installation.md index 3f9b1098..37552378 100644 --- a/doc/installation.md +++ b/doc/installation.md @@ -5,9 +5,10 @@ OpenPose Library - Compilation and Installation 1. [Requirements](#requirements) 2. [Ubuntu](#ubuntu) 3. [Windows](#windows) -4. [Quick Start](#quick-start) -5. [Expected Visual Results](#expected-visual-results) -6. [FAQ](#faq) +4. [OpenPose 3D Demo](#openpose-3d-demo) +5. [Quick Start](#quick-start) +6. [Expected Visual Results](#expected-visual-results) +7. [FAQ](#faq) @@ -129,6 +130,16 @@ You just need to remove the OpenPose or portable demo folder. +## OpenPose 3D Demo +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). + +If you still wanna try our OpenPose 3-D reconstruction demo, see [doc/openpose_3d_reconstruction_demo.md](./openpose_3d_reconstruction_demo.md). + + + + + + ## Quick Start 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. diff --git a/doc/openpose_3d_reconstruction_demo.md b/doc/openpose_3d_reconstruction_demo.md new file mode 100644 index 00000000..ed3f4ac5 --- /dev/null +++ b/doc/openpose_3d_reconstruction_demo.md @@ -0,0 +1,61 @@ +# Running OpenPose 3-D Reconstruction Demo - Windows +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. + +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). + + + +### Hardware +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: + +1. Camera details: + - Blackfly S Color 1.3 MP USB3 Vision (ON Semi PYTHON 1300) + - Model: BFS-U3-13Y3C-C + - 1280x1024 resolution and 170 FPS + - https://www.ptgrey.com/blackfly-s-13-mp-color-usb3-vision-on-semi-python1300 + - 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). + - (Ubuntu-only) Open your USB ports following section `Configuring USBFS` in [http://www.ptgrey.com/KB/10685](http://www.ptgrey.com/KB/10685). + - Install the Spinnaker SDK for your operating system: [https://www.ptgrey.com/support/downloads](https://www.ptgrey.com/support/downloads). +2. Fujinon 3 MP Varifocal Lens (3.8-13mm, 3.4x Zoom) for each camera. + - 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). +3. 4-Port PCI Express (PCIe) USB 3.0 Card Adapter with 4 dedicated channels. + - 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). +4. USB 3.0 cable for each FLIR camera. + - 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). + + + +### Calibrate Cameras +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. + + + +### Windows +1. Open the OpenPose visual studio solution `windows\openpose.sln`. +2. Right-click on `Solution 'OpenPose'` of the `Solution Explorer` window, usually placed at the top-right part of the VS screen. +3. Click on `Properties`. Go to `Configuration Properties` -> `Configuration` and check `Build` for the `OpenPose3DReconstruction` project. +4. Get the last Spinnaker SKD version, i.e. the FLIR camera driver and software: + - Download last Spinnaker SDK: https://www.ptgrey.com/support/downloads + - Copy `{PointGreyParentDirectory}\Point Grey Research\Spinnaker\bin64\vs2015\` as `{OpenPoseDirectory}\3rdparty\windows\spinnaker\bin\`. You can remove all the *.exe files. + - Copy `{PointGreyParentDirectory}\Point Grey Research\Spinnaker\include\` as `{OpenPoseDirectory}\3rdparty\windows\spinnaker\include\`. + - Copy `Spinnaker_v140.lib` and `Spinnakerd_v140.lib` from `{PointGreyParentDirectory}\Point Grey Research\Spinnaker\lib64\vs2015\` into `{OpenPoseDirectory}\3rdparty\windows\spinnaker\lib\`. + - (Optional) Spinnaker SDK overview: https://www.ptgrey.com/spinnaker-sdk +5. Get the last OpenGL Glut library version for the rendering: + - Download the latest `MSVC Package` from http://www.transmissionzero.co.uk/software/freeglut-devel/ + - Copy `{freeglutParentDirectory}\freeglut\bin\x64\` as `{OpenPoseDirectory}\3rdparty\windows\freeglut\bin\bin\`. + - Copy `{freeglutParentDirectory}\freeglut\include\` as `{OpenPoseDirectory}\3rdparty\windows\freeglut\include\`. + - Copy `{freeglutParentDirectory}\freeglut\lib\x64\` as `{OpenPoseDirectory}\3rdparty\windows\freeglut\lib\`. + + + +### Ubuntu +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. + +1. `sudo apt-get install freeglut3-dev`. +2. Compile OpenPose by your own [from https://github.com/CMU-Perceptual-Computing-Lab/openpose](from https://github.com/CMU-Perceptual-Computing-Lab/openpose). +3. Perform `make distribute` on OpenPose, and copy the `include` and `lib` files in [3rdparty/openpose/](3rdparty/openpose/). +4. Copy the `include` and `lib` folders from {OpenPose path}/3rdparty/caffe/distribute/ to [3rdparty/caffe/](3rdparty/caffe/). +5. Copy your Spinnaker desired version `include` and `lib` folders on [3rdparty/spinnaker/](3rdparty/spinnaker/). +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. + 1. If using Qt, you will have to manually copy the {OpenPose path}/models folder inside the generated build folder. +7. You must copy the contents of [add_to_bin_file/](add_to_bin_file/) where the final binary file is generated. diff --git a/include/openpose/core/macros.hpp b/include/openpose/core/macros.hpp index 6410533a..f6910ea9 100644 --- a/include/openpose/core/macros.hpp +++ b/include/openpose/core/macros.hpp @@ -9,6 +9,12 @@ #define OP_API __declspec(dllimport) #endif +//Disable some Windows Warnings +#ifdef _WIN32 + #pragma warning ( disable : 4251 ) // XXX needs to have dll-interface to be used by clients of class YYY + #pragma warning( disable: 4275 ) // non dll-interface structXXX used as base +#endif + #define DATUM_BASE_NO_PTR std::vector #define DATUM_BASE std::shared_ptr #define DEFINE_TEMPLATE_DATUM(templateName) template class OP_API templateName diff --git a/windows/OpenPose.sln b/windows/OpenPose.sln index 31522569..23df3a9e 100644 --- a/windows/OpenPose.sln +++ b/windows/OpenPose.sln @@ -62,6 +62,13 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "2_extract_pose_or_heatmat_f {1848F100-6EC5-4F60-9748-062590ADFE5C} = {1848F100-6EC5-4F60-9748-062590ADFE5C} EndProjectSection EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "OpenPose 3D Reconstruction", "OpenPose 3D Reconstruction", "{CB5A0F6C-6DD3-4789-9E6F-9B9B51AE4F10}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "OpenPose3DReconstruction", "OpenPose3DReconstruction\OpenPose3DReconstruction.vcxproj", "{F31BEEF2-37B0-4B0F-85D3-AD427C56AD72}" + ProjectSection(ProjectDependencies) = postProject + {1848F100-6EC5-4F60-9748-062590ADFE5C} = {1848F100-6EC5-4F60-9748-062590ADFE5C} + EndProjectSection +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|x64 = Debug|x64 @@ -130,6 +137,11 @@ Global {D1E5B5FC-A447-4BCC-8024-C6B6B8061A7D}.Release|x64.ActiveCfg = Release|x64 {D1E5B5FC-A447-4BCC-8024-C6B6B8061A7D}.Release|x64.Build.0 = Release|x64 {D1E5B5FC-A447-4BCC-8024-C6B6B8061A7D}.Release|x86.ActiveCfg = Release|x64 + {F31BEEF2-37B0-4B0F-85D3-AD427C56AD72}.Debug|x64.ActiveCfg = Debug|x64 + {F31BEEF2-37B0-4B0F-85D3-AD427C56AD72}.Debug|x64.Build.0 = Debug|x64 + {F31BEEF2-37B0-4B0F-85D3-AD427C56AD72}.Debug|x86.ActiveCfg = Debug|x64 + {F31BEEF2-37B0-4B0F-85D3-AD427C56AD72}.Release|x64.ActiveCfg = Release|x64 + {F31BEEF2-37B0-4B0F-85D3-AD427C56AD72}.Release|x86.ActiveCfg = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -149,5 +161,7 @@ Global {4A271F39-C60B-4827-9A64-E0EEDD15D082} = {8F1B1B9F-0117-48CD-B9F6-06E1930640C3} {DA43DA92-141D-4B91-80CE-8A2C5B377683} = {40194B19-A61E-4B91-89CD-A858AC5953A6} {D1E5B5FC-A447-4BCC-8024-C6B6B8061A7D} = {40194B19-A61E-4B91-89CD-A858AC5953A6} + {CB5A0F6C-6DD3-4789-9E6F-9B9B51AE4F10} = {48ECEE85-ED06-42A5-8068-CBDD92BB6EF4} + {F31BEEF2-37B0-4B0F-85D3-AD427C56AD72} = {CB5A0F6C-6DD3-4789-9E6F-9B9B51AE4F10} EndGlobalSection EndGlobal diff --git a/windows/OpenPose/OpenPose.vcxproj b/windows/OpenPose/OpenPose.vcxproj index c963b265..ac96bcb0 100644 --- a/windows/OpenPose/OpenPose.vcxproj +++ b/windows/OpenPose/OpenPose.vcxproj @@ -55,7 +55,7 @@ Disabled true $(IntDir)\obj\obj\obj\%(RelativeDir)\%(Filename)%(Extension).obj - 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 + _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 true @@ -75,7 +75,7 @@ true true ..\..\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) - 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 + _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 $(IntDir)\obj\obj\obj\%(RelativeDir)\%(Filename)%(Extension).obj true Speed @@ -84,13 +84,14 @@ true true - ..\..\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) - $(CUDA_PATH_V8_0)\lib\x64\;$(CudaToolkitLibDir);%(AdditionalLibraryDirectories); + ..\..\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) + $(CUDA_PATH_V8_0)\lib\x64\;%(AdditionalLibraryDirectories); $(IntDir)\obj\obj\obj\%(RelativeDir)\%(Filename)%(Extension).obj compute_30,sm_30;compute_35,sm_35;compute_50,sm_50;compute_52,sm_52;compute_61,sm_61;compute_61,compute_61 -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) + Shared diff --git a/windows/OpenPose3DReconstruction/OpenPose3DReconstruction.vcxproj b/windows/OpenPose3DReconstruction/OpenPose3DReconstruction.vcxproj new file mode 100644 index 00000000..7e6789d2 --- /dev/null +++ b/windows/OpenPose3DReconstruction/OpenPose3DReconstruction.vcxproj @@ -0,0 +1,103 @@ + + + + + Debug + x64 + + + Release + x64 + + + + + + + + + + + + + + + + + + {F31BEEF2-37B0-4B0F-85D3-AD427C56AD72} + OpenPose3DReconstruction + 8.1 + + + + Application + true + v140 + MultiByte + + + Application + false + v140 + true + MultiByte + + + + + + + + + + + + + + + $(VC_LibraryPath_x64);$(WindowsSDK_LibraryPath_x64);$(NETFXKitsDir)Lib\um\x64 + $(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(FxCopDir);$(PATH); + $(VC_ReferencesPath_x64); + $(ProjectName)\$(Platform)\$(Configuration)\ + false + + + $(VC_LibraryPath_x64);$(WindowsSDK_LibraryPath_x64);$(NETFXKitsDir)Lib\um\x64 + $(ProjectName)\$(Platform)\$(Configuration)\ + + + + EnableAllWarnings + Disabled + true + true + _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" + $(IntDir)\obj\relDir\relDir\%(RelativeDir)\%(Filename)%(Extension).obj + + + + + Level4 + Full + true + true + true + ..\..\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;include;..\..\3rdparty\windows\freeglut\include;..\..\3rdparty\windows\spinnaker\include;%(AdditionalIncludeDirectories) + _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 + $(IntDir)\obj\relDir\relDir\%(RelativeDir)\%(Filename)%(Extension).obj + true + Speed + OldStyle + + + true + true + $(CUDA_PATH_V8_0)\lib\x64\; + ..\..\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;..\x64\Release\OpenPose.lib;..\..\3rdparty\windows\freeglut\lib\freeglut.lib;..\..\3rdparty\windows\spinnaker\lib\Spinnaker_$(PlatformToolset).lib;%(AdditionalDependencies) + + + + + + \ No newline at end of file diff --git a/windows/OpenPose3DReconstruction/OpenPose3DReconstruction.vcxproj.filters b/windows/OpenPose3DReconstruction/OpenPose3DReconstruction.vcxproj.filters new file mode 100644 index 00000000..61108a96 --- /dev/null +++ b/windows/OpenPose3DReconstruction/OpenPose3DReconstruction.vcxproj.filters @@ -0,0 +1,48 @@ + + + + + {71c68da4-5188-4106-a82d-b220b4ede682} + + + {52199589-120f-4517-bd6f-64c2857a0e29} + + + {af413d97-7c26-410a-ad92-33f3904f4cde} + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + + + Header Files\openpose3d + + + Header Files\openpose3d + + + Header Files\openpose3d + + + Header Files\openpose3d + + + Header Files\openpose3d + + + Header Files\openpose3d + + + \ No newline at end of file diff --git a/windows/OpenPose3DReconstruction/OpenPose3DReconstruction.vcxproj.user b/windows/OpenPose3DReconstruction/OpenPose3DReconstruction.vcxproj.user new file mode 100644 index 00000000..9eb6dc9a --- /dev/null +++ b/windows/OpenPose3DReconstruction/OpenPose3DReconstruction.vcxproj.user @@ -0,0 +1,13 @@ + + + + PATH=%PATH%;3rdparty\windows\caffe\bin\;3rdparty\windows\opencv\x64\vc14\bin;3rdparty\windows\freeglut\bin;3rdparty\windows\spinnaker\bin + WindowsLocalDebugger + ..\.. + + + ..\.. + WindowsLocalDebugger + PATH=%PATH%;3rdparty\windows\caffe\bin\;3rdparty\windows\opencv\x64\vc14\bin;3rdparty\windows\freeglut\bin;3rdparty\windows\spinnaker\bin + + \ No newline at end of file diff --git a/windows/OpenPose3DReconstruction/include/openpose3d/cameraParameters.hpp b/windows/OpenPose3DReconstruction/include/openpose3d/cameraParameters.hpp new file mode 100644 index 00000000..80601311 --- /dev/null +++ b/windows/OpenPose3DReconstruction/include/openpose3d/cameraParameters.hpp @@ -0,0 +1,48 @@ +#ifndef OPENPOSE3D_CAMERA_PARAMETERS_HPP +#define OPENPOSE3D_CAMERA_PARAMETERS_HPP + +#include + +// User configurable code +// Intrinsic and distortion parameters +// Camera 1 parameters +const cv::Mat INTRINSIC_1 = (cv::Mat_(3, 3) << 817.93481631740565, 0, 600.70689997785121, + 0, 816.51774059837908, 517.84529566329593, + 0, 0, 1); +const cv::Mat DISTORTION_1 = (cv::Mat_(8, 1) << + -1.8102158829399091, 9.1966147162623262, -0.00044293900343777355, 0.0013638377686816653, 1.3303863414979364, -1.418905163635487, 8.4725535468475819, 4.7911023525901033); +const cv::Mat INTRINSIC_2 = (cv::Mat_(3, 3) << 816.20921132436638, 0, 612.67087968681585, + 0, 816.18292222910486, 530.47901782670431, + 0, 0, 1); +// Camera 2 parameters +const cv::Mat DISTORTION_2 = (cv::Mat_(8, 1) << + -5.1088507540294881, 133.63995617304997, -0.0010048069080912836, 0.00018825291386406282, 20.688286893903879, -4.7604289550474768, 132.42412342224557, 70.01195364029752); +const cv::Mat INTRINSIC_3 = (cv::Mat_(3, 3) << 798.42980806905666, 0, 646.48130011561727, + 0, 798.46535448393979, 523.91590563194586, + 0, 0, 1); +// Camera 3 +const cv::Mat DISTORTION_3 = (cv::Mat_(8, 1) << + -0.57530495294002304, -0.54721992620722582, -0.00037614702677289967, -0.00081995658363481598, -0.020321660897680775, -0.18040544059116842, -0.87724444571603022, -0.13136636671099691); + +// Extrinsic parameters - rotation and pose orientation between cameras +// From camera 1 to 2 +const cv::Mat M_1_2 = (cv::Mat_(3, 4) << 0.999962504862692, -0.00165862051503619, 0.00849928507093793, -238.301309354482, + 0.00176155163779584, 0.999925029704659, -0.0121174215889211, 4.75863886121558, + -0.00847854967298925, 0.0121319391740716, 0.999890459124058, 15.9219925821916); +// From camera 1 to 3 +const cv::Mat M_1_3 = (cv::Mat_(3, 4) << 0.995809442124071, -0.000473104796892308, 0.0914512501193800, -461.301274485705, + 0.00165046455210419, 0.999916727562850, -0.0127989806923977, 6.22648121362088, + -0.0914375794917412, 0.0128962828696210, 0.995727299487585, 63.4911132860733); +// From camera 2 to 3 +const cv::Mat M_2_3 = (cv::Mat_(3, 4) << 0.999644115423621, -0.00194501088674130, -0.0266056278177532, -235.236375502202, + 0.00201646110733780, 0.999994431880356, 0.00265896462686206, 9.52238656728889, + 0.0266003079592876, -0.00271166755609303, 0.999642471324391, -4.23534963077479); + + + +// Do not modify this code +const std::vector INTRINSICS{ INTRINSIC_1, INTRINSIC_2, INTRINSIC_3 }; +const std::vector DISTORTIONS{ DISTORTION_1, DISTORTION_2, DISTORTION_3 }; +const std::vector M_EACH_CAMERA{ INTRINSIC_1 * cv::Mat::eye(3,4, CV_64F), INTRINSIC_2 * M_1_2, INTRINSIC_3 * M_1_3 }; + +#endif // OPENPOSE3D_CAMERA_PARAMETERS_HPP diff --git a/windows/OpenPose3DReconstruction/include/openpose3d/datum3D.hpp b/windows/OpenPose3DReconstruction/include/openpose3d/datum3D.hpp new file mode 100644 index 00000000..e389b44d --- /dev/null +++ b/windows/OpenPose3DReconstruction/include/openpose3d/datum3D.hpp @@ -0,0 +1,17 @@ +#ifndef OPENPOSE3D_DATUM_3D_HPP +#define OPENPOSE3D_DATUM_3D_HPP + +#include +#include + +// Following OpenPose `tutorial_wrapper/` examples, we create our own class inherited from Datum +// See `examples/tutorial_wrapper/` for more details +struct Datum3D : public op::Datum +{ + op::Array poseKeypoints3D; + op::Array faceKeypoints3D; + op::Array leftHandKeypoints3D; + op::Array rightHandKeypoints3D; +}; + +#endif // OPENPOSE3D_DATUM_3D_HPP diff --git a/windows/OpenPose3DReconstruction/include/openpose3d/headers.hpp b/windows/OpenPose3DReconstruction/include/openpose3d/headers.hpp new file mode 100644 index 00000000..e201ef9f --- /dev/null +++ b/windows/OpenPose3DReconstruction/include/openpose3d/headers.hpp @@ -0,0 +1,15 @@ +#ifndef OPENPOSE3D_HEADERS_HPP +#define OPENPOSE3D_HEADERS_HPP + +// Camera intrinsic and extrinsic parameters +#include +// Datum3D +#include +// PointGrey cameras +#include +// 3D reconstruction +#include +// OpenGL Renderer +#include + +#endif // OPENPOSE3D_HEADERS_HPP diff --git a/windows/OpenPose3DReconstruction/include/openpose3d/pointGrey.hpp b/windows/OpenPose3DReconstruction/include/openpose3d/pointGrey.hpp new file mode 100644 index 00000000..7b947b0c --- /dev/null +++ b/windows/OpenPose3DReconstruction/include/openpose3d/pointGrey.hpp @@ -0,0 +1,34 @@ +#ifndef OPENPOSE3D_POINT_GREY_HPP +#define OPENPOSE3D_POINT_GREY_HPP + +#include +#include +#include + +// Following OpenPose `tutorial_wrapper/` examples, we create our own class inherited from WorkerProducer. +// This worker: + // 1. Set hardware trigger and the buffer to get the latest obtained frame. + // 2. Read images from FLIR cameras. + // 3. Turn them into std::vector. + // 4. Return the resulting images wrapped into a std::shared_ptr>. +// The HW trigger + reading FLIR camera code is highly based on the Spinnaker SDK examples `AcquisitionMultipleCamera` and specially `Trigger` +// (located in `src/`). See them for more details about the cameras. +// See `examples/tutorial_wrapper/` for more details about inhering the WorkerProducer class. +class WPointGrey : public op::WorkerProducer>> +{ +public: + WPointGrey(); + + ~WPointGrey(); + + void initializationOnThread(); + + std::shared_ptr> workProducer(); + +private: + bool initialized; + Spinnaker::CameraList mCameraList; + Spinnaker::SystemPtr mSystemPtr; +}; + +#endif // OPENPOSE3D_POINT_GREY_HPP diff --git a/windows/OpenPose3DReconstruction/include/openpose3d/reconstruction3D.hpp b/windows/OpenPose3DReconstruction/include/openpose3d/reconstruction3D.hpp new file mode 100644 index 00000000..c3a4380b --- /dev/null +++ b/windows/OpenPose3DReconstruction/include/openpose3d/reconstruction3D.hpp @@ -0,0 +1,19 @@ +#ifndef RECONSTRUCTION_3D_HPP +#define RECONSTRUCTION_3D_HPP + +#include + +// Following OpenPose `tutorial_wrapper/` examples, we create our own class inherited from Worker. +// This worker will do 3-D reconstruction +// We apply the simple Direct linear transformation (DLT) algorithm, asumming each keypoint (e.g. right hip) is seen by all the cameras. +// No non-linear minimization used, and if some camera misses the point, it is not reconstructed. +// See `examples/tutorial_wrapper/` for more details about inhering the Worker class and using it for post-processing purposes. +class WReconstruction3D : public op::Worker>> +{ +public: + void initializationOnThread() {} + + void work(std::shared_ptr>& datumsPtr); +}; + +#endif // RECONSTRUCTION_3D_HPP diff --git a/windows/OpenPose3DReconstruction/include/openpose3d/renderer.hpp b/windows/OpenPose3DReconstruction/include/openpose3d/renderer.hpp new file mode 100644 index 00000000..1ce10851 --- /dev/null +++ b/windows/OpenPose3DReconstruction/include/openpose3d/renderer.hpp @@ -0,0 +1,25 @@ +#ifndef OPENPOSE3D_RENDERER_HPP +#define OPENPOSE3D_RENDERER_HPP + +#include +#include +#include +#include + +// This worker will do 3-D rendering +class WRender3D : public op::WorkerConsumer>> +{ +public: + WRender3D(); + + void initializationOnThread() {} + + void workConsumer(const std::shared_ptr>& datumsPtr); + +private: + std::thread mRenderThread; + + void visualizationThread(); +}; + +#endif // OPENPOSE3D_RENDERER_HPP diff --git a/windows/OpenPose3DReconstruction/src/openpose3d.cpp b/windows/OpenPose3DReconstruction/src/openpose3d.cpp new file mode 100644 index 00000000..d7098084 --- /dev/null +++ b/windows/OpenPose3DReconstruction/src/openpose3d.cpp @@ -0,0 +1,230 @@ +// ------------------------- OpenPose Library Tutorial - Thread - Example 2 - Synchronous ------------------------- +// Synchronous mode: ideal for performance. The user can add his own frames producer / post-processor / consumer to the OpenPose wrapper or use the default ones. + +// This example shows the user how to use the OpenPose wrapper class: + // 1. Extract and render keypoint / heatmap / PAF of that image + // 2. Save the results on disc + // 3. Display the rendered pose + // Everything in a multi-thread scenario +// In addition to the previous OpenPose modules, we also need to use: + // 1. `core` module: + // For the Array class that the `pose` module needs + // For the Datum struct that the `thread` module sends between the queues + // 2. `utilities` module: for the error & logging functions, i.e. op::error & op::log respectively +// This file should only be used for the user to take specific examples. + +// C++ std library dependencies +#include // `std::chrono::` functions and classes, e.g. std::chrono::milliseconds +#include +#include // std::this_thread +#include +// Other 3rdparty dependencies +#include // DEFINE_bool, DEFINE_int32, DEFINE_int64, DEFINE_uint64, DEFINE_double, DEFINE_string +#include // google::InitGoogleLogging + +// OpenPose dependencies +#include +#include + +// See all the available parameter options withe the `--help` flag. E.g. `./build/examples/openpose/openpose.bin --help`. +// Note: This command will show you flags for other unnecessary 3rdparty files. Check only the flags for the OpenPose +// executable. E.g. for `openpose.bin`, look for `Flags from examples/openpose/openpose.cpp:`. +// Debugging +DEFINE_int32(logging_level, 3, "The logging level. Integer in the range [0, 255]. 0 will output any log() message, while" + " 255 will not output any. Current OpenPose library messages are in the range 0-4: 1 for" + " low priority messages and 4 for important ones."); +// OpenPose +DEFINE_string(model_folder, "models/", "Folder path (absolute or relative) where the models (pose, face, ...) are located."); +DEFINE_string(resolution, "1280x720", "The image resolution (display and output). Use \"-1x-1\" to force the program to use the" + " default images resolution."); +DEFINE_int32(num_gpu, -1, "The number of GPU devices to use. If negative, it will use all the available GPUs in your" + " machine."); +DEFINE_int32(num_gpu_start, 0, "GPU device start number."); +DEFINE_int32(keypoint_scale, 0, "Scaling of the (x,y) coordinates of the final pose data array, i.e. the scale of the (x,y)" + " coordinates that will be saved with the `write_keypoint` & `write_keypoint_json` flags." + " Select `0` to scale it to the original source resolution, `1`to scale it to the net output" + " size (set with `net_resolution`), `2` to scale it to the final output size (set with" + " `resolution`), `3` to scale it in the range [0,1], and 4 for range [-1,1]. Non related" + " with `scale_number` and `scale_gap`."); +// OpenPose Body Pose +DEFINE_string(model_pose, "COCO", "Model to be used (e.g. COCO, MPI, MPI_4_layers)."); +DEFINE_string(net_resolution, "656x368", "Multiples of 16. If it is increased, the accuracy usually increases. If it is decreased," + " the speed increases."); +DEFINE_int32(scale_number, 1, "Number of scales to average."); +DEFINE_double(scale_gap, 0.3, "Scale gap between scales. No effect unless scale_number > 1. Initial scale is always 1." + " If you want to change the initial scale, you actually want to multiply the" + " `net_resolution` by your desired initial scale."); +DEFINE_bool(heatmaps_add_parts, false, "If true, it will add the body part heatmaps to the final op::Datum::poseHeatMaps array" + " (program speed will decrease). Not required for our library, enable it only if you intend" + " to process this information later. If more than one `add_heatmaps_X` flag is enabled, it" + " will place then in sequential memory order: body parts + bkg + PAFs. It will follow the" + " order on POSE_BODY_PART_MAPPING in `include/openpose/pose/poseParameters.hpp`."); +DEFINE_bool(heatmaps_add_bkg, false, "Same functionality as `add_heatmaps_parts`, but adding the heatmap corresponding to" + " background."); +DEFINE_bool(heatmaps_add_PAFs, false, "Same functionality as `add_heatmaps_parts`, but adding the PAFs."); +DEFINE_int32(heatmaps_scale, 2, "Set 0 to scale op::Datum::poseHeatMaps in the range [0,1], 1 for [-1,1]; and 2 for integer" + " rounded [0,255]."); +// OpenPose Face +DEFINE_bool(face, true, "Enables face keypoint detection. It will share some parameters from the body pose, e.g." + " `model_folder`."); +DEFINE_string(face_net_resolution, "368x368", "Multiples of 16. Analogous to `net_resolution` but applied to the face keypoint detector." + " 320x320 usually works fine while giving a substantial speed up when multiple faces on the" + " image."); +// OpenPose Hand +DEFINE_bool(hand, true, "Enables hand keypoint detection. It will share some parameters from the body pose, e.g." + " `model_folder`."); +DEFINE_string(hand_net_resolution, "368x368", "Multiples of 16. Analogous to `net_resolution` but applied to the hand keypoint detector."); +DEFINE_int32(hand_scale_number, 1, "Analogous to `scale_number` but applied to the hand keypoint detector. Our best results" + " were found with `hand_scale_number` = 6 and `hand_scale_range` = 0.4"); +DEFINE_double(hand_scale_range, 0.4, "Analogous purpose than `scale_gap` but applied to the hand keypoint detector. Total range" + " between smallest and biggest scale. The scales will be centered in ratio 1. E.g. if" + " scaleRange = 0.4 and scalesNumber = 2, then there will be 2 scales, 0.8 and 1.2."); + +DEFINE_bool(hand_tracking, false, "Adding hand tracking might improve hand keypoints detection for webcam (if the frame rate" + " is high enough, i.e. >7 FPS per GPU) and video. This is not person ID tracking, it" + " simply looks for hands in positions at which hands were located in previous frames, but" + " it does not guarantee the same person ID among frames"); +// OpenPose Rendering +DEFINE_int32(part_to_show, 0, "Part to show from the start."); +DEFINE_bool(disable_blending, false, "If blending is enabled, it will merge the results with the original frame. If disabled, it" + " will only display the results."); +// OpenPose Rendering Pose +DEFINE_double(render_threshold, 0.05, "Only estimated keypoints whose score confidences are higher than this threshold will be" + " rendered. Generally, a high threshold (> 0.5) will only render very clear body parts;" + " while small thresholds (~0.1) will also output guessed and occluded keypoints, but also" + " more false positives (i.e. wrong detections)."); +DEFINE_int32(render_pose, 1, "Set to 0 for no rendering, 1 for CPU rendering (slightly faster), and 2 for GPU rendering" + " (slower but greater functionality, e.g. `alpha_X` flags). If rendering is enabled, it will" + " render both `outputData` and `cvOutputData` with the original image and desired body part" + " to be shown (i.e. keypoints, heat maps or PAFs)."); +DEFINE_double(alpha_pose, 0.6, "Blending factor (range 0-1) for the body part rendering. 1 will show it completely, 0 will" + " hide it. Only valid for GPU rendering."); +DEFINE_double(alpha_heatmap, 0.7, "Blending factor (range 0-1) between heatmap and original frame. 1 will only show the" + " heatmap, 0 will only show the frame. Only valid for GPU rendering."); +// OpenPose Rendering Face +DEFINE_double(face_render_threshold, 0.4, "Analogous to `render_threshold`, but applied to the face keypoints."); +DEFINE_int32(face_render, -1, "Analogous to `render_pose` but applied to the face. Extra option: -1 to use the same" + " configuration that `render_pose` is using."); +DEFINE_double(face_alpha_pose, 0.6, "Analogous to `alpha_pose` but applied to face."); +DEFINE_double(face_alpha_heatmap, 0.7, "Analogous to `alpha_heatmap` but applied to face."); +// OpenPose Rendering Hand +DEFINE_double(hand_render_threshold, 0.2, "Analogous to `render_threshold`, but applied to the hand keypoints."); +DEFINE_int32(hand_render, -1, "Analogous to `render_pose` but applied to the hand. Extra option: -1 to use the same" + " configuration that `render_pose` is using."); +DEFINE_double(hand_alpha_pose, 0.6, "Analogous to `alpha_pose` but applied to hand."); +DEFINE_double(hand_alpha_heatmap, 0.7, "Analogous to `alpha_heatmap` but applied to hand."); +// Result Saving +DEFINE_string(write_images, "", "Directory to write rendered frames in `write_images_format` image format."); +DEFINE_string(write_images_format, "png", "File extension and format for `write_images`, e.g. png, jpg or bmp. Check the OpenCV" + " function cv::imwrite for all compatible extensions."); +DEFINE_string(write_video, "", "Full file path to write rendered frames in motion JPEG video format. It might fail if the" + " final path does not finish in `.avi`. It internally uses cv::VideoWriter."); +DEFINE_string(write_keypoint, "", "Directory to write the people body pose keypoint data. Set format with `write_keypoint_format`."); +DEFINE_string(write_keypoint_format, "yml", "File extension and format for `write_keypoint`: json, xml, yaml & yml. Json not available" + " for OpenCV < 3.0, use `write_keypoint_json` instead."); +DEFINE_string(write_keypoint_json, "", "Directory to write people pose data in *.json format, compatible with any OpenCV version."); +DEFINE_string(write_coco_json, "", "Full file path to write people pose data with *.json COCO validation format."); +DEFINE_string(write_heatmaps, "", "Directory to write heatmaps in *.png format. At least 1 `add_heatmaps_X` flag must be" + " enabled."); +DEFINE_string(write_heatmaps_format, "png", "File extension and format for `write_heatmaps`, analogous to `write_images_format`." + " Recommended `png` or any compressed and lossless format."); + +int openpose3d() +{ + // logging_level + op::check(0 <= FLAGS_logging_level && FLAGS_logging_level <= 255, "Wrong logging_level value.", __LINE__, __FUNCTION__, __FILE__); + op::ConfigureLog::setPriorityThreshold((op::Priority)FLAGS_logging_level); + // op::ConfigureLog::setPriorityThreshold(op::Priority::None); // To print all logging messages + + op::log("Starting pose estimation demo.", op::Priority::High); + const auto timerBegin = std::chrono::high_resolution_clock::now(); + + // Applying user defined configuration - Google flags to program variables + // outputSize + const auto outputSize = op::flagsToPoint(FLAGS_resolution, "1280x720"); + // netInputSize + const auto netInputSize = op::flagsToPoint(FLAGS_net_resolution, "656x368"); + // faceNetInputSize + const auto faceNetInputSize = op::flagsToPoint(FLAGS_face_net_resolution, "368x368 (multiples of 16)"); + // handNetInputSize + const auto handNetInputSize = op::flagsToPoint(FLAGS_hand_net_resolution, "368x368 (multiples of 16)"); + // poseModel + const auto poseModel = op::flagsToPoseModel(FLAGS_model_pose); + // keypointScale + const auto keypointScale = op::flagsToScaleMode(FLAGS_keypoint_scale); + // heatmaps to add + const auto heatMapTypes = op::flagsToHeatMaps(FLAGS_heatmaps_add_parts, FLAGS_heatmaps_add_bkg, FLAGS_heatmaps_add_PAFs); + op::check(FLAGS_heatmaps_scale >= 0 && FLAGS_heatmaps_scale <= 2, "Non valid `heatmaps_scale`.", __LINE__, __FUNCTION__, __FILE__); + const auto heatMapScale = (FLAGS_heatmaps_scale == 0 ? op::ScaleMode::PlusMinusOne + : (FLAGS_heatmaps_scale == 1 ? op::ScaleMode::ZeroToOne : op::ScaleMode::UnsignedChar )); + op::log("", op::Priority::Low, __LINE__, __FUNCTION__, __FILE__); + + // Initializing the user custom classes + // Frames producer (e.g. video, webcam, ...) + auto wPointGrey = std::make_shared(); + // Processing + auto wReconstruction3D = std::make_shared(); + // GUI (Display) + auto wRender3D = std::make_shared(); + + op::Wrapper> opWrapper; + // Add custom input + const auto workerInputOnNewThread = true; + opWrapper.setWorkerInput(wPointGrey, workerInputOnNewThread); + // Add custom processing + const auto workerProcessingOnNewThread = true; + opWrapper.setWorkerPostProcessing(wReconstruction3D, workerProcessingOnNewThread); + // Add custom output + const auto workerOutputOnNewThread = true; + opWrapper.setWorkerOutput(wRender3D, workerOutputOnNewThread); + // Configure OpenPose + const op::WrapperStructPose wrapperStructPose{netInputSize, outputSize, keypointScale, FLAGS_num_gpu, + FLAGS_num_gpu_start, FLAGS_scale_number, (float)FLAGS_scale_gap, + op::flagsToRenderMode(FLAGS_render_pose), poseModel, + !FLAGS_disable_blending, (float)FLAGS_alpha_pose, + (float)FLAGS_alpha_heatmap, FLAGS_part_to_show, FLAGS_model_folder, + heatMapTypes, heatMapScale, (float)FLAGS_render_threshold}; + // Face configuration (use op::WrapperStructFace{} to disable it) + const op::WrapperStructFace wrapperStructFace{FLAGS_face, faceNetInputSize, op::flagsToRenderMode(FLAGS_face_render, FLAGS_render_pose), + (float)FLAGS_face_alpha_pose, (float)FLAGS_face_alpha_heatmap, (float)FLAGS_face_render_threshold}; + // Hand configuration (use op::WrapperStructHand{} to disable it) + const op::WrapperStructHand wrapperStructHand{FLAGS_hand, handNetInputSize, FLAGS_hand_scale_number, (float)FLAGS_hand_scale_range, + FLAGS_hand_tracking, op::flagsToRenderMode(FLAGS_hand_render, FLAGS_render_pose), + (float)FLAGS_hand_alpha_pose, (float)FLAGS_hand_alpha_heatmap, (float)FLAGS_hand_render_threshold}; + // Consumer (comment or use default argument to disable any output) + const bool displayGui = false; + const bool guiVerbose = true; + const bool fullScreen = false; + const op::WrapperStructOutput wrapperStructOutput{displayGui, guiVerbose, fullScreen, FLAGS_write_keypoint, + op::stringToDataFormat(FLAGS_write_keypoint_format), FLAGS_write_keypoint_json, + FLAGS_write_coco_json, FLAGS_write_images, FLAGS_write_images_format, FLAGS_write_video, + FLAGS_write_heatmaps, FLAGS_write_heatmaps_format}; + // Configure wrapper + opWrapper.configure(wrapperStructPose, wrapperStructFace, wrapperStructHand, op::WrapperStructInput{}, wrapperStructOutput); + // Set to single-thread running (e.g. for debugging purposes) + // opWrapper.disableMultiThreading(); + + op::log("Starting thread(s)", op::Priority::Max); + // Start, run & stop threads + opWrapper.exec(); // It blocks this thread until all threads have finished + + // Measuring total time + const auto now = std::chrono::high_resolution_clock::now(); + const auto totalTimeSec = (double)std::chrono::duration_cast(now-timerBegin).count() * 1e-9; + const auto message = "Real-time pose estimation demo successfully finished. Total time: " + std::to_string(totalTimeSec) + " seconds."; + op::log(message, op::Priority::High); + + return 0; +} + +int main(int argc, char *argv[]) +{ + // Initializing google logging (Caffe uses it for logging) + google::InitGoogleLogging("openpose3d"); + + // Parsing command line flags + gflags::ParseCommandLineFlags(&argc, &argv, true); + + // Running openpose3d + return openpose3d(); +} diff --git a/windows/OpenPose3DReconstruction/src/pointGrey.cpp b/windows/OpenPose3DReconstruction/src/pointGrey.cpp new file mode 100644 index 00000000..89919e3e --- /dev/null +++ b/windows/OpenPose3DReconstruction/src/pointGrey.cpp @@ -0,0 +1,548 @@ +#include +#include +#include +#include +#include +#include + +/* + * This function converts between Spinnaker::ImagePtr container to cv::Mat container used in OpenCV. +*/ +cv::Mat pointGreyToCvMat(const Spinnaker::ImagePtr &imagePtr) +{ + try + { + const auto XPadding = imagePtr->GetXPadding(); + const auto YPadding = imagePtr->GetYPadding(); + const auto rowsize = imagePtr->GetWidth(); + const auto colsize = imagePtr->GetHeight(); + + // image data contains padding. When allocating cv::Mat container size, you need to account for the X,Y image data padding. + return cv::Mat{(int)(colsize + YPadding), (int)(rowsize + XPadding), CV_8UC3, imagePtr->GetData(), imagePtr->GetStride()}; + } + catch (const std::exception& e) + { + op::error(e.what(), __LINE__, __FUNCTION__, __FILE__); + return cv::Mat{}; + } +} + +// This function configures the camera to use a trigger. First, trigger mode is +// set to off in order to select the trigger source. Once the trigger source +// has been selected, trigger mode is then enabled, which has the camera +// capture only a single image upon the execution of the chosen trigger. +int configureTrigger(Spinnaker::GenApi::INodeMap &iNodeMap) +{ + try + { + int result = 0; + op::log("*** CONFIGURING TRIGGER ***", op::Priority::High); + op::log("Configuring hardware trigger...", op::Priority::High); + // Ensure trigger mode off + // *** NOTES *** + // The trigger must be disabled in order to configure whether the source + // is software or hardware. + Spinnaker::GenApi::CEnumerationPtr ptrTriggerMode = iNodeMap.GetNode("TriggerMode"); + if (!Spinnaker::GenApi::IsAvailable(ptrTriggerMode) || !Spinnaker::GenApi::IsReadable(ptrTriggerMode)) + op::error("Unable to disable trigger mode (node retrieval). Aborting...", __LINE__, __FUNCTION__, __FILE__); + + Spinnaker::GenApi::CEnumEntryPtr ptrTriggerModeOff = ptrTriggerMode->GetEntryByName("Off"); + if (!Spinnaker::GenApi::IsAvailable(ptrTriggerModeOff) || !Spinnaker::GenApi::IsReadable(ptrTriggerModeOff)) + op::error("Unable to disable trigger mode (enum entry retrieval). Aborting...", __LINE__, __FUNCTION__, __FILE__); + + ptrTriggerMode->SetIntValue(ptrTriggerModeOff->GetValue()); + + op::log("Trigger mode disabled...", op::Priority::High); + + // Select trigger source + // *** NOTES *** + // The trigger source must be set to hardware or software while trigger + // mode is off. + Spinnaker::GenApi::CEnumerationPtr ptrTriggerSource = iNodeMap.GetNode("TriggerSource"); + if (!Spinnaker::GenApi::IsAvailable(ptrTriggerSource) || !Spinnaker::GenApi::IsWritable(ptrTriggerSource)) + op::error("Unable to set trigger mode (node retrieval). Aborting...", __LINE__, __FUNCTION__, __FILE__); + + // Set trigger mode to hardware ('Line0') + Spinnaker::GenApi::CEnumEntryPtr ptrTriggerSourceHardware = ptrTriggerSource->GetEntryByName("Line0"); + if (!Spinnaker::GenApi::IsAvailable(ptrTriggerSourceHardware) || !Spinnaker::GenApi::IsReadable(ptrTriggerSourceHardware)) + op::error("Unable to set trigger mode (enum entry retrieval). Aborting...", __LINE__, __FUNCTION__, __FILE__); + + ptrTriggerSource->SetIntValue(ptrTriggerSourceHardware->GetValue()); + + op::log("Trigger source set to hardware...", op::Priority::High); + + // Turn trigger mode on + // *** LATER *** + // Once the appropriate trigger source has been set, turn trigger mode + // on in order to retrieve images using the trigger. + Spinnaker::GenApi::CEnumEntryPtr ptrTriggerModeOn = ptrTriggerMode->GetEntryByName("On"); + if (!Spinnaker::GenApi::IsAvailable(ptrTriggerModeOn) || !Spinnaker::GenApi::IsReadable(ptrTriggerModeOn)) + { + op::error("Unable to enable trigger mode (enum entry retrieval). Aborting...", __LINE__, __FUNCTION__, __FILE__); + return -1; + } + + ptrTriggerMode->SetIntValue(ptrTriggerModeOn->GetValue()); + + op::log("Trigger mode turned back on...", op::Priority::High); + + return result; + } + catch (const Spinnaker::Exception& e) + { + op::error(e.what(), __LINE__, __FUNCTION__, __FILE__); + return -1; + } + catch (const std::exception& e) + { + op::error(e.what(), __LINE__, __FUNCTION__, __FILE__); + return -1; + } +} + +// This function returns the camera to a normal state by turning off trigger +// mode. +int resetTrigger(Spinnaker::GenApi::INodeMap &iNodeMap) +{ + try + { + int result = 0; + // + // Turn trigger mode back off + // + // *** NOTES *** + // Once all images have been captured, turn trigger mode back off to + // restore the camera to a clean state. + // + Spinnaker::GenApi::CEnumerationPtr ptrTriggerMode = iNodeMap.GetNode("TriggerMode"); + if (!Spinnaker::GenApi::IsAvailable(ptrTriggerMode) || !Spinnaker::GenApi::IsReadable(ptrTriggerMode)) + op::error("Unable to disable trigger mode (node retrieval). Non-fatal error...", __LINE__, __FUNCTION__, __FILE__); + + Spinnaker::GenApi::CEnumEntryPtr ptrTriggerModeOff = ptrTriggerMode->GetEntryByName("Off"); + if (!Spinnaker::GenApi::IsAvailable(ptrTriggerModeOff) || !Spinnaker::GenApi::IsReadable(ptrTriggerModeOff)) + op::error("Unable to disable trigger mode (enum entry retrieval). Non-fatal error...", __LINE__, __FUNCTION__, __FILE__); + + ptrTriggerMode->SetIntValue(ptrTriggerModeOff->GetValue()); + + // op::log("Trigger mode disabled...", op::Priority::High); + + return result; + } + catch (Spinnaker::Exception &e) + { + op::error(e.what(), __LINE__, __FUNCTION__, __FILE__); + return -1; + } + catch (const std::exception& e) + { + op::error(e.what(), __LINE__, __FUNCTION__, __FILE__); + return -1; + } +} + +// This function acquires and displays images from each device. +std::vector acquireImages(Spinnaker::CameraList &cameraList) +{ + try + { + std::vector cvMats; + + // Retrieve, convert, and return an image for each camera + // In order to work with simultaneous camera streams, nested loops are + // needed. It is important that the inner loop be the one iterating + // through the cameras; otherwise, all images will be grabbed from a + // single camera before grabbing any images from another. + + // Get cameras + std::vector cameraPtrs(cameraList.GetSize()); + for (auto i = 0u; i < cameraPtrs.size(); i++) + cameraPtrs.at(i) = cameraList.GetByIndex(i); + + std::vector imagePtrs(cameraPtrs.size()); + + // Getting frames + // Retrieve next received image and ensure image completion + // Spinnaker::ImagePtr imagePtr = cameraPtrs.at(i)->GetNextImage(); + // Clean buffer + retrieve next received image + ensure image completion + auto durationMs = 0.; + // for (auto counter = 0 ; counter < 10 ; counter++) + while (durationMs < 1.) + { + const auto begin = std::chrono::high_resolution_clock::now(); + for (auto i = 0u; i < cameraPtrs.size(); i++) + imagePtrs.at(i) = cameraPtrs.at(i)->GetNextImage(); + durationMs = std::chrono::duration_cast(std::chrono::high_resolution_clock::now()-begin).count() * 1e-6; + // op::log("Time extraction (ms): " + std::to_string(durationMs), op::Priority::High, __LINE__, __FUNCTION__, __FILE__); + } + + // Original format -> RGB8 + bool imagesExtracted = true; + for (auto& imagePtr : imagePtrs) + { + if (imagePtr->IsIncomplete()) + { + op::log("Image incomplete with image status " + std::to_string(imagePtr->GetImageStatus()) + "...", + op::Priority::High, __LINE__, __FUNCTION__, __FILE__); + imagesExtracted = false; + break; + } + else + { + // Print image information + // Convert image to RGB + // Interpolation methods + // http://softwareservices.ptgrey.com/Spinnaker/latest/group___spinnaker_defs.html + // DEFAULT Default method. + // NO_COLOR_PROCESSING No color processing. + // NEAREST_NEIGHBOR Fastest but lowest quality. Equivalent to FLYCAPTURE_NEAREST_NEIGHBOR_FAST in FlyCapture. + // EDGE_SENSING Weights surrounding pixels based on localized edge orientation. + // HQ_LINEAR Well-balanced speed and quality. + // RIGOROUS Slowest but produces good results. + // IPP Multi-threaded with similar results to edge sensing. + // DIRECTIONAL_FILTER Best quality but much faster than rigorous. + // Colors + // http://softwareservices.ptgrey.com/Spinnaker/latest/group___camera_defs__h.html#ggabd5af55aaa20bcb0644c46241c2cbad1a33a1c8a1f6dbcb4a4eaaaf6d4d7ff1d1 + // PixelFormat_BGR8 + // Time tests + // const auto reps = 1e3; + // // const auto reps = 1e2; // for RIGOROUS & DIRECTIONAL_FILTER + // const auto begin = std::chrono::high_resolution_clock::now(); + // for (auto asdf = 0 ; asdf < reps ; asdf++){ + // imagePtr = imagePtr->Convert(Spinnaker::PixelFormat_BGR8, Spinnaker::DEFAULT); // ~ 1.5 ms but pixeled + // imagePtr = imagePtr->Convert(Spinnaker::PixelFormat_BGR8, Spinnaker::NO_COLOR_PROCESSING); // ~0.5 ms but BW + imagePtr = imagePtr->Convert(Spinnaker::PixelFormat_BGR8, Spinnaker::HQ_LINEAR); // ~6 ms, looks as good as best + // imagePtr = imagePtr->Convert(Spinnaker::PixelFormat_BGR8, Spinnaker::EDGE_SENSING); // ~2 ms default << edge << best + // imagePtr = imagePtr->Convert(Spinnaker::PixelFormat_BGR8, Spinnaker::RIGOROUS); // ~115, too slow + // imagePtr = imagePtr->Convert(Spinnaker::PixelFormat_BGR8, Spinnaker::IPP); // ~2 ms, slightly worse than HQ_LINEAR + // imagePtr = imagePtr->Convert(Spinnaker::PixelFormat_BGR8, Spinnaker::DIRECTIONAL_FILTER); // ~30 ms, ideally best quality? + // imagePtr = imagePtr; + // } + // durationMs = std::chrono::duration_cast(std::chrono::high_resolution_clock::now()-begin).count() * 1e-6; + // op::log("Time conversion (ms): " + std::to_string(durationMs / reps), op::Priority::High, __LINE__, __FUNCTION__, __FILE__); + } + } + + // Convert to cv::Mat + if (imagesExtracted) + { + for (auto i = 0u; i < imagePtrs.size(); i++) + { + // Baseline + // cvMats.emplace_back(pointGreyToCvMat(imagePtrs.at(i)).clone()); + // Undistort + // http://docs.opencv.org/2.4/modules/imgproc/doc/geometric_transformations.html#undistort + auto auxCvMat = pointGreyToCvMat(imagePtrs.at(i)); + cvMats.emplace_back(); + cv::undistort(auxCvMat, cvMats[i], INTRINSICS[i], DISTORTIONS[i]); + } + } + + return cvMats; + } + catch (Spinnaker::Exception &e) + { + op::error(e.what(), __LINE__, __FUNCTION__, __FILE__); + return {}; + } + catch (const std::exception& e) + { + op::error(e.what(), __LINE__, __FUNCTION__, __FILE__); + return {}; + } +} + +// This function prints the device information of the camera from the transport +// layer; please see NodeMapInfo example for more in-depth comments on printing +// device information from the nodemap. +int printDeviceInfo(Spinnaker::GenApi::INodeMap &iNodeMap, const unsigned int camNum) +{ + int result = 0; + + op::log("Printing device information for camera " + std::to_string(camNum) + "...\n", op::Priority::High); + + Spinnaker::GenApi::FeatureList_t features; + Spinnaker::GenApi::CCategoryPtr cCategoryPtr = iNodeMap.GetNode("DeviceInformation"); + if (Spinnaker::GenApi::IsAvailable(cCategoryPtr) && Spinnaker::GenApi::IsReadable(cCategoryPtr)) + { + cCategoryPtr->GetFeatures(features); + + Spinnaker::GenApi::FeatureList_t::const_iterator it; + for (it = features.begin(); it != features.end(); ++it) + { + Spinnaker::GenApi::CNodePtr pfeatureNode = *it; + const auto cValuePtr = (Spinnaker::GenApi::CValuePtr)pfeatureNode; + op::log(pfeatureNode->GetName() + " : " + (IsReadable(cValuePtr) ? cValuePtr->ToString() : "Node not readable"), op::Priority::High); + } + } + else + op::log("Device control information not available.", op::Priority::High); + op::log(" ", op::Priority::High); + + return result; +} + +WPointGrey::WPointGrey() : + initialized{false} +{ +} + +WPointGrey::~WPointGrey() +{ + try + { + if (initialized) + { + // End acquisition for each camera + // Notice that what is usually a one-step process is now two steps + // because of the additional step of selecting the camera. It is worth + // repeating that camera selection needs to be done once per loop. + // It is possible to interact with cameras through the camera list with + // GetByIndex(); this is an alternative to retrieving cameras as + // Spinnaker::CameraPtr objects that can be quick and easy for small tasks. + // + for (auto i = 0; i < mCameraList.GetSize(); i++) + mCameraList.GetByIndex(i)->EndAcquisition(); + + for (auto i = 0; i < mCameraList.GetSize(); i++) + { + // Select camera + auto cameraPtr = mCameraList.GetByIndex(i); + + // Retrieve GenICam nodemap + auto& iNodeMap = cameraPtr->GetNodeMap(); + + // // Disable chunk data + // result = disableChunkData(iNodeMap); + // // if (result < 0) + // // return result; + + // Reset trigger + auto result = resetTrigger(iNodeMap); + if (result < 0) + op::error("Error happened..." + std::to_string(result), __LINE__, __FUNCTION__, __FILE__); + + // Deinitialize each camera + // Each camera must be deinitialized separately by first + // selecting the camera and then deinitializing it. + cameraPtr->DeInit(); + } + + op::log("Completed. Releasing...", op::Priority::High); + + // Clear camera list before releasing mSystemPtr + mCameraList.Clear(); + + // Release mSystemPtr + mSystemPtr->ReleaseInstance(); + } + + op::log("Done! Exitting...", op::Priority::High); + } + catch (const Spinnaker::Exception& e) + { + op::error(e.what(), __LINE__, __FUNCTION__, __FILE__); + } + catch (const std::exception& e) + { + op::error(e.what(), __LINE__, __FUNCTION__, __FILE__); + } +} + +void WPointGrey::initializationOnThread() +{ + try + { + initialized = true; + + // Print application build information + op::log(std::string{ "Application build date: " } + __DATE__ + " " + __TIME__, op::Priority::High, __LINE__, __FUNCTION__, __FILE__); + + // Retrieve singleton reference to mSystemPtr object + mSystemPtr = Spinnaker::System::GetInstance(); + + // Retrieve list of cameras from the mSystemPtr + mCameraList = mSystemPtr->GetCameras(); + + unsigned int numCameras = mCameraList.GetSize(); + + op::log("Number of cameras detected: " + std::to_string(numCameras), op::Priority::High, __LINE__, __FUNCTION__, __FILE__); + + // Finish if there are no cameras + if (numCameras == 0) + { + // Clear camera list before releasing mSystemPtr + mCameraList.Clear(); + + // Release mSystemPtr + mSystemPtr->ReleaseInstance(); + + op::log("Not enough cameras!\nPress Enter to exit...", op::Priority::High); + getchar(); + + op::error("No cameras detected.", __LINE__, __FUNCTION__, __FILE__); + } + op::log("Camera system initialized...", op::Priority::High); + + // + // Retrieve transport layer nodemaps and print device information for + // each camera + // + // *** NOTES *** + // This example retrieves information from the transport layer nodemap + // twice: once to print device information and once to grab the device + // serial number. Rather than caching the nodemap, each nodemap is + // retrieved both times as needed. + // + op::log("\n*** DEVICE INFORMATION ***\n", op::Priority::High); + + for (int i = 0; i < mCameraList.GetSize(); i++) + { + // Select camera + auto cameraPtr = mCameraList.GetByIndex(i); + + // Retrieve TL device nodemap + auto& iNodeMapTLDevice = cameraPtr->GetTLDeviceNodeMap(); + + // Print device information + auto result = printDeviceInfo(iNodeMapTLDevice, i); + if (result < 0) + op::error("Result > 0, error " + std::to_string(result) + " occurred...", __LINE__, __FUNCTION__, __FILE__); + } + + for (auto i = 0; i < mCameraList.GetSize(); i++) + { + // Select camera + auto cameraPtr = mCameraList.GetByIndex(i); + + // Initialize each camera + // You may notice that the steps in this function have more loops with + // less steps per loop; this contrasts the acquireImages() function + // which has less loops but more steps per loop. This is done for + // demonstrative purposes as both work equally well. + // Later: Each camera needs to be deinitialized once all images have been + // acquired. + cameraPtr->Init(); + + // Retrieve GenICam nodemap + // auto& iNodeMap = cameraPtr->GetNodeMap(); + + // // Configure trigger + // result = configureTrigger(iNodeMap); + // if (result < 0) + // op::error("Result > 0, error " + std::to_string(result) + " occurred...", __LINE__, __FUNCTION__, __FILE__); + + // // Configure chunk data + // result = configureChunkData(iNodeMap); + // if (result < 0) + // return result; + + // Remove buffer --> Always get newest frame + Spinnaker::GenApi::INodeMap& snodeMap = cameraPtr->GetTLStreamNodeMap(); + Spinnaker::GenApi::CEnumerationPtr ptrBufferHandlingMode = snodeMap.GetNode("StreamBufferHandlingMode"); + if (!Spinnaker::GenApi::IsAvailable(ptrBufferHandlingMode) || !Spinnaker::GenApi::IsWritable(ptrBufferHandlingMode)) + op::error("Unable to change buffer handling mode", __LINE__, __FUNCTION__, __FILE__); + + Spinnaker::GenApi::CEnumEntryPtr ptrBufferHandlingModeNewest = ptrBufferHandlingMode->GetEntryByName("NewestFirstOverwrite"); + if (!Spinnaker::GenApi::IsAvailable(ptrBufferHandlingModeNewest) || !IsReadable(ptrBufferHandlingModeNewest)) + op::error("Unable to set buffer handling mode to newest (entry 'NewestFirstOverwrite' retrieval). Aborting...", __LINE__, __FUNCTION__, __FILE__); + int64_t bufferHandlingModeNewest = ptrBufferHandlingModeNewest->GetValue(); + + ptrBufferHandlingMode->SetIntValue(bufferHandlingModeNewest); + } + + // Prepare each camera to acquire images + // + // *** NOTES *** + // For pseudo-simultaneous streaming, each camera is prepared as if it + // were just one, but in a loop. Notice that cameras are selected with + // an index. We demonstrate pseduo-simultaneous streaming because true + // simultaneous streaming would require multiple process or threads, + // which is too complex for an example. + // + // Serial numbers are the only persistent objects we gather in this + // example, which is why a std::vector is created. + std::vector strSerialNumbers(mCameraList.GetSize()); + for (auto i = 0u; i < strSerialNumbers.size(); i++) + { + // Select camera + auto cameraPtr = mCameraList.GetByIndex(i); + + // Set acquisition mode to continuous + Spinnaker::GenApi::CEnumerationPtr ptrAcquisitionMode = cameraPtr->GetNodeMap().GetNode("AcquisitionMode"); + if (!Spinnaker::GenApi::IsAvailable(ptrAcquisitionMode) || !Spinnaker::GenApi::IsWritable(ptrAcquisitionMode)) + op::error("Unable to set acquisition mode to continuous (node retrieval; camera " + std::to_string(i) + "). Aborting...", __LINE__, __FUNCTION__, __FILE__); + + Spinnaker::GenApi::CEnumEntryPtr ptrAcquisitionModeContinuous = ptrAcquisitionMode->GetEntryByName("Continuous"); + if (!Spinnaker::GenApi::IsAvailable(ptrAcquisitionModeContinuous) || !Spinnaker::GenApi::IsReadable(ptrAcquisitionModeContinuous)) + op::error("Unable to set acquisition mode to continuous (entry 'continuous' retrieval " + std::to_string(i) + "). Aborting...", __LINE__, __FUNCTION__, __FILE__); + + int64_t acquisitionModeContinuous = ptrAcquisitionModeContinuous->GetValue(); + + ptrAcquisitionMode->SetIntValue(acquisitionModeContinuous); + + op::log("Camera " + std::to_string(i) + " acquisition mode set to continuous...", op::Priority::High); + + // Begin acquiring images + cameraPtr->BeginAcquisition(); + + op::log("Camera " + std::to_string(i) + " started acquiring images...", op::Priority::High); + + // Retrieve device serial number for filename + strSerialNumbers[i] = ""; + + Spinnaker::GenApi::CStringPtr ptrStringSerial = cameraPtr->GetTLDeviceNodeMap().GetNode("DeviceSerialNumber"); + + if (Spinnaker::GenApi::IsAvailable(ptrStringSerial) && Spinnaker::GenApi::IsReadable(ptrStringSerial)) + { + strSerialNumbers[i] = ptrStringSerial->GetValue(); + op::log("Camera " + std::to_string(i) + " serial number set to " + strSerialNumbers[i].c_str() + "...", op::Priority::High); + } + op::log(" ", op::Priority::High); + } + + op::log("\nRunning for all cameras...\n\n*** IMAGE ACQUISITION ***\n", op::Priority::High); + } + catch (const Spinnaker::Exception& e) + { + op::error(e.what(), __LINE__, __FUNCTION__, __FILE__); + } + catch (const std::exception& e) + { + op::error(e.what(), __LINE__, __FUNCTION__, __FILE__); + } +} + +std::shared_ptr> WPointGrey::workProducer() +{ + try + { + // Profiling speed + const auto profilerKey = op::Profiler::timerInit(__LINE__, __FUNCTION__, __FILE__); + // Get image from each camera + const auto cvMats = acquireImages(mCameraList); + // Images to userDatum + auto datums3d = std::make_shared>(cvMats.size()); + for (auto i = 0u ; i < cvMats.size() ; i++) + datums3d->at(i).cvInputData = cvMats.at(i); + // Profiling speed + if (!cvMats.empty()) + { + op::Profiler::timerEnd(profilerKey); + op::Profiler::printAveragedTimeMsOnIterationX(profilerKey, __LINE__, __FUNCTION__, __FILE__, 100); + } + // Return Datum + return datums3d; + } + catch (const Spinnaker::Exception& e) + { + this->stop(); + op::error(e.what(), __LINE__, __FUNCTION__, __FILE__); + return nullptr; + } + catch (const std::exception& e) + { + this->stop(); + op::error(e.what(), __LINE__, __FUNCTION__, __FILE__); + return nullptr; + } +} diff --git a/windows/OpenPose3DReconstruction/src/reconstruction3D.cpp b/windows/OpenPose3DReconstruction/src/reconstruction3D.cpp new file mode 100644 index 00000000..69b91994 --- /dev/null +++ b/windows/OpenPose3DReconstruction/src/reconstruction3D.cpp @@ -0,0 +1,153 @@ +#include +#include +#include +#include + +double calcReprojectionError(const cv::Mat& X, const std::vector& M, const std::vector& pt2D) +{ + auto averageError = 0.; + for(unsigned int i = 0 ; i < M.size() ; i++) + { + cv::Mat imageX = M[i] * X; + imageX /= imageX.at(2,0); + const auto error = std::sqrt(std::pow(imageX.at(0,0) - pt2D[i].x,2) + std::pow(imageX.at(1,0) - pt2D[i].y,2)); + //log("Error: " + std::to_string(error)); + averageError += error; + } + return averageError / M.size(); +} + +void triangulate(cv::Mat& X, const std::vector& matrixEachCamera, const std::vector& pointOnEachCamera) +{ + // Security checks + if (matrixEachCamera.empty() || matrixEachCamera.size() != pointOnEachCamera.size()) + op::error("numberCameras.empty() || numberCameras.size() != pointOnEachCamera.size()", __LINE__, __FUNCTION__, __FILE__); + // Create and fill A + const auto numberCameras = (int)matrixEachCamera.size(); + cv::Mat A = cv::Mat::zeros(numberCameras*2, 4, CV_64F); + for (auto i = 0 ; i < numberCameras ; i++) + { + cv::Mat temp = pointOnEachCamera[i].x*matrixEachCamera[i].rowRange(2,3) - matrixEachCamera[i].rowRange(0,1); + temp.copyTo(A.rowRange(i*2,i*2+1)); + temp = pointOnEachCamera[i].y*matrixEachCamera[i].rowRange(2,3) - matrixEachCamera[i].rowRange(1,2); + temp.copyTo(A.rowRange(i*2+1,i*2+2)); + } + // SVD on A + cv::SVD svd{A}; + svd.solveZ(A,X); + X /= X.at(3); +} + +// TODO: ask Hanbyul for the missing function: TriangulationOptimization +double triangulateWithOptimization(cv::Mat& X, const std::vector& matrixEachCamera, const std::vector& pointOnEachCamera) +{ + triangulate(X, matrixEachCamera, pointOnEachCamera); + + // //if (matrixEachCamera.size() >= 3) + // //double beforeError = calcReprojectionError(&matrixEachCamera, pointOnEachCamera, X); + // double change = TriangulationOptimization(&matrixEachCamera, pointOnEachCamera, X); + // //double afterError = calcReprojectionError(&matrixEachCamera,pointOnEachCamera,X); + // //printfLog("!!Mine %.8f , inFunc %.8f \n",beforeError-afterError,change); + // return change; + return 0.; +} + +void reconstructArray(op::Array& keypoints3D, const std::vector>& keypointsVector) +{ + const auto& keypoints0 = keypointsVector.at(0); + const auto& keypoints1 = keypointsVector.at(1); + const auto& keypoints2 = keypointsVector.at(2); + if (keypoints0.getSize(0) > 0 && keypoints1.getSize(0) > 0 && keypoints2.getSize(0) > 0) + { + // Count #correspondences + const auto threshold = 0.1f; + const auto numberBodyParts = keypoints0.getSize(1); + std::vector indexesUsed; + std::vector> xyPoints; + for (auto part = 0; part < numberBodyParts; part++) + { + if (keypoints0[{0, part, 2}] > threshold && keypoints1[{0, part, 2}] > threshold && keypoints2[{0, part, 2}] > threshold) + { + indexesUsed.emplace_back(part); + xyPoints.emplace_back(std::vector{ + cv::Point2d{ keypoints0[{0, part, 0}], keypoints0[{0, part, 1}] }, + cv::Point2d{ keypoints1[{0, part, 0}], keypoints1[{0, part, 1}] }, + cv::Point2d{ keypoints2[{0, part, 0}], keypoints2[{0, part, 1}] } + }); + } + } + if (!xyPoints.empty()) + { + // Do 3D reconstruction + std::vector xyzPoints(xyPoints.size()); + for (auto i = 0u; i < xyPoints.size(); i++) + { + cv::Mat X; + triangulateWithOptimization(X, M_EACH_CAMERA, xyPoints[i]); + xyzPoints[i] = cv::Point3d{ X.at(0), X.at(1), X.at(2) }; + } + + // 3D points to pose + // OpenCV alternative: + // // http://docs.opencv.org/2.4/modules/calib3d/doc/camera_calibration_and_3d_reconstruction.html#triangulatepoints + // cv::Mat reconstructedcv::Points{4, firstcv::Points.size(), CV_64F}; + // cv::triangulatecv::Points(cv::Mat::eye(3,4, CV_64F), M_3_1, firstcv::Points, secondcv::Points, reconstructedcv::Points); + keypoints3D = op::Array{ { 1, numberBodyParts, 4 }, 0 }; + for (auto index = 0u; index < indexesUsed.size(); index++) + { + auto& xValue = keypoints3D[{0, indexesUsed[index], 0}]; + auto& yValue = keypoints3D[{0, indexesUsed[index], 1}]; + auto& zValue = keypoints3D[{0, indexesUsed[index], 2}]; + auto& scoreValue = keypoints3D[{0, indexesUsed[index], 3}]; + if (std::isfinite(xyzPoints[index].x) && std::isfinite(xyzPoints[index].y) && std::isfinite(xyzPoints[index].z)) + { + xValue = xyzPoints[index].x; + yValue = xyzPoints[index].y; + zValue = xyzPoints[index].z; + scoreValue = 1.f; + } + } + } + } +} + +void WReconstruction3D::work(std::shared_ptr>& datumsPtr) +{ + // User's post-processing (after OpenPose processing & before OpenPose outputs) here + // datum.cvOutputData: rendered frame with pose or heatmaps + // datum.poseKeypoints: Array with the estimated pose + try + { + // Profiling speed + const auto profilerKey = op::Profiler::timerInit(__LINE__, __FUNCTION__, __FILE__); + if (datumsPtr != nullptr && /*!datumsPtr->empty() &&*/ datumsPtr->size() == 3) + { + // Pose + reconstructArray(datumsPtr->at(0).poseKeypoints3D, std::vector>{ + datumsPtr->at(0).poseKeypoints, datumsPtr->at(1).poseKeypoints, datumsPtr->at(2).poseKeypoints + }); + // Face + reconstructArray(datumsPtr->at(0).faceKeypoints3D, std::vector>{ + datumsPtr->at(0).faceKeypoints, datumsPtr->at(1).faceKeypoints, datumsPtr->at(2).faceKeypoints + }); + // Left hand + reconstructArray(datumsPtr->at(0).leftHandKeypoints3D, std::vector>{ + datumsPtr->at(0).handKeypoints[0], datumsPtr->at(1).handKeypoints[0], datumsPtr->at(2).handKeypoints[0] + }); + // Right hand + reconstructArray(datumsPtr->at(0).rightHandKeypoints3D, std::vector>{ + datumsPtr->at(0).handKeypoints[1], datumsPtr->at(1).handKeypoints[1], datumsPtr->at(2).handKeypoints[1] + }); + + // Profiling speed + op::Profiler::timerEnd(profilerKey); + op::Profiler::printAveragedTimeMsOnIterationX(profilerKey, __LINE__, __FUNCTION__, __FILE__, 100); + } + } + catch (const std::exception& e) + { + op::log("Some kind of unexpected error happened."); + this->stop(); + op::error(e.what(), __LINE__, __FUNCTION__, __FILE__); + } +} diff --git a/windows/OpenPose3DReconstruction/src/renderer.cpp b/windows/OpenPose3DReconstruction/src/renderer.cpp new file mode 100644 index 00000000..2264e39d --- /dev/null +++ b/windows/OpenPose3DReconstruction/src/renderer.cpp @@ -0,0 +1,453 @@ +#include +#include +#include + +struct SDispUnit +{ + op::Array mPoseKeypoints; + op::Array mFaceKeypoints; + op::Array mLeftHandKeypoints; + op::Array mRightHandKeypoints; + bool mKeypointsValid; +}; + +SDispUnit gDispUnit3d; + +static auto gRatio = 16.f / 9.f; +static auto gWidth = 600; // Initial window width +static auto gHeight = 600; // Initial window height +static GLfloat gNearPlaneForDefaultRender = -100; //0.01; +static GLfloat gFarPlaneForDefaultRender = 1000; + +const GLfloat LIGHT_DIFFUSE[] = {1.f, 1.f, 1.f, 1.f}; /* Red diffuse light. */ +const GLfloat LIGHT_POSITION[] = {1.f, 1.f, 1.f, 0.f}; /* Infinite light location. */ +const GLfloat COLOR_DIFFUSE[] = { 0.f, 1.f, 1.f, 1.f}; +const GLfloat COLOR_AMBIENT[] = { 0.f, 0.7f, 0.7f, 1.f}; + +//View Change by Mouse +static bool gBButton1Down = false; +static auto gXClick = 0.f; +static auto gYClick = 0.f; +static auto gGViewDistance = -82.3994f; //-45; +static auto gMouseXRotate = -63.2f; //0; +static auto gMouseYRotate = 7.f; //60; +static auto gMouseXPan = -69.2f; // 0; +static auto gMouseYPan = -29.9501f; // 0; +static auto gMouseZPan = 0.f; +static auto gScaleForMouseMotion = 0.1f; + +enum class CameraMode { + CAM_DEFAULT, + CAM_ROTATE, + CAM_ZOOM, + CAM_PAN, + CAM_PAN_Z +}; +static CameraMode gCameraMode = CameraMode::CAM_DEFAULT; + +const auto RADPERDEG = 0.0174532925199433; + +void DrawConeByTwoPts(cv::Point3f& pt1,cv::Point3f& pt2,float ptSize) +{ + const GLdouble x1 = pt1.x; + const GLdouble y1 = pt1.y; + const GLdouble z1 = pt1.z; + const GLdouble x2 = pt2.x; + const GLdouble y2 = pt2.y; + const GLdouble z2 = pt2.z; + + const double x = x2-x1; + const double y = y2-y1; + const double z = z2-z1; + //const double L = std::sqrt(x*x+y*y+z*z); + + glPushMatrix (); + + glTranslated(x1,y1,z1); + + if ((x != 0.) || (y != 0.)) + { + glRotated(std::atan2(y,x)/RADPERDEG,0.,0.,1.); + glRotated(std::atan2(std::sqrt(x*x+y*y),z)/RADPERDEG,0.,1.,0.); + } + else if (z<0) + glRotated(180,1.,0.,0.); + + const auto height = sqrt((pt1.x - pt2.x)*(pt1.x - pt2.x) + (pt1.y - pt2.y)*(pt1.y - pt2.y) + (pt1.z - pt2.z)*(pt1.z - pt2.z) ); + glutSolidCone(ptSize, height, 5, 5); + + glPopMatrix(); +} + + +void RenderHumanBody() +{ + //const auto numberPeople = gDispUnit3d.mPoseKeypoints.getSize(0); + const auto numberBodyParts = gDispUnit3d.mPoseKeypoints.getSize(1); + const int person = 0; + //for(int person=0;person 0) + { + glPushMatrix(); + //glTranslatef(skeleton.m_jointPos[i].first.x,skeleton.m_jointPos[i].first.y,skeleton.m_jointPos[i].first.z); + glTranslatef(-(gDispUnit3d.mPoseKeypoints[4*part + person*numberBodyParts] -640 )/1280*30, + -(gDispUnit3d.mPoseKeypoints[4*part+1+ person*numberBodyParts]-360)/720*30, + -(gDispUnit3d.mPoseKeypoints[4*part+2+ person*numberBodyParts]-360)/720*30 + ); + + if (part == 4 || part == 7) + glutSolidSphere(0.5*0.7,20,20); + else + glutSolidSphere(0.5,20,20); + //glutSolidSphere(20/WORLD_TO_CM_RATIO,20,20); + glPopMatrix(); + } + } + + const int parentIdx[] = { 1, -1, 1, 2, 3, 1, 5, 6, 1, 8, 9, 1, 11, 12, 0, 0, 14, 15 }; + //Bone + //0-1-2 1-3-4-5 0-6-7 6-8-9-10 + //int sizeOfJoints = skeleton.m_boneEndsPos.size(); + //sizeOfJoints /=2; + for(int part=0;part= 0) + { + if (gDispUnit3d.mPoseKeypoints[4 * part + 3 + person*numberBodyParts]>0) + { + cv::Point3f child( + -(gDispUnit3d.mPoseKeypoints[4 * part + person*numberBodyParts] - 640) / 1280 * 30, + -(gDispUnit3d.mPoseKeypoints[4 * part + 1 + person*numberBodyParts] - 360) / 720 * 30, + -(gDispUnit3d.mPoseKeypoints[4 * part + 2 + person*numberBodyParts] - 360) / 720 * 30 + ); + cv::Point3f parent( + -(gDispUnit3d.mPoseKeypoints[4 * parentIdx[part] + person*numberBodyParts] - 640) / 1280 * 30, + -(gDispUnit3d.mPoseKeypoints[4 * parentIdx[part] + 1 + person*numberBodyParts] - 360) / 720 * 30, + -(gDispUnit3d.mPoseKeypoints[4 * parentIdx[part] + 2 + person*numberBodyParts] - 360) / 720 * 30 + ); + DrawConeByTwoPts(parent, child, 0.5); + } + } + } + } +} + + +void InitGraphics(void) +{ + // Enable a single OpenGL light + glLightfv(GL_LIGHT0, GL_AMBIENT, LIGHT_DIFFUSE); + glLightfv(GL_LIGHT0, GL_DIFFUSE, LIGHT_DIFFUSE); + glLightfv(GL_LIGHT0, GL_POSITION, LIGHT_POSITION); + glEnable(GL_LIGHT0); + glEnable(GL_LIGHTING); + + // Use depth buffering for hidden surface elimination + glEnable(GL_DEPTH_TEST); + + // Setup the view of the cube + glMatrixMode(GL_PROJECTION); + gluPerspective( /* field of view in degree */ 40.0, + /* aspect ratio */ 1.0, + /* Z near */ 1.0, /* Z far */ 1000.0); + glMatrixMode(GL_MODELVIEW); + gluLookAt( + 0.0, 0.0, 5.0, // eye is at (0,0,5) + 0.0, 0.0, 0.0, // center is at (0,0,0) + 0.0, 1.0, 0. // up is in positive Y direction + ); + + // Adjust cube position to be asthetic angle + glTranslatef(0.0, 0.0, -1.0); + glRotatef(60, 1.0, 0.0, 0.0); + glRotatef(-20, 0.0, 0.0, 1.0); + + glColorMaterial(GL_FRONT, GL_DIFFUSE); + glEnable(GL_COLOR_MATERIAL); +} + + +// this is the actual idle function +void IdleFunc() +{ + glutPostRedisplay(); + glutSwapBuffers(); +} + + +void reshape(GLint width, GLint height) +{ + gWidth = width; + gHeight = height; + //printf("Window Reshape: %d, %d\n",width,height); + glViewport(0, 0, gWidth, gHeight); + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); + gRatio = (float)gWidth / gHeight; + gluPerspective(65.0, gRatio, gNearPlaneForDefaultRender, gFarPlaneForDefaultRender); + glMatrixMode(GL_MODELVIEW); +} + +void RenderDomeFloor() +{ + glDisable(GL_LIGHTING); + + const cv::Point3f gGloorCenter{0,0,0}; //ankle + const cv::Point3f Noise{0,1,0}; + + cv::Point3f upright = Noise - gGloorCenter; + upright = 1.0/sqrt(upright.x *upright.x + upright.y *upright.y + upright.z *upright.z )*upright; + const cv::Point3f gGloorAxis2 = cv::Point3f{1,0,0}.cross(upright); + const cv::Point3f gGloorAxis1 = gGloorAxis2.cross(upright); + + const auto gridNum = 10; + const auto width = 50.;//sqrt(Distance(gGloorPts.front(),gGloorCenter)*2 /gridNum) * 1.2; + const cv::Point3f origin = gGloorCenter - gGloorAxis1*(width*gridNum/2 ) - gGloorAxis2*(width*gridNum/2); + const cv::Point3f axis1 = gGloorAxis1 * width; + const cv::Point3f axis2 = gGloorAxis2 * width; + for (auto y = 0; y <= gridNum; ++y) + { + for (auto x = 0; x <= gridNum; ++x) + { + if ((x + y) % 2 == 0) + { + //continue; + //if(g_visData.m_backgroundColor.x ==0) + glColor4f(0.2f, 0.2f, 0.2f, 1.f); //black + //else + // glColor4f(1.f,1.f,1.f,1.f); //white + } + else + { + //if(g_visData.m_backgroundColor.x ==0) //black background + glColor4f(0.5f, 0.5f, 0.5f, 1.f); //grey + //else + // glColor4f(0.9.f, 0.9.f, 0.9.f, 1); //grey + } + + const cv::Point3f p1 = origin + axis1*x + axis2*y; + const cv::Point3f p2 = p1 + axis1; + const cv::Point3f p3 = p1 + axis2; + const cv::Point3f p4 = p1 + axis1 + axis2; + + + glBegin(GL_QUADS); + +// glNormal3f(0.f, -1.f, 0.f); + glVertex3f( p1.x, p1.y,p1.z); + //glNormal3f(0.f, -1.f, 0.f); + glVertex3f( p2.x, p2.y,p2.z); +// glNormal3f(0.f, -1.f, 0.f); + glVertex3f( p4.x, p4.y,p4.z); +// glNormal3f(0.f, -1.f, 0.f); + glVertex3f( p3.x, p3.y,p3.z); + glEnd(); + } + } + glEnable(GL_LIGHTING); +} + +void RenderMain(void) +{ + + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); + + glLoadIdentity(); + //gluLookAt(0,0,0, 0, 0, 1, 0, -1, 0); + gluLookAt( + 0.0, 0.0, 5.0, // eye is at (0,0,5) + 0.0, 0.0, 0.0, // center is at (0,0,0) + 0.0, 1.0, 0. // up is in positive Y direction + ); + + + glTranslatef(0,0,gGViewDistance); + glRotatef(-gMouseYRotate, 1.f, 0.f, 0.f); + glRotatef(-gMouseXRotate, 0.f, 1.f, 0.f); + //glRotatef(g_rotateAngle,0,0,1); + + glTranslatef(-gMouseXPan,gMouseYPan,-gMouseZPan); + //std::cout << gGViewDistance << " " << gMouseYRotate<< " " << gMouseXRotate << "\t\t\t"; + //std::cout << gMouseXPan << " " << gMouseYPan<< " " << gMouseZPan << std::endl; + //glTranslatef(gDispUnit3d.m_pt.x,gDispUnit3d.m_pt.y,-gMouseZPan); + //printf(" render: %f,%f\n",gDispUnit3d.m_pt.x,gDispUnit3d.m_pt.y); + + ////////////////////////////////////////////////////////////////////////// + // Transform to anchor a selected bone as origin + //glTranslatef(-g_visData.m_anchorOrigin.x,-g_visData.m_ + //glColor3f(1,1,0); + //glutWireTeapot(1); + + RenderDomeFloor(); + if (gDispUnit3d.mKeypointsValid) + RenderHumanBody(); + + glutSwapBuffers(); +} + +void MouseButton(int button, int state, int x, int y) +{ + + if (button == 3 || button == 4) //mouse wheel + { + //printf("wheel:: %d, %d, %d, %d\n",button, state,x,y); + if(button==3) //zoom in + gGViewDistance += 10*gScaleForMouseMotion; + else //zoom out + gGViewDistance -= 10*gScaleForMouseMotion; + //if(gGViewDistance<0.01) + //gGViewDistance = 0.01; + printf("gGViewDistance: %f\n",gGViewDistance); + } + else + { + if (button == GLUT_LEFT_BUTTON) + { + gBButton1Down = (state == GLUT_DOWN) ? 1 : 0; + gXClick = (float)x; + gYClick = (float)y; + + + //if (glutGetModifiers() == GLUT_ACTIVE_CTRL) + ///gCameraMode = CameraMode::CAM_ROTATE; + //else + if (glutGetModifiers() == GLUT_ACTIVE_SHIFT) + gCameraMode = CameraMode::CAM_PAN; + else + { + gCameraMode = CameraMode::CAM_ROTATE; + } + } + //printf("Clicked: %f,%f\n",gXClick,gYClick); + } + glutPostRedisplay(); +} + +void MouseMotion(int x, int y) +{ + + // If button1 pressed, zoom in/out if mouse is moved up/down. + if (gBButton1Down) + { + /* if(gCameraMode == CameraMode::CAM_ZOOM) + { + gGViewDistance += (y - gYClick) * gScaleForMouseMotion; + + printf("gGViewDistance: %f\n",gGViewDistance); + //if (gCameraWorks.m_currentViewStatus.fViewDistance < VIEWING_DISTANCE_MIN) + // gCameraWorks.m_currentViewStatus.fViewDistance = VIEWING_DISTANCE_MIN; + } + else */ + if (gCameraMode == CameraMode::CAM_ROTATE) + { + gMouseXRotate += (x - gXClick)*0.2f; + gMouseYRotate -= (y - gYClick)*0.2f; + } + else if (gCameraMode == CameraMode::CAM_PAN) + { + gMouseXPan -= (x - gXClick) / 2 * gScaleForMouseMotion; + gMouseYPan -= (y - gYClick) / 2 * gScaleForMouseMotion; + } + else if (gCameraMode == CameraMode::CAM_PAN_Z) + { + auto dist = sqrt(pow((x - gXClick), 2.0f) + pow((y - gYClick), 2.0f)); + if (y>& datumsPtr) +{ + try + { + // Profiling speed + const auto profilerKey = op::Profiler::timerInit(__LINE__, __FUNCTION__, __FILE__); + + // User's displaying/saving/other processing here + // datum.cvOutputData: rendered frame with pose or heatmaps + // datum.poseKeypoints: Array with the estimated pose + if (datumsPtr != nullptr && !datumsPtr->empty()) + { + cv::Mat cvMat = datumsPtr->at(0).cvOutputData.clone(); + for (auto i = 1u; i < datumsPtr->size(); i++) + cv::hconcat(cvMat, datumsPtr->at(i).cvOutputData, cvMat); + + // while (cvMat.cols > 1500 || cvMat.rows > 1500) + while (cvMat.cols > 1920 || cvMat.rows > 1920) + // while (cvMat.rows > 3500) + cv::pyrDown(cvMat, cvMat); + + cv::imshow(GUI_NAME, cvMat); + cv::resizeWindow(GUI_NAME, cvMat.cols, cvMat.rows); + + // OpenGL Rendering + gDispUnit3d.mPoseKeypoints = datumsPtr->at(0).poseKeypoints3D; + gDispUnit3d.mFaceKeypoints = datumsPtr->at(0).faceKeypoints3D; + gDispUnit3d.mLeftHandKeypoints = datumsPtr->at(0).leftHandKeypoints3D; + gDispUnit3d.mRightHandKeypoints = datumsPtr->at(0).rightHandKeypoints3D; + gDispUnit3d.mKeypointsValid = true; + + // Profiling speed + op::Profiler::timerEnd(profilerKey); + op::Profiler::printAveragedTimeMsOnIterationX(profilerKey, __LINE__, __FUNCTION__, __FILE__, 100); + } + + const auto key = cv::waitKey(1) % 256; // It sleeps 1 ms just to let the user see the output. Change to 33ms for normal 30 fps display + if (key == 27 || key == 'q') + this->stop(); + } + catch (const std::exception& e) + { + op::log("Some kind of unexpected error happened."); + this->stop(); + op::error(e.what(), __LINE__, __FUNCTION__, __FILE__); + } +} + +void WRender3D::visualizationThread() +{ + char *my_argv[] = { "OpenPose", NULL }; + int my_argc = 1; + glutInit(&my_argc, my_argv); + + /* setup the size, position, and display mode for new windows */ + glutInitWindowSize(1280, 720); + // glutInitWindowSize(640,480); + glutInitWindowPosition(200, 0); + // glutSetOption(GLUT_MULTISAMPLE,8); + glutInitDisplayMode(GLUT_RGBA | GLUT_DOUBLE | GLUT_DEPTH | GLUT_MULTISAMPLE); + + /* create and set up a window */ + glutCreateWindow(GUI_NAME); + InitGraphics(); + glutDisplayFunc(RenderMain); + glutMouseFunc(MouseButton); + glutMotionFunc(MouseMotion); + glutIdleFunc(IdleFunc); + //glutReshapeFunc (reshape); + + glutMainLoop(); +} diff --git a/windows/OpenPoseDemo/OpenPoseDemo.vcxproj b/windows/OpenPoseDemo/OpenPoseDemo.vcxproj index e6739c75..a0d60feb 100644 --- a/windows/OpenPoseDemo/OpenPoseDemo.vcxproj +++ b/windows/OpenPoseDemo/OpenPoseDemo.vcxproj @@ -58,7 +58,7 @@ Disabled true true - CAFFE_VERSION=1.0.0;BOOST_ALL_NO_LIB;USE_LMDB;USE_LEVELDB;USE_CUDNN;USE_OPENCV;USE_CAFFE;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;CMAKE_INTDIR="Debug";-D_SCL_SECURE_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;%(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" $(IntDir)\obj\relDir\relDir\%(RelativeDir)\%(Filename)%(Extension).obj @@ -70,7 +70,7 @@ true true ..\..\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) - 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;-D_SCL_SECURE_NO_WARNINGS + _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 $(IntDir)\obj\relDir\relDir\%(RelativeDir)\%(Filename)%(Extension).obj true Speed @@ -80,7 +80,7 @@ true true $(CUDA_PATH_V8_0)\lib\x64\; - ..\..\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;..\x64\Release\OpenPose.lib;%(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;..\x64\Release\OpenPose.lib;%(AdditionalDependencies) diff --git a/windows/TutorialPose/1_extract_from_image.vcxproj b/windows/TutorialPose/1_extract_from_image.vcxproj index 5801d39e..be152232 100644 --- a/windows/TutorialPose/1_extract_from_image.vcxproj +++ b/windows/TutorialPose/1_extract_from_image.vcxproj @@ -61,7 +61,7 @@ Disabled true true - CAFFE_VERSION=1.0.0;BOOST_ALL_NO_LIB;USE_LMDB;USE_LEVELDB;USE_CUDNN;USE_OPENCV;USE_CAFFE;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;CMAKE_INTDIR="Debug";-D_SCL_SECURE_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;%(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" $(IntDir)\obj\relDir\relDir\%(RelativeDir)\%(Filename)%(Extension).obj @@ -73,7 +73,7 @@ true true ..\..\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) - 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;-D_SCL_SECURE_NO_WARNINGS + _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 $(IntDir)\obj\relDir\relDir\%(RelativeDir)\%(Filename)%(Extension).obj true Speed @@ -83,7 +83,7 @@ true true $(CUDA_PATH_V8_0)\lib\x64\; - ..\..\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;..\x64\Release\OpenPose.lib;%(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;..\x64\Release\OpenPose.lib;%(AdditionalDependencies) diff --git a/windows/TutorialPose/2_extract_pose_or_heatmat_from_image.vcxproj b/windows/TutorialPose/2_extract_pose_or_heatmat_from_image.vcxproj index 9f04dd1b..8c5a3bb7 100644 --- a/windows/TutorialPose/2_extract_pose_or_heatmat_from_image.vcxproj +++ b/windows/TutorialPose/2_extract_pose_or_heatmat_from_image.vcxproj @@ -61,7 +61,7 @@ Disabled true true - CAFFE_VERSION=1.0.0;BOOST_ALL_NO_LIB;USE_LMDB;USE_LEVELDB;USE_CUDNN;USE_OPENCV;USE_CAFFE;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;CMAKE_INTDIR="Debug";-D_SCL_SECURE_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;%(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" $(IntDir)\obj\relDir\relDir\%(RelativeDir)\%(Filename)%(Extension).obj @@ -73,7 +73,7 @@ true true ..\..\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) - 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;-D_SCL_SECURE_NO_WARNINGS + _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 $(IntDir)\obj\relDir\relDir\%(RelativeDir)\%(Filename)%(Extension).obj true Speed @@ -83,7 +83,7 @@ true true $(CUDA_PATH_V8_0)\lib\x64\; - ..\..\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;..\x64\Release\OpenPose.lib;%(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;..\x64\Release\OpenPose.lib;%(AdditionalDependencies) diff --git a/windows/TutorialThread/1_openpose_read_and_display.vcxproj b/windows/TutorialThread/1_openpose_read_and_display.vcxproj index becfc6f1..d7039fb6 100644 --- a/windows/TutorialThread/1_openpose_read_and_display.vcxproj +++ b/windows/TutorialThread/1_openpose_read_and_display.vcxproj @@ -61,7 +61,7 @@ Disabled true true - CAFFE_VERSION=1.0.0;BOOST_ALL_NO_LIB;USE_LMDB;USE_LEVELDB;USE_CUDNN;USE_OPENCV;USE_CAFFE;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;CMAKE_INTDIR="Debug";-D_SCL_SECURE_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;%(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" $(IntDir)\obj\relDir\relDir\%(RelativeDir)\%(Filename)%(Extension).obj @@ -73,7 +73,7 @@ true true ..\..\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) - 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;-D_SCL_SECURE_NO_WARNINGS + _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 $(IntDir)\obj\relDir\relDir\%(RelativeDir)\%(Filename)%(Extension).obj true Speed @@ -83,7 +83,7 @@ true true $(CUDA_PATH_V8_0)\lib\x64\; - ..\..\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;..\x64\Release\OpenPose.lib;%(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;..\x64\Release\OpenPose.lib;%(AdditionalDependencies) diff --git a/windows/TutorialThread/2_user_processing_function.vcxproj b/windows/TutorialThread/2_user_processing_function.vcxproj index d5061c6d..0e11cb05 100644 --- a/windows/TutorialThread/2_user_processing_function.vcxproj +++ b/windows/TutorialThread/2_user_processing_function.vcxproj @@ -61,7 +61,7 @@ Disabled true true - CAFFE_VERSION=1.0.0;BOOST_ALL_NO_LIB;USE_LMDB;USE_LEVELDB;USE_CUDNN;USE_OPENCV;USE_CAFFE;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;CMAKE_INTDIR="Debug";-D_SCL_SECURE_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;%(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" $(IntDir)\obj\relDir\relDir\%(RelativeDir)\%(Filename)%(Extension).obj @@ -73,7 +73,7 @@ true true ..\..\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) - 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;-D_SCL_SECURE_NO_WARNINGS + _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 $(IntDir)\obj\relDir\relDir\%(RelativeDir)\%(Filename)%(Extension).obj true Speed @@ -83,7 +83,7 @@ true true $(CUDA_PATH_V8_0)\lib\x64\; - ..\..\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;..\x64\Release\OpenPose.lib;%(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;..\x64\Release\OpenPose.lib;%(AdditionalDependencies) diff --git a/windows/TutorialThread/3_user_input_processing_and_output.vcxproj b/windows/TutorialThread/3_user_input_processing_and_output.vcxproj index 19b0c586..f806c6bd 100644 --- a/windows/TutorialThread/3_user_input_processing_and_output.vcxproj +++ b/windows/TutorialThread/3_user_input_processing_and_output.vcxproj @@ -61,7 +61,7 @@ Disabled true true - CAFFE_VERSION=1.0.0;BOOST_ALL_NO_LIB;USE_LMDB;USE_LEVELDB;USE_CUDNN;USE_OPENCV;USE_CAFFE;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;CMAKE_INTDIR="Debug";-D_SCL_SECURE_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;%(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" $(IntDir)\obj\relDir\relDir\%(RelativeDir)\%(Filename)%(Extension).obj @@ -73,7 +73,7 @@ true true ..\..\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) - 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;-D_SCL_SECURE_NO_WARNINGS + _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 $(IntDir)\obj\relDir\relDir\%(RelativeDir)\%(Filename)%(Extension).obj true Speed @@ -83,7 +83,7 @@ true true $(CUDA_PATH_V8_0)\lib\x64\; - ..\..\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;..\x64\Release\OpenPose.lib;%(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;..\x64\Release\OpenPose.lib;%(AdditionalDependencies) diff --git a/windows/TutorialThread/4_user_input_processing_output_and_datum.vcxproj b/windows/TutorialThread/4_user_input_processing_output_and_datum.vcxproj index a8ac98cd..e284553a 100644 --- a/windows/TutorialThread/4_user_input_processing_output_and_datum.vcxproj +++ b/windows/TutorialThread/4_user_input_processing_output_and_datum.vcxproj @@ -61,7 +61,7 @@ Disabled true true - CAFFE_VERSION=1.0.0;BOOST_ALL_NO_LIB;USE_LMDB;USE_LEVELDB;USE_CUDNN;USE_OPENCV;USE_CAFFE;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;CMAKE_INTDIR="Debug";-D_SCL_SECURE_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;%(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" $(IntDir)\obj\relDir\relDir\%(RelativeDir)\%(Filename)%(Extension).obj @@ -73,7 +73,7 @@ true true ..\..\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) - 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;-D_SCL_SECURE_NO_WARNINGS + _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 $(IntDir)\obj\relDir\relDir\%(RelativeDir)\%(Filename)%(Extension).obj true Speed @@ -83,7 +83,7 @@ true true $(CUDA_PATH_V8_0)\lib\x64\; - ..\..\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;..\x64\Release\OpenPose.lib;%(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;..\x64\Release\OpenPose.lib;%(AdditionalDependencies) diff --git a/windows/TutorialWrapper/1_user_asynchronous.vcxproj b/windows/TutorialWrapper/1_user_asynchronous.vcxproj index b5889585..7ede3057 100644 --- a/windows/TutorialWrapper/1_user_asynchronous.vcxproj +++ b/windows/TutorialWrapper/1_user_asynchronous.vcxproj @@ -61,7 +61,7 @@ Disabled true true - CAFFE_VERSION=1.0.0;BOOST_ALL_NO_LIB;USE_LMDB;USE_LEVELDB;USE_CUDNN;USE_OPENCV;USE_CAFFE;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;CMAKE_INTDIR="Debug";-D_SCL_SECURE_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;%(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" $(IntDir)\obj\relDir\relDir\%(RelativeDir)\%(Filename)%(Extension).obj @@ -73,7 +73,7 @@ true true ..\..\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) - 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;-D_SCL_SECURE_NO_WARNINGS + _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 $(IntDir)\obj\relDir\relDir\%(RelativeDir)\%(Filename)%(Extension).obj true Speed @@ -83,7 +83,7 @@ true true $(CUDA_PATH_V8_0)\lib\x64\; - ..\..\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;..\x64\Release\OpenPose.lib;%(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;..\x64\Release\OpenPose.lib;%(AdditionalDependencies) diff --git a/windows/TutorialWrapper/2_user_synchronous.vcxproj b/windows/TutorialWrapper/2_user_synchronous.vcxproj index 67bf0b62..6db89bf2 100644 --- a/windows/TutorialWrapper/2_user_synchronous.vcxproj +++ b/windows/TutorialWrapper/2_user_synchronous.vcxproj @@ -61,7 +61,7 @@ Disabled true true - CAFFE_VERSION=1.0.0;BOOST_ALL_NO_LIB;USE_LMDB;USE_LEVELDB;USE_CUDNN;USE_OPENCV;USE_CAFFE;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;CMAKE_INTDIR="Debug";-D_SCL_SECURE_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;%(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" $(IntDir)\obj\relDir\relDir\%(RelativeDir)\%(Filename)%(Extension).obj @@ -73,7 +73,7 @@ true true ..\..\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) - 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;-D_SCL_SECURE_NO_WARNINGS + _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 $(IntDir)\obj\relDir\relDir\%(RelativeDir)\%(Filename)%(Extension).obj true Speed @@ -83,7 +83,7 @@ true true $(CUDA_PATH_V8_0)\lib\x64\; - ..\..\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;..\x64\Release\OpenPose.lib;%(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;..\x64\Release\OpenPose.lib;%(AdditionalDependencies) -- GitLab