c# 2.0实现摄象头视频采集,拍照,录象

From: http://blog.csdn.net/ysq5202121/article/details/5672291

Camera.cs类文件using System;
using System.IO;
using System.Drawing.Imaging;
using System.Runtime.InteropServices;
using System.Drawing;
using System.Collections;
using System.Data;namespace SoundVideo
{public class Camera{public delegate void RecievedFrameEventHandler(byte[] data);public event RecievedFrameEventHandler RecievedFrame;public IntPtr lwndC;private IntPtr mControlPtr;private int mWidth;private int mHeight;private showVideo.FrameEventHandler mFrameEventHandler;public Camera(IntPtr handle, int width, int height){mControlPtr = handle;mWidth = width;mHeight = height;}public void CloseCamera(){this.capDriverDisconnect(this.lwndC);}public void StartCamera(){try{byte[] lpszName = new byte[100];byte[] lpszVer = new byte[100];showVideo.capGetDriverDescriptionA(0, lpszName, 100, lpszVer, 100);this.lwndC = showVideo.capCreateCaptureWindowA(lpszName, showVideo.WS_VISIBLE + showVideo.WS_CHILD, 0, 0, mWidth, mHeight, mControlPtr, 0);if (this.capDriverConnect(this.lwndC, 0)){this.capPreviewRate(this.lwndC, 66);this.capPreview(this.lwndC, true);showVideo.BITMAPINFO bitmapinfo = new showVideo.BITMAPINFO();bitmapinfo.bmiHeader.biSize = showVideo.SizeOf(bitmapinfo.bmiHeader);bitmapinfo.bmiHeader.biWidth = 352;bitmapinfo.bmiHeader.biHeight = 288;bitmapinfo.bmiHeader.biPlanes = 1;bitmapinfo.bmiHeader.biBitCount = 24;this.capSetVideoFormat(this.lwndC, ref bitmapinfo, showVideo.SizeOf(bitmapinfo));this.mFrameEventHandler = new showVideo.FrameEventHandler(FrameCallBack);this.capSetCallbackOnFrame(this.lwndC, this.mFrameEventHandler);showVideo.SetWindowPos(this.lwndC, 0, 0, 0, mWidth, mHeight, 6);}}catch{throw;}}public void bitMapToJPG(string bmpFileName, string jpgFileName){System.Drawing.Image img;img = ReturnPhoto(bmpFileName);img.Save(jpgFileName, ImageFormat.Jpeg);}private Image ReturnPhoto(string bmpFileName){try{System.IO.FileStream stream;stream = File.OpenRead(bmpFileName);Bitmap bmp = new Bitmap(stream);System.Drawing.Image image = bmp;//得到原图//创建指定大小的图System.Drawing.Image newImage = image.GetThumbnailImage(bmp.Width, bmp.Height, null, new IntPtr());Graphics g = Graphics.FromImage(newImage);g.DrawImage(newImage, 0, 0, newImage.Width, newImage.Height); //将原图画到指定的图上g.Dispose();stream.Close();return newImage;}catch{throw;}}public void capImage(IntPtr lwnd, string path)//抓图{showVideo.BITMAPINFO bitmapinfo = new showVideo.BITMAPINFO();IntPtr hBmp = Marshal.StringToHGlobalAnsi(path);showVideo.SendMessage(lwnd, showVideo.WM_CAP_SAVEDIB, 0, hBmp.ToInt32());}public void capScope(IntPtr lwnd, string path)// 录像,保存avi文件的路径{IntPtr hBmp = Marshal.StringToHGlobalAnsi(path);showVideo.SendMessage(lwnd, showVideo.WM_CAP_FILE_SET_CAPTURE_FILEA, 0, hBmp.ToInt32());showVideo.SendMessage(lwnd, showVideo.WM_CAP_SEQUENCE, 0, 0);}public void stopCapScope(IntPtr lwnd)// 停止录像{showVideo.SendMessage(lwnd, showVideo.WM_CAP_STOP, 0, 0);}private bool capDriverConnect(IntPtr lwnd, short i){return showVideo.SendMessage(lwnd, showVideo.WM_CAP_DRIVER_CONNECT, i, 0);}private bool capDriverDisconnect(IntPtr lwnd){return showVideo.SendMessage(lwnd, showVideo.WM_CAP_DRIVER_DISCONNECT, 0, 0);}private bool capPreview(IntPtr lwnd, bool f){return showVideo.SendMessage(lwnd, showVideo.WM_CAP_SET_PREVIEW, f, 0);}private bool capPreviewRate(IntPtr lwnd, short wMS){return showVideo.SendMessage(lwnd, showVideo.WM_CAP_SET_PREVIEWRATE, wMS, 0);}private bool capSetCallbackOnFrame(IntPtr lwnd, showVideo.FrameEventHandler lpProc){return showVideo.SendMessage(lwnd, showVideo.WM_CAP_SET_CALLBACK_FRAME, 0, lpProc);}private bool capSetVideoFormat(IntPtr hCapWnd, ref showVideo.BITMAPINFO BmpFormat, int CapFormatSize){return showVideo.SendMessage(hCapWnd, showVideo.WM_CAP_SET_VIDEOFORMAT, CapFormatSize, ref BmpFormat);}private void FrameCallBack(IntPtr lwnd, IntPtr lpVHdr){try{showVideo.VIDEOHDR videoHeader = new showVideo.VIDEOHDR();byte[] VideoData;videoHeader = (showVideo.VIDEOHDR)showVideo.GetStructure(lpVHdr, videoHeader);VideoData = new byte[videoHeader.dwBytesUsed];showVideo.Copy(videoHeader.lpData, VideoData);if (this.RecievedFrame != null) this.RecievedFrame(VideoData);}catch{throw;}}}
}ShowVideo.cs类文件using System;
using System.IO;
using System.Drawing.Imaging;
using System.Runtime.InteropServices;
using System.Drawing;
using System.Collections;
using System.Data;namespace SoundVideo
{public class showVideo{[DllImport("avicap32.dll")]public static extern IntPtr capCreateCaptureWindowA(byte[] lpszWindowName, int dwStyle, int x, int y, int nWidth, int nHeight, IntPtr hWndParent, int nID);[DllImport("avicap32.dll")]public static extern bool capGetDriverDescriptionA(short wDriver, byte[] lpszName, int cbName, byte[] lpszVer, int cbVer);[DllImport("User32.dll")]public static extern bool SendMessage(IntPtr hWnd, int wMsg, bool wParam, int lParam);[DllImport("User32.dll")]public static extern bool SendMessage(IntPtr hWnd, int wMsg, short wParam, int lParam);[DllImport("User32.dll")]public static extern bool SendMessage(IntPtr hWnd, int wMsg, short wParam, FrameEventHandler lParam);[DllImport("User32.dll")]public static extern bool SendMessage(IntPtr hWnd, int wMsg, int wParam, ref BITMAPINFO lParam);[DllImport("User32.dll")]public static extern int SetWindowPos(IntPtr hWnd, int hWndInsertAfter, int x, int y, int cx, int cy, int wFlags);[DllImport("avicap32.dll")]public static extern int capGetVideoFormat(IntPtr hWnd, IntPtr psVideoFormat, int wSize);public const int WM_USER = 0x400;public const int WS_CHILD = 0x40000000;public const int WS_VISIBLE = 0x10000000;public const int WM_CAP_START = WM_USER;public const int WM_CAP_STOP = WM_CAP_START + 68;public const int WM_CAP_DRIVER_CONNECT = WM_CAP_START + 10;public const int WM_CAP_DRIVER_DISCONNECT = WM_CAP_START + 11;public const int WM_CAP_SAVEDIB = WM_CAP_START + 25;public const int WM_CAP_GRAB_FRAME = WM_CAP_START + 60;public const int WM_CAP_SEQUENCE = WM_CAP_START + 62;public const int WM_CAP_FILE_SET_CAPTURE_FILEA = WM_CAP_START + 20;public const int WM_CAP_SEQUENCE_NOFILE = WM_CAP_START + 63;public const int WM_CAP_SET_OVERLAY = WM_CAP_START + 51;public const int WM_CAP_SET_PREVIEW = WM_CAP_START + 50;public const int WM_CAP_SET_CALLBACK_VIDEOSTREAM = WM_CAP_START + 6;public const int WM_CAP_SET_CALLBACK_ERROR = WM_CAP_START + 2;public const int WM_CAP_SET_CALLBACK_STATUSA = WM_CAP_START + 3;public const int WM_CAP_SET_CALLBACK_FRAME = WM_CAP_START + 5;public const int WM_CAP_SET_SCALE = WM_CAP_START + 53;public const int WM_CAP_SET_PREVIEWRATE = WM_CAP_START + 52;public const int WM_CAP_SET_VIDEOFORMAT = WM_USER + 45;[StructLayout(LayoutKind.Sequential)]public struct VIDEOHDR{[MarshalAs(UnmanagedType.I4)]public int lpData;[MarshalAs(UnmanagedType.I4)]public int dwBufferLength;[MarshalAs(UnmanagedType.I4)]public int dwBytesUsed;[MarshalAs(UnmanagedType.I4)]public int dwTimeCaptured;[MarshalAs(UnmanagedType.I4)]public int dwUser;[MarshalAs(UnmanagedType.I4)]public int dwFlags;[MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)]public int[] dwReserved;}[StructLayout(LayoutKind.Sequential)]public struct BITMAPINFOHEADER{[MarshalAs(UnmanagedType.I4)]public Int32 biSize;[MarshalAs(UnmanagedType.I4)]public Int32 biWidth;[MarshalAs(UnmanagedType.I4)]public Int32 biHeight;[MarshalAs(UnmanagedType.I2)]public short biPlanes;[MarshalAs(UnmanagedType.I2)]public short biBitCount;[MarshalAs(UnmanagedType.I4)]public Int32 biCompression;[MarshalAs(UnmanagedType.I4)]public Int32 biSizeImage;[MarshalAs(UnmanagedType.I4)]public Int32 biXPelsPerMeter;[MarshalAs(UnmanagedType.I4)]public Int32 biYPelsPerMeter;[MarshalAs(UnmanagedType.I4)]public Int32 biClrUsed;[MarshalAs(UnmanagedType.I4)]public Int32 biClrImportant;}[StructLayout(LayoutKind.Sequential)]public struct BITMAPINFO{[MarshalAs(UnmanagedType.Struct, SizeConst = 40)]public BITMAPINFOHEADER bmiHeader;[MarshalAs(UnmanagedType.ByValArray, SizeConst = 1024)]public Int32[] bmiColors;}public delegate void FrameEventHandler(IntPtr lwnd, IntPtr lpVHdr);public static object GetStructure(IntPtr ptr, ValueType structure){return Marshal.PtrToStructure(ptr, structure.GetType());}public static object GetStructure(int ptr, ValueType structure){return GetStructure(new IntPtr(ptr), structure);}public static void Copy(IntPtr ptr, byte[] data){Marshal.Copy(ptr, data, 0, data.Length);}public static void Copy(int ptr, byte[] data){Copy(new IntPtr(ptr), data);}public static int SizeOf(object structure){return Marshal.SizeOf(structure);}}
}Form1.cs类文件using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;namespace SoundVideo
{public partial class Form1 : Form{Camera wc;public Form1(){InitializeComponent();}private void Form1_Load(object sender, EventArgs e){try{this.btnPlay.Enabled = false;this.btnClose.Enabled = true;//panelPreview.Size = new Size(330,330);wc = new Camera(panelPreview.Handle, panelPreview.Width, panelPreview.Height);wc.StartCamera();}catch{MessageBox.Show("打开摄像头有误,请检查", "系统消息", MessageBoxButtons.OK, MessageBoxIcon.Information);}}private void btnPlay_Click(object sender, EventArgs e){try{this.btnPlay.Enabled = false;this.btnClose.Enabled = true;wc = new Camera(panelPreview.Handle, panelPreview.Width, panelPreview.Height);wc.StartCamera();}catch{MessageBox.Show("打开摄像头有误,请检查", "系统消息", MessageBoxButtons.OK, MessageBoxIcon.Information);}}private void btnScroll_Click(object sender, EventArgs e){try{wc.capImage(wc.lwndC, "d://test.bmp");}catch{MessageBox.Show("抓图有误,请检查", "系统消息", MessageBoxButtons.OK, MessageBoxIcon.Information);}}private void btnStopCap_Click(object sender, EventArgs e){try{wc.stopCapScope(wc.lwndC);}catch{MessageBox.Show("停止摄像有误,请检查", "系统消息", MessageBoxButtons.OK, MessageBoxIcon.Information);}}private void btnStartCap_Click(object sender, EventArgs e){try{wc.capScope(wc.lwndC, "d://test.avi");}catch{MessageBox.Show("开始摄像有误,请检查", "系统消息", MessageBoxButtons.OK, MessageBoxIcon.Information);}}private void btnClose_Click(object sender, EventArgs e){try{this.btnPlay.Enabled = true;this.btnClose.Enabled = false;wc.CloseCamera();}catch{MessageBox.Show("关闭摄像头有误,请检查", "系统消息", MessageBoxButtons.OK, MessageBoxIcon.Information);}}}
}using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;namespace SoundVideo
{public partial class Form1 : Form{Camera wc;public Form1(){InitializeComponent();}private void Form1_Load(object sender, EventArgs e){try{this.btnPlay.Enabled = false;this.btnClose.Enabled = true;//panelPreview.Size = new Size(330,330);wc = new Camera(panelPreview.Handle, panelPreview.Width, panelPreview.Height);wc.StartCamera();}catch{MessageBox.Show("打开摄像头有误,请检查", "系统消息", MessageBoxButtons.OK, MessageBoxIcon.Information);}}private void btnPlay_Click(object sender, EventArgs e){try{this.btnPlay.Enabled = false;this.btnClose.Enabled = true;wc = new Camera(panelPreview.Handle, panelPreview.Width, panelPreview.Height);wc.StartCamera();}catch{MessageBox.Show("打开摄像头有误,请检查", "系统消息", MessageBoxButtons.OK, MessageBoxIcon.Information);}}private void btnScroll_Click(object sender, EventArgs e){try{wc.capImage(wc.lwndC, "d://test.bmp");}catch{MessageBox.Show("抓图有误,请检查", "系统消息", MessageBoxButtons.OK, MessageBoxIcon.Information);}}private void btnStopCap_Click(object sender, EventArgs e){try{wc.stopCapScope(wc.lwndC);}catch{MessageBox.Show("停止摄像有误,请检查", "系统消息", MessageBoxButtons.OK, MessageBoxIcon.Information);}}private void btnStartCap_Click(object sender, EventArgs e){try{wc.capScope(wc.lwndC, "d://test.avi");}catch{MessageBox.Show("开始摄像有误,请检查", "系统消息", MessageBoxButtons.OK, MessageBoxIcon.Information);}}private void btnClose_Click(object sender, EventArgs e){try{this.btnPlay.Enabled = true;this.btnClose.Enabled = false;wc.CloseCamera();}catch{MessageBox.Show("关闭摄像头有误,请检查", "系统消息", MessageBoxButtons.OK, MessageBoxIcon.Information);}}}
}Form1.Designer.cs类文件namespace SoundVideo
{partial class Form1{/// <summary>/// 必需的设计器变量。/// </summary>private System.ComponentModel.IContainer components = null;/// <summary>/// 清理所有正在使用的资源。/// </summary>/// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>protected override void Dispose(bool disposing){if (disposing && (components != null)){components.Dispose();}base.Dispose(disposing);}#region Windows 窗体设计器生成的代码/// <summary>/// 设计器支持所需的方法 - 不要/// 使用代码编辑器修改此方法的内容。/// </summary>private void InitializeComponent(){this.panel1 = new System.Windows.Forms.Panel();this.btnStartCap = new System.Windows.Forms.Button();this.btnStopCap = new System.Windows.Forms.Button();this.btnScroll = new System.Windows.Forms.Button();this.btnPlay = new System.Windows.Forms.Button();this.btnClose = new System.Windows.Forms.Button();this.panelPreview = new System.Windows.Forms.Panel();this.panel2 = new System.Windows.Forms.Panel();this.panel1.SuspendLayout();this.panel2.SuspendLayout();this.SuspendLayout();//// panel1//this.panel1.Controls.Add(this.panel2);this.panel1.Controls.Add(this.panelPreview);this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;this.panel1.Location = new System.Drawing.Point(0, 0);this.panel1.Name = "panel1";this.panel1.Size = new System.Drawing.Size(518, 487);this.panel1.TabIndex = 0;//// btnStartCap//this.btnStartCap.Location = new System.Drawing.Point(51, 3);this.btnStartCap.Name = "btnStartCap";this.btnStartCap.Size = new System.Drawing.Size(75, 23);this.btnStartCap.TabIndex = 0;this.btnStartCap.Text = "开始录像";this.btnStartCap.UseVisualStyleBackColor = true;this.btnStartCap.Click += new System.EventHandler(this.btnStartCap_Click);//// btnStopCap//this.btnStopCap.Location = new System.Drawing.Point(132, 3);this.btnStopCap.Name = "btnStopCap";this.btnStopCap.Size = new System.Drawing.Size(75, 23);this.btnStopCap.TabIndex = 1;this.btnStopCap.Text = "停止录像";this.btnStopCap.UseVisualStyleBackColor = true;this.btnStopCap.Click += new System.EventHandler(this.btnStopCap_Click);//// btnScroll//this.btnScroll.Location = new System.Drawing.Point(213, 3);this.btnScroll.Name = "btnScroll";this.btnScroll.Size = new System.Drawing.Size(75, 23);this.btnScroll.TabIndex = 2;this.btnScroll.Text = "抓图";this.btnScroll.UseVisualStyleBackColor = true;this.btnScroll.Click += new System.EventHandler(this.btnScroll_Click);//// btnPlay//this.btnPlay.Location = new System.Drawing.Point(294, 3);this.btnPlay.Name = "btnPlay";this.btnPlay.Size = new System.Drawing.Size(75, 23);this.btnPlay.TabIndex = 3;this.btnPlay.Text = "播放";this.btnPlay.UseVisualStyleBackColor = true;this.btnPlay.Click += new System.EventHandler(this.btnPlay_Click);//// btnClose//this.btnClose.Location = new System.Drawing.Point(375, 3);this.btnClose.Name = "btnClose";this.btnClose.Size = new System.Drawing.Size(75, 23);this.btnClose.TabIndex = 4;this.btnClose.Text = "关闭";this.btnClose.UseVisualStyleBackColor = true;this.btnClose.Click += new System.EventHandler(this.btnClose_Click);//// panelPreview//this.panelPreview.Dock = System.Windows.Forms.DockStyle.Fill;this.panelPreview.Location = new System.Drawing.Point(0, 0);this.panelPreview.Name = "panelPreview";this.panelPreview.Size = new System.Drawing.Size(518, 487);this.panelPreview.TabIndex = 5;//// panel2//this.panel2.Controls.Add(this.btnStartCap);this.panel2.Controls.Add(this.btnStopCap);this.panel2.Controls.Add(this.btnClose);this.panel2.Controls.Add(this.btnScroll);this.panel2.Controls.Add(this.btnPlay);this.panel2.Dock = System.Windows.Forms.DockStyle.Bottom;this.panel2.Location = new System.Drawing.Point(0, 448);this.panel2.Name = "panel2";this.panel2.Size = new System.Drawing.Size(518, 39);this.panel2.TabIndex = 6;//// Form1//this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;this.ClientSize = new System.Drawing.Size(518, 487);this.Controls.Add(this.panel1);this.Name = "Form1";this.Text = "Form1";this.Load += new System.EventHandler(this.Form1_Load);this.panel1.ResumeLayout(false);this.panel2.ResumeLayout(false);this.ResumeLayout(false);}#endregionprivate System.Windows.Forms.Panel panel1;private System.Windows.Forms.Button btnClose;private System.Windows.Forms.Button btnPlay;private System.Windows.Forms.Button btnScroll;private System.Windows.Forms.Button btnStopCap;private System.Windows.Forms.Button btnStartCap;private System.Windows.Forms.Panel panelPreview;private System.Windows.Forms.Panel panel2;}
}


本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/404953.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

socket初级使用(客户端)

在国庆这段时间里用零星的一些时间看了一下socket的学习资料&#xff0c;由于笔者偏向学习实用方面的内容&#xff0c;因此此篇文章涉及理论知识较少&#xff0c;主要是以实现思路(怎么做)为主,但在实现之前还是需要了解一些基础的理论知识(如果其中有误请指出) TCP是用socket来…

CRC16循环冗余校验 RTU-MODBUS标准 Linux C

1、概述 CRC16循环冗余校验常用在MODBUS协议中&#xff0c;用于校验报文的完整性。CRC16校验值为uint16_t 无符号整形2字节&#xff0c;在MODBUS协议中&#xff0c;低检验字节在前&#xff0c;高校验字节在后&#xff0c;比如校验结果crc160x1788&#xff0c;则MODBUS中的校验…

第11章 路由器OSPF动态路由配置

实验目标&#xff1a; 一、掌握OSPF协议的配置方法&#xff1b; 二、掌握查看通过动态路由协议OSPF学习产生的路由信息&#xff1b; 三、熟悉广域网线缆连接方式&#xff1b; 技术原理&#xff1a; OSFP开放式最短路径优先协议&#xff0c;是目前网络中最广泛的路由协议之一。属…

Hi3515的开发板 Hi3515 SDK编译出错 提示缺少libpciv.a的解决办法

From: http://zyd87818.blog.163.com/blog/static/17488150120124300261687/ 这是HI3515说明文档的说明 但是我进去编译却通不过&#xff0c;提示错误如下 通过qq群里的好人帮助解决方法如下首先看一下makefile自己看不懂&#xff0c;经高人指点需要修改Makefile.param文件…

[react] React为什么要搞一个Hooks?

[react] React为什么要搞一个Hooks&#xff1f; 动机 Hook 解决了我们五年来编写和维护成千上万的组件时遇到的各种各样看起来不相关的问题。无论你正在学习 React&#xff0c;或每天使用&#xff0c;或者更愿尝试另一个和 React 有相似组件模型的框架&#xff0c;你都可能对这…

有关Botton的用法(二)

关于设置listener监听onClicked事件的步骤分析 Steps: 1.tell android you are interested in listening to a button click 2.bring your xml button inside java 3.tell your java button whose responding when its clicked 4.what should happen when button is clicked 1 …

poj1222

题意&#xff1a;一个01矩阵&#xff0c;表示灯的亮灭状态&#xff0c;每次操作可以改变一个十字形状内的五个灯的状态。问能否将所有灯熄灭。 分析&#xff1a;高斯消元法 对于每个灯的两灭有影响的开关就是它附近十字形内的五个开关。所以对于每个灯可以列一个方程&#xff0…

[react] React Hooks帮我们解决了哪些问题?

[react] React Hooks帮我们解决了哪些问题&#xff1f; React hooks help use get rid of js class and all trouble with this pointer. 个人简介 我是歌谣&#xff0c;欢迎和大家一起交流前后端知识。放弃很容易&#xff0c; 但坚持一定很酷。欢迎大家一起讨论 主目录 与歌…

李秋红130705010066

3-9、没有冗余度的信源还能不能压缩&#xff1f;为什么&#xff1f; 解答&#xff1a;可以压缩。这种情况下&#xff0c;不能使用无损压缩&#xff0c;但可以使用有损压缩。 3-10、不相关的信源还能不能压缩&#xff1f;为什么&#xff1f; 解答&#xff1a;可以压缩。对于不相…

iphone开发我的新浪微博客户端-用户登录准备篇(1.1)

首先说一下我这个的实现思路&#xff0c;登录支持多个账号&#xff0c;也就是说可以保存多个微博账号登录的时候选择其中一个登录。多个账号信息保存在sqlite的数据库中&#xff0c; 每一个账号信息就是一条记录, 当用户启动微博客户端的时候去取保存在sqlite数据库中的账号记录…

基于密度的异常值检测方法整理

基于密度的异常值检测方法的原理认为正常样本点所处的类簇密度要高于异常点样本所处的类簇密度。为解决实际异常值检测情况 中出现的问题&#xff0c;有一种基于局部异常因子 LOF 方法。

[react] 有在项目中使用过Antd吗?说说它的好处

[react] 有在项目中使用过Antd吗&#xff1f;说说它的好处 They gave every user a big surprise on Christmas Holiday. 个人简介 我是歌谣&#xff0c;欢迎和大家一起交流前后端知识。放弃很容易&#xff0c; 但坚持一定很酷。欢迎大家一起讨论 主目录 与歌谣一起通关前端…

TCP的流模式与UDP的报文模式对比

1 案例背景 在学习TCP-IP协议详解卷一时&#xff0c;读到介绍TCP协议的部分&#xff0c;发现TCP的首部是没有报文总长度字段的&#xff0c;而在UDP中是有的&#xff0c;对这个问题的思考引出了两者之间的区别。 2 案例分析 TCP报文的格式&#xff1a; TCP首部的格式&a…

GWT 入门介绍

From: http://blog.csdn.net/struts2/article/details/1758122 GWT 入门介绍 GWT使用JSON格式的数据通讯 GWT是 Google Web Toolkit的简称。 GWT是一个以Java语言为工具&#xff0c;以类似Swing的方式编写UI组件&#xff0c;之后通过GWT Compiler编译 为JavaScritp和HTM…

SQL Server 2008空间数据应用系列十一:Bing Maps中呈现GeoRSS订阅的空间数据

友情提示&#xff0c;您阅读本篇博文的先决条件如下&#xff1a; 1、本文示例基于Microsoft SQL Server 2008 R2调测。 2、具备 Transact-SQL 编程经验和使用 SQL Server Management Studio 的经验。 3、熟悉或了解Microsoft SQL Server 2008中的空间数据类型。 4、具备相应&am…

聚类算法的分类整理

1、基于划分的聚类算法 基于划分的聚类算法 主要通过聚类中心的迭代重置&#xff0c;直到达到“簇内点足够近&#xff0c;簇间点足够远”的目标效果&#xff0c;完成样本集的最优化分。其算法优点是时间、空间复杂度低&#xff0c;可以处理大规模数据集。缺点包括容易陷入局部…

[react] 为什么标签里的for要写成htmlFor呢?

[react] 为什么标签里的for要写成htmlFor呢&#xff1f; 为了区别和html自身标签中属性 个人简介 我是歌谣&#xff0c;欢迎和大家一起交流前后端知识。放弃很容易&#xff0c; 但坚持一定很酷。欢迎大家一起讨论 主目录 与歌谣一起通关前端面试题

minGW64安装和使用 极简教程

1、下载minGW64 官网下载&#xff1a;https://sourceforge.net/projects/mingw-w64/files/mingw-w64/mingw-w64-release/我的FTP&#xff1a;a、minGW64 install.exe b、解压免安装版 2、解压 3、添加环境变量 4、CMD 运行gcc 安装完成。 5、使用minGW编译C源码 6、运行

培训总结2

今天&#xff0c;我学习了工具类java.util.包中的几个平时经常用到的几个类&#xff0c;例如ArrayList、HashMap、Hashtable等几个类&#xff0c;在这我总结一下ArrayList的用法。 特征&#xff1a;允许null在内的所有元素&#xff0c;大致上等同于Vector类&#xff0c;但是他是…