Commit 21409355 authored by BORNON Théophile's avatar BORNON Théophile

1 filter added

parent 944de5dd
...@@ -10,44 +10,57 @@ namespace S04_Projet ...@@ -10,44 +10,57 @@ namespace S04_Projet
{ {
public static short[,] boxBlurFilter = new short[,] public static short[,] boxBlurFilter = new short[,]
{ {
{ 1, 1, 1 }, { 1, 1, 1 },
{ 1, 1, 1 }, { 1, 1, 1 },
{ 1, 1, 1 } { 1, 1, 1 }
}; };
public static short[,] identityFilter = new short[,] public static short[,] identityFilter = new short[,]
{ {
{ 0, 0, 0 }, { 0, 0, 0 },
{ 0, 1, 0 }, { 0, 1, 0 },
{ 0, 0, 0 } { 0, 0, 0 }
}; };
public static short[,] edgeDetect1Filter = new short[,] public static short[,] edgeDetect1Filter = new short[,]
{ {
{ 1, 0, -1 }, { 1, 0, -1 },
{ 0, 0, 0 }, { 0, 0, 0 },
{ -1, 0, 1 } { -1, 0, 1 }
}; };
public static short[,] edgeDetect2Filter = new short[,] public static short[,] edgeDetect2Filter = new short[,]
{ {
{ 0, 1, 0 }, { 0, 1, 0 },
{ 1, -4, 1 }, { 1, -4, 1 },
{ 0, 1, 0 } { 0, 1, 0 }
}; };
public static short[,] edgeDetect3Filter = new short[,] public static short[,] edgeDetect3Filter = new short[,]
{ {
{ -1, -1, -1 }, { -1, -1, -1 },
{ -1, 8, -1 }, { -1, 8, -1 },
{ -1, -1, -1 } { -1, -1, -1 }
}; };
public static short[,] sharpenFilter = new short[,] public static short[,] sharpenFilter = new short[,]
{ {
{ 0, -1, 0 }, { 0, -1, 0 },
{ -1, 5, -1 }, { -1, 5, -1 },
{ 0, -1, 0 } { 0, -1, 0 }
};
public static short[,] motionBlueFilter = new short[,]
{
{ 1, 0, 0, 0, 0, 0, 0, 0, 0 },
{ 0, 1, 0, 0, 0, 0, 0, 0, 0 },
{ 0, 0, 1, 0, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 1, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 1, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 1, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 0, 1, 0, 0 },
{ 0, 0, 0, 0, 0, 0, 0, 1, 0 },
{ 0, 0, 0, 0, 0, 0, 0, 0, 1 },
}; };
} }
} }
...@@ -18,14 +18,13 @@ namespace S04_Projet ...@@ -18,14 +18,13 @@ namespace S04_Projet
static void Main(string[] args) static void Main(string[] args)
{ {
Stopwatch sw = new Stopwatch(); Stopwatch sw = new Stopwatch();
/*MyImage img = new MyImage("img/image.bmp"); /*MyImage img = new MyImage("img/coco.bmp");
MyImage imgg = new MyImage("img/flocon.bmp");
Console.WriteLine("Loading done"); Console.WriteLine("Loading done");
sw.Start(); sw.Start();
MyImage supperposition = img.Superposition(imgg, -6000, -8000); img = img.Filter(Filter.motionBlueFilter, 1.0 / 9.0);
sw.Stop(); sw.Stop();
supperposition.Save("sup.bmp"); img.Save("filter.bmp");
Console.WriteLine(sw.ElapsedMilliseconds); Console.WriteLine(sw.ElapsedMilliseconds);
Console.Read();*/ Console.Read();*/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment