ソースを参照

v2.0 修改打标大小

LianTong
CPL 1年前
コミット
1d273e4a3c
7個のファイルの変更13行の追加3行の削除
  1. バイナリ
     
  2. バイナリ
     
  3. バイナリ
     
  4. バイナリ
     
  5. バイナリ
     
  6. バイナリ
     
  7. +13
    -3
      LeatherProject/GeBoShi/ImageDefect/DefectLib.cs

バイナリ
ファイルの表示


バイナリ
ファイルの表示


バイナリ
ファイルの表示


バイナリ
ファイルの表示


バイナリ
ファイルの表示


バイナリ
ファイルの表示


+ 13
- 3
LeatherProject/GeBoShi/ImageDefect/DefectLib.cs ファイルの表示

@@ -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} 行缺陷信息;");


読み込み中…
キャンセル
保存