Rank: 1684 based on 88 downloads (last 30 days) and 1 file submitted
photo

Leslie Smith

E-mail
Company/University
Naval Research Lab

Personal Profile:
Professional Interests:

 

Watch this Author's files

 

Files Posted by Leslie
Updated   File Tags Downloads
(last 30 days)
Comments Rating
20 Nov 2008 Contrast Limited Adaptive Histogram Equalization (CLAHE) Best to read the reference in "Graphics Gems IV", Academic Press, 1994 pages 474-485 Author: Leslie Smith histogram equalizatio..., adaptive histogram eq..., clahe, image processing 88 21
  • 4.75
4.8 | 4 ratings
Comments and Ratings by Leslie View all
Updated File Comments Rating
27 Sep 2012 Contrast Limited Adaptive Histogram Equalization (CLAHE) Best to read the reference in "Graphics Gems IV", Academic Press, 1994 pages 474-485 Author: Leslie Smith

I think the error might be related to the image size - when I wrote it I only tested it on even sized images.

Let me again recommend using adapthisteq in the Image Processing Toolbox. It is more robust and doesn't have these limitations.

17 Jun 2011 Contrast Limited Adaptive Histogram Equalization (CLAHE) Best to read the reference in "Graphics Gems IV", Academic Press, 1994 pages 474-485 Author: Leslie Smith

The full argument list is
runCLAHE(Image,XRes,YRes,Min,Max,NrX,NrY,NrBins,Cliplimit,modHist)
The comments in the beginning of the function describe the arguments.
Once again I will suggest you use adapthisteq in the Image processing toolbox because Matlab's routine is more robust.

12 May 2011 Contrast Limited Adaptive Histogram Equalization (CLAHE) Best to read the reference in "Graphics Gems IV", Academic Press, 1994 pages 474-485 Author: Leslie Smith

The "Subscript indices must either be real positive integers or logicals" is basically that the index is out of bounds.

Obviously you are taking a class where the assignment is to create the CLAHE code. IMO, that is what you should do because the goal of a class is the learning, not the grade.

11 May 2011 Contrast Limited Adaptive Histogram Equalization (CLAHE) Best to read the reference in "Graphics Gems IV", Academic Press, 1994 pages 474-485 Author: Leslie Smith

I suggest you use adapthisteq in the Image processing toolbox because Matlab's routine is more robust.
Although you don't say what the error is, my guess is that it is "index out of bounds" for the look up table LUT. If I remember correctly, runCLAHE needs for the dimensions of the image to be even to work properly. Again, you are likely better off to use adapthisteq.

20 Nov 2008 Contrast Limited Adaptive Histogram Equalization (CLAHE) Best to read the reference in "Graphics Gems IV", Academic Press, 1994 pages 474-485 Author: Leslie Smith

Thanks for the reference. I had looked for and did not find the Matlab CLAHE and was surprised when I thought it did not exist.
Leslie

Comments and Ratings on Leslie's Files View all
Updated File Comment by Comments Rating
07 Oct 2014 Contrast Limited Adaptive Histogram Equalization (CLAHE) Best to read the reference in "Graphics Gems IV", Academic Press, 1994 pages 474-485 Author: Leslie Smith Ace, Portgas

can't seem to make it work. Can you give me a sample on how to use this?

20 Aug 2014 Contrast Limited Adaptive Histogram Equalization (CLAHE) Best to read the reference in "Graphics Gems IV", Academic Press, 1994 pages 474-485 Author: Leslie Smith Seyoung

If error occured "runCLAHE.m" at 53,
Replace "Bin= 1 + LUT(round(Image));" for:
"Bin=1+LUT(round(Image+1));"

and check the function arguements one more time.

12 Jan 2014 Contrast Limited Adaptive Histogram Equalization (CLAHE) Best to read the reference in "Graphics Gems IV", Academic Press, 1994 pages 474-485 Author: Leslie Smith Sheikh, Tuhin

How to modify the following codes for Gaussian specification ?

case 'rayleigh', % suitable for underwater imagery
% pdf = (t./alpha^2).*exp(-t.^2/(2*alpha^2))*U(t)
% cdf = 1-exp(-t.^2./(2*alpha^2))
hconst = 2*alpha^2;
vmax = 1 - exp(-1/hconst);
val = vmax*(histSum/numPixInTile);
val(val>=1) = 1-eps; % avoid log(0)
temp = sqrt(-hconst*log(1-val));
mapping = min(selectedRange(1)+temp*valSpread,...
selectedRange(2));

28 Nov 2012 Contrast Limited Adaptive Histogram Equalization (CLAHE) Best to read the reference in "Graphics Gems IV", Academic Press, 1994 pages 474-485 Author: Leslie Smith Assed Highs

OK, my last comment haha, I don't know what I was thinking about using "adapthisteq" function. SOLUTION:

- Add the following code to runCLAHE.m:

LUT=makeLUT(Min,Max,NrBins);
avgBin = NrPixels/NrBins;

LUT2=zeros(graylevels,1);
[x]=size(LUT);
LUT2(1:x(1),1)=LUT;

Bin=1+LUT2(round(Image));

graylevels is the color depth of used image. If it's 8 bit, just replace "graylevels" for 255.

- If you still having the error, change "Bin=1+LUT2(round(Image));" for "Bin=1+LUT2(round(Image+1))" to avoid pixels with 0 value.

28 Nov 2012 Contrast Limited Adaptive Histogram Equalization (CLAHE) Best to read the reference in "Graphics Gems IV", Academic Press, 1994 pages 474-485 Author: Leslie Smith Assed Highs

One last comment, just to clariry. To avoid "index out of bounds":

- Add the following code to runCLAHE.m:

LUT=makeLUT(Min,Max,NrBins);
avgBin = NrPixels/NrBins;

LUT2=zeros(graylevels,1);
[x]=size(LUT);
LUT2(1:x(1),1)=LUT;

Bin=1+LUT2(round(Image));

graylevels is the color depth of used image. If it's 8 bit, just replace "graylevels" for 255.

- Right before calling runCLAHE.m, add:
"image=adapthisteq(image);"

- If you still having the error, change "Bin=1+LUT2(round(Image));" for "Bin=1+LUT2(round(Image+1))" to avoid pixels with 0 value (if there's still one after applying adapthisteq function).

That should work.

Contact us