Friday, January 27, 2012

Bilateral image filter: .NET implementation

UPDATE 24.02.2012: Starting from version 2.2.4 AForge.NET contains Bilateral filter:

In the previous post you may find an overview of bilateral image filtering and sample results it can produce. In this post you'll find out about my implementation and links to the files.

The first thing to mention is that my implementation relies on AForge.NET (version 2.2.3) framework which is a massive framework for image and video processing, solving AI and recognition tasks etc. One of the framework parts is dedicated to image processing and the filter fitted it pretty well.

If you don't use AForge.NET and don't want to download the full library then you may use an archive from here. Since only a small part of AForge.NET is used you'll need to reference 3 assemlblies:
  • AForge.dll
  • AForge.Math.dll
  • AForge.Imaging.dll

The acrhive contains the following folders:

  • FilterDemoExecutable - compiled demo of a filter. It's based on AForge.NET filter demo so it also has a large number of other AForge filters. The differences are: Bilateral filter, saving files, copy the processed image to clipboard.
  • FilterDemo - source for the above application.
  • Release - all assemblies required (as listed above)
  • Sources - solution with AForge.Imaging.dll sources which includes Bilateral filter (class AForge.Imaging.Filters.Smooting.Bilateral). Other AForge.NET projects are not included so ignore the warning you'll get upon opening the solution.

If you are already using AForge.NET then simply add the following .cs file to your project and that would be enough.

If you'd like to play with a demo application only then go here.

No comments:

Post a Comment