技术领域technical field
本发明涉及图像识别技术,特别是涉及一种图像特征提取方法和装置。The invention relates to image recognition technology, in particular to an image feature extraction method and device.
背景技术Background technique
人脸识别作为一种新兴的生物特征识别技术,与虹膜识别、指纹扫描、掌形扫描等技术相比,具有高精度、易于使用、稳定性高、难仿冒、性价比高的特点,因而有极其广阔的市场应用前景。人脸识别的具体过程可以分为以下三个部分:人脸检测、特征提取、人脸识别;其中,特征提取是研究人脸识别的关键技术。As an emerging biometric identification technology, face recognition has the characteristics of high precision, easy to use, high stability, difficult to counterfeit and high cost performance compared with iris recognition, fingerprint scanning, palm scanning and other technologies. Broad market application prospects. The specific process of face recognition can be divided into the following three parts: face detection, feature extraction, and face recognition; among them, feature extraction is the key technology for studying face recognition.
现有技术中,特征提取主要是提取人脸的代数特征;具体的,代数特征是从试验人脸数据库中的人脸图像中得到一个人脸平均图像,然后计算每个人脸图像与平均图像的差异,得到样本散布矩阵,进而对该样本散布矩阵作卡洛南-洛伊变换(Karhunen-LoèveTransform,KL)变化以求出特征矢量,即得到特征量。虽然人脸的代数特征容易得到,但代数特征对脸部姿态、表情等变化比较敏感,从而导致人脸识别的结果不准确。In the prior art, the feature extraction is mainly to extract the algebraic features of the face; specifically, the algebraic feature is to obtain an average face image from the face images in the test face database, and then calculate the ratio between each face image and the average image. The difference is to obtain the sample scatter matrix, and then apply Karhunen-Loève Transform (KL) to the sample scatter matrix to obtain the feature vector, that is, to get the feature quantity. Although the algebraic features of the face are easy to obtain, the algebraic features are sensitive to changes in facial posture and expression, which leads to inaccurate results of face recognition.
发明内容Contents of the invention
为解决现有存在的技术问题,本发明实施例期望提供一种图像特征提取方法和装置,能够得到更多包含有效信息的代数特征,从而提高人脸识别的准确率。In order to solve the existing technical problems, the embodiments of the present invention expect to provide an image feature extraction method and device, which can obtain more algebraic features containing effective information, thereby improving the accuracy of face recognition.
本发明实施例的技术方案是这样实现的:The technical scheme of the embodiment of the present invention is realized like this:
第一方面,提供一种图像特征提取方法,包括:In the first aspect, an image feature extraction method is provided, including:
对图像进行分块,得到所述图像的各个图像块,其中,任意图像块与所述图像中除自身图像块之外的其它图像块中的至少一个图像块具有重叠区域;The image is divided into blocks to obtain each image block of the image, wherein any image block has an overlapping area with at least one image block in other image blocks in the image except its own image block;
提取所述各个图像块的特征。Extract the feature of each image block.
结合第一方面,在第一种可实现方式中,所述对图像进行分块包括:With reference to the first aspect, in a first implementable manner, said dividing the image into blocks includes:
获取所述图像的宽度和高度;Get the width and height of said image;
获取采样窗口的宽度和高度,所述采样窗口的宽度等于所述图像的宽度,所述采样窗口的高度小于或等于所述图像的高度;Obtain the width and height of the sampling window, the width of the sampling window is equal to the width of the image, and the height of the sampling window is less than or equal to the height of the image;
根据所述图像的高度、所述采样窗口的高度和预设的图像块之间的重叠高度,确定出所述图像的采样数,所述采样数满足Determine the sampling number of the image according to the height of the image, the height of the sampling window and the preset overlapping height between image blocks, and the sampling number satisfies
其中,所述T是采样数,所述H为所述图像的高度,采样窗口的高度为L;重叠高度为P;Wherein, the T is the number of samples, the H is the height of the image, the height of the sampling window is L; the overlapping height is P;
根据预设的采样窗口和所述采样数,对所述图像按照所述图像的高度轴向进行采样,得到所述图像的各个图像块。According to the preset sampling window and the number of samples, the image is axially sampled according to the height of the image to obtain each image block of the image.
结合第一种可实现方式,在第二种可实现方式中,所述L的取值为[H/15,H/10]区间内的整数,所述P的取值为[L/5,L/3]区间内的整数。In combination with the first achievable manner, in the second achievable manner, the value of the L is an integer in the interval [H/15, H/10], and the value of the P is [L/5, Integers in the interval L/3].
结合第二种可实现方式,在第三种可实现方式中,所述提取所述各个图像块的特征包括:In combination with the second implementation manner, in the third implementation manner, the extracting the features of each image block includes:
根据LBP纹理描述方法,提取所述各个图像块的LBP直方图特征。According to the LBP texture description method, the LBP histogram features of each image block are extracted.
结合第一方面、第一种至第三种可实现方式中的任意一种,在第四种可实现方式中,所述对图像进行分块之前,所述方法还包括:In combination with the first aspect, any one of the first to the third implementation manners, in the fourth implementation manner, before the image is divided into blocks, the method further includes:
对所述图像进行光线补偿;performing light compensation on the image;
对所述图像去噪声。The image is denoised.
结合第四种可实现方式,在第五种可实现方式中,所述提取所述各个图像块的特征之后,所述方法还包括:With reference to the fourth implementable manner, in the fifth implementable manner, after extracting the features of each image block, the method further includes:
将所述各个图像块的特征级联为所述图像的特征向量;Concatenating the features of each image block into a feature vector of the image;
将所述图像的特征向量输入预设的分类器进行分类识别,所述分类器是提取图像数据库中多个图像的特征向量之后,将所述多个图像的特征向量训练得到的。Inputting the feature vectors of the images into a preset classifier for classification and recognition, the classifier is obtained by training the feature vectors of the multiple images after extracting the feature vectors of the multiple images in the image database.
第二方面,提供一种图像特征提取装置,包括:In a second aspect, an image feature extraction device is provided, comprising:
分块单元,用于对图像进行分块,得到所述图像的各个图像块,其中,任意图像块与所述图像中除自身图像块之外的其它图像块中的至少一个图像块具有重叠区域;A blocking unit, configured to block the image to obtain each image block of the image, wherein any image block has an overlapping area with at least one image block of other image blocks in the image except its own image block ;
提取单元,用于提取所述各个图像块的特征。An extraction unit, configured to extract features of the respective image blocks.
结合第二方面,在第一种可实现方式中,所述分块单元具体用于:With reference to the second aspect, in a first implementable manner, the block unit is specifically used for:
获取所述图像的宽度和高度;Get the width and height of said image;
获取采样窗口的宽度和高度,所述采样窗口的宽度等于所述图像的宽度,所述采样窗口的高度小于或等于所述图像的高度;Obtain the width and height of the sampling window, the width of the sampling window is equal to the width of the image, and the height of the sampling window is less than or equal to the height of the image;
根据所述图像的高度、所述采样窗口的高度和预设的图像块之间的重叠高度,确定出所述图像的采样数,所述采样数满足Determine the sampling number of the image according to the height of the image, the height of the sampling window and the preset overlapping height between image blocks, and the sampling number satisfies
其中,所述T是采样数,所述H为所述图像的高度,采样窗口的高度为L;重叠高度为P;Wherein, the T is the number of samples, the H is the height of the image, the height of the sampling window is L; the overlapping height is P;
根据预设的采样窗口和所述采样数,对所述图像按照所述图像的高度轴向进行采样,得到所述图像的各个图像块。According to the preset sampling window and the number of samples, the image is axially sampled according to the height of the image to obtain each image block of the image.
结合第一种可实现方式,在第二种可实现方式中,所述L的取值为[H/15,H/10]区间内的整数,所述P的取值为[L/5,L/3]区间内的整数。In combination with the first achievable manner, in the second achievable manner, the value of the L is an integer in the interval [H/15, H/10], and the value of the P is [L/5, Integers in the interval L/3].
结合第二种可实现方式,在第三种可实现方式中,所述提取单元具体用于:In combination with the second possible implementation, in the third possible implementation, the extraction unit is specifically used for:
根据LBP纹理描述方法,提取所述各个图像块的LBP直方图特征。According to the LBP texture description method, the LBP histogram features of each image block are extracted.
结合第二方面、第一种至第三种可实现方式中的任意一种,所述装置还包括:In combination with any one of the second aspect, the first to the third possible implementation manners, the device further includes:
补偿单元,用于对所述图像进行光线补偿;a compensation unit, configured to perform light compensation on the image;
去噪单元,用于对所述图像去噪声。The denoising unit is used for denoising the image.
结合第四种可实现方式,在第五种可实现方式中,所述装置还包括:In combination with the fourth possible implementation, in the fifth possible implementation, the device further includes:
级联单元,用于将所述各个图像块的特征级联为所述图像的特征向量;a concatenation unit, configured to concatenate the features of each image block into a feature vector of the image;
识别单元,用于将所述图像的特征向量输入预设的分类器进行分类识别,所述分类器是提取图像数据库中多个图像的特征向量之后,将所述多个图像的特征向量训练得到的。The recognition unit is configured to input the feature vector of the image into a preset classifier for classification and recognition, the classifier is obtained by training the feature vectors of the multiple images after extracting the feature vectors of the multiple images in the image database of.
本发明实施例提供的图像特征提取方法和装置,先对当前采集的图像进行分块,得到该图像的各个图像块;再提取各个图像块的特征;其中,对于所划分的图像块,任意图像块与图像中除自身图像块之外的其它图像块中的至少一个图像块具有重叠区域。可以看出,采用本发明实施例方法分块图像,所得到的任意图像块都会与其它图像块具有重叠区域,如此,重叠区域的特征就会被多次提取;相应的,提取到的图像的特征就会增加,这些特征中包括的包含有效信息(需要识别的信息)的特征也随之增加,这样,更多的包含有效信息的特征在图像识别过程中,能够提高人脸识别的准确率。The image feature extraction method and device provided by the embodiments of the present invention first divide the currently collected image into blocks to obtain each image block of the image; then extract the features of each image block; wherein, for the divided image blocks, any image The block has an overlapping area with at least one image block of other image blocks in the image except its own image block. It can be seen that, by using the method of the embodiment of the present invention to block images, any obtained image block will have an overlapping area with other image blocks, so that the features of the overlapping area will be extracted multiple times; correspondingly, the extracted image The features will increase, and the features containing valid information (information that needs to be recognized) included in these features will also increase. In this way, more features containing valid information can improve the accuracy of face recognition in the image recognition process. .
附图说明Description of drawings
图1为本发明实施例提供的一种图像特征提取方法的流程图;Fig. 1 is the flowchart of a kind of image feature extraction method that the embodiment of the present invention provides;
图2为本发明实施例提供的原始图像的示意图;FIG. 2 is a schematic diagram of an original image provided by an embodiment of the present invention;
图3为本发明实施例提供的被分块的图像的示意图;FIG. 3 is a schematic diagram of a segmented image provided by an embodiment of the present invention;
图4为本发明实施例提供的分块后的两个图像块的示意图;Fig. 4 is a schematic diagram of two image blocks after block provided by an embodiment of the present invention;
图5为本发明实施例提供的一种图像特征提取方法的流程图;5 is a flow chart of an image feature extraction method provided by an embodiment of the present invention;
图6为本发明实施例提供的一幅灰度归一化处理后的人脸图像和对应的直方图;Fig. 6 is a face image and corresponding histogram after grayscale normalization processing provided by the embodiment of the present invention;
图7为本发明实施例提供的一幅中值滤波处理后的人脸图像和对应的直方图;Fig. 7 is a face image and corresponding histogram after median filter processing provided by the embodiment of the present invention;
图8为本发明实施例提供的一种图像特征提取装置的结构示意图;FIG. 8 is a schematic structural diagram of an image feature extraction device provided by an embodiment of the present invention;
图9为本发明实施例提供的另一种图像特征提取装置的结构示意图。FIG. 9 is a schematic structural diagram of another image feature extraction device provided by an embodiment of the present invention.
具体实施方式detailed description
支持向量机(Support Vector Machine,SVM)是统计学习理论中最年轻,也是最有用的部分,目前正处在不断发展的阶段。支持向量机是一种比较好地实现了结构风险最小化思想的方法,与传统的建立在经验风险最小化基础上的学习方法相比,它在解决非线性、高维的模式识别、回归估计和小样本问题中表现出许多特有的优势;而且,不存在局部最优的问题,成为机器学习领域备受关注的方法。该算法分为两个阶段:第一阶段,通过已知的正负样本的特征对标准支持向量机进行训练,找到样本中的支持向量,据此确定最优分类超平面;第二阶段,测试集样本根据最优分类面作出分类决策。Support Vector Machine (SVM) is the youngest and most useful part of statistical learning theory, and it is currently in a stage of continuous development. Support vector machine is a method that better realizes the idea of structural risk minimization. Compared with traditional learning methods based on empirical risk minimization, it can solve nonlinear, high-dimensional pattern recognition, regression estimation It shows many unique advantages in small sample and small sample problems; moreover, there is no local optimal problem, and it has become a method that has attracted much attention in the field of machine learning. The algorithm is divided into two stages: in the first stage, the standard support vector machine is trained through the known positive and negative sample characteristics, and the support vector in the sample is found, and the optimal classification hyperplane is determined accordingly; in the second stage, the test The classification decision is made according to the optimal classification surface of the set samples.
实施例一Embodiment one
本发明实施例提供一种图像特征提取方法,如图1所示,该方法可以包括:Embodiments of the present invention provide a method for extracting image features, as shown in Figure 1, the method may include:
步骤101、对图像进行分块,得到该图像的各个图像块,其中,任意图像块与该图像中除自身图像块之外的其它图像块中的至少一个图像块具有重叠区域。Step 101: Divide the image into blocks to obtain each image block of the image, wherein any image block has an overlapping area with at least one image block of other image blocks in the image except its own image block.
这里,本发明实施例提供的方法主要应用于面部特征的提取,需要提取特征的图像一般为面部图像,因此,在这类图像分块之前,可以预先将不含有面部信息的部分先裁剪掉,如图2所示,该图像包括人物的面部和上身,因此,该图像可以裁剪掉除人物的面部之外的部分,得到如图3所示的图片再进行分块,这样减少无用信息的特征产生。Here, the method provided by the embodiment of the present invention is mainly applied to the extraction of facial features, and the image that needs to extract features is generally a facial image. Therefore, before this type of image is divided into blocks, the part that does not contain facial information can be cut out in advance. As shown in Figure 2, the image includes the face and upper body of the person. Therefore, the image can be cut out except for the face of the person, and then the image shown in Figure 3 can be divided into blocks, so as to reduce the characteristics of useless information. produce.
对于大多数图像来说,图像的高度轴向就是图像中景物从上到下或者人物从头到脚步的方向,因此,步骤101可以包括:获取该图像的宽度和高度;获取采样窗口的宽度和高度,该采样窗口的宽度等于该图像的宽度,该采样窗口的高度小于或等于图像的高度;根据图像的高度、采样窗口的高度和预设的图像块之间的重叠高度,确定出该图像的采样数,该采样数满足:其中,该T是采样数,该H为该图像的高度,采样窗口的高度为L;重叠高度为P;根据预设的采样窗口和所述采样数,对图像按照图像的高度轴向进行采样,得到该图像的各个图像块。优选的,L的取值为[H/15,H/10]区间内的整数,P的取值为[L/5,L/3]区间内的整数。For most images, the height axis of the image is the direction from top to bottom of the scene in the image or the direction of the person from head to footsteps. Therefore, step 101 may include: obtaining the width and height of the image; obtaining the width and height of the sampling window , the width of the sampling window is equal to the width of the image, and the height of the sampling window is less than or equal to the height of the image; according to the height of the image, the height of the sampling window and the overlapping height between preset image blocks, determine the height of the image The number of samples, which satisfies: Wherein, the T is the sampling number, the H is the height of the image, the height of the sampling window is L; the overlapping height is P; according to the preset sampling window and the sampling number, the image is sampled according to the height axis of the image , to get each image block of the image. Preferably, the value of L is an integer in the interval [H/15, H/10], and the value of P is an integer in the interval [L/5, L/3].
示例的,假设图像是面部图像如图3所示,面部图像的H是48mm,L取4mm,P取1mm,T=(48-4)/(4-1)=15,因此,使用采样窗口按照面部图像的高度方向进行采样,得到采样结果,即部分的图像块如图4所示。For example, assume that the image is a facial image as shown in Figure 3, the H of the facial image is 48mm, the L is 4mm, the P is 1mm, T=(48-4)/(4-1)=15, therefore, use the sampling window Sampling is performed according to the height direction of the facial image to obtain a sampling result, that is, some image blocks are shown in FIG. 4 .
值得说明的是,本实施例中提供的分块方法不限于此,图像可以按照图像中的具体景物进行分块,以保证分块后的图像块能够最大限度的包括用于后续识别的特征,特别是对于人物图像,可以按照图像中人物从头到脚的方向进行分块,从而保证有效信息的提取。It is worth noting that the block division method provided in this embodiment is not limited to this, and the image can be divided into blocks according to specific scenes in the image, so as to ensure that the segmented image blocks can include features for subsequent recognition to the greatest extent. Especially for images of people, it can be divided into blocks according to the direction of the people in the image from head to toe, so as to ensure the extraction of effective information.
步骤102、提取各个图像块的特征。Step 102, extracting features of each image block.
这里,本发明提取的特征可以是代数特征,该代数特征包含对应图像块中的景物的信息,可用于后续图像识别。提取图像块特征的方法有很多种,可以包括傅立叶变换法、窗口傅立叶变换法、小波变换法、最小二乘法、边界方向直方图法等。Here, the feature extracted by the present invention may be an algebraic feature, which contains information about the scene in the corresponding image block, and can be used for subsequent image recognition. There are many methods for extracting image block features, including Fourier transform method, window Fourier transform method, wavelet transform method, least square method, boundary direction histogram method, etc.
本实施例优选的提取特征的方法是LBP纹理描述方法,相应的,提取到的特征是LBP直方图特征。LBP纹理描述方法可以具体包括:首先计算图像中每个像素与其局部邻域像素在灰度上的二值关系,然后对二值关系按一定规则加权形成像素的LBP码,最后根据该LBP码提取图像中各个子区域的LBP直方图序列作为图像的特征描述;提取得到的特征能够有效地保留人脸图像中的纹理信息。The preferred feature extraction method in this embodiment is the LBP texture description method, and correspondingly, the extracted features are LBP histogram features. The LBP texture description method may specifically include: first calculating the binary relationship between each pixel in the image and its local neighborhood pixels on the gray level, then weighting the binary relationship according to certain rules to form the LBP code of the pixel, and finally extracting The LBP histogram sequence of each sub-region in the image is used as the feature description of the image; the extracted features can effectively retain the texture information in the face image.
具体的,假设中心点像素为gc,建立一个以R为半径,采样点为P的纹理模型,采用最基本的3×3的矩阵的LBP算子,包含有9个灰度值,定义一个纹理特征T为gc到gp的P个像素点的联合概率分布,如下式所示:Specifically, assuming that the center point pixel is gc , a texture model with R as the radius and sampling points as P is established, and the most basic 3×3 matrix LBP operator is used, which contains 9 gray values, and a The texture feature T is the joint probability distribution ofP pixels from gc to gp, as shown in the following formula:
T=t(gc,g0,...,gn-1)T=t(gc ,g0 ,...,gn-1 )
相应的,一致LBPP定义为:Correspondingly, consistent LBPP is defined as:
其中,
这里,对分块后的图像块,提取一致LBP编码的特征向量,将该特征向量作为图像块的特征。Here, for the block-divided image block, the feature vector encoded by the consistent LBP is extracted, and the feature vector is used as the feature of the image block.
这样一来,采用本发明实施例的方法进行图像分块,所得到的任意图像块都会与其它图像块具有重叠区域,因此,重叠区域的特征就会被多次提取;相应的,提取到的图像的特征就会增加,这些特征中包括的包含有效信息(需要识别的信息)的特征也随之增加,这样,更多的包含有效信息的特征在图像识别过程中,能够提高人脸识别的准确率。In this way, using the method of the embodiment of the present invention to divide the image into blocks, any obtained image block will have an overlapping area with other image blocks, so the features of the overlapping area will be extracted multiple times; correspondingly, the extracted The features of the image will increase, and the features that contain effective information (information that needs to be recognized) included in these features will also increase. In this way, more features that contain effective information can improve the performance of face recognition in the process of image recognition. Accuracy.
进一步的,如图5所示,在步骤101之前,该方法还包括:Further, as shown in Figure 5, before step 101, the method also includes:
步骤100a、对图像进行光线补偿。Step 100a, perform light compensation on the image.
通常,光照补偿能够一定程度地克服光照变化的影响而提高识别率;一般的图像光线补偿都是通过灰度归一化实现的。现有的灰度归一化的方法有很多种,优选的灰度归一化方法是直方图均衡化法。直方图均衡化的原理是使各灰度级具有相同的出现概率,把图像的灰度范围拉开,并且让灰度频率大的灰度级间隔变大,使得灰度直方图在较大的动态范围内趋于一致。图6展示了一幅灰度归一化处理后的人脸图像和对应的直方图,图7展示了均衡化之后的人脸图像和其对应直方图。可以看出,经过直方图均衡化,可使图像的灰度分布范围尽可能覆盖所有的灰度级,没有占绝对优势或劣势的灰度范围,从而尽可能地减少光照的影响。Usually, lighting compensation can overcome the influence of lighting changes to a certain extent and improve the recognition rate; general image lighting compensation is realized through grayscale normalization. There are many existing methods for grayscale normalization, and the preferred method for grayscale normalization is the histogram equalization method. The principle of histogram equalization is to make each gray level have the same probability of occurrence, to widen the gray range of the image, and to make the gray level interval with high gray frequency larger, so that the gray histogram is in a larger range. The dynamic range tends to be consistent. Figure 6 shows a gray-scale normalized face image and the corresponding histogram, and Figure 7 shows the equalized face image and its corresponding histogram. It can be seen that after histogram equalization, the gray scale distribution range of the image can cover all the gray scale levels as much as possible, and there is no absolute dominant or inferior gray scale range, thereby reducing the influence of light as much as possible.
步骤100b、对图像去噪声。Step 100b, denoising the image.
现有最常应用的图像去噪声方法是中值滤波。中值滤波是一种非线性平滑技术,它将每一像素点的灰度值设置为该点某邻域窗口内的所有像素点灰度值的中值,从而抑制图像的噪声。The most commonly used image denoising method is the median filter. Median filtering is a nonlinear smoothing technique, which sets the gray value of each pixel to the median value of all pixels in a certain neighborhood window of the point, thereby suppressing the noise of the image.
进一步的,如图5所示,在步骤102之后,该方法还包括:Further, as shown in FIG. 5, after step 102, the method further includes:
步骤103、将各个图像块的特征级联为图像的特征向量。Step 103, concatenating the features of each image block into a feature vector of the image.
这里,所述图像的特征向量表示着各个图像块的特征总和,特征向量将作为被识别的对象;例如,可以将各个图像块的特征Z0,Z1,……,Zn,n是大于1的整数,组成特征向量Z=(Z0,Z1,……,Zn)。Here, the feature vector of the image represents the sum of the features of each image block, and the feature vector will be used as the object to be identified; for example, the feature Z0, Z1, ..., Zn, n of each image block can be an integer greater than 1 , forming a feature vector Z=(Z0, Z1, . . . , Zn).
步骤104、将图像的特征向量输入预设的分类器进行分类识别,该分类器是提取图像数据库中多个图像的特征向量之后,将该多个图像的特征向量训练得到的。Step 104: Input the feature vector of the image into a preset classifier for classification and recognition. The classifier is obtained by training the feature vectors of the multiple images after extracting the feature vectors of the multiple images in the image database.
这里,分类器提取多个图像的特征向量的方法可以与本实施例中提取特征的方法完全相同;分类器可以包括:选择分类器和基于分块LBP+SVM分类器。Here, the method for the classifier to extract feature vectors of multiple images may be exactly the same as the method for extracting features in this embodiment; the classifier may include: a selection classifier and a block-based LBP+SVM classifier.
其中,选择分类器是在样本训练的基础上确定某个判决规则,按这种判决规则对被识别对象进行分类。下面对几种常用的分类器作简单介绍。Among them, selecting a classifier is to determine a certain judgment rule on the basis of sample training, and classify the recognized object according to this judgment rule. The following is a brief introduction to several commonly used classifiers.
第一种是最小距离分类器,最小距离分类器的距离分类准则是以特征空间中各点间的距离作为样本相似度量,并以各类训练样本点的集合所构成的区域表示各决策区,空间中两点距离越近,认为两样本越相似。The first is the minimum distance classifier. The distance classification criterion of the minimum distance classifier is to use the distance between points in the feature space as the sample similarity measure, and to represent each decision area by the area formed by the collection of various training sample points. The closer the distance between two points in the space is, the more similar the two samples are considered.
当采用距离方式对特征空间中的样本进行分类时,最“自然”的一种距离就是欧几里德距离(欧式距离)。在一些分类问题中,欧式距离对于衡量样本间的相似性是比较方便和有效的。其中,欧氏距离为应用最小距离分类器分类时,计算样本X到每类训练样本的均值向量(即该类的中心)mi的欧氏距离di。确定出最小欧氏距离的训练样本。When using the distance method to classify samples in the feature space, the most "natural" distance is the Euclidean distance (Euclidean distance). In some classification problems, Euclidean distance is more convenient and effective for measuring the similarity between samples. Among them, the Euclidean distance is When using the minimum distance classifier for classification, calculate the Euclidean distance di from the sample X to the mean vector (ie the center of the class) mi of each class of training samples. Determine the training samples with the minimum Euclidean distance.
第二种是最近邻分类器。在人脸识别中,最近邻分类器是一种简单有效的分类器,也是使用最多的分类器。其直观概念就是根据某种距离准则比较未知类别的测试样本和已知类别的样本之间的距离,决策为测试样本与离它最近的样本同类。The second is the nearest neighbor classifier. In face recognition, the nearest neighbor classifier is a simple and effective classifier, and it is also the most used classifier. Its intuitive concept is to compare the distance between the test samples of the unknown category and the samples of the known category according to a certain distance criterion, and the decision is that the test sample is the same as the nearest sample.
第三种是最大相关分类器。具体的,计算样本X到每类训练样本的均值向量计算样本X到每类训练样本的均值向量(即该类的中心)mi,相关系数pi,并The third is the maximum correlation classifier. Specifically, calculate the mean vector from sample X to each type of training sample, calculate the mean vector (ie the center of the class) mi from sample X to each type of training sample, the correlation coefficient pi , and
按相关系数最大进行分类
示例的,假设进行人脸的表情/年龄/身份的识别,若选择上述任意一种简单分类器,过程具体如下:首先将训练图集送入人脸特征提取模块中,得到所需的人脸特征向量,再将得到的特征以及相应的标记送入训练模块中,经过训练得到最终的人脸表情/年龄/身份的分类器,完成训练过程。For example, assuming facial expression/age/identity recognition, if any of the above simple classifiers is selected, the process is as follows: first, the training atlas is sent to the face feature extraction module to obtain the required face The feature vector, and then the obtained features and corresponding tags are sent to the training module, and the final classifier of facial expression/age/identity is obtained after training, and the training process is completed.
基于分块LBP+SVM分类器可以包括:从人脸性别数据库中随机地选取人脸图像,提取得到相应的特征向量,再用这些特征向量训练得到SVM分类器。The block-based LBP+SVM classifier may include: randomly selecting face images from the face gender database, extracting corresponding feature vectors, and then using these feature vectors to train an SVM classifier.
具体的,标准支持向量机对正负样本分类的训练生成分块LBP+SVM分类器可以包括如下几个步骤:Specifically, the training of the standard support vector machine for classifying positive and negative samples to generate a block LBP+SVM classifier may include the following steps:
(1)建立训练样本集{xi,yi},i=1,2,...n,x∈Rd,y∈{1,-1}。(1) Establish a training sample set {xi , yi }, i=1, 2,...n, x∈Rd , y∈{1,-1}.
(2)选择核函数K(x,xi)及参数,将低维空间向高维空间变换。(2) Select the kernel function K(x,xi ) and parameters to transform the low-dimensional space to the high-dimensional space.
(3)输入样本正规化,将xi K(x,x')规定在{-1,1}内。(3) The input samples are normalized, and xi K(x, x') is specified within {-1, 1}.
(4)构造核矩阵H{n,n},n为正整数。(4) Construct a kernel matrix H{n,n}, where n is a positive integer.
(5)求解拉格朗日系数αi。(5) Solve the Lagrangian coefficient αi .
约束条件为
目标函数为
(6)找出支持向量,求解分类超平面系数。(6) Find out the support vectors and solve the classification hyperplane coefficients.
(7)根据求得的各类系数,建立训练数据的最优分类超平面,完成训练过程。(7) According to the obtained various coefficients, establish the optimal classification hyperplane of the training data, and complete the training process.
相应的,识别特征向量又可以包括以下几个步骤:Correspondingly, identifying feature vectors may include the following steps:
(1)读入学习阶段训练得到的模板数据文件。(1) Read in the template data file trained in the learning phase.
(2)根据f(x')=∑yiαiK(xi,x')-b,计算新输入特征数据x'的输出值。(2) According to f(x')=∑yi αi K(xi ,x')-b, calculate the output value of the new input feature data x'.
(3)利用分类函数将f(x')归为{-1,1},作出分类结果。(3) Use the classification function to classify f(x') as {-1,1}, and make a classification result.
与传统的人脸性别识别方法相比,本文的方法由于提取了LBP特征充分利用了人脸的纹理信息,同时借助SVM分类器有效地区分了男女差异,故而可以达到更好的识别效果。Compared with the traditional face gender recognition method, the method in this paper can achieve a better recognition effect because it extracts the LBP feature and makes full use of the texture information of the face, and at the same time, it can effectively distinguish the difference between men and women with the help of the SVM classifier.
实施例二Embodiment two
本发明实施例提供一种图像特征提取装置20,如图8所示,该装置20可以包括:An embodiment of the present invention provides an image feature extraction device 20, as shown in Figure 8, the device 20 may include:
分块单元201,用于对图像进行分块,得到所述图像的各个图像块,其中,任意图像块与所述图像中除自身图像块之外的其它图像块中的至少一个图像块具有重叠区域。Blocking unit 201, configured to block the image to obtain each image block of the image, wherein any image block overlaps with at least one image block of other image blocks in the image except its own image block area.
提取单元202,用于提取所述各个图像块的特征。The extraction unit 202 is configured to extract features of the respective image blocks.
这样一来,采用本发明实施例的方法进行图像分块,所得到的任意图像块都会与其它图像块具有重叠区域,因此,重叠区域的特征就会被多次提取;相应的,提取到的图像的特征就会增加,这些特征中包括的包含有效信息(需要识别的信息)的特征也随之增加,这样,更多的包含有效信息的特征在图像识别过程中,能够提高人脸识别的准确率。In this way, using the method of the embodiment of the present invention to divide the image into blocks, any obtained image block will have an overlapping area with other image blocks, so the features of the overlapping area will be extracted multiple times; correspondingly, the extracted The features of the image will increase, and the features that contain effective information (information that needs to be recognized) included in these features will also increase. In this way, more features that contain effective information can improve the performance of face recognition in the process of image recognition. Accuracy.
具体的,所述分块单元201具体用于:Specifically, the blocking unit 201 is specifically used for:
获取所述图像的宽度和高度;Get the width and height of said image;
获取采样窗口的宽度和高度,所述采样窗口的宽度等于所述图像的宽度,所述采样窗口的高度小于或等于所述图像的高度;Obtain the width and height of the sampling window, the width of the sampling window is equal to the width of the image, and the height of the sampling window is less than or equal to the height of the image;
根据所述图像的高度、所述采样窗口的高度和预设的图像块之间的重叠高度,确定出所述图像的采样数,所述采样数满足:According to the height of the image, the height of the sampling window and the preset overlapping height between the image blocks, the sampling number of the image is determined, and the sampling number satisfies:
其中,所述T是采样数,所述H为所述图像的高度,采样窗口的高度为L;重叠高度为P;Wherein, the T is the number of samples, the H is the height of the image, the height of the sampling window is L; the overlapping height is P;
根据预设的采样窗口和采样数,对所述图像按照所述图像的高度轴向进行采样,得到所述图像的各个图像块。According to the preset sampling window and sampling number, the image is axially sampled according to the height of the image to obtain each image block of the image.
优选的,所述L的取值为[H/15,H/10]区间内的整数,所述P的取值为[L/5,L/3]区间内的整数。Preferably, the value of L is an integer in the interval [H/15, H/10], and the value of P is an integer in the interval [L/5, L/3].
具体的,所述提取单元202具体用于:Specifically, the extracting unit 202 is specifically used for:
根据LBP纹理描述方法,提取所述各个图像块的LBP直方图特征。According to the LBP texture description method, the LBP histogram features of each image block are extracted.
进一步的,如图9所示,所述装置20还包括:Further, as shown in FIG. 9, the device 20 also includes:
补偿单元203,用于对所述图像进行光线补偿。The compensation unit 203 is configured to perform light compensation on the image.
去噪单元204,用于对所述图像去噪声。A denoising unit 204, configured to denoise the image.
进一步的,如图9所示,所述装置20还包括:Further, as shown in FIG. 9, the device 20 also includes:
级联单元205,用于将所述各个图像块的特征级联为所述图像的特征向量。A concatenation unit 205, configured to concatenate the features of each image block into a feature vector of the image.
识别单元206,用于将所述图像的特征向量输入预设的分类器进行分类识别,所述分类器是提取图像数据库中多个图像的特征向量之后,将所述多个图像的特征向量训练得到的。The recognition unit 206 is configured to input the feature vectors of the images into a preset classifier for classification and recognition, the classifier is to train the feature vectors of the multiple images after extracting the feature vectors of the multiple images in the image database owned.
在实际应用中,所述分块单元201、提取单元202、补偿单元203、去噪单元204、级联单元205和识别单元206均可由位于终端中的中央处理器(CentralProcessing Unit,CPU)、微处理器(Micro Processor Unit,MPU)、数字信号处理器(Digital Signal Processor,DSP)、或现场可编程门阵列(FieldProgrammable Gate Array,FPGA)等实现。In practical applications, the block unit 201, the extraction unit 202, the compensation unit 203, the denoising unit 204, the concatenation unit 205 and the recognition unit 206 can all be controlled by a central processing unit (Central Processing Unit, CPU), micro Processor (Micro Processor Unit, MPU), digital signal processor (Digital Signal Processor, DSP), or Field Programmable Gate Array (Field Programmable Gate Array, FPGA) and other implementations.
以上所述,仅为本发明的较佳实施例而已,并非用于限定本发明的保护范围。The above descriptions are only preferred embodiments of the present invention, and are not intended to limit the protection scope of the present invention.
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201510304685.3ACN106295478A (en) | 2015-06-04 | 2015-06-04 | A kind of image characteristic extracting method and device |
| PCT/CN2015/087782WO2016192213A1 (en) | 2015-06-04 | 2015-08-21 | Image feature extraction method and device, and storage medium |
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201510304685.3ACN106295478A (en) | 2015-06-04 | 2015-06-04 | A kind of image characteristic extracting method and device |
| Publication Number | Publication Date |
|---|---|
| CN106295478Atrue CN106295478A (en) | 2017-01-04 |
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN201510304685.3AWithdrawnCN106295478A (en) | 2015-06-04 | 2015-06-04 | A kind of image characteristic extracting method and device |
| Country | Link |
|---|---|
| CN (1) | CN106295478A (en) |
| WO (1) | WO2016192213A1 (en) |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN109493424A (en)* | 2018-11-07 | 2019-03-19 | 绍兴文理学院 | The all standing sampling method of structural plane 3 d surface topography |
| CN111161140A (en)* | 2018-11-08 | 2020-05-15 | 银河水滴科技(北京)有限公司 | Method and device for correcting distorted image |
| CN113055677A (en)* | 2021-04-07 | 2021-06-29 | 南京云格信息技术有限公司 | Image compression method based on FPGA |
| CN114882512A (en)* | 2022-05-27 | 2022-08-09 | 圣码智能科技(深圳)有限公司 | Handwritten mathematical formula recognition method, system, equipment and storage medium |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN108009530B (en)* | 2017-12-27 | 2024-02-20 | 欧普照明股份有限公司 | Identity calibration system and method |
| CN114663687B (en)* | 2022-03-15 | 2025-05-23 | 北京京东尚科信息技术有限公司 | Model training method, target recognition method, device, equipment and storage medium |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN1900970A (en)* | 2006-07-20 | 2007-01-24 | 中山大学 | Image zone duplicating and altering detecting method of robust |
| US20080253661A1 (en)* | 2007-04-12 | 2008-10-16 | Canon Kabushiki Kaisha | Image processing apparatus and control method thereof |
| CN101615290A (en)* | 2009-07-29 | 2009-12-30 | 西安交通大学 | A face image super-resolution reconstruction method based on canonical correlation analysis |
| CN101853304A (en)* | 2010-06-08 | 2010-10-06 | 河海大学 | Remote Sensing Image Retrieval Method Based on Feature Selection and Semi-Supervised Learning |
| CN101923721A (en)* | 2010-08-31 | 2010-12-22 | 汉王科技股份有限公司 | Non-illumination face image reconstruction method and system |
| CN101930608A (en)* | 2010-08-26 | 2010-12-29 | 北京交通大学 | Method and system for blind detection of tampered images |
| CN102254303A (en)* | 2011-06-13 | 2011-11-23 | 河海大学 | Methods for segmenting and searching remote sensing image |
| CN102609891A (en)* | 2012-01-12 | 2012-07-25 | 合肥工业大学 | Texture-characteristic-based method for passively and blindly obtaining evidence of digital image |
| CN102968626A (en)* | 2012-12-19 | 2013-03-13 | 中国电子科技集团公司第三研究所 | Human face image matching method |
| CN103049897A (en)* | 2013-01-24 | 2013-04-17 | 武汉大学 | Adaptive training library-based block domain face super-resolution reconstruction method |
| CN104318216A (en)* | 2014-10-28 | 2015-01-28 | 宁波大学 | Method for recognizing and matching pedestrian targets across blind area in video surveillance |
| CN104408482A (en)* | 2014-12-08 | 2015-03-11 | 电子科技大学 | Detecting method for high-resolution SAR (Synthetic Aperture Radar) image object |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN1900970A (en)* | 2006-07-20 | 2007-01-24 | 中山大学 | Image zone duplicating and altering detecting method of robust |
| US20080253661A1 (en)* | 2007-04-12 | 2008-10-16 | Canon Kabushiki Kaisha | Image processing apparatus and control method thereof |
| CN101615290A (en)* | 2009-07-29 | 2009-12-30 | 西安交通大学 | A face image super-resolution reconstruction method based on canonical correlation analysis |
| CN101853304A (en)* | 2010-06-08 | 2010-10-06 | 河海大学 | Remote Sensing Image Retrieval Method Based on Feature Selection and Semi-Supervised Learning |
| CN101930608A (en)* | 2010-08-26 | 2010-12-29 | 北京交通大学 | Method and system for blind detection of tampered images |
| CN101923721A (en)* | 2010-08-31 | 2010-12-22 | 汉王科技股份有限公司 | Non-illumination face image reconstruction method and system |
| CN102254303A (en)* | 2011-06-13 | 2011-11-23 | 河海大学 | Methods for segmenting and searching remote sensing image |
| CN102609891A (en)* | 2012-01-12 | 2012-07-25 | 合肥工业大学 | Texture-characteristic-based method for passively and blindly obtaining evidence of digital image |
| CN102968626A (en)* | 2012-12-19 | 2013-03-13 | 中国电子科技集团公司第三研究所 | Human face image matching method |
| CN103049897A (en)* | 2013-01-24 | 2013-04-17 | 武汉大学 | Adaptive training library-based block domain face super-resolution reconstruction method |
| CN104318216A (en)* | 2014-10-28 | 2015-01-28 | 宁波大学 | Method for recognizing and matching pedestrian targets across blind area in video surveillance |
| CN104408482A (en)* | 2014-12-08 | 2015-03-11 | 电子科技大学 | Detecting method for high-resolution SAR (Synthetic Aperture Radar) image object |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN109493424A (en)* | 2018-11-07 | 2019-03-19 | 绍兴文理学院 | The all standing sampling method of structural plane 3 d surface topography |
| CN111161140A (en)* | 2018-11-08 | 2020-05-15 | 银河水滴科技(北京)有限公司 | Method and device for correcting distorted image |
| CN111161140B (en)* | 2018-11-08 | 2023-09-19 | 银河水滴科技(北京)有限公司 | Distortion image correction method and device |
| CN113055677A (en)* | 2021-04-07 | 2021-06-29 | 南京云格信息技术有限公司 | Image compression method based on FPGA |
| CN114882512A (en)* | 2022-05-27 | 2022-08-09 | 圣码智能科技(深圳)有限公司 | Handwritten mathematical formula recognition method, system, equipment and storage medium |
| Publication number | Publication date |
|---|---|
| WO2016192213A1 (en) | 2016-12-08 |
| Publication | Publication Date | Title |
|---|---|---|
| Sankaran et al. | Adaptive latent fingerprint segmentation using feature selection and random decision forest classification | |
| CN106446952B (en) | A kind of musical score image recognition methods and device | |
| Gnanasivam et al. | Fingerprint gender classification using wavelet transform and singular value decomposition | |
| CN112597812A (en) | Finger vein identification method and system based on convolutional neural network and SIFT algorithm | |
| CN106295478A (en) | A kind of image characteristic extracting method and device | |
| CN107729820B (en) | A Finger Vein Recognition Method Based on Multi-scale HOG | |
| CN101162503A (en) | Method for extracting and recognizing human ear characteristic by improved Hausdorff distance | |
| CN104966085A (en) | Remote sensing image region-of-interest detection method based on multi-significant-feature fusion | |
| CN103093215A (en) | Eye location method and device | |
| CN102542243A (en) | LBP (Local Binary Pattern) image and block encoding-based iris feature extracting method | |
| CN103839033A (en) | Face identification method based on fuzzy rule | |
| CN103971122B (en) | Three-dimensional face based on depth image describes method | |
| Faudzi et al. | Evaluation of LBP-based face recognition techniques | |
| CN106096517A (en) | A kind of face identification method based on low-rank matrix Yu eigenface | |
| CN110008920A (en) | Research on facial expression recognition method | |
| CN104915626A (en) | Face identification method and apparatus | |
| CN105631441A (en) | Human face recognition method | |
| CN112070116B (en) | A system and method for automatic classification of art paintings based on support vector machines | |
| CN103246877B (en) | Based on the recognition of face novel method of image outline | |
| CN107563319A (en) | Face similarity measurement computational methods between a kind of parent-offspring based on image | |
| CN108197577B (en) | Finger vein image feature extraction method combining Sobel and MFRAT | |
| CN106709442B (en) | Face recognition method | |
| Singh et al. | Implementation and evaluation of DWT and MFCC based ISL gesture recognition | |
| Houtinezhad et al. | Off-line signature verification system using features linear mapping in the candidate points | |
| Angadi et al. | User identification using wavelet features of hand geometry graph |
| Date | Code | Title | Description |
|---|---|---|---|
| C06 | Publication | ||
| PB01 | Publication | ||
| C10 | Entry into substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| WW01 | Invention patent application withdrawn after publication | ||
| WW01 | Invention patent application withdrawn after publication | Application publication date:20170104 |