public class RefinePolygonCornersToImage<T extends boofcv.struct.image.ImageGray> extends java.lang.Object implements RefineBinaryPolygon<T>
| Modifier and Type | Field and Description |
|---|---|
protected java.util.List<georegression.struct.point.Point2D_I32> |
contour |
protected georegression.struct.point.Point2D_F64 |
cornerPt |
protected georegression.struct.point.Point2D_F64 |
leftPt |
protected RefineCornerLinesToImage<T> |
refineCorner |
protected georegression.struct.point.Point2D_F64 |
rightPt |
protected org.ddogleg.struct.GrowQueue_I32 |
splits |
| Constructor and Description |
|---|
RefinePolygonCornersToImage(java.lang.Class<T> imageType)
Provides reasonable default values for all parameters that it can
|
RefinePolygonCornersToImage(int endPointDistance,
double cornerOffset,
int maxLineSamples,
int sampleRadius,
int maxIterations,
double convergeTolPixels,
double maxCornerChangePixels,
java.lang.Class<T> imageType)
Configures all parameters of the detector
|
| Modifier and Type | Method and Description |
|---|---|
void |
clearLensDistortion()
Clears the previously set lens distortion
|
int |
getPixelsAway() |
SnapToLineEdge<T> |
getSnapToEdge() |
protected int |
pickEndIndex(int cornerS,
int dir)
Selects the index to use as the end point.
|
boolean |
refine(georegression.struct.shapes.Polygon2D_F64 input,
java.util.List<georegression.struct.point.Point2D_I32> contour,
org.ddogleg.struct.GrowQueue_I32 splits,
georegression.struct.shapes.Polygon2D_F64 refined)
Refines the corner estimates in the contour.
|
void |
setImage(T input)
Sets the input image
|
void |
setLensDistortion(int width,
int height,
boofcv.struct.distort.PixelTransform2_F32 distToUndist,
boofcv.struct.distort.PixelTransform2_F32 undistToDist)
Specifies lens distortion
|
void |
setPixelsAway(int pixelsAway) |
protected RefineCornerLinesToImage<T extends boofcv.struct.image.ImageGray> refineCorner
protected georegression.struct.point.Point2D_F64 cornerPt
protected georegression.struct.point.Point2D_F64 leftPt
protected georegression.struct.point.Point2D_F64 rightPt
protected java.util.List<georegression.struct.point.Point2D_I32> contour
protected org.ddogleg.struct.GrowQueue_I32 splits
public RefinePolygonCornersToImage(int endPointDistance,
double cornerOffset,
int maxLineSamples,
int sampleRadius,
int maxIterations,
double convergeTolPixels,
double maxCornerChangePixels,
java.lang.Class<T> imageType)
endPointDistance - How many indexes away in the contour list should end points be.cornerOffset - pixels this close to the corner will be ignored. Try 2maxLineSamples - Number of points along the line which will be sampled. try 10sampleRadius - How far away from the line will it sample pixels. ≥ 1maxIterations - Maximum number of iterations it will perform. Try 10convergeTolPixels - When the corner changes less than this amount it will stop iterating. Try 1e-5maxCornerChangePixels - maximum change in corner location allowed from previous iteration in pixels. Try 2.0imageType - Type of input image.public RefinePolygonCornersToImage(java.lang.Class<T> imageType)
imageType - Type of input image.public void setImage(T input)
setImage in interface RefineBinaryPolygon<T extends boofcv.struct.image.ImageGray>input - Input image-public void setLensDistortion(int width,
int height,
boofcv.struct.distort.PixelTransform2_F32 distToUndist,
boofcv.struct.distort.PixelTransform2_F32 undistToDist)
RefineBinaryPolygonsetLensDistortion in interface RefineBinaryPolygon<T extends boofcv.struct.image.ImageGray>public void clearLensDistortion()
RefineBinaryPolygonclearLensDistortion in interface RefineBinaryPolygon<T extends boofcv.struct.image.ImageGray>public boolean refine(georegression.struct.shapes.Polygon2D_F64 input,
java.util.List<georegression.struct.point.Point2D_I32> contour,
org.ddogleg.struct.GrowQueue_I32 splits,
georegression.struct.shapes.Polygon2D_F64 refined)
refine in interface RefineBinaryPolygon<T extends boofcv.struct.image.ImageGray>contour - (Input) Shape's contoursplits - (Input) index of corners in the contourrefined - (Output) Refined polygon with sub-pixel accurate cornersinput - 2D polygon version of contour polygonprotected int pickEndIndex(int cornerS,
int dir)
cornerS - index of corner in split listdir - Specifies which corner is next. can be -1 or 1.public int getPixelsAway()
public void setPixelsAway(int pixelsAway)
public SnapToLineEdge<T> getSnapToEdge()