class
RandomCrop
extends
GeometricTransform[Offset]RandomCrop(height: int, width: int, p: float = 1.0)Crop a random height x width window (Albumentations RandomCrop).
Samples top uniformly from [0, H - height] and left
uniformly from [0, W - width], then applies the same crop to
image / mask / boxes / keypoints so every target stays aligned.
Parameters
heightintTarget crop height in pixels (must be
<= H).widthintTarget crop width in pixels (must be
<= W).pfloat= 1.0Probability of applying the transform.
Used by 1
Constructors
1Instance methods
1Sample per-call random parameters for RandomCrop.
Parameters
imgTensorImage tensor; its spatial size bounds the uniform draw of
the crop window's top-left corner.
Returns
OffsetCarries top ~ U[0, H - height] and left
~ U[0, W - width]; the configured height /
width are reused as the crop size.