[問題] 寫完程式以後跑超級久的?已回收
tic
clc;
clear all;
image2=imread('im2b_s.bmp');
whos image2
Name Size Bytes Class Attributes
image2 121x81x3 29403 uint8
X = colorspace('RGB->Luv',image2);
[H W B]=size(X);
sigma=0.1;
N=H*W;
aff=sparse(N,N);
for col=1:H
for row=1:W
for b=1:H
for a=1:W
c1=[X(col,row,1);X(col,row,2);X(col,row,3)];
c2=[X(b,a,1);X(b,a,2);X(b,a,3)];
if(a<=row+1 && a>=row-1 && b<=col+1 && b>=col-1)
aff((col-1)*W+row,(b-1)*W+a)=exp((-0.5/sigma^2)*norm(c1-c2)^2);
end
end
end
end
end
toc
我的程式是要寫computer vision中的切割影像的方法 normalized cut
其中aff矩陣就是affinity matrix
設的if條件就是把只有以一個pixel為基準點,周圍八點才計算,寫入aff
可是跑了超級久都還是沒有結果
請問到底是哪邊出錯了?
有請板上的高手解答
謝謝
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.114.22.11
→
11/04 02:20, , 1F
11/04 02:20, 1F
→
11/04 17:44, , 2F
11/04 17:44, 2F
→
11/05 21:57, , 3F
11/05 21:57, 3F