Skip to content
Snippets Groups Projects
Commit 75f2c531 authored by Eric Wait's avatar Eric Wait
Browse files

Implemented Contrast Enhancement in Matlab

parent adf4de4b
No related branches found
No related tags found
Loading
...@@ -30,6 +30,20 @@ function imageOut = ContrastEnhancement(imageIn,sigma,MedianNeighborhood,forceMA ...@@ -30,6 +30,20 @@ function imageOut = ContrastEnhancement(imageIn,sigma,MedianNeighborhood,forceMA
end end
function imageOut = lclContrastEnhancement(imageIn,sigma,MedianNeighborhood) function imageOut = lclContrastEnhancement(imageIn,sigma,MedianNeighborhood)
if (ismatrix(imageIn))
imGauss = imgaussfilt(imageIn,sigma);
else
imGauss = imgaussfilt3(imageIn,sigma);
end
imageOut = imageIn - imGauss;
if (ismatrix(imageIn))
imageOut = medfilt2(imageOut,MedianNeighborhood([1,2]));
else
imageOut = medfilt3(imageOut,MedianNeighborhood);
end
imageOut(imageOut<0) = 0;
end end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment