hello sir,i am new in matlab.By using imhist show an error

2 views (last 30 days)
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
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
ATHIRA P M
ATHIRA P M on 9 Oct 2018
these are the error shown in command window
Error in imhist>wireHistogramAxesListeners (line 232) deleteProxy = text('Parent',hist_axes,...
Error in imhist>plot_result (line 211) wireHistogramAxesListeners(hist_axes,stripe_axes,original_axes_pos);
Error in imhist (line 94) plot_result(x, y, map, isScaled, class(a), range);
Error in project (line 10) figure,imhist(I);

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!