org.shapelogic.imageprocessing
Class DistanceBasedColorHypothesisFinder

java.lang.Object
  extended by org.shapelogic.imageutil.BaseImageOperation
      extended by org.shapelogic.imageprocessing.DistanceBasedColorHypothesisFinder
All Implemented Interfaces:
java.lang.Runnable, IColorHypothesisFinder, ImageOperation, PixelHandler

public class DistanceBasedColorHypothesisFinder
extends BaseImageOperation
implements IColorHypothesisFinder, PixelHandler

Find a color hypothesis based on just distance of colors.
Should this be a BaseImageOperation?
What should go on in run and what in findBestColorHypothesis()?
findBestColorHypothesis() should be the workhorse.
What should I do about color and gray, should there be a separate class for each?
I would think that maybe

Author:
Sami Badawi

Field Summary
 
Fields inherited from class org.shapelogic.imageutil.BaseImageOperation
_arg, _guiWrapper, _image, _keyValueParser, _setupReturnValue
 
Constructor Summary
DistanceBasedColorHypothesisFinder()
           
DistanceBasedColorHypothesisFinder(double maxDistance)
           
DistanceBasedColorHypothesisFinder(java.lang.String arg, SLImage image, double maxDistance)
           
DistanceBasedColorHypothesisFinder(java.lang.String arg, java.lang.String filePath, double maxDistance)
           
DistanceBasedColorHypothesisFinder(java.lang.String arg, java.lang.String dir, java.lang.String fileName, java.lang.String fileFormat, double maxDistance)
           
 
Method Summary
 ColorHypothesis colorHypothesisIteration(ColorHypothesis lastColorHypothesis)
           
 IColorRange findBestBackground(ColorHypothesis colorHypothesis)
           
 ColorHypothesis findBestColorHypothesis()
           
 ColorHypothesis getColorHypothesis()
           
 int getIteration()
          Number of the current iteration.
XXX: Not sure that this is needed.
 int getIterations()
          How many iterations to do.
 void putPixel(int x, int y, int color)
          Handle a pixel with a color and a coordinate.
 void run()
           
 void setIterations(int iterations)
          How many iterations to do.
 void setMaxDistance(double maxDistance)
           
 int setup(java.lang.String arg, SLImage image)
          If you are using the ImageOperation to fit into a ImageJ PlugInFilter use this to instantiate arg and image.
 boolean verifyColor(IColorRange colorRange)
           
 
Methods inherited from class org.shapelogic.imageutil.BaseImageOperation
getGuiWrapper, getImage, getKeyValueParser, getSetupReturnValue, isImageValid, setArg, setGuiWrapper, setKeyValueParser, setSetupReturnValue, showAbout, showMessage
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DistanceBasedColorHypothesisFinder

public DistanceBasedColorHypothesisFinder(java.lang.String arg,
                                          SLImage image,
                                          double maxDistance)

DistanceBasedColorHypothesisFinder

public DistanceBasedColorHypothesisFinder(java.lang.String arg,
                                          java.lang.String filePath,
                                          double maxDistance)

DistanceBasedColorHypothesisFinder

public DistanceBasedColorHypothesisFinder(java.lang.String arg,
                                          java.lang.String dir,
                                          java.lang.String fileName,
                                          java.lang.String fileFormat,
                                          double maxDistance)

DistanceBasedColorHypothesisFinder

public DistanceBasedColorHypothesisFinder()

DistanceBasedColorHypothesisFinder

public DistanceBasedColorHypothesisFinder(double maxDistance)
Method Detail

findBestColorHypothesis

public ColorHypothesis findBestColorHypothesis()
Specified by:
findBestColorHypothesis in interface IColorHypothesisFinder

colorHypothesisIteration

public ColorHypothesis colorHypothesisIteration(ColorHypothesis lastColorHypothesis)
Specified by:
colorHypothesisIteration in interface IColorHypothesisFinder

setup

public int setup(java.lang.String arg,
                 SLImage image)
Description copied from class: BaseImageOperation
If you are using the ImageOperation to fit into a ImageJ PlugInFilter use this to instantiate arg and image.

Specified by:
setup in interface ImageOperation
Overrides:
setup in class BaseImageOperation

run

public void run()
Specified by:
run in interface java.lang.Runnable

putPixel

public void putPixel(int x,
                     int y,
                     int color)
Description copied from interface: PixelHandler
Handle a pixel with a color and a coordinate.

Specified by:
putPixel in interface PixelHandler

setMaxDistance

public void setMaxDistance(double maxDistance)

getColorHypothesis

public ColorHypothesis getColorHypothesis()
Specified by:
getColorHypothesis in interface IColorHypothesisFinder

getIterations

public int getIterations()
How many iterations to do.

Specified by:
getIterations in interface IColorHypothesisFinder

setIterations

public void setIterations(int iterations)
How many iterations to do.

Specified by:
setIterations in interface IColorHypothesisFinder

verifyColor

public boolean verifyColor(IColorRange colorRange)
Specified by:
verifyColor in interface IColorHypothesisFinder

getIteration

public int getIteration()
Number of the current iteration.
XXX: Not sure that this is needed.
XXX: Might rename this to getCurrentIteration.

Specified by:
getIteration in interface IColorHypothesisFinder

findBestBackground

public IColorRange findBestBackground(ColorHypothesis colorHypothesis)
Specified by:
findBestBackground in interface IColorHypothesisFinder


Copyright © 2009. All Rights Reserved.