Enlarging an image with spline interpolation

3 ビュー (過去 30 日間)
T.K
T.K 2020 年 10 月 28 日
編集済み: Mehri Mehrnia 2022 年 6 月 13 日
I want to enlarge the number of pixels of the input image using spline interpolation. Please tell me how.

採用された回答

KSSV
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 件のコメント
T.K
T.K 2020 年 10 月 30 日
Thank you for your replying!
I understood!
Mehri Mehrnia
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
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
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 ExchangeGeometric Transformation and Image Registration についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by