소스 검색

v2.0 修改打标大小

LianTong
CPL 1 년 전
부모
커밋
1d273e4a3c
7개의 변경된 파일13개의 추가작업 그리고 3개의 파일을 삭제
  1. BIN
     
  2. BIN
     
  3. BIN
     
  4. BIN
     
  5. BIN
     
  6. BIN
     
  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} 行缺陷信息;");


불러오는 중...
취소
저장