polar-computing / 3DSeals

0 stars 2 forks source link

Background extraction #4

Closed aborowicz closed 8 years ago

aborowicz commented 8 years ago

(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.

aborowicz commented 8 years ago

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).