Skip to content

Commit 185ead4

Browse files
Flag process_real_time threw error with webcam
1 parent 5d8dcd5 commit 185ead4

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

doc/release_notes.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,5 @@ OpenPose Library - Release Notes
4141
3. Main bugs fixed:
4242
1. All visualization functions moved to same thread, so it works with most OpenCV custom compiled versions.
4343
2. Fixed error on debug mode: `Too many resources requested for launch`.
44+
3. Bug in Array::getConstCvMat() if mVolume=0, now returning empty cv::Mat.
45+
4. Bug: `--process_real_time` threw error with webcam.

src/openpose/producer/producer.cpp

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,16 @@ namespace op
6767
try
6868
{
6969
check(fpsMode == ProducerFpsMode::RetrievalFps || fpsMode == ProducerFpsMode::OriginalFps, "Unknown ProducerFpsMode.", __LINE__, __FUNCTION__, __FILE__);
70-
check(fpsMode != ProducerFpsMode::OriginalFps || get(CV_CAP_PROP_FPS) > 0,
71-
"Selected to keep the source fps but get(CV_CAP_PROP_FPS) <= 0, i.e. the source did not set its fps property.", __LINE__, __FUNCTION__, __FILE__);
72-
73-
mProducerFpsMode = {fpsMode};
70+
// For webcam, ProducerFpsMode::OriginalFps == ProducerFpsMode::RetrievalFps, since the internal webcam cache will overwrite frames after it gets full
71+
if (mType == ProducerType::Webcam)
72+
mProducerFpsMode = {ProducerFpsMode::RetrievalFps};
73+
// If no webcam
74+
else
75+
{
76+
check(fpsMode == ProducerFpsMode::RetrievalFps || get(CV_CAP_PROP_FPS) > 0,
77+
"Selected to keep the source fps but get(CV_CAP_PROP_FPS) <= 0, i.e. the source did not set its fps property.", __LINE__, __FUNCTION__, __FILE__);
78+
mProducerFpsMode = {fpsMode};
79+
}
7480
reset(mNumberEmptyFrames, mTrackingFps);
7581
}
7682
catch (const std::exception& e)

0 commit comments

Comments
 (0)