Document Scanning SDK for Apple iOS  2.5.2
Class Methods | List of all members
PxSDK Class Reference

SDK main API class. More...

#import <PxSDK.h>

Inheritance diagram for PxSDK:

Class Methods

(CGSize) + supportedImageSize:
 Returns max supported image size. This function is not thread safe. More...
 
(BOOL) + detectDocumentCorners:docCorners:
 Detects document in the page image and saves document detection quality into the page. More...
 
(BOOL) + validateDocumentCorners:width:height:
 Check document corners validity. More...
 
(BOOL) + regulateDocumentCorners:
 Try to regulate document corners compliance to order UL-UR-BL-BR. More...
 
(PxMetaImage *_Nonnull) + correctDocument:corners:
 Corrects document perspective distortions in the image, warping corners to corrected image rectangle. More...
 
(PxMetaImage *_Nonnull) + imageWithoutRotation:
 Creates a new UIImage as a copy of source image with applying UIImageOrientation flag to it. More...
 
(PxMetaImage *_Nonnull) + imageOriginal:
 Returns new image with orientation reset to normal. More...
 
(PxMetaImage *_Nonnull) + imageBWBinarization:
 
(PxMetaImage *_Nonnull) + imageGrayBinarization:
 
(PxMetaImage *_Nonnull) + imageColorBinarization:
 

Detailed Description

SDK main API class.

Method Documentation

◆ correctDocument:corners:()

+ (PxMetaImage* _Nonnull) correctDocument: (PxMetaImage *_Nonnull)  image
corners: (const PxPoint corners[_Nonnull 4] 

Corrects document perspective distortions in the image, warping corners to corrected image rectangle.

Parameters
imagesource image containig the document
corners4 corners in the source image coordinate space with the following sequence: (top;left), (top;right), (bottom;left), (bottom:right). Origin point (0,0) is top-left corner of source image. All 4 corners are within the source image.
Returns
image containing the document without perpective distortions.

◆ detectDocumentCorners:docCorners:()

+ (BOOL) detectDocumentCorners: (PxMetaImage *_Nonnull)  image
docCorners: (PxDocCorners *_Nonnull)  docCorners 

Detects document in the page image and saves document detection quality into the page.

Parameters
imagesource image containig the document
docCornersdetection parameters on input and receives detection result on output
Returns
YES on success, otherwise NO.

◆ imageBWBinarization:()

+ (PxMetaImage* _Nonnull) imageBWBinarization: (PxMetaImage *_Nonnull)  image
Parameters
imageimage to process
Returns
black/white binarized image.

◆ imageColorBinarization:()

+ (PxMetaImage* _Nonnull) imageColorBinarization: (PxMetaImage *_Nonnull)  image
Parameters
imageimage to process
Returns
color binarized image.

◆ imageGrayBinarization:()

+ (PxMetaImage* _Nonnull) imageGrayBinarization: (PxMetaImage *_Nonnull)  image
Parameters
imageimage to process
Returns
gray (monochrome) binarized image.

◆ imageOriginal:()

+ (PxMetaImage* _Nonnull) imageOriginal: (PxMetaImage *_Nonnull)  image

Returns new image with orientation reset to normal.

Parameters
imageimage to process
Returns
thr resulting image.

◆ imageWithoutRotation:()

+ (PxMetaImage* _Nonnull) imageWithoutRotation: (PxMetaImage *_Nonnull)  image

Creates a new UIImage as a copy of source image with applying UIImageOrientation flag to it.

Parameters
imageimage to process
Returns
rotated image.

◆ regulateDocumentCorners:()

+ (BOOL) regulateDocumentCorners: (PxPoint corners[_Nonnull 4]

Try to regulate document corners compliance to order UL-UR-BL-BR.

Parameters
cornersdocument corners to validate
Returns
true if corners are valid and regulation was successful.

◆ supportedImageSize:()

+ (CGSize) supportedImageSize: (CGSize)  imageSize

Returns max supported image size. This function is not thread safe.

Parameters
imageSizeinput image size
Returns
maximal supported image size. Special case: for input (-1, -1) returns maximal image dimensions.

◆ validateDocumentCorners:width:height:()

+ (BOOL) validateDocumentCorners: (const PxPoint corners[_Nonnull 4]
width: (uint)  width
height: (uint)  height 

Check document corners validity.

Parameters
cornersdocument corners to validate
widthrotated image width
heightrotated image height
Returns
true if corners are valid.