MATLAB: Local histogram equalization – Using the function ‘histeq’ in nlfilter/colfilt

colfiltcontrastequalizationhisteqhistogramImage Processing Toolboxnlfilter

Hi Guys,
I need to perform a neighbourhood sliding window operation, that calculates the local histogram of the window, and assigns it to the pixel.
When I use the below code,
g=colfilt(fp,[m n],'sliding',@histeq);
I receive the error as "??? Assignment has more non-singleton rhs dimensions than non-singleton subscripts".
Can someone please advise on this? Thank you for your time.

Best Answer

g=colfilt(fp,[m n],'sliding',@fun);
here fun operates on individual columns(neighbourhood of a pixel) and must return a row vector. but in your case histeq doesnt return a row vector, So, i guess you cant use colfilt, you may use blkproc.
g=blkproc(fp,[m n], @histeq);
Related Question