当前位置:网站首页>视觉上位系统设计开发(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,
}
边栏推荐
- SQL server installation location cannot be changed
- Global and Chinese market of lighting control components 2022-2028: Research Report on technology, participants, trends, market size and share
- 【Transformer】入门篇-哈佛Harvard NLP的原作者在2018年初以逐行实现的形式呈现了论文The Annotated Transformer
- [opengl] advanced chapter of texture - principle of flowmap
- Functional modules and application scenarios covered by the productization of user portraits
- 【pytorch学习笔记】Datasets and Dataloaders
- C # realizes the login interface, and the password asterisk is displayed (hide the input password)
- Use of Tex editor
- XWiki安装使用技巧
- Yolov5系列(一)——网络可视化工具netron
猜你喜欢
零拷贝底层剖析
C # realizes the login interface, and the password asterisk is displayed (hide the input password)
[attention mechanism] [first vit] Detr, end to end object detection with transformers the main components of the network are CNN and transformer
[graphics] real shading in Unreal Engine 4
Tencent internship interview sorting
复合类型(自定义类型)
Redis主从、哨兵、集群模式介绍
【pytorch学习笔记】Datasets and Dataloaders
【云原生训练营】模块八 Kubernetes 生命周期管理和服务发现
[graphics] adaptive shadow map
随机推荐
SQL server installation location cannot be changed
【云原生训练营】模块八 Kubernetes 生命周期管理和服务发现
406. Reconstruct the queue according to height
What are the composite types of Blackhorse Clickhouse, an OLAP database recognized in the industry
Introduction to opengl4.0 tutorial computing shaders
What is machine reading comprehension? What are the applications? Finally someone made it clear
How does vs+qt set the software version copyright, obtain the software version and display the version number?
[transformer] Introduction - the original author of Harvard NLP presented the annotated transformer in the form of line by line implementation in early 2018
Tencent internship interview sorting
Global and Chinese market of optical fiber connectors 2022-2028: Research Report on technology, participants, trends, market size and share
复合类型(自定义类型)
Incluxdb2 buckets create database
[engine development] in depth GPU and rendering optimization (basic)
2022/02/14
Construction of operation and maintenance system
What is embedding (encoding an object into a low dimensional dense vector), NN in pytorch Principle and application of embedding
Leetcode the smallest number of the rotation array of the offer of the sword (11)
The first character of leetcode sword offer that only appears once (12)
Puppet自动化运维排错案例
[combinatorics] permutation and combination (set permutation, step-by-step processing example)