A blind method to recover the mask of a deep galaxy survey