public class VisionUtils
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
PIPELINE_CONTROL_PROPERTY_NAME |
static java.lang.String |
PIPELINE_RESULTS_NAME |
Constructor and Description |
---|
VisionUtils() |
Modifier and Type | Method and Description |
---|---|
static long[][] |
computeImageHistogram(java.awt.image.BufferedImage image)
Compute an RGB histogram over the provided image.
|
static long[][] |
computeImageHistogramHsv(java.awt.image.BufferedImage image)
Compute an HSV histogram over the provided image.
|
static PartAlignment.PartAlignmentOffset |
findPartAlignmentOffsets(PartAlignment p,
Part part,
BoardLocation boardLocation,
Location placementLocation,
Nozzle nozzle) |
static Camera |
getBottomVisionCamera() |
static Point |
getLocationPixelCenterOffsets(Camera camera,
HeadMountable tool,
Location location)
Get a location camera center offsets in pixels.
|
static Point |
getLocationPixelCenterOffsets(Camera camera,
Location location)
Get a location camera center offsets in pixels.
|
static Point |
getLocationPixels(Camera camera,
HeadMountable tool,
Location location)
Get a location in camera pixels.
|
static Point |
getLocationPixels(Camera camera,
Location location)
Get a location in camera pixels.
|
static double |
getPixelAngle(Camera camera,
double angle)
Get an angle in the OpenPNP coordinate system from an angle in the camera pixel
coordinate system.
|
static Location |
getPixelCenterOffsets(Camera camera,
double x,
double y)
Given pixel coordinates within the frame of the Camera's image, get the offsets from Camera
center to the coordinates in Camera space and units.
|
static Location |
getPixelLocation(Camera camera,
double x,
double y)
Get the Location of a set of pixel coordinates referenced to the center of the given camera.
|
static Location |
getPixelLocation(Camera camera,
HeadMountable tool,
double x,
double y)
Same as getPixelLocation() but including the tool specific calibration offset.
|
static Location |
getPixelOffsets(Camera camera,
double offsetX,
double offsetY)
Given pixel offset coordinates, get the same offsets in Camera space and units.
|
static java.lang.String |
readQrCode(Camera camera)
Using the given camera, try to find a QR code and return it's text.
|
static Part |
readyHomingFiducialWithDiameter(Length fiducialDiameter,
boolean overwrite)
Ready the FIDUCIAL-HOME, either by returning the existing part or creating a new
part with the given circular fiducialDiameter.
|
static java.lang.String |
scanBarcode(Camera camera)
Using the given camera, try to find any supported barcode and return it's text.
|
static java.util.List<Location> |
sortLocationsByDistance(Location origin,
java.util.List<Location> locations) |
static double |
toPixels(Area area,
Camera camera) |
static double |
toPixels(Length length,
Camera camera) |
public static final java.lang.String PIPELINE_RESULTS_NAME
public static final java.lang.String PIPELINE_CONTROL_PROPERTY_NAME
public static Location getPixelCenterOffsets(Camera camera, double x, double y)
camera
- x
- y
- public static Location getPixelOffsets(Camera camera, double offsetX, double offsetY)
camera
- offsetX
- offsetY
- public static Location getPixelLocation(Camera camera, double x, double y)
getPixelCenterOffsets(Camera, double, double)
to the Camera's current
location.camera
- x
- y
- public static Location getPixelLocation(Camera camera, HeadMountable tool, double x, double y)
camera
- tool
- x
- y
- public static double getPixelAngle(Camera camera, double angle)
getPixelCenterOffsets(Camera, double, double)
.camera
- angle
- public static java.util.List<Location> sortLocationsByDistance(Location origin, java.util.List<Location> locations)
public static Camera getBottomVisionCamera() throws java.lang.Exception
java.lang.Exception
public static Point getLocationPixels(Camera camera, Location location)
location
- camera
- public static Point getLocationPixels(Camera camera, HeadMountable tool, Location location)
camera
- tool
- location
- public static Point getLocationPixelCenterOffsets(Camera camera, Location location)
location
- camera
- public static Point getLocationPixelCenterOffsets(Camera camera, HeadMountable tool, Location location)
camera
- tool
- location
- public static java.lang.String readQrCode(Camera camera) throws java.lang.Exception
camera
- java.lang.Exception
public static java.lang.String scanBarcode(Camera camera) throws java.lang.Exception
camera
- java.lang.Exception
public static PartAlignment.PartAlignmentOffset findPartAlignmentOffsets(PartAlignment p, Part part, BoardLocation boardLocation, Location placementLocation, Nozzle nozzle) throws java.lang.Exception
java.lang.Exception
public static long[][] computeImageHistogram(java.awt.image.BufferedImage image)
image
- public static long[][] computeImageHistogramHsv(java.awt.image.BufferedImage image)
image
- public static Part readyHomingFiducialWithDiameter(Length fiducialDiameter, boolean overwrite) throws java.lang.Exception
fiducialDiameter
- overwrite
- If the FIDUCIAL-HOME already exists, overwrite it and make sure it has the given fiducialDiameter
and circular shape.java.lang.Exception