Image Transformation using Parallel Processing / GPU
3 次查看(过去 30 天)
显示 更早的评论
Hello all,
I am wondering if it's possible to perform a transformation on two matrices (in my case two images) at the same time, i.e. by using parallel processing or utilising the power of the GPU. I am attempting to transform two video streams (continuously updated images) with two unchanging transformation matrices at the same time. I'm not looking for a solution, just if I'm either barking mad or on the right track.
Cheers!
0 个评论
回答(2 个)
Matt J
2013-1-23
Should be possible with PARFOR
parfor j=1:2
VI{j}=imtransform(V{j},...)
end
but if there are only 2, it seems like small gains. You could also try to cut up the resampling coordinates into N parallel chunks
parfor i=1:N
for j=1:2
VI{j}=interp2(V{j},X{i},Y{i})
end
end
The problem there is that multiple workers would require access to the image data V{j} and, in my experience, a lot of the gains can be lost as the images are cloned and broadcast to the workers.
If you have Jacket (they're in the process of merging into Matlab), it has GPU support for INTERP2, and GPUs are better at sharing global data among workers, i.e., the image data won't have to be cloned. However, there is longer broadcasting time to GPUs and it's not clear how much that would hurt you. The GPU would be ideal if you are planning to do many transformations to the same images. Then the broadcasting becomes a 1-time startup cost.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 GPU Computing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!