How can i do this?
古いコメントを表示
Here is my code:
[m,n] = size(I);
for c = 1:n
for r = 1:m
x = round(s*r);
y = round(s*c);
if x > 0 && x < row && y > 0 && y < col % inside
S(r,c,:) = I(x,y,:);
end
end
end
Implementation works fine but the timing issues is the problem.
Thanks in advance :)
1 件のコメント
Randy Souza
2012 年 10 月 22 日
judy, did you flag your question as inappropriate for a reason? If not, can you please delete the flag? Thanks!
採用された回答
その他の回答 (1 件)
Sean de Wolski
2012 年 10 月 17 日
You'll get an enormous speedup just by preallocating scaled_image so that it does not change size on every iteration.
scaled_image = zeros(size(your_image));
for c
for r
etc;
Also note, don't call your variable image since this is a useful builtin function.
カテゴリ
ヘルプ センター および File Exchange で Tracking and Motion Estimation についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!