Modification + ajout du TODO + avancée dossier
This commit is contained in:
parent
ddc83b710d
commit
cd470bebae
Binary file not shown.
Before Width: | Height: | Size: 257 KiB |
BIN
code/new.bmp
BIN
code/new.bmp
Binary file not shown.
Before Width: | Height: | Size: 257 KiB |
|
@ -413,9 +413,8 @@ def testAdditiveGaussianNoise(sigma=10, seuil=35):
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
print "| Removing Additive |",; t.reset();
|
print "| Average Filter |",; t.reset();
|
||||||
# img.content.map = FX.Additive.unset(img.content.map, seuil=seuilB)
|
FX.Filter.smooth(img.content.map)
|
||||||
img.content.map = FX.Additive.unset2(img.content.map, seuil=seuil)
|
|
||||||
print "%s |" % (t.get())
|
print "%s |" % (t.get())
|
||||||
|
|
||||||
# Unparsing
|
# Unparsing
|
||||||
|
|
|
@ -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 |
|
||||||
|
+------+
|
|
@ -57,19 +57,23 @@ class Additive_Noise:
|
||||||
sigma = float(sigma);
|
sigma = float(sigma);
|
||||||
|
|
||||||
# vérification de la cohérence de 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"
|
print "sigma have incoherent value"
|
||||||
exit();
|
exit();
|
||||||
|
|
||||||
|
|
||||||
from numpy import random # random.rand(height,width) renvoie une matrice de flottants entre 0 et 1
|
from numpy import random as npRand # random.rand(height,width) renvoie une matrice de flottants entre 0 et 1
|
||||||
factors = random.rand(height, width)
|
factors = npRand.rand(height, width)
|
||||||
|
|
||||||
|
|
||||||
# on parcourt en même temps les facteurs aléatoires et la matrice de pixels
|
# on parcourt en même temps les facteurs aléatoires et la matrice de pixels
|
||||||
for lineP, lineF in zip(pixelMap, factors):
|
for lineP, lineF in zip(pixelMap, factors):
|
||||||
for pixel, fact in zip(lineP, lineF):
|
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 )
|
r = int( pixel.r + sigma * fact )
|
||||||
g = int( pixel.g + sigma * fact )
|
g = int( pixel.g + sigma * fact )
|
||||||
b = int( pixel.b + sigma * fact )
|
b = int( pixel.b + sigma * fact )
|
||||||
|
|
Binary file not shown.
Binary file not shown.
|
@ -445,7 +445,7 @@
|
||||||
% =================== %
|
% =================== %
|
||||||
% === SECT1 - ADD === %
|
% === 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{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 :
|
\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*}
|
\begin{align*}
|
||||||
|
|
|
@ -445,7 +445,7 @@
|
||||||
% =================== %
|
% =================== %
|
||||||
% === SECT1 - ADD === %
|
% === 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{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 :
|
\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*}
|
\begin{align*}
|
||||||
|
|
Loading…
Reference in New Issue