org.shapelogic.color
Class ColorAndVariance

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

public class ColorAndVariance
extends java.lang.Object
implements IColorAndVariance

GrayAndVariance describes an average color with variance for gray 8 bit.
Used for color clustering, and particle counter.
XXX this class should be renamed to ColorArea

Author:
Sami Badawi

Field Summary
protected  StorelessDiscriptiveStatistic[] _colorStatistics
           
protected  int[] _splitColors
           
 
Constructor Summary
ColorAndVariance()
           
 
Method Summary
 int getArea()
          Area of this color range.
 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.
 int getMeanBlue()
           
 int getMeanColor()
           
 int getMeanGreen()
           
 int getMeanRed()
           
 PixelArea getPixelArea()
           
 double getStandardDeviation()
           
 void merge(IColorAndVariance colorAndVariance)
           
 void putPixel(int x, int y, int color)
          Add the color for a given point (x,y).
 void setPixelArea(PixelArea pixelArea)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_colorStatistics

protected StorelessDiscriptiveStatistic[] _colorStatistics

_splitColors

protected int[] _splitColors
Constructor Detail

ColorAndVariance

public ColorAndVariance()
Method Detail

putPixel

public void putPixel(int x,
                     int y,
                     int color)
Add the color for a given point (x,y).
The points needs to be added in sequence.

Specified by:
putPixel in interface PixelHandler

getArea

public int getArea()
Description copied from interface: HasArea
Area of this color range.

Specified by:
getArea in interface HasArea

getStandardDeviation

public double getStandardDeviation()
Specified by:
getStandardDeviation in interface IColorAndVariance

merge

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

getColorChannels

public 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.

Specified by:
getColorChannels in interface ColorChannels

getMeanRed

public int getMeanRed()
Specified by:
getMeanRed in interface IColorAndVariance

getMeanGreen

public int getMeanGreen()
Specified by:
getMeanGreen in interface IColorAndVariance

getMeanBlue

public int getMeanBlue()
Specified by:
getMeanBlue in interface IColorAndVariance

getMeanColor

public int getMeanColor()
Specified by:
getMeanColor in interface IColorAndVariance

getPixelArea

public PixelArea getPixelArea()
Specified by:
getPixelArea in interface HasPixelArea

setPixelArea

public void setPixelArea(PixelArea pixelArea)
Specified by:
setPixelArea in interface HasPixelArea

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2009. All Rights Reserved.