YeP*_*IcK 26 webcam opencv tracking gesture-recognition human-interface
我正在尝试使用常规网络摄像头确定骨架关节(或者至少能够跟踪单个手掌).我在网上看了一遍,似乎无法找到办法.
我发现的每个例子都是使用Kinect.我想使用一个网络摄像头.
我不需要计算关节的深度 - 我只需要能够识别它们在框架中的X,Y位置.这就是我使用网络摄像头而不是Kinect的原因.
到目前为止,我已经看过了:
我正在寻找一个C/C++库(但此时会查看任何其他语言),最好是开源(但同样,会考虑任何许可),可以执行以下操作:
如果有人可以帮我解决这个问题,我将非常感激.我已经被困在这几天了,没有明确的道路可以继续.
UPDATE
2年后,找到了一个解决方案:http://dlib.net/imaging.html#shape_predictor
Pal*_*rom 19
使用没有深度信息的单个摄像机跟踪手是一项严肃的任务和正在进行的科学工作的主题.我可以为您提供一系列有趣和/或被高度引用的关于该主题的科学论文:
第二章手部跟踪文献调查:
不幸的是,我不知道一些免费提供的手部跟踪库.
有一种简单的方法来检测使用肤色的手.也许这可以帮助...你可以在这个YouTube 视频上看到结果.警告:背景不应包含像木头一样的肤色.
这是代码:
''' Detect human skin tone and draw a boundary around it.
Useful for gesture recognition and motion tracking.
Inspired by: http://stackoverflow.com/a/14756351/1463143
Date: 08 June 2013
'''
# Required moduls
import cv2
import numpy
# Constants for finding range of skin color in YCrCb
min_YCrCb = numpy.array([0,133,77],numpy.uint8)
max_YCrCb = numpy.array([255,173,127],numpy.uint8)
# Create a window to display the camera feed
cv2.namedWindow('Camera Output')
# Get pointer to video frames from primary device
videoFrame = cv2.VideoCapture(0)
# Process the video frames
keyPressed = -1 # -1 indicates no key pressed
while(keyPressed < 0): # any key pressed has a value >= 0
# Grab video frame, decode it and return next video frame
readSucsess, sourceImage = videoFrame.read()
# Convert image to YCrCb
imageYCrCb = cv2.cvtColor(sourceImage,cv2.COLOR_BGR2YCR_CB)
# Find region with skin tone in YCrCb image
skinRegion = cv2.inRange(imageYCrCb,min_YCrCb,max_YCrCb)
# Do contour detection on skin region
contours, hierarchy = cv2.findContours(skinRegion, cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE)
# Draw the contour on the source image
for i, c in enumerate(contours):
area = cv2.contourArea(c)
if area > 1000:
cv2.drawContours(sourceImage, contours, i, (0, 255, 0), 3)
# Display the source image
cv2.imshow('Camera Output',sourceImage)
# Check for user input to close program
keyPressed = cv2.waitKey(1) # wait 1 milisecond in each iteration of while loop
# Close window and camera after exiting the while loop
cv2.destroyWindow('Camera Output')
videoFrame.release()
Run Code Online (Sandbox Code Playgroud)
cv2.findContour非常有用,你可以在找到轮廓后使用cv2.moments找到"blob"的质心.看一下有关形状描述符的opencv文档.
我还没弄明白如何制作位于轮廓中间的骷髅,但我想要"蚀刻"轮廓,直到它是一条线.在图像处理过程中,该过程称为"骨架化"或"形态骨架".这里有一些关于骨架化的基本信息.
这是一个在opencv和c ++中实现骨架化的链接
这是opencv和python中骨架化的链接
希望有帮助:)
---编辑----
我强烈建议您阅读Deva Ramanan的这些文章(访问链接页面后向下滚动):http://www.ics.uci.edu/~dramanan/