Image processing: vImage? CI?

Hi all, I'm pretty much new to everything so I apologize if this is a hugely basic question.

I'm trying to do some processing of some images, and I'm a bit torn as to how I should try to approach this. At the moment, I want to do some image opening and image closing on some grayscale jpg images. After much digging, I found that vImage contains erosion and dilation functions that I could use to do image opening and closing.

I'm all about trying to do this with Core Image if possible since I'm a big fan of warm and cuddly Objective-C as opposed to scary structy C. Unfortunately, I don't see any functions in Core Image that look like they will do this.

If I am indeed doomed to vImage, does anyone have any whizbang example code of loading up an image file, frobulating it into a vImage_Buffer, and then doing something to said buffer? Apple's 'Tableau' example is causing my eyes to bleed.

Many thanks for any help, commiserations, or constructive verbal abuse!

-Peter

Hi Peter, depending on what

Hi Peter,

depending on what exactly you need, you might want to check out IPLT (http://iplt.org). It's an open-source software package aimed at the electron miscroscopy community. It contains most of the basic image processing filters and algorithms, such as FFT, noise reduction, cross-corelation, canny edge detection, histograms and a lot more. It is perfectly suited for rapid prototyping as you can script it in python. If you need more performance, you can go down to C++ level and hack your algorithms there.

HTH

Re: Image processing: vImage? CI?

Hi Peter,

From looking at the CIFilter reference it doesn't appear that Erosion and Dilation are directly supported:

http://developer.apple.com/documentation/GraphicsImaging/Reference/CoreImageFilterReference/Reference/reference.html

However a while back I came across this set of blog postings that mention it in some context:

http://avixe.blogspot.com/2006_11_01_archive.html

Search for erosion.

Also, vImage isn't that bad in terms of usage. I'd been meaning to put together a tutorial regarding it for some time. I'll see if I can get something together that is a bit simpler than Tableau.

Dave

Thanks for the link. Though

Thanks for the link. Though I'm actually going from a Matlab prototype to a Cocoa app, this will be useful for some other folks I know.

Thanks, Dave! I wonder if

Thanks, Dave! I wonder if an enhancement request to Apple might precipitate Erosion / Dilation filters in CI. I think I'll go file one just in case.

As for vImage, I certainly wouldn't turn down a tutorial in it!

I found a posting that describes converting from an NSImage to a vImage_Buffer and back again here:
http://www.omnigroup.com/mailman/archive/macosx-dev/2004-March/051427.html
(and here because the first link appears to be down at the moment)
http://www.wodeveloper.com/omniLists/macosx-dev/2004/March/msg00184.html

Anyway, an example of how to create an image kernel and do some work with vImage would be really cool if you or someone else had the time and inclination. :-)

-Peter