加速 vImage 与 vDSP
我试图在 iOS 上使用 Accelerate 框架来绕过 iOS 上的 Core Image 不支持自定义过滤器/内核的事实。我正在开发一个边缘检测滤波器,使用两个卷积和 Sobel 内核,但从一个简单的开始高斯模糊来掌握它的窍门。我知道 vImage 适合作为矩阵进行图像处理,而 vDSP 则专注于使用傅立叶变换处理数字信号。但是,尽管我开始使用 vImage 函数(vImageConvolve_XXXX 等),但我听到很多人讨论使用 vDSP 函数(vDSP_conv、vDSP_imgfir 等)来执行卷积等操作。所以这引出了我手头的问题:我什么时候应该使用其中一种而不是另一种?它们在卷积运算方面有什么区别?我到处寻找但找不到明确的答案。有人可以阐明它,或者为我指出正确的方向吗?
谢谢!
I'm trying to use the Accelerate framework on iOS to bypass the fact that Core Image on iOS doesn't support custom filters/kernels. I'm developing an edge detection filter using two convolutions with a Sobel kernel, but starting with a simple Gaussian blur to get the hangs of it. I know vImage is geared towards image manipulation as matrices and vDSP focuses in processing digital signals using Fourier transforms. But although I started using the vImage functions (vImageConvolve_XXXX, etc), I'm hearing a lot of people discussing the use of vDSP's functions (vDSP_conv, vDSP_imgfir, etc) to do such things as convolutions. So that leads me to the question at hand: when should I use one over the other? What are the differences between them with regards to convolution operations? I've looked everywhere but couldn't find a clear answer. Can someone shed some lights on it, or point me in the right direction?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果 vImage 提供了您需要的操作,那么使用它通常是最简单的。 vImage 会为您执行缓存阻塞和线程化,而 vDSP 则不会。 vImage 提供对交错和整数格式的操作,这对于图像处理通常很有用。
If vImage provides the operation you need, it is usually simplest to use that. vImage does cache blocking and threading for you, vDSP does not. vImage provides operations on interleaved and integer formats, which are often useful for image processing.
上次我进行实验时,这些框架都没有利用内核可分离性,而内核可分离性在空间域中进行卷积时可以提供巨大的性能提升 - 比矢量化指令所能带来的性能提升要大得多。 Sobel 内核尤其是可分离的,因此如果您使用
vDSP
或vImage
(而不是OpenCV
),请务必将自己内核。Last time I experimented, neither of these frameworks took advantage of kernel separability, which affords a huge performance boost when convolving in the spatial domain -- a far larger performance boost than vectorized instructions will ever buy you. The Sobel kernel in particular is separable, so if you're using
vDSP
orvImage
(instead of sayOpenCV
), be sure to separate the kernel yourself.