add white threshold in koptcontext