|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.shapelogic.imageutil.BaseImageOperation org.shapelogic.imageprocessing.BaseVectorizer org.shapelogic.imageprocessing.ShortLineBasedVectorizer org.shapelogic.imageprocessing.DirectionBasedVectorizer
public class DirectionBasedVectorizer
DirectionBasedVectorizer is a Vectorizer based on direction. This is special by using directions as the primary way of finding the path.
Field Summary | |
---|---|
protected byte[] |
_chainCodeForMultiLine
All the direction from _firstPointInLine, so the direction on index 0 is point one pixel away from _firstPointInLine. |
protected int[] |
_directionsCount
|
protected int |
_lastPointInCurrentMultiLine
|
protected double[] |
_shortLineAngles
|
protected double[] |
_shortLineAngleSpeeds
|
protected int |
_shortLineCount
|
protected double[] |
_shortLineLength
|
protected int[] |
_shortLinePointIndex
|
protected static int |
CHAIN_CODE_FOR_MULTI_LINE_MAX_LENGTH
|
protected static int |
MAX_SHORT_LINE_COUNT
|
protected static int |
NUMBER_OF_SAME_DIRECTION_TO_START_STRAIGHT
|
Fields inherited from class org.shapelogic.imageprocessing.ShortLineBasedVectorizer |
---|
_angleLimit, _currentAngle, _currentCircleInterval, _currentLineType, _currentVectorDirection, _firstPointInLine, _firstUsedDirection, _maxPointsInShortLine, _pixelTypeCalculatorNextPoint, _pointsInCurrentShortLine, _secondUsedDirection, _startOfShortLinePoint, ANGLE_DIFFERENCE_LIMIT, MAX_NUMBER_OF_POINTS_IN_SHORT_LINE |
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 | |
---|---|
DirectionBasedVectorizer()
|
Method Summary | |
---|---|
static CPointInt |
angleFromDirectionArray(byte[] directionArray,
int startDirection,
int endDirection)
Get angle from direction byte array. |
protected void |
findMultiLinePostProcess()
To be overridden. |
protected boolean |
isStraight()
Test if the last part of the line is straight. |
protected boolean |
lastPixelOk(byte newDirection)
Change to be an up front check. |
protected void |
makeNewPointPostProcess()
|
protected void |
moveCurrentPointForwards(byte newDirection)
|
protected boolean |
multiLineHasGlobalFitness()
Test that the current direction is close to the last direction. |
void |
newShortLine()
Hook for creating new short line. |
protected int |
numberOfDirections(int[] directionsCount)
Test how many of the 8 directions are represented. |
protected void |
splitLine(int splitIndex)
I think that this is messing with the short lines. |
Methods inherited from class org.shapelogic.imageprocessing.ShortLineBasedVectorizer |
---|
findMultiLine, findMultiLinePreProcess, findNextLinePoint, getAngleLimit, getMaxSinceLast, handleProblematicPoints, internalFactory, makeNewPoint, resetShortLine, setAngleLimit, setMaxSinceLast, splitLine |
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, init, isPixelUsed, matchLines, next, oppesiteDirection, pixelIndexToPoint, pointToPixelIndex, pointToPixelIndex, polygonFactory, remove, run, 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 |
---|
protected static final int CHAIN_CODE_FOR_MULTI_LINE_MAX_LENGTH
protected static final int MAX_SHORT_LINE_COUNT
protected static final int NUMBER_OF_SAME_DIRECTION_TO_START_STRAIGHT
protected byte[] _chainCodeForMultiLine
protected int[] _directionsCount
protected int _shortLineCount
protected double[] _shortLineAngles
protected double[] _shortLineAngleSpeeds
protected double[] _shortLineLength
protected int[] _shortLinePointIndex
protected int _lastPointInCurrentMultiLine
Constructor Detail |
---|
public DirectionBasedVectorizer()
Method Detail |
---|
protected boolean multiLineHasGlobalFitness()
protected boolean lastPixelOk(byte newDirection)
ShortLineBasedVectorizer
lastPixelOk
in class ShortLineBasedVectorizer
protected boolean isStraight()
protected int numberOfDirections(int[] directionsCount)
protected void moveCurrentPointForwards(byte newDirection)
moveCurrentPointForwards
in class ShortLineBasedVectorizer
public void newShortLine()
ShortLineBasedVectorizer
newShortLine
in class ShortLineBasedVectorizer
protected void makeNewPointPostProcess()
makeNewPointPostProcess
in class ShortLineBasedVectorizer
public static CPointInt angleFromDirectionArray(byte[] directionArray, int startDirection, int endDirection)
protected void splitLine(int splitIndex)
splitIndex
- protected void findMultiLinePostProcess()
BaseVectorizer
findMultiLinePostProcess
in class ShortLineBasedVectorizer
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |