- tf.image.extract_glimpse(input, size, offsets, centered=None, normalized=None, uniform_noise=None, name=None)
- tf.image.crop_to_bounding_box(image, offset_height, offset_width, target_height, target_width)
- tf.image.extract_glimpse(input, size, offsets, centered=None, normalized=None, uniform_noise=None, name=None)
tf.image.crop_to_bounding_box(image, offset_height, offset_width, target_height, target_width)
Crops an image to a specified bounding box.
This op cuts a rectangular part out of image
. The top-left corner of the returned image is at offset_height, offset_width
in image
, and its lower-right corner is at offset_height + target_height, offset_width + target_width
.
Args:
image
: 3-D tensor with shape[height, width, channels]
offset_height
: Vertical coordinate of the top-left corner of the result in the input.offset_width
: Horizontal coordinate of the top-left corner of the result in the input.target_height
: Height of the result.target_width
: Width of the result.
Returns:
3-D tensor of image with shape [target_height, target_width, channels]
Raises:
ValueError
: If the shape ofimage
is incompatible with the