Using annotation and masking for contours