boofcv.alg.shapes.edge
Class ScoreLineSegmentEdge<T extends ImageGray>
- java.lang.Object
-
- boofcv.alg.shapes.edge.BaseIntegralEdge<T>
-
- boofcv.alg.shapes.edge.ScoreLineSegmentEdge<T>
-
public class ScoreLineSegmentEdge<T extends ImageGray> 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 Summary
Constructors Constructor and Description ScoreLineSegmentEdge(int numSamples, java.lang.Class<T> imageType)Constructor which configures scoring.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description doublecomputeAverageDerivative(Point2D_F64 a, Point2D_F64 b, double tanX, double tanY)Returns average tangential derivative along the line segment.doublegetAverageDown()doublegetAverageUp()intgetNumSamples()intgetSamplesInside()voidsetImage(T image)Sets the image which is going to be processed.voidsetNumSamples(int numSamples)voidsetTransform(PixelTransform_F32 undistToDist)Used to specify a transform that is applied to pixel coordinates to bring them back into original input image coordinates.
-
-
-
Constructor Detail
-
ScoreLineSegmentEdge
public ScoreLineSegmentEdge(int numSamples, java.lang.Class<T> imageType)Constructor which configures scoring.- Parameters:
numSamples- Number of points it will sample along an edgeimageType- Type of image it will process
-
-
Method Detail
-
setTransform
public void setTransform(PixelTransform_F32 undistToDist)
Used to specify a transform that is applied to pixel coordinates to bring them back into original input image coordinates. For example if the input image has lens distortion but the edge were found in undistorted coordinates this code needs to know how to go from undistorted back into distorted image coordinates in order to read the pixel's value.- Overrides:
setTransformin classBaseIntegralEdge<T extends ImageGray>- Parameters:
undistToDist- Pixel transformation from undistorted pixels into the actual distorted input image..
-
setImage
public void setImage(T image)
Sets the image which is going to be processed.- Overrides:
setImagein classBaseIntegralEdge<T extends ImageGray>
-
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.- Parameters:
a- start pointb- end pointtanX- unit tangent x-axis. determines length of line integraltanY- unit tangent y-axis determines length of line integral- Returns:
- average derivative
-
getSamplesInside
public int getSamplesInside()
-
getNumSamples
public int getNumSamples()
-
setNumSamples
public void setNumSamples(int numSamples)
-
getAverageUp
public double getAverageUp()
-
getAverageDown
public double getAverageDown()
-
-
DataMelt 3.0 © DataMelt by jWork.ORG