我尝试过遵循算法,但它不起作用。我无法确定问题是什么。 有人能帮助我吗?
Where can I learn/find examples of gesture recognitions streamed from Kinect, using OpenCV?
Image<Gray, Byte> dest = new Image<Gray, Byte>(this.bitmap.Width, this.bitmap.Height);
CvInvoke.cvThreshold(src, dest, 220, 300, Emgu.CV.CvEnum.THRESH.CV_THRESH_BINARY);
Bitmap nem1 = new Bitmap(dest.Bitmap);
this.bitmap = nem1;
Graphics g = Graphics.FromImage(this.bitmap);
using (MemStorage storage = new MemStorage()) //allocate storage for contour approximation
{
for (Contour<Point> contours = dest.FindContours();
contours != null;
contours = contours.HNext)
{
g.DrawRectangle(new Pen(new SolidBrush(Color.Green)),contours.BoundingRectangle);
IntPtr seq = CvInvoke.cvConvexHull2(contours,storage.Ptr, Emgu.CV.CvEnum.ORIENTATION.CV_CLOCKWISE, 0);
IntPtr defects = CvInvoke.cvConvexityDefects(contours, seq, storage);
Seq<Point> tr= contours.GetConvexHull(Emgu.CV.CvEnum.ORIENTATION.CV_CLOCKWISE);
Seq<Emgu.CV.Structure.MCvConvexityDefect> te = contours.GetConvexityDefacts(storage, Emgu.CV.CvEnum.ORIENTATION.CV_CLOCKWISE);
g.DrawRectangle(new Pen(new SolidBrush(Color.Green)), tr.BoundingRectangle);
}
}
答案 0 :(得分:0)
没有一些图形数据,很难提供帮助(我也没有适当的硬件)。无论如何,我建议你做两件事:
让我知道它是否有效: - )