Class ScoreLineSegmentEdge<T extends ImageGray<T>>


public class ScoreLineSegmentEdge<T extends ImageGray<T>>
extends BaseIntegralEdge<T>
Looks at the difference in pixel values along the edge of a polygon and decides if its a false positive or not. The average difference along the polygons edge is the score. Note that the abs is only taken after the sum is finished, so objects which are entirely dark/light along the edge will have an advantage.
  • Constructor Details

    • ScoreLineSegmentEdge

      public ScoreLineSegmentEdge​(int numSamples, Class<T> imageType)
      Constructor which configures scoring.
      numSamples - Number of points it will sample along an edge
      imageType - Type of image it will process
  • Method Details

    • setImage

      public void setImage​(T image)
      Sets the image which is going to be processed.
      setImage in class BaseIntegralEdge<T extends ImageGray<T>>
    • computeAverageDerivative

      public double computeAverageDerivative​(Point2D_F64 a, Point2D_F64 b, double tanX, double tanY)
      Returns average tangential derivative along the line segment. Derivative is computed in direction of tangent. A positive step in the tangent direction will have a positive value. If all samples go outside the image then zero is returned.
      a - start point
      b - end point
      tanX - unit tangent x-axis. determines length of line integral
      tanY - unit tangent y-axis determines length of line integral
      average derivative
    • getSamplesInside

      public int getSamplesInside()
    • getNumSamples

      public int getNumSamples()
    • setNumSamples

      public void setNumSamples​(int numSamples)
    • getAverageUp

      public double getAverageUp()
    • getAverageDown

      public double getAverageDown()