public class Image
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected org.opencv.core.Mat |
m |
Modifier and Type | Method and Description |
---|---|
double |
compareTo(Image i)
Compares this Image to another Image.
|
Image |
copy()
Creates an identical copy of this Image.
|
void |
drawArrow(double x,
double y,
double x2,
double y2,
Color c)
Draws an arrow on this Image.
|
void |
drawCircle(int x,
int y,
int radius,
Color c)
Draws a circle on this Image.
|
void |
drawContours(java.util.List<Contour> con,
Color c)
Draws Contours onto this Image.
|
void |
drawLine(int x,
Color c)
Draws a centered line the length of this Image onto this Image.
|
void |
drawLine(int x,
int height,
Color c)
Draws a centered line on this Image.
|
void |
drawLine(int x,
int y,
int height,
Color c)
Draws a line on this Image.
|
void |
drawRectangle(int x,
int y,
int x2,
int y2,
Color c)
Draws a Rectangle on this Image.
|
void |
drawRectangle(Rectangle r,
Color c)
Draws a Rectangle on this Image.
|
void |
drawText(java.lang.String text,
int x,
int y,
double scale,
Color color)
Draws text on this Image.
|
static Image |
fromFile(java.lang.String fileName)
Creates an Image from an existing image file.
|
java.util.List<Contour> |
getContours()
Gets the Contours in this Image.
|
java.util.List<Rectangle> |
getFaces()
Gets all the human faces in this Image.
|
double |
getHeight()
Gets the height of this Image.
|
org.opencv.core.Mat |
getMat()
Gets the internal Map of this Image.
|
double |
getWidth()
Gets the width of this Image.
|
Image |
inRange(BCNScalar low,
BCNScalar high)
Finds objects within a certain range.
|
void |
release()
Releases this Image from memory.
|
Image |
resize(int width,
int height)
Creates a resized version of this Image.
|
void |
saveAs(java.lang.String fileName)
Saves this Image as a file.
|
void |
setMat(org.opencv.core.Mat newMat)
Sets the internal Map of this Image.
|
byte[] |
toBytes()
Converts this Image to a byte array.
|
void |
toHSV()
Converts this image to HSV.
|
public double getWidth()
public double getHeight()
public java.util.List<Contour> getContours()
public java.util.List<Rectangle> getFaces()
public Image inRange(BCNScalar low, BCNScalar high)
low
- The lowest value.high
- The highest value.public void toHSV()
public Image copy()
public void drawLine(int x, int y, int height, Color c)
x
- The X coordinate of the line.y
- The Y coordinate of the line.height
- The height of the line.c
- The Color of the line.public void drawLine(int x, int height, Color c)
x
- The X coordinate of the line.height
- The height of the line.c
- The Color of the line.public void drawLine(int x, Color c)
x
- The X coordinate of the line.c
- The Color of the line.public void drawRectangle(Rectangle r, Color c)
r
- The Rectangle to draw.c
- The Color of the Rectangle.public void drawRectangle(int x, int y, int x2, int y2, Color c)
x
- The X coordinate of the Rectangle.y
- The Y coordinate of the Rectangle.x2
- The second X coordinate of the Rectangle.y2
- The second Y coordinate of the Rectangle.c
- The Color of the Rectangle.public void drawCircle(int x, int y, int radius, Color c)
x
- The X coordinate of the center of the circle.y
- The Y coordinate of the center of the circle.radius
- The radius of the circle.c
- The Color of the circle.public void drawContours(java.util.List<Contour> con, Color c)
con
- The Contours to be drawn.c
- The Color of the Contours.public void drawArrow(double x, double y, double x2, double y2, Color c)
x
- The X coordinate of the arrow.y
- The Y coordinate of the arrow.x2
- The second X coordinate of the arrow.y2
- The second Y coordinate of the arrow.c
- The Color of the arrow.public void drawText(java.lang.String text, int x, int y, double scale, Color color)
text
- The text to be drawn.x
- The X coordinate of the text's starting point.y
- The Y coordinate of the text's starting point.scale
- The scale of the text.color
- The Color of the text.public double compareTo(Image i)
i
- The Image this Image is being compared to.public Image resize(int width, int height)
public byte[] toBytes()
public void saveAs(java.lang.String fileName)
fileName
- The name of the file.public void release()
public org.opencv.core.Mat getMat()
public void setMat(org.opencv.core.Mat newMat)
newMat
- The new Map to be used.public static Image fromFile(java.lang.String fileName)
fileName
- The name of the image file.