|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object cbr.ccv.CCVExtractor
This class extracts color coherence vectors from images.
Field Summary | |
protected ArrayList |
activeareas_
The array of active areas. |
protected ArrayList |
activespans_
The array of active spans. |
protected ArrayList |
areas_
The list of areas whose analysis is in progress. |
protected int[] |
coherent_
The per color counts of coherent pixels. |
protected ArrayList |
freeareas_
The array of unused areas. |
protected ArrayList |
freespans_
The array of unused spans. |
protected int[] |
incoherent_
The per color counts of incoherent pixels. |
protected ArrayList |
spans_
The list of spans whose analysis is in progress. |
protected float |
tau_
The tau value in percent of total pixel count. |
Constructor Summary | |
CCVExtractor()
Creates a fresh instance. |
|
CCVExtractor(float tau)
Creates a fresh instance that uses the given tau to distinguish between coherent and incoherent pixel areas. |
Method Summary | |
FeatureVector |
extract(byte[] px,
int w,
int h)
This method extracts the CCV from a byte array of RGB222 pixels. |
FeatureVector |
extract(Image im)
Extracts the color coherence vector from the given image. |
FeatureVector |
extract(int[] px,
int width,
int height)
Extracts the color coherence vector from the given array of RGB888 pixels. |
protected void |
freeArea(Area area)
|
protected Area |
newArea(int color,
int size)
|
protected void |
scan(List list,
byte[] px,
int off,
int width)
Fills the given list instance with the list of spans initialised from the given pixel buffer starting at the given offset. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected ArrayList freespans_
protected ArrayList freeareas_
protected ArrayList activespans_
protected ArrayList activeareas_
protected ArrayList spans_
protected ArrayList areas_
protected int[] coherent_
protected int[] incoherent_
protected float tau_
Constructor Detail |
public CCVExtractor()
public CCVExtractor(float tau)
tau
- The tau value.Method Detail |
public FeatureVector extract(Image im) throws InterruptedException, ImageException
extract
in interface FeatureExtractor
im
- The image from which the CCV is extacted.
InterruptedException
- if an interrupt occurs
while the image's pixel data is loaded.
ImageException
- if for instance the dimensions
of the given image cannot be determined.public FeatureVector extract(int[] px, int width, int height)
extract
in interface FeatureExtractor
px
- The byte array of RGB222 pixel values of
the image from which the CCV is extracted.
public FeatureVector extract(byte[] px, int w, int h)
The caller has to make sure that the pixel values
are in the range [0,63]. Any pixel outside this
range will cause an ArrayIndexOutOfBoundsException
to be thrown in the course of this method call.
The easiest way to assure this range is to use the
Quantizer
.
extract
in interface FeatureExtractor
px
- The byte array of RGB222 pixel values of
the image from which the CCV is extracted.w
- The width of the image in pixels.h
- The height of the image in pixels.
protected void scan(List list, byte[] px, int off, int width)
width
pixels are consumed.
protected Area newArea(int color, int size)
protected void freeArea(Area area)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |