当前位置: 首页 > news >正文

网站节日设计昆明seo关键词

网站节日设计,昆明seo关键词,长春网站排名提升,网站关键词排名先展示效果 AForge介绍 AForge是一个专门为开发者和研究者基于C#框架设计的, 也是NET平台下的开源计算机视觉和人工智能库 它提供了许多常用的图像处理和视频处理算法、机器学习和神经网络模型,并且具有高效、易用、稳定等特点。 AForge主要包括: 计算机视觉与人…

先展示效果 

AForge介绍

AForge是一个专门为开发者研究者基于C#框架设计的, 也是NET平台下的开源计算机视觉和人工智能库
它提供了许多常用的图像处理视频处理算法、机器学习和神经网络模型,并且具有高效、易用、稳定等特点。

 AForge主要包括:

计算机视觉与人工智能,图像处理,神经网络,遗传算法,机器学习,模糊系统,机器人控制等

  • AForge.Imaging ——日常的图像处理和过滤器
  • AForge.Vision —— 计算机视觉应用类库
  • AForge.Neuro —— 神经网络计算库AForge.Genetic -进化算法编程库
  • AForge. MachineLearning —— 机械学习类库
  • AForge. Robotics —— 提供一些机器学习的工具类库
  • AForge.Video —— 一系列的视频处理类库
  • AForge.Fuzzy —— 模糊推理系统类库
  • AForge.Controls —— 图像, 三维, 图表显示控件

AForge的使用方向 

1. 基于符号识别的3D显示增强技术

2. 基于模糊系统的自动导航

3. 运动检测

4. 2D增强技术

5. 计算机视觉与人工智能

6. 模拟识别

7. 神经网络

8. 图像处理

9. 遗传算法

10. 机器学习

11. 机器人控制等等

 AForge的安装方法

1.右键项目名

2.打开 "管理 NuGet程序包"

3.点击浏览 在浏览上输入 "AForge",并下载

注意:作者一般都是 aforge.net

4.全部下载之后,他会在你的winfrom的左边框会自动显示 

一、下面是我做的一个相机拍摄小项目

 

1.我们先把页面搭好, 上面的字都是lable弄的不是textbox

控件: label  button  comboBox  picture  timer   VideoSourcePlayer

注意:  VideoSourcePlayer 是 我们下载的那个控件里的(AForge.NET)

 2. 拉一个label , 右下角属性  

label 的 属性

  • Auto ==>False     
  • BorderStyle ==> Fixed3D   
  • TextAlign==>MiddleCenter  
  • ForeColor==>Red   
  • BackGround==>Black

3.最上面时间的显示

注意:这里是timer的控件一个点击事件

timer的Enable  属性  修改成  True

 #region 显示实时时间private void timer1_Tick(object sender, EventArgs e){DateTime dt=DateTime.Now;this.txtYear.Text = dt.Year.ToString();this.txtMonth.Text = dt.Month.ToString();this.txtDay.Text = dt.Day.ToString();this.txtTime.Text=dt.ToLongTimeString();string week = "";switch(dt.DayOfWeek){case DayOfWeek.Sunday:week = "日";break;case DayOfWeek.Monday:week = "一";break;case DayOfWeek.Tuesday:week = "二";break;case DayOfWeek.Wednesday:week = "三";break;case DayOfWeek.Thursday:week = "四";break;case DayOfWeek.Friday:week = "五";break;case DayOfWeek.Saturday:week = "六";break;default:break;}this.txtWeek.Text = week;}#endregion

4.我们要把最基本的 给完善了,把该定义的全部完成,窗体加载我们要提前实例化相机

  private FilterInfoCollection filterInfoCollection;  //摄像头设备集合private VideoCaptureDevice videoCapture;//捕捉设备源private Bitmap image=null; //设置图片接收的int Isopen = 0;  private void Form1_Load(object sender, EventArgs e){filterInfoCollection = new FilterInfoCollection(FilterCategory.VideoInputDevice);//MessageBox.Show($"检测到了{filterInfoCollection.Count.ToString()}个摄像头");//这下面的for循环是为了检测电脑连接几个相机 ,来吧相机数量写在combobox控件下for(int i = 0; i < filterInfoCollection.Count; i++){comboBox1.Items.Add($"摄像头{i}");}}

5.下拉框(ComboBox)索引选择改变

 CloseCamera(); //这个先提前关闭相机, 下面有介绍if (comboBox1.SelectedIndex == 0 && filterInfoCollection.Count > 0){videoCapture = new VideoCaptureDevice(filterInfoCollection[0].MonikerString);}else if (comboBox1.SelectedIndex == 1 && filterInfoCollection.Count > 1){videoCapture = new VideoCaptureDevice(filterInfoCollection[0].MonikerString);}else{MessageBox.Show("摄像头选择有误", "错误提示");return;}videoSourcePlayer1.VideoSource=videoCapture;videoSourcePlayer1.Start();

