From 0b617e22e15bca0b3dbaebdc55015cc2792f6840 Mon Sep 17 00:00:00 2001
From: C3031 <shitiangui@lanpucloud.cn>
Date: 星期二, 06 一月 2026 16:15:01 +0800
Subject: [PATCH] 增加S7通讯界面
---
LB_VisionProcesses/Alogrithms/BaseAlgorithm/TAlgorithm.cs | 22 ++++++++++++++++------
1 files changed, 16 insertions(+), 6 deletions(-)
diff --git a/LB_VisionProcesses/Alogrithms/BaseAlgorithm/TAlgorithm.cs b/LB_VisionProcesses/Alogrithms/BaseAlgorithm/TAlgorithm.cs
index 0c95831..2c7a2c6 100644
--- a/LB_VisionProcesses/Alogrithms/BaseAlgorithm/TAlgorithm.cs
+++ b/LB_VisionProcesses/Alogrithms/BaseAlgorithm/TAlgorithm.cs
@@ -41,7 +41,7 @@
/// <summary>
/// 璇诲啓閿�
/// </summary>
- public readonly object lockObj = new object();
+ public static readonly object lockObj = new object();
/// <summary>
/// 瑁佸垏鍥剧墖涓篽oDomainImage(淇濈暀鍘熷潗鏍囩郴,鍏朵綑濉厖涓虹┖)
@@ -304,7 +304,16 @@
Result = true;
bCompleted = false;
Msg = "";
- OutputImage = null;
+ if (OutputImage != null)
+ {
+ if (OutputImage is HObject)
+ ((HObject)OutputImage).Dispose();
+ else if (OutputImage is Mat)
+ ((Mat)OutputImage).Dispose();
+ else if (OutputImage is Bitmap)
+ ((Bitmap)OutputImage).Dispose();
+ OutputImage = null;
+ }
if (Record != null)
Record.Dispose();
@@ -645,6 +654,7 @@
else
{
throw new ArgumentException($"Mat2HObject涓嶆敮鎸佺殑鍥惧儚鏍煎紡锛歿mat.Type()}");
+ return;
}
return;
}
@@ -1237,10 +1247,10 @@
HOperatorSet.GenImageConst(out image, "real", hv_xMax + 1, hv_yMax + 1);
HOperatorSet.SetGrayval(image, hv_y, hv_x, hv_z);
- //hoperatorset.getimagesize(ho_image, out htuple hv_width, out htuple hv_height);
- //hoperatorset.genrectangle1(out hobject ho_rectangle, 0, 0, hv_height - 1, hv_width - 1);
- //hoperatorset.getregionpoints(ho_rectangle, out htuple hv_rows, out htuple hv_columns);
- //hoperatorset.getgrayval(ho_image, hv_rows, hv_columns, out htuple hv_z);
+ //HOperatorSet.GetImageSize(ho_Image, out HTuple hv_Width, out HTuple hv_Height);
+ //HOperatorSet.GenRectangle1(out HObject ho_Rectangle, 0, 0, hv_Height - 1, hv_Width - 1);
+ //HOperatorSet.GetRegionPoints(ho_Rectangle, out HTuple hv_Rows, out HTuple hv_Columns);
+ //HOperatorSet.GetGrayval(ho_Image, hv_Rows, hv_Columns, out HTuple hv_Z);
}
catch { image = null; }
}
--
Gitblit v1.9.3