How to enlarge an image using spline interpolation
5 ビュー (過去 30 日間)
古いコメントを表示
採用された回答
KSSV
2020 年 8 月 28 日
編集済み: KSSV
2020 年 8 月 28 日
I = imread("image.jpeg") ; % assuming image to m*n
[m,n,p] = size(I) ;
x = 1:n ;
y = 1:m ;
% Inteprolate to double
xi = 1:2*n ;
yi = 1:2*m ;
I = double(I) ;
Inew = zeros(2*m,2*n) ;
% Row wise inteprolation
for i = 1:m
Inew(i,:) = spline(x,I(i,:),xi) ;
end
% Column wise interpolation
for j = 1:n
Inew(:,j) = spline(y,I(:,j),yi) ;
end
Change the class if Inew to the original I. Also read about imresize.
5 件のコメント
その他の回答 (1 件)
Bruno Luong
2020 年 8 月 28 日
編集済み: Bruno Luong
2020 年 8 月 28 日
A=peaks(10);
B=interp2(A,1,'spline');
subplot(1,2,1)
imagesc(A)
subplot(1,2,2)
imagesc(B)
0 件のコメント
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


