|
发表于 2018-9-5 21:44:24
|
显示全部楼层
以下是我用V3.4版本调试的,我也是新手。
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Emgu.CV;
using Emgu.CV.Cvb;
using Emgu.CV.UI;
using Emgu.CV.CvEnum;
using Emgu.CV.Structure;
namespace ImageProcess
{
public partial class FaceDetect : Form
{
Image<Bgr, Byte> current;
VideoCapture webcam = new VideoCapture(0);
private void button1_Click(object sender, EventArgs e)
{
Application.Idle += new EventHandler(processCamera);
}
private void processCamera(object sender, EventArgs e)
{
Mat current = webcam.QueryFrame();
//Image<Bgr, Byte> frame = webcam.QueryFrame();
Image<Bgr, Byte> img = current.ToImage<Bgr, Byte>();
// currnet = current.Flip(Emgu.CV.CvEnum.FlipType.Horizontal);
pictureBox1.Image = img.ToBitmap ();
}
} |
|