Commit 34134cee 顾剑亮

输出图像由EyemImage改为Bitmap

1 个父辈 067a7372
......@@ -130,37 +130,40 @@ namespace Asa
/// <param name="tpDstImg"></param>
/// <returns></returns>
[HandleProcessCorruptedStateExceptions]
public static int GetLocalCount(string path, int ShrinkOffset, out int[] count, out EyemImage tpDstImg)
public static int GetLocalCount(string path, int ShrinkOffset, out int[] count, out Bitmap BmpDstImg)
{
count = null;
tpDstImg = new EyemImage();
BmpDstImg = null;
string fileName = Path.GetFileNameWithoutExtension(path);
int flag = eyemImageRead(path, -1, out EyemImage eyem);
if (flag != 0) return -1;
int n = GetLocalCount(eyem, ShrinkOffset, fileName, out count, out tpDstImg);
int n = GetLocalCount(eyem, ShrinkOffset, fileName, out count, out BmpDstImg);
eyemImageFree(ref eyem);
return n;
}
[HandleProcessCorruptedStateExceptions]
public static int GetLocalCount(EyemImage eyem, int ShrinkOffset, string outfilename, out int[] count, out EyemImage tpDstImg)
public static int GetLocalCount(EyemImage eyem, int ShrinkOffset, string outfilename, out int[] count, out Bitmap BmpDstImg)
{
var tpRoi = new EyemRect();
tpRoi.iXs = 0 + ShrinkOffset;
tpRoi.iYs = 0 + ShrinkOffset;
tpRoi.iWidth = eyem.iWidth - ShrinkOffset * 2;
tpRoi.iHeight = eyem.iHeight - ShrinkOffset * 2;
int n;
BmpDstImg = null;
EyemRect tpRoi = new EyemRect
{
iXs = 0 + ShrinkOffset,
iYs = 0 + ShrinkOffset,
iWidth = eyem.iWidth - ShrinkOffset * 2,
iHeight = eyem.iHeight - ShrinkOffset * 2
};
int[] ipReelNum = new int[4];
setSkipProcessID(-1);
n = eyemCountObjectE(eyem, tpRoi, outfilename, ipReelNum, out tpDstImg);
int n = eyemCountObjectE(eyem, tpRoi, outfilename, ipReelNum, out EyemImage tpDstImg);
count = ipReelNum;
if (n == 0)
BmpDstImg = eyemCvtToBitmap(tpDstImg);
eyemImageFree(ref tpDstImg);
return n;
}
......@@ -194,36 +197,41 @@ namespace Asa
/// <param name="tpDstImg"></param>
/// <returns></returns>
[HandleProcessCorruptedStateExceptions]
public static int GetLocalCountIrregular(string path, int ShrinkOffset, string type, out int[] count, out EyemImage tpDstImg)
public static int GetLocalCountIrregular(string path, int ShrinkOffset, string type, out int[] count, out Bitmap BmpDstImg)
{
count = null;
tpDstImg = new EyemImage();
BmpDstImg = null;
string fileName = Path.GetFileNameWithoutExtension(path);
int flag = eyemImageRead(path, -1, out EyemImage eyem);
if (flag != 0) return -1;
int n = GetLocalCountIrregular(eyem, ShrinkOffset, fileName, type, out count, out tpDstImg);
int n = GetLocalCountIrregular(eyem, ShrinkOffset, fileName, type, out count, out BmpDstImg);
eyemImageFree(ref eyem);
return n;
}
[HandleProcessCorruptedStateExceptions]
public static int GetLocalCountIrregular(EyemImage eyem, int ShrinkOffset, string outfilename, string type, out int[] count, out EyemImage tpDstImg)
public static int GetLocalCountIrregular(EyemImage eyem, int ShrinkOffset, string outfilename, string type, out int[] count, out Bitmap BmpDstImg)
{
int n;
BmpDstImg = null;
var tpRoi = new EyemRect();
tpRoi.iXs = 0 + ShrinkOffset;
tpRoi.iYs = 0 + ShrinkOffset;
tpRoi.iWidth = eyem.iWidth - ShrinkOffset * 2;
tpRoi.iHeight = eyem.iHeight - ShrinkOffset * 2;
EyemRect tpRoi = new EyemRect
{
iXs = 0 + ShrinkOffset,
iYs = 0 + ShrinkOffset,
iWidth = eyem.iWidth - ShrinkOffset * 2,
iHeight = eyem.iHeight - ShrinkOffset * 2
};
setSkipProcessID(-1);
int[] ipReelNum = new int[4];
n = eyemCountObjectIrregularParts(eyem, tpRoi, outfilename, type, ipReelNum, out tpDstImg);
int n = eyemCountObjectIrregularParts(eyem, tpRoi, outfilename, type, ipReelNum, out EyemImage tpDstImg);
count = ipReelNum;
if (n == 0)
BmpDstImg = eyemCvtToBitmap(tpDstImg);
eyemImageFree(ref tpDstImg);
return n;
}
......@@ -276,9 +284,7 @@ namespace Asa
n = eyemCountObjectIrregularPartsE(eyem, tpRoi, outfilename, selectModel, hModelIDs, ipReelNum, out tpDstImg);
count = ipReelNum;
if (n == 0)
{
BmpDstImg = eyemCvtToBitmap(tpDstImg);
}
eyemImageFree(ref tpDstImg);
return n;
}
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!