HISTEQ default not consistent with syntax?

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?

 채택된 답변

Matt Fig
Matt Fig 2012년 11월 15일

0 개 추천

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

댓글 수: 1

Jurgen
Jurgen 2012년 11월 15일
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.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Test Scripts에 대해 자세히 알아보기

태그

질문:

2012년 11월 15일

Community Treasure Hunt

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

Start Hunting!

Translated by