public class Contour extends Image
Modifier and Type | Field and Description |
---|---|
org.opencv.core.Point |
coords |
org.opencv.core.MatOfPoint |
mop |
org.opencv.core.MatOfPoint2f |
mop2f |
protected Rectangle |
rect |
org.opencv.core.RotatedRect |
rotatedRect |
Constructor and Description |
---|
Contour(org.opencv.core.MatOfPoint mop)
Creates a Contour from a MatOfPoint.
|
Contour(org.opencv.core.MatOfPoint2f mop2f)
Creates a Contour from a MatOfPoint2f.
|
Modifier and Type | Method and Description |
---|---|
Contour |
approxEdges(double precision)
Approximates the edges of this Contour.
|
double |
getArea()
Gets the area of this Image.
|
Rectangle |
getBoundingBox()
Gets a Rectangle that surrounds this Image.
|
double |
getHeight()
Gets the height of this Image.
|
org.opencv.core.MatOfPoint |
getMatOfPoint()
Gets the MatOfPoint.
|
org.opencv.core.MatOfPoint2f |
getMatOfPoint2f()
Gets the MatOfPoint2f.
|
double |
getMiddleX()
Gets the X coordinate of the middle of this Contour.
|
double |
getMiddleY()
Gets the Y coordinate of the middle of this Contour.
|
double |
getWidth()
Gets the width of this Image.
|
double |
getX()
Gets the X coordinate of this Contour.
|
double |
getY()
Gets the Y coordinate of this Contour.
|
boolean |
isConvex()
Checks if this Contour is convex.
|
static java.util.List<org.opencv.core.MatOfPoint> |
toMatOfPoint(java.util.List<Contour> cons)
Converts a List of Contours to a List of MatOfPoint.
|
compareTo, copy, drawArrow, drawCircle, drawContours, drawLine, drawLine, drawLine, drawRectangle, drawRectangle, drawText, fromFile, getContours, getFaces, getMat, inRange, release, resize, saveAs, setMat, toBytes, toHSV
public org.opencv.core.Point coords
public org.opencv.core.MatOfPoint mop
public org.opencv.core.MatOfPoint2f mop2f
protected Rectangle rect
public org.opencv.core.RotatedRect rotatedRect
public Contour(org.opencv.core.MatOfPoint mop)
mop
- The MatOfPoint.public Contour(org.opencv.core.MatOfPoint2f mop2f)
mop2f
- The MatOfPoint2f.public double getArea()
public Rectangle getBoundingBox()
public double getX()
public double getY()
public double getWidth()
Image
public double getHeight()
Image
public double getMiddleX()
public double getMiddleY()
public boolean isConvex()
public org.opencv.core.MatOfPoint getMatOfPoint()
public org.opencv.core.MatOfPoint2f getMatOfPoint2f()
public Contour approxEdges(double precision)
precision
- How precise the approximated edges should be. 0.01 is a good number to start with.public static java.util.List<org.opencv.core.MatOfPoint> toMatOfPoint(java.util.List<Contour> cons)
cons
- The Contours to convert.