Skip to content

Commit 09df229

Browse files
Fixed typos in doc and Python API
1 parent aa16f96 commit 09df229

File tree

9 files changed

+38
-31
lines changed

9 files changed

+38
-31
lines changed

doc/modules/3d_reconstruction_module.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ There are 2 alternatives to calibrate the cameras:
7575
1. Create a xml file for each camera named as `models/cameraParameters/flir/{camera_serial_number}.xml`.
7676
2. The elements inside each xml file are the extrinsic parameters of the camera (`CameraMatrix`), the intrinsic parameters (`Intrinsics`), and the distortion coefficients (`Distortion`). Copy the format from `models/cameraParameters/flir/17012332.xml.example`. For the extrinsic parameters of the camera, it allows you to set the coordinate origin (so that 3-d keypoints are distances with respect to that origin).
7777
- E.g., in order to set the camera 1 as the coordinate center, set its `CameraMatrix` as the identity matrix of size 3x4, and the `CameraMatrix` of the other cameras as the camera extrinsic parameters of from those cameras with respect to the main camera `M_1_i`.
78+
- **VERY IMPORTANT: The intrinsic camera matrix should be an upper triangular matrix.**
7879
3. The program can use any arbitrary number of cameras. Even if lots of cameras are added in `models/cameraParameters/flir/`, the program will check at runtime which FLIR cameras are detected and simply read those camera parameters. If the file corresponding to any of the cameras detected at runtime is not found, OpenPose will return an error.
7980
4. In the example XML, OpenPose uses the 8-distortion-parameter version of OpenCV. The distortion parameters are internally used by the OpenCV function [undistort()](http://docs.opencv.org/3.2.0/da/d54/group__imgproc__transform.html#ga69f2545a8b62a6b0fc2ee060dc30559d) to rectify the images. Therefore, this function can take either 4-, 5- or 8-parameter distortion coefficients (OpenCV 3.X also adds a 12- and 14-parameter alternatives). Therefore, either version (4, 5, 8, 12 or 14) will work in 3D OpenPose.
8081

doc/modules/calibration_module.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,13 @@ This experimental module performs camera calibration (distortion, intrinsic, and
1717

1818
Note: We are not aiming to have the best calibration toolbox, but the simplest one. If very high quality calibration is required, I am sure there must exist many other toolboxs with better extrinsic parameter estimation tools.
1919

20+
**VERY IMPORTANT**: OpenPose requires an upper triangular matrix for the intrinsic camera matrix. If you plan to use your own camera intrinsics, be aware of this.
21+
22+
2023

2124

2225
## Installing the Calibration Module
23-
Check [doc/installation.md#calibration-module](./installation.md#calibration-module) for installation steps.
26+
Check [doc/installation.md#calibration-module](../installation.md#calibration-module) for installation steps.
2427

2528

2629

@@ -150,7 +153,7 @@ Examples:
150153
## Using a Different Camera Brand
151154
If you plan to use the calibration tool without using OpenPose, you can manually save a video sequence of your desired camera into each of the camera image folders (i.e., in the above example, the `~/Desktop/intrinsics_0`, `~/Desktop/intrinsics_1`, etc. folders).
152155

153-
If you wanna eventually run that camera with OpenPose, check [doc/modules/3d_reconstruction_module.md#using-a-different-camera-brand](./modules/3d_reconstruction_module.md#using-a-different-camera-brand).
156+
If you wanna eventually run that camera with OpenPose, check [doc/modules/3d_reconstruction_module.md#using-a-different-camera-brand](./3d_reconstruction_module.md#using-a-different-camera-brand).
154157

155158

156159

doc/prerequisites.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ In addition, CMake automatically downloads all the OpenPose models. However, **s
3535
- Run `./bootstrap && make -j8 && make install -j8`. Make sure no error occurred.
3636
- Assuming your CMake downloaded folder is in {CMAKE_FOLDER_PATH}, everytime these instructions mentions `cmake-gui`, you will have to replace that line by `{CMAKE_FOLDER_PATH}/bin/cmake-gui`.
3737
3. Nvidia GPU version prerequisites:
38-
1. **Note: OpenPose has been tested extensively with CUDA 8.0 (cuDNN 5.1) and CUDA 10.0 (cuDNN 7.2)**. We highly recommend using those versions to minimize potential installation issues. Other versions should also work, but we do not provide support about any CUDA/cuDNN installation/compilation issue, as well as problems relate dto their integration into OpenPose.
38+
1. **Note: OpenPose has been tested extensively with CUDA 8.0 (cuDNN 5.1) and CUDA 10.0 (cuDNN 7.5)**. We highly recommend using those versions to minimize potential installation issues. Other versions should also work, but we do not provide support about any CUDA/cuDNN installation/compilation issue, as well as problems relate dto their integration into OpenPose.
3939
2. **CUDA**:
4040
- Ubuntu 14 or 16 ([**CUDA 8**](https://developer.nvidia.com/cuda-80-ga2-download-archive) **or 10**): Run `sudo ./scripts/ubuntu/install_cuda.sh` (if Ubuntu 16 or 14 and for Graphic cards up to 10XX) or alternatively download and install it from their website.
4141
- Ubuntu 18 ([**CUDA 10**](https://developer.nvidia.com/cuda-downloads)): Download the latest Nvidia CUDA version from their [official website](https://developer.nvidia.com/cuda-downloads).

examples/tutorial_api_python/06_face_from_image.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
params["model_folder"] = "../../../models/"
3737
params["face"] = True
3838
params["face_detector"] = 2
39-
params["body_disable"] = True
39+
params["body"] = 0
4040

4141
# Add others in path?
4242
for i in range(0, len(args[1])):

examples/tutorial_api_python/07_hand_from_image.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
params["model_folder"] = "../../../models/"
3737
params["hand"] = True
3838
params["hand_detector"] = 2
39-
params["body_disable"] = True
39+
params["body"] = 0
4040

4141
# Add others in path?
4242
for i in range(0, len(args[1])):

include/openpose/filestream/wCocoJsonSaver.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,8 @@ namespace op
6767
// T* to T
6868
const auto& tDatumPtr = tDatums->at(0);
6969
// Record json in COCO format
70-
spCocoJsonSaver->record(tDatumPtr->poseKeypoints, tDatumPtr->poseScores, tDatumPtr->name, tDatumPtr->frameNumber);
70+
spCocoJsonSaver->record(
71+
tDatumPtr->poseKeypoints, tDatumPtr->poseScores, tDatumPtr->name, tDatumPtr->frameNumber);
7172
// Profiling speed
7273
Profiler::timerEnd(profilerKey);
7374
Profiler::printAveragedTimeMsOnIterationX(profilerKey, __LINE__, __FUNCTION__, __FILE__);

src/openpose/3d/poseTriangulation.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -435,8 +435,10 @@ namespace op
435435
log("Unusual high re-projection error (averaged over #keypoints) of value "
436436
+ std::to_string(reprojectionErrorTotal) + " pixels, while the average for a good OpenPose"
437437
" detection from 4 cameras is about 2-3 pixels. It might be simply a wrong OpenPose"
438-
" detection. If this message appears very frequently, your calibration parameters"
439-
" might be wrong.", Priority::High);
438+
" detection. However, if this message appears very frequently, your calibration parameters"
439+
" might be wrong. Note: If you have introduced your own camera intrinsics, are they an"
440+
" upper triangular matrix (as specified in the OpenPose doc/modules/calibration_module.md"
441+
" and 3d_reconstruction_module.md)?", Priority::High);
440442
// log("Reprojection error: " + std::to_string(reprojectionErrorTotal)); // To debug reprojection error
441443
}
442444
}

src/openpose/filestream/cocoJsonSaver.cpp

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -100,19 +100,23 @@ namespace op
100100
imageId = getLastNumber(imageName);
101101
// Body
102102
if (numberBodyParts == 23)
103-
indexesInCocoOrder = std::vector<int>{0, 14,13,16,15, 4,1,5,2,6, 3,10,7,11, 8, 12, 9};
103+
indexesInCocoOrder = std::vector<int>{
104+
0, 14,13,16,15, 4,1,5,2,6, 3,10,7,11, 8, 12, 9};
104105
else if (numberBodyParts == 18)
105-
indexesInCocoOrder = std::vector<int>{0, 15,14,17,16, 5,2,6,3,7, 4,11,8,12, 9, 13,10};
106+
indexesInCocoOrder = std::vector<int>{
107+
0, 15,14,17,16, 5,2,6,3,7, 4,11,8,12, 9, 13,10};
106108
else if (mPoseModel == PoseModel::BODY_25B || mPoseModel == PoseModel::BODY_95
107109
|| mPoseModel == PoseModel::BODY_135)
108110
{
109111
indexesInCocoOrder = std::vector<int>(17);
110112
std::iota(indexesInCocoOrder.begin(), indexesInCocoOrder.end(), 0);
111113
}
112114
else if (numberBodyParts == 19 || numberBodyParts == 25 || numberBodyParts == 59)
113-
indexesInCocoOrder = std::vector<int>{0, 16,15,18,17, 5,2,6,3,7, 4,12,9,13,10, 14,11};
115+
indexesInCocoOrder = std::vector<int>{
116+
0, 16,15,18,17, 5,2,6,3,7, 4,12,9,13,10, 14,11};
114117
// else if (numberBodyParts == 23)
115-
// indexesInCocoOrder = std::vector<int>{18,21,19,22,20, 4,1,5,2,6, 3,13,8,14, 9, 15,10};
118+
// indexesInCocoOrder = std::vector<int>{
119+
// 18,21,19,22,20, 4,1,5,2,6, 3,13,8,14, 9, 15,10};
116120
}
117121
// Foot
118122
else if (cocoJsonFormat == CocoJsonFormat::Foot)
@@ -183,21 +187,17 @@ namespace op
183187
// Save on JSON file
184188
for (auto person = 0 ; person < numberPeople ; person++)
185189
{
186-
bool foundAtLeast1Keypoint = true;
187-
// Foot
188-
if (cocoJsonFormat == CocoJsonFormat::Foot)
190+
// At least 1 valid keypoint?
191+
// Reason: When saving any combination of Body + Foot + Face + Hand, the others might be empty
192+
bool foundAtLeast1Keypoint = false;
193+
for (auto bodyPart = 0u ; bodyPart < indexesInCocoOrder.size() ; bodyPart++)
189194
{
190-
// At least 1 valid keypoint?
191-
foundAtLeast1Keypoint = false;
192-
for (auto bodyPart = 0u ; bodyPart < indexesInCocoOrder.size() ; bodyPart++)
195+
const auto finalIndex = 3*(person*numberBodyParts + indexesInCocoOrder.at(bodyPart));
196+
const auto validPoint = (poseKeypoints[finalIndex+2] > 0.f);
197+
if (validPoint)
193198
{
194-
const auto finalIndex = 3*(person*numberBodyParts + indexesInCocoOrder.at(bodyPart));
195-
const auto validPoint = (poseKeypoints[finalIndex+2] > 0.f);
196-
if (validPoint)
197-
{
198-
foundAtLeast1Keypoint = true;
199-
break;
200-
}
199+
foundAtLeast1Keypoint = true;
200+
break;
201201
}
202202
}
203203

src/openpose/pose/poseParameters.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -483,9 +483,9 @@ namespace op
483483
254,255, 256,257, 258,259, 260,261, 262,263, 264,265, 266,267, 268,269, 270,271, 272,273, 274,275,
484484
276,277,
485485
// Outer-Inner + Inner Mouth
486-
278,279, 280,281, 282,283, 284,285, 286,287, 288,289, 290,291, 292,293, 294,295//,
487-
// // Eyes-Pupils
488-
// 296,297, 298,299, 300,301, 302,303
486+
278,279, 280,281, 282,283, 284,285, 286,287, 288,289, 290,291, 292,293, 294,295,
487+
// Eyes-Pupils
488+
296,297, 298,299, 300,301, 302,303
489489
},
490490
};
491491
// POSE_BODY_PART_MAPPING on HPP crashes on Windows at dynamic initialization if it's on hpp
@@ -699,9 +699,9 @@ namespace op
699699
F135+54,F135+55, F135+55,F135+56, F135+56,F135+57, F135+57,F135+58, F135+58,F135+59,
700700
// Outer-Inner + Inner Mouth
701701
F135+48,F135+60, F135+54,F135+64, F135+60,F135+61, F135+61,F135+62, F135+62,F135+63, F135+63,F135+64, F135+64,F135+65,
702-
F135+65,F135+66, F135+66,F135+67//,
703-
// // Eyes-Pupils
704-
// F135+36,F135+68, F135+39,F135+68, F135+42,F135+69, F135+45,F135+69
702+
F135+65,F135+66, F135+66,F135+67,
703+
// Eyes-Pupils
704+
F135+36,F135+68, F135+39,F135+68, F135+42,F135+69, F135+45,F135+69
705705
}
706706
};
707707

0 commit comments

Comments
 (0)