简体   繁体   English

OpenCV检测手和比较图像

[英]OpenCV detect hand and comparison images

Purpose of my application is to take a photo hand (gesture) and comparing it with a picture that is in the database. 我的应用程序的目的是拍张照片(手势)并将其与数据库中的图片进行比较。 The first option I was use is background subtraction on images: 我使用的第一个选项是图像的背景减法:

http://docs.opencv.org/trunk/doc/tutorials/video/background_subtraction/background_subtraction.html . http://docs.opencv.org/trunk/doc/tutorials/video/background_subtraction/background_subtraction.html

The solution works, but sometimes, depending on the first picture is not properly cut hand. 该解决方案有效,但有时,取决于第一张图片的切割手是否正确。

The second option is to detect skin color: http://bytefish.de/blog/opencv/skin_color_thresholding/ 第二个选项是检测肤色: http : //bytefish.de/blog/opencv/skin_color_thresholding/

Or is it better to use a hand detection based on xml files? 还是使用基于xml文件的手动检测更好? To compare the images I wanted to use this method: http://docs.opencv.org/doc/tutorials/imgproc/histograms/histogram_comparison/histogram_comparison.html 要比较我想使用此方法的图像: http : //docs.opencv.org/doc/tutorials/imgproc/histograms/histogram_comparison/histogram_comparison.html

Let me remind you that I'm talking about comparing the images to which they are gestures. 让我提醒您,我正在谈论将它们作为手势的图像进行比较。 I also read about the possibility of making the histogram is not the entire image only on the subject of the photo and then the data is more reliable, but do not know how to do it. 我还读到了使直方图不只是照片主题上的整个图像的可能性,然后数据更可靠,但不知道如何做。

I want to compare the gesture as a single image, I do not mean here with the sequences. 我想将手势作为单个图像进行比较,在这里我不是要与序列进行比较。 1 picture for comparison with the baseline. 1张图片与基线进行比较。 Gesture detection is to enable someone eg. 手势检测是为了使某人例如。 Will ring, and now I will have for example. 会响,现在我举个例子。 5 seconds to take pictures and compare them with the base because I'm not certain if appeared in the lens of the hand or not. 5秒钟拍照并与底座进行比较,因为我不确定是否出现在手部镜头中。 Unless there is another solution. 除非有其他解决方案。

Ultimately, it is to be a comparison of two images in which there will be some hand gestures. 最终,它将是两个图像的比较,其中会有一些手势。

If your goal is to perform gesture recognition, you should take into account that gestures are sequence of images. 如果您的目标是执行手势识别,则应考虑到手势是图像序列。 Thus, if you want to compare gesture you'll have to find a "smart" way to compare the whole sequences, and not single images, because one frame can belong to different gestures. 因此,如果您要比较手势,则必须找到一种“智能”方式来比较整个序列,而不是单个图像,因为一帧可以属于不同的手势。

State of the art approaches for gesture recognition involves the extraction of the Optical Flow between two consecutive frames and then compute the histogram of optical flow (HOF). 用于手势识别的最新方法涉及提取两个连续帧之间的光流,然后计算光流直方图(HOF)。 Having computed the histograms for all the frame pair in the video sequence, you can use different strategies to compare gestures: 计算完视频序列中所有帧对的直方图后,您可以使用不同的策略来比较手势:

  • You can concatenate all the HOF in the sequence and then perform histogram intersection to compare the two sequences 您可以连接序列中的所有HOF,然后执行直方图相交以比较两个序列
  • You can use the Bag of Word paradigm to create a representation of the HOF 您可以使用Word Bag范式创建HOF的表示形式

Here there are some pointers to this strateies: 这里有一些指向这些策略的指针:

  • Optical Flow 光流
  • You can check this article for extracting HOF: "Histograms of Oriented Optical Flow and Binet-Cauchy Kernels on Nonlinear Dynamical Systems for the Recognition of Human Actions"[Bag of words] 您可以查看这篇文章以提取HOF:“用于识别人类行为的非线性动力学系统上的定向光流直方图和Binet-Cauchy核的直方图”
  • Bag of Words 言语包

However, if your application requires just the comparison between two images, I would suggest to extract the Histogram of Gradient (HOG) for each image and then compare them with the histogram intersection measure or, again, use the Bag of words paradigm (it is better if you're looking for higher level representations of the images). 但是,如果您的应用程序只需要比较两个图像,我建议为每个图像提取梯度直方图(HOG),然后将它们与直方图相交度量进行比较,或者再次使用词袋范例(如果您正在寻找更高层次的图像表示,那就更好了。 The HOG are provided within the OpenCv libraries link HOG在OpenCv库链接中提供

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM