image - Histeq matlab not working -


i want histogram equalization spot5 image. im trying histeq command. why isn't working?

this input , error:

>>i = imread('c:\users\windows 8\downloads\ori.tif');  >>imshow( i(:,:,1:3) ) 

warning: image big fit on screen; displaying @ 17% in imuitools\private\initsize @ 72in imshow @ 283

>> j = histeq(i); 

error using histeq expected input number 1, i, two-dimensional.

i still new . appreciate help. thank in advance

the warning happening because image size of or.tif bigger screen. it's telling not displaying @ full size. won't affect histogram equalisation.

the error histogram equalisation because matlab expects 2d matrix. tiff file 3d matrix, has width x height x colour.

depending on trying achieve histogram equalisation, may need first convert image grayscale image

greyi = rgb2gray( i(:,:,1:3) ); j = histeq( greyi ); 

or apply histogram equalisation each of 3 colour planes in turn.

j = zeros( size( ) ); j(:,:,1) = histeq( squeeze( i(:,:,1) ) ); j(:,:,2) = histeq( squeeze( i(:,:,2) ) ); j(:,:,3) = histeq( squeeze( i(:,:,3) ) ); % next line if have alpha channel if( size( j, 3 ) == 4 )     j(:,:,4) = histeq( squeeze( i(:,:,4) ) ); end 

Comments