hello sir,i am new in matlab.By using imhist show an error
2 views (last 30 days)
Show older comments
RGB = imread('figure.jpg'); redvalue=RGB(:,:,1); greenvalue=RGB(:,:,2); bluevalue=RGB(:,:,3); sprintf('Value of the red,green and blue pixel is %d,%d,%d',redvalue,greenvalue,bluevalue) imshow(RGB) title('RGB IMAGE') I = rgb2gray(RGB);%figure,imshow(I) title('gray image') figure,imhist(I) title('histogram') T=80; it=im2bw(I,T/255); figure,imshow(it);
Accepted Answer
KALYAN ACHARJYA
on 9 Oct 2018
Edited: KALYAN ACHARJYA
on 9 Oct 2018
%I have tested it with a different image, No error
RGB=imread('1.jpg');
redvalue=RGB(:,:,1);
greenvalue=RGB(:,:,2);
bluevalue=RGB(:,:,3);
sprintf('Value of the red,green and blue pixel is %d,%d,%d',redvalue,greenvalue,bluevalue);
figure, imshow(RGB),title('RGB IMAGE')
I=rgb2gray(RGB);
figure,imshow(I),title('gray image')
figure,imhist(I),title('histogram')
T=80;
it=im2bw(I,T/255);
figure,imshow(it);
Here I have ignored the warning
4 Comments
More Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!