> For the complete documentation index, see [llms.txt](https://docs.roboflow.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.roboflow.com/datasets/versions/dataset-versions/image-augmentation/augmentation-types/crop-augmentation.md).

# Crop Augmentation

Randomly crop and zoom into each image to add positional and scale variability and improve model generalization.

Crop zooms into a random part of each image, then scales the crop back to the full image size. Your model learns that objects can appear at different sizes, off center, or partly out of frame.

## Settings

* "Minimum Zoom": the smallest zoom, in percent. The default is 0%.
* "Maximum Zoom": the largest zoom, in percent. The default is 20%.

Each augmented image gets a random zoom between the two values, at a random position. The zoom is the share of the image's width and height that is cut away: a 20% zoom keeps 80% of the width and 80% of the height, then scales that region up to the original size. The "Create New Version" page sets both values with one two-handle slider, and warns you when the minimum is above 10% or the maximum is above 30%.

Crop is not available for keypoint detection.

## How Annotations Change

Annotations move and scale with the crop. Roboflow drops any annotation that falls completely outside the crop, and trims any annotation that is partly outside so it ends at the edge of the image. A trimmed annotation is kept no matter how little of the object remains in the frame.

## When to Use

* Framing in production is unpredictable (ex: a mobile app held at different distances, a security camera where subjects move through the frame).
* Objects are often partly out of frame or partly hidden.

## When Not to Use

* Your objects are tiny. A crop can cut them out or leave too few pixels to learn from. Crop lightly, if at all, and check a few generated images.
* The camera framing never changes (ex: a fixed inspection station).
* The whole frame carries the meaning (ex: document layout, a full page of text).

## Example

<figure><img src="https://2252499186-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNVfRxNsvCh4GOyqrjmzX%2Fuploads%2Fgit-blob-e298f1b28328fc476a3b1c0d89cd43ca848ca7cd%2Faugmentation-example-crop.png?alt=media" alt="The image zoomed by 20% at two positions, with boxes moved, scaled, and trimmed at the edges"><figcaption><p>Example: a 20% zoom at two random positions. The kept region is scaled back to 1280 x 720, and boxes are trimmed where they cross the edge.</p></figcaption></figure>

<figure><img src="https://2252499186-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNVfRxNsvCh4GOyqrjmzX%2Fuploads%2Fgit-blob-db214e3040a1360713975c71bb65056497a233e6%2Faugmentation-crop-modal.png?alt=media" alt="The Crop modal on the Create New Version page with a two-handle slider from 0% to 20% and previews at 0% and 20% zoom"><figcaption><p>On the "Create New Version" page, one slider sets the minimum and maximum zoom.</p></figcaption></figure>
