本文整理汇总了C#中Emgu.CV.Capture.QuerySmallFrame方法的典型用法代码示例。如果您正苦于以下问题:C# Capture.QuerySmallFrame方法的具体用法?C# Capture.QuerySmallFrame怎么用?C# Capture.QuerySmallFrame使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Emgu.CV.Capture
的用法示例。
在下文中一共展示了Capture.QuerySmallFrame方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TestBlobTracking
public void TestBlobTracking()
{
Capture capture = new Capture();
ImageViewer viewer = new ImageViewer();
BlobTrackerAutoParam<Gray> param = new BlobTrackerAutoParam<Gray>();
//param.BlobDetector = new BlobDetector(Emgu.CV.CvEnum.BLOB_DETECTOR_TYPE.CC);
param.FGDetector = new FGDetector<Gray>(Emgu.CV.CvEnum.FORGROUND_DETECTOR_TYPE.FGD);
//param.BlobTracker = new BlobTracker(Emgu.CV.CvEnum.BLOBTRACKER_TYPE.CCMSPF);
param.FGTrainFrames = 10;
BlobTrackerAuto<Gray> tracker = new BlobTrackerAuto<Gray>(param);
MCvFont font = new MCvFont(Emgu.CV.CvEnum.FONT.CV_FONT_HERSHEY_SIMPLEX, 1.0, 1.0);
Application.Idle += new EventHandler(delegate(object sender, EventArgs e)
{
tracker.Process(capture.QuerySmallFrame().PyrUp().Convert<Gray, Byte>());
Image<Gray, Byte> img = tracker.ForgroundMask;
//viewer.Image = tracker.GetForgroundMask();
foreach (MCvBlob blob in tracker)
{
img.Draw(Rectangle.Round(blob), new Gray(255.0), 2);
img.Draw(blob.ID.ToString(), ref font, Point.Round(blob.Center), new Gray(255.0));
}
viewer.Image = img;
});
viewer.ShowDialog();
}