自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(94)
  • 资源 (8)
  • 收藏
  • 关注

原创 通过网页免费下载音乐(F12)

找到你想要下载的音乐1、按F12 2、点击网络或Network 3、按F5刷新 4、点击播放 5、找MP4文件 找到后双击

2019-12-18 19:59:49 18154 1

原创 Halcon 开,闭运算

开运算和闭运行在膨胀和腐蚀两个基本运算的基础上,可以构造出形态学运算族,它由上述两个运算的符合和集合操作(并、交、补等)组合成的所有运算构成。其中两个最为重要的组合运算是形态学开运算和闭运算。开运算相当于对图像先进行腐蚀运算再进行膨胀运算,可以消除离散点和"毛刺",可以将两个物体分开。闭运算相当于对图像先进行膨胀运算再进行腐蚀运行,可以填充图像的内部孔洞和图像的凹角点,可以把两个邻近的目标...

2019-11-19 14:16:10 11786

原创 C#与Halcon 编程报:异常:"异常捕获:HALCON错误#1402

语句://在图像中找到形状模型的最佳匹配在图像中找到形状模型的最佳匹配HOperatorSet.FindShapeModel(returnPic, hv_Tuple, (new HTuple(-180)).TupleRad() , (new HTuple(180)).TupleRad(), 0.5, 1, 0, "least_squares", 4,...

2019-10-15 18:37:30 7864 1

原创 C# MySQL数据库查询显示到datagridview1

