Class NeuQuant
java.lang.Object
NeuQuant
public class NeuQuant
- extends java.lang.Object
NeuQuant Neural-Net Quantization Algorithm
------------------------------------------
Copyright (c) 1994 Anthony Dekker
NEUQUANT Neural-Net quantization algorithm by Anthony Dekker, 1994.
See "Kohonen neural networks for optimal colour quantization"
in "Network: Computation in Neural Systems" Vol. 5 (1994) pp 351-367.
for a discussion of the algorithm.
Any party obtaining a copy of these files from the author, directly or
indirectly, is granted, free of charge, a full and unrestricted irrevocable,
world-wide, paid up, royalty-free, nonexclusive right and license to deal
in this software and documentation files (the "Software"), including without
limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons who receive
copies from any such party to do so, with the only requirement being
that this copyright notice remain intact.
Constructor Summary |
NeuQuant(byte[] thepic,
int len,
int sample)
|
Method Summary |
protected void |
alterneigh(int rad,
int i,
int b,
int g,
int r)
|
protected void |
altersingle(int alpha,
int i,
int b,
int g,
int r)
|
byte[] |
colorMap()
|
protected int |
contest(int b,
int g,
int r)
|
void |
inxbuild()
|
void |
learn()
|
int |
map(int b,
int g,
int r)
|
byte[] |
process()
|
void |
unbiasnet()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
netsize
protected static final int netsize
- See Also:
- Constant Field Values
prime1
protected static final int prime1
- See Also:
- Constant Field Values
prime2
protected static final int prime2
- See Also:
- Constant Field Values
prime3
protected static final int prime3
- See Also:
- Constant Field Values
prime4
protected static final int prime4
- See Also:
- Constant Field Values
minpicturebytes
protected static final int minpicturebytes
- See Also:
- Constant Field Values
maxnetpos
protected static final int maxnetpos
- See Also:
- Constant Field Values
netbiasshift
protected static final int netbiasshift
- See Also:
- Constant Field Values
ncycles
protected static final int ncycles
- See Also:
- Constant Field Values
intbiasshift
protected static final int intbiasshift
- See Also:
- Constant Field Values
intbias
protected static final int intbias
- See Also:
- Constant Field Values
gammashift
protected static final int gammashift
- See Also:
- Constant Field Values
gamma
protected static final int gamma
- See Also:
- Constant Field Values
betashift
protected static final int betashift
- See Also:
- Constant Field Values
beta
protected static final int beta
- See Also:
- Constant Field Values
betagamma
protected static final int betagamma
- See Also:
- Constant Field Values
initrad
protected static final int initrad
- See Also:
- Constant Field Values
radiusbiasshift
protected static final int radiusbiasshift
- See Also:
- Constant Field Values
radiusbias
protected static final int radiusbias
- See Also:
- Constant Field Values
initradius
protected static final int initradius
- See Also:
- Constant Field Values
radiusdec
protected static final int radiusdec
- See Also:
- Constant Field Values
alphabiasshift
protected static final int alphabiasshift
- See Also:
- Constant Field Values
initalpha
protected static final int initalpha
- See Also:
- Constant Field Values
alphadec
protected int alphadec
radbiasshift
protected static final int radbiasshift
- See Also:
- Constant Field Values
radbias
protected static final int radbias
- See Also:
- Constant Field Values
alpharadbshift
protected static final int alpharadbshift
- See Also:
- Constant Field Values
alpharadbias
protected static final int alpharadbias
- See Also:
- Constant Field Values
thepicture
protected byte[] thepicture
lengthcount
protected int lengthcount
samplefac
protected int samplefac
network
protected int[][] network
netindex
protected int[] netindex
bias
protected int[] bias
freq
protected int[] freq
radpower
protected int[] radpower
NeuQuant
public NeuQuant(byte[] thepic,
int len,
int sample)
colorMap
public byte[] colorMap()
inxbuild
public void inxbuild()
learn
public void learn()
map
public int map(int b,
int g,
int r)
process
public byte[] process()
unbiasnet
public void unbiasnet()
alterneigh
protected void alterneigh(int rad,
int i,
int b,
int g,
int r)
altersingle
protected void altersingle(int alpha,
int i,
int b,
int g,
int r)
contest
protected int contest(int b,
int g,
int r)