二、简化封装:相机关闭,相机连接(实时显示),保存图片

1.连接相机

  #region 连接相机private void ConnCamera(){if(filterInfoCollection.Count>0){ videoCapture = new VideoCaptureDevice(filterInfoCollection[0].MonikerString);videoSourcePlayer1.VideoSource= videoCapture;videoSourcePlayer1.Start();}}#endregion

2.关闭相机

 #region 关闭相机private void CloseCamera(){if(videoSourcePlayer1.VideoSource!=null){videoSourcePlayer1.SignalToStop();videoSourcePlayer1.VideoSource.Stop();videoSourcePlayer1.VideoSource = null;}}#endregion

3.保存图片

 #region 保存图片private void SaveImage(){var date = DateTime.Now.ToString("yyyy-MM-dd");date += "-" + DateTime.Now.TimeOfDay.ToString("hhmmss");if(!Directory.Exists("D:\\Saved_Pictures")){Directory.CreateDirectory("D:\\Saved_Pictures");}image.Save(string.Format("D:\\Saved_Pictures\\" + date + ".jpg", date), System.Drawing.Imaging.ImageFormat.Png);}#endregion

三、实现相机拍照,相机实时显示(打开),图片保存功能,窗体关闭

1.打开相机(实时显示)

 private void takeCamera_Click(object sender, EventArgs e){if(((uint)filterInfoCollection.Count)==0){MessageBox.Show("检测不到你的摄像头", "错误提示");}else{Isopen++;if(Isopen%2!=0){takeCamera.Text = "关闭摄像头";ConnCamera();}else if(Isopen%2==0){takeCamera.Text = "打开摄像头";CloseCamera();}}}

2.相机拍照

 private void takephoto_Click(object sender, EventArgs e){image=videoSourcePlayer1.GetCurrentVideoFrame();pictureBox1.SizeMode=PictureBoxSizeMode.Zoom;pictureBox1.Image= image;}

3.图片保存

   private void SavePicture_Click(object sender, EventArgs e){if(pictureBox1.Image!=null){SaveImage();}else{MessageBox.Show("请先进行拍照", "相机拍照");}}

4.窗体关闭

    private void Form1_FormClosing(object sender, FormClosingEventArgs e){if(MessageBox.Show("将要关闭窗口,是否继续?", "询问", MessageBoxButtons.YesNo) == DialogResult.Yes){e.Cancel=false;CloseCamera();Application.Exit();}else{e.Cancel = true;}}
}

补充: 窗体的关闭方法;窗体跳转文件夹

1.关闭窗体的多种方法

1. this.Close() ;

只是关闭当前窗口,如果不是主窗体的话,它后台还会再运行,是无法推出主程序的。

2.Application.Exit();

强制所有消息中止,退出所有的窗口,但是有托管线程,也无法干净退出

3.Applicat.ExitThread();

强制中止调用线程上的所有消息,同样面临其他线程无法正确退出问题

4.System.Environment.Exit(0);

这是彻底的强制退出,能把程序结束很干净

2.跳转功能

由于一般程序保存图片后都会有个跳转功能,这个我感觉保存后跳转,他就不是一个功能了,这里给大家写一下怎么去跳转。

 System.Diagnostics.Process.Start("D:\\Saved_Pictures");

注意: 括号里面是路径 

