org.shapelogic.color
Class GrayAndVariance

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

public class GrayAndVariance
extends java.lang.Object
implements IColorAndVariance

GrayAndVariance describes an average color with variance for gray 8 bit.
Used for color clustering, and particle counter.

Author:
Sami Badawi

Field Summary
protected  StorelessDiscriptiveStatistic _grayStatistic
           
protected  int _maxColor
           
protected  double _maxDistance
          Distance from colorCenter that will be accepted in this Range.
protected  int _minColor
          Not sure if these are needed.
 
Constructor Summary
GrayAndVariance()
           
 
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 getMeanGray()
           
 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

_grayStatistic

protected StorelessDiscriptiveStatistic _grayStatistic

_minColor

protected int _minColor
Not sure if these are needed.


_maxColor

protected int _maxColor

_maxDistance

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

Constructor Detail

GrayAndVariance

public GrayAndVariance()
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

getMeanColor

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

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

getMeanGray

public int getMeanGray()

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

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 © 2008. All Rights Reserved.