org.opencv.imgproc.Imgproc.line()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(3.0k)|赞(0)|评价(0)|浏览(251)

本文整理了Java中org.opencv.imgproc.Imgproc.line()方法的一些代码示例,展示了Imgproc.line()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Imgproc.line()方法的具体详情如下:
包路径:org.opencv.imgproc.Imgproc
类名称:Imgproc
方法名:line

Imgproc.line介绍

暂无

代码示例

代码示例来源:origin: openpnp/openpnp

public void drawOrientationMark(Mat image, RotatedRect rrect, Scalar color, int thickness) {
  double markAngle = Math.toRadians(rrect.angle - 90.0);
  Imgproc.line(image, rrect.center,
      new Point(rrect.center.x + 1.2 * rrect.size.height / 2.0 * Math.cos(markAngle),
          rrect.center.y + 1.2 * rrect.size.height / 2.0 * Math.sin(markAngle)),
      color, Math.abs(thickness));
}

代码示例来源:origin: openpnp/openpnp

private void drawLine(Mat mat, Ransac.Line line, Color color, int thickness) {
  Imgproc.line(mat, line.a, line.b, FluentCv.colorToScalar(color), thickness);
}

代码示例来源:origin: openpnp/openpnp

public static void drawRotatedRect(Mat mat, RotatedRect rect, Color color, int thickness) {
  Point points[] = new Point[4];
  rect.points(points);
  Scalar color_ = colorToScalar(color);
  for (int j = 0; j < 4; ++j) {
    Imgproc.line(mat, points[j], points[(j + 1) % 4], color_, thickness);
  }
}

代码示例来源:origin: openpnp/openpnp

@Override
  public Result process(CvPipeline pipeline) throws Exception {
    Mat mat = pipeline.getWorkingImage();
    if (showImageCenter) {
      int cx = (int)mat.size().width/2;
      int cy = (int)mat.size().height/2;
      Scalar c = FluentCv.colorToScalar( color == null ? FluentCv.indexedColor(0) : color);
      Imgproc.line(mat,new Point(cx - size/2,cy), new Point(cx + size/2,cy), c, thickness);
      Imgproc.line(mat,new Point(cx,cy - size/2), new Point(cx,cy + size/2), c, thickness);
    }
    return new Result(mat);
  }
}

代码示例来源:origin: openpnp/openpnp

/**
 * Get the current working image. Primarily intended to be called from CvStage implementations.
 * 
 * @return
 */
public Mat getWorkingImage() {
  if (workingImage == null || (workingImage.cols() == 0 && workingImage.rows() == 0)) {
    workingImage = new Mat(480, 640, CvType.CV_8UC3, new Scalar(0, 0, 0));
    Imgproc.line(workingImage, new Point(0, 0), new Point(640, 480), new Scalar(0, 0, 255));
    Imgproc.line(workingImage, new Point(640, 0), new Point(0, 480), new Scalar(0, 0, 255));
  }
  return workingImage;
}

代码示例来源:origin: openpnp/openpnp

q.y = img.rows();
Imgproc.line(img, p, q, colorToScalar(color));

代码示例来源:origin: JavaOpenCVBook/code

Imgproc.line(originalImageAnnotated,srcPoints[0], srcPoints[1], new Scalar( 255.0,0,0), 2);
Imgproc.line(originalImageAnnotated,srcPoints[1], srcPoints[3], new Scalar( 255.0,0,0), 2);
Imgproc.line(originalImageAnnotated,srcPoints[3], srcPoints[2], new Scalar( 255.0,0,0), 2);
Imgproc.line(originalImageAnnotated,srcPoints[2], srcPoints[0], new Scalar( 255.0,0,0), 2);

代码示例来源:origin: JavaOpenCVBook/code

pt2.y = Math.round(y0 - 1000*(a));
 Imgproc.line( image, pt1, pt2, new Scalar(255,0,0), 2, Core.LINE_AA,0);
double d = lines.get(0, i)[3];
Imgproc.line( image, new Point(a, b), new Point(c, d), new Scalar(0,0,255), 1, Core.LINE_AA,0);

代码示例来源:origin: com.infotel.seleniumRobot/core

p4.set(new double[] {p4.x + objectImageMat.cols(), p4.y});
Imgproc.line(imgMatch, p1, p2, new Scalar(0, 255, 0),1);
Imgproc.line(imgMatch, p2, p3, new Scalar(0, 255, 0),1);
Imgproc.line(imgMatch, p3, p4, new Scalar(0, 255, 0),1);
Imgproc.line(imgMatch, p4, p1, new Scalar(0, 255, 0),1);

相关文章

微信公众号

最新文章

更多

Imgproc类方法