2010 FRC Java API


edu.wpi.first.wpilibj.image
Class BinaryImage

java.lang.Object
  extended by edu.wpi.first.wpilibj.image.Image
      extended by edu.wpi.first.wpilibj.image.MonoImage
          extended by edu.wpi.first.wpilibj.image.BinaryImage

public class BinaryImage
extends MonoImage

An image where each pixel is treated as either on or off.

Author:
dtjones

Field Summary
 
Fields inherited from class edu.wpi.first.wpilibj.image.Image
image
 
Method Summary
 int getNumberParticles()
          Returns the number of particles.
 ParticleAnalysisReport[] getOrderedParticleAnalysisReports()
          Gets all the particle analysis reports ordered from largest area to smallest.
 ParticleAnalysisReport[] getOrderedParticleAnalysisReports(int size)
          Gets all the particle analysis reports ordered from largest area to smallest.
 ParticleAnalysisReport getParticleAnalysisReport(int index)
          Get a particle analysis report for the particle at the given index.
 void write(String fileName)
          Write the image to a file.
 
Methods inherited from class edu.wpi.first.wpilibj.image.MonoImage
detectEllipses, detectEllipses
 
Methods inherited from class edu.wpi.first.wpilibj.image.Image
free, getHeight, getWidth
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getNumberParticles

public int getNumberParticles()
                       throws NIVisionException
Returns the number of particles.

Returns:
The number of particles
Throws:
NIVisionException

getParticleAnalysisReport

public ParticleAnalysisReport getParticleAnalysisReport(int index)
                                                 throws NIVisionException
Get a particle analysis report for the particle at the given index.

Parameters:
index - The index of the particle to report on.
Returns:
The ParticleAnalysisReport for the particle at the given index
Throws:
NIVisionException

getOrderedParticleAnalysisReports

public ParticleAnalysisReport[] getOrderedParticleAnalysisReports(int size)
                                                           throws NIVisionException
Gets all the particle analysis reports ordered from largest area to smallest.

Parameters:
size - The number of particles to return
Returns:
An array of ParticleReports from largest area to smallest
Throws:
NIVisionException

getOrderedParticleAnalysisReports

public ParticleAnalysisReport[] getOrderedParticleAnalysisReports()
                                                           throws NIVisionException
Gets all the particle analysis reports ordered from largest area to smallest.

Returns:
An array of ParticleReports from largest are to smallest
Throws:
NIVisionException

write

public void write(String fileName)
           throws NIVisionException
Description copied from class: Image
Write the image to a file. Supported extensions: .aipd or .apd AIPD .bmp BMP .jpg or .jpeg JPEG .jp2 JPEG2000 .png PNG .tif or .tiff TIFF

Overrides:
write in class Image
Parameters:
fileName - The path to write the image to.
Throws:
NIVisionException

2010 FRC Java API


Copyright © 2006-2009 Sun Microsystems, Inc. All Rights Reserved.