Enlarging an image with spline interpolation
3 次查看(过去 30 天)
显示 更早的评论
I want to enlarge the number of pixels of the input image using spline interpolation. Please tell me how.
0 个评论
采纳的回答
KSSV
2020-10-28
I = imread("image.jpeg") ; % assuming image to m*n
I=rgb2gray(I);
[m,n] = size(I) ;
x = 1:n ;
y = 1:m ;
% Inteprolate to double
xi = linspace(1,n,2*n) ;
yi = linspace(1,m,2*m) ;
I = double(I) ;
I1 = zeros(m,2*n) ;
% Row wise inteprolation
for i = 1:m
I1(i,:) = spline(x,I(i,:),xi) ;
end
Inew = zeros(2*m,2*n) ;
% Column wise interpolation
for j = 1:2*n
Inew(:,j) = spline(y,I1(:,j),yi) ;
end
Inew = uint8(Inew) ;
figure
imshow(Inew)
2 个评论
Mehri Mehrnia
2022-6-13
编辑:Mehri Mehrnia
2022-6-13
main problem of this is it does not preserve image size, I mean the size of primary matrix
更多回答(1 个)
Mehri Mehrnia
2022-6-13
Hi,
I really appreciate this Q/A, helped me.
I have a countour which is a complex shape(left atrial of heart). I want to select some points(control ones) to dilate or erode the shape? any idead?
1 个评论
Image Analyst
2022-6-13
Maybe the attached demos???
Otherwise start a new question and attach your image and data and code after you read this:
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Splines 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!