SNR corrigé

This commit is contained in:
xdrm-brackets 2015-10-09 14:55:49 +02:00
parent 9dc4b027fd
commit 59974d4c24
4 changed files with 5 additions and 8 deletions

View File

@ -52,14 +52,11 @@ class Noise:
uNoise.append( [] );
for pixNoisy, pixRef in zip(lineNoisy, lineRef):
uNoise[pixRef.y].append( RGBPixel(
r = 0 if pixNoisy.r-pixRef.r < 0 else pixNoisy.r-pixRef.r, # on tronque à 0 si négatif
g = 0 if pixNoisy.g-pixRef.g < 0 else pixNoisy.g-pixRef.g, # on tronque à 0 si négatif
b = 0 if pixNoisy.b-pixRef.b < 0 else pixNoisy.b-pixRef.b, # on tronque à 0 si négatif
x = pixRef.x,
y = pixRef.y,
bpp = pixRef.bpp,
) )
pix = RGBPixel(0,0,0,pixRef.x, pixRef.y, pixRef.bpp );
pix.r = pixNoisy.r-pixRef.r;
pix.g = pixNoisy.r-pixRef.g;
pix.b = pixNoisy.r-pixRef.b;
uNoise[pixRef.y].append( pix);
# on calcule la puissance du bruit

BIN
code/SaltAndPepper.bmp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 257 KiB

BIN
code/test.bmp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 257 KiB