本文整理汇总了C#中Emgu.CV.Mat.CopyTo方法的典型用法代码示例。如果您正苦于以下问题:C# Mat.CopyTo方法的具体用法?C# Mat.CopyTo怎么用?C# Mat.CopyTo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Emgu.CV.Mat
的用法示例。
在下文中一共展示了Mat.CopyTo方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Main
static void Main(string[] args)
{
PupilDetector pupilDetector = new PupilDetector("C:\\Users\\Phoenix\\Documents\\Visual Studio 2013\\Projects\\testPupilDetection\\res\\haarcascade_frontalface_alt.xml");
Mat frame = new Mat();
Mat frameCopy = new Mat();
Capture capture = new Capture(0);
if (capture == null)
return;
while (true)
{
frame = capture.QueryFrame();
frame.CopyTo(frameCopy);
CvInvoke.Flip(frameCopy, frameCopy, FlipType.Horizontal);
if (!frameCopy.IsEmpty)
{
Rectangle face = new Rectangle(new Point(0, 0), new Size(0, 0));
Point leftPupil = new Point(0, 0);
Point rightPupil = new Point(0, 0);
pupilDetector.Detect(frameCopy, ref face, ref leftPupil, ref rightPupil);
CvInvoke.Rectangle(frameCopy, face, new MCvScalar(1234));
CvInvoke.Circle(frameCopy, leftPupil, 3, new MCvScalar(1234));
CvInvoke.Circle(frameCopy, rightPupil, 3, new MCvScalar(1234));
CvInvoke.Imshow("Pupil Detection", frameCopy);
}
else
{
Console.WriteLine(" --(!) No captured frame -- Break!");
break;
}
int c = CvInvoke.WaitKey(10);
if ((char)c == 'c')
break;
}
}
示例2: DoMatMagic
public static void DoMatMagic(string message = null)
{
if (message != "Magical Mystery Heap fix")
{
Log.InfoFormat("Magical Mystery Heap fix from '{0}'", message);
return;
}
Log.InfoFormat("Mat test! {0}" , message);
var m1 = new Mat();
var m2 = new Mat();
m2.CopyTo(m1);
m1.Dispose();
m2.Dispose();
}