# Class: CropToBoxAugmenter

## CropToBoxAugmenter(opts)

Crop the image considering input's "boxes" parameter and with a variation given by sigma

## Constructor

#### new CropToBoxAugmenter(opts)

##### Parameters:

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

`opts`

Object

options

###### Properties

Name | Type | Attributes | Description
--- | --- | --- | ---
`cornersVariation` | NumberArgument | <optional> | length-2 x lenght-2 variate (in percent) of box ex : [[x1, y1], [x2, y2]] will cropp a box of size (x1+x2 +1)width x (y1+y2 +1)height Positive numbers will increase the size of the box
`sigma` | NumberArgument |  | sigma af a normal distribution of cornersVariation
`mean` | NumberArgument |  | mean of a normal distribution of cornersVariation
`boxIndex` | NumberArgument | <optional> | index of the box to use, by default, will be randomly decided

Source:
  - crop-to-box.js, line 29

##### Examples

    // Simple usage, will crop a random box among boxes,
    // and return it as the new image
    // will throw an error if no boxes
    const cropper = ia.cropToBox();

    // default parameter is sigma, here 10% variation
    ia.cropToBox(0.1);

    // here 20% variation, in the normal distribution
    // and by average width of the cropped box will be 20% larger (10% + 10%) and same for height
    ia.cropToBox({sigma: 0.2, mean: 0.1});