利用CreateMetrologyModel封装找线工具时,在后期实际应用调试时容易把检测极性搞混乱,造成检测偏差,基于此,此Demo增加画线后检测极性的指引,首先看一下效果
加载测试图片
画线
确定后指引效果
找线效果
修改显示
UI代码
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using ViewControl;
using HalconDotNet;
using System.Reflection.Emit;
using static System.Net.Mime.MediaTypeNames;
namespace DeepLearningTest1
{
public partial class Form1 : Form
{
HalconView HW;
public static MyDraw myDraw =new MyDraw();
HObject HIMage = new HObject(), ho_Arrows=new HObject();
HObject ho_Clip, ho_Cross, ho_Fit;
Double R1, R2, C1, C2;
bool DisDraw=false, DisClip=false, DisCross=false, DisFit=false;
public Form1()
{
InitializeComponent();
HW = new HalconView();
HW.HWindowControl.BackColor = Color.White;
splitContainer1.Panel1.Controls.Add(HW);
HW.Dock = DockStyle.Fill;
}
/// <summary>
/// 加载图像
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void button1_Click(object sender, EventArgs e)
{
try
{
OpenFileDialog openFileDialog = new OpenFileDialog();
标签:HW,找线,C#,System,Halcon,HObject,ho,new,using
From: https://blog.csdn.net/2202_75557553/article/details/145048441