I need to extract (m x m) sub-images from a batch of (n x n) images, where:
images.shape = (batch, n, n, n_channels), sub-images.shape = (batch, m, m, n_channels),
and where each sub-image is in a different location for each image in the batch. Seems like the closest routine there is for this is: tf.image.crop_to_bounding_box(), but this uses the same cropping parameters for all images in the batch. Is there a simple way to do this? I can always resort to gather_nd() but that is very cumbersome.