在iPhone上使用OpenGL ES对图像进行卷积可能? [英] Convolving an image with OpenGL ES on iPhone: possible?

查看:463
本文介绍了在iPhone上使用OpenGL ES对图像进行卷积可能?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经google了几次,但我没有得到一个正确的答案。我有一个矩阵,我想与一个离散滤波器(例如Sobel算子用于边缘检测)卷积。是否可以用加速的方式在iPhone上使用OpenGL ES?

I've googled around a few times, but I have not gotten a straight answer. I have a matrix that I would like to convolve with a discrete filter (e.g. the Sobel operator for edge detection). Is it possible to do this in an accelerated way with OpenGL ES on the iPhone?

如果是,怎么办?如果不是,还有其他高性能的技巧,我可以用来加快操作吗?向导ARM组装操作可以做到快吗?最终我想在iPhone的ARM处理器上执行尽可能快的卷积。

If it is, how how? If it is not, are there other high-performance tricks I can use to speed up the operation? Wizardly ARM assembly operations that can do it fast? Ultimately I want to perform as fast of a convolution as possible on an iPhone's ARM processor.

推荐答案

您应该能够在OpenGL ES 2.0下使用可编程着色器。我在 iTunes U

You should be able to do this using programmable shaders under OpenGL ES 2.0. I describe OpenGL ES 2.0 shaders in more detail in the video for my class on iTunes U.

虽然我没有自己进行图像卷积,但我为Mac和iOS描述了一些GPU加速的图像处理。此处。我提供了一个使用GLSL着色器的示例应用(基于Core Image过滤器

Although I've not done image convolution myself, I describe some GPU-accelerated image processing for Mac and iOS here. I present a sample application that uses GLSL shaders (based on Core Image filters developed by Apple) that does realtime color tracking from the iPhone's camera feed.

自从我写这个,我创建了一个开源框架,其具有内置的图像卷积过滤器,从Sobel边缘检测到定制的3x3卷积内核。这些可以比CPU限制的实现速度快100倍。

Since I wrote this, I've created an open source framework based on the above example which has built-in image convolution filters, ranging from Sobel edge detection to custom 3x3 convolution kernels. These can run up to 100X faster than CPU-bound implementations.

但是,如果你在CPU上这样做,你可以使用加速框架,以在iPhone的NEON SIMD设备上运行一些操作。特别是,FFT操作(通常是图像卷积滤波器中的关键组件,或者我听说过的)可以通过使用Apple在这里提供的例程获得〜4-5X的加速。

However, if you were to do this on the CPU, you might be able to use the Accelerate framework to run some of the operations on the iPhone's NEON SIMD unit. In particular, FFT operations (which are usually a key component in image convolution filters, or so I've heard) can get a ~4-5X speedup by using the routines Apple provides here.

这篇关于在iPhone上使用OpenGL ES对图像进行卷积可能?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