|
|
@@ -474,8 +474,8 @@ namespace LeatherApp.Device |
|
|
{
|
|
|
{
|
|
|
if (Config.getDefectCode(DefectLabelInfoList[q].classId) == "jietou")
|
|
|
if (Config.getDefectCode(DefectLabelInfoList[q].classId) == "jietou")
|
|
|
{
|
|
|
{
|
|
|
int max = stpoint.y + 500;
|
|
|
|
|
|
int min = stpoint.y - 500 > 0? stpoint.y - 500:0;
|
|
|
|
|
|
|
|
|
int max = stpoint.y + 2000;
|
|
|
|
|
|
int min = stpoint.y - 2000 > 0? stpoint.y - 2000 : 0;
|
|
|
if (DefectLabelInfoList[q].y >= min && DefectLabelInfoList[q].y <= max)
|
|
|
if (DefectLabelInfoList[q].y >= min && DefectLabelInfoList[q].y <= max)
|
|
|
{
|
|
|
{
|
|
|
HeBingList.Add(DefectLabelInfoList[q]);
|
|
|
HeBingList.Add(DefectLabelInfoList[q]);
|
|
|
@@ -487,8 +487,8 @@ namespace LeatherApp.Device |
|
|
}
|
|
|
}
|
|
|
else if (Config.getDefectCode(DefectLabelInfoList[q].classId) == "hengdang")
|
|
|
else if (Config.getDefectCode(DefectLabelInfoList[q].classId) == "hengdang")
|
|
|
{
|
|
|
{
|
|
|
int max = stpoint.y + 500;
|
|
|
|
|
|
int min = stpoint.y - 500 > 0 ? stpoint.y - 500 : 0;
|
|
|
|
|
|
|
|
|
int max = stpoint.y + 2000;
|
|
|
|
|
|
int min = stpoint.y - 2000 > 0 ? stpoint.y - 2000 : 0;
|
|
|
if (DefectLabelInfoList[q].y >= min && DefectLabelInfoList[q].y <= max)
|
|
|
if (DefectLabelInfoList[q].y >= min && DefectLabelInfoList[q].y <= max)
|
|
|
{
|
|
|
{
|
|
|
HeBingList2.Add(DefectLabelInfoList[q]);
|
|
|
HeBingList2.Add(DefectLabelInfoList[q]);
|
|
|
@@ -500,8 +500,8 @@ namespace LeatherApp.Device |
|
|
}
|
|
|
}
|
|
|
else if (Config.getDefectCode(DefectLabelInfoList[q].classId) == "jt")
|
|
|
else if (Config.getDefectCode(DefectLabelInfoList[q].classId) == "jt")
|
|
|
{
|
|
|
{
|
|
|
int max = stpoint.y + 500;
|
|
|
|
|
|
int min = stpoint.y - 500 > 0 ? stpoint.y - 500 : 0;
|
|
|
|
|
|
|
|
|
int max = stpoint.y + 2000;
|
|
|
|
|
|
int min = stpoint.y - 2000 > 0 ? stpoint.y - 2000 : 0;
|
|
|
if (DefectLabelInfoList[q].y >= min && DefectLabelInfoList[q].y <= max)
|
|
|
if (DefectLabelInfoList[q].y >= min && DefectLabelInfoList[q].y <= max)
|
|
|
{
|
|
|
{
|
|
|
HeBingList3.Add(DefectLabelInfoList[q]);
|
|
|
HeBingList3.Add(DefectLabelInfoList[q]);
|
|
|
@@ -513,8 +513,8 @@ namespace LeatherApp.Device |
|
|
}
|
|
|
}
|
|
|
else if (Config.getDefectCode(DefectLabelInfoList[q].classId) == "tcy")
|
|
|
else if (Config.getDefectCode(DefectLabelInfoList[q].classId) == "tcy")
|
|
|
{
|
|
|
{
|
|
|
int max = stpoint.y + 500;
|
|
|
|
|
|
int min = stpoint.y - 500 > 0 ? stpoint.y - 500 : 0;
|
|
|
|
|
|
|
|
|
int max = stpoint.y + 2000;
|
|
|
|
|
|
int min = stpoint.y - 2000 > 0 ? stpoint.y - 2000 : 0;
|
|
|
if (DefectLabelInfoList[q].y >= min && DefectLabelInfoList[q].y <= max)
|
|
|
if (DefectLabelInfoList[q].y >= min && DefectLabelInfoList[q].y <= max)
|
|
|
{
|
|
|
{
|
|
|
HeBingList4.Add(DefectLabelInfoList[q]);
|
|
|
HeBingList4.Add(DefectLabelInfoList[q]);
|
|
|
@@ -548,11 +548,12 @@ namespace LeatherApp.Device |
|
|
var edIt = HeBingList.Find(x => (x.i % colNum) * image_width + x.x == xPos.Max());
|
|
|
var edIt = HeBingList.Find(x => (x.i % colNum) * image_width + x.x == xPos.Max());
|
|
|
var eZXD = HeBingList.Find(x => x.confidence == ZXD.Max());
|
|
|
var eZXD = HeBingList.Find(x => x.confidence == ZXD.Max());
|
|
|
int newW = Math.Abs(((edIt.i % colNum) * image_width + edIt.x) - ((stIt.i % colNum) * image_width + stIt.x)) + edIt.w;
|
|
|
int newW = Math.Abs(((edIt.i % colNum) * image_width + edIt.x) - ((stIt.i % colNum) * image_width + stIt.x)) + edIt.w;
|
|
|
|
|
|
int newh = Math.Abs(((edIt.i / colNum) * image_hight + edIt.y) - ((stIt.i / colNum) * image_hight + stIt.y)) + edIt.h;
|
|
|
outList.Add(new DefectLabelInfo() {
|
|
|
outList.Add(new DefectLabelInfo() {
|
|
|
x=stIt.x,
|
|
|
x=stIt.x,
|
|
|
y=edIt.y,
|
|
|
y=edIt.y,
|
|
|
w = newW, //多图叠加
|
|
|
w = newW, //多图叠加
|
|
|
h = edIt.h,
|
|
|
|
|
|
|
|
|
h = newh,
|
|
|
classId = eZXD.classId,
|
|
|
classId = eZXD.classId,
|
|
|
confidence = eZXD.confidence,
|
|
|
confidence = eZXD.confidence,
|
|
|
contrast = eZXD.contrast,
|
|
|
contrast = eZXD.contrast,
|
|
|
@@ -569,12 +570,13 @@ namespace LeatherApp.Device |
|
|
var edIt = HeBingList2.Find(x => (x.i % colNum) * image_width + x.x == xPos2.Max());
|
|
|
var edIt = HeBingList2.Find(x => (x.i % colNum) * image_width + x.x == xPos2.Max());
|
|
|
var eZXD = HeBingList2.Find(x => x.confidence == ZXD2.Max());
|
|
|
var eZXD = HeBingList2.Find(x => x.confidence == ZXD2.Max());
|
|
|
int newW = Math.Abs(((edIt.i % colNum) * image_width + edIt.x) - ((stIt.i % colNum) * image_width + stIt.x)) + edIt.w;
|
|
|
int newW = Math.Abs(((edIt.i % colNum) * image_width + edIt.x) - ((stIt.i % colNum) * image_width + stIt.x)) + edIt.w;
|
|
|
|
|
|
int newh = Math.Abs(((edIt.i / colNum) * image_hight + edIt.y) - ((stIt.i / colNum) * image_hight + stIt.y)) + edIt.h;
|
|
|
outList.Add(new DefectLabelInfo()
|
|
|
outList.Add(new DefectLabelInfo()
|
|
|
{
|
|
|
{
|
|
|
x = stIt.x,
|
|
|
x = stIt.x,
|
|
|
y = edIt.y,
|
|
|
y = edIt.y,
|
|
|
w = newW, //多图叠加
|
|
|
w = newW, //多图叠加
|
|
|
h = edIt.h,
|
|
|
|
|
|
|
|
|
h = newh,
|
|
|
classId = eZXD.classId,
|
|
|
classId = eZXD.classId,
|
|
|
confidence = eZXD.confidence,
|
|
|
confidence = eZXD.confidence,
|
|
|
contrast = eZXD.contrast,
|
|
|
contrast = eZXD.contrast,
|
|
|
@@ -591,12 +593,13 @@ namespace LeatherApp.Device |
|
|
var edIt = HeBingList3.Find(x => (x.i % colNum) * image_width + x.x == xPos3.Max());
|
|
|
var edIt = HeBingList3.Find(x => (x.i % colNum) * image_width + x.x == xPos3.Max());
|
|
|
var eZXD = HeBingList3.Find(x => x.confidence == ZXD3.Max());
|
|
|
var eZXD = HeBingList3.Find(x => x.confidence == ZXD3.Max());
|
|
|
int newW = Math.Abs(((edIt.i % colNum) * image_width + edIt.x) - ((stIt.i % colNum) * image_width + stIt.x)) + edIt.w;
|
|
|
int newW = Math.Abs(((edIt.i % colNum) * image_width + edIt.x) - ((stIt.i % colNum) * image_width + stIt.x)) + edIt.w;
|
|
|
|
|
|
int newh = Math.Abs(((edIt.i / colNum) * image_hight + edIt.y) - ((stIt.i / colNum) * image_hight + stIt.y)) + edIt.h;
|
|
|
outList.Add(new DefectLabelInfo()
|
|
|
outList.Add(new DefectLabelInfo()
|
|
|
{
|
|
|
{
|
|
|
x = stIt.x,
|
|
|
x = stIt.x,
|
|
|
y = edIt.y,
|
|
|
y = edIt.y,
|
|
|
w = newW, //多图叠加
|
|
|
w = newW, //多图叠加
|
|
|
h = edIt.h,
|
|
|
|
|
|
|
|
|
h = newh,
|
|
|
classId = eZXD.classId,
|
|
|
classId = eZXD.classId,
|
|
|
confidence = eZXD.confidence,
|
|
|
confidence = eZXD.confidence,
|
|
|
contrast = eZXD.contrast,
|
|
|
contrast = eZXD.contrast,
|
|
|
@@ -613,12 +616,13 @@ namespace LeatherApp.Device |
|
|
var edIt = HeBingList4.Find(x => (x.i % colNum) * image_width + x.x == xPos4.Max());
|
|
|
var edIt = HeBingList4.Find(x => (x.i % colNum) * image_width + x.x == xPos4.Max());
|
|
|
var eZXD = HeBingList4.Find(x => x.confidence == ZXD4.Max());
|
|
|
var eZXD = HeBingList4.Find(x => x.confidence == ZXD4.Max());
|
|
|
int newW = Math.Abs(((edIt.i % colNum) * image_width + edIt.x) - ((stIt.i % colNum) * image_width + stIt.x)) + edIt.w;
|
|
|
int newW = Math.Abs(((edIt.i % colNum) * image_width + edIt.x) - ((stIt.i % colNum) * image_width + stIt.x)) + edIt.w;
|
|
|
|
|
|
int newh = Math.Abs(((edIt.i / colNum) * image_hight + edIt.y) - ((stIt.i / colNum) * image_hight + stIt.y)) + edIt.h;
|
|
|
outList.Add(new DefectLabelInfo()
|
|
|
outList.Add(new DefectLabelInfo()
|
|
|
{
|
|
|
{
|
|
|
x = stIt.x,
|
|
|
x = stIt.x,
|
|
|
y = edIt.y,
|
|
|
y = edIt.y,
|
|
|
w = newW, //多图叠加
|
|
|
w = newW, //多图叠加
|
|
|
h = edIt.h,
|
|
|
|
|
|
|
|
|
h = newh,
|
|
|
classId = eZXD.classId,
|
|
|
classId = eZXD.classId,
|
|
|
confidence = eZXD.confidence,
|
|
|
confidence = eZXD.confidence,
|
|
|
contrast = eZXD.contrast,
|
|
|
contrast = eZXD.contrast,
|
|
|
|