Resizing images using interp1()
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Quan Seah
am 8 Mai 2018
Kommentiert: Dingbang Liang
am 25 Mai 2018
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 Kommentar
Akzeptierte Antwort
KSSV
am 8 Mai 2018
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 Kommentare
Image Analyst
am 8 Mai 2018
For each pixel you need to call it twice, once with the top and bottom neighbors, and once with the right and left neighbors.
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Image Segmentation and Analysis finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!