Different Image Block Sizes Using the GPU

拈花ヽ惹草 提交于 2019-12-11 07:53:28

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!