org.shapelogic.color
Class GrayEdgeArea

java.lang.Object
  extended by org.shapelogic.color.GrayAndVariance
      extended by org.shapelogic.color.GrayRange
          extended by org.shapelogic.color.GrayEdgeArea
All Implemented Interfaces:
ColorChannels, IColorAndVariance, IColorEdgeArea, IColorRange, HasArea, HasPixelArea, PixelHandler

public class GrayEdgeArea
extends GrayRange
implements IColorEdgeArea

GrayEdgeArea holds the information.
Should this have getter and setters?
Maybe start without.
Should this be split in color and gray?
I think that maybe it should.

Author:
Sami Badawi

Field Summary
protected  int[] _borderCount
           
protected  int _lastX
           
protected  int _lastY
           
static int HIGH_CONTRAST_POS
           
static int LOW_CONTRAST_POS
           
static int MEDIUM_CONTRAST_POS
           
 
Fields inherited from class org.shapelogic.color.GrayRange
_colorCenter, _distance, _frozen
 
Fields inherited from class org.shapelogic.color.GrayAndVariance
_grayStatistic, _maxColor, _maxDistance, _minColor
 
Constructor Summary
GrayEdgeArea(int x, int y, int startColor)
           
 
Method Summary
 void addBorder(int level)
          Count how many borders and the size of the border.
 int getAllContrastBorders()
           
 int getHighContrastBorders()
          Description of how much high contrast neighbor.
 int getLowContrastBorders()
           
 int getMediumContrastBorders()
           
 PixelArea getPixelArea()
           
 void merge(IColorAndVariance colorAndVariance)
           
 void putPixel(int x, int y, int color)
          Add the color for a given point (x,y).
 
Methods inherited from class org.shapelogic.color.GrayRange
colorInRange, distanceFromRange, distanceFromRangeCenter, getColorCenter, getDistance, getMaxDistance, isRangeFrozen, setColorCenter, setDistance, setMaxDistance
 
Methods inherited from class org.shapelogic.color.GrayAndVariance
getArea, getColorChannels, getMeanBlue, getMeanColor, getMeanGray, getMeanGreen, getMeanRed, getStandardDeviation, 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.color.ColorChannels
getColorChannels
 
Methods inherited from interface org.shapelogic.imageutil.HasArea
getArea
 
Methods inherited from interface org.shapelogic.imageutil.HasPixelArea
setPixelArea
 

Field Detail

LOW_CONTRAST_POS

public static final int LOW_CONTRAST_POS
See Also:
Constant Field Values

MEDIUM_CONTRAST_POS

public static final int MEDIUM_CONTRAST_POS
See Also:
Constant Field Values

HIGH_CONTRAST_POS

public static final int HIGH_CONTRAST_POS
See Also:
Constant Field Values

_borderCount

protected int[] _borderCount

_lastX

protected int _lastX

_lastY

protected int _lastY
Constructor Detail

GrayEdgeArea

public GrayEdgeArea(int x,
                    int y,
                    int startColor)
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
Overrides:
putPixel in class GrayRange

merge

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

getPixelArea

public PixelArea getPixelArea()
Specified by:
getPixelArea in interface HasPixelArea
Overrides:
getPixelArea in class GrayAndVariance

getAllContrastBorders

public int getAllContrastBorders()
Specified by:
getAllContrastBorders in interface IColorEdgeArea

getHighContrastBorders

public int getHighContrastBorders()
Description copied from interface: IColorEdgeArea
Description of how much high contrast neighbor. What would be a good measure for this. Maybe the rate of borders that are high contrast to the one that are not. So maybe have a 30 and 70 percentile contrast levels. Or maybe I can just set the levels manually and do the count.

Specified by:
getHighContrastBorders in interface IColorEdgeArea

getMediumContrastBorders

public int getMediumContrastBorders()
Specified by:
getMediumContrastBorders in interface IColorEdgeArea

getLowContrastBorders

public int getLowContrastBorders()
Specified by:
getLowContrastBorders in interface IColorEdgeArea

addBorder

public void addBorder(int level)
Count how many borders and the size of the border.

Specified by:
addBorder in interface IColorEdgeArea
Parameters:
level - low, medium or high


Copyright © 2008. All Rights Reserved.