Perform conv2 on a batch of images

조회 수: 3 (최근 30일)
Jonathan
Jonathan 2015년 8월 7일
편집: Jonathan 2015년 8월 7일
I have a set of 2D images for which I would like to convolve each image separately with a kernel. This is particularly important for GPU acceleration because doing the convolution one at a time with a for loop is much slower.
Ideally, conv2(A,B) would be written such as A can be a 3D matrix (m x n p), where p is the number of separate 2D arrays to perform the convolution with B on.
Is there any way in Matlab to do such a thing currently, or would I need to write my own mex function?

채택된 답변

David Young
David Young 2015년 8월 7일
convn does exactly what you describe, given a 3-D array and a 2-D kernel.
  댓글 수: 1
Jonathan
Jonathan 2015년 8월 7일
편집: Jonathan 2015년 8월 7일
Yes, thanks, you are correct. From the docs, it sounded like both kernel and array would need to be of the same dimension.

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Walter Roberson
Walter Roberson 2015년 8월 7일
You can use pagefun() with conv2 with a gpuarray
  댓글 수: 1
Jonathan
Jonathan 2015년 8월 7일
Does not work yet with pagefun. However, convn does do the same thing.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Convert Image Type에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by