How can i do this?
Afficher commentaires plus anciens
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 commentaire
Randy Souza
le 22 Oct 2012
judy, did you flag your question as inappropriate for a reason? If not, can you please delete the flag? Thanks!
Réponse acceptée
Plus de réponses (1)
Sean de Wolski
le 17 Oct 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.
Catégories
En savoir plus sur Tracking and Motion Estimation dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!