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!