HAPPY.cropping_functions module
- HAPPY.cropping_functions.cropImage(image, crop_bottom, crop_top, crop_left, crop_right)[source]
Crop an image.
- Parameters
image (numpy array) – The image that is to be cropped
crop_bottom (int) – How many pixels to crop in each of these directions
crop_top (int) – How many pixels to crop in each of these directions
crop_left (int) – How many pixels to crop in each of these directions
crop (int) – How many pixels to crop in each of these directions
- Returns
image – The image that has been cropped
- Return type
array
- HAPPY.cropping_functions.cropping_tube(image, crop_param, size_param, dilation_param)[source]
Crop tubes of an image.
- Parameters
image (numpy array) – The original tubed image that needs to be cropped.
crop_param (int) – Threshold for removing the dark edges i.e., tube ends in the image.
size_param (int) – Make sure features below this size (i.e. hydrides) are not included in cropping.
dilation_param (int) – Dilate the cropped boundary by a number of pixels.
- Returns
cropped image (numpy array) – The final cropped image
cropped threshold (array of bool) – True/False array highlighting the cropped and not cropped regions