Add threshold and smooth