0

I have an image, and would like to modify the image based on a given threshold. The function such as

binary = image > threshold 

will create a binary image. What I want is the image pixels will remain the same if it is higher than the threshold. Are there any convenient function to do that?

2

1 Answer 1

1
image[image < threshold] = 0

will clip every pixel below the threshold to 0 and will leave the rest intact

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.