Skip to content

Instantly share code, notes, and snippets.

@Grungeby52
Last active March 6, 2016 23:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Grungeby52/1e64bb6e412abf166fc0 to your computer and use it in GitHub Desktop.
Save Grungeby52/1e64bb6e412abf166fc0 to your computer and use it in GitHub Desktop.
Make a Filters With Aforge Library in .NET(c#)
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using AForge;
using AForge.Imaging;
using AForge.Controls;
using AForge.Genetic;
using AForge.Imaging.ColorReduction;
using AForge.Imaging.ComplexFilters;
using AForge.Imaging.Filters;
using AForge.Imaging.Textures;
using AForge.Math.Geometry;
using AForge.Math.Metrics;
using AForge.Math.Random;
using AForge.Neuro.Learning;
using AForge.Neuro;
using AForge.Video.DirectShow;
using AForge.Video;
using AForge.Vision.Motion;
using AForge.Vision;
namespace FiltersWithAforge
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
pictureBox1.ImageLocation = "sample1.jpg";
}
private void button1_Click(object sender, EventArgs e)
{
LevelsLinear filter = new LevelsLinear();
filter.InRed = new IntRange(30, 320);
filter.InGreen = new IntRange(50,240);
filter.InBlue = new IntRange(10,210);
Bitmap image = new Bitmap("sample1.jpg");
filter.ApplyInPlace(image);
pictureBox2.Image = image;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment