提取图像的LBP特征,用SVM分类的问题
我现在要提取一张图像的LBP特征,然后用SVM分类。
Img=imread('lena.jpg');
I=rgb2gray(Img);
mapping=getmapping(8,'u2');
H1=LBP(I,1,8,mapping,'h'); %LBP histogram in (8,1) neighborhood
%using uniform patterns
subplot(2,1,1),stem(H1);
H2=LBP(I);
subplot(2,1,2),stem(H2);
SP=[-1 -1; -1 0; -1 1; 0 -1; -0 1; 1 -1; 1 0; 1 1];
I2=LBP(I,SP,0,'i'); %LBP code image using sampling points in SP
%and no mapping. Now H2 is equal to histogram of I2.
% show the images
figure, imshow(I);
title('Input Image');
figure, imshow(I2);
title('Result of LBP');
我用上面的代码提取LBP特征,请问H1就是SVM训练时的属性矩阵吗?要用不同的LBP算子提取特征,可以通过改变H1的参数来实现吗?