How can i do this?
Show older comments
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 Comment
Randy Souza
on 22 Oct 2012
judy, did you flag your question as inappropriate for a reason? If not, can you please delete the flag? Thanks!
Accepted Answer
More Answers (1)
Sean de Wolski
on 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.
Categories
Find more on Tracking and Motion Estimation in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!