From: Parker on 21 May 2010 16:57 The old version of block processing in Matlab is invoked by "blkproc", while the new version which I used now (R2009b) introduces a new method as "blockproc". The difference according to the official website I can see is the new function consider each block as a struct, rather than matrix in the old version. As I assumed, the newer one should more effective and faster than the old one. However, it's not true. Why does this happen? The test code is as following, the old function is about 10 times faster than the newer one???: >> a = rgb2gray(imread('test.jpg')); >> y1 = @(x) mean2(x)*ones(size(x)); >> y2 = @(x) mean2(x.data)*ones(size(x.data)); >> tic;e = blkproc(a,[2 2],y1);toc;tic;f = blockproc(a,[2 2],y2);toc; Warning: BLKPROC will be removed in a future release. Use BLOCKPROC instead. > In blkproc at 68 Elapsed time is 0.431351 seconds. Elapsed time is 4.582460 seconds.
From: Parker on 22 May 2010 04:51 On May 21, 9:57 pm, Parker <xeno...(a)gmail.com> wrote: > The old version of block processing in Matlab is invoked by "blkproc", > while the new version which I used now (R2009b) introduces a new > method as "blockproc". The difference according to the official > website I can see is the new function consider each block as a struct, > rather than matrix in the old version. > > As I assumed, the newer one should more effective and faster than the > old one. However, it's not true. Why does this happen? The test code > is as following, the old function is about 10 times faster than the > newer one???: > > >> a = rgb2gray(imread('test.jpg')); > >> y1 = @(x) mean2(x)*ones(size(x)); > >> y2 = @(x) mean2(x.data)*ones(size(x.data)); > >> tic;e = blkproc(a,[2 2],y1);toc;tic;f = blockproc(a,[2 2],y2);toc; > > Warning: BLKPROC will be removed in a future release. Use BLOCKPROC > instead.> In blkproc at 68 > > Elapsed time is 0.431351 seconds. > Elapsed time is 4.582460 seconds. no comments?
From: Royi Avital on 22 May 2010 05:15 Parker <xenoszh(a)gmail.com> wrote in message <d7dbddd0-5571-4ec4-8183-e5f76a31edb8(a)f14g2000vbn.googlegroups.com>... > On May 21, 9:57 pm, Parker <xeno...(a)gmail.com> wrote: > > The old version of block processing in Matlab is invoked by "blkproc", > > while the new version which I used now (R2009b) introduces a new > > method as "blockproc". The difference according to the official > > website I can see is the new function consider each block as a struct, > > rather than matrix in the old version. > > > > As I assumed, the newer one should more effective and faster than the > > old one. However, it's not true. Why does this happen? The test code > > is as following, the old function is about 10 times faster than the > > newer one???: > > > > >> a = rgb2gray(imread('test.jpg')); > > >> y1 = @(x) mean2(x)*ones(size(x)); > > >> y2 = @(x) mean2(x.data)*ones(size(x.data)); > > >> tic;e = blkproc(a,[2 2],y1);toc;tic;f = blockproc(a,[2 2],y2);toc; > > > > Warning: BLKPROC will be removed in a future release. Use BLOCKPROC > > instead.> In blkproc at 68 > > > > Elapsed time is 0.431351 seconds. > > Elapsed time is 4.582460 seconds. > > no comments? Why do you assume the new version is faster? Does Matlab handles structures faster than Matrices? I'm not sure. Though the performance gap you found is beyond reasonable.
|
Pages: 1 Prev: put some axeses on a certian figure Next: merging existing .fig into the same figure |