PxCutout Class

@interface PxCutout : NSObject

A document (or other) region detected in a picture, described as an array of points linked in clockwise order.

Overview

A cutout currently holds four points (a quadrilateral); a future release may use more points to describe more complex regions. A cutout starts in the image’s native orientation, untransformed, and can be transformed for display and restored back to the native orientation.

Instance Properties

NameSummary
boundsThe cutout bounds after transformation is applied.
isDefinedWhether the cutout is a detected document. When false, detection found none and the cutout covers the entire image.
isValidWhether the cutout is geometrically valid: points in the correct order and no self-intersection. Useful to flag an invalid user-edited cutout.
numPointsThe number of points in the rawPoints array.
rawPointsThe cutout points in their original, untransformed image space.
transformationThe transformation matrix applied to the cutout points.

Instance Methods

NameSummary
applyTransformApplies the current transformation to the points and resets it to identity.
copyReturns a copy of this cutout.
expandExpands the cutout to cover its entire origin image; isDefined becomes false.
getPoints:Writes the transformed cutout points into the caller’s buffer.
reorderReorders the points to start from the top-left corner, going clockwise.
reset:Resets the cutout to its initial state covering a region of the given size.
setPoints::Replaces the transformed cutout points.
transformToOrientation:Transforms the cutout to the given orientation.

Relationships

Inherits From

  • NSObject
Top