how to convert grayscale image to binary matrix?

回答(1 个)

See the documentation on the im2bw (link) and imbinarize (link) functions.

6 个评论

I need grayscale image to be an 8 by 8 binary matrix.
After thresholding with the functions, or yourself like this:
binaryImage = grayImage > someThreshold;
call imresize() to make the image 8 by 8
binaryImage = imresize(binaryImage, [8,8], 'nearest');
i didn't get your ans..please give some examples or write complete code for this
Search the File Exchange (link) for Image Analyst’s demonstrations.
Experiment with your image to get the result you want. See the documentation for the functions we referenced.
SHIREESHA THADKAPALLY,did you find the answer?

请先登录,再进行评论。

类别

帮助中心File Exchange 中查找有关 Convert Image Type 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by