MATLAB Answers


HISTEQ default not consistent with syntax?

Asked by Jurgen
on 15 Nov 2012

If I have an 8-bit image IM (e.g. cameraman.tif), why does histeq(IM) produce a different result than histeq(IM,ones(1,256))??

Shouldn't they be identical? The description says hgram defaults to ones(1,n)*prod(size(A))/n. Since cameraman is 256x256 and n=2^8, shouldn't it scale normally?


Log in to comment.



No products are associated with this question.

1 Answer

Answer by Loginatorist on 15 Nov 2012
 Accepted Answer

IM = imread('cameraman.tif');
I = histeq(IM);
I2 = histeq(IM,ones(1,64)*(numel(IM)/64));
ans =

  1 Comment

I see it uses n=64 then, I was testing with n=256. Because of the description I was under the impression that n=length(HGRAM). Thanks for clearing that up.

Log in to comment.

Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

MATLAB Academy

New to MATLAB?

Learn MATLAB today!