问题
I wish to apply filter motion for certain number of iteration on different images, each image will be divided into different block size.
For example, if the image size is 1024x870
,how to divide this image into different block sizes 8x8
, 16x16
, 64x64
, etc. using MATLAB?
回答1:
It's not perfect but I would do:
A=rand(128);
Apatch=im2col(A,[64 64],'distinct');
Apacth=gpuArray(Apatch);
Otherwise you can try (I am not sure it speeds up):
A=rand(128);
A=gpuArray(A);
Apatch=im2col(A,[64 64],'distinct');
Apacth=gpuArray(Apatch);
来源:https://stackoverflow.com/questions/8374496/different-image-block-sizes-using-the-gpu