Commit 9bdb6abc 刘韬

1

1 个父辈 64fe067f
...@@ -183,6 +183,8 @@ namespace Asa ...@@ -183,6 +183,8 @@ namespace Asa
int[] ipReelNum = new int[4]; int[] ipReelNum = new int[4];
setSkipProcessID(-1); setSkipProcessID(-1);
try
{
int n = eyemCountObjectE(eyem, tpRoi, outfilename, ipReelNum, out EyemImage tpDstImg); int n = eyemCountObjectE(eyem, tpRoi, outfilename, ipReelNum, out EyemImage tpDstImg);
count = ipReelNum; count = ipReelNum;
if (n == 0) if (n == 0)
...@@ -190,6 +192,11 @@ namespace Asa ...@@ -190,6 +192,11 @@ namespace Asa
eyemImageFree(ref tpDstImg); eyemImageFree(ref tpDstImg);
return n; return n;
} }
catch {
count = new int[4];
return -999;
}
}
//[HandleProcessCorruptedStateExceptions] //[HandleProcessCorruptedStateExceptions]
//public static int GetLocalCountE(EyemImage eyem, EyemRect? tpRoi, string outfilename, double dOffset, int iWinSize, out string count, out EyemImage tpDstImg) //public static int GetLocalCountE(EyemImage eyem, EyemRect? tpRoi, string outfilename, double dOffset, int iWinSize, out string count, out EyemImage tpDstImg)
......
...@@ -5,6 +5,7 @@ using System.Drawing; ...@@ -5,6 +5,7 @@ using System.Drawing;
using System.Drawing.Imaging; using System.Drawing.Imaging;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using System.Runtime.ExceptionServices;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
...@@ -35,6 +36,7 @@ namespace Asa ...@@ -35,6 +36,7 @@ namespace Asa
//普通器件(新版本新算法) //普通器件(新版本新算法)
[DllImport("eyemLib.dll", CharSet = CharSet.None, CallingConvention = CallingConvention.Cdecl)] [DllImport("eyemLib.dll", CharSet = CharSet.None, CallingConvention = CallingConvention.Cdecl)]
[HandleProcessCorruptedStateExceptions]
public static extern int eyemCountObjectE(EyemImage tpImage, EyemRect tpRoi, string fileName, [MarshalAs(UnmanagedType.LPArray)] int[] ipReelNum, out EyemImage tpDstImg); public static extern int eyemCountObjectE(EyemImage tpImage, EyemRect tpRoi, string fileName, [MarshalAs(UnmanagedType.LPArray)] int[] ipReelNum, out EyemImage tpDstImg);
//异型器件(新版本模板匹配) //异型器件(新版本模板匹配)
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!