histogram - Error using 'imhist' in MATLAB 2014 -


i trying use imhist display histogram of uint8 .jpg, getting error:

error using imhist expected input number 1, or x, 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{:});

here image information:

whos f name size bytes class
attributes

f 2988x5312x3 47616768 uint8

do need convert image data class? appreciate on this.

thanks!

the cause of error because image rgb , imhist not deal that. work around can either use single channel:

imhist(yourimage(:,:,channel)); 

or convert rgb grayscale:

imhist(rgb2gray(yourimage)); 

that should work fine now.


Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

jsf - How to ajax update an item in the footer of a PrimeFaces dataTable? -

django - CSRF verification failed. Request aborted. CSRF cookie not set -