Improved and optimized method split_by_mask()

Method mask_from_contour() is not needed and was removed. Instead, cv2.drawContours is now used to create a binary mask from a contour. The function is much faster as a result, and only the area within a contour is exported.