四、完结:代码展示和结果

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
using AForge.Video.DirectShow;namespace Camera
{public partial class Form1 : Form{public Form1(){InitializeComponent();}private FilterInfoCollection filterInfoCollection;  //摄像头设备集合private VideoCaptureDevice videoCapture;//捕捉设备源private Bitmap image=null;int Isopen = 0;#region 显示实时时间private void timer1_Tick(object sender, EventArgs e){DateTime dt=DateTime.Now;this.txtYear.Text = dt.Year.ToString();this.txtMonth.Text = dt.Month.ToString();this.txtDay.Text = dt.Day.ToString();this.txtTime.Text=dt.ToLongTimeString();string week = "";switch(dt.DayOfWeek){case DayOfWeek.Sunday:week = "日";break;case DayOfWeek.Monday:week = "一";break;case DayOfWeek.Tuesday:week = "二";break;case DayOfWeek.Wednesday:week = "三";break;case DayOfWeek.Thursday:week = "四";break;case DayOfWeek.Friday:week = "五";break;case DayOfWeek.Saturday:week = "六";break;default:break;}this.txtWeek.Text = week;}#endregionprivate void Form1_Load(object sender, EventArgs e){filterInfoCollection = new FilterInfoCollection(FilterCategory.VideoInputDevice);//MessageBox.Show($"检测到了{filterInfoCollection.Count.ToString()}个摄像头");for(int i = 0; i < filterInfoCollection.Count; i++){comboBox1.Items.Add($"摄像头{i}");}System.Diagnostics.Process.Start("D:\\Saved_Pictures");}private void comboBox1_SelectedIndexChanged(object sender, EventArgs e){CloseCamera();if (comboBox1.SelectedIndex == 0 && filterInfoCollection.Count > 0){videoCapture = new VideoCaptureDevice(filterInfoCollection[0].MonikerString);}else if (comboBox1.SelectedIndex == 1 && filterInfoCollection.Count > 1){videoCapture = new VideoCaptureDevice(filterInfoCollection[0].MonikerString);}else{MessageBox.Show("摄像头选择有误", "错误提示");return;}videoSourcePlayer1.VideoSource=videoCapture;videoSourcePlayer1.Start();}#region 关闭相机private void CloseCamera(){if(videoSourcePlayer1.VideoSource!=null){videoSourcePlayer1.SignalToStop();videoSourcePlayer1.VideoSource.Stop();videoSourcePlayer1.VideoSource = null;}}#endregion#region 连接相机private void ConnCamera(){if(filterInfoCollection.Count>0){ videoCapture = new VideoCaptureDevice(filterInfoCollection[0].MonikerString);videoSourcePlayer1.VideoSource= videoCapture;videoSourcePlayer1.Start();}}#endregion#region 保存图片private void SaveImage(){var date = DateTime.Now.ToString("yyyy-MM-dd");date += "-" + DateTime.Now.TimeOfDay.ToString("hhmmss");if(!Directory.Exists("D:\\Saved_Pictures")){Directory.CreateDirectory("D:\\Saved_Pictures");}image.Save(string.Format("D:\\Saved_Pictures\\" + date + ".jpg", date), System.Drawing.Imaging.ImageFormat.Png);}#endregionprivate void takeCamera_Click(object sender, EventArgs e){if(((uint)filterInfoCollection.Count)==0){MessageBox.Show("检测不到你的摄像头", "错误提示");}else{Isopen++;if(Isopen%2!=0){takeCamera.Text = "关闭摄像头";ConnCamera();}else if(Isopen%2==0){takeCamera.Text = "打开摄像头";CloseCamera();}}}private void takephoto_Click(object sender, EventArgs e){image=videoSourcePlayer1.GetCurrentVideoFrame();pictureBox1.SizeMode=PictureBoxSizeMode.Zoom;pictureBox1.Image= image;}private void SavePicture_Click(object sender, EventArgs e){if(pictureBox1.Image!=null){SaveImage();}else{MessageBox.Show("请先进行拍照", "相机拍照");}}private void Form1_FormClosing(object sender, FormClosingEventArgs e){if(MessageBox.Show("将要关闭窗口,是否继续?", "询问", MessageBoxButtons.YesNo) == DialogResult.Yes){e.Cancel=false;CloseCamera();Application.Exit();}else{e.Cancel = true;}}}
}

http://www.khdw.cn/news/30504.html

相关文章:

  • 虚拟主机与网站建设万网官网登录
  • 专做运动品牌的网站营销网课
  • 2023长春疫情第二波最新消息百度seo官网
  • 虚拟主机怎么发布网站吗百度手机助手下载安装最新版
  • 昆山外贸公司网站建设流程公司网站制作网络公司
  • 多梦wordpress长沙网站seo
  • 微信电脑网站是什么原因网上销售渠道
  • 海口网站制作设计企业seo网络推广
  • 厦门网站建设哪家比较好重庆森林影评
  • 网站建设贵州收录情况有几种
  • 做家教网站资质注册域名费用一般多少钱
  • 找建设网站公司百度拍照搜索
  • 网站设计制作公司排名百度seo关键词优化市场
  • 许昌做网站哪家好营销软文模板
  • 做微官网什么网站好计算机编程培训学校哪家好
  • 沈阳网站建设首选龙兴科技windows优化大师有哪些功能
  • 免费外贸建站平台推广软件的app
  • 深圳建站服务中心新媒体运营师证书
  • 网站域名空间代理东莞市民最新疫情
  • 网站开发运营推广叫什么软件淘宝关键词搜索工具
  • 龙华住房与建设局网站网店网络营销与推广策划书
  • 网站培训中心网页设计师
  • 料远若近网站建设网站发布平台
  • 网络广告策划书案例seo文章代写一篇多少钱
  • 如何开公司做网站台州网站建设方案推广
  • 福田做网站百度广告联盟点击一次多少钱
  • 高校宣传网站建设新闻10 30字
  • 斯塔德迈尔球衣连云港seo
  • 商品展示介绍网站源码国外产品推广平台
  • 厦门网站建设要多少钱推广手段和渠道有哪些