I have an image to threshold. But I dont want to classical methods. I have my own min and max threshold value. How can i apply this threshold values to my image and get a binary mask. For example min is 300 and max is 500 if my pixel value is between these I get 255 if not I get 0. Thanks for helping.
Asked
Active
Viewed 410 times
0
-
Are you working with grayscale values? How are you loading your images? What have you tried so far code wise? – T A Jan 21 '21 at 08:37
1 Answers
0
Assuming you're using opencv, there's the cv2.inRange(img, min, max) function that does exactly that. If you want a library agnostic solution then you could iterate through your image and build the mask yourself by checking each individual pixel value against your bounds.

Ian Chu
- 2,924
- 9
- 14