public class Skew extends Object
Modifier and Type | Field and Description |
---|---|
static float |
SEARCH_MIN_DELTA
Default search minimum delta, reasonably accurate within 0.05 degrees.
|
static int |
SEARCH_REDUCTION
Default sweep reduction, one-fourth the size of the original image.
|
static float |
SWEEP_DELTA
Default sweep delta, reasonably accurate within 0.05 degrees.
|
static float |
SWEEP_RANGE
Default range for sweep, will detect rotation of + or - 30 degrees.
|
static int |
SWEEP_REDUCTION
Default sweep reduction, one-eighth the size of the original image.
|
Constructor and Description |
---|
Skew() |
Modifier and Type | Method and Description |
---|---|
static float |
findSkew(Pix pixs)
Finds and returns the skew angle using default parameters.
|
static float |
findSkew(Pix pixs,
float sweepRange,
float sweepDelta,
int sweepReduction,
int searchReduction,
float searchMinDelta)
Finds and returns the skew angle, doing first a sweep through a set of
equal angles, and then doing a binary search until convergence.
|
public static final float SWEEP_RANGE
public static final float SWEEP_DELTA
public static final int SWEEP_REDUCTION
public static final int SEARCH_REDUCTION
public static final float SEARCH_MIN_DELTA
public static float findSkew(Pix pixs)
pixs
- Input pix (1 bpp).public static float findSkew(Pix pixs, float sweepRange, float sweepDelta, int sweepReduction, int searchReduction, float searchMinDelta)
Notes:
pixs
- Input pix (1 bpp).sweepRange
- Half the full search range, assumed about 0; in
degrees.sweepDelta
- Angle increment of sweep; in degrees.sweepReduction
- Sweep reduction factor = 1, 2, 4 or 8.searchReduction
- Binary search reduction factor = 1, 2, 4 or 8; and
must not exceed sweepReduction.searchMinDelta
- Minimum binary search increment angle; in degrees.