• Emgu CV


    摄像头

    Capture _capture = new Capture(0);

    _capture.SetCaptureProperty(Emgu.CV.CvEnum.CAP_PROP.CV_CAP_PROP_FPS, 30);
    _capture.SetCaptureProperty(Emgu.CV.CvEnum.CAP_PROP.CV_CAP_PROP_FRAME_HEIGHT, capheight);

    var frame = _capture.QueryFrame();

    视频保存

    VideoWriter videoWriter =new VideoWriter(filename,CvInvoke.CV_FOURCC('M', 'J', 'P', 'G'), 20, capwidth , capheight, true);

    IntPtr  Fcapture = CvInvoke.cvCreateFileCapture(filename);

    videoWriter.WriteFrame<Bgr, Byte>(rimage);

    图片操作

     

    Image<Bgr, byte> frameg = image.Copy(rectangle)

    frameg = frameg .Rotate(90f, new Bgr(0,0,0), false);

    frame = frameb.Flip(Emgu.CV.CvEnum.FLIP.HORIZONTAL);

    Image<Bgr, byte> rimage = new Image<Bgr, byte>(capwidth , capheight);
    CvInvoke.cvSetImageROI(rimage.Ptr, new Rectangle(0, 0, capwidth, capheight));
    CvInvoke.cvCopy(frameg.Ptr, rimage.Ptr, IntPtr.Zero);

    灰度

    Image<Gray, Byte> graye = frameg.Convert<Gray, Byte>().Resize(checkper, Emgu.CV.CvEnum.INTER.CV_INTER_LINEAR);、

    画矩形

    frameg.Draw(r, new Bgr(0, 255, 0), 2);

  • 相关阅读:
    用JAVA自己画一张二维码
    20.custom自定义线程池
    19.线程池的使用
    7.volatile关键字
    8.volatile原子性
    10.线程通信CountDownLatch
    9.线程通信wait、notify
    11.线程通信CountDownLatch
    14.ThreadLocal
    13.FutureTask异步计算
  • 原文地址:https://www.cnblogs.com/ahuo/p/5787322.html
Copyright © 2020-2023  润新知