private readonly string connetStr = "server=localhost;port=3306;user=root;password=123; database=xx;";MySqlConnection conn =null ;public Form1(){ InitializeComponent(); conn = new MySqlCon...

2019-09-15 11:36:37 2838 1

原创 winform 继承窗体卡顿解决

get { const int CS_NOCLOSE = 0x200; CreateParams cp = base.CreateParams; cp.ClassStyle = cp.ClassStyle | CS_NOCLOSE; if (!DesignMode) { cp.ExS...

2021-08-23 11:59:58 405

原创 Halcon 卡尺找圆

read_image (Image, 'D:/桌面/圆.png')get_image_size (Image, Width, Height)dev_get_window (WindowHandle)dev_set_draw ('margin')gen_circle (ROI_0, 155.605, 161.387, 118.247)dev_set_color ('green')Row:=155.605Column:=161.387Radius:=118.247circle:=[Row,.

2021-04-10 01:31:58 4072

原创 C# CRC校验

#region**CRC Computation** public void GetCRC(byte[] message, ref byte[] CRC) { //Function expects a modbus message of any length as well as a 2 byte CRC array in which to //return the CRC values: usho.

2021-01-19 15:02:37 779

原创 Halcon 写CSV文件

FileName:='C:/Users/ytg16/Desktop/test.csv'file_exists(FileName, FileExists)* if(FileExists)* delete_file(FileName)* endif * open_file (FileName, 'input', FileHandle) open_file (FileName, 'append', FileHandle)* open_file(FileName,'output',FileH.

2021-01-17 20:22:19 1179 1

原创 halcon坐标转换(机器人坐标转换用)

#图像坐标r:=[431, 355, 507, 53, 507]c:=[505, 543, 316, 127, 883]#物理坐标(例如机器人坐标)r1:=[0, 2.0, -2.0, 10, -2.0]c1:=[0, 1.0, -5.0, -10, 10]row:=670col:=789vector_to_hom_mat2d (r, c, r1,c1 , HomMat2D)affine_trans_point_2d (HomMat2D, row,col, Qx, Qy) #图...

2021-01-16 23:10:02 1639

原创 C# 压缩解压Zip文件

//添加引用ICSharpCode.SharpZipLib.dll/// <summary> /// Zip 压缩文件 /// </summary> public class Zip { public Zip() { } #region 加压方法 /// <summary> /// 功能:压缩文件(暂时只压缩文件夹下一级目录中的文件,.

2020-12-24 02:04:12 2147

原创 C# 写日志

public static void WriteLog(string msg) { string filePath = AppDomain.CurrentDomain.BaseDirectory + "Log"; if (!Directory.Exists(filePath)) { Directory.CreateDirectory(filePath); } ..

2020-11-27 17:22:00 752

原创 C# 二维数组

//定义string类型的数组 string[,,] Account = new string[100,4,4]; //统计数组长度 int AccountCount = 0; for (int i = 0; i < 100; i++) { for (int j = 0; j < 4; j++) ..

2020-11-27 10:07:28 1671

原创 C# ini读取一个节点下所有键值

[DllImport("kernel32.dll")]private static extern int GetPrivateProfileSection(string lpAppName, byte[] lpszReturnBuffer, int nSize, string lpFileName);public static Dictionary<string, string> GetKeys(string iniFile, string category){ byte[].

2020-11-25 16:36:41 2708 1

原创 C# flowLayoutPanel1里动态添加控件

//添加控件Button button = new Button();button.ImageAlign = System.Drawing.ContentAlignment.TopCenter;button.Location = new System.Drawing.Point(3, 0);button.Name = "button1";button.Size = new System.Drawing.Size(118, 117);button.TabIndex = 0;button.Tex.

2020-11-25 16:32:45 3374

原创 C# 图片透明

/// <summary> /// 处理图片透明操作 /// </summary> /// <param name="srcImage">原始图片</param> /// <param name="opacity">透明度(0.0---1.0)</param> /// <returns></returns> pri..

2020-11-04 14:33:35 499

原创 C# 无损压缩图片

/// <summary>/// 无损压缩图片/// </summary>/// <param name="sFile">原图片地址</param>/// <param name="dFile">压缩后保存图片地址</param>/// <param name="flag">压缩质量(数字越小压缩率越高)1-100</param>/// <param name="size">压缩后图片的最

2020-11-04 14:33:05 449

原创 C# 遍历ToolStripMenuItem

ToolStripMenuItem tool = (ToolStripMenuItem)sender; for (int i = 0; i < this.初始状态ToolStripMenuItem.DropDownItems.Count; i++) { ToolStripMenuItem cb = this.初始状态ToolStripMenuItem.DropDownItems[i] as ToolStripMenuIt.

2020-11-04 14:30:42 1787

原创 winform 防止遮挡任务栏

//遮挡任务栏全屏this.MaximumSize = new Size(Screen.PrimaryScreen.Bounds.Width,Screen.PrimaryScreen.Bounds.Height); //防止遮挡任务栏//this.MaximumSize = new Size(Screen.PrimaryScreen.WorkingArea.Width,Screen.PrimaryScreen.WorkingArea.Height);...

2020-11-03 10:12:34 293

原创 halcon rectangle2的四个顶点并生成矩形

*rectangle2的四个顶点read_image (Image2020090611045988id1, 'C:/Users/ytg18/Desktop/2020090611045988ID1.bmp')get_image_size (Image2020090611045988id1, Width, Height)dev_set_draw ('margin')gen_rectangle2 (Rectangle, Height/2, Width/2,0, Height/3, Width/4...

2020-09-06 19:41:58 3613

原创 C# 读写dat

private static void ReadDat() { //使用“另存为”对话框中输入的文件名实例化FileStream对象 FileStream myStream = new FileStream("license.dat", FileMode.OpenOrCreate, FileAccess.ReadWrite); //使用FileStream对象实例化BinaryWriter二进制..

2020-08-04 18:11:07 2325

原创 C# 三菱PLC FX5U 通信

需要引用这三个库:实例: //添加PLC控件 axActUtlType = new AxActUtlType(); Controls.Add(this.axActUtlType); //打开PLC string s = MitsubishiHelper.Open(ref axActUtlType, 1);/// <summary> //.

2020-08-04 18:01:36 3165 6

原创 C# 获取指定文件夹下所有的文件

DirectoryInfo dirs = new DirectoryInfo(System.Environment.CurrentDirectory + @"\11\"); FileInfo[] file = dirs.GetFiles();//获得目录下文件对 //循环文件 for (int j = 0; j < file.Count(); j++) { ..

2020-08-04 17:53:00 485

原创 C# halcon hobject 快速转Bitmap

Bitmap Honject2Bitmap(HObject hObject) { //获取图像尺寸 HOperatorSet.GetImageSize(hObject, out HTuple width0, out HTuple height0); HOperatorSet.GetImageSize(hObject, out width0, out height0); //创建交错格式图像..

2020-07-13 23:43:30 1857

原创 C# LZW算法压缩tiff图像

OpenFileDialog opndlg = new OpenFileDialog(); opndlg.Filter = "所有图像文件|*.bmp;*.pcx;*.png;*.jpg;*.gif;*.raw;*.tiff;*.tif"; opndlg.Title = "打开图像文件"; if (opndlg.ShowDialog() == DialogResult.OK) { ..

2020-07-02 20:04:20 1739

原创 C# 固高点位运动

#region 点位运动 /// <summary> /// 点位运动 /// </summary> /// <param name="axis">轴号</param> /// <param name="acc">加速度 </param> /// <param name="dec">减速度</param> ..

2020-07-02 03:00:04 1346

原创 C# 固高Jog运动

#region JOG运动 /// <summary> /// JOG运动 /// </summary> /// <param name="axis">轴号</param> /// <param name="acc">加速度</param> /// <param name="dec">减速度</param>...

2020-07-02 02:59:17 964

原创 halcon 一维码识别

*条形码类型BarCodeType:=['2/5 Industrial', '2/5 Interleaved', \ 'Codabar', 'Code 128', 'Code 39', 'Code 93', 'EAN-13 Add-On 2', 'EAN-13 Add-On 5', \ 'EAN-13', 'EAN-8 Add-On 2', 'EAN-8 Add-On 5', 'EAN-8', 'GS1 DataBar Expanded Stacked', \ .

2020-05-28 16:16:50 360

原创 C#与halcon联合编程 HObject转Bitmap

// halcon rgb变量转C# bitmap变量 public static Bitmap HObject2Bitmap3(HObject ho) { Bitmap bimp = null; HTuple hred, hgreen, hblue, type, width, height; HOperatorSet.GetImagePointer3(ho, ou...

2020-05-18 16:43:47 654

原创 C#与Halcon联合编程 HObject转OpenCVSharp Mat

public static Mat HImageToMat(HObject hobj){ try { Mat pImage; HTuple htChannels; HTuple cType = null; HTuple width, height; width = height = 0; htChannels = null; HOperatorSet.CountChannels(hobj, out htChannels); if (htChannels.Lengt.

2020-05-18 14:33:04 1798 2

原创 C# TCP/iP通信

private delegate void UsetEventHandler(); private static Socket _serveSocket = null; private static Thread _listthread = null; private static Socket _socket=null; private static Thread _receiveThread = null; #region.

2020-05-18 00:26:00 1487

原创 halcon 两点之间的距离

dev_get_window (WindowHandle)draw_point (WindowHandle, Row, Column)draw_point (WindowHandle, Row1, Column1)gen_cross_contour_xld (Cross1, Row, Column, 6, 0.785398)gen_cross_contour_xld (Cross, Row1, Column1, 6, 0.785398)*两点之间的距离distance_pp (Row, Col.

2020-05-16 21:33:49 3979

原创 halcon 点到一条线的距离

*获取窗口句柄dev_get_window (WindowHandle)draw_point (WindowHandle, Row2, Column2)gen_cross_contour_xld (Cross2, Row2, Column2, 6, 0.785398)draw_line (WindowHandle, Row11, Column11, Row21, Column21)gen_region_line (RegionLines, Row11, Column11, Row21, Colu.

2020-05-16 21:31:52 4547

原创 C# OpenFileDialog控件使用

使用C#代码操作:OpenFileDialog openFileDialog=new OpenFileDialog(); openFileDialog.InitialDirectory="c:\\";//注意这里写路径时要用c:\\而不是c:\ openFileDialog.Filter="文本文件|*.*|C#文件|*.cs|所有文件|*.*"; openFile...

2020-04-24 12:26:57 776

原创 Halcon 圆的中心,半径

list_image_files ('C:/Users/Desktop/image', 'default', [], ImageFiles)*图像区域的中心点for Index := 0 to |ImageFiles|-1 by 1 read_image (Image, ImageFiles[Index]) get_image_size (Image, Width, H...

2020-04-15 19:16:11 1154

原创 Halcon 基于相关性模板匹配

*关闭窗口dev_close_window ()read_image (Image, 'printer_chip/printer_chip_01')get_image_size (Image, Width, Height)dev_open_window_fit_size (0, 0, Width, Height, -1, -1, WindowHandle)dev_display (Im...

2020-04-10 20:14:10 809

原创 Halcon 卡尺找边

dev_close_window ()read_image (Image2, '无标题')get_image_size (Image2, Width, Height)dev_open_window_fit_image (Image2, 0, 0, -1, -1, WindowHandle)dev_display (Image2)dev_set_line_width (2)draw_l...

2020-03-14 20:09:25 3526

原创 Halcon 报错“HALCON error #1201: Wrong type of control parameter 1 in operator set_comprise ”

1、现在你的halcon实际用的另一个版本,要么用切换助手切换回去以前的halcon版本。2、c#里面引用的库换成现在的halcon版本。3、将你已引用的halcondotnet.dll动态链接库,相同版本的Halcon.dll放到degub文件目录下即可。...

2020-03-12 13:30:55 9643 1

原创 C# 截屏幕

try { //获取屏幕宽 int iWidth = Screen.PrimaryScreen.Bounds.Width; //获取屏幕高 int iHeight = Screen.PrimaryScreen.Bounds.Height; ...

2020-03-04 14:26:38 167

原创 C# 获取指定磁盘容量

#region 磁盘 /// <summary> /// 获取指定驱动器的空间总大小(单位为GB) /// </summary> /// <param name="str_HardDiskName">只需输入代表驱动器的字母即可</param> /// <re...

2020-03-03 15:50:40 454

原创 C# 给日期增加一天、减少一天

DateTime dt = DateTime.Now;string plus= dt.AddDays(2).ToString("yyyyMMddHHmmss");//添加2天string subtract= dt.AddDays(2).ToString("yyyyMMddHHmmss");//减2天

2020-02-22 01:48:49 5313 2

modbus TCP、RTU通信

modbus TCP、RTU通信

2022-06-25

CognexSDK.rar

CognexSDK.rar

2021-07-08

C# 三菱PLC FX5U 通信DEMO

好不好用,自己看

2020-08-04

C# 西门子通信S7TCPDLL.dll

S7TCPDLL,支持西门子 S7 TCP 协议,支持 S7_1200,300,400,1500 PLC

2020-07-19

图像文件格式转换 可浏览tiff图像 demo.rar

图像文件格式转换 可浏览tiff图像

2020-07-02

halcon函数速查表CHW.rar

算子参数说明中文,,,,,

2020-03-04

WindowsForms控件手册.chm

WindowsForms控件手册.chm

2020-02-16

C# 帮助文档.pdf

C# 帮助文档

2019-10-16

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除