public class Quant extends Object
| Modifier and Type | Field and Description |
|---|---|
protected static int |
alphabiasshift
alpha值从1.0开始
|
protected int |
alphadec
偏移10位
|
protected static int |
alpharadbias |
protected static int |
alpharadbshift |
protected static int |
beta |
protected static int |
betagamma |
protected static int |
betashift |
protected int[] |
bias |
protected int[] |
freq
基本偏差和频率阵列
|
protected static int |
gamma |
protected static int |
gammashift |
protected static int |
initalpha |
protected static int |
initrad
256颜色,半径开始
|
protected static int |
initradius |
protected static int |
intbias |
protected static int |
intbiasshift |
protected int |
lengthcount
engthcount = H * W * 3
|
protected static int |
maxnetpos |
protected static int |
minpicturebytes |
protected static int |
ncycles |
protected static int |
netbiasshift |
protected int[] |
netindex
用于网络查找——实际上是256
|
protected static int |
netsize
所用颜色数
|
protected int[][] |
network
网络本身- [netsize][4]
|
protected static int |
prime1
4个接近500的质数——假设没有一幅图像的长度大到可以被所有4个质数整除
|
protected static int |
prime2 |
protected static int |
prime3 |
protected static int |
prime4 |
protected static int |
radbias |
protected static int |
radbiasshift
radbias和alpharadbias用于radpower计算
|
protected static int |
radiusbias |
protected static int |
radiusbiasshift
在32.0偏置6位
|
protected static int |
radiusdec
每循环1/30
|
protected int[] |
radpower |
protected int |
samplefac
1 .
|
protected byte[] |
thepicture
输入图像本身
|
| Constructor and Description |
|---|
Quant(byte[] thepic,
int len,
int sample)
初始化网络的范围(0,0,0)到(255,255,255),并设置参数
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
alterneigh(int rad,
int i,
int b,
int g,
int r)
通过radpower[|i-j|]中预先计算的alpha*(1-(((i-j)^2/[r]^2))移动相邻神经元
|
protected void |
altersingle(int alpha,
int i,
int b,
int g,
int r)
通过因子将神经元i向偏置(b,g,r)移动
|
byte[] |
colorMap() |
protected int |
contest(int b,
int g,
int r)
搜索有偏差的BGR值
|
void |
inxbuild()
网络的插入排序与netindex的建立[0..]255](在无偏移之后做)
|
void |
learn() |
int |
map(int b,
int g,
int r)
搜索BGR值0..255(经过净是无偏的)和返回颜色指数
|
byte[] |
process() |
void |
unbiasnet()
无偏见网络给字节值0..并记录位置i,为排序做准备
|
protected static final int netsize
protected static final int prime1
protected static final int prime2
protected static final int prime3
protected static final int prime4
protected static final int minpicturebytes
protected static final int maxnetpos
protected static final int netbiasshift
protected static final int ncycles
protected static final int intbiasshift
protected static final int intbias
protected static final int gammashift
protected static final int gamma
protected static final int betashift
protected static final int beta
protected static final int betagamma
protected static final int initrad
protected static final int radiusbiasshift
protected static final int radiusbias
protected static final int initradius
protected static final int radiusdec
protected static final int alphabiasshift
protected static final int initalpha
protected static final int radbiasshift
protected static final int radbias
protected static final int alpharadbshift
protected static final int alpharadbias
protected int alphadec
protected byte[] thepicture
protected int lengthcount
protected int samplefac
protected int[][] network
protected int[] netindex
protected int[] bias
protected int[] freq
protected int[] radpower
public Quant(byte[] thepic,
int len,
int sample)
thepic - 图片len - 长度sample - 样品public byte[] colorMap()
public void inxbuild()
public void learn()
public int map(int b,
int g,
int r)
b - 蓝g - 绿r - 红public byte[] process()
public void unbiasnet()
protected void alterneigh(int rad,
int i,
int b,
int g,
int r)
rad - 弧度i - 偏移量b - 蓝g - 绿r - 红protected void altersingle(int alpha,
int i,
int b,
int g,
int r)
alpha - 开端i - 偏移量b - 蓝g - 绿r - 红protected int contest(int b,
int g,
int r)
b - 蓝g - 绿r - 红Copyright © 2020. All rights reserved.