openpose icon indicating copy to clipboard operation
openpose copied to clipboard

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

Open Anikzzz opened this issue 9 years ago • 12 comments

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<char,std::char_traits,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

Anikzzz avatar Aug 05 '17 07:08 Anikzzz

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.

callemein avatar Aug 08 '17 04:08 callemein

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" [email protected] 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 avatar Aug 08 '17 06:08 Anikzzz

@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

callemein avatar Aug 08 '17 15:08 callemein

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.

andudu avatar Aug 29 '17 09:08 andudu

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 avatar Aug 29 '17 09:08 andudu

@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 avatar Oct 17 '17 23:10 rongfeng-china

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

andudu avatar Oct 18 '17 00:10 andudu

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 avatar Nov 01 '17 07:11 aniketzz

@aniketzz great! fast & perfect way!

andudu avatar Nov 01 '17 07:11 andudu

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

gineshidalgo99 avatar Nov 03 '17 20:11 gineshidalgo99

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

ilovebob avatar Mar 07 '18 11:03 ilovebob

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?

callemein avatar Mar 07 '18 18:03 callemein