フィルターのクリア

Resizing images using interp1()

3 ビュー (過去 30 日間)
Quan Seah
Quan Seah 2018 年 5 月 8 日
コメント済み: Dingbang Liang 2018 年 5 月 25 日
So I have got this image that I am trying to resize which I have already attached. The requirement for me is to resize the image without using the functions imresize() or immse() but use interp1(). And I have no clue where exactly to begin.
  1 件のコメント
Dingbang Liang
Dingbang Liang 2018 年 5 月 25 日
Did you figure out how to enlarge the column?

サインインしてコメントする。

採用された回答

KSSV
KSSV 2018 年 5 月 8 日
I = imread('lighthouse.png') ;
N = 1000 ; % interp1 along row
[m,n,p] = size(I) ;
iwant = zeros(m,N,p) ;
xi = linspace(1,n,N) ;
for i = 1:m
for j = 1:p
T = interp1(1:n,double(I(i,:,j)),xi) ;
iwant(i,:,j) = T ;
end
end
iwant = uint8(iwant) ;
imshow(iwant)
  3 件のコメント
Quan Seah
Quan Seah 2018 年 5 月 8 日
I realized that your code only interp1 along row, what if i want to interp1 along columns, since the code you showed me only changes the width not the length.
Image Analyst
Image Analyst 2018 年 5 月 8 日
For each pixel you need to call it twice, once with the top and bottom neighbors, and once with the right and left neighbors.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

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