Adapted binary metrics to cope with empty image.