当前位置:网站首页>视觉上位系统设计开发(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,
}
边栏推荐
- Using notepad++ to build an arbitrary language development environment
- Yolov5进阶之七目标追踪最新环境搭建(二)
- 在MapReduce中利用MultipleOutputs输出多个文件
- Global and Chinese markets for infrared solutions (for industrial, civil, national defense and security applications) 2022-2028: Research Report on technology, participants, trends, market size and sh
- The first character of leetcode sword offer that only appears once (12)
- TPS61170QDRVRQ1
- Leetcode the smallest number of the rotation array of the offer of the sword (11)
- 视觉上位系统设计开发(halcon-winform)-2.全局变量设计
- 链表有环,快慢指针走3步可以吗
- 【Transform】【实践】使用Pytorch的torch.nn.MultiheadAttention来实现self-attention
猜你喜欢
Influxdb2 sources add data sources
What is machine reading comprehension? What are the applications? Finally someone made it clear
链表有环,快慢指针走3步可以吗
[graphics] real shading in Unreal Engine 4
什么是one-hot encoding?Pytorch中,将label变成one hot编码的两种方式
Série yolov5 (i) - - netron, un outil de visualisation de réseau
[graphics] hair simulation in tressfx
[wechat applet] wxss template style
Zero copy underlying analysis
【可能是全中文网最全】pushgateway入门笔记
随机推荐
官网MapReduce实例代码详细批注
Yolov5进阶之九 目标追踪实例1
Search in the two-dimensional array of leetcode sword offer (10)
Yolov5 advanced seven target tracking latest environment construction (II)
[opengl] face pinching system
第04章_逻辑架构
[combinatorics] permutation and combination (set permutation, step-by-step processing example)
[attention mechanism] [first vit] Detr, end to end object detection with transformers the main components of the network are CNN and transformer
Global and Chinese market of lighting control components 2022-2028: Research Report on technology, participants, trends, market size and share
The first character of leetcode sword offer that only appears once (12)
"Seven weapons" in the "treasure chest" of machine learning: Zhou Zhihua leads the publication of the new book "machine learning theory guide"
High quality workplace human beings must use software to recommend, and you certainly don't know the last one
Using Tengine to solve the session problem of load balancing
2022/02/14
How does vs+qt set the software version copyright, obtain the software version and display the version number?
Using TCL (tool command language) to manage Tornado (for VxWorks) can start the project
【Transformer】入门篇-哈佛Harvard NLP的原作者在2018年初以逐行实现的形式呈现了论文The Annotated Transformer
视觉上位系统设计开发(halcon-winform)-6.节点与宫格
Byte practice plane longitude 2
TPS61170QDRVRQ1