How can I find threshold value for an image ?

3 views (last 30 days)
Hi,I want to find threshold of an gray image so please provide some codings regarding it.
  1 Comment
Rik
Rik on 31 Mar 2018
binIM=IM<128;
or
binIM=IM>100;
Have a read here and here. It will greatly improve your chances of getting an answer.

Sign in to comment.

Answers (2)

Image Analyst
Image Analyst on 31 Mar 2018
There are a variety of ways. You can use the Otsu method, like in graythresh() or imbinarize(). I tend to like the triangle threshold method, like my attached code.
You can also use the interactive visual thresholding application in my File Exchange: https://www.mathworks.com/matlabcentral/fileexchange/?term=authorid%3A31862&sort=downloads_desc

Nilesh Raghavan
Nilesh Raghavan on 25 Jan 2020
binIM=IM>100;

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!