1. thresholding for bg-corrected image and inverted version of it 2. binary dilation of convex masks 3. find overlapping contours 4. determine brightness in contour of convex mask 5. depending on whether that is > 0 or < 0, use the normal or or inverted mask