Hello!
I am working with a big dataset of feature images and i noticed that im2feat is pretty slow.
I profiled the code and discovered a non preallocated growing matrix. (line=80)
imm = [];
for i=1:m
imm = [imm; reshape(im(:,:,:,i),imsize(1)*imsize(2),n)];
end
objsize = [imsize(1:2) m];
I rewrote the code this way:
rtc = imsize(1)*imsize(2);
imm = zeros(m*rtc,n);
for i=1:m
imm(rtc*(i-1)+1:rtc*(i),:) = reshape(im(:,:,:,i),rtc,n);
end
objsize = [imsize(1:2) m];
Now it runs much faster, hope you like the patch!
Thanks
Giuseppe

