Kofax Mobile SDK API Reference
|
Public Member Functions | |
DetectionSettings (Point targetFrameCenter, double targetFrameAspectRatio, double targetFramePaddingPercent) | |
Constructor creates a document detection setting object that has specified values. More... | |
Point | getCenterPoint () |
Gets the center point within the image of the target frame. More... | |
void | setCenterPoint (Point targetFrameCenter) |
Sets the center point within the image of the target frame. More... | |
double | getTargetFrameAspectRatio () |
Gets the aspect ratio of the rectangular frame that should match the document being searched. More... | |
void | setTargetFrameAspectRatio (double targetFrameAspectRatio) |
Sets the aspect ratio of the rectangular frame that should match the document being searched. More... | |
double | getTargetFramePaddingPercent () |
Gets the minimum padding in percent length to be maintained between the edges of the target frame and image. More... | |
void | setTargetFramePaddingPercent (double paddingPercent) |
Sets the minimum padding in percent length to be maintained between the edges of the target frame and image. More... | |
double | getMinFillFraction () |
Gets the minimum fill area as a fraction of the target frame. More... | |
void | setMinFillFraction (double minFillFraction) |
Sets the minimum fill area as a fraction of the target frame. More... | |
double | getMaxFillFraction () |
Gets the maximum fill area as a fraction of the target frame. More... | |
void | setMaxFillFraction (double maxFillFraction) |
Sets the maximum fill area as a fraction of the target frame. More... | |
double | getMaxSkewAngle () |
Gets the maximum angle the document can be rotated off from the target frame. More... | |
void | setMaxSkewAngle (double maxSkewAngle) |
Sets the maximum angle the document can be rotated off from the target frame. More... | |
double | getToleranceFraction () |
Gets the maximum distance the document can be shifted from the target frame. More... | |
void | setToleranceFraction (double toleranceFraction) |
Sets the maximum distance the document can be shifted from the target frame. More... | |
Protected Member Functions | |
DetectionSettings () | |
Default constructor creates a detection setting object that has default values. More... | |
DetectionSettings (DetectionSettings settings) | |
A base class for configuration objects for controlling the guided detection driven by target frame.
The primary purpose of the settings object is to define properties of a rectangular target frame. The target frame is a rectangular area confined within the bounds of the image, and represents the the ideal area that should be covered by a document. Results returned from the document detector will provide adjustment guidance relative to the target frame.
A target frame is constructed from a center point, an aspect ratio, and a minimum edge padding. The size of the target frame is the largest possible rectangle that can be made without violating any of these constraints.
Additional settings properties set tolerances on the guidance available from a result object.
|
protected |
Default constructor creates a detection setting object that has default values.
|
protected |
Copy constructor
settings | the settings object to copy from |
DetectionSettings | ( | Point | targetFrameCenter, |
double | targetFrameAspectRatio, | ||
double | targetFramePaddingPercent | ||
) |
Constructor creates a document detection setting object that has specified values.
targetFrameCenter | Set the target rectangle center point. Should just be a point with in the bounds of the image height and width. |
targetFrameAspectRatio | Set the aspect ratio the target rectangle should have. Must be greater than 0. |
targetFramePaddingPercent | Set the padding around the target rectangle. must be greater than or equal to 0 and less then 100. |
Point getCenterPoint | ( | ) |
Gets the center point within the image of the target frame.
double getMaxFillFraction | ( | ) |
Gets the maximum fill area as a fraction of the target frame.
double getMaxSkewAngle | ( | ) |
Gets the maximum angle the document can be rotated off from the target frame.
double getMinFillFraction | ( | ) |
Gets the minimum fill area as a fraction of the target frame.
double getTargetFrameAspectRatio | ( | ) |
Gets the aspect ratio of the rectangular frame that should match the document being searched.
double getTargetFramePaddingPercent | ( | ) |
Gets the minimum padding in percent length to be maintained between the edges of the target frame and image.
double getToleranceFraction | ( | ) |
Gets the maximum distance the document can be shifted from the target frame.
void setCenterPoint | ( | Point | targetFrameCenter | ) |
Sets the center point within the image of the target frame.
The center point is any point within the image that the target frame will be constructed around and centered over. This value will be clamped to the valid area of the image being searched, and by default is set to the center of the image.
targetFrameCenter | : Point |
void setMaxFillFraction | ( | double | maxFillFraction | ) |
Sets the maximum fill area as a fraction of the target frame.
The maximum fill fraction puts an upper bound on what is considered an acceptable zoom level. If the area of a detected document is greater then the area of the target frame multiplied by the maximum fill fraction, guidance will suggest zooming out from the document. Setting a negative number is ignored.
The default value is 1.3.
void setMaxSkewAngle | ( | double | maxSkewAngle | ) |
Sets the maximum angle the document can be rotated off from the target frame.
The skew angle tolerance puts an upper bound on how far a document can be rotated clockwise or counter-clockwise relative to the target frame and still be considered acceptable. Angles of rotation greater than the tolerance will result in guidance to turn the document. Setting a negative number is ignored.
The default value is 10, specified in degrees.
maxSkewAngle | : double |
void setMinFillFraction | ( | double | minFillFraction | ) |
Sets the minimum fill area as a fraction of the target frame.
The minimum fill fraction puts a lower bound on what is considered an acceptable zoom level. If the area of a detected document is less then the area of the target frame multiplied by the minimum fill fraction, guidance will suggest zooming in on the document. Setting a negative number is ignored.
The default value is 0.65.
minFillFraction | : double |
void setTargetFrameAspectRatio | ( | double | targetFrameAspectRatio | ) |
Sets the aspect ratio of the rectangular frame that should match the document being searched.
The aspect ratio is used to construct the target frame that should match the document being searched. If targetFrameAspectRatio > 1
, the long edge of the target frame will align with the long edge of the camera preview. If 0 < targetFrameAspectRatio < 1
, the long edge of the target frame will align with the short edge of the camera preview.
If the targetFrameAspectRatio is set to 0, then it will be automatically reset to an image aspect ratio.
Setting negative values has the same effect as if 0
was set.
The default value is 0.
targetFrameAspectRatio | : double |
void setTargetFramePaddingPercent | ( | double | paddingPercent | ) |
Sets the minimum padding in percent length to be maintained between the edges of the target frame and image.
Values will be clamped to the range [0-50]. The default value is 5. Also, note that there is a much lower operational bound to what the padding percent could be set to behave well. For example:
paddingPercent | : double |
void setToleranceFraction | ( | double | toleranceFraction | ) |
Sets the maximum distance the document can be shifted from the target frame.
The movement tolerance puts an upper bound on how far a document can be shifted from the target frame and still be considered acceptable. The tolerance is specified as a fraction of the target size, and the comparison is made between the center of the target frame and the center of the detected document bounds. Setting a negative number is ignored.
The default tolerance value is 0.15.
toleranceFraction | : double |