preprocessor_BASE_470 module¶
-
preprocessor_BASE_470.binarize_asparagus_img(img)¶
-
preprocessor_BASE_470.filter_mask_img(img)¶ [summary]
- Parameters
img ([type]) – [description]
- Returns
[description]
- Return type
[type]
-
preprocessor_BASE_470.preprocessor(img_dir, target_dir, show=True, save=False, debug=True, time_constraint=None)¶ Walks over a directory full of images, detects asparagus in those images, extracts them with minimal bounding box into an image of shape height x width and stores that image in target dir with a simple name.
- Parameters
img_dir – the directory with raw images as string
target_dir – the target directory as string (where to store clean images)
show – whether to show the generated images
save – whether to actually save images or not (for debugging)
debug – debug mode: increased verbosity
time_constraint – If we expect automatic shutdown by grid service, we set this to the available runtime in minutes. The script will commit suicide gracefully if less than 30 seconds remain. This is only done to prevent being killed by force while the progress file is updated, to prevent catastrophic status loss. (i.e. just set this to 60 if you start this on the grid)