|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.wpi.first.wpilibj.image.NIVision
public class NIVision
Class for interfacing with the NIVision libraries
Nested Class Summary | |
---|---|
static class |
NIVision.ColorMode
Enumerations representing the possible color spaces to operate in |
static class |
NIVision.ImageType
Enumeration representing the possible types of imaq images |
static class |
NIVision.MeasurementType
|
static class |
NIVision.Range
|
static class |
NIVision.Rect
|
Field Summary | |
---|---|
protected static BlockingFunction |
imaqCreateImageFn
|
Method Summary | |
---|---|
protected static void |
assertCleanStatus(int code)
|
static void |
colorEqualize(Pointer destination,
Pointer source,
boolean all)
Calculates the histogram of each plane of a color image and redistributes pixel values across the desired range while maintaining pixel value groupings. |
static void |
colorThreshold(Pointer dest,
Pointer source,
NIVision.ColorMode mode,
Pointer plane1Range,
Pointer plane2Range,
Pointer plane3Range)
Convert the given image into a binary image true where the colors match the given thresholds |
static void |
convexHull(Pointer dest,
Pointer source,
int connectivity8)
|
static int |
countParticles(Pointer image)
Counts the number of particles in a binary image. |
float |
decodeGreyscaleValue(int pixelValue)
|
static EllipseMatch[] |
detectEllipses(MonoImage image,
EllipseDescriptor ellipseDescriptor,
CurveOptions curveOptions,
ShapeDetectionOptions shapeDetectionOptions,
RegionOfInterest roi)
|
static void |
dispose(Pointer item)
Cleans up resources associated with images, regions of interest (ROIs), arrays, and reports that you no longer need. |
int |
encodeGreyscaleValue(float greyscale)
|
int |
encodeHSLValue(int h,
int s,
int l,
int a)
|
int |
encodeHSVValue(int h,
int s,
int v,
int a)
|
int |
encodeRGBValue(int r,
int g,
int b,
int a)
|
static void |
extractColorPlanes(Pointer source,
NIVision.ColorMode mode,
Pointer plane1,
Pointer plane2,
Pointer plane3)
Extract the color planes from the given source image into the given planes |
static int |
getHeight(Pointer image)
Get the height of an image. |
static int |
getLastError()
|
static LinearAverages |
getLinearAverages(Pointer image,
LinearAverages.LinearAveragesMode mode,
NIVision.Rect rect)
|
static int |
getWidth(Pointer image)
Get the width of an image. |
int |
hslGetA(int hslvalue)
|
int |
hslGetH(int hslvalue)
|
int |
hslGetL(int hslvalue)
|
int |
hslGetS(int hslvalue)
|
int |
hsvGetA(int hsvvalue)
|
int |
hsvGetH(int hsvvalue)
|
int |
hsvGetS(int hsvvalue)
|
int |
hsvGetV(int hsvvalue)
|
static Pointer |
imaqCreateImage(NIVision.ImageType type,
int borderSize)
Allocates space for and creates a new imaq image |
static double |
MeasureParticle(Pointer image,
int particleNum,
boolean calibrated,
NIVision.MeasurementType type)
Returns a measurement associated with a particle |
static int |
particleFilter(Pointer dest,
Pointer source,
CriteriaCollection collection)
|
static void |
readFile(Pointer image,
java.lang.String fileName)
Read an image from to the given image from the given filename |
static void |
readJpegString(Pointer image,
Pointer p)
Read a pointer to a byte array into the given image |
static void |
replaceColorPlanes(Pointer dest,
Pointer source,
NIVision.ColorMode mode,
Pointer plane1,
Pointer plane2,
Pointer plane3)
Replaces one or more of the color planes of a color image. |
int |
rgbGetA(int rgbvalue)
|
int |
rgbGetB(int rgbvalue)
|
int |
rgbGetG(int rgbvalue)
|
int |
rgbGetR(int rgbvalue)
|
static void |
setWriteFileAllowed(boolean val)
Set true to be able to create files on cRio |
static void |
sizeFilter(Pointer dest,
Pointer source,
boolean connectivity8,
int erosions,
boolean keepLarger)
|
static void |
writeFile(Pointer image,
java.lang.String fileName)
Write an image to the given file. |
static void |
writeFile(Pointer image,
java.lang.String fileName,
Pointer colorTable)
Write an image to the given file. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final BlockingFunction imaqCreateImageFn
Method Detail |
---|
public int encodeRGBValue(int r, int g, int b, int a)
public int rgbGetR(int rgbvalue)
public int rgbGetG(int rgbvalue)
public int rgbGetB(int rgbvalue)
public int rgbGetA(int rgbvalue)
public int encodeHSLValue(int h, int s, int l, int a)
public int hslGetH(int hslvalue)
public int hslGetS(int hslvalue)
public int hslGetL(int hslvalue)
public int hslGetA(int hslvalue)
public int encodeHSVValue(int h, int s, int v, int a)
public int hsvGetH(int hsvvalue)
public int hsvGetS(int hsvvalue)
public int hsvGetV(int hsvvalue)
public int hsvGetA(int hsvvalue)
public int encodeGreyscaleValue(float greyscale)
public float decodeGreyscaleValue(int pixelValue)
public static int getHeight(Pointer image) throws NIVisionException
image
- The image to get the height of.
NIVisionException
public static int getWidth(Pointer image) throws NIVisionException
image
- The image to get the width of.
NIVisionException
public static void convexHull(Pointer dest, Pointer source, int connectivity8) throws NIVisionException
NIVisionException
public static void sizeFilter(Pointer dest, Pointer source, boolean connectivity8, int erosions, boolean keepLarger) throws NIVisionException
NIVisionException
public static int countParticles(Pointer image) throws NIVisionException
image
- The image to count the particles in
NIVisionException
public static double MeasureParticle(Pointer image, int particleNum, boolean calibrated, NIVision.MeasurementType type) throws NIVisionException
image
- The image containing the particle to get information about.particleNum
- The number of the particle to get information about.calibrated
- Specifies whether to return the measurement as a real-world value.type
- The measurement to make on the particle.
NIVisionException
public static int particleFilter(Pointer dest, Pointer source, CriteriaCollection collection) throws NIVisionException
NIVisionException
public static Pointer imaqCreateImage(NIVision.ImageType type, int borderSize) throws NIVisionException
type
- the imaq encoding to use for the imageborderSize
- the size of border to use for the image
NIVisionException
public static void colorThreshold(Pointer dest, Pointer source, NIVision.ColorMode mode, Pointer plane1Range, Pointer plane2Range, Pointer plane3Range) throws NIVisionException
dest
- the 8 bit monocolor image to store the result insource
- the color image sourcemode
- The mode of color to useplane1Range
- First color rangeplane2Range
- Second color rangeplane3Range
- Third color range
NIVisionException
public static void colorEqualize(Pointer destination, Pointer source, boolean all) throws NIVisionException
destination
- The destination image.source
- The image to equalize.all
- Set this parameter to TRUE to equalize all three planes of the
image. Set this parameter to FALSE to equalize only the luminance plane.
NIVisionException
public static EllipseMatch[] detectEllipses(MonoImage image, EllipseDescriptor ellipseDescriptor, CurveOptions curveOptions, ShapeDetectionOptions shapeDetectionOptions, RegionOfInterest roi) throws NIVisionException
NIVisionException
public static LinearAverages getLinearAverages(Pointer image, LinearAverages.LinearAveragesMode mode, NIVision.Rect rect) throws NIVisionException
NIVisionException
public static int getLastError()
protected static void assertCleanStatus(int code) throws NIVisionException
NIVisionException
public static void dispose(Pointer item) throws NIVisionException
item
- The image, ROI, array, or report whose memory you want to free.
NIVisionException
public static void readJpegString(Pointer image, Pointer p)
image
- pointer to an imaq image objectp
- pointer to a byte array holding image datapublic static void setWriteFileAllowed(boolean val)
val
- true allows files to be createdpublic static void writeFile(Pointer image, java.lang.String fileName) throws NIVisionException
image
- The image to write to a file.fileName
- The name of the destination file.
NIVisionException
public static void writeFile(Pointer image, java.lang.String fileName, Pointer colorTable) throws NIVisionException
image
- The image to write to a file.fileName
- The name of the destination file.colorTable
- The color table to use for 8-bit images
NIVisionException
public static void readFile(Pointer image, java.lang.String fileName) throws NIVisionException
image
- The image to store the data in.fileName
- The name of the file to load.
NIVisionException
public static void extractColorPlanes(Pointer source, NIVision.ColorMode mode, Pointer plane1, Pointer plane2, Pointer plane3) throws NIVisionException
source
- The color source image.mode
- The color space to extract the planes of.plane1
- MonoImage destination for the first plane.plane2
- MonoImage destination for the first plane.plane3
- MonoImage destination for the first plane.
NIVisionException
public static void replaceColorPlanes(Pointer dest, Pointer source, NIVision.ColorMode mode, Pointer plane1, Pointer plane2, Pointer plane3) throws NIVisionException
dest
- The destination image.source
- The source image.mode
- The color space in which the function replaces planes.plane1
- The first plane of replacement data. Set this parameter to null if you do not want to change the first plane of the source image.plane2
- The second plane of replacement data. Set this parameter to null if you do not want to change the second plane of the source image.plane3
- The third plane of replacement data. Set this parameter to null if you do not want to change the third plane of the source image.
NIVisionException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |