edu.berkeley.guir.papier_mache.vision
Class MeanColorClassifier

java.lang.Object
  extended by edu.berkeley.guir.papier_mache.assoc.ObjectClassifier
      extended by edu.berkeley.guir.papier_mache.vision.MeanColorClassifier
All Implemented Interfaces:
edu.berkeley.guir.lib.util.ToShortStringable

public class MeanColorClassifier
extends ObjectClassifier

Classifies Phobs, comparing their mean color to this classifier's ideal color. Uses the IHS color space as the color comparison model.

Author:
Scott Klemmer ( srk(AT)cs.berkeley.edu ), Ana Ramirez ( anar(AT)cs.berkeley.edu ), Edward De Guzman ( edwardd(AT)cs.berkeley.edu )

Nested Class Summary
 
Nested classes inherited from class edu.berkeley.guir.papier_mache.assoc.ObjectClassifier
ObjectClassifier.AcceptAllClassifier
 
Field Summary
 
Fields inherited from class edu.berkeley.guir.papier_mache.assoc.ObjectClassifier
FALSE, TRUE
 
Constructor Summary
MeanColorClassifier()
          This constructor should only be used when unmarshalling a classifier from an XML file.
MeanColorClassifier(java.awt.Color rgbColor)
           
MeanColorClassifier(IHSColor ihsColor, float intTolerance, float hueTolerance, float satTolerance)
           
 
Method Summary
 javax.swing.Icon getIcon()
           
 IHSColor getIdealColor()
           
 float[] getTolerance()
           
 ObjectClassifierView getView()
           
 double isMemberOfClass(Phob phob)
           
 void setIdealColor(IHSColor ihsColor)
           
 void setParameter(java.lang.String paramName, java.lang.String paramValue)
          This classifier has six parameters: colors and tolerances for each of intensity, hue, and saturation.
 void setTolerance(float intTolerance, float hueTolerance, float satTolerance)
           
 java.lang.String toShortString()
           
 void updateIconColor()
           
 
Methods inherited from class edu.berkeley.guir.papier_mache.assoc.ObjectClassifier
toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MeanColorClassifier

public MeanColorClassifier()
This constructor should only be used when unmarshalling a classifier from an XML file.


MeanColorClassifier

public MeanColorClassifier(IHSColor ihsColor,
                           float intTolerance,
                           float hueTolerance,
                           float satTolerance)
Parameters:
ihsColor - the canonical color to classify, in the IHS color space
tolerance - similar phobs are phobs whose mean color is within this tolerance of the ideal color.

MeanColorClassifier

public MeanColorClassifier(java.awt.Color rgbColor)
Parameters:
rgbColor - the canonical color to classify, in the RGB color space
Method Detail

getIdealColor

public IHSColor getIdealColor()

getTolerance

public float[] getTolerance()

getView

public ObjectClassifierView getView()
Overrides:
getView in class ObjectClassifier

setIdealColor

public void setIdealColor(IHSColor ihsColor)

setTolerance

public void setTolerance(float intTolerance,
                         float hueTolerance,
                         float satTolerance)

updateIconColor

public void updateIconColor()

isMemberOfClass

public double isMemberOfClass(Phob phob)
Specified by:
isMemberOfClass in class ObjectClassifier

toShortString

public java.lang.String toShortString()
Specified by:
toShortString in interface edu.berkeley.guir.lib.util.ToShortStringable
Specified by:
toShortString in class ObjectClassifier

setParameter

public void setParameter(java.lang.String paramName,
                         java.lang.String paramValue)
This classifier has six parameters: colors and tolerances for each of intensity, hue, and saturation.

Overrides:
setParameter in class ObjectClassifier
Parameters:
paramName - the name of the parameter to set
paramValue - the value of the parameter

getIcon

public javax.swing.Icon getIcon()
Overrides:
getIcon in class ObjectClassifier