An entropy based method for extracting robust binary-templates