ir_safe_threshold_subtraction