image¶

Miscellaneous utilities which operate on image data.

Module attributes

PADDING_TO_BOUNDS

Constant array which when multiplied with padding and added to bounds, applies the padding to the bounds.

Functions

crop_and_pad_edges

Apply padding to areas of a region which are outside max dimensions.

find_overlap

Find the part of a region which overlaps the image area.

find_padding

Find the correct padding to add when reading a region of an image.

make_bounds_size_positive

Make bounds have positive size and get horizontal/vertical flip flags.

normalize_padding_size

Normalizes padding to be length 4 (left, top, right, bottom).

safe_padded_read

Read a region of a numpy array with padding applied to edges.

sub_pixel_read

Read and resize an image region with sub-pixel bounds.