MATLAB: How to filter an histogram with gaussian low pass filter

filter histogram low pass

I have MR slice of type double, I want to filter its histogram to smooth it using Gaussian Low Pass Filter. I know that the (imgaussfilt ) filter the image with a Gaussian filter but we need the standard deviation. Could any one tell me how to fix the value of the standart deviation ? is it the (std2) of the whole image ? Otherwise, if you have you any other prepositions, I will be greatful.

Best Answer

Just take the histogram counts and use conv() to smooth
windowSize = 15; % Adjust to control level of smoothing.
smoothedCounts = conv(counts(:), ones(windowSize, 1)/windowSize, 'same');