NlBP尿蛋白正常值是多少是正常值

最大纸张尺寸
打印速度*1
黑白12ppm/彩色8ppm(A4)
打印分辨率*2
600dpi×600dpi
支持操作系统*3
Windows 2000/XP/Vista, Mac OS X 10.3.9 - 10.5.x
16MB(Hi-SCoA,无需扩展)
(从电源开启到就绪状态)
约25秒或更少
(从休眠到就绪状态)
首页打印时间
黑白 22秒或更少,彩色28秒或更少
A4 / A5 / B5 / Legal / Letter /16K/ Executive / Index card / Envelope (C5/ COM10 / DL / Monarch)
用户自定义:宽76.2-215.9mm,长127.0-355.6mm
150 页(80g/m2)
多功能进纸托盘
1 页(80g/m2)
纸张输出(面向下)
125 页(80g/m2)
耗材及打印量*4
Cartridge 316硒鼓
Y黄色/M品红/C青色 各1500页/BK黑色 2300页
(打印机包装内的初始硒鼓打印量:Y黄色/M品红/C青色/BK黑色 各800页)
220-240V(±10%)50/60Hz(±2Hz)
能量消耗*5
最高约680W或更少/打印:彩色约210W或更少,黑白约258W或更少/待机约16W或更少/睡眠约8W或更少
打印: 黑白48dB,彩色47dB
体积(W×D×H)
399mm×452.5mm×262mm
约 16.0kg(不含硒鼓)
USB2.0高速/10BASE-T/100BASE―TX
*1 打印速度取决于纸张尺寸、纸张类型、打印份数和定影模式的设置。
*2 图像处理分辨率为9600dpi×600dpi,图像处理分辨率是指打印前处理数据时的分辨率。
*3 关于Mac及LINUX操作系统的兼容情况请咨询佳能公司,Max及LINUX的驱动仅限英文且不包含在随机光盘内。
*4 LBP5050n打印量基于A4,以默认设置打印“ISO/IEC19798”模板。
*5 打印机在标准配置状态下且启动时的瞬间峰值未计算在内。
佳能官方微信订阅号
佳能官方微信服务号
佳能(中国)有限公司版权所有,未经许可不得转载
京公网安备04号
《互联网药品信息服务资格证书》编号:(京)-非经营性-号
分享到各大网站君,已阅读到文档的结尾了呢~~
扫扫二维码,随身浏览文档
手机或平板扫扫即可继续访问
LBP5050(N)维修手册(中文)
举报该文档为侵权文档。
举报该文档含有违规或不良信息。
反馈该文档无法正常浏览。
举报该文档为重复文档。
推荐理由:
将文档分享至:
分享完整地址
文档地址:
粘贴到BBS或博客
flash地址:
支持嵌入FLASH地址的网站使用
html代码:
&embed src='/DocinViewer-4.swf' width='100%' height='600' type=application/x-shockwave-flash ALLOWFULLSCREEN='true' ALLOWSCRIPTACCESS='always'&&/embed&
450px*300px480px*400px650px*490px
支持嵌入HTML代码的网站使用
您的内容已经提交成功
您所提交的内容需要审核后才能发布,请您等待!
3秒自动关闭窗口LBP特征原理及代码实现 - CSDN博客
LBP特征原理及代码实现
一、LBP特征的背景介绍
LBP指局部二值模式,英文全称:Local Binary Pattern,是一种用来描述图像局部特征的算子,LBP特征具有灰度不变性和旋转不变性等显著优点。它是由T. Ojala, M.Pietik?inen, 和 D. Harwood [1][2]在1994年提出,由于LBP特征计算简单、效果较好,因此LBP特征在计算机视觉的许多领域都得到了广泛的应用,LBP特征比较出名的应用是用在人脸识别和目标检测中,在计算机视觉开源库Opencv中有使用LBP特征进行人脸识别的接口,也有用LBP特征训练目标检测分类器的方法,Opencv实现了LBP特征的计算,但没有提供一个单独的计算LBP特征的接口。
二、LBP特征的原理
1、原始LBP特征描述及计算方法
原始的LBP算子定义在像素3*3的邻域内,以邻域中心像素为阈值,相邻的8个像素的灰度值与邻域中心的像素值进行比较,若周围像素大于中心像素值,则该像素点的位置被标记为1,否则为0。这样,3*3邻域内的8个点经过比较可产生8位二进制数,将这8位二进制数依次排列形成一个二进制数字,这个二进制数字就是中心像素的LBP值,LBP值共有28种可能,因此LBP值有256种。中心像素的LBP值反映了该像素周围区域的纹理信息。
备注:计算LBP特征的图像必须是灰度图,如果是彩色图,需要先转换成灰度图。
上述过程用图像表示为:
将上述过程用公式表示为:
(xc,yc)为中心像素的坐标,p为邻域的第p个像素,ip为邻域像素的灰度值,ic为中心像素的灰度值,s(x)为符号函数
原始LBP特征计算代码(Opencv下):
//原始LBP特征计算
template &typename _tp&
void getOriginLBPFeature(InputArray _src,OutputArray _dst)
Mat src = _src.getMat()
_dst.create(src.rows-2,src.cols-2,CV_8UC1)
Mat dst = _dst.getMat()
dst.setTo(0)
for(int i=1
for(int j=1
_tp center = src.at&_tp&(i,j)
unsigned char lbpCode = 0
lbpCode |= (src.at&_tp&(i-1,j-1) & center) && 7
lbpCode |= (src.at&_tp&(i-1,j
) & center) && 6
lbpCode |= (src.at&_tp&(i-1,j+1) & center) && 5
lbpCode |= (src.at&_tp&(i
,j+1) & center) && 4
lbpCode |= (src.at&_tp&(i+1,j+1) & center) && 3
lbpCode |= (src.at&_tp&(i+1,j
) & center) && 2
lbpCode |= (src.at&_tp&(i+1,j-1) & center) && 1
lbpCode |= (src.at&_tp&(i
,j-1) & center) && 0
dst.at&uchar&(i-1,j-1) = lbpCode
测试结果:
2、LBP特征的改进版本
在原始的LBP特征提出以后,研究人员对LBP特征进行了很多的改进,因此产生了许多LBP的改进版本。
2.1 圆形LBP特征(Circular LBP or Extended LBP)
& & & &由于原始LBP特征使用的是固定邻域内的灰度值,因此当图像的尺度发生变化时,LBP特征的编码将会发生错误,LBP特征将不能正确的反映像素点周围的纹理信息,因此研究人员对其进行了改进[3]。基本的 LBP 算子的最大缺陷在于它只覆盖了一个固定半径范围内的小区域,这显然不能满足不同尺寸和频率纹理的需要。为了适应不同尺度的纹理特征,并达到灰度和旋转不变性的要求,Ojala 等对 LBP 算子进行了改进,将 3×3 邻域扩展到任意邻域,并用圆形邻域代替了正方形邻域,改进后的 LBP 算子允许在半径为 R 的圆形邻域内有任意多个像素点。从而得到了诸如半径为R的圆形区域内含有P个采样点的LBP算子:
这种LBP特征叫做Extended LBP,也叫Circular LBP。使用可变半径的圆对近邻像素进行编码,可以得到如下的近邻:
对于给定中心点(xc,yc),其邻域像素位置为(xp,yp),p∈P,其采样点(xp,yp)用如下公式计算:
R是采样半径,p是第p个采样点,P是采样数目。由于计算的值可能不是整数,即计算出来的点不在图像上,我们使用计算出来的点的插值点。目的的插值方法有很多,Opencv使用的是双线性插值,双线性插值的公式如下:
通过LBP特征的定义可以看出,LBP特征对光照变化是鲁棒的,其效果如下图所示:
template &typename _tp&
void getCircularLBPFeature(InputArray _src,OutputArray _dst,int radius,int neighbors)
Mat src = _src.getMat();
_dst.create(src.rows-2*radius,src.cols-2*radius,CV_8UC1);
Mat dst = _dst.getMat();
dst.setTo(0);
for(int i=i&src.rows-i++)
for(int j=j&src.cols-j++)
_tp center = src.at&_tp&(i,j);
unsigned char lbpCode = 0;
for(int k=0;k&k++)
float x = i + static_cast&float&(radius * \
cos(2.0 * CV_PI * k / neighbors));
float y = j - static_cast&float&(radius * \
sin(2.0 * CV_PI * k / neighbors));
int x1 = static_cast&int&(floor(x));
int x2 = static_cast&int&(ceil(x));
int y1 = static_cast&int&(floor(y));
int y2 = static_cast&int&(ceil(y));
float tx = x - x1;
float ty = y - y1;
float w1 = (1-tx) * (1-ty);
float w2 =
float w3 = (1-tx) *
float w4 =
float neighbor = src.at&_tp&(x1,y1) * w1 + src.at&_tp&(x1,y2) *w2 \
+ src.at&_tp&(x2,y1) * w3 +src.at&_tp&(x2,y2) *w4;
lbpCode |= (neighbor&center) &&(neighbors-k-1);
dst.at&uchar&(i-radius,j-radius) = lbpC
template &typename _tp&
void getCircularLBPFeatureOptimization(InputArray _src,OutputArray _dst,int radius,int neighbors)
Mat src = _src.getMat();
_dst.create(src.rows-2*radius,src.cols-2*radius,CV_8UC1);
Mat dst = _dst.getMat();
dst.setTo(0);
for(int k=0;k&k++)
float rx = static_cast&float&(radius * cos(2.0 * CV_PI * k / neighbors));
float ry = -static_cast&float&(radius * sin(2.0 * CV_PI * k / neighbors));
int x1 = static_cast&int&(floor(rx));
int x2 = static_cast&int&(ceil(rx));
int y1 = static_cast&int&(floor(ry));
int y2 = static_cast&int&(ceil(ry));
float tx = rx - x1;
float ty = ry - y1;
float w1 = (1-tx) * (1-ty);
float w2 =
float w3 = (1-tx) *
float w4 =
for(int i=i&src.rows-i++)
for(int j=j&src.cols-j++)
_tp center = src.at&_tp&(i,j);
float neighbor = src.at&_tp&(i+x1,j+y1) * w1 + src.at&_tp&(i+x1,j+y2) *w2 \
+ src.at&_tp&(i+x2,j+y1) * w3 +src.at&_tp&(i+x2,j+y2) *w4;
dst.at&uchar&(i-radius,j-radius) |= (neighbor&center) &&(neighbors-k-1);
测试结果:
radius = 3,neighbors = 8
第三幅图像为radius = 3,neighbors = 8,第四幅图像为radius = 1,neighbors = 8,从实验结果可以看出,半径越小,图像纹理越精细
第三幅图像为radius = 3,neighbors = 8,第四幅图像为radius = 3,neighbors = 4,从实验结果可以看出,邻域数目越小,图像亮度越低,合理,因此4位的灰度值很小
由于我代码的问题,不能使neighbors &8,可改进
2.2 旋转不变LBP特征
& & & &从上面可以看出,上面的LBP特征具有灰度不变性,但还不具备旋转不变性,因此研究人员又在上面的基础上进行了扩展,提出了具有旋转不变性的LBP特征。
首先不断的旋转圆形邻域内的LBP特征,根据选择得到一系列的LBP特征值,从这些LBP特征值选择LBP特征值最小的作为中心像素点的LBP特征。具体做法如下图所示:
如图,通过对得到的LBP特征进行旋转,得到一系列的LBP特征值,最终将特征值最小的一个特征模式作为中心像素点的LBP特征。
template &typename _tp&
void getRotationInvariantLBPFeature(InputArray _src,OutputArray _dst,int radius,int neighbors)
Mat src = _src.getMat();
_dst.create(src.rows-2*radius,src.cols-2*radius,CV_8UC1);
Mat dst = _dst.getMat();
dst.setTo(0);
for(int k=0;k&k++)
float rx = static_cast&float&(radius * cos(2.0 * CV_PI * k / neighbors));
float ry = -static_cast&float&(radius * sin(2.0 * CV_PI * k / neighbors));
int x1 = static_cast&int&(floor(rx));
int x2 = static_cast&int&(ceil(rx));
int y1 = static_cast&int&(floor(ry));
int y2 = static_cast&int&(ceil(ry));
float tx = rx - x1;
float ty = ry - y1;
float w1 = (1-tx) * (1-ty);
float w2 =
float w3 = (1-tx) *
float w4 =
for(int i=i&src.rows-i++)
for(int j=j&src.cols-j++)
_tp center = src.at&_tp&(i,j);
float neighbor = src.at&_tp&(i+x1,j+y1) * w1 + src.at&_tp&(i+x1,j+y2) *w2 \
+ src.at&_tp&(i+x2,j+y1) * w3 +src.at&_tp&(i+x2,j+y2) *w4;
dst.at&uchar&(i-radius,j-radius) |= (neighbor&center) &&(neighbors-k-1);
for(int i=0;i&dst.i++)
for(int j=0;j&dst.j++)
unsigned char currentValue = dst.at&uchar&(i,j);
unsigned char minValue = currentV
for(int k=1;k&k++)
unsigned char temp = (currentValue&&(neighbors-k)) | (currentValue&&k);
if(temp & minValue)
minValue =
dst.at&uchar&(i,j) = minV
测试结果:
radius = 3,neighbors = 8,最后一幅是旋转不变LBP特征
2.3 Uniform Pattern LBP特征
& & & &Uniform Pattern,也被称为等价模式或均匀模式,由于一个LBP特征有多种不同的二进制形式,对于半径为R的圆形区域内含有P个采样点的LBP算子将会产生2P种模式。很显然,随着邻域集内采样点数的增加,二进制模式的种类是以指数形式增加的。例如:5×5邻域内20个采样点,有220=1,048,576种二进制模式。这么多的二进制模式不利于纹理的提取、分类、识别及存取。例如,将LBP算子用于纹理分类或人脸识别时,常采用LBP模式的统计直方图来表达图像的信息,而较多的模式种类将使得数据量过大,且直方图过于稀疏。因此,需要对原始的LBP模式进行降维,使得数据量减少的情况下能最好的表示图像的信息。
&&&&为了解决二进制模式过多的问题,提高统计性,Ojala提出了采用一种“等价模式”(Uniform Pattern)来对LBP算子的模式种类进行降维。Ojala等认为,在实际图像中,绝大多数LBP模式最多只包含两次从1到0或从0到1的跳变。因此,Ojala将“等价模式”定义为:当某个LBP所对应的循环二进制数从0到1或从1到0最多有两次跳变时,该LBP所对应的二进制就称为一个等价模式类。如次跳变),(只含一次从0到1的跳变),(先由1跳到0,再由0跳到1,共两次跳变)都是等价模式类。除等价模式类以外的模式都归为另一类,称为混合模式类,例如(共四次跳变)。通过这样的改进,二进制模式的种类大大减少,而不会丢失任何信息。模式数量由原来的2P种减少为 P ( P-1)+2种,其中P表示邻域集内的采样点数。对于3×3邻域内8个采样点来说,二进制模式由原始的256种减少为58种,即:它把值分为59类,58个uniform pattern为一类,其它的所有值为第59类。这样直方图从原来的256维变成59维。这使得特征向量的维数更少,并且可以减少高频噪声带来的影响。
&&&&具体实现:采样点数目为8个,即LBP特征值有28种,共256个值,正好对应灰度图像的0-255,因此原始的LBP特征图像是一幅正常的灰度图像,而等价模式LBP特征,根据0-1跳变次数,将这256个LBP特征值分为了59类,从跳变次数上划分:跳变0次—2个,跳变1次—0个,跳变2次—56个,跳变3次—0个,跳变4次—140个,跳变5次—0个,跳变6次—56个,跳变7次—0个,跳变8次—2个。共9种跳变情况,将这256个值进行分配,跳变小于2次的为等价模式类,共58个,他们对应的值按照从小到大分别编码为1—58,即它们在LBP特征图像中的灰度值为1—58,而除了等价模式类之外的混合模式类被编码为0,即它们在LBP特征中的灰度值为0,因此等价模式LBP特征图像整体偏暗。
template &typename _tp&
void getUniformPatternLBPFeature(InputArray _src,OutputArray _dst,int radius,int neighbors)
Mat src = _src.getMat();
_dst.create(src.rows-2*radius,src.cols-2*radius,CV_8UC1);
Mat dst = _dst.getMat();
dst.setTo(0);
uchar temp = 1;
uchar table[256] = {0};
for(int i=0;i&256;i++)
if(getHopTimes(i)&3)
table[i] =
bool flag = false;
for(int k=0;k&k++)
if(k==neighbors-1)
flag = true;
float rx = static_cast&float&(radius * cos(2.0 * CV_PI * k / neighbors));
float ry = -static_cast&float&(radius * sin(2.0 * CV_PI * k / neighbors));
int x1 = static_cast&int&(floor(rx));
int x2 = static_cast&int&(ceil(rx));
int y1 = static_cast&int&(floor(ry));
int y2 = static_cast&int&(ceil(ry));
float tx = rx - x1;
float ty = ry - y1;
float w1 = (1-tx) * (1-ty);
float w2 =
float w3 = (1-tx) *
float w4 =
for(int i=i&src.rows-i++)
for(int j=j&src.cols-j++)
_tp center = src.at&_tp&(i,j);
float neighbor = src.at&_tp&(i+x1,j+y1) * w1 + src.at&_tp&(i+x1,j+y2) *w2 \
+ src.at&_tp&(i+x2,j+y1) * w3 +src.at&_tp&(i+x2,j+y2) *w4;
dst.at&uchar&(i-radius,j-radius) |= (neighbor&center) &&(neighbors-k-1);
dst.at&uchar&(i-radius,j-radius) = table[dst.at&uchar&(i-radius,j-radius)];
int getHopTimes(int n)
int count = 0;
bitset&8& binaryCode =
for(int i=0;i&8;i++)
if(binaryCode[i] != binaryCode[(i+1)%8])
测试结果:
radius = 3,neighbors = 8,最后一幅是等价模式LBP特征
2.4 MB-LBP特征
MB-LBP特征,全称为Multiscale Block LBP,来源于论文[9],中科院的人发明的,在Traincascade级联目标训练检测中的LBP特征使用的就是MB-LBP。
MB-LBP的原理:
将图像分成一个个小块(Block),每个小块再分为一个个的小区域(类似于HOG中的cell),小区域内的灰度平均值作为当前小区域的灰度值,与周围小区域灰度进行比较形成LBP特征,生成的特征称为MB-LBP,Block大小为3*3,则小区域的大小为1,就是原始的LBP特征,上图的Block大小为9*9,小区域的大小为3*3。
不同Block提取的MB-LBP特征如图所示:
计算MB-LBP代码:
void getMultiScaleBlockLBPFeature(InputArray _src,OutputArray _dst,int scale)
Mat src = _src.getMat();
Mat dst = _dst.getMat();
int cellSize = scale / 3;
int offset = cellSize / 2;
Mat cellImage(src.rows-2*offset,src.cols-2*offset,CV_8UC1);
for(int i=i&src.rows-i++)
for(int j=j&src.cols-j++)
int temp = 0;
for(int m=-m&offset+1;m++)
for(int n=-n&offset+1;n++)
temp += src.at&uchar&(i+n,j+m);
temp /= (cellSize*cellSize);
cellImage.at&uchar&(i-cellSize/2,j-cellSize/2) = uchar(temp);
getOriginLBPFeature&uchar&(cellImage,dst);
Block=3,即原始的LBP特征
&&&&到此为止,还没有结束,作者对得到LBP特征又进行了均值模式编码,通过对得到的特征图求直方图,得到了LBP特征值0-255之间(0-255即直方图中的bin)的特征数量,通过对bin中的数值进行排序,通过权衡,将排序在前63位的特征值看作是等价模式类,其他的为混合模式类,总共64类,作者在论文中称之为SEMB-LBP(Statistically Effective MB-LBP )。类似于等价模式LBP,等价模式的LBP的等价模式类为58种,混合模式类1种,共59种。二者除了等价模式类的数量不同之外,主要区别在于:对等价模式类的定义不同,等价模式LBP是根据0-1的跳变次数定义的,而SEMB-LBP是通过对直方图排序得到的。当然下一步要做的就是将SEMB-LBP变为LBPH进行使用。
计算SEMB-LBP的代码
void SEMB_LBPFeature(InputArray _src,OutputArray _dst,int scale)
Mat dst=_dst.getMat();
Mat MB_LBPI
getMultiScaleBlockLBPFeature(_src,MB_LBPImage,scale);
int histSize = 256;
float range[] = {float(0),float(255)};
const float* ranges = {range};
calcHist(&MB_LBPImage,1,0,Mat(),histMat,1,&histSize,&ranges,true,false);
histMat.reshape(1,1);
vector&float& histVector(histMat.rows*histMat.cols);
uchar table[256];
memset(table,64,256);
if(histMat.isContinuous())
histVector.assign((float*)histMat.datastart,(float*)histMat.dataend);
vector&float& histVectorCopy(histVector);
sort(histVector.begin(),histVector.end(),greater&float&());
for(int i=0;i&63;i++)
for(int j=0;j&histVectorCopy.size();j++)
if(histVectorCopy[j]==histVector[i])
table[j]=i;
dst = MB_LBPI
for(int i=0;i&dst.i++)
for(int j=0;j&dst.j++)
dst.at&uchar&(i,j) = table[dst.at&uchar&(i,j)];
测试结果:
第二幅为对MB-LBP进行编码得到的SEMB-LBP图像
总结:MB-LBP有点类似于先将图像进行平滑处理,然后再求LBP特征。而SEMB-LBP是在MB-LBP进行编码后的图像。类似于等价模式LBP,先求LBP特征,再用等价模式进行编码。当Scale=3时,MB-LBP和SEMB-LBP就是LBP和等价模式LBP。想具体了解需要去看论文,当然要自己实现才会理解的更透彻。
三、LBPH——图像的LBP特征向量
&&&&LBPH,Local Binary Patterns Histograms,即LBP特征的统计直方图,LBPH将LBP特征与图像的空间信息结合在一起。这种表示方法由Ahonen等人在论文[3]中提出,他们将LBP特征图像分成m个局部块,并提取每个局部块的直方图,然后将这些直方图依次连接在一起形成LBP特征的统计直方图,即LBPH。
一幅图像具体的计算LBPH的过程(以Opencv中的人脸识别为例):
1. 计算图像的LBP特征图像,在上面已经讲过了。
2. 将LBP特征图像进行分块,Opencv中默认将LBP特征图像分成8行8列64块区域
3. 计算每块区域特征图像的直方图cell_LBPH,将直方图进行归一化,直方图大小为1*numPatterns
4. 将上面计算的每块区域特征图像的直方图按分块的空间顺序依次排列成一行,形成LBP特征向量,大小为1*(numPatterns*64)
5. 用机器学习的方法对LBP特征向量进行训练,用来检测和识别目标
举例说明LBPH的维度:
采样点为8个,如果用的是原始的LBP或Extended LBP特征,其LBP特征值的模式为256种,则一幅图像的LBP特征向量维度为:64*256=16384维,
而如果使用的UniformPatternLBP特征,其LBP值的模式为59种,其特征向量维度为:64*59=3776维,可以看出,使用等价模式特征,其特征向量的维度大大减少,
这意味着使用机器学习方法进行学习的时间将大大减少,而性能上没有受到很大影响。
Opencv的人脸识别使用的是Extended LBP
计算LBPH的代码如下:
Mat getLBPH(InputArray _src,int numPatterns,int grid_x,int grid_y,bool normed)
Mat src = _src.getMat();
int width = src.cols / grid_x;
int height = src.rows / grid_y;
Mat result = Mat::zeros(grid_x * grid_y,numPatterns,CV_32FC1);
if(src.empty())
return result.reshape(1,1);
int resultRowIndex = 0;
for(int i=0;i&grid_x;i++)
for(int j=0;j&grid_y;j++)
Mat src_cell = Mat(src,Range(i*height,(i+1)*height),Range(j*width,(j+1)*width));
Mat hist_cell = getLocalRegionLBPH(src_cell,0,(numPattern-1),true);
Mat rowResult = result.row(resultRowIndex);
hist_cell.reshape(1,1).convertTo(rowResult,CV_32FC1);
resultRowIndex++;
return result.reshape(1,1);
Mat getLocalRegionLBPH(const Mat& src,int minValue,int maxValue,bool normed)
int histSize = maxValue - minValue + 1;
float range[] = { static_cast&float&(minValue),static_cast&float&(maxValue + 1) };
const float* ranges = { range };
calcHist(&src,1,0,Mat(),result,1,&histSize,&ranges,true,false);
if(normed)
result /= (int)src.total();
return result.reshape(1,1);
总结:上面的LBP特征都是较经典的LBP特征,除此之外,LBP特征还有大量的变种,如TLBP(中心像素与周围所有像素比较,而不是根据采样点的数目),DLBP(编码标准四个方向的灰度变化,每个方向上用2比特编码),MLBP(将中心像素值替换成采样点像素的平均值),MB-LBP(上面有介绍),VLBP(没太看懂),RGB-LBP(RGB图像分别计算LBP,然后连接在一起)等,具体的需要自己去研究,可参考维基百科
四、LBP特征的匹配与使用
1、LBP特征用在目标检测中
人脸检测比较出名的是Haar+Adaboost方法,其实目前的Opencv也支持LBP+Adaboost和HOG+Adaboost方法进行目标检测,从目前我的使用效果来看,LBP+Adaboost方法用在目标检测中的效果比Haar特征、HOG特征都要好(HOG特征用的不多,主要是Haar和LBP),而且LBP特征的训练速度比Haar和HOG都要快很多。在LBP+Adaboost中,LBP特征主要是用作输入的训练数据(特征),使用的LBP特征应该是DLBP(维基百科上说的,待考证,没太看明白Cascade中LBP特征的计算方式),具体用法需要看源码。Opencv的TrainCascade中使用的LBP特征是MB-LBP。
老外的对Opencv级联检测中使用的LBP的解释(非常好,自己读,就不翻译了),在看这个之前最好是运行过TrainCascade来训练目标检测的分类器,并使用过LBP特征训练,调节过参数[8]:
OpenCV ships with a tool called traincascade that trains LBP, Haar and HOG. Specifically for face detection they even ship the 3000-image dataset of 24x24 pixel faces, in the format needed bytraincascade.
In my experience, of the three types traincascade supports, LBP takes the least time to train, taking on the order of hours rather than days for Haar.
A quick overview of its training process is that for the given number of stages (a decent choice is 20), it attempts to find features that reject as many non-faces as possible while not rejecting the faces. The balance between rejecting non-faces and keeping faces is controlled by the mininum hit rate (OpenCV chose 99.5%) and false alarm rate (OpenCV chose 50%). The specific meta-algorithm used for crafting OpenCV's own LBP cascade is Gentle AdaBoost (GAB).
The variant of LBP implemented in OpenCV is described here:
Shengcai Liao, Xiangxin Zhu, Zhen Lei, Lun Zhang and Stan Z. Li. Learning Multi-scale Block Local Binary Patterns for Face Recognition. International Conference on Biometrics (ICB), 2007, pp. 828-837.
What it amounts to in practice in OpenCV with default parameters is:
OpenCV LBP Cascade Runtime Overview
The detector examines 24x24 windows within the image looking for a face. Stepping from Stage 1 to 20 of the cascade classifier, if it can show that the current 24x24 window is likely not a face, it rejects it and moves over the window by one or two pixels over to the Otherwise it proceeds to the next stage.
During each stage, 3-10 or so LBP features are examined. Every LBP feature has an offset within the window and a size, and the area it covers is fully contained within the current window. Evaluating an LBP feature at a given position can result in either a pass or fail. Depending on whether an LBP feature succeeds or fails, a positive or negative weight particular to that feature is added to an accumulator.
Once all of a stage's LBP features are evaluated, the accumulator's value is compared to the stage threshold. A stage fails if the accumulator is below the threshold, and passes if it is above. Again, if a stage fails, the cascade is exited and the window moves to the next position.
LBP feature evaluation is relatively simple. At that feature's offset within the window, nine rectangles are laid out in a 3x3 configuration. These nine rectangles are all the same size for a particular LBP feature, ranging from 1x1 to 8x8.
The sum of all the pixels in the nine rectangles are computed, in other words their integral. Then, the central rectangle's integral is compared to that of its eight neighbours. The result of these eight comparisons is eight bits (1 or 0), which are assembled in an 8-bit LBP.
This 8-bit bitvector is used as an index into a 2^8 == 256-bit LUT, computed by the training process and particular to each LBP feature, that determines whether the LBP feature passed or failed.
2、 LBP用在人脸识别中
LBP在人脸识别中比较出名,从源码上来看,人脸识别中LBPH的使用主要是用来进行直方图的比较,通过直方图的比较来判断目标的类别。在Opencv的基于LBP的人脸识别的实现中使用的LBP特征是Extendes LBP,即圆形LBP特征。参考的论文为文献[10]。
LBPH训练主要是提取输入的图像的LBPH保存,当进行识别时,遍历保存的LBPH,找到输入图像与训练图像方差最小的LBPH,将其对应的类别作为识别的类别输出。
用LBPH进行训练和识别的代码。
#include&iostream&
#include&opencv2\core\core.hpp&
#include&opencv2\highgui\highgui.hpp&
#include&opencv2\imgproc\imgproc.hpp&
#include&opencv2\contrib\contrib.hpp&
using namespace std;
using namespace
int main(int argc,char* argv[])
vector&Mat&
vector&int&
char buff[10];
for(int i=1;i&8;i++)
sprintf(buff,"0%d.tif",i);
Mat image = imread(buff);
cvtColor(image,grayImage,COLOR_BGR2GRAY);
images.push_back(grayImage);
labels.push_back(1);
for(int i=8;i&12;i++)
sprintf(buff,"0%d.tif",i);
Mat image = imread(buff);
cvtColor(image,grayImage,COLOR_BGR2GRAY);
images.push_back(grayImage);
labels.push_back(2);
Ptr&FaceRecognizer& p = createLBPHFaceRecognizer();
p-&train(images,labels);
Mat test= imread("12.tif");
cvtColor(test,grayImage,COLOR_BGR2GRAY);
int result = p-&predict(grayImage);
cout&&result&&
system("pause");
测试结果:
[1] T. Ojala, M. Pietik?inen, and D. Harwood (1994), “Performance evaluation of texture measures with classification based on Kullback discrimination of distributions”, Proceedings of the 12th IAPR International Conference on Pattern Recognition (ICPR 1994), vol. 1, pp. 582 - 585.
[2] T. Ojala, M. Pietik?inen, and D. Harwood (1996), “A Comparative Study of Texture Measures with Classification Based on Feature Distributions”, Pattern Recognition, vol. 29, pp. 51-59.
[3] Ahonen, T., Hadid, A., and Pietikainen, M. Face Recognition with Local Binary Patterns. Computer Vision- ECCV ), 469–481.
[5] opencv参考手册,Opencv源码
[9] Shengcai Liao, Xiangxin Zhu, Zhen Lei, Lun Zhang and Stan Z. Li. Learning Multi-scale Block Local Binary Patterns for Face Recognition. International Conference on Biometrics (ICB), 2007, pp. 828-837.
[10] Ahonen T, Hadid A. and Pietik?inen M. “Face description with local binary
patterns: Application to face recognition.” IEEE Transactions on Pattern
Analysis and Machine Intelligence, 28(12):.
本文已收录于以下专栏:
相关文章推荐
什么叫特征检测?就是检测图像中目标的特征呗,所谓特征,不管你怎么旋转目标,离目标远近,它的特征都应不变才对,这两个特性称为叫旋转不变性和尺度不变性。
对特征的描述有很多种方法和算子,常见的有SIFT特...
在模式识别和数字图像处理领域,LBP指局部二值模式,即Local Binary Patterns。最初功能为辅助图像局部对比度,后来提升为一种有效的纹理描述算子,度量和提取图像局部的纹理信息,对光照具...
一:原理部分
LBP(Local Binary Pattern,局部二值模式)是一种用来描述图像局部纹理特征的算子;它具有旋转不变性和灰度不变性等显著的优点。它是首先由T. Ojala,
http://blog.csdn.net/zouxy09/article/details/7929531
        LBP(Local Binary Pattern,局部二值模式)是...
LBP的原理及代码实现
特征选择对于文本分类任务很重要,选的好了能够大大提高文本分类准确率。其实特征选择也没有多神秘。首先,不选择也是一种选择,把所有可能的特征类型都用来作文本分类也没有问题。其次,随机选择也是一种选择,效果...
他的最新文章
讲师:何宇健
讲师:董岩
您举报文章:
举报原因:
原文地址:
原因补充:
(最多只允许输入30个字)

我要回帖

更多关于 血糖的正常值是多少 的文章

 

随机推荐