使用GPU的不同图像块大小 [英] Different Image Block Sizes Using the GPU
本文介绍了使用GPU的不同图像块大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我希望在不同图像上应用滤镜运动一定次数的迭代,每个图像将被分成不同的块大小。
I wish to apply filter motion for certain number of iteration on different images, each image will be divided into different block size.
例如,如果图像大小为 1024x870
,如何将此图像划分为不同的块大小 8x8
, 16x16
, 64x64
等,使用MATLAB?
For example, if the image size is 1024x870
,how to divide this image into different block sizes 8x8
, 16x16
, 64x64
, etc. using MATLAB?
推荐答案
这不完美但我愿意:
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);
这篇关于使用GPU的不同图像块大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文