subtracting smoothing image from original image

3 views (last 30 days)
Hello, I want to estimate a threshold value that will be used later in comparison equation, the idea is to find the value of threshold by subtracting original image from smoothed one. my image is gray and I try applying medfit2 and imfilter2 to smooth it before subtraction then using imsubtract to complete the process, but I am not quite sure about the code and I do not know how to see the result which suppose to be the threshold value.
{ if true
% First method
o = imread ('0019hv1.bmp');
a = medfilt2(o , [3 3]);
subplot(1,2,1); imshow(a);
subplot(1,2,2); imshow(o);
v = imsubtract ( o ,a );
imshow(v):
* find nois value in the image ( 2nd method)
j = imread ('0013hv1.bmp');
lowPass = conv2(double(j), ones(25), 'same');
noiseOnlyImage = double(j) - lowPass;
noiseVar = var(noiseOnlyImage);
end
}
example of image :
could you please help me in this problem ? Thank you.

Answers (1)

Image Analyst
Image Analyst on 12 Oct 2014
It looks like the (badly named) v is your final image. It's floating point so you need to use [] with imshow to display it
imshow(v, []);
If it still does not look right, cast the (also badly named) o and a to double before subtracting.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!