Borrar filtros
Borrar filtros

Is it possible to subsample an image by deleting data then interpolating to create a blurred image, while keeping the resulting image the same size as the original image?

1 visualización (últimos 30 días)
Is it possible to subsample an image by deleting data then interpolating to create a blurred image, while keeping the resulting image the same size as the original image?
The code I am using below does the subsampling and interpolation but changes the image size. It looks smaller. See a part of my code below.
originalImage = imread(imagePath);
zeroPaddedImage = zeros(size(originalImage), 'like', originalImage);
zeroPaddedImage(:, 1:subsamplingFactor:end) = originalImage(:, 1:subsamplingFactor:end);
blurredImage = imresize(zeroPaddedImage, 1/subsamplingFactor, 'bicubic');

Respuesta aceptada

Matt J
Matt J el 18 de Dic. de 2023
Editada: Matt J el 19 de Dic. de 2023
siz=size(originalImage);
tempImage=originalImage( 1:subsamplingFactor:end, 1:subsamplingFactor:end, :);
blurredImage = imresize(tempImage, siz(1:2), 'bicubic');
  10 comentarios
Tevin
Tevin el 19 de Dic. de 2023
%Please see a part of my code
% Create a zero-filled image of the same size as the original
siz = size(originalImage);
zeroPaddedImage = zeros(size(originalImage), 'like', originalImage);
zeroPaddedImage(:, 1:factor:end, :) = originalImage(:, 1:factor:end, :);
blurredImage = imresize(zeroPaddedImage, siz(1:2), 'bicubic');
I have attached a file with the original image, the subsampled and the interpolated image. The interpolated image looks like the subsampled one. I want to fill the gaps by interpolating so it seemed like a blurry or noisy image, rather than a having gaps. Can you look at where my code is going wrong?
Matt J
Matt J el 19 de Dic. de 2023
originalImage=load('Images').originalImage;
subsamplingFactor=20;
siz=size(originalImage);
tempImage=originalImage( 1:subsamplingFactor:end, 1:subsamplingFactor:end, :);
blurredImage = imresize(tempImage, siz(1:2), 'bicubic');
montage({originalImage,blurredImage})

Iniciar sesión para comentar.

Más respuestas (0)

Productos


Versión

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by