ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

How to do real time hand detection on Kinect V2/ROS

asked 2018-01-18 07:41:18 -0600

hassanyf gravatar image

I am very new to Kinect V2 and ROS Indigo. I have installed libfreenect2 and iai_kinect2 from the GitHub pages. After running rostopic list I get a list of topics published by Kinect. I wrote a small code so that it subscribes to a specific topic and displays the camera i.e image_mono

file.py:

#!/usr/bin/python

import roslib
import rospy
import cv2
import sys
from std_msgs.msg import String
from sensor_msgs.msg import Image
from cv_bridge import CvBridge, CvBridgeError

class PositionTracker:

    def __init__(self):
        # subscribe to kinect image messages
        self.sub = rospy.Subscriber("kinect2/qhd/image_mono", Image, self.image_callback, queue_size=1)
        self.bridge = CvBridge()

    def image_callback(self,data):
        try:
            cv_image = self.bridge.imgmsg_to_cv2(data)
        except CvBridgeError as e:
            print(e)
        cv2.imshow("Image window", cv_image)
        cv2.waitKey(3)

def main(args):
    ic = PositionTracker()
    rospy.init_node('kinect_tracker')
    try:
        rospy.spin()
    except KeyboardInterrupt:
        print("Shutting down")
    cv2.destroyAllWindows()

if __name__ == '__main__':
    main(sys.argv)

How do I perform real time hand detection and save data sets to a folder with the camera that was opened.

If I type, rostopic echo /kinect2/qhd/image_mono, it gives a 1D array. Any resource/tutorial will be really helpful.

edit retag flag offensive close merge delete

Comments

Hand detection from RGB-D data is still an active area of research. This is a non-trivial question!

PeteBlackerThe3rd gravatar image PeteBlackerThe3rd  ( 2018-01-19 08:48:14 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2018-01-20 10:25:07 -0600

dasanche gravatar image

updated 2018-01-20 12:08:57 -0600

jayess gravatar image

Hello,

For real time hand pose detection I'd take a look at this code. It performs humand body (including hand) body tracking in real time. The software is based on the detection of keypoints on single images.

It has a C++ wrapper, so it is posible to used it with ROS, and it provides several different outputs.

https://github.com/CMU-Perceptual-Com...

Best, David

edit flag offensive delete link more

Comments

Can you please provide more details about why they should take a look at it?

jayess gravatar image jayess  ( 2018-01-20 11:21:06 -0600 )edit

Because that code performs humand body (including hand) body tracking in real time. The software is based on the detection of keypoints on single images.

It has a C++ wrapper, so it is posible to used it with ROS, and it provides several different outputs.

dasanche gravatar image dasanche  ( 2018-01-20 11:38:32 -0600 )edit

Question Tools

Stats

Asked: 2018-01-18 07:41:18 -0600

Seen: 806 times

Last updated: Jan 20 '18