Openpose: How can i access Kinect v2 camera as webcam for openPose?

Created on 5 Aug 2017  ·  12Comments  ·  Source: CMU-Perceptual-Computing-Lab/openpose

I am trying to use Kinect v2 camera to capture the frames but when i'm changing the value from -1 to 1 at "DEFINE_int32(camera,-1,.... ) " then i am getting exception as "+errorMessageToPropagate"\nError:\nVideoCapture (webcam) could not be opened.\n\nComing from:\n- ..\..\src\openpose\producer\videoCaptureReader.cpp:op::VideoCaptureReader::VideoCaptureReader():16\n- ..\..\src\openpose\producer\vide...std::basic_string,std::allocator >"
Can anyone suggest me with any other way to change the webcam and use Kinect v2 camera as primary camera.
Any help will be appreciated.

Regards,
Anizzz

help wantequestion

All 12 comments

Hello @Anikzzz, which operating system are you using? And have you checked the permissions to the webcam? Maybe try opening it with VLC to also check the index of the RGB vs. Depth source.

I am using windows 10 os and yaa i gave permission for the kinect camera.
But still i am unable to use kinect as webcam. I tried in VLC as well but
it is not showing there as well .. i did the KinectCam.ax registered to my
pc but still I'm not able to view.

Thanks & Regards,
Anikzzz

On 8 Aug 2017 10:17 a.m., "Timothy Callemein" notifications@github.com
wrote:

Hello @Anikzzz https://github.com/anikzzz, which operating system are
you using? And have you checked the permissions to the webcam? Maybe try
opening it with VLC to also check the index of the RGB vs. Depth source.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/CMU-Perceptual-Computing-Lab/openpose/issues/189#issuecomment-320849019,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AdUiFC0u3UKLF98TFAFsgiXe-naPdFn8ks5sV-h3gaJpZM4OuY_p
.

@Anikzzz Unfortunately I'm not a Windows user and can't really offer support on that. Though I think you first need to make sure you are able to open the Kinect apart from using OpenPose. Maybe a basic webcam application in python to check if OpenCV can handle your camera and your drivers are installed correctly.

For example -> http://docs.opencv.org/3.3.0/dd/d43/tutorial_py_video_display.html

1.write independent project to record the color & depth image as 'jpg/png/or ...' by kinect v2.0;
2.read the 'jpg/png/or...' (from kinect v2.0) by openpose 'cmd' demand ..... windows\x64\Release\OpenPoseDemo.exe --face --hand....
in other words ,only change the image input of the openpose ,ok.

e.g...you need make two parallel projs:
---1--->looping record kinectcolor.jpg by kinect2.0 ---> each time rename it as 'newimage.jpg' ---1-->......
---2-->if openpose cmd demand detect 'newimage.jpg' existed ----->read 'newimage.jpg' then process and display(or record the keypoints from hand face body) -----> remove 'newimage.jpg'!--->looping process> ---2--> ---2--> ---2--> ---2--> ---2--> ---2-->............

@andudu
The initialization of openpose takes time. In step 2, inside the loop, everytime you do process, openpose is initialized every time as well. Thus it will make the time longer...

@rongfeng-china
that's right!
The speed is influenced.
But anyway It works as your hope ..... haha

i have finally figured how i can access kinect2.0 with openpose. With windows 10 Anniversary update they have added a feature for kinect 2.0 and all i had to do was update the driver for "kinect sensor device" from "disk management" and change "DEFINE_int32(camera, -1, " to "DEFINE_int32(camera, 2, " in "openposeDemo.cpp" file and now its working quiet well. and the FPS is increased from 1.2 to 4.6 also.

@aniketzz great!
fast & perfect way!

@aniketzz Thanks! Added your instructions to doc/demo_overview.md.

@callemein Can you tell me how can i access kinect 2.0 in ubuntu16.04?

I’ve only used a ROS implementation of the Kinect (360 and One), try looking op OpenNI that library allows you to use the Kinect. Maybe in combination with the OpenPose implementation in ROS?

Was this page helpful?
0 / 5 - 0 ratings