How from uint8 to 0 and 1?
조회 수: 3 (최근 30일)
이전 댓글 표시
I import the following image which is a [583x673x3] uint8 :
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/146008/image.png)
and i would like the convert the grey/black color to origianally black.How it can be ?
댓글 수: 0
채택된 답변
Sean de Wolski
2014년 11월 6일
Igray = rgb2gray(I);
BW = im2bw(Igray,graythresh(Igray));
imshow(BW)
댓글 수: 2
추가 답변 (2개)
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
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.
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!