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 CenterFile 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