|
|||||||||
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.BaseMaxDistanceVectorizer
public class BaseMaxDistanceVectorizer
Vectorizer that is splitting lines based on max distance to line between end points.
The main idea is that this will read a whole multi line at a time. Then later it will split it according to max distance of pixels to the line between start and end point of the multi line.
Maybe this could be completely abstracted out, maybe but at that point I will just take most of this class and turn it into a base class.
Always stop on junctions, if there is one junction point use that, but stop after. N points are chosen last. Never go from one N point to another, unless that the N point is the first point, to handle an X, where you have 4 N points in the center. If you are at a start point then just chose one direction. Can I delegate this to a different object. I always need to find all the neighbors first. I might have to know how many N points there are if there are more just add all to _unfinishedPoints.
Treatment of different points: Junction: add to new point, move to first junction. N points: count, keep track of first. Other: count, keep track of first. Unused: count, keep track of first. I think that is already done. Used: count, keep track of first.
For each junction add to unfinished. Go to first junction. If other points are available take first and go to it. If only N point is available, if current point an N and not the first point stop else go to that.
When coming to a new point check if it is a junction if stop if not on first point. It does not matter if the start point is used or not. I think that at the end check to see if you can go to either a junction point or to the start point. Also stop if you do not know what to do, at the end of handleProblematicPoints().
Field Summary | |
---|---|
protected ChainCodeHandler |
_chainCodeHandler
|
Fields inherited from class org.shapelogic.imageprocessing.BaseVectorizer |
---|
_cleanedupPolygon, _currentDirection, _currentPixelIndex, _currentPoint, _cyclePoints, _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, _setupReturnValue |
Constructor Summary | |
---|---|
BaseMaxDistanceVectorizer()
|
Method Summary | |
---|---|
protected void |
findMultiLine()
Take point off _unfinishedPoints try to start line from that, if nothing is found the remove point |
protected void |
findMultiLinePostProcess()
To be overridden. |
protected boolean |
findMultiLinePreProcess()
|
protected boolean |
findNextLinePoint()
Get the next point to investigate from _currentPoint This also contains check if this should cause a new new point to be created. |
protected byte |
handleProblematicPoints()
|
void |
init()
Cannot handle the last pixel at the edge, so for now just ignore it. |
protected void |
internalFactory()
All the objects that needs special version should be created here. |
protected boolean |
lastPixelOk(byte newDirection)
Everything is always OK. |
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, matchLines, moveCurrentPointForwards, next, oppesiteDirection, pixelIndexToPoint, pointToPixelIndex, pointToPixelIndex, polygonFactory, remove, run, setStreamName |
Methods inherited from class org.shapelogic.imageutil.BaseImageOperation |
---|
getGuiWrapper, getImage, getSetupReturnValue, isImageValid, setGuiWrapper, 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 ChainCodeHandler _chainCodeHandler
Constructor Detail |
---|
public BaseMaxDistanceVectorizer()
Method Detail |
---|
protected void findMultiLine()
findMultiLine
in class BaseVectorizer
protected boolean findNextLinePoint()
protected byte handleProblematicPoints()
handleProblematicPoints
in class BaseVectorizer
protected boolean lastPixelOk(byte newDirection)
lastPixelOk
in class BaseVectorizer
protected void internalFactory()
BaseVectorizer
internalFactory
in class BaseVectorizer
protected boolean findMultiLinePreProcess()
findMultiLinePreProcess
in class BaseVectorizer
protected void findMultiLinePostProcess()
BaseVectorizer
findMultiLinePostProcess
in class BaseVectorizer
public void init()
BaseVectorizer
init
in class BaseVectorizer
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |