public class OpenCvUtils
extends java.lang.Object
Constructor and Description |
---|
OpenCvUtils() |
Modifier and Type | Method and Description |
---|---|
static java.awt.image.BufferedImage |
createFootprintTemplate(Camera camera,
Footprint footprint,
double rotation,
boolean topView,
java.awt.Color padsColor,
java.awt.Color bodyColor,
java.awt.Color backgroundColor,
double marginFactor,
int minimumMarginSize)
Draws a template image of the given footprint.
|
static Mat |
drawCircles(Mat mat,
Mat circles) |
static Mat |
gaussianBlur(Mat mat,
int kernel)
Perform an in place gaussian blur on the given Mat with a kernel of size kernel x kernel.
|
static java.util.List<Location> |
houghCircles(Camera camera,
Length minDiameter,
Length maxDiameter,
Length minDistance)
Finds circles of the given min and maxDiameter, no less than minDistance apart by capturing
an image from the given Camera.
|
static Mat |
houghCircles(Mat mat,
double minDiameter,
double maxDiameter,
double minDistance) |
static java.util.List<java.awt.Point> |
matMaxima(Mat mat,
double rangeMin,
double rangeMax)
Ported from the C++ version in FireSight by Karl Lew, which is licensed under the
MIT license.
|
static void |
saveDebugImage(java.lang.Class implementationClass,
java.lang.String function,
java.lang.String identifier,
java.awt.image.BufferedImage img) |
static void |
saveDebugImage(java.lang.Class implementationClass,
java.lang.String function,
java.lang.String identifier,
Mat mat) |
static Mat |
thresholdAdaptive(Mat mat,
boolean invert) |
static Mat |
thresholdOtsu(Mat mat,
boolean invert) |
static java.awt.image.BufferedImage |
toBufferedImage(Mat m) |
static Mat |
toGray(Mat mat)
Convert the given Mat to grayscale.
|
static Mat |
toMat(java.awt.image.BufferedImage img) |
static Mat |
toRGB(Mat mat)
Convert the given Mat to RGB.
|
static Mat |
toRGB(Mat image,
FluentCv.ColorSpace colorSpace)
Convert the given Mat to True Color RGB from the given ColorSpace.
|
public static java.awt.image.BufferedImage toBufferedImage(Mat m)
public static Mat toMat(java.awt.image.BufferedImage img)
public static java.util.List<Location> houghCircles(Camera camera, Length minDiameter, Length maxDiameter, Length minDistance) throws java.lang.Exception
camera
- minDiameter
- maxDiameter
- minDistance
- java.lang.Exception
public static Mat houghCircles(Mat mat, double minDiameter, double maxDiameter, double minDistance)
public static Mat toGray(Mat mat)
mat
- public static Mat toRGB(Mat mat)
mat
- public static Mat toRGB(Mat image, FluentCv.ColorSpace colorSpace) throws java.lang.Exception
image
- colorSpace
- java.lang.Exception
public static Mat gaussianBlur(Mat mat, int kernel)
mat
- kernel
- public static Mat drawCircles(Mat mat, Mat circles)
public static Mat thresholdAdaptive(Mat mat, boolean invert)
public static Mat thresholdOtsu(Mat mat, boolean invert)
public static void saveDebugImage(java.lang.Class implementationClass, java.lang.String function, java.lang.String identifier, java.awt.image.BufferedImage img)
public static void saveDebugImage(java.lang.Class implementationClass, java.lang.String function, java.lang.String identifier, Mat mat)
public static java.awt.image.BufferedImage createFootprintTemplate(Camera camera, Footprint footprint, double rotation, boolean topView, java.awt.Color padsColor, java.awt.Color bodyColor, java.awt.Color backgroundColor, double marginFactor, int minimumMarginSize) throws java.lang.Exception
camera
- The camera to get the pixel scale from.footprint
- Footprint to be drawn.topView
- Whether the body is drawn over the pads rather than vice versa.padsColor
- Color of the pads. Pads are not drawn if null.bodyColor
- Color of the body. Body is not drawn if null.backgroundColor
- marginFactor
- The margin around the Footprint, relative to its bounding rectangle.minimumMarginSize
- java.lang.Exception
public static java.util.List<java.awt.Point> matMaxima(Mat mat, double rangeMin, double rangeMax)
mat
- rangeMin
- rangeMax
-