Hi I have an image and I calculate the mean and standard deviation like this
meanint=mean(mean(tmpimg)); stdint=std(std(tmpimg));
Now I have another image and I try to make it have the same mean and standard deviation as the previous image. That's what I do
if (meanint2>meanint(1)) tmpimg = imsubtract(tmpimg,meanint2); tmpimg = imadd(tmpimg,meanint); tmpimg = imdivide(tmpimg,stdint2); tmpimg = immultiply(tmpimg,stdint); elseif (meanint2<meanint(1)) tmpimg = imadd(tmpimg,meanint); tmpimg = imsubtract(tmpimg,meanint2); tmpimg = immultiply(tmpimg,stdint); tmpimg = imdivide(tmpimg,stdint2); end
But I don't have the result I want. Does anyone knows why?
Best Answer