[問題] 請問關於bilinaer縮放的方法已回收

看板MATLAB作者 (wei)時間15年前 (2010/07/24 16:46), 編輯推噓0(003)
留言3則, 2人參與, 最新討論串1/1
不好意思,小弟剛學matlab,不太懂許多地方,有請各位幫我解答,感恩 小弟想到了解bilinear的縮放演算法,在網路上抓了一段程式 但似乎有點問題不能執行 clear all; close all; clc; image=imread('lena.bmp'); figure, imshow(image); c1=0.5; c2=0; c3=0; c4=1.5; C=[c1 c2;c3 c4]; [row,col]=size(image); new_row=row*c1; new_col=col*c4; new_image=zeros(new_row,new_col); image=[image(1,:);image;image(row,:)]; image=[image(:,1),image,image(:,col)]; CC=C^(-1); for i=1:1:new_row for j=1:1:new_col QQ=CC*[i;j]; if (floor(QQ(1))>row | floor(QQ(2))>col) WW(i,j)=0; else AAA=double(image(floor(QQ(1))+1,floor(QQ(2))+2)); BBB=double(image(floor(QQ(1))+2,floor(QQ(2))+2)); CCC=double(image(floor(QQ(1))+1,floor(QQ(2))+1)); DDD=double(image(floor(QQ(1))+2,floor(QQ(2))+1)); WW(i,j)=bilinear(QQ(1),QQ(2),AAA,BBB,CCC,DDD); end end end figure, imshow(mat2gray(WW)) -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 134.208.2.222

07/25 00:20, , 1F
你大概是沒抓到第四行的圖吧
07/25 00:20, 1F
※ 編輯: beoiom 來自: 114.44.204.160 (07/25 09:27)

07/25 09:28, , 2F
圖有抓到...
07/25 09:28, 2F

07/25 09:29, , 3F
我的疑問是15和16行
07/25 09:29, 3F
文章代碼(AID): #1CIgXhAU (MATLAB)