why i get this error
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
i=imread('leaf_Pic_small.jpg');
s=imadjust(i,stretchlim(i,[0.05 0.95]),[]);
subplot(2,2,1), imshow(i), title('original');
subplot(2,2,2), imshow(s), title('stretched');
subplot(2,2,3), imhist(i), title('histogram of original img');
subplot(2,2,4), imhist(s), title('hist of stretched img');
>> leafproj
Error using imhist
Expected input number 1, I or X, to be two-dimensional.
Error in imhist>parse_inputs (line 278)
validateattributes(a,
{'double','uint8','int8','logical','uint16','int16','single','uint32',
'int32'}, ...
Error in imhist (line 60)
[a, n, isScaled, top, map] = parse_inputs(varargin{:});
Error in leafproj (line 5)
subplot(2,2,3), imhist(i), title('histogram of original img');
0 commentaires
Réponses (1)
KSSV
le 19 Sep 2020
Your image seems to be a RGB image. You have to use imhist on a 2D matrix. Not 3D image.
R = i(:,:,1) ;
G = i(:,:,2) ;
B = i(:,:,3) ;
figure
imhist(R)
figure
imhist(B)
figure
imhist(G)
0 commentaires
Voir également
Catégories
En savoir plus sur Subplots dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!