|
|
|
@@ -811,14 +811,24 @@ namespace GeBoShi.ImageDefect |
|
|
|
step++;
|
|
|
|
//1
|
|
|
|
int penLine = 20;
|
|
|
|
int DB_W = 0, DB_H = 0;
|
|
|
|
int kzWidth = 500;
|
|
|
|
if (DefectLabelInfoList[q].w < kzWidth)
|
|
|
|
DB_W = kzWidth;
|
|
|
|
else
|
|
|
|
DB_W = DefectLabelInfoList[q].w;
|
|
|
|
if (DefectLabelInfoList[q].h < kzWidth)
|
|
|
|
DB_H = kzWidth;
|
|
|
|
else
|
|
|
|
DB_H = DefectLabelInfoList[q].h;
|
|
|
|
//打标
|
|
|
|
var point1 = new OpenCvSharp.Point((DefectLabelInfoList[q].i % colNum) * image_width + DefectLabelInfoList[q].x - penLine / 2, (DefectLabelInfoList[q].i / colNum) * image_hight + DefectLabelInfoList[q].y - penLine / 2);
|
|
|
|
var point2 = new OpenCvSharp.Point(point1.X + DefectLabelInfoList[q].w + penLine / 2, point1.Y + DefectLabelInfoList[q].h + penLine / 2);
|
|
|
|
var point1 = new OpenCvSharp.Point((DefectLabelInfoList[q].i % colNum) * image_width + DefectLabelInfoList[q].x - penLine / 2 - (kzWidth /2 - DefectLabelInfoList[q].w/2), (DefectLabelInfoList[q].i / colNum) * image_hight + DefectLabelInfoList[q].y - penLine / 2 - (kzWidth / 2 - DefectLabelInfoList[q].h / 2));
|
|
|
|
var point2 = new OpenCvSharp.Point(point1.X + DB_W + penLine / 2, point1.Y + DB_H + penLine / 2);
|
|
|
|
step++;//2
|
|
|
|
task.resultInfo += $" 转换到大图坐标(px):p1={point1.X},{point1.Y}; p2={point2.X},{point2.Y}\n";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//大图打标
|
|
|
|
Cv2.Rectangle(task.bmpTag, point1, point2, new Scalar(0.0, 0.0, 255.0), penLine);//画打标点
|
|
|
|
|
|
|
|
//WarningEvent?.Invoke(DateTime.Now,WarningEnum.Low, $"保存第 {count} 行缺陷信息;");
|
|
|
|
|