Antinag
Die Mutter der Nagra-Decodierung
Hier ist die Theorie zu einem kleinen Programm, das man durchaus als den Ursprung der Nagra-Decodierung bezeichnen kann. 1994 gab es schon die Version 2.0. Allerdings war mit den damals zur Verfügung stehenden Computern und dieser Software nicht an laufende Bilder zu denken. Letztenendes ist das die Basis, auf der die heutigen Algorithmen aufbauen.
This program decodes NAGRAVision images by using an algorithm based on error function to sort lines.
This program substitutes the original idea based in correlation function because the new algorithm is FASTER, SIMPLER and get GOOD results.
(In my 486DX33 the program takes about 2.83 minutes to decode a 512*512 image, with 1Meg assigned to the smartdrv.exe!).
* NOTES ABOUT USING: - Images must be on PGM format (Portable GrayMap) version P5
- The algorithm reports the same result for all resolutions.
- If you have MS-DOS 5 or upper then use SMARTDRV to minimize disk access!.
- Some people ask me: how to view .PGM files?, well in this version I include .JPG copies (for fast view). There are lots of programs that recognize .PGM format:
- DVPEG v3.0l from Thomas G. Lane (a viewer).
- CJPEG (a JPG converter, I have used it to make the .JPG files).
- ALCHEMY (a viewer/coverter). All that programs are available in any SIMTEL ftp mirror.
* THEORY:
- Def. Error function (E):
---
E=abs[ f(x) - g(x) ]where:
f(x) is the real function
g(x) is the probe function.- Property.
--------The g(x) that minimizes E will be the one that is most liking to f(x).
* ALGORITHM:
I calculate:
E=abs[ (G(x) - G(x) ]
i jBeing:
G(x) the discreet function that returns the grayscale values for line i in y
the x horizontal point.
x, y discreet variables (pixels) when domain x î [1, x_max]
y î [1, y_max].x_max, y_max are the horizontal and vertical resolutions of .PGM respectively.
(x, y) = (1, 1) is the upper left corner.
x_max
If I fix G(x) and calculate: E= sum [ abs[ (G(x) - G(x) ] ]
i x=1 i jthe j (j<>i of course) that minimizes E will be the one that is most liking
to i, and must be located beside to i.
Repeating that for all the lines we get the decoded image.
by:
Toni Cebrian
Telecommunications student at Valencia (Spain)
E-Mail: acebrian@afrodita.etsit.upv.es