Added function get_mask_from_poly().