image blurring

i am in need of matlab code for image blurring.plz do provide it as soon as possible

Respuestas (2)

Walter Roberson
Walter Roberson el 18 de Feb. de 2012

2 votos

I = imread('YourImage.jpg');
blurredI = I + max(I(:)) / 10 * rand(size(I);
imwrite(blurredI, 'BlurredImage.jpg');

2 comentarios

Sneha Chakurkar
Sneha Chakurkar el 25 de Ag. de 2022
its showing Error. Code is wrong.
filename = 'flamingos.jpg';
I = imread(filename);
imshow(I); title('original');
blurredI = cast(double(I) + double(max(I(:))) / 10 * rand(size(I)), 'like', I);
imwrite(blurredI, 'BlurredImage.jpg');
imshow(blurredI)
diffI = imsubtract(blurredI, I);
imshow(rescale(diffI))

Iniciar sesión para comentar.

Image Analyst
Image Analyst el 28 de Ag. de 2022

0 votos

Try this:
fontSize = 15;
% Blur a gray scale image.
windowSize = 19;
kernel = ones(windowSize) / windowSize ^ 2;
grayImage = imread('cameraman.tif');
subplot(2, 2, 1);
imshow(grayImage);
title('Original Image', 'FontSize',fontSize);
blurryImage = imfilter(grayImage, kernel);
subplot(2, 2, 2);
imshow(blurryImage, []);
title('Blurred Image', 'FontSize',fontSize);
% Blur an RGB image.
windowSize = 19;
kernel = ones(windowSize) / windowSize ^ 2;
rgbImage = imread('peppers.png');
subplot(2, 2, 3);
imshow(rgbImage);
title('Original Image', 'FontSize',fontSize);
blurryImage = imfilter(rgbImage, kernel);
subplot(2, 2, 4);
imshow(blurryImage, []);
title('Blurred Image', 'FontSize',fontSize);

Categorías

Más información sobre Image Processing Toolbox en Centro de ayuda y File Exchange.

Preguntada:

el 18 de Feb. de 2012

Respondida:

el 28 de Ag. de 2022

Community Treasure Hunt

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

Start Hunting!

Translated by