Quantifying camouflage: how to predict detectability from appearance