org.shapelogic.color
Class ColorRange

java.lang.Object
  extended by org.shapelogic.color.ColorAndVariance
      extended by org.shapelogic.color.ColorRange
All Implemented Interfaces:
ColorChannels, IColorAndVariance, IColorRange, HasArea, HasPixelArea, PixelHandler
Direct Known Subclasses:
ColorEdgeArea

public class ColorRange
extends ColorAndVariance
implements IColorRange

GrayRange describes a range of colors in the Gray 8 bit.
Used for color clustering, and particle counter.

Author:
Sami Badawi

Field Summary
protected  int _colorCenter
          Color encoded in an int.
protected  int[] _colorCenterInChannels
           
protected  IColorDistance _distance
           
protected  boolean _frozen
           
protected  double _maxDistance
          Distance from colorCenter that will be accepted in this Range.
 
Fields inherited from class org.shapelogic.color.ColorAndVariance
_colorStatistics, _splitColors
 
Constructor Summary
ColorRange()
           
 
Method Summary
 boolean colorInRange(int color)
          Whether a color belong to the ColorRange.
 double distanceFromRange(int color)
          Distance of input color from this ColorRange.
 double distanceFromRangeCenter(int color)
          Distance of input color from this ColorRange.
 int getColorCenter()
           
 int[] getColorChannels()
          Color vector to be used for color distance.
Should I use the center color or the mean color?
I will start by using the mean color.
I think that I will start without including the standard deviation.
 IColorDistance getDistance()
           
 double getMaxDistance()
           
 boolean isRangeFrozen()
          If the ColorRange can change.
 void merge(IColorAndVariance colorAndVariance)
           
 void setColorCenter(int center)
           
 void setDistance(IColorDistance distance)
           
 void setMaxDistance(double distance)
           
 
Methods inherited from class org.shapelogic.color.ColorAndVariance
getArea, getMeanBlue, getMeanColor, getMeanGreen, getMeanRed, getPixelArea, getStandardDeviation, putPixel, setPixelArea, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.shapelogic.color.IColorAndVariance
getMeanBlue, getMeanColor, getMeanGreen, getMeanRed, getStandardDeviation
 
Methods inherited from interface org.shapelogic.imageutil.PixelHandler
putPixel
 
Methods inherited from interface org.shapelogic.imageutil.HasArea
getArea
 
Methods inherited from interface org.shapelogic.imageutil.HasPixelArea
getPixelArea, setPixelArea
 

Field Detail

_maxDistance

protected double _maxDistance
Distance from colorCenter that will be accepted in this Range.


_distance

protected IColorDistance _distance

_colorCenter

protected int _colorCenter
Color encoded in an int.


_colorCenterInChannels

protected int[] _colorCenterInChannels

_frozen

protected boolean _frozen
Constructor Detail

ColorRange

public ColorRange()
Method Detail

distanceFromRangeCenter

public double distanceFromRangeCenter(int color)
Description copied from interface: IColorRange
Distance of input color from this ColorRange.

Specified by:
distanceFromRangeCenter in interface IColorRange

colorInRange

public boolean colorInRange(int color)
Description copied from interface: IColorRange
Whether a color belong to the ColorRange.

Specified by:
colorInRange in interface IColorRange

distanceFromRange

public double distanceFromRange(int color)
Description copied from interface: IColorRange
Distance of input color from this ColorRange.

Specified by:
distanceFromRange in interface IColorRange

isRangeFrozen

public boolean isRangeFrozen()
Description copied from interface: IColorRange
If the ColorRange can change.

Specified by:
isRangeFrozen in interface IColorRange

getMaxDistance

public double getMaxDistance()
Specified by:
getMaxDistance in interface IColorRange

setMaxDistance

public void setMaxDistance(double distance)
Specified by:
setMaxDistance in interface IColorRange

getColorCenter

public int getColorCenter()
Specified by:
getColorCenter in interface IColorRange

setColorCenter

public void setColorCenter(int center)
Specified by:
setColorCenter in interface IColorRange

merge

public void merge(IColorAndVariance colorAndVariance)
Specified by:
merge in interface IColorAndVariance
Overrides:
merge in class ColorAndVariance

getDistance

public IColorDistance getDistance()
Specified by:
getDistance in interface IColorRange

setDistance

public void setDistance(IColorDistance distance)
Specified by:
setDistance in interface IColorRange

getColorChannels

public int[] getColorChannels()
Description copied from class: ColorAndVariance
Color vector to be used for color distance.
Should I use the center color or the mean color?
I will start by using the mean color.
I think that I will start without including the standard deviation.

Specified by:
getColorChannels in interface ColorChannels
Overrides:
getColorChannels in class ColorAndVariance


Copyright © 2009. All Rights Reserved.