net.sourceforge.javaocr.plugin.cluster.extractor
Class FreeSpacesExtractor

java.lang.Object
  extended by net.sourceforge.javaocr.filter.AbstractSinglePixelFilter
      extended by net.sourceforge.javaocr.plugin.cluster.extractor.FreeSpacesExtractor
All Implemented Interfaces:
FeatureExtractor, ImageFilter

public class FreeSpacesExtractor
extends AbstractSinglePixelFilter
implements FeatureExtractor

extracts amount of contiguous free spaces in a glyph. As it is basically integer value, and also pretty stable - some classificators utilizing statistical methods may barf due to zero variance TODO: I'm not happy with this location - maybe it is best somewhere else

Author:
Konstantin Pribluda

Field Summary
(package private)  int currentSpaceNumber
           
(package private)  boolean free
           
(package private)  int index
           
(package private)  int reductionFactor
           
(package private)  int spaceCount
           
(package private)  int[] workingScan
           
 
Constructor Summary
FreeSpacesExtractor()
           
 
Method Summary
 double[] extract(Image image)
           
 int getSize()
           
 void process(Image image)
          prepare image processing
protected  void processPixel(Image image)
          process single pixel.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

workingScan

int[] workingScan

spaceCount

int spaceCount

index

int index

free

boolean free

currentSpaceNumber

int currentSpaceNumber

reductionFactor

int reductionFactor
Constructor Detail

FreeSpacesExtractor

public FreeSpacesExtractor()
Method Detail

getSize

public int getSize()
Specified by:
getSize in interface FeatureExtractor

extract

public double[] extract(Image image)
Specified by:
extract in interface FeatureExtractor

process

public void process(Image image)
prepare image processing

Specified by:
process in interface ImageFilter
Overrides:
process in class AbstractSinglePixelFilter
Parameters:
image -

processPixel

protected void processPixel(Image image)
process single pixel. a lot of voodoo magic emerged from test driven development - it is correct but not designed

Specified by:
processPixel in class AbstractSinglePixelFilter
Parameters:
image -


Copyright © -2012. All Rights Reserved.