// For Directory.GetFiles and Directory.GetDirectories // For File.Exists, Directory.Exists using System; using System.IO; using System.Collections; public class RecursiveFileProcessor { public static void Main( string [] args) { foreach ( string path in args) { if (File.Exists(path)) { // This path is a file ProcessFile(path); } else if (Directory.Exists(path)) { // This path is a directory ProcessDirectory(path); } else { Console.WriteLine( "{0} is not a valid file or directory." , path); } } } // Process all files in the directory passed in, recurse on any directories // that are found, and process the files they contain. public static void ProcessDirectory( string targetDirector...
https://rdmilligan.wordpress.com/2015/05/31/getting-started-with-aforge-net/
답글삭제using System;
답글삭제using System.Drawing;
using System.Windows.Forms;
using AForge;
using AForge.Imaging.Filters;
namespace tt
{
class MainClass
{
public static void Main(string[] args)
{
// load image
var image = (Bitmap)Image.FromFile(@"/Users/kerb/lena.jpg");
// apply filter
var structuringElement = new short[5, 5] { { 1, 1, 1, 1, 1 }, { 1, 1, 1, 1, 1 }, { 1, 1, 1, 1, 1 }, { 1, 1, 1, 1, 1 }, { 1, 1, 1, 1, 1 } };
Opening filter = new Opening(structuringElement);
var filteredImage = filter.Apply(image);
// save image
filteredImage.Save(@"/Users/kerb/filtered_space.jpg");
Console.Write("Good~!");
}
}
}