do u want to blure ur image?if yes then just do low pass filtering with image,other wise some noise functions are available in matlab see their documentation
Fog is basically a decrease in contrast or linear blending with a solid color such as blue-gray, but the amount of blending varies according to the distance to the objects in the scene. That's not something you can easily do without depth info.
function im=FogEffect(i)
a = imadjust(i,[0.1 0.1 0.1; 1 1 1],[0 0 0; 1 1 1]);
[m,n,d] = size(i);
for w = 1:3
for u = 1:m
for v = 1:n
if mod(v+u,2) == 0
a(u,v,w) = 225;
end
end
end
end
h = fspecial('gaussian',10,1);
im = imfilter(a,h);
end
and result
**broken link removed**
After **broken link removed**
But it's not really real fog. Some one can help me develop this code. Thanks for your help.
A JPEG image doesn't contain any depth information.
MATLAB can't guess the object distances.
Maybe you could manually paint fog onto the image by using something like Photoshop.