Package boofcv.alg.shapes.edge
Class ScoreLineSegmentEdge<T extends ImageGray<T>>
java.lang.Object
boofcv.alg.shapes.edge.BaseIntegralEdge<T>
boofcv.alg.shapes.edge.ScoreLineSegmentEdge<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.
-
Field Summary
Fields inherited from class boofcv.alg.shapes.edge.BaseIntegralEdge
integral, integralImage
-
Constructor Summary
ConstructorDescriptionScoreLineSegmentEdge
(int numSamples, Class<T> imageType) Constructor which configures scoring. -
Method Summary
Modifier and TypeMethodDescriptiondouble
computeAverageDerivative
(Point2D_F64 a, Point2D_F64 b, double tanX, double tanY) Returns average tangential derivative along the line segment.double
double
int
int
void
Sets the image which is going to be processed.void
setNumSamples
(int numSamples) Methods inherited from class boofcv.alg.shapes.edge.BaseIntegralEdge
getInputType, setTransform
-
Constructor Details
-
ScoreLineSegmentEdge
Constructor which configures scoring.- Parameters:
numSamples
- Number of points it will sample along an edgeimageType
- Type of image it will process
-
-
Method Details
-
setImage
Sets the image which is going to be processed.- Overrides:
setImage
in classBaseIntegralEdge<T extends ImageGray<T>>
-
computeAverageDerivative
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()
-