public static void drawIrisCircle(Mat matrixRgba, Core.MinMaxLocResult minMaxLocResult) { Imgproc.circle(matrixRgba, minMaxLocResult.minLoc, 2, new Scalar(255, 255, 255, 255), 2); }
public void mousePressed(MouseEvent e) { Imgproc.circle(image,new Point(e.getX(),e.getY()),20, new Scalar(0,0,255), 4); updateView(image); } });
private void drawCircles(Mat mat, List<CvStage.Result.Circle> circles, int numToDraw, Color color) { Color centerColor = new HslColor(color).getComplementary(); numToDraw = (numToDraw <= circles.size()) ? numToDraw : circles.size(); for (int i=0; i<numToDraw; i++) { CvStage.Result.Circle circle = circles.get(i); double x = circle.x; double y = circle.y; double radius = circle.diameter / 2.0; Imgproc.circle(mat, new Point(x, y), (int) radius, FluentCv.colorToScalar(color), 2); Imgproc.circle(mat, new Point(x, y), 1, FluentCv.colorToScalar(centerColor), 2); } }
public static Mat drawCircles(Mat mat, Mat circles) { for (int i = 0; i < circles.cols(); i++) { double[] circle = circles.get(0, i); double x = circle[0]; double y = circle[1]; double radius = circle[2]; Imgproc.circle(mat, new Point(x, y), (int) radius, new Scalar(0, 0, 255, 255), 2); Imgproc.circle(mat, new Point(x, y), 1, new Scalar(0, 255, 0, 255), 2); } return mat; }
@Override public Result process(CvPipeline pipeline) throws Exception { if (circlesStageName == null) { return null; } Result result = pipeline.getResult(circlesStageName); if (result == null || result.model == null) { return null; } Mat mat = pipeline.getWorkingImage(); List<Result.Circle> circles = (List<Result.Circle>) result.model; for (int i = 0; i < circles.size(); i++) { Result.Circle circle = circles.get(i); Color color = this.color == null ? FluentCv.indexedColor(i) : this.color; Color centerColor = this.centerColor == null ? new HslColor(color).getComplementary() : this.centerColor; Imgproc.circle(mat, new Point(circle.x, circle.y), (int) (circle.diameter / 2), FluentCv.colorToScalar(color), thickness); Imgproc.circle(mat, new Point(circle.x, circle.y), 1, FluentCv.colorToScalar(centerColor), 2); } return null; } }
FluentCv.drawRotatedRect(mat, rect, thecolor, thickness); if (drawRectCenter) { Imgproc.circle(mat, rect.center, rectCenterRadius, FluentCv.colorToScalar(thecolor), thickness);
public static void drawFaceShapes(Rect face, Mat matrixRGBA) { Point start = face.tl(); int h = (int) start.y + (face.height / 2); int w = (int) start.x + (face.width / 2); Imgproc.rectangle(matrixRGBA, start, face.br(), FACE_RECT_COLOR, 3); Point center = new Point(w, h); Imgproc.circle(matrixRGBA, center, 10, new Scalar(255, 0, 0, 255), 3); }
private void drawEnclosingCircle(MatOfPoint currentContour) { float[] radius = new float[1]; Point center = new Point(); MatOfPoint2f currentContour2f = new MatOfPoint2f(); currentContour.convertTo(currentContour2f, CvType.CV_32FC2); Imgproc.minEnclosingCircle(currentContour2f, center, radius); Imgproc.circle(image, center, (int) radius[0], new Scalar(255,0,0)); }
if (coords.length == 3) { Imgproc.circle(mask, new Point(Integer.parseInt(coords[0]), Integer.parseInt(coords[1])), Integer.parseInt(coords[2]), new Scalar(255, 255, 255), -1);
/** * Draw circles from the current Mat contained onto the Mat specified in baseTag using the * specified color, optionally storing the results in tag. The current Mat is replaced with the * Mat from baseTag with the circles drawn on top of it. * * @param baseTag * @param color * @param tag * @return */ public FluentCv drawCircles(String baseTag, Color color, String... tag) { Color centerColor = new HslColor(color).getComplementary(); Mat mat = get(baseTag); if (mat == null) { mat = new Mat(); } for (int i = 0; i < this.mat.cols(); i++) { double[] circle = this.mat.get(0, i); double x = circle[0]; double y = circle[1]; double radius = circle[2]; Imgproc.circle(mat, new Point(x, y), (int) radius, colorToScalar(color), 2); Imgproc.circle(mat, new Point(x, y), 1, colorToScalar(centerColor), 2); } return store(mat, tag); }
Point openCvCenter = new Point(vecCenter.getX(), vecCenter.getY()); int circleRadius = (int) circles.get(i).getRadius(); Imgproc.circle(openCVColoredCircularBlobDetector.getCurrentCameraFrameMatInBGR(), openCvCenter, circleRadius, circleColor, 1); Imgproc.circle(openCVColoredCircularBlobDetector.getThresholdMat(), openCvCenter, circleRadius, circleColor, 1);
Point openCvCenter = new Point(vecCenter.getX(), vecCenter.getY()); int circleRadius = (int) circles.get(i).getRadius(); Imgproc.circle(openCVColoredCircularBlobDetector.getCurrentCameraFrameMatInBGR(), openCvCenter, circleRadius, circleColor, 1); Imgproc.circle(openCVColoredCircularBlobDetector.getThresholdMat(), openCvCenter, circleRadius, circleColor, 1);
@Override public Result process(CvPipeline pipeline) throws Exception { Mat mat = pipeline.getWorkingImage(); Mat mask = mat.clone(); Mat masked = mat.clone(); Scalar color = FluentCv.colorToScalar(Color.black); mask.setTo(color); masked.setTo(color); Imgproc.circle(mask, new Point(mat.cols() / 2, mat.rows() / 2), Math.abs(diameter) / 2, new Scalar(255, 255, 255), -1); if(diameter < 0) { Core.bitwise_not(mask,mask); } mat.copyTo(masked, mask); mask.release(); return new Result(masked); } }
int radius = (int) Math.round(circles.get(0, i)[2]); Imgproc.circle( image, center, radius, new Scalar(0,255,0),3);//radius, color)
Imgproc.circle(originalImageAnnotated, srcPoints[i], 4, new Scalar (255.0,0,0),-1);