How from uint8 to 0 and 1?

8 ビュー (過去 30 日間)
Dimitrios
Dimitrios 2014 年 11 月 6 日
コメント済み: Dimitrios 2014 年 11 月 6 日
I import the following image which is a [583x673x3] uint8 :
and i would like the convert the grey/black color to origianally black.How it can be ?

採用された回答

Sean de Wolski
Sean de Wolski 2014 年 11 月 6 日
Igray = rgb2gray(I);
BW = im2bw(Igray,graythresh(Igray));
imshow(BW)
  2 件のコメント
Image Analyst
Image Analyst 2014 年 11 月 6 日
grayImage = uint8(255 * BW);
Dimitrios
Dimitrios 2014 年 11 月 6 日
Sorry i deleted the question,because i found it.but thanks for the answer.For others my question was 'How to convert the resulted image again to uint8?'

サインインしてコメントする。

その他の回答 (2 件)

Youssef  Khmou
Youssef Khmou 2014 年 11 月 6 日
編集済み: Youssef Khmou 2014 年 11 月 6 日
rgb2gray(im2double(X));
  1 件のコメント
Dimitrios
Dimitrios 2014 年 11 月 6 日
thank you for your answer, but the image remained the same.

サインインしてコメントする。


Chad Greene
Chad Greene 2014 年 11 月 6 日
Tinker with this threshold value:
threshold = 250;
A = imread('export_fig_out.png');
A(A>=threshold)=255;
A(A<threshold)=0;
imshow(A)
  2 件のコメント
Chad Greene
Chad Greene 2014 年 11 月 6 日
Before adjusting the image, (if you have the image processing toolbox) try imhist(A) to see where values in A lie relative to the gray scale.
Sean de Wolski
Sean de Wolski 2014 年 11 月 6 日
graythresh separates modes for you :)

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeConvert Image Type についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by