cbr.ccv
Class CCV

java.lang.Object
  extended bycbr.ccv.CCV
All Implemented Interfaces:
FeatureVector, Serializable

public class CCV
extends Object
implements Serializable, FeatureVector

This class represents a color coherence vector. Such a vector consists of a number of pixel counts for 64 colors. Pixels are classified into coherent and incoherent pixels and pixel counts are maintained separately for both classes.

Version:
"$Id: CCV.java 1913 2007-08-08 02:41:53Z jpeters $"
Author:
Volker Roth
See Also:
Serialized Form

Field Summary
protected  float[] coherent_
          The per color percentage of coherent pixels in the represented image.
protected  float[] incoherent_
          The per color percentage of incoherent pixels in the represented image.
 
Constructor Summary
CCV()
          Creates an empty instance.
CCV(int total, int[] coherent, int[] incoherent)
          Creates an instance from the given absolute pixel counts.
 
Method Summary
 float distance(FeatureVector v)
          This method computes the L1-Distance between this CCV and the given one.
 float[] getCoherentPixels()
          Returns the per color percentage of coherent pixels in this CCV.
 float[] getIncoherentPixels()
          Returns the per color percentage of incoherent pixels in this CCV.
 String toString()
          Returns an informative string that lists the components of this CCV.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

coherent_

protected float[] coherent_
The per color percentage of coherent pixels in the represented image.


incoherent_

protected float[] incoherent_
The per color percentage of incoherent pixels in the represented image.

Constructor Detail

CCV

public CCV(int total,
           int[] coherent,
           int[] incoherent)
Creates an instance from the given absolute pixel counts. The caller must make sure that the accumulated pixel counts of the given arrays equals the given total pixel count.


CCV

public CCV()
Creates an empty instance. This constructor is required for deserialisation.

Method Detail

getCoherentPixels

public float[] getCoherentPixels()
Returns the per color percentage of coherent pixels in this CCV. The percentage is represented by a number in the range [0,1].

Returns:
The coherent pixel percentage.

getIncoherentPixels

public float[] getIncoherentPixels()
Returns the per color percentage of incoherent pixels in this CCV. The percentage is represented by a number in the range [0,1].

Returns:
The incoherent pixel percentage.

distance

public float distance(FeatureVector v)
This method computes the L1-Distance between this CCV and the given one. The L1-Distance is the sum of linear differences of the respective vector elements, normalised to the range [0,1].

Specified by:
distance in interface FeatureVector
Parameters:
v - The feature vector to compare with.
Returns:
The normalised distance of the given vector to this one. A value of 0.0 denotes identity and a value of 1.0 denotes infinite distance.

toString

public String toString()
Returns an informative string that lists the components of this CCV.

Returns:
The string representation.


Copyright © Fraunhofer Gesellschaft. All Rights Reserved.