CMU-Perceptual-Computing-Lab / openpose

OpenPose: Real-time multi-person keypoint detection library for body, face, hands, and foot estimation
https://cmu-perceptual-computing-lab.github.io/openpose
Other
30.68k stars 7.82k forks source link

Unable to locate webcam and/or FLIR cameras (CPU version) #517

Closed vism2889 closed 6 years ago

vism2889 commented 6 years ago

Issue Summary

Trying to get openpose running with Linux mint 18.3, am not a terribly savvy linux user. To the best of my knowledge i have gotten this built the app is unable to locate a camera. I would also like to confirm that i am indeed able to run this without a GPU?

Executed Command (if any)

'./build/examples/openpose/openpose.bin --face --hand'

Terminal Output

Starting pose estimation demo.
OpenCV Error: Unspecified error (GStreamer: unable to start pipeline
) in cvCaptureFromCAM_GStreamer, file /home/morgan/opencv-3.4.0/modules/videoio/src/cap_gstreamer.cpp, line 890
VIDEOIO(cvCreateCapture_GStreamer(CV_CAP_GSTREAMER_V4L2, reinterpret_cast<char *>(index))): raised OpenCV exception:

/home/morgan/opencv-3.4.0/modules/videoio/src/cap_gstreamer.cpp:890: error: (-2) GStreamer: unable to start pipeline
 in function cvCaptureFromCAM_GStreamer

OpenCV Error: Unspecified error (GStreamer: unable to start pipeline
) in cvCaptureFromCAM_GStreamer, file /home/morgan/opencv-3.4.0/modules/videoio/src/cap_gstreamer.cpp, line 890
VIDEOIO(cvCreateCapture_GStreamer(CV_CAP_GSTREAMER_V4L2, reinterpret_cast<char *>(index))): raised OpenCV exception:

/home/morgan/opencv-3.4.0/modules/videoio/src/cap_gstreamer.cpp:890: error: (-2) GStreamer: unable to start pipeline
 in function cvCaptureFromCAM_GStreamer

OpenCV Error: Unspecified error (GStreamer: unable to start pipeline
) in cvCaptureFromCAM_GStreamer, file /home/morgan/opencv-3.4.0/modules/videoio/src/cap_gstreamer.cpp, line 890
VIDEOIO(cvCreateCapture_GStreamer(CV_CAP_GSTREAMER_V4L2, reinterpret_cast<char *>(index))): raised OpenCV exception:

/home/morgan/opencv-3.4.0/modules/videoio/src/cap_gstreamer.cpp:890: error: (-2) GStreamer: unable to start pipeline
 in function cvCaptureFromCAM_GStreamer

OpenCV Error: Unspecified error (GStreamer: unable to start pipeline
) in cvCaptureFromCAM_GStreamer, file /home/morgan/opencv-3.4.0/modules/videoio/src/cap_gstreamer.cpp, line 890
VIDEOIO(cvCreateCapture_GStreamer(CV_CAP_GSTREAMER_V4L2, reinterpret_cast<char *>(index))): raised OpenCV exception:

/home/morgan/opencv-3.4.0/modules/videoio/src/cap_gstreamer.cpp:890: error: (-2) GStreamer: unable to start pipeline
 in function cvCaptureFromCAM_GStreamer

OpenCV Error: Unspecified error (GStreamer: unable to start pipeline
) in cvCaptureFromCAM_GStreamer, file /home/morgan/opencv-3.4.0/modules/videoio/src/cap_gstreamer.cpp, line 890
VIDEOIO(cvCreateCapture_GStreamer(CV_CAP_GSTREAMER_V4L2, reinterpret_cast<char *>(index))): raised OpenCV exception:

/home/morgan/opencv-3.4.0/modules/videoio/src/cap_gstreamer.cpp:890: error: (-2) GStreamer: unable to start pipeline
 in function cvCaptureFromCAM_GStreamer

OpenCV Error: Unspecified error (GStreamer: unable to start pipeline
) in cvCaptureFromCAM_GStreamer, file /home/morgan/opencv-3.4.0/modules/videoio/src/cap_gstreamer.cpp, line 890
VIDEOIO(cvCreateCapture_GStreamer(CV_CAP_GSTREAMER_V4L2, reinterpret_cast<char *>(index))): raised OpenCV exception:

/home/morgan/opencv-3.4.0/modules/videoio/src/cap_gstreamer.cpp:890: error: (-2) GStreamer: unable to start pipeline
 in function cvCaptureFromCAM_GStreamer

OpenCV Error: Unspecified error (GStreamer: unable to start pipeline
) in cvCaptureFromCAM_GStreamer, file /home/morgan/opencv-3.4.0/modules/videoio/src/cap_gstreamer.cpp, line 890
VIDEOIO(cvCreateCapture_GStreamer(CV_CAP_GSTREAMER_V4L2, reinterpret_cast<char *>(index))): raised OpenCV exception:

/home/morgan/opencv-3.4.0/modules/videoio/src/cap_gstreamer.cpp:890: error: (-2) GStreamer: unable to start pipeline
 in function cvCaptureFromCAM_GStreamer

OpenCV Error: Unspecified error (GStreamer: unable to start pipeline
) in cvCaptureFromCAM_GStreamer, file /home/morgan/opencv-3.4.0/modules/videoio/src/cap_gstreamer.cpp, line 890
VIDEOIO(cvCreateCapture_GStreamer(CV_CAP_GSTREAMER_V4L2, reinterpret_cast<char *>(index))): raised OpenCV exception:

/home/morgan/opencv-3.4.0/modules/videoio/src/cap_gstreamer.cpp:890: error: (-2) GStreamer: unable to start pipeline
 in function cvCaptureFromCAM_GStreamer

OpenCV Error: Unspecified error (GStreamer: unable to start pipeline
) in cvCaptureFromCAM_GStreamer, file /home/morgan/opencv-3.4.0/modules/videoio/src/cap_gstreamer.cpp, line 890
VIDEOIO(cvCreateCapture_GStreamer(CV_CAP_GSTREAMER_V4L2, reinterpret_cast<char *>(index))): raised OpenCV exception:

/home/morgan/opencv-3.4.0/modules/videoio/src/cap_gstreamer.cpp:890: error: (-2) GStreamer: unable to start pipeline
 in function cvCaptureFromCAM_GStreamer

OpenCV Error: Unspecified error (GStreamer: unable to start pipeline
) in cvCaptureFromCAM_GStreamer, file /home/morgan/opencv-3.4.0/modules/videoio/src/cap_gstreamer.cpp, line 890
VIDEOIO(cvCreateCapture_GStreamer(CV_CAP_GSTREAMER_V4L2, reinterpret_cast<char *>(index))): raised OpenCV exception:

/home/morgan/opencv-3.4.0/modules/videoio/src/cap_gstreamer.cpp:890: error: (-2) GStreamer: unable to start pipeline
 in function cvCaptureFromCAM_GStreamer

Error:
No camera found.

Coming from:
- /home/morgan/openpose/src/openpose/utilities/flagsToOpenPose.cpp:flagsToProducer():194
- /home/morgan/openpose/src/openpose/utilities/flagsToOpenPose.cpp:flagsToProducer():203
terminate called after throwing an instance of 'std::runtime_error'
  what():  
Error:
No camera found.

Coming from:
- /home/morgan/openpose/src/openpose/utilities/flagsToOpenPose.cpp:flagsToProducer():194
- /home/morgan/openpose/src/openpose/utilities/flagsToOpenPose.cpp:flagsToProducer():203

[1]    7615 abort      ./build/examples/openpose/openpose.bin --face --hand

Type of Issue

-Question regarding CPU version (just confirming the obvious) but i do NOT need a gpu to get this working? -Hopefully if it is correct that i do not need a GPU then i believe i have built everything properly but am having an issue regarding a camera being detected. (i followed the linked 'Running on Webcam' guide)

Your System Configuration

Operating system Linux Mint 18.3 Installation mode: CMake CUDA version (cat /usr/local/cuda/version.txt in most cases): cuDNN version: CMake version: 3.5.1 Release or Debug mode? (by defualt: release): 3-D Reconstruction module added: no GPU model : No GPU Caffe version: Default from OpenPose OpenCV version: pre-compiled apt-get install libopencv-dev (only Ubuntu) Compiler : (Ubuntu 5.4.0-6ubuntu1~16.04.6) 5.4.0 20160609

gineshidalgo99 commented 6 years ago

Make sure you can open your webcam with a basic OpenCV program (we simply use OpenCV to read it). If you followed the CPU installation instructions, yes, it should run in CPU (but not the default OpenPose).

vism2889 commented 6 years ago
--   Debug CXX flags         :   -g -fopenmp -DMKL2017_SUPPORTED -DUSE_MKL2017_AS_DEFAULT_ENGINE -DMKLDNN_SUPPORTED -std=c++11 -DUSE_MKLDNN_AS_DEFAULT_ENGINE -fPIE -fstack-protector-strong -DENABLE_SGD_FUSION -fPIC -fno-operator-names -Wformat -Wformat-security -Wall -std=c++11 -Wno-sign-compare -Wno-uninitialized
--   Build type              :   Release
-- 
--   BUILD_SHARED_LIBS       :   on
--   BUILD_python            :   OFF
--   BUILD_matlab            :   OFF
--   BUILD_docs              :   OFF
--   CPU_ONLY                :   ON
--   USE_OPENMP              :   ON
--   USE_OPENCV              :   OFF
--   USE_LEVELDB             :   OFF
--   USE_LMDB                :   OFF
--   ALLOW_LMDB_NOLOCK       :   OFF
--   USE_SYSTEMTAP           :   OFF
--   PERFORMANCE_MONITORING  :   OFF

@gineshidalgo99 Looking back at the output during the build i came across this list of DEBUG flags, mainly noticed the USE_OPENCV option is set to off. Guess i'm not sure if that is relevant. I also have opencv working with examples and other code, but in python separate from this build; should i try running examples using C++ interface, or does this terminal output indicate that opecv was left out of the build or 'connected' to it incorrectly ? Thanks for your time and insight, its much appreciated.

gineshidalgo99 commented 6 years ago

USE_OPENCV is not an OpenPose flag, actually most of those flags are not OpenPose flags, I think they're Caffe flags (so it's irrelevant).

I think so, you should try C++ OpenCV examples, as we simply use that.

vasavig commented 6 years ago

@vism2889 Were you able to solve this issue or find the root cause of the problem? I am facing similar detection problem with recognizing stereo cameras (used by the 3D module). Please let me know your findings. It might help me solve my issue.

gineshidalgo99 commented 6 years ago

@vasavig FLIR cameras are completely unrelated to OpenCV and its webcam/video/image reader. The solutions to each problem will be completely independent to each other.

vasavig commented 6 years ago

@gineshidalgo99 I thought maybe the application was unable to detect the hardware devices connected to the computer. But yeah, I understand that the way FLIR cameras are detected is different from how a webcam is detected. The FLIR cameras got detected after I plugged them into a dedicated USB ports.

gineshidalgo99 commented 6 years ago

Thanks for the feed-back, I understand then it's now closed. Best