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?
8 ビュー (過去 30 日間)
古いコメントを表示
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');
0 件のコメント
採用された回答
Matt J
2023 年 12 月 18 日
編集済み: Matt J
2023 年 12 月 19 日
siz=size(originalImage);
tempImage=originalImage( 1:subsamplingFactor:end, 1:subsamplingFactor:end, :);
blurredImage = imresize(tempImage, siz(1:2), 'bicubic');
10 件のコメント
Matt J
2023 年 12 月 19 日
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})
その他の回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!