网页资讯视频图片知道文库贴吧地图采购
进入贴吧全吧搜索

 
 
 
日一二三四五六
       
       
       
       
       
       

签到排名:今日本吧第个签到,

本吧因你更精彩,明天继续来努力!

本吧签到人数:0

一键签到
成为超级会员,使用一键签到
一键签到
本月漏签0次!
0
成为超级会员,赠送8张补签卡
如何使用?
点击日历上漏签日期,即可进行补签。
连续签到:天  累计签到:天
0
超级会员单次开通12个月以上,赠送连续签到卡3张
使用连续签到卡
12月05日漏签0天
人工智能吧 关注:118,453贴子:512,867
  • 看贴

  • 图片

  • 吧主推荐

  • 视频

  • 游戏

  • 5回复贴,共1页
<<返回人工智能吧
>0< 加载中...

好吧,今天学会了openCV捕获视频

  • 只看楼主
  • 收藏

  • 回复
  • split_X
  • T800
    10
该楼层疑似违规已被系统折叠 隐藏此楼查看此楼
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.Structure;
using Emgu.Util;
using System.Threading;
namespace MyOpenCV
{
public partial class Form2 : Form
{
public Form2()
{
InitializeComponent();
}
private Capture _capture;
private bool _captureInProgress;
private void ProcessFrame(object sender, EventArgs arg)
{
Image<Bgr, Byte> frame = _capture.QueryFrame();
captureImageBox.Image = frame;
// 请再加上以下四行程式码
Image<Gray, Byte> grayFrame = frame.Convert<Gray, Byte>();
Image<Gray, Byte> cannyFrame = grayFrame.Canny(new Gray(100), new Gray(60));
grayscaleImageBox.Image = grayFrame;
cannyImageBox.Image = cannyFrame;
pictureBox1.BackgroundImage = cannyFrame.Bitmap;
}
private void captureButton_Click(object sender, EventArgs e)
{
#region if capture is not created, create it now
if (_capture == null)
{
try
{
_capture = new Capture();
}
catch (NullReferenceException excpt)
{
MessageBox.Show(excpt.Message);
}
}
#endregion
if (_capture != null)
{
if (_captureInProgress)
{ //stop the capture
Application.Idle -= new EventHandler(ProcessFrame);
captureButton.Text = "Start Capture";
}
else
{
//start the capture
captureButton.Text = "Stop";
Application.Idle += new EventHandler(ProcessFrame);
}
_captureInProgress = !_captureInProgress;
}
}
}
}
    ------小学生放假了,大家快跑~~


  • 无尽愿
  • 9S
    12
该楼层疑似违规已被系统折叠 隐藏此楼查看此楼
coder前来拜访


登录百度账号

扫二维码下载贴吧客户端

下载贴吧APP
看高清直播、视频!
  • 贴吧页面意见反馈
  • 违规贴吧举报反馈通道
  • 贴吧违规信息处理公示
  • 5回复贴,共1页
<<返回人工智能吧
分享到:
©2025 Baidu贴吧协议|隐私政策|吧主制度|意见反馈|网络谣言警示