diff --git a/halftoneproject-master/BanBoShi/ImageProcessing/SizeLib.cs b/halftoneproject-master/BanBoShi/ImageProcessing/SizeLib.cs index 50217df0..107ea97b 100644 --- a/halftoneproject-master/BanBoShi/ImageProcessing/SizeLib.cs +++ b/halftoneproject-master/BanBoShi/ImageProcessing/SizeLib.cs @@ -273,18 +273,30 @@ namespace MaiMuAOI.ImageProcessing try { step = 6; - var posePT = ProcCall1_PI_PT.GetOutputCtrlParamTuple("posePT").DArr; + double[] posePTarr; + try + { + if (ProcCall1_PI_PT.GetOutputCtrlParamTuple("posePT") != null && + ProcCall1_PI_PT.GetOutputCtrlParamTuple("posePT").DArr != null) + posePTarr = ProcCall1_PI_PT.GetOutputCtrlParamTuple("posePT").DArr; + else + posePTarr = null; + } + catch { + posePTarr = null; + } + 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); + task.SaveMat = yolo5.DisplayLines(mat, posePTarr, task.index); } catch (Exception ex) { - //WarningEvent?.Invoke(WarningEnum.Low, $"SizeLib task err({step}) index({task.index}):" + ex.Message); + WarningEvent?.Invoke(WarningEnum.Low, $"SizeLib task err({step}) index({task.index}):" + ex.Message); task.SaveMat = null; } } diff --git a/halftoneproject-master/BanBoShi/SysCtrl/SysMgr.cs b/halftoneproject-master/BanBoShi/SysCtrl/SysMgr.cs index cd9a0cf7..63ce6c6c 100644 --- a/halftoneproject-master/BanBoShi/SysCtrl/SysMgr.cs +++ b/halftoneproject-master/BanBoShi/SysCtrl/SysMgr.cs @@ -8173,7 +8173,11 @@ namespace MaiMuAOI.SysCtrl path = Util.CreateSubDir(confMgr.SysConfigParams.SizeBigImag.SavePath, new List { order.CreateTime.ToString("yyyyMMdd"), order.SN }); path += $"Size_SN{order.SN}_I{res.index}_X{res.posX}_Y{res.posY}_{model.StepInfo.Name}"; if (res.SaveMat != null) + { + //显示 + //OnAutoRuning(new RunEventArgs(0, res.SaveMat)); res.SaveMat.ImWrite(path + "_DB.bmp"); + } } }