-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1 parent
3b6d1bb
commit 0f106e9
Showing
16 changed files
with
90 additions
and
123 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,7 @@ | ||
using System; | ||
using System.Drawing; | ||
|
||
|
||
namespace _2DDFT | ||
namespace _2DDFT.Fourier | ||
{ | ||
public class DFT2D | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
using System; | ||
|
||
|
||
namespace _2DDFT | ||
namespace _2DDFT.Noise | ||
{ | ||
public class Filters | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
2DDFT/PhillipsParameters.cs → 2DDFT/Phillips/PhillipsParameters.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
namespace _2DDFT | ||
namespace _2DDFT.Phillips | ||
{ | ||
public class WindDirection | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,58 +1,43 @@ | ||
using System; | ||
using System.Drawing; | ||
using _2DDFT.Fourier; | ||
using _2DDFT.Noise; | ||
|
||
namespace _2DDFT | ||
{ | ||
class Program | ||
{ | ||
static void Main(string[] args) | ||
static Bitmap GenerateWhiteNoise() | ||
{ | ||
var display = new Display(256); | ||
|
||
var fft2D = new FFT2D(256); | ||
|
||
Console.WriteLine("--------------------2DDFT--------------------------"); | ||
var whiteNoise = new WhiteNoise(256, 256,1); | ||
var bitmap = whiteNoise.Create("C:\\tmp\\whitenoise.jpg"); | ||
|
||
var phillips = new Phillips(256,256,1); | ||
var phillipsSepctrum = phillips.Create(); | ||
|
||
display.Magnitude(phillipsSepctrum, "C:\\tmp\\phillips.jpg"); | ||
|
||
var transform4 = fft2D.Inverse(phillipsSepctrum); | ||
|
||
var whiteNoise = new WhiteNoise(256, 1); | ||
return whiteNoise.Create("C:\\tmp\\whitenoise.jpg"); | ||
} | ||
|
||
display.Picture(transform4, "C:\\tmp\\transform4.jpg"); | ||
static Complex[][] GeneratePhillipsSpectrum() | ||
{ | ||
var phillips = new Phillips.Phillips(256, 1); | ||
return phillips.Create(); | ||
} | ||
|
||
Console.WriteLine("--------------------Read Image---------------------"); | ||
|
||
static void Main(string[] args) | ||
{ | ||
//WHITE NOISE GENERATION | ||
var whitenoise = GenerateWhiteNoise(); | ||
|
||
var bitmap2 = display.ReadImage("C:\\tmp\\cln1.gif"); | ||
//PHILLIPS SPECTRUM FREQUENCY AND SPATIAL DOMAIN | ||
var phillipsSpectrum = GeneratePhillipsSpectrum().Magnitude("C:\\tmp\\phillipsSpectrum.jpg"); | ||
new FFT2D(256).Inverse(phillipsSpectrum).ToPicture("C:\\tmp\\phillipsSpatialDomain.jpg"); | ||
|
||
/*Console.WriteLine("--------------------Beginning DDFT-----------------"); | ||
var transform = DFT2D.Forward(bitmap); | ||
display.Magnitude(transform, "C:\\tmp\\transform.jpg"); | ||
Console.WriteLine("--------------------Ending DDFT--------------------");*/ | ||
//BUTTERWORTH FILTERING IN FREQUESNCY DOMAIN | ||
var bitmap2 = Display.ReadImage("C:\\tmp\\lena.gif"); | ||
|
||
Console.WriteLine("--------------------Beginning FFT------------------"); | ||
var transform2 = new FFT2D(256).Forward(bitmap2).Magnitude("C:\\tmp\\SpectrumForwardTransform.jpg"); | ||
|
||
|
||
var transform2 = fft2D.Forward(bitmap2); | ||
display.Magnitude(transform2, "C:\\tmp\\transform2.jpg"); | ||
Console.WriteLine("--------------------Ending FFT---------------------"); | ||
Console.WriteLine("--------------------Beging FFTInv------------------"); | ||
|
||
var result = new Filters(256).ButterWorthLowPassFilter(transform2); | ||
|
||
display.Magnitude(result, "C:\\tmp\\filteredImage.jpg"); | ||
|
||
|
||
var transform3 = fft2D.Inverse(result); | ||
display.Picture(transform3, "C:\\tmp\\transform3.jpg"); | ||
|
||
Console.WriteLine("--------------------Ending FFT---------------------"); | ||
result.Magnitude("C:\\tmp\\filteredImageWithButterWorth.jpg"); | ||
|
||
Console.ReadLine(); | ||
new FFT2D(256).Inverse(result).ToPicture("C:\\tmp\\Inversetransform.jpg"); | ||
} | ||
} | ||
} |
Binary file not shown.
Binary file not shown.
This file was deleted.
Oops, something went wrong.
Binary file not shown.
Binary file not shown.