Crop
Crop
Bases: BoundsTransform
Crop an image.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cropping
|
TypeBounds
|
Tuple \((w_{ini}, w_{fin}, h_{ini}, h_{fin}, d_{ini}, d_{fin})\) defining the number of values cropped from the edges of each axis. If the initial shape of the image is \(W \times H \times D\), the final shape will be \((- w_{ini} + W - w_{fin}) \times (- h_{ini} + H - h_{fin}) \times (- d_{ini} + D - d_{fin})\). If only three values \((w, h, d)\) are provided, then \(w_{ini} = w_{fin} = w\), \(h_{ini} = h_{fin} = h\) and \(d_{ini} = d_{fin} = d\). If only one value \(n\) is provided, then \(w_{ini} = w_{fin} = h_{ini} = h_{fin} = d_{ini} = d_{fin} = n\). |
required |
copy
|
If |
True
|
|
**kwargs
|
See |
{}
|
If you want to pass the output shape instead, please use
CropOrPad instead.
__call__(data)
Transform data and return a result of the same type.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
TypeTransformInput
|
Instance of |
required |
to_hydra_config()
Return a dictionary representation of the transform for Hydra instantiation.