How can i do this?
Ältere Kommentare anzeigen
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 Kommentar
Randy Souza
am 22 Okt. 2012
judy, did you flag your question as inappropriate for a reason? If not, can you please delete the flag? Thanks!
Akzeptierte Antwort
Weitere Antworten (1)
Sean de Wolski
am 17 Okt. 2012
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.
Kategorien
Mehr zu Tracking and Motion Estimation finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!