org.shapelogic.imageprocessing
Class LineProperties

java.lang.Object
  extended by org.shapelogic.imageprocessing.LineProperties
All Implemented Interfaces:
Calc<java.util.Set<LineType>>, LazyCalc<java.util.Set<LineType>>

public class LineProperties
extends java.lang.Object
implements LazyCalc<java.util.Set<LineType>>

LineProperties contains properties that are important for a line when you are dealing with curved multi line.

Author:
Sami Badawi Properties to keep track of Min and max point Number of positive, almost zero and negative pixels Sum of positive and sum of negative distances If direction change for the 2 adjacent point is different sign Assumptions I do not think that this class is going be reused

Field Summary
 LineType _lineType
           
 double angle
           
 int areaNegativeDistance
           
 int areaPositiveDistance
           
 boolean inflectionPoint
           
 double lastDist
           
 double lengthOfDistanceUnit
           
 int maxNegativeDist
           
 int maxNegativeIndex
           
 CPointInt maxNegativePoint
           
 int maxPositiveDist
           
 int maxPositiveIndex
           
 double nextDist
           
 CPointInt orthogonalVector
           
 int pixelsWithAlmostZeroDistance
           
 int pixelsWithNegativeDistance
           
 int pixelsWithPositiveDistance
           
 CPointInt relativeVector
           
 CPointInt startPoint
           
static int STRAIGHT_LIMIT
           
 
Constructor Summary
LineProperties()
           
 
Method Summary
 java.util.Set<LineType> calc()
           
 LineType calcLineType()
          The main LineType for a line there are 3 options: straight, arch, wave.
 double distanceToPoint(CPointInt point)
          Same unnormalized point distance to line used in splitting line.
 java.util.Set<LineType> getCalcValue()
          If dirty do calc() else return cached value.
 boolean isConcaveArch()
          lineType needs to be set first.
 boolean isDirty()
           
 void setup()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

STRAIGHT_LIMIT

public static int STRAIGHT_LIMIT

pixelsWithPositiveDistance

public int pixelsWithPositiveDistance

pixelsWithNegativeDistance

public int pixelsWithNegativeDistance

pixelsWithAlmostZeroDistance

public int pixelsWithAlmostZeroDistance

areaPositiveDistance

public int areaPositiveDistance

areaNegativeDistance

public int areaNegativeDistance

maxPositiveDist

public int maxPositiveDist

maxPositiveIndex

public int maxPositiveIndex

maxNegativeDist

public int maxNegativeDist

maxNegativeIndex

public int maxNegativeIndex

maxNegativePoint

public CPointInt maxNegativePoint

angle

public double angle

_lineType

public LineType _lineType

startPoint

public CPointInt startPoint

relativeVector

public CPointInt relativeVector

orthogonalVector

public CPointInt orthogonalVector

lengthOfDistanceUnit

public double lengthOfDistanceUnit

lastDist

public double lastDist

nextDist

public double nextDist

inflectionPoint

public boolean inflectionPoint
Constructor Detail

LineProperties

public LineProperties()
Method Detail

setup

public void setup()
Specified by:
setup in interface LazyCalc<java.util.Set<LineType>>

calc

public java.util.Set<LineType> calc()
Specified by:
calc in interface Calc<java.util.Set<LineType>>

getCalcValue

public java.util.Set<LineType> getCalcValue()
Description copied from interface: Calc
If dirty do calc() else return cached value. This should maybe be moved up in the hierarchy

Specified by:
getCalcValue in interface Calc<java.util.Set<LineType>>

calcLineType

public LineType calcLineType()
The main LineType for a line there are 3 options: straight, arch, wave.


distanceToPoint

public double distanceToPoint(CPointInt point)
Same unnormalized point distance to line used in splitting line.

Parameters:
point - an input
Returns:
unnormalized distance to the line from the star to end point

isConcaveArch

public boolean isConcaveArch()
lineType needs to be set first.


isDirty

public boolean isDirty()
Specified by:
isDirty in interface LazyCalc<java.util.Set<LineType>>


Copyright © 2007. All Rights Reserved.