(fun is back_extract.py)
Currently, we gamma adjust the image to a high value (gamma=~10) which provides a clear outline of the seal. Then we findContour for the largest contour. IF the background wraps around the seal (ie the seal's head and tail aren't cropped off, then this segment is typically the background.
Problems:
images where there are two backgrounds (one above and one below due to cropping.
Differences in background - really good on snow, not as much on rock
Possible Solutions:
blur the image before findContours. Helps reduce the effect of pebble/cobble beaches (they segment together).
-Invert images where the background is dark. Average the pixel values of the first row and also the last row to find if the background is dark or light. If they're different, then maybe run 1st and second largest contours by area rather than just the 1st largest.
Pretty much solved. back_extract now can find two background segments if there is in fact a second one. It also blurs early on. It now outputs an image with the background removed (background is black).
(fun is back_extract.py) Currently, we gamma adjust the image to a high value (gamma=~10) which provides a clear outline of the seal. Then we findContour for the largest contour. IF the background wraps around the seal (ie the seal's head and tail aren't cropped off, then this segment is typically the background.
Problems:
Possible Solutions:
-Invert images where the background is dark. Average the pixel values of the first row and also the last row to find if the background is dark or light. If they're different, then maybe run 1st and second largest contours by area rather than just the 1st largest.