Crop and position Mask

Takes a binary mask and positions it on another image.

crop_position_mask(img, mask, device,x,y,v_pos="top",h_pos="right", debug=None)

returns device, newmask

Original image

Screenshot

Original resized mask (using the resize function)

Screenshot

from plantcv import plantcv as pcv

# Image not positioned (no adustment)

device, cropped1= pcv.crop_position_mask(img,mask,device,0,0,"top","right", debug="print")


Screenshot

from plantcv import plantcv as pcv

# Image positioned

device, cropped1= pcv.crop_position_mask(img,mask,device,40,3,"top","right", debug="print")


Screenshot