|
|
|
@@ -1,6 +1,7 @@ |
|
|
|
using HalconDotNet;
|
|
|
|
using MaiMuAOI.SysCtrl;
|
|
|
|
using MaiMuControl.Device;
|
|
|
|
using MaiMuControl.Device.CamDev;
|
|
|
|
using Newtonsoft.Json;
|
|
|
|
using Newtonsoft.Json.Linq;
|
|
|
|
using OpenCvSharp;
|
|
|
|
@@ -265,6 +266,30 @@ namespace MaiMuAOI.ImageProcessing |
|
|
|
task.offsetY = (double)ProcCall1_PI_PT.GetOutputCtrlParamTuple("offsetY");
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
step = 5;
|
|
|
|
//尺寸标注
|
|
|
|
if (task.index != 3333)
|
|
|
|
{
|
|
|
|
try
|
|
|
|
{
|
|
|
|
step = 6;
|
|
|
|
var posePT = ProcCall1_PI_PT.GetOutputCtrlParamTuple("posePT").DArr;
|
|
|
|
step = 7;
|
|
|
|
//Yolo_Class yolo = new Yolo_Class();
|
|
|
|
step = 8;
|
|
|
|
var mat = CamDev.HImageToMat(image);
|
|
|
|
step = 9;
|
|
|
|
//task.SaveMat = yolo.DisplayLines(mat, posePT, task.index).Clone();
|
|
|
|
task.SaveMat = yolo5.DisplayLines(mat, posePT, task.index);
|
|
|
|
}
|
|
|
|
catch (Exception ex)
|
|
|
|
{
|
|
|
|
//WarningEvent?.Invoke(WarningEnum.Low, $"SizeLib task err({step}) index({task.index}):" + ex.Message);
|
|
|
|
task.SaveMat = null;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
step = 100;
|
|
|
|
ProcCall1_PI_PT.Dispose();
|
|
|
|
Program1.Dispose();
|
|
|
|
@@ -343,6 +368,8 @@ namespace MaiMuAOI.ImageProcessing |
|
|
|
public double PT1,PT2, Shanxian, Circle_Ymm, Circle_Xmm, offsetX, offsetY;
|
|
|
|
public bool isSucceed;//转换是否成功
|
|
|
|
public string resultInfo = "";//成功或失败信息
|
|
|
|
|
|
|
|
public Mat SaveMat;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void add(SizeTask task)
|
|
|
|
|