当前位置:网站首页>视觉上位系统设计开发(halcon-winform)
视觉上位系统设计开发(halcon-winform)
2022-07-03 15:08:00 【11eleven】
- 本文介绍如何实现一个视觉上位的方案配置系统的思路,基于C# winform,原生控件进行界面设计,流程UI交互,以及算子调用,设备通讯等等。
- 设计的思路大致是基于视觉库的算子,将算子封装成单个工具节点,例如图像导入,颜色转换,区域绘制,阈值分析,结果判断等等,可根据项目情况进行自定义节点的输入参数,运行参数,从而执行得到执行结果。另外加上设备通讯的驱动全局变量的流转,最后结果的输出完成整个的检测工作。
- 视觉上位的模块大致划分为以下几个模块
- 方案流程管理
- 流程节点关系
- 全局变量管理
- 图像绘制预览功能
- 设备通讯控制
- 节点算子执行方法
- 结果输出,图像输出
- 先上几张效果图。后续文章将从这几个块进行功能解析。
- 数据对象有:方案,流程、流程节点、节点基础信息、设备信息、设备事件信息、算子匹配的函数、全局变量、等等
public class SchemeConfig {
public static SchemeInfo Scheme { set; get; }
public static HWindow_Final HWindowControl { set; get; }}
public class SchemeInfo : BaseField, IEntity<long>
{public SchemeInfo()
{
Id = GeneratePrimaryKeyIdHelper.GetPrimaryKeyId();
}
public long Id { get; set; }
/// <summary>
/// 方案编码
/// </summary>
public string Code { get; set; }/// <summary>
/// 方案名称
/// </summary>
public string Name { get; set; }/// <summary>
/// 备注
/// </summary>
public string Remark { get; set; }
public List<SchemeFlowInfoEntity> FlowList { set; get; }
public List<GlobalVariableModel> GlobalVariableList { set; get; }/// <summary>
/// 设备配置
/// </summary>
public GlobalDeviceConfig GlobalDeviceConfig { set; get; }}
public class GlobalDeviceConfig
{
public List<DeviceCommumicationClient> ClientList { set; get; } = new List<DeviceCommumicationClient>();
public List<CommumicationEventReceive> ReceiveList { set; get; } = new List<CommumicationEventReceive>();
public List<CommumicationEventSend> SendList { set; get; } = new List<CommumicationEventSend>();
}/// <summary>
/// 图像源
/// </summary>
public class ImageSourceContentModel: SchemeFlowNodeEntity
{
public override void InitData() {
NodeResultModels = new List<NodeResultModel>();
NodeResultModels.Add(new NodeResultModel() { NodeResultCode = NodeResultTypeEnum.ImageWidth.ToString(),NodeResultName =NodeResultTypeEnum.ImageWidth.GetDescription() });
NodeResultModels.Add(new NodeResultModel() { NodeResultCode = NodeResultTypeEnum.ImageHeight.ToString(), NodeResultName = NodeResultTypeEnum.ImageHeight.GetDescription() });
}
public int DefaultImageIndex { set; get; } = -1;
public string ImageFolderPath { set; get; }
/// <summary>
/// 图像地址PATH
/// </summary>
public List<string> ImagePathList { set; get; }}
/// <summary>
/// 几何创建
/// </summary>
public class GeometryContentModel : SchemeFlowNodeEntity
{/// <summary>
/// ROIJSON
/// </summary>
public string RoiDataJson { set; get; }/// <summary>
/// ROI几何
/// </summary>
public List<ROI> Regions { set; get; } = new List<ROI>();//roi集合}
/// <summary>
/// blob
/// </summary>
public class BlobContentModel : SchemeFlowNodeEntity
{public override void InitData()
{
}
}/// <summary>
/// 颜色转换
/// </summary>
public class ColorRgbContentModel : SchemeFlowNodeEntity
{
}/// <summary>
/// Result
/// </summary>
public class ConditionResultContentModel : SchemeFlowNodeEntity
{
/// <summary>
/// 判断条件 0:全部符合,1:任意条件符合
/// </summary>
public int JudgeType { set; get; }public List<ResultConditionJudgeModel> JudgeList { set; get; } = new List<ResultConditionJudgeModel>();
public Color OkColor { set; get; }
public Color NgColor { set; get; }
public int ResultLocationX { set; get; }
public int ResultLocationY { set; get; }
}public class ResultConditionJudgeModel {
public string VariableCode { set; get; }
public string VariableName { set; get; }
public decimal MinValue { set; get; }
public decimal MaxValue { set; get; }
}
/// <summary>
/// 工具节点类型
/// </summary>
public enum ToolNodeTypeEnum:long
{
/// <summary>
/// 图像源
/// </summary>
ImageSource=0,
/// <summary>
/// 几何
/// </summary>
Geometry=1,
/// <summary>
/// blob分析
/// </summary>
Blob=2,
/// <summary>
/// 条件结果
/// </summary>
ConditionResult=3,
/// <summary>
/// 颜色转换
/// </summary>
ColorRgb=4,
}

边栏推荐
- There are links in the linked list. Can you walk three steps faster or slower
- B2020 分糖果
- 【云原生训练营】模块七 Kubernetes 控制平面组件:调度器与控制器
- 官网MapReduce实例代码详细批注
- Global and Chinese market of lighting control components 2022-2028: Research Report on technology, participants, trends, market size and share
- 4-24--4-28
- Zero copy underlying analysis
- 4-33--4-35
- What are the composite types of Blackhorse Clickhouse, an OLAP database recognized in the industry
- TPS61170QDRVRQ1
猜你喜欢

什么是embedding(把物体编码为一个低维稠密向量),pytorch中nn.Embedding原理及使用

Kubernetes 进阶训练营 Pod基础
![[ue4] cascading shadow CSM](/img/83/f4dfda3bd5ba0172676c450ba7693b.jpg)
[ue4] cascading shadow CSM

Introduction to opengl4.0 tutorial computing shaders
![[Yu Yue education] scientific computing and MATLAB language reference materials of Central South University](/img/83/922efb4f88843f1b7feaccf2b515b9.jpg)
[Yu Yue education] scientific computing and MATLAB language reference materials of Central South University

Byte practice plane longitude 2

Chapter 04_ Logical architecture
![[probably the most complete in Chinese] pushgateway entry notes](/img/5a/6dcb75f5d713ff513ad6842ff53cc3.png)
[probably the most complete in Chinese] pushgateway entry notes

4-29——4.32

零拷贝底层剖析
随机推荐
Zero copy underlying analysis
Global and Chinese market of transfer case 2022-2028: Research Report on technology, participants, trends, market size and share
Chapter 04_ Logical architecture
Vs+qt multithreading implementation -- run and movetothread
官网MapReduce实例代码详细批注
Pytorch深度学习和目标检测实战笔记
Yolov5 advanced seven target tracking latest environment construction (II)
Kubernetes带你从头到尾捋一遍
MySQL reports an error: [error] mysqld: file '/ mysql-bin. 010228‘ not found (Errcode: 2 “No such file or directory“)
Leetcode sword offer find the number I (nine) in the sorted array
Mmdetection learning rate and batch_ Size relationship
Relationship between truncated random distribution and original distribution
Didi off the shelf! Data security is national security
[transformer] Introduction - the original author of Harvard NLP presented the annotated transformer in the form of line by line implementation in early 2018
【日常训练】395. 至少有 K 个重复字符的最长子串
Yolov5进阶之九 目标追踪实例1
[set theory] inclusion exclusion principle (complex example)
[transform] [practice] use pytoch's torch nn. Multiheadattention to realize self attention
视觉上位系统设计开发(halcon-winform)-3.图像控件
[graphics] real shading in Unreal Engine 4