views:

244

answers:

1

Hi all,

In any image processing library there is always the issue of having to provide an implementation of every single algorithm for every single image format (color space, channels, bit depth, mem layout, etc). One very elegant solution to the problem is Boost GIL. Through the power of C++, and a great design, all of these issues are abstracted away and you can write a single algorithm that will work on any type of image.

I wanted to create something similar in C#, but many of the necessary constructs such as templates and certain operator overloads (like unary *) are missing. I'm willing to accept that what I can create will not be nearly as robust and elegant as GIL, but to the extent possible I would like to model the concepts. Ultimately, abstracting image differences and writing generic processing algorithms would be the aim.

With what there is available in C#, generics, lambdas, even dynamic IL /cringe, what do people think some possible approaches would be to designing the library?

+1  A: 

Have you seen Aforge.NET, the way that's designed is pretty generic.

The author of that library solved a lot of the problems you are talking about through interfaces. Off the top of my head stuff like, IFilter, IFilterColourToAny etc

To do efficient image processing in .NET you'll need to go into unsafe code using Bitmap.LockData (I think), which could negate all the cool .NET stuff you're talking about...

ParmesanCodice
This is a great library, but they don't generalize any of the image processing routines to be agnostic of format. Everything they have works with an RGB bitmap or a grayscale image.I'm looking for a way to generalize iterating over pixels and pixel formats like GIL does. In GIL you can write one algorithm for something like thresholding, for example, and it can work on any image in any color space, with any number of channels, with any number of bits per channel. That's ultimately what I am trying to accomplish.
Charles