diff --git a/code/AdditiveGaussian.bmp b/code/AdditiveGaussian.bmp deleted file mode 100644 index 95bc3b4..0000000 Binary files a/code/AdditiveGaussian.bmp and /dev/null differ diff --git a/code/new.bmp b/code/new.bmp deleted file mode 100644 index 95bc3b4..0000000 Binary files a/code/new.bmp and /dev/null differ diff --git a/code/tests.py b/code/tests.py index 9f366e6..96b288c 100644 --- a/code/tests.py +++ b/code/tests.py @@ -413,9 +413,8 @@ def testAdditiveGaussianNoise(sigma=10, seuil=35): - print "| Removing Additive |",; t.reset(); - # img.content.map = FX.Additive.unset(img.content.map, seuil=seuilB) - img.content.map = FX.Additive.unset2(img.content.map, seuil=seuil) + print "| Average Filter |",; t.reset(); + FX.Filter.smooth(img.content.map) print "%s |" % (t.get()) # Unparsing diff --git a/code/todo.md b/code/todo.md new file mode 100644 index 0000000..9845264 --- /dev/null +++ b/code/todo.md @@ -0,0 +1,22 @@ ++-------+ +| To Do | ++-------+ + +Centraliser les fonctions: + Ne plus séparer par type de fonctions (ex: bruit A, bruit B, bruit C, ...) + Mais plutôt factoriser + + + ++-------+ +| Doing | ++-------+ + + + + + + ++------+ +| Done | ++------+ \ No newline at end of file diff --git a/code/utility/Additive_Noise.py b/code/utility/Additive_Noise.py index 0b7c50f..ed33f2e 100644 --- a/code/utility/Additive_Noise.py +++ b/code/utility/Additive_Noise.py @@ -57,19 +57,23 @@ class Additive_Noise: sigma = float(sigma); # vérification de la cohérence de sigma - if -255 > sigma or sigma > 255: + if 0 > sigma or sigma > 255: print "sigma have incoherent value" exit(); - from numpy import random # random.rand(height,width) renvoie une matrice de flottants entre 0 et 1 - factors = random.rand(height, width) + from numpy import random as npRand # random.rand(height,width) renvoie une matrice de flottants entre 0 et 1 + factors = npRand.rand(height, width) # on parcourt en même temps les facteurs aléatoires et la matrice de pixels for lineP, lineF in zip(pixelMap, factors): for pixel, fact in zip(lineP, lineF): + # ajout ou suppression (choix aléatoire) + if random.randint(0,1) == 1: + fact *= -1 + r = int( pixel.r + sigma * fact ) g = int( pixel.g + sigma * fact ) b = int( pixel.b + sigma * fact ) diff --git a/docs/Notes_11222010.pdf b/docs/Notes_11222010.pdf new file mode 100644 index 0000000..d26638d Binary files /dev/null and b/docs/Notes_11222010.pdf differ diff --git a/docs/unGaussianize_waveletFilter.pdf b/docs/unGaussianize_waveletFilter.pdf new file mode 100644 index 0000000..e8aa04a Binary files /dev/null and b/docs/unGaussianize_waveletFilter.pdf differ diff --git a/dossier/.dossier.tex.swp b/dossier/.dossier.tex.swp index c19caf2..ac760f6 100644 --- a/dossier/.dossier.tex.swp +++ b/dossier/.dossier.tex.swp @@ -445,7 +445,7 @@ % =================== % % === SECT1 - ADD === % % =================== % - \section{Le bruit additif (Gaussien)} + \section{Le bruit additif gaussien} \textbf{Définition graphique: }Chaque pixel de l'image est plus ou moins bruitée, l'image semble avoir moins de contraste et chaque pixel est éclairci ou foncé.\\\\ \textbf{Bruitage: }Le bruitage se fait en fonction du paramètre réel \begin{math}\sigma\in[0;255]\end{math}. Soit \emph{u} l'image d'origine, \begin{math}u^{OBS}\end{math} l'image observée et \emph{X} le bruit, on a : \begin{align*} diff --git a/dossier/dossier.tex b/dossier/dossier.tex index c19caf2..ac760f6 100644 --- a/dossier/dossier.tex +++ b/dossier/dossier.tex @@ -445,7 +445,7 @@ % =================== % % === SECT1 - ADD === % % =================== % - \section{Le bruit additif (Gaussien)} + \section{Le bruit additif gaussien} \textbf{Définition graphique: }Chaque pixel de l'image est plus ou moins bruitée, l'image semble avoir moins de contraste et chaque pixel est éclairci ou foncé.\\\\ \textbf{Bruitage: }Le bruitage se fait en fonction du paramètre réel \begin{math}\sigma\in[0;255]\end{math}. Soit \emph{u} l'image d'origine, \begin{math}u^{OBS}\end{math} l'image observée et \emph{X} le bruit, on a : \begin{align*}