org.shapelogic.imageprocessing
Class SBSegmentation

java.lang.Object
  extended by org.shapelogic.imageprocessing.SBSegmentation
All Implemented Interfaces:
java.util.Iterator<java.util.ArrayList<SBPendingVertical>>

public class SBSegmentation
extends java.lang.Object
implements java.util.Iterator<java.util.ArrayList<SBPendingVertical>>

High level class for segmentation.
Works with both color and gray scale.

Author:
Sami Badawi

Field Summary
protected  IColorAndVariance _currentSegmentArea
           
protected  ValueAreaFactory _segmentAreaFactory
           
 
Constructor Summary
SBSegmentation()
           
 
Method Summary
 java.lang.String findStatus()
           
 int getCurrentArea()
           
 ValueAreaFactory getSegmentAreaFactory()
           
 SLImage getSLImage()
           
 java.lang.String getStatus()
           
 boolean hasNext()
           
 void init()
          line is at the edge of image and pointing away from the center
 boolean isFarFromReferencColor()
           
 java.util.ArrayList<SBPendingVertical> next()
           
 void paintSegment(java.util.ArrayList<SBPendingVertical> lines, int paintColor)
           
 boolean pixelIsHandled(int index)
           
 void remove()
           
 void segment(int x, int y, boolean useReferenceColor)
          Start segmentation by selecting a point Use the color of that point at your goal color
 void segmentAll()
           
 void segmentAll(int color)
          Set every pixel that has the input color, regardless of connectivity.
 void setFarFromReferencColor(boolean farFromColor)
           
 void setMaxDistance(int maxDistance)
           
 void setPixelCompare(SBPixelCompare pixelCompare)
           
 void setReferenceColor(int referenceColor)
           
 void setSegmentAreaFactory(ValueAreaFactory areaFactory)
           
 void setSLImage(SLImage ip)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_segmentAreaFactory

protected ValueAreaFactory _segmentAreaFactory

_currentSegmentArea

protected IColorAndVariance _currentSegmentArea
Constructor Detail

SBSegmentation

public SBSegmentation()
Method Detail

segmentAll

public void segmentAll()

segmentAll

public void segmentAll(int color)
Set every pixel that has the input color, regardless of connectivity.

Parameters:
color -

segment

public void segment(int x,
                    int y,
                    boolean useReferenceColor)
Start segmentation by selecting a point Use the color of that point at your goal color

Parameters:
x -
y -

init

public void init()
line is at the edge of image and pointing away from the center


setSLImage

public void setSLImage(SLImage ip)
Parameters:
ip - The ip to set.

getSLImage

public SLImage getSLImage()

setPixelCompare

public void setPixelCompare(SBPixelCompare pixelCompare)
Parameters:
pixelCompare - The pixelCompare to set.

getStatus

public java.lang.String getStatus()
Returns:
Returns the status.

findStatus

public java.lang.String findStatus()

setSegmentAreaFactory

public void setSegmentAreaFactory(ValueAreaFactory areaFactory)

getSegmentAreaFactory

public ValueAreaFactory getSegmentAreaFactory()

setMaxDistance

public void setMaxDistance(int maxDistance)

isFarFromReferencColor

public boolean isFarFromReferencColor()

setFarFromReferencColor

public void setFarFromReferencColor(boolean farFromColor)

hasNext

public boolean hasNext()
Specified by:
hasNext in interface java.util.Iterator<java.util.ArrayList<SBPendingVertical>>

next

public java.util.ArrayList<SBPendingVertical> next()
Specified by:
next in interface java.util.Iterator<java.util.ArrayList<SBPendingVertical>>

remove

public void remove()
Specified by:
remove in interface java.util.Iterator<java.util.ArrayList<SBPendingVertical>>

setReferenceColor

public void setReferenceColor(int referenceColor)

getCurrentArea

public int getCurrentArea()

paintSegment

public void paintSegment(java.util.ArrayList<SBPendingVertical> lines,
                         int paintColor)

pixelIsHandled

public boolean pixelIsHandled(int index)


Copyright © 2008. All Rights Reserved.