码迷,mamicode.com
首页 > 其他好文 > 详细

Emgu CV

时间:2016-08-19 14:45:20      阅读:765      评论:0      收藏:0      [点我收藏+]

标签:

摄像头

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);

 

Emgu CV

标签:

原文地址:http://www.cnblogs.com/ahuo/p/5787322.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!