提交 49939503 编写于 作者: G gineshidalgo99

Fixed webcam resolution bug

上级 05a05730
......@@ -188,6 +188,7 @@ OpenPose Library - Release Notes
16. 3-D reconstruction module can be implemented with different camera brands or custom image sources.
17. Flag `--write_json` includes 3-D keypoints.
18. Flag `--image_dir_stereo` added to allow `--image_dir` to load stereo images.
19. Flag `--camera_resolution` applicable to `--flir_camera`.
2. Functions or parameters renamed:
1. Flag `no_display` renamed as `display`, able to select between `NoDisplay`, `Display2D`, `Display3D`, and `DisplayAll`.
2. 3-D reconstruction demo is now inside the OpenPose demo binary.
......
......@@ -269,7 +269,7 @@ int openPoseDemo()
const op::WrapperStructPose wrapperStructPose{!FLAGS_body_disable, netInputSize, outputSize, keypointScale,
FLAGS_num_gpu, FLAGS_num_gpu_start, FLAGS_scale_number,
(float)FLAGS_scale_gap,
op::flagsToRenderMode(FLAGS_render_pose, FLAGS_3d, FLAGS_render_pose),
op::flagsToRenderMode(FLAGS_render_pose, FLAGS_3d),
poseModel, !FLAGS_disable_blending, (float)FLAGS_alpha_pose,
(float)FLAGS_alpha_heatmap, FLAGS_part_to_show, FLAGS_model_folder,
heatMapTypes, heatMapScale, FLAGS_part_candidates,
......
......@@ -270,7 +270,7 @@ int openPoseTutorialWrapper4()
// Pose configuration (use WrapperStructPose{} for default and recommended configuration)
const op::WrapperStructPose wrapperStructPose{!FLAGS_body_disable, netInputSize, outputSize, keypointScale,
FLAGS_num_gpu, FLAGS_num_gpu_start, FLAGS_scale_number,
(float)FLAGS_scale_gap, op::flagsToRenderMode(FLAGS_render_pose),
(float)FLAGS_scale_gap, op::flagsToRenderMode(FLAGS_render_pose, FLAGS_3d),
poseModel, !FLAGS_disable_blending, (float)FLAGS_alpha_pose,
(float)FLAGS_alpha_heatmap, FLAGS_part_to_show, FLAGS_model_folder,
heatMapTypes, heatMapScale, FLAGS_part_candidates,
......@@ -278,13 +278,13 @@ int openPoseTutorialWrapper4()
enableGoogleLogging, FLAGS_3d};
// Face configuration (use op::WrapperStructFace{} to disable it)
const op::WrapperStructFace wrapperStructFace{FLAGS_face, faceNetInputSize,
op::flagsToRenderMode(FLAGS_face_render, FLAGS_render_pose),
op::flagsToRenderMode(FLAGS_face_render, FLAGS_3d, 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),
op::flagsToRenderMode(FLAGS_hand_render, FLAGS_3d, FLAGS_render_pose),
(float)FLAGS_hand_alpha_pose, (float)FLAGS_hand_alpha_heatmap,
(float)FLAGS_hand_render_threshold};
// Producer (use default to disable any input)
......
......@@ -345,7 +345,7 @@ int openPoseTutorialWrapper1()
// Pose configuration (use WrapperStructPose{} for default and recommended configuration)
const op::WrapperStructPose wrapperStructPose{!FLAGS_body_disable, netInputSize, outputSize, keypointScale,
FLAGS_num_gpu, FLAGS_num_gpu_start, FLAGS_scale_number,
(float)FLAGS_scale_gap, op::flagsToRenderMode(FLAGS_render_pose),
(float)FLAGS_scale_gap, op::flagsToRenderMode(FLAGS_render_pose, FLAGS_3d),
poseModel, !FLAGS_disable_blending, (float)FLAGS_alpha_pose,
(float)FLAGS_alpha_heatmap, FLAGS_part_to_show, FLAGS_model_folder,
heatMapTypes, heatMapScale, FLAGS_part_candidates,
......@@ -353,13 +353,13 @@ int openPoseTutorialWrapper1()
enableGoogleLogging, FLAGS_3d};
// Face configuration (use op::WrapperStructFace{} to disable it)
const op::WrapperStructFace wrapperStructFace{FLAGS_face, faceNetInputSize,
op::flagsToRenderMode(FLAGS_face_render, FLAGS_render_pose),
op::flagsToRenderMode(FLAGS_face_render, FLAGS_3d, 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),
op::flagsToRenderMode(FLAGS_hand_render, FLAGS_3d, FLAGS_render_pose),
(float)FLAGS_hand_alpha_pose, (float)FLAGS_hand_alpha_heatmap,
(float)FLAGS_hand_render_threshold};
// Producer (use default to disable any input)
......
......@@ -431,7 +431,7 @@ int openPoseTutorialWrapper2()
op::log("Configuring OpenPose wrapper.", op::Priority::Low, __LINE__, __FUNCTION__, __FILE__);
const op::WrapperStructPose wrapperStructPose{!FLAGS_body_disable, netInputSize, outputSize, keypointScale,
FLAGS_num_gpu, FLAGS_num_gpu_start, FLAGS_scale_number,
(float)FLAGS_scale_gap, op::flagsToRenderMode(FLAGS_render_pose),
(float)FLAGS_scale_gap, op::flagsToRenderMode(FLAGS_render_pose, FLAGS_3d),
poseModel, !FLAGS_disable_blending, (float)FLAGS_alpha_pose,
(float)FLAGS_alpha_heatmap, FLAGS_part_to_show, FLAGS_model_folder,
heatMapTypes, heatMapScale, FLAGS_part_candidates,
......@@ -439,13 +439,13 @@ int openPoseTutorialWrapper2()
enableGoogleLogging, FLAGS_3d};
// Face configuration (use op::WrapperStructFace{} to disable it)
const op::WrapperStructFace wrapperStructFace{FLAGS_face, faceNetInputSize,
op::flagsToRenderMode(FLAGS_face_render, FLAGS_render_pose),
op::flagsToRenderMode(FLAGS_face_render, FLAGS_3d, 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),
op::flagsToRenderMode(FLAGS_hand_render, FLAGS_3d, 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)
......
......@@ -372,7 +372,7 @@ int openPoseTutorialWrapper3()
// Pose configuration (use WrapperStructPose{} for default and recommended configuration)
const op::WrapperStructPose wrapperStructPose{!FLAGS_body_disable, netInputSize, outputSize, keypointScale,
FLAGS_num_gpu, FLAGS_num_gpu_start, FLAGS_scale_number,
(float)FLAGS_scale_gap, op::flagsToRenderMode(FLAGS_render_pose),
(float)FLAGS_scale_gap, op::flagsToRenderMode(FLAGS_render_pose, FLAGS_3d),
poseModel, !FLAGS_disable_blending, (float)FLAGS_alpha_pose,
(float)FLAGS_alpha_heatmap, FLAGS_part_to_show, FLAGS_model_folder,
heatMapTypes, heatMapScale, FLAGS_part_candidates,
......@@ -380,13 +380,13 @@ int openPoseTutorialWrapper3()
enableGoogleLogging, FLAGS_3d};
// Face configuration (use op::WrapperStructFace{} to disable it)
const op::WrapperStructFace wrapperStructFace{FLAGS_face, faceNetInputSize,
op::flagsToRenderMode(FLAGS_face_render, FLAGS_render_pose),
op::flagsToRenderMode(FLAGS_face_render, FLAGS_3d, 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),
op::flagsToRenderMode(FLAGS_hand_render, FLAGS_3d, 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)
......
......@@ -156,14 +156,16 @@ namespace op
if (type == ProducerType::FlirCamera)
{
// cameraFrameSize
const auto cameraFrameSize = op::flagsToPoint(cameraResolution, "-1x-1");
const auto cameraFrameSize = flagsToPoint(cameraResolution, "-1x-1");
return std::make_shared<FlirReader>(cameraParameterPath, cameraFrameSize);
}
// Webcam
if (type == ProducerType::Webcam)
{
// cameraFrameSize
const auto cameraFrameSize = op::flagsToPoint(cameraResolution, "1280x720");
auto cameraFrameSize = flagsToPoint(cameraResolution, "1280x720");
if (cameraFrameSize.x < 0 || cameraFrameSize.y < 0)
cameraFrameSize = Point<int>{1280,720};
if (webcamIndex >= 0)
{
const auto throwExceptionIfNoOpened = true;
......@@ -235,7 +237,7 @@ namespace op
}
// Face and hand: to pick same than body
else if (renderFlag == -1 && renderPoseFlag != -2)
return flagsToRenderMode(renderPoseFlag, -2);
return flagsToRenderMode(renderPoseFlag, gpuBuggy, -2);
// No render
else if (renderFlag == 0)
return RenderMode::None;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册