52

I am just learning about computer vision and C#. It seems like two prominent image processing libraries are OpenCV and AForge. What are some of the differences of the two?

I am making a basic image editor in C# and while researching I have come across articles on both. But I don't really know why I would choose one over the other. I would like to eventually improve the app to include more advanced functions.

Thanks.

vrish88
  • 20,047
  • 8
  • 38
  • 56

4 Answers4

44

Well, why not using both ;) ??

I am using (literally in C# ... lol) EMGUCV.NET (which is an OpenCV C# wrapper) and AFORGE.NET at the same time:

AFORGE.NET plus its "Image Processing Lab" makes much sense for filtering options (edge detection, thresholds, and so forth) and easing viewing functionalities.

OpenCV provides all the rest like SIFT/SURF and other more sophisticated image processing routines.

That's why you use .NET: simply bring all the components you need together in one application :)

Guido
  • 449
  • 1
  • 4
  • 2
20

I am using OpenCV for a project in school right now, and I browsed the documentation for AForge and their feature seem to differ. AForge has lots of filters and is probably excellent for different transforms and image manipulation. But it seems to lack quite a bit in other areas. I could not find any matrix operations which was a disappointment as it is so useful in computer vision. Our current project (3D point cloud reconstruction from an image sequence) would, as far as I could see from the docs, be impossible to do with AForge alone.

Combine AForge with a good linear algebra library and you might have something really useful though.

As for OpenCV it has a rich feature set but is a bit tricky to program with.

Hannes Ovrén
  • 21,229
  • 9
  • 65
  • 75
3

If you would like to improve your application with more and more advanced functions like you said, I'd go for OpenCV- however, a part of your success depends on the fact that the C# port is actively updated, which shouldn't be much of trouble considering the three ports. I think EmguCV seems to be one of the best right now in terms of updated, but when I looked at it, lacks documentation (but you could probably translate C++ code into C# with some C++ knowledge). AForge seems a lot easier for me and that's what I'm using right now. OpenCV also has support for haarcascade.xml files you can use that include face detection.

So for the final take: both will suit you well, OpenCV is more widely used/supported (though most user-base is C++), AForge is easier. It all comes down to what you want to do.

Dominic K
  • 6,975
  • 11
  • 53
  • 62
  • 3
    [Accord](http://accord-net.origo.ethz.ch/), a framework extending AForge, supports XML Haar cascade files. It fills many gaps in AForge, so it's a good idea to use both. – smola Oct 12 '11 at 10:24
  • 1
    @smmv: Accord seems to have moved to the following address: http://code.google.com/p/accord/ – Sabuncu Jul 14 '13 at 19:14
1

Another important thing to consider is the licensing, AForge is GPL, whereas OpenCV has recently changed to Apache2.0 which means that using AForge in a commercial app like point of sales for example, very well may result in requiring you to open source your code or at least parts of it. Which as far as I understand, means that a customer will be within their right to ask you to send them a copy of -or make publicly available your source code or parts of it. Whereas Apache2.0 which OpenCV now uses, allows you to use it within a commercial setting without requiring you to open source your code.

Hence me moving away from AForge even tho it works well, not willing to risk the time I have spent developing my POS app. If licencing is important, I would suggest doing some research into it. Both have their licencing available on their websites.