views:

359

answers:

3

I would like to apply image processing on pictures taken on the iPhone. This processing would involve 2D matrix convolutions etc.

I'm afraid that the performance with nested NSArrays would be pretty bad. What is the right way to manipulate pixel based images? Should I simply use C arrays allocated with malloc?

+2  A: 

Have you looked at the Quartz 2D engine available in the iPhone SDK? Or perhaps Core Graphics? Apple has a nice overview document describing all the different imaging technologies available on the iPhone. Unfortunately there isn't anything as nice as ImageKit on the iPhone yet.

Marc W
A: 

Yes, you would use a C array since that's how you get back the pixel data anyway.

As mentioned, you should look and see if you can use Quartz2D to do the manipulations you are interested in as it would probably perform better being hardware based. If not, just do your own over the array of pixels.

Kendall Helmstetter Gelner
A: 

The iPhone also supports OpenCL, and it's GPU has way more processing power than the CPU.

Andrew McGregor
This is incorrect. The iPhone does not currently support OpenCL.
Brad Larson
Really? Sorry for being misleading then...
Andrew McGregor