필터 지우기
필터 지우기

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 CenterFile Exchange에서 Geometric 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