org.shapelogic.imageprocessing
Class StreamVectorizer

java.lang.Object
  extended by org.shapelogic.imageutil.BaseImageOperation
      extended by org.shapelogic.imageprocessing.BaseVectorizer
          extended by org.shapelogic.imageprocessing.BaseMaxDistanceVectorizer
              extended by org.shapelogic.imageprocessing.StreamVectorizer
All Implemented Interfaces:
java.lang.Runnable, java.util.Iterator<Polygon>, RecursiveContext, IPixelTypeFinder, LazyPlugInFilter<Polygon>, PixelJumperByte, ImageOperation
Direct Known Subclasses:
StreamVectorizerIJ

public class StreamVectorizer
extends BaseMaxDistanceVectorizer
implements RecursiveContext

Same vectorizer as MaxDistanceVectorizer, but logic implemented with streams.

Author:
Sami Badawi

Field Summary
protected  NumberedStream<java.lang.String> _categorizer
           
protected  java.util.Map _context
           
protected  boolean _displayAll
           
protected  boolean _displayResultTable
           
protected  java.lang.String _neuralNetworkFile
           
protected  java.util.List<java.lang.String> _printListOverwrite
           
protected  BaseTableBuilder _tableBuilder
           
protected  TableDefinition _tableDefinition
           
protected  boolean _useNeuralNetwork
           
protected  LoadLetterStreams loadLetterStreams
           
 
Fields inherited from class org.shapelogic.imageprocessing.BaseMaxDistanceVectorizer
_chainCodeHandler
 
Fields inherited from class org.shapelogic.imageprocessing.BaseVectorizer
_cleanedupPolygon, _currentDirection, _currentPixelIndex, _currentPoint, _cyclePoints, _displayInternalInfo, _endPointsClusters, _errorMessage, _firstPointInLineIndex, _firstPointInMultiLine, _matchingOH, _maxX, _maxY, _minX, _minY, _nextCount, _numberOfPointsInAllLines, _pixels, _pixelTypeCalculator, _pixelTypeFinder, _rulesArrayForLetterMatching, _stream, _streamName, _unfinishedPoints, _yForUnporcessedPixel, MAX_DISTANCE_BETWEEN_CLUSTER_POINTS, STRAIGHT_LINE_COLOR
 
Fields inherited from class org.shapelogic.imageutil.BaseImageOperation
_arg, _guiWrapper, _image, _keyValueParser, _setupReturnValue
 
Constructor Summary
StreamVectorizer()
           
 
Method Summary
protected  void categorizeStreams()
           
protected  void customStreamDefinitions()
           
protected  void defaultColumnDefinitions()
           
protected  void defaultStreamDefinitions()
           
protected  void defineNeuralNetwork()
          Method to override if you want to define your own neural network.
The default network is very simple it is marking particles Dark or Light.
protected  void defineRules()
          Method to override if you want to define your own rule set.
The default network is very simple it is marking particles Tall, Flat based on their aspect ratio.
protected  void displayResultsTable()
           
 java.util.Map getContext()
           
 RecursiveContext getParentContext()
           
 void init()
          Use this to setup all the needed streams.
protected  void matchLines()
          This does really not belong in a vectorizer.
 void matchSetup()
          In order to match a different alphabet override this.
protected  void populateResultsTable()
           
protected  boolean populateResultsTableRow(int index)
           
 void printTable()
           
protected  FFNeuralNetworkWeights readFFNeuralNetworkWeights()
           
 void run()
           
 void setNeuralNetworkFile(java.lang.String neuralNetworkFile)
           
protected  void setupTableBuilder()
           
 void setUseNeuralNetwork(boolean useNeuralNetwork)
           
 
Methods inherited from class org.shapelogic.imageprocessing.BaseMaxDistanceVectorizer
findMultiLine, findMultiLinePostProcess, findMultiLinePreProcess, findNextLinePoint, handleProblematicPoints, internalFactory, lastPixelOk
 
Methods inherited from class org.shapelogic.imageprocessing.BaseVectorizer
addToUnfinishedPoints, cleanPolygon, countRegionCrossingsAroundPoint, drawLine, drawLines, findAllLines, findFirstLinePoint, findPointType, getCleanedupPolygon, getCyclePoints, getErrorMessage, getImageProcessor, getMatchingOH, getMaxX, getMaxY, getMinX, getMinY, getPixels, getPoints, getPolygon, getStream, getStreamName, hasNext, isPixelUsed, moveCurrentPointForwards, next, oppesiteDirection, pixelIndexToPoint, pointToPixelIndex, pointToPixelIndex, polygonFactory, remove, setStreamName
 
Methods inherited from class org.shapelogic.imageutil.BaseImageOperation
getGuiWrapper, getImage, getKeyValueParser, getSetupReturnValue, isImageValid, setArg, setGuiWrapper, setKeyValueParser, setSetupReturnValue, setup, showAbout, showMessage
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_context

protected java.util.Map _context

loadLetterStreams

protected LoadLetterStreams loadLetterStreams

_categorizer

protected NumberedStream<java.lang.String> _categorizer

_useNeuralNetwork

protected boolean _useNeuralNetwork

_neuralNetworkFile

protected java.lang.String _neuralNetworkFile

_tableBuilder

protected BaseTableBuilder _tableBuilder

_tableDefinition

protected TableDefinition _tableDefinition

_printListOverwrite

protected java.util.List<java.lang.String> _printListOverwrite

_displayAll

protected boolean _displayAll

_displayResultTable

protected boolean _displayResultTable
Constructor Detail

StreamVectorizer

public StreamVectorizer()
Method Detail

matchLines

protected void matchLines()
This does really not belong in a vectorizer.

Overrides:
matchLines in class BaseVectorizer

readFFNeuralNetworkWeights

protected FFNeuralNetworkWeights readFFNeuralNetworkWeights()

defineRules

protected void defineRules()
Method to override if you want to define your own rule set.
The default network is very simple it is marking particles Tall, Flat based on their aspect ratio.


defineNeuralNetwork

protected void defineNeuralNetwork()
Method to override if you want to define your own neural network.
The default network is very simple it is marking particles Dark or Light.


init

public void init()
Use this to setup all the needed streams.

Overrides:
init in class BaseMaxDistanceVectorizer

matchSetup

public void matchSetup()
In order to match a different alphabet override this.


run

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

getContext

public java.util.Map getContext()
Specified by:
getContext in interface RecursiveContext

getParentContext

public RecursiveContext getParentContext()
Specified by:
getParentContext in interface RecursiveContext

printTable

public void printTable()

defaultStreamDefinitions

protected void defaultStreamDefinitions()

categorizeStreams

protected void categorizeStreams()

customStreamDefinitions

protected void customStreamDefinitions()

defaultColumnDefinitions

protected void defaultColumnDefinitions()

setupTableBuilder

protected void setupTableBuilder()

populateResultsTable

protected void populateResultsTable()

displayResultsTable

protected void displayResultsTable()

populateResultsTableRow

protected boolean populateResultsTableRow(int index)

setUseNeuralNetwork

public void setUseNeuralNetwork(boolean useNeuralNetwork)

setNeuralNetworkFile

public void setNeuralNetworkFile(java.lang.String neuralNetworkFile)


Copyright © 2009. All Rights Reserved.