# Class: PerspectiveTransformAugmenter

## PerspectiveTransformAugmenter(sigma)

Applies a random four-point perspective transform to the image (kinda like an advanced form of cropping). Each point has a random distance from the image corner, derived from a normal distribution with sigma `sigma`.

Warning : this is only working with opencv4nodejs backend

## Constructor

#### new PerspectiveTransformAugmenter(sigma)

##### Parameters:

Name | Type | Description
--- | --- | ---

`sigma`

Object

options

###### Properties

Name | Type | Attributes | Default | Description
--- | --- | --- | --- | ---
`sigma` | NumberArgument |  |  | the sigma of the normal distribution
`keepSize` | BooleanArgument |  |  | If `keepSize` is set to True (default), each image will be resized back to its original size.
`borderValue` | ColorArgument | <optional> | [0,0,0] | if borderType is "constant" this is used as border pixel values
`borderType` | BorderTypeArgument | <optional> | "constant" | can be "constant", "replicate", "transparent"
`cornersVariation` | Array.<Array.<Number>> | <optional> | null | if set, sigma is not used. For more deterministic behavior, use this to set manually the percent (x,y) variation of each corner

Source:
  - perspective-transform.js, line 26

##### Examples

    // Simple usage, perspective transform on a sigma=10% random perspective tarnsform
    ia.perspectiveTransform(0.1);

    // Now replicate the borders
    ia.perspectiveTransform({
    	sigma: 0.1,
    	borderType: "replicate"
    });