[go: up one dir, main page]

CN107506738A - Feature extracting method, image-recognizing method, device and electronic equipment - Google Patents

Feature extracting method, image-recognizing method, device and electronic equipment Download PDF

Info

Publication number
CN107506738A
CN107506738A CN201710766531.5A CN201710766531A CN107506738A CN 107506738 A CN107506738 A CN 107506738A CN 201710766531 A CN201710766531 A CN 201710766531A CN 107506738 A CN107506738 A CN 107506738A
Authority
CN
China
Prior art keywords
image
target image
color
region
characteristic vector
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201710766531.5A
Other languages
Chinese (zh)
Inventor
杨茜
牟永强
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Intellifusion Technologies Co Ltd
Original Assignee
Shenzhen Intellifusion Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Intellifusion Technologies Co Ltd filed Critical Shenzhen Intellifusion Technologies Co Ltd
Priority to CN201710766531.5A priority Critical patent/CN107506738A/en
Publication of CN107506738A publication Critical patent/CN107506738A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/10Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
    • G06V40/103Static body considered as a whole, e.g. static pedestrian or occupant recognition
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/213Feature extraction, e.g. by transforming the feature space; Summarisation; Mappings, e.g. subspace methods
    • G06F18/2135Feature extraction, e.g. by transforming the feature space; Summarisation; Mappings, e.g. subspace methods based on approximation criteria, e.g. principal component analysis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/40Extraction of image or video features
    • G06V10/50Extraction of image or video features by performing operations within image blocks; by using histograms, e.g. histogram of oriented gradients [HoG]; by summing image-intensity values; Projection analysis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/40Extraction of image or video features
    • G06V10/56Extraction of image or video features relating to colour
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/74Image or video pattern matching; Proximity measures in feature spaces
    • G06V10/75Organisation of the matching processes, e.g. simultaneous or sequential comparisons of image or video features; Coarse-fine approaches, e.g. multi-scale approaches; using context analysis; Selection of dictionaries
    • G06V10/757Matching configurations of points or features

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Multimedia (AREA)
  • Data Mining & Analysis (AREA)
  • Artificial Intelligence (AREA)
  • Evolutionary Computation (AREA)
  • General Engineering & Computer Science (AREA)
  • Evolutionary Biology (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Human Computer Interaction (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Computing Systems (AREA)
  • Databases & Information Systems (AREA)
  • General Health & Medical Sciences (AREA)
  • Medical Informatics (AREA)
  • Software Systems (AREA)
  • Image Analysis (AREA)

Abstract

A kind of feature extracting method, methods described include:Obtain target image;The target image is divided at least two regions according to the upright direction of personage in the target image;Extract color information of each region in multiple color spaces;The color information of the multiple color spaces extracted from least two region is combined, obtains representing the assemblage characteristic vector of the target image.The present invention also provides a kind of feature deriving means, image-recognizing method and device, electronic equipment.The present invention can extract the feature of image exactly and carry out image recognition and tracking using this feature.

Description

特征提取方法、图像识别方法、装置及电子设备Feature extraction method, image recognition method, device and electronic equipment

技术领域technical field

本发明涉及图像处理技术领域,具体涉及一种特征提取方法、图像识别方法、装置及电子设备。The invention relates to the technical field of image processing, in particular to a feature extraction method, an image recognition method, a device and electronic equipment.

背景技术Background technique

随着计算机技术的发展,图像处理技术的应用越来越多,例如通过图像识别技术来识别人脸、通过图像追踪技术来对人物进行追踪等这其中就需要对人物进行识别。而在人物识别中,人体的姿态和动作常常有很大变化,因此许多特征不能使用。特征提取是图像处理技术的重要技术环节,具体的,特征提取使用计算机提取图像信息,为进一步处理图像(如图像匹配、图像追踪、人物识别等)提供基础。若特征提取的不够完整、充分及不准确则无法有效的传递图像的信息,对后续的图像处理工作产生影响,例如降低后续的图像识别、图像追踪的准确性和效率。因此,亟需一种准确地提取图像的特征的方法。With the development of computer technology, there are more and more applications of image processing technology, such as recognizing faces through image recognition technology, tracking people through image tracking technology, etc. Among them, people need to be recognized. However, in character recognition, the posture and movement of the human body often change greatly, so many features cannot be used. Feature extraction is an important technical link of image processing technology. Specifically, feature extraction uses a computer to extract image information to provide a basis for further image processing (such as image matching, image tracking, and person recognition, etc.). If the feature extraction is not complete, sufficient and inaccurate, the information of the image cannot be effectively transmitted, which will affect the subsequent image processing work, such as reducing the accuracy and efficiency of subsequent image recognition and image tracking. Therefore, there is an urgent need for a method for accurately extracting features of an image.

发明内容Contents of the invention

鉴于此,有必要提供一种特征提取方法、图像识别方法、装置及电子设备,可准确地提取图像的特征及利用该特征进行图像识别和跟踪。In view of this, it is necessary to provide a feature extraction method, image recognition method, device and electronic equipment, which can accurately extract image features and utilize the features for image recognition and tracking.

本发明一方面提供了一种特征提取方法,所述特征提取方法包括:One aspect of the present invention provides a feature extraction method, the feature extraction method comprising:

获取目标图像;Get the target image;

按照所述目标图像中人物直立的方向将所述目标图像划分为至少两个区域;dividing the target image into at least two regions according to the upright direction of the person in the target image;

提取每个区域在多个颜色空间的色彩信息;Extract color information of each region in multiple color spaces;

将从所述至少两个区域中提取到的多个颜色空间的色彩信息组合,得到表示所述目标图像的组合特征向量。Combining the color information of multiple color spaces extracted from the at least two regions to obtain a combined feature vector representing the target image.

在一种可能的实现方式中,所述提取每个区域在多个颜色空间的色彩信息包括:In a possible implementation manner, the extracting the color information of each region in multiple color spaces includes:

根据颜色直方图提取每个区域在多个颜色空间中各个颜色维度的信息并用特征向量进行表示。According to the color histogram, the information of each color dimension of each region in multiple color spaces is extracted and represented by a feature vector.

在一种可能的实现方式中,所述将从所述至少两个区域中提取到的多个颜色空间的色彩信息组合,得到表示所述目标图像的组合特征向量包括:In a possible implementation manner, the combining the color information of multiple color spaces extracted from the at least two regions to obtain the combined feature vector representing the target image includes:

将每个区域在每个颜色空间的各个颜色维度的信息组合,得到每个区域中各个颜色空间的组合特征向量;Combining the information of each color dimension of each region in each color space to obtain the combined feature vector of each color space in each region;

将所述每个区域中各个颜色空间的组合特征向量进行拼接,得到每个区域在多个颜色空间的组合特征向量;splicing the combined eigenvectors of each color space in each region to obtain the combined eigenvectors of each region in multiple color spaces;

将所述每个区域在多个颜色空间的组合特征向量进行拼接,得到所述目标图像在所述至少两个区域的多个颜色空间的组合特征向量。The combined feature vectors of each area in multiple color spaces are spliced to obtain combined feature vectors of the target image in multiple color spaces of the at least two areas.

在一种可能的实现方式中,所述特征提取方法还包括:In a possible implementation manner, the feature extraction method further includes:

对所述表示所述目标图像的组合特征向量进行降维处理。performing dimensionality reduction processing on the combined feature vector representing the target image.

本发明另一方面还提供了一种图像识别方法,所述图像识别方法包括:Another aspect of the present invention also provides an image recognition method, the image recognition method comprising:

获取目标图像;Get the target image;

按照所述目标图像中人物直立的方向将所述目标图像划分为至少两个区域;dividing the target image into at least two regions according to the upright direction of the person in the target image;

提取每个区域在多个颜色空间的色彩信息;Extract color information of each region in multiple color spaces;

将从所述至少两个区域中提取到的多个颜色空间的色彩信息组合,得到表示所述目标图像的组合特征向量;combining the color information of multiple color spaces extracted from the at least two regions to obtain a combined feature vector representing the target image;

计算所述表示所述目标图像的组合特征向量与图像库中样本图像的特征向量之间的距离以判断目标图像与所述图像库中样本图像之间的相似性;calculating the distance between the combined feature vector representing the target image and the feature vector of the sample image in the image library to judge the similarity between the target image and the sample image in the image library;

选取所述图像库中与所述目标图像的相似性最高的样本图像为图像识别结果;Selecting the sample image with the highest similarity to the target image in the image library as the image recognition result;

根据所述图像识别结果对所述目标图像进行跟踪。The target image is tracked according to the image recognition result.

在一种可能的实现方式中,在所述计算所述表示所述目标图像的组合特征向量与图像库中样本图像的特征向量之间的距离以判断目标图像与所述图像库中样本图像之间的相似性之前还包括:In a possible implementation manner, the distance between the combined feature vector representing the target image and the feature vector of the sample image in the image library is calculated to determine the distance between the target image and the sample image in the image library. The similarities between previously also include:

对所述表示所述目标图像的组合特征向量进行降维处理。performing dimensionality reduction processing on the combined feature vector representing the target image.

本发明另一方面还提供了一种特征提取装置,所述装置包括:Another aspect of the present invention also provides a feature extraction device, which includes:

获取模块,用于获取目标图像;An acquisition module, configured to acquire a target image;

区域划分模块,用于按照所述目标图像中人物直立的方向将所述目标图像划分为至少两个区域;An area division module, configured to divide the target image into at least two areas according to the upright direction of the person in the target image;

多颜色空间处理模块,用于提取每个区域在多个颜色空间的色彩信息;A multi-color space processing module, used to extract color information of each region in multiple color spaces;

特征表达模块,用于将从所述至少两个区域中提取到的多个颜色空间的色彩信息组合,得到表示所述目标图像的组合特征向量。A feature expression module, configured to combine the color information of multiple color spaces extracted from the at least two regions to obtain a combined feature vector representing the target image.

在一种可能的实现方式中,所述多颜色空间处理模块具体用于:根据颜色直方图提取每个区域在多个颜色空间中各个颜色维度的信息并用特征向量进行表示。In a possible implementation manner, the multi-color space processing module is specifically configured to: extract information of each color dimension of each region in multiple color spaces according to the color histogram and represent it with a feature vector.

在一种可能的实现方式中,所述特征表达模块具体用于:In a possible implementation manner, the feature expression module is specifically used for:

将每个区域在每个颜色空间的各个颜色维度的信息组合,得到每个区域中各个颜色空间的组合特征向量;Combining the information of each color dimension of each region in each color space to obtain the combined feature vector of each color space in each region;

将所述每个区域中各个颜色空间的组合特征向量进行拼接,得到每个区域在多个颜色空间的组合特征向量;splicing the combined eigenvectors of each color space in each region to obtain the combined eigenvectors of each region in multiple color spaces;

将所述每个区域在多个颜色空间的组合特征向量进行拼接,得到所述目标图像在所述至少两个区域的多个颜色空间的组合特征向量。The combined feature vectors of each area in multiple color spaces are spliced to obtain combined feature vectors of the target image in multiple color spaces of the at least two areas.

在一种可能的实现方式中,所述特征提取装置还包括:In a possible implementation manner, the feature extraction device further includes:

降维模块,用于对所述表示所述目标图像的组合特征向量进行降维处理。A dimensionality reduction module, configured to perform dimensionality reduction processing on the combined feature vector representing the target image.

本发明又一方面还提供了一种图像识别装置,所述装置包括:Another aspect of the present invention also provides an image recognition device, the device comprising:

获取模块,用于获取目标图像;An acquisition module, configured to acquire a target image;

区域划分模块,用于按照所述目标图像中人物直立的方向将所述目标图像划分为至少两个区域;An area division module, configured to divide the target image into at least two areas according to the upright direction of the person in the target image;

多颜色空间处理模块,用于提取每个区域在多个颜色空间的色彩信息;A multi-color space processing module, used to extract color information of each region in multiple color spaces;

特征表达模块,用于将从所述至少两个区域中提取到的多个颜色空间的色彩信息组合,得到表示所述目标图像的组合特征向量;A feature expression module, configured to combine the color information of multiple color spaces extracted from the at least two regions to obtain a combined feature vector representing the target image;

图像识别模块,用于计算所述表示所述目标图像的降维后的组合特征向量与图像库中样本图像的特征向量之间的距离以判断图像之间的相似性,选取所述图像库中与所述目标图像的相似性最高的样本图像为图像识别结果,根据所述图像识别结果对所述目标图像进行跟踪。The image recognition module is used to calculate the distance between the combined feature vector representing the dimensionality reduction of the target image and the feature vector of the sample image in the image library to judge the similarity between the images, and select the image in the image library The sample image with the highest similarity to the target image is an image recognition result, and the target image is tracked according to the image recognition result.

在一种可能的实现方式中,所述图像识别装置还包括:In a possible implementation manner, the image recognition device further includes:

降维模块,用于对表示所述目标图像的组合特征向量进行降维处理。A dimensionality reduction module, configured to perform dimensionality reduction processing on the combined feature vector representing the target image.

本发明再一方面还提供一种电子设备,所述电子设备包括存储器和处理器,所述存储器用于存储至少一个指令,所述处理器用于执行存储器中存储的程序时实现上述特征提取方法和/上述图像识别方法。Another aspect of the present invention also provides an electronic device, the electronic device includes a memory and a processor, the memory is used to store at least one instruction, and the processor is used to implement the above feature extraction method and method when executing a program stored in the memory. / above image recognition method.

由以上技术方案,本发明中,电子设备可以获取目标图像;按照所述目标图像中人物直立的方向将所述目标图像划分为至少两个区域;提取每个区域在多个颜色空间的色彩信息;将从所述至少两个区域中提取到的多个颜色空间的色彩信息组合,得到表示所述目标图像的组合特征向量。通过将目标图像划分区域,并在每个区域的多颜色空间提取色彩信息,从多个维度对图像的色彩进行了表达,充分体现了图像不同部分的特征及颜色分布,使得无论在何种光照条件下的图像都可以准确的表示图像。通过多区域及多颜色空间进行特征提取从而实现了准确地提取图像的特征的目的。From the above technical solution, in the present invention, the electronic device can acquire the target image; divide the target image into at least two regions according to the direction in which the person stands upright in the target image; extract the color information of each region in multiple color spaces ; Combining the color information of multiple color spaces extracted from the at least two regions to obtain a combined feature vector representing the target image. By dividing the target image into regions and extracting color information in the multi-color space of each region, the color of the image is expressed from multiple dimensions, fully reflecting the characteristics and color distribution of different parts of the image, so that no matter what kind of lighting The image under the conditions can accurately represent the image. The purpose of extracting the features of the image is realized accurately through the feature extraction of multiple regions and multiple color spaces.

本发明采用目标图像中人物直立的方向划分图像的空间区域的方法,在每个区域中,分别提取多个颜色空间的色彩信息,将每个颜色空间的三维直方图拼接为单维,再连接该区域不同颜色空间的直方图,以及连接所有区域的直方图获得多区域多颜色空间的组合特征向量,从而克服了在目标对象的跟踪识别中的局限性,增加颜色空间特征的信息量,同时高效表征目标对象的空间信息。The present invention adopts the method of dividing the spatial region of the image by the direction of the upright person in the target image, in each region, the color information of multiple color spaces is respectively extracted, the three-dimensional histograms of each color space are spliced into a single dimension, and then connected The histograms of different color spaces in this area, and the histograms connecting all areas to obtain the combined feature vector of multi-area and multi-color spaces, thus overcoming the limitations in the tracking and identification of target objects, increasing the information content of color space features, and at the same time Efficiently represent the spatial information of the target object.

再将获得的多区域多颜色空间的组合特征向量降维,以减小运算量并提高了鲁棒性,之后再根据获得的多区域多颜色空间的组合特征向量计算图像之间的相似性来对目标图像进行识别和跟踪。Then reduce the dimensionality of the obtained combined eigenvectors of multi-region and multi-color spaces to reduce the amount of computation and improve the robustness, and then calculate the similarity between images according to the obtained combined eigenvectors of multi-region and multi-color spaces. Identify and track target images.

附图说明Description of drawings

为了更清楚地说明本发明实施例技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to illustrate the technical solutions of the embodiments of the present invention more clearly, the drawings that need to be used in the description of the embodiments will be briefly introduced below. Obviously, the drawings in the following description are some embodiments of the present invention. Ordinary technicians can also obtain other drawings based on these drawings on the premise of not paying creative work.

图1是本发明实施例提供的一种特征提取方法的流程图;Fig. 1 is a flow chart of a feature extraction method provided by an embodiment of the present invention;

图2是将目标图像划分为至少两个区域的示例图;Fig. 2 is an example diagram of dividing a target image into at least two regions;

图3是本发明实施例提供的一种特征提取装置的模块图;Fig. 3 is a block diagram of a feature extraction device provided by an embodiment of the present invention;

图4是本发明实施例提供的一种电子设备的示意图。Fig. 4 is a schematic diagram of an electronic device provided by an embodiment of the present invention.

如下具体实施方式将结合上述附图进一步说明本发明。The following specific embodiments will further illustrate the present invention in conjunction with the above-mentioned drawings.

具体实施方式detailed description

为了能够更清楚地理解本发明的上述目的、特征和优点,下面结合附图和具体实施例对本发明进行详细描述。需要说明的是,在不冲突的情况下,本申请的实施例及实施例中的特征可以相互组合。In order to more clearly understand the above objects, features and advantages of the present invention, the present invention will be described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be noted that, in the case of no conflict, the embodiments of the present application and the features in the embodiments can be combined with each other.

在下面的描述中阐述了很多具体细节以便于充分理解本发明,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。Many specific details are set forth in the following description to facilitate a full understanding of the present invention, and the described embodiments are only some of the embodiments of the present invention, rather than all of them. Based on the embodiments of the present invention, all other embodiments obtained by persons of ordinary skill in the art without making creative efforts belong to the protection scope of the present invention.

除非另有定义,本文所使用的所有的技术和科学术语与属于本发明的技术领域的技术人员通常理解的含义相同。本文中在本发明的说明书中所使用的术语只是为了描述具体的实施例的目的,不是旨在于限制本发明。Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the technical field of the invention. The terms used herein in the description of the present invention are for the purpose of describing specific embodiments only, and are not intended to limit the present invention.

实施例Example

图1为本发明实施例提供的特征提取方法的流程图。其中,根据不同的需求,该流程图中步骤的顺序可以改变,某些步骤可以省略。如图1所示,特征提取方法可包括以下步骤:FIG. 1 is a flowchart of a feature extraction method provided by an embodiment of the present invention. Wherein, according to different requirements, the order of the steps in the flow chart can be changed, and some steps can be omitted. As shown in Figure 1, the feature extraction method may include the following steps:

S10:获取目标图像。S10: Acquiring a target image.

上述目标图像是要进行特征提取的图像。例如,若要对摄像机捕获到的图像进行特征提取,则将摄像机捕获到的图像作为目标图像,并获取该目标图像。同时,目标图像可以是摄像机捕获到的原始图像,也可以是对摄像机捕获到的原始图像进行预处理(例如将原始图像进行切割)之后的得到的图像。The above target image is an image to be subjected to feature extraction. For example, if feature extraction is to be performed on an image captured by a camera, the image captured by the camera is used as a target image, and the target image is obtained. Meanwhile, the target image may be an original image captured by the camera, or an image obtained after preprocessing (for example, cutting the original image) on the original image captured by the camera.

目标图像中的内容可以包括:人物、动物、建筑物、景物等,且目标图像中的内容可以包括上述内容的任意组合。The content in the target image may include: people, animals, buildings, scenery, etc., and the content in the target image may include any combination of the above content.

S11:按照所述目标图像中人物直立的方向将所述目标图像划分为至少两个区域。S11: Divide the target image into at least two regions according to the upright direction of the person in the target image.

直立的人物比例大致类似,但是由于姿态和动作不同,按人物直立的方向划分会有更高的鲁棒性,因此将目标图像按照目标图像中人物直立的方向划分为至少两个区域。The proportions of the upright characters are roughly similar, but due to the different postures and actions, the division by the upright direction of the characters will have higher robustness, so the target image is divided into at least two regions according to the upright direction of the characters in the target image.

上述人物直立的方向是指人站立的方向。例如,若目标图像中人站立的方向为直角坐标系的Y轴方向,则将该目标图像按照直角坐标系的Y轴方向划分为至少两个区域。若目标图像中人站立的方向相对直角坐标系的Y轴方向向右偏离45度,则按照相对直角坐标系的Y轴方向向右偏离45度的方向将该目标图像划分为至少两个区域。The above-mentioned upright direction of a person refers to a direction in which a person stands. For example, if the direction in which a person stands in the target image is the Y-axis direction of the Cartesian coordinate system, the target image is divided into at least two regions according to the Y-axis direction of the Cartesian coordinate system. If the standing direction of the person in the target image deviates 45 degrees to the right relative to the Y-axis direction of the Cartesian coordinate system, the target image is divided into at least two regions according to the direction deviated 45 degrees to the right relative to the Y-axis direction of the Cartesian coordinate system.

请参见图2,图2是将目标图像划分为至少两个区域的示例图。其中,图像2a中人物直立的方向为直角坐标系的Y轴方向,则将图像2a在直角坐标系的Y轴方向进行划分,图像2a中通过虚线来表示在直角坐标系的Y轴方向将图像2a划分为5个区域。Please refer to FIG. 2 , which is an example diagram of dividing a target image into at least two regions. Wherein, the upright direction of the person in image 2a is the Y-axis direction of the Cartesian coordinate system, then the image 2a is divided in the Y-axis direction of the Cartesian coordinate system, and the image 2a is represented by a dotted line in the Y-axis direction of the Cartesian coordinate system. 2a is divided into 5 regions.

同时,在其他实施例中,还可以按照垂直于图像中人物直立的方向将目标图像划分为至少两区域。请继续参见图2,图2中图像2b人物直立的方向为直角坐标系的Y轴方向,则垂直于图像中人物直立的方向为X轴方向,将图像2b在直角坐标系的Y轴方向进行划分,图像2b中通过虚线来表示在直角坐标系的X轴方向将图像2b划分为5个区域。Meanwhile, in other embodiments, the target image may also be divided into at least two regions according to a direction perpendicular to the upright direction of the person in the image. Please continue to refer to Figure 2. In Figure 2, the upright direction of the person in image 2b is the Y-axis direction of the Cartesian coordinate system, and the direction perpendicular to the upright character in the image is the X-axis direction. Divide, the image 2b is divided into 5 regions in the X-axis direction of the Cartesian coordinate system by dotted lines in the image 2b.

在其他实施例中,也可以不考虑目标图像中人物的直立方向,仅按照预先设定的方向进行划分,例如按照某一倾斜方向将图像进行区域划分。请继续参见图2,图2中图像2c是按照与直角坐标系的X轴呈45度倾斜方向将目标图像进行划分的示意图,图像2c中通过虚线来表示在与直角坐标系的X轴呈45度倾斜方向将图像2c划分为5个区域。In other embodiments, the upright direction of the person in the target image may also be disregarded, and only be divided according to a preset direction, for example, the image may be divided into regions according to a certain oblique direction. Please continue to refer to Figure 2. Image 2c in Figure 2 is a schematic diagram of dividing the target image in a direction inclined at 45 degrees to the X-axis of the rectangular coordinate system. Divide the image 2c into 5 regions according to the oblique direction.

在其他实施例中,将目标图像按照空间金字塔模型进行区域的划分。如何根据空间金字塔模型划分区域可以从现有技术中获取,故此处不再赘述。In other embodiments, the target image is divided into regions according to the spatial pyramid model. How to divide regions according to the spatial pyramid model can be obtained from the prior art, so details will not be described here.

同时,当目标图像不包括人物时也可以选择上述方式将图像进行划分区域或者是其他方式将图像划分区域。At the same time, when the target image does not include a person, the above method can also be selected to divide the image into regions or other methods can be used to divide the image into regions.

由于在目标图像中,按照人物直立的方向进行划分时,划分后的每个区域可包含人物较多的部位的信息,所以按照人物直立的方向进行划分进而提取特征更能反应完整的图像信息。比如,按人物直立的方向划分时,每个区域可包括人物的多个部分,如头部、人物上半身与人物下半身;若按垂直与人物直立的方向划分,则一个区域可能仅包括人物的一个部分,如一区域仅包括人物的头部,另一区域仅包括人物的上肢部分,又一区域仅包括人物的脚部。Since in the target image, when divided according to the upright direction of the person, each divided region can contain information about more parts of the person, so dividing according to the upright direction of the person and then extracting features can better reflect the complete image information. For example, when divided according to the upright direction of the character, each area may include multiple parts of the character, such as the head, the upper body of the character, and the lower body of the character; For example, one area includes only the head of the character, another area includes only the upper limbs of the character, and another area includes only the feet of the character.

例如,图像a与图像b中人物的直立方向为直角坐标系的Y轴方向,图像a为红色上衣黑色裤子,图像b为黑色上衣红色裤子,若此时按照直角坐标系的X轴方向进行划分,则在对图像a与图像b划分好之后进行颜色提取时,图像a与图像b提取到的颜色特征类似,图像a与图像b会识别为相同的图像,而实际上图像a与图像b是两幅不同的图像,此时提取到的特征不够准确,进而影响图像识别的识别结果也不准确,降低判断准确性。For example, the upright direction of the characters in image a and image b is the Y-axis direction of the Cartesian coordinate system, image a is a red top and black pants, and image b is a black top and red pants, if it is divided according to the X-axis direction of the Cartesian coordinate system , then when image a and image b are divided and color extraction is performed, the color features extracted from image a and image b are similar, image a and image b will be recognized as the same image, but in fact image a and image b are For two different images, the features extracted at this time are not accurate enough, which further affects the inaccurate recognition results of image recognition and reduces the accuracy of judgment.

进一步地,在对目标图像进行区域划分时,可将目标图像划分为3-5部分。划分过多的区域可能增加运算的复杂度从而降低运算效率,划分过少的区域可能不足以完全将每个图像进行区分。将目标图像划分为3-5个区域可以足够将目标图像的每部分进行区分,但又不会划分的过多。在划分区域时每区域可以为等分的区域,也可以为不等分的区域。Further, when performing region division on the target image, the target image may be divided into 3-5 parts. Dividing too many regions may increase the complexity of the operation and reduce the efficiency of the operation, and dividing too few regions may not be enough to completely distinguish each image. Dividing the target image into 3-5 regions can be enough to distinguish each part of the target image, but not too much. When dividing the area, each area can be an equally divided area or an unequal area.

对目标图像划分区域以后可对每一部分进行标记,通过标记来标识划分好的每个区域。例如将目标图像划分为3部分,分别为region1、region2和region3。After the target image is divided into regions, each part can be marked, and each divided region can be identified by marking. For example, the target image is divided into three parts, namely region1, region2 and region3.

若不对目标图像进行区域划分,可能无法充分体现目标图像中对象的空间方位特点,从而降低图像表征的准确性。例如,图像c为红色上衣黑色帽子的行人,图像d为红色裤子黑色手提包的行人,若仅对图像c和图像d提取颜色信息,则图像c与图像d提取到的颜色特征类似,而实际上图像c与图像d是两幅不同的图像。因此,仅通过颜色信息提取不足以表现图像的完整信息,而需要将图像先进行区域的划分。If the target image is not divided into regions, it may not be able to fully reflect the spatial orientation characteristics of the object in the target image, thereby reducing the accuracy of image representation. For example, image c is a pedestrian with a red coat and black hat, and image d is a pedestrian with red pants and a black handbag. If only the color information is extracted from image c and image d, the color features extracted from image c and image d are similar, while the actual The above image c and image d are two different images. Therefore, only extracting color information is not enough to represent the complete information of the image, and the image needs to be divided into regions first.

S12:提取每个区域在多个颜色空间的色彩信息。S12: Extract color information of each region in multiple color spaces.

上述颜色空间也称颜色模型,可以为现有的颜色空间中的任意多个颜色空间。颜色空间包括但不限于RGB颜色空间、CMY颜色空间、YUV颜色空间、HSV颜色空间、HIS颜色空间、Lab颜色空间。The above color space is also called a color model, and may be any number of color spaces in existing color spaces. Color spaces include but are not limited to RGB color space, CMY color space, YUV color space, HSV color space, HIS color space, and Lab color space.

作为一种可选的实施方式,在一个实施例中,所述多个颜色空间可以包括:RGB颜色空间、HSV颜色空间、Lab颜色空间。As an optional implementation manner, in an embodiment, the multiple color spaces may include: an RGB color space, an HSV color space, and a Lab color space.

即多个颜色空间可以是三个颜色空间或多于三个的颜色空间,若为三个颜色空间,则分别为RGB颜色空间、HSV颜色空间、Lab颜色空间。That is, the multiple color spaces may be three color spaces or more than three color spaces, and if there are three color spaces, they are RGB color space, HSV color space, and Lab color space.

其中,RGB为显示器中采用的颜色空间,基于光的三原色定义。HSV是根据颜色的直观特性创建的一种颜色空间,这个颜色空间中的参数分别是:色调(H)、饱和度(S)、亮度(V)。Lab是在国际照明委员会(CIE)制定的颜色度量国际标准的基础上建立的颜色空间,是一种与设备无关的颜色空间,也是一种基于生理特征的颜色系统,它用数字化的方式来描述人的视觉感应。因此,通过提取RGB颜色空间、HSV颜色空间、Lab颜色空间的色彩信息可以更贴近人的视觉感受,使得数字化的色彩表达与人的感受相一致。Among them, RGB is the color space adopted in the display, which is defined based on the three primary colors of light. HSV is a color space created according to the intuitive characteristics of color. The parameters in this color space are: hue (H), saturation (S), and brightness (V). Lab is a color space established on the basis of the international standard for color measurement formulated by the International Commission on Illumination (CIE). It is a device-independent color space and a color system based on physiological characteristics. It is described digitally. human visual perception. Therefore, by extracting the color information of RGB color space, HSV color space, and Lab color space, it can be closer to human visual perception, so that the digital color expression is consistent with human perception.

例如,提取每个区域在RGB颜色空间的色彩信息是指:用三原色来表示每个区域的颜色信息,具体的,可以通过一组R、G、B的值来表示每个区域上的一个像素点。提取每个区域在多个颜色空间的色彩信息,具体是将每个区域在多个颜色空间的色彩信息用数字化的形式进行表示,例如通过特征向量来表示每个区域在多个颜色空间的色彩信息。For example, extracting the color information of each area in the RGB color space means: using three primary colors to represent the color information of each area, specifically, a set of R, G, and B values can be used to represent a pixel on each area point. Extract the color information of each region in multiple color spaces, specifically represent the color information of each region in multiple color spaces in digital form, for example, express the color information of each region in multiple color spaces through feature vectors information.

作为一种可选的实施方式,在一个实施例中,所述提取每个区域在多个颜色空间的色彩信息包括:As an optional implementation manner, in an embodiment, the extracting the color information of each region in multiple color spaces includes:

根据颜色直方图提取每个区域在多个颜色空间中各个颜色维度的信息并用特征向量进行表示。According to the color histogram, the information of each color dimension of each region in multiple color spaces is extracted and represented by a feature vector.

其中,颜色直方图可反应图像中颜色的组成分布,即出现了哪些颜色以及各种颜色的出现概率,上述颜色维度也称为颜色通道或者是颜色分量。Among them, the color histogram can reflect the composition distribution of colors in the image, that is, which colors appear and the occurrence probability of each color. The above-mentioned color dimensions are also called color channels or color components.

根据颜色直方图提取每个区域在多个颜色空间中各个颜色维度的信息具体是对于每个区域中的多个颜色空间都进行颜色维度的信息的提取,通过特征向量来表示提取得到的各个颜色空间的颜色特征。通过特征向量进行表示的目的是为了便于后续进行计算。According to the color histogram, the information of each color dimension of each region in multiple color spaces is extracted, specifically, the information of color dimensions is extracted for multiple color spaces in each region, and the extracted colors are represented by feature vectors The color characteristics of the space. The purpose of expressing by eigenvectors is to facilitate subsequent calculations.

在根据颜色直方图进行提取时,先计算每个区域的颜色直方图。计算颜色直方图需要将颜色空间划分成多个小的颜色区间,每个小的颜色区间称为直方图的一个柄(bin)。这个过程称为颜色量化。然后通过计算颜色落在每个小的颜色区间内的像素数量可以得到颜色直方图。一般来说,小的颜色区间(bin)的数目越多,直方图对颜色的分辨能力就越强。然而,柄的数目很大的颜色直方图不但会增加计算负担,也不利于在大型图像库中建立索引。When extracting according to the color histogram, first calculate the color histogram of each region. Calculating the color histogram requires dividing the color space into multiple small color intervals, and each small color interval is called a bin of the histogram. This process is called color quantization. The color histogram can then be obtained by counting the number of pixels whose color falls within each small color interval. Generally speaking, the more the number of small color intervals (bins), the stronger the histogram's ability to distinguish colors. However, a color histogram with a large number of bins not only increases the computational burden, but also is not conducive to indexing in large image libraries.

在本发明的一个实施例中,RGB颜色空间和HSV颜色空间的柄数设置为8,Lab颜色空间的柄数设置为16。In an embodiment of the present invention, the number of handles in the RGB color space and the HSV color space is set to 8, and the number of handles in the Lab color space is set to 16.

例如,RBG由R、G、B三个维度或称三个通道构成,每个维度设置8个柄。HSV由H、S、V三个维度构成,每个维度也同样设置8个柄。Lab由L(亮度)、a(颜色是从深绿色(低亮度值)到灰色(中亮度值)再到亮粉红色(高亮度值))、b(颜色是从亮蓝色(低亮度值)到灰色(中亮度值)再到黄色(高亮度值))三个维度构成,每个维度设置16个柄。For example, RBG is composed of R, G, and B three dimensions or called three channels, and 8 handles are set for each dimension. HSV consists of three dimensions: H, S, and V, and each dimension also has 8 handles. Lab consists of L (brightness), a (color is from dark green (low brightness value) to gray (medium brightness value) to bright pink (high brightness value)), b (color is from bright blue (low brightness value) ) to gray (medium brightness value) to yellow (high brightness value)) in three dimensions, and each dimension has 16 handles.

若将目标图像分为region1、region2和region3这三个区域,则在某一区域(region1)中,提取到的RGB颜色空间中各个颜色维度的信息并用特征向量表示为:If the target image is divided into three regions, region1, region2 and region3, then in a certain region (region1), the information of each color dimension in the extracted RGB color space is expressed as:

[r1,r2,r3,r4,r5,r6,r7,r8];[g1,g2,g3,g4,g5,g6,g7,g8];[b1,b2,b3,b4,b5,b6,b7,b8][r 1 , r 2 , r 3 , r 4 , r 5 , r 6 , r 7 , r 8 ]; [g 1 , g 2 , g 3 , g 4 , g 5 , g 6 , g 7 , g 8 ]; [b 1 , b 2 , b 3 , b 4 , b 5 , b 6 , b 7 , b 8 ]

其中,r1是region1的颜色直方图中某一颜色区间的某一像素点的R值,也可以是region1的颜色直方图中某一颜色区间的所有像素点的R值的平均值,或者是根据region1的颜色直方图中某一颜色区间的预设像素点的R的值和预设公式计算得到的值。同样的,g1是region1的颜色直方图中某一颜色区间的某一像素点的G的值,也可以是region1的颜色直方图中某一颜色区间的所有像素点的G值的平均值,或者是根据region1的颜色直方图中某一颜色区间的预设像素点的G的值和预设公式计算得到的值。Among them, r 1 is the R value of a pixel in a certain color interval in the color histogram of region1, or the average value of the R values of all pixels in a certain color interval in the color histogram of region1, or The value calculated according to the R value of a preset pixel point in a certain color interval in the color histogram of region1 and the preset formula. Similarly, g 1 is the G value of a pixel in a certain color interval in the color histogram of region1, or the average value of the G values of all pixels in a certain color interval in the color histogram of region1. Or it is a value calculated according to the G value of a preset pixel point in a certain color interval in the color histogram of region1 and a preset formula.

同样的,提取到的HSV颜色空间和Lab颜色空间中各个颜色维度的信息并用特征向量表示分别为:Similarly, the information of each color dimension in the extracted HSV color space and Lab color space is represented by feature vectors as follows:

[h1,h2,h3,h4,h5,h6,h7,h8];[s1,s2,s3,s4,s5,s6,s7,s8];[v1,v2,v3,v4,v5,v6,v7,v8][h 1 , h 2 , h 3 , h 4 , h 5 , h 6 , h 7 , h 8 ]; [s 1 , s 2 , s 3 , s 4 , s 5 , s 6 , s 7 , s 8 ]; [v 1 , v 2 , v 3 , v 4 , v 5 , v 6 , v 7 , v 8 ]

[l1,l2,l3,...,l14,l15,l16];[a1,a2,a3,...,a14,a15,a16];[b1,b2,b3,...,b14,b15,b16][l 1 ,l 2 ,l 3 ,...,l 14 ,l 15 ,l 16 ]; [a 1 ,a 2 ,a 3 ,...,a 14 ,a 15 ,a 16 ];[b 1 , b 2 , b 3 ,..., b 14 , b 15 , b 16 ]

其中,特征向量中每个具体值(如h1和a1)的获取方法可以根据前述提取RGB颜色空间中各个颜色维度的信息的方法一致,或者是可以根据提取RGB颜色空间中各个颜色维度的信息的结果和颜色空间转换公式进行转换,其中颜色空间转换公式可以从现有的颜色空间转换公式中获取。Wherein, the acquisition method of each specific value (such as h 1 and a 1 ) in the feature vector can be consistent with the aforementioned method of extracting the information of each color dimension in the RGB color space, or can be based on the method of extracting the information of each color dimension in the RGB color space The result of the information and the color space conversion formula are converted, wherein the color space conversion formula can be obtained from the existing color space conversion formula.

S13:将从至少两个区域中提取到的多个颜色空间的色彩信息组合,得到表示所述目标图像的组合特征向量。S13: Combine the color information of multiple color spaces extracted from at least two regions to obtain a combined feature vector representing the target image.

在提取到每个区域在多个颜色空间的色彩信息后,将多个区域在多个颜色空间的色彩信息进行组合。例如,通过特征向量来表示每个区域在多个颜色空间的色彩信息,再将多个特征向量进行拼接,来得到表示目标图像的组合特征向量,或者是通过核函数的数学方法来进行组合,得到表示目标图像的组合特征向量。After the color information of each area in multiple color spaces is extracted, the color information of multiple areas in multiple color spaces is combined. For example, the color information of each area in multiple color spaces is represented by the feature vector, and then the multiple feature vectors are spliced to obtain the combined feature vector representing the target image, or combined by the mathematical method of the kernel function, A combined feature vector representing the target image is obtained.

作为一种可选的实施方式,在一个实施例中,步骤S13将从所述至少两个区域中提取到的多个颜色空间的色彩信息组合,得到表示所述目标图像的组合特征向量包括:As an optional implementation manner, in one embodiment, step S13 combines the color information of multiple color spaces extracted from the at least two regions, and obtaining the combined feature vector representing the target image includes:

将每个区域在每个颜色空间的各个颜色维度的信息组合,得到每个区域中各个颜色空间的组合特征向量;Combining the information of each color dimension of each region in each color space to obtain the combined feature vector of each color space in each region;

将所述每个区域中各个颜色空间的组合特征向量进行拼接,得到每个区域在多个颜色空间的组合特征向量;splicing the combined eigenvectors of each color space in each region to obtain the combined eigenvectors of each region in multiple color spaces;

将所述每个区域在多个颜色空间的组合特征向量进行拼接,得到所述目标图像在所述至少两个区域的多个颜色空间的组合特征向量。The combined feature vectors of each area in multiple color spaces are spliced to obtain combined feature vectors of the target image in multiple color spaces of the at least two areas.

其中,将每个区域在每个颜色空间的各个颜色维度的信息组合,得到每个区域中各个颜色空间的组合特征向量,即为对于region1这一区域,可将表示该区域在每个颜色空间的各个颜色维度的信息的特征向量进行拼接,得到该区域中各个颜色空间的特征向量:Among them, the information of each color dimension of each region in each color space is combined to obtain the combined feature vector of each color space in each region, that is, for the region of region1, it can be expressed that the region is in each color space The eigenvectors of the information of each color dimension of the color are spliced to obtain the eigenvectors of each color space in the region:

[r1,r2,...,r7,r8,g1,g2,...,g7,g8,b1,b2,...,b7,b8][r 1 , r 2 ,..., r 7 , r 8 , g 1 , g 2 ,..., g 7 , g 8 , b 1 , b 2 ,..., b 7 , b 8 ]

[h1,h2,...,h7,h8,s1,s2,...,s7,s8,v1,v2,...,v7,v8][h 1 , h 2 ,..., h 7 , h 8 , s 1 , s 2 ,..., s 7 , s 8 , v 1 , v 2 ,..., v 7 , v 8 ]

[l1,l2....,l15,l16,a1,a2,...,a15,a16,b1,b2...,b16][l 1 , l 2 ..., l 15 , l 16 , a 1 , a 2 , ..., a 15 , a 16 , b 1 , b 2 ..., b 16 ]

接着,将每个区域中各个颜色空间的组合特征向量进行拼接,即将一个区域的所有颜色空间的特征向量拼接为一个组合特征向量,对于region1这一区域,可将表示各个颜色空间的信息的特征向量进行拼接,得到该区域在多个颜色空间的组合特征向量:Then, the combined feature vectors of each color space in each region are spliced, that is, the feature vectors of all color spaces in a region are spliced into a combined feature vector. For the region1, the features representing the information of each color space can be The vectors are spliced to obtain the combined feature vectors of the region in multiple color spaces:

[r1,...,r8,g1,...,g8,b1,...,b8,h1,...,h8,s1,...,s8,v1,...,v8,l1,...,l8,a1,...,a8,b1,...,b8][r 1 ,...,r 8 ,g 1 ,...,g 8 ,b 1 ,...,b 8 ,h 1 ,...,h 8 ,s 1 ,...,s 8 ,v 1 ,...,v 8 ,l 1 ,...,l 8 ,a 1 ,...,a 8 ,b 1 ,...,b 8 ]

=[RGB1HSV1LAB1]=[RGB 1 HSV 1 LAB 1 ]

目标图像划分后的每个区域通过以上步骤,都可以得到在多个颜色空间的组合特征向量,则再将每个区域在多个颜色空间的组合特征向量进行拼接,得到目标图像在至少两个区域的多个颜色空间的组合特征向量:After the target image is divided into each area, the combined feature vectors in multiple color spaces can be obtained through the above steps, and then the combined feature vectors of each area in multiple color spaces are spliced to obtain the target image in at least two Combined eigenvectors of multiple color spaces for a region:

[Region1,Region2,Region3][Region1, Region2, Region3]

=[RGB1HSV1LAB1,RGB2HSV2LAB2,RGB3HSV3LAB3]=[RGB 1 HSV 1 LAB 1 , RGB 2 HSV 2 LAB 2 , RGB 3 HSV 3 LAB 3 ]

通过以上步骤,完成了对目标图像的特征提取,得到了表示目标图像的组合特征向量。Through the above steps, the feature extraction of the target image is completed, and the combined feature vector representing the target image is obtained.

作为一种可选的实施方式,在一个实施例中,本发明提供的特征提取方法还包括:对表示所述目标图像的组合特征向量进行降维处理。As an optional implementation manner, in one embodiment, the feature extraction method provided by the present invention further includes: performing dimensionality reduction processing on the combined feature vector representing the target image.

在得到表示目标图像的组合特征向量之后,为了使表达式更简洁,便于后续使用,可将表示目标图像的组合特征向量进行降维处理,以减少后续使用时的运算复杂度,提高运算效率。After obtaining the combined feature vector representing the target image, in order to make the expression more concise and convenient for subsequent use, the combined feature vector representing the target image can be subjected to dimensionality reduction processing to reduce the computational complexity of subsequent use and improve computational efficiency.

例如,降维方法有主成分分析(Principal Component Analysis,PCA),可通过PCA对表示目标图像的组合特征向量进行降维。For example, the dimensionality reduction method includes principal component analysis (Principal Component Analysis, PCA), which can reduce the dimensionality of the combined feature vector representing the target image through PCA.

同时降维的方法不限于以上提到的PCA,还可以是反向特征消除、组合数等任意降维方法对表示目标图像的组合特征向量进行降维。At the same time, the method of dimensionality reduction is not limited to the PCA mentioned above, and any dimensionality reduction method such as reverse feature elimination and combination number can also be used to reduce the dimensionality of the combined feature vector representing the target image.

进一步地,在一个实施例中,本发明提供的特征提取方法所提取的目标图像的组合特征向量可以用于图像识别和跟踪,具体为:Further, in one embodiment, the combined feature vector of the target image extracted by the feature extraction method provided by the present invention can be used for image recognition and tracking, specifically:

计算所述表示所述目标图像的组合特征向量与图像库中样本图像的特征向量之间的距离以判断图像之间的相似性;calculating the distance between the combined feature vector representing the target image and the feature vector of the sample image in the image library to judge the similarity between the images;

选取所述图像库中与所述目标图像的相似性最高的样本图像为图像识别结果;Selecting the sample image with the highest similarity to the target image in the image library as the image recognition result;

根据所述图像识别结果对所述目标图像进行跟踪。The target image is tracked according to the image recognition result.

其中,可以计算降维之后的表示目标图像的组合特征向量或者是降维之前的表示目标图像的组合特征向量与图像库中样本图像的特征向量之间的距离。Wherein, the combined feature vector representing the target image after dimension reduction or the distance between the combined feature vector representing the target image before dimension reduction and the feature vector of the sample image in the image library can be calculated.

优选的,计算降维之后的表示目标图像的组合特征向量与图像库中样本图像的特征向量之间的距离,可以进一步提高运算的效率,降低运算复杂度。Preferably, calculating the distance between the combined feature vector representing the target image after dimensionality reduction and the feature vector of the sample image in the image library can further improve the efficiency of the operation and reduce the complexity of the operation.

其中,图像库中可包含多个样本图像的信息。例如,图像库中包括多个样本图像的名称、编号及特征向量等。比如包括A用户图像的名称、编号与A用户图像的特征向量,通过A用户图像的名称可以在图像库中唯一标识该样本,通过A用户图像的特征向量可以用于表达A用户图像的特征。Wherein, the image library may contain information of multiple sample images. For example, the image library includes names, serial numbers, and feature vectors of multiple sample images. For example, it includes the name and serial number of user A’s image, and the feature vector of user A’s image. The sample can be uniquely identified in the image database through the name of user A’s image, and the feature vector of user A’s image can be used to express the characteristics of user A’s image.

在进行距离计算时,可以通过距离公式进行计算,距离公式包括但不限于欧式距离、明氏距离、马氏距离。具体使用哪个距离公式可以根据需要进行选择。距离公式可从现有技术中进行获取,此处不再赘述。对于不同的距离公式有不同的确定相似性的方法,例如,根据欧式距离得到的距离值越小,表明图像之间的相似度越大。When calculating the distance, the distance formula can be used for calculation, and the distance formula includes but not limited to Euclidean distance, Mingren distance, and Mahalanobis distance. Which distance formula to use can be selected according to needs. The distance formula can be obtained from the prior art, and will not be repeated here. There are different methods for determining similarity for different distance formulas. For example, the smaller the distance value obtained according to the Euclidean distance, the greater the similarity between images.

在计算表示目标图像的组合特征向量与图像库中样本图像的特征向量之间的距离时,可以将表示目标图像的组合特征向量与图像库中多个样本图像的特征向量分别进行计算,以获取与目标图像相似度最高的图像,从而得到图像识别结果,即目标图像中是否包含某一目标对象。When calculating the distance between the combined feature vector representing the target image and the feature vectors of the sample images in the image library, the combined feature vector representing the target image and the feature vectors of multiple sample images in the image library can be calculated separately to obtain The image with the highest similarity to the target image is used to obtain the image recognition result, that is, whether the target image contains a certain target object.

例如,将M图像进行特征提取,得到表示M图像的组合特征向量x,若图像库中包括A用户图像、B用户图像、C用户图像,其中A用户图像的特征向量为ya,B用户图像的特征向量为yb,C用户图像的特征向量为yc,则根据欧式距离分别计算特征向量x与ya,特征向量x与yb,特征向量x与yc的距离。若计算得到特征向量x与yb的距离最小,识别B用户图像为与目标图像最相似,目标图像中包括B用户。For example, the M image is subjected to feature extraction to obtain the combined feature vector x representing the M image. If the image library includes A user image, B user image, and C user image, the feature vector of A user image is y a , and the B user image The feature vector of user C is y b , and the feature vector of C user image is y c , then calculate the distances between feature vectors x and y a , feature vectors x and y b , and feature vectors x and y c according to the Euclidean distance. If the calculated distance between the eigenvectors x and y b is the smallest, the image of user B is identified as the most similar to the target image, and the target image includes user B.

在得到对目标图像的识别结果后,可以根据图像识别结果对目标图像进行跟踪,具体的是对目标图像中识别到的目标对象进行跟踪。例如,对M图像中的B用户进行跟踪。After the recognition result of the target image is obtained, the target image can be tracked according to the image recognition result, specifically, the target object recognized in the target image can be tracked. For example, the B user in the M image is tracked.

在进行图像跟踪时,可以选择现有的图像跟踪算法进行跟踪,此处不再赘述。When performing image tracking, an existing image tracking algorithm can be selected for tracking, which will not be repeated here.

由于表示目标图像的组合特征向量是特征提取的结果,可以用于表示目标图像,因此可以根据特征提取的结果对目标图像中包括的内容进行识别和跟踪。Since the combined feature vector representing the target image is the result of feature extraction and can be used to represent the target image, the content included in the target image can be identified and tracked according to the result of feature extraction.

若对目标图像的特征提取的准确度越高,则图像识别和图像跟踪的准确度会越高,若特征提取的准确度不高,则图像识别和图像跟踪的准确度也会降低。If the accuracy of feature extraction of the target image is higher, the accuracy of image recognition and image tracking will be higher; if the accuracy of feature extraction is not high, the accuracy of image recognition and image tracking will also be reduced.

同时,除了进行图像识别和图像跟踪以外,还可以进行图像识别以外的其他的图像处理操作,例如,图像检索,对于目标图像的特征提取的越准确,则对于后续进行其他图像处理操作时的准确度和效率越高。At the same time, in addition to image recognition and image tracking, other image processing operations other than image recognition can also be performed, such as image retrieval. The more accurate the feature extraction of the target image is, the more accurate it will be for subsequent other image processing operations Higher degree and efficiency.

本发明实施例提供的特征提取方法,获取目标图像;按照所述目标图像中人物直立的方向将所述目标图像划分为至少两个区域;提取每个区域在多个颜色空间的色彩信息;将从所述至少两个区域中提取到的多个颜色空间的色彩信息组合,得到表示所述目标图像的组合特征向量。通过将目标图像划分区域,并在每个区域的多颜色空间提取色彩信息,从多个维度对图像的色彩进行了表达,充分体现了图像不同部分的特征及颜色分布,使得无论在何种光照条件下的图像都可以准确的表示图像。通过多区域及多颜色空间进行特征提取从而实现了准确地提取图像的特征的目的。The feature extraction method provided by the embodiment of the present invention acquires a target image; divides the target image into at least two regions according to the upright direction of the person in the target image; extracts color information of each region in multiple color spaces; The color information of multiple color spaces extracted from the at least two regions is combined to obtain a combined feature vector representing the target image. By dividing the target image into regions and extracting color information in the multi-color space of each region, the color of the image is expressed from multiple dimensions, fully reflecting the characteristics and color distribution of different parts of the image, so that no matter what kind of lighting The image under the conditions can accurately represent the image. The purpose of extracting the features of the image is realized accurately through the feature extraction of multiple regions and multiple color spaces.

本发明采用目标图像中人物直立的方向划分图像的空间区域的方法,在每个区域中,分别提取多个颜色空间的色彩信息,将每个颜色空间的三维直方图拼接为单维,再连接该区域不同颜色空间的直方图,以及连接所有区域的直方图获得多区域多颜色空间的组合特征向量,从而克服了在目标对象的跟踪识别中的局限性,增加颜色空间特征的信息量,同时高效表征目标对象的空间信息。The present invention adopts the method of dividing the spatial region of the image by the direction of the upright person in the target image, in each region, the color information of multiple color spaces is respectively extracted, the three-dimensional histograms of each color space are spliced into a single dimension, and then connected The histograms of different color spaces in this area, and the histograms connecting all areas to obtain the combined feature vector of multi-area and multi-color spaces, thus overcoming the limitations in the tracking and identification of target objects, increasing the information content of color space features, and at the same time Efficiently represent the spatial information of the target object.

再将获得的多区域多颜色空间的组合特征向量降维,以减小运算量并提高了鲁棒性,之后再根据获得的多区域多颜色空间的组合特征向量计算图像之间的相似性来对目标图像进行识别和跟踪。Then reduce the dimensionality of the obtained combined eigenvectors of multi-region and multi-color spaces to reduce the amount of computation and improve the robustness, and then calculate the similarity between images according to the obtained combined eigenvectors of multi-region and multi-color spaces. Identify and track target images.

实施例Example

本发明还提供一种图像识别方法,所述图像识别方法包括:The present invention also provides an image recognition method, the image recognition method comprising:

获取目标图像;Get the target image;

按照所述目标图像中人物直立的方向将所述目标图像划分为至少两个区域;dividing the target image into at least two regions according to the upright direction of the person in the target image;

提取每个区域在多个颜色空间的色彩信息;Extract color information of each region in multiple color spaces;

将从所述至少两个区域中提取到的多个颜色空间的色彩信息组合,得到表示所述目标图像的组合特征向量;combining the color information of multiple color spaces extracted from the at least two regions to obtain a combined feature vector representing the target image;

计算所述表示所述目标图像的组合特征向量与图像库中样本图像的特征向量之间的距离以判断目标图像与所述图像库中样本图像之间的相似性;calculating the distance between the combined feature vector representing the target image and the feature vector of the sample image in the image library to judge the similarity between the target image and the sample image in the image library;

选取所述图像库中与所述目标图像的相似性最高的样本图像为图像识别结果;Selecting the sample image with the highest similarity to the target image in the image library as the image recognition result;

根据所述图像识别结果对所述目标图像进行跟踪。The target image is tracked according to the image recognition result.

作为一种优选的实施方式,本发明在计算所述表示所述目标图像的组合特征向量与图像库中样本图像的特征向量之间的距离之前,还包括:对表示所述目标图像的组合特征向量进行降维处理。As a preferred embodiment, before calculating the distance between the combined feature vector representing the target image and the feature vector of the sample image in the image library, the present invention further includes: Vectors are dimensionally reduced.

在得到表示目标图像的组合特征向量之后,为了使表达式更简洁,便于后续使用,可将表示目标图像的组合特征向量进行降维处理,以减少后续使用时的运算复杂度,提高运算效率。After obtaining the combined feature vector representing the target image, in order to make the expression more concise and convenient for subsequent use, the combined feature vector representing the target image can be subjected to dimensionality reduction processing to reduce the computational complexity of subsequent use and improve computational efficiency.

所述降维的方法有主成分分析(Principal Component Analysis,PCA),可通过PCA对表示目标图像的组合特征向量进行降维。The dimensionality reduction method includes principal component analysis (Principal Component Analysis, PCA), which can reduce the dimensionality of the combined feature vector representing the target image through PCA.

同时降维的方法不限于以上提到的PCA,还可以是反向特征消除、组合数等任意降维方法对表示目标图像的组合特征向量进行降维。At the same time, the method of dimensionality reduction is not limited to the PCA mentioned above, and any dimensionality reduction method such as reverse feature elimination and combination number can also be used to reduce the dimensionality of the combined feature vector representing the target image.

对于图像识别方法的有关描述请参照上述特征提取方法中相关步骤的描述。此处不再赘述。For the description of the image recognition method, please refer to the description of the relevant steps in the feature extraction method above. I won't repeat them here.

实施例Example

图3为本发明实施例提供的特征提取装置的结构图,如图3所示,特征提取装置可以包括:获取模块201、区域划分模块202、多颜色空间处理模块203和特征表达模块204。3 is a structural diagram of a feature extraction device provided by an embodiment of the present invention. As shown in FIG.

获取模块201,用于获取目标图像。An acquisition module 201, configured to acquire a target image.

上述目标图像是要进行特征提取的图像。例如,若要对摄像机捕获到的图像进行特征提取,则将摄像机捕获到的图像作为目标图像,并获取该目标图像。同时,目标图像可以是摄像机捕获到的原始图像,也可以是对摄像机捕获到的原始图像进行预处理(例如将原始图像进行切割)之后的得到的图像。The above target image is an image to be subjected to feature extraction. For example, if feature extraction is to be performed on an image captured by a camera, the image captured by the camera is used as a target image, and the target image is obtained. Meanwhile, the target image may be an original image captured by the camera, or an image obtained after preprocessing (for example, cutting the original image) on the original image captured by the camera.

目标图像中的内容可以包括:人物、动物、建筑物、景物等,且目标图像中的内容可以包括上述内容的任意组合。The content in the target image may include: people, animals, buildings, scenery, etc., and the content in the target image may include any combination of the above content.

区域划分模块202,用于按照所述目标图像中人物直立的方向将所述目标图像划分为至少两个区域。The area division module 202 is configured to divide the target image into at least two areas according to the upright direction of the person in the target image.

直立的人物比例大致类似,但是由于姿态和动作不同,按人物直立的方向划分会有更高的鲁棒性,因此将目标图像按照目标图像中人物直立的方向划分为至少两个区域。The proportions of the upright characters are roughly similar, but due to the different postures and actions, the division by the upright direction of the characters will have higher robustness, so the target image is divided into at least two regions according to the upright direction of the characters in the target image.

上述人物直立的方向是指人站立的方向。例如,若目标图像中人站立的方向为直角坐标系的Y轴方向,则将该目标图像按照直角坐标系的Y轴方向划分为至少两个区域。若目标图像中人站立的方向相对直角坐标系的Y轴方向向右偏离45度,则按照相对直角坐标系的Y轴方向向右偏离45度的方向将该目标图像划分为至少两个区域。The above-mentioned upright direction of a person refers to a direction in which a person stands. For example, if the direction in which a person stands in the target image is the Y-axis direction of the Cartesian coordinate system, the target image is divided into at least two regions according to the Y-axis direction of the Cartesian coordinate system. If the standing direction of the person in the target image deviates 45 degrees to the right relative to the Y-axis direction of the Cartesian coordinate system, the target image is divided into at least two regions according to the direction deviated 45 degrees to the right relative to the Y-axis direction of the Cartesian coordinate system.

请参见图2,图2是将目标图像划分为至少两个区域的示例图。其中,图像2a中人物直立的方向为直角坐标系的Y轴方向,则将图像2a在直角坐标系的Y轴方向进行划分,图像2a中通过虚线来表示在直角坐标系的Y轴方向将图像2a划分为5个区域。Please refer to FIG. 2 , which is an example diagram of dividing a target image into at least two regions. Wherein, the upright direction of the person in image 2a is the Y-axis direction of the Cartesian coordinate system, then the image 2a is divided in the Y-axis direction of the Cartesian coordinate system, and the image 2a is represented by a dotted line in the Y-axis direction of the Cartesian coordinate system. 2a is divided into 5 regions.

同时,在其他实施例中,还可以按照垂直于图像中人物直立的方向将目标图像划分为至少两区域。请继续参见图2,图2中图像2b人物直立的方向为直角坐标系的Y轴方向,则垂直于图像中人物直立的方向为X轴方向,将图像2b在直角坐标系的Y轴方向进行划分,图像2b中通过虚线来表示在直角坐标系的X轴方向将图像2b划分为5个区域。Meanwhile, in other embodiments, the target image may also be divided into at least two regions according to a direction perpendicular to the upright direction of the person in the image. Please continue to refer to Figure 2. In Figure 2, the upright direction of the person in image 2b is the Y-axis direction of the Cartesian coordinate system, and the direction perpendicular to the upright character in the image is the X-axis direction. Divide, the image 2b is divided into 5 regions in the X-axis direction of the Cartesian coordinate system by dotted lines in the image 2b.

在其他实施例中,也可以不考虑目标图像中人物的直立方向,仅按照预先设定的方向进行划分,例如按照某一倾斜方向将图像进行区域划分。请继续参见图2,图2中图像2c是按照与直角坐标系的X轴呈45度倾斜方向将目标图像进行划分的示意图,图像2c中通过虚线来表示在与直角坐标系的X轴呈45度倾斜方向将图像2c划分为5个区域。In other embodiments, the upright direction of the person in the target image may also be disregarded, and only be divided according to a preset direction, for example, the image may be divided into regions according to a certain oblique direction. Please continue to refer to Figure 2. Image 2c in Figure 2 is a schematic diagram of dividing the target image in a direction inclined at 45 degrees to the X-axis of the rectangular coordinate system. Divide the image 2c into 5 regions according to the oblique direction.

在其他实施例中,将目标图像按照空间金字塔模型进行区域的划分。如何根据空间金字塔模型划分区域可以从现有技术中获取,故此处不再赘述。In other embodiments, the target image is divided into regions according to the spatial pyramid model. How to divide regions according to the spatial pyramid model can be obtained from the prior art, so details will not be described here.

同时,当目标图像不包括人物时也可以选择上述方式将图像进行划分区域或者是其他方式将图像划分区域。At the same time, when the target image does not include a person, the above method can also be selected to divide the image into regions or other methods can be used to divide the image into regions.

由于在目标图像中,按照人物直立的方向进行划分时,划分后的每个区域可包含人物较多的部位的信息,所以按照人物直立的方向进行划分进而提取特征更能反应完整的图像信息。比如,按人物直立的方向划分时,每个区域可包括人物的多个部分,如头部、人物上半身与人物下半身;若按垂直与人物直立的方向划分,则一个区域可能仅包括人物的一个部分,如一区域仅包括人物的头部,另一区域仅包括人物的上肢部分,又一区域仅包括人物的脚部。Since in the target image, when divided according to the upright direction of the person, each divided region can contain information about more parts of the person, so dividing according to the upright direction of the person and then extracting features can better reflect the complete image information. For example, when divided according to the upright direction of the character, each area may include multiple parts of the character, such as the head, the upper body of the character, and the lower body of the character; For example, one area includes only the head of the character, another area includes only the upper limbs of the character, and another area includes only the feet of the character.

例如,图像a与图像b中人物的直立方向为直角坐标系的Y轴方向,图像a为红色上衣黑色裤子,图像b为黑色上衣红色裤子,若此时按照直角坐标系的X轴方向进行划分,则在对图像a与图像b划分好之后进行颜色提取时,图像a与图像b提取到的颜色特征类似,图像a与图像b会识别为相同的图像,而实际上图像a与图像b是两幅不同的图像,此时提取到的特征不够准确,进而影响图像识别的识别结果也不准确,降低判断准确性。For example, the upright direction of the characters in image a and image b is the Y-axis direction of the Cartesian coordinate system, image a is a red top and black pants, and image b is a black top and red pants, if it is divided according to the X-axis direction of the Cartesian coordinate system , then when image a and image b are divided and color extraction is performed, the color features extracted from image a and image b are similar, image a and image b will be recognized as the same image, but in fact image a and image b are For two different images, the features extracted at this time are not accurate enough, which further affects the inaccurate recognition results of image recognition and reduces the accuracy of judgment.

进一步地,在对目标图像进行区域划分时,可将目标图像划分为3-5部分。划分过多的区域可能增加运算的复杂度从而降低运算效率,划分过少的区域可能不足以完全将每个图像进行区分。将目标图像划分为3-5个区域可以足够将目标图像的每部分进行区分,但又不会划分的过多。在划分区域时每个区域可以为等分的区域,也可以为不等分的区域。Further, when performing region division on the target image, the target image may be divided into 3-5 parts. Dividing too many regions may increase the complexity of the operation and reduce the efficiency of the operation, and dividing too few regions may not be enough to completely distinguish each image. Dividing the target image into 3-5 regions can be enough to distinguish each part of the target image, but not too much. When dividing the area, each area may be an equally divided area or an unequal area.

对目标图像划分区域以后可对每一部分进行标记,通过标记来标识划分好的每个区域。例如将目标图像划分为3部分,分别为region1、region2和region3。After the target image is divided into regions, each part can be marked, and each divided region can be identified by marking. For example, the target image is divided into three parts, namely region1, region2 and region3.

若不对目标图像进行区域划分,可能无法充分体现目标图像中对象的空间方位特点,从而降低图像表征的准确性。例如,图像c为红色上衣黑色帽子的行人,图像d为红色裤子黑色手提包的行人,若仅对图像c和图像d提取颜色信息,则图像c与图像d提取到的颜色特征类似,而实际上图像c与图像d是两幅不同的图像。因此,仅通过颜色信息提取不足以表现图像的完整信息,而需要将图像先进行区域的划分。If the target image is not divided into regions, it may not be able to fully reflect the spatial orientation characteristics of the object in the target image, thereby reducing the accuracy of image representation. For example, image c is a pedestrian with a red coat and black hat, and image d is a pedestrian with red pants and a black handbag. If only the color information is extracted from image c and image d, the color features extracted from image c and image d are similar, while the actual The above image c and image d are two different images. Therefore, only extracting color information is not enough to represent the complete information of the image, and the image needs to be divided into regions first.

多颜色空间处理模块203,用于提取每个区域在多个颜色空间的色彩信息。The multi-color space processing module 203 is configured to extract color information of each region in multiple color spaces.

上述颜色空间也称颜色模型,可以为现有的颜色空间中的任意多个颜色空间。颜色空间包括但不限于RGB颜色空间、CMY颜色空间、YUV颜色空间、HSV颜色空间、HIS颜色空间、Lab颜色空间。The above color space is also called a color model, and may be any number of color spaces in existing color spaces. Color spaces include but are not limited to RGB color space, CMY color space, YUV color space, HSV color space, HIS color space, and Lab color space.

作为一种可选的实施方式,在一个实施例中,所述多个颜色空间可以包括:RGB颜色空间、HSV颜色空间、Lab颜色空间。As an optional implementation manner, in an embodiment, the multiple color spaces may include: an RGB color space, an HSV color space, and a Lab color space.

即多个颜色空间可以是三个颜色空间或多于三个的颜色空间,若为三个颜色空间,则分别为RGB颜色空间、HSV颜色空间、Lab颜色空间。That is, the multiple color spaces may be three color spaces or more than three color spaces, and if there are three color spaces, they are RGB color space, HSV color space, and Lab color space.

其中,RGB为显示器中采用的颜色空间,基于光的三原色定义。HSV是根据颜色的直观特性创建的一种颜色空间,这个颜色空间中的参数分别是:色调(H)、饱和度(S)、亮度(V)。Lab是在国际照明委员会(CIE)制定的颜色度量国际标准的基础上建立的颜色空间,是一种与设备无关的颜色空间,也是一种基于生理特征的颜色系统,它用数字化的方式来描述人的视觉感应。因此,通过提取RGB颜色空间、HSV颜色空间、Lab颜色空间的色彩信息可以更贴近人的视觉感受,使得数字化的色彩表达与人的感受相一致。Among them, RGB is the color space adopted in the display, which is defined based on the three primary colors of light. HSV is a color space created according to the intuitive characteristics of color. The parameters in this color space are: hue (H), saturation (S), and brightness (V). Lab is a color space established on the basis of the international standard for color measurement formulated by the International Commission on Illumination (CIE). It is a device-independent color space and a color system based on physiological characteristics. It is described digitally. human visual perception. Therefore, by extracting the color information of RGB color space, HSV color space, and Lab color space, it can be closer to human visual perception, so that the digital color expression is consistent with human perception.

例如,提取每个区域在RGB颜色空间的色彩信息是指:用三原色来表示每个区域的颜色信息,具体的,可以通过一组R、G、B的值来表示每个区域上的一个像素点。提取每个区域在多个颜色空间的色彩信息,具体是将每个区域在多个颜色空间的色彩信息用数字化的形式进行表示,例如通过特征向量来表示每个区域在多个颜色空间的色彩信息。For example, extracting the color information of each area in the RGB color space means: using three primary colors to represent the color information of each area, specifically, a set of R, G, and B values can be used to represent a pixel on each area point. Extract the color information of each region in multiple color spaces, specifically represent the color information of each region in multiple color spaces in digital form, for example, express the color information of each region in multiple color spaces through feature vectors information.

作为一种可选的实施方式,在一个实施例中,多颜色空间处理模块203具体用于:根据颜色直方图提取每个区域在多个颜色空间中各个颜色维度的信息并用特征向量进行表示。As an optional implementation manner, in one embodiment, the multi-color space processing module 203 is specifically configured to: extract information of each color dimension of each region in multiple color spaces according to the color histogram and represent it with a feature vector.

其中,颜色直方图可反应图像中颜色的组成分布,即出现了哪些颜色以及各种颜色的出现概率,上述颜色维度也称为颜色通道或者是颜色分量。Among them, the color histogram can reflect the composition distribution of colors in the image, that is, which colors appear and the occurrence probability of each color. The above-mentioned color dimensions are also called color channels or color components.

根据颜色直方图提取每个区域在多个颜色空间中各个颜色维度的信息具体是对于每个区域中的多个颜色空间都进行颜色维度的信息的提取,通过特征向量来表示提取得到的各个颜色空间的颜色特征。通过特征向量进行表示的目的是为了便于后续进行计算。According to the color histogram, the information of each color dimension of each region in multiple color spaces is extracted, specifically, the information of color dimensions is extracted for multiple color spaces in each region, and the extracted colors are represented by feature vectors The color characteristics of the space. The purpose of expressing by eigenvectors is to facilitate subsequent calculations.

在根据颜色直方图进行提取时,先计算每个区域的颜色直方图。计算颜色直方图需要将颜色空间划分成多个小的颜色区间,每个小的颜色区间称为直方图的一个柄(bin)。这个过程称为颜色量化。然后通过计算颜色落在每个小的颜色区间内的像素数量可以得到颜色直方图。一般来说,小的颜色区间(bin)的数目越多,直方图对颜色的分辨能力就越强。然而,柄的数目很大的颜色直方图不但会增加计算负担,也不利于在大型图像库中建立索引。When extracting according to the color histogram, first calculate the color histogram of each region. Calculating the color histogram requires dividing the color space into multiple small color intervals, and each small color interval is called a bin of the histogram. This process is called color quantization. The color histogram can then be obtained by counting the number of pixels whose color falls within each small color interval. Generally speaking, the more the number of small color intervals (bins), the stronger the histogram's ability to distinguish colors. However, a color histogram with a large number of bins not only increases the computational burden, but also is not conducive to indexing in large image libraries.

在本发明的一个实施例中,RGB颜色空间和HSV颜色空间的柄数设置为8,Lab颜色空间的柄数设置为16。In an embodiment of the present invention, the number of handles in the RGB color space and the HSV color space is set to 8, and the number of handles in the Lab color space is set to 16.

例如,RBG由R、G、B三个维度或称三个通道构成,每个维度设置8个柄。HSV由H、S、V三个维度构成,每个维度也同样设置8个柄。Lab由L(亮度)、a(颜色是从深绿色(低亮度值)到灰色(中亮度值)再到亮粉红色(高亮度值))、b(颜色是从亮蓝色(低亮度值)到灰色(中亮度值)再到黄色(高亮度值))三个维度构成,每个维度设置16个柄。For example, RBG is composed of R, G, and B three dimensions or called three channels, and 8 handles are set for each dimension. HSV consists of three dimensions: H, S, and V, and each dimension also has 8 handles. Lab consists of L (brightness), a (color is from dark green (low brightness value) to gray (medium brightness value) to bright pink (high brightness value)), b (color is from bright blue (low brightness value) ) to gray (medium brightness value) to yellow (high brightness value)) in three dimensions, and each dimension has 16 handles.

若将目标图像分为region1、region2和region3这三个区域,则在某一区域(region1)中,提取到的RGB颜色空间中各个颜色维度的信息并用特征向量表示为:If the target image is divided into three regions, region1, region2 and region3, then in a certain region (region1), the information of each color dimension in the extracted RGB color space is expressed as:

[r1,r2,r3,r4,r5,r6,r7,r8];[g1,g2,g3,g4,g5,g6,g7,g8];[b1,b2,b3,b4,b5,b6,b7,b8][r 1 , r 2 , r 3 , r 4 , r 5 , r 6 , r 7 , r 8 ]; [g 1 , g 2 , g 3 , g 4 , g 5 , g 6 , g 7 , g 8 ]; [b 1 , b 2 , b 3 , b 4 , b 5 , b 6 , b 7 , b 8 ]

其中,r1是region1的颜色直方图中某一颜色区间的某一像素点的R值,也可以是region1的颜色直方图中某一颜色区间的所有像素点的R值的平均值,或者是根据region1的颜色直方图中某一颜色区间的预设像素点的R的值和预设公式计算得到的值。同样的,g1是region1的颜色直方图中某一颜色区间的某一像素点的G的值,也可以是region1的颜色直方图中某一颜色区间的所有像素点的G值的平均值,或者是根据region1的颜色直方图中某一颜色区间的预设像素点的G的值和预设公式计算得到的值。Among them, r 1 is the R value of a pixel in a certain color interval in the color histogram of region1, or the average value of the R values of all pixels in a certain color interval in the color histogram of region1, or The value calculated according to the R value of a preset pixel point in a certain color interval in the color histogram of region1 and the preset formula. Similarly, g 1 is the G value of a pixel in a certain color interval in the color histogram of region1, or the average value of the G values of all pixels in a certain color interval in the color histogram of region1. Or it is a value calculated according to the G value of a preset pixel point in a certain color interval in the color histogram of region1 and a preset formula.

同样的,提取到的HSV颜色空间和Lab颜色空间中各个颜色维度的信息并用特征向量表示分别为:Similarly, the information of each color dimension in the extracted HSV color space and Lab color space is represented by feature vectors as follows:

[h1,h2,h3,h4,h5,h6,h7,h8];[s1,s2,s3,s4,s5,s6,s7,s8];[v1,v2,v3,v4,v5,v6,v7,v8][h 1 , h 2 , h 3 , h 4 , h 5 , h 6 , h 7 , h 8 ]; [s 1 , s 2 , s 3 , s 4 , s 5 , s 6 , s 7 , s 8 ]; [v 1 , v 2 , v 3 , v 4 , v 5 , v 6 , v 7 , v 8 ]

[l1,l2,l3,...,l14,l15,l16];[a1,a2,a3,...,a14,a15,a16];[b1,b2,b3,...,b14,b15,b16][l 1 ,l 2 ,l 3 ,...,l 14, l 15 ,l 16 ]; [a 1 ,a 2 ,a 3 ,...,a 14 ,a 15 ,a 16 ];[b 1 , b 2 , b 3 ,..., b 14 , b 15 , b 16 ]

其中,特征向量中每个具体值(如h1和a1)的获取方法可以根据前述提取RGB颜色空间中各个颜色维度的信息的方法一致,或者是可以根据提取RGB颜色空间中各个颜色维度的信息的结果和颜色空间转换公式进行转换,其中颜色空间转换公式可以从现有的颜色空间转换公式中获取。Wherein, the acquisition method of each specific value (such as h 1 and a 1 ) in the feature vector can be consistent with the aforementioned method of extracting the information of each color dimension in the RGB color space, or can be based on the method of extracting the information of each color dimension in the RGB color space The result of the information and the color space conversion formula are converted, wherein the color space conversion formula can be obtained from the existing color space conversion formula.

特征表达模块204,用于将从所述至少两个区域中提取到的多个颜色空间的色彩信息组合,得到表示所述目标图像的组合特征向量。The feature expression module 204 is configured to combine the color information of multiple color spaces extracted from the at least two regions to obtain a combined feature vector representing the target image.

在提取到每个区域在多个颜色空间的色彩信息后,将多个区域在多个颜色空间的色彩信息进行组合。例如,通过特征向量来表示每个区域在多个颜色空间的色彩信息,再将多个特征向量进行拼接,来得到表示目标图像的组合特征向量,或者是通过核函数的数学方法来进行组合,得到表示目标图像的组合特征向量。After the color information of each area in multiple color spaces is extracted, the color information of multiple areas in multiple color spaces is combined. For example, the color information of each area in multiple color spaces is represented by the feature vector, and then the multiple feature vectors are spliced to obtain the combined feature vector representing the target image, or combined by the mathematical method of the kernel function, A combined feature vector representing the target image is obtained.

作为一种可选的实施方式,在一个实施例中,特征表达模块204具体用于:As an optional implementation manner, in one embodiment, the feature expression module 204 is specifically used to:

将每个区域在每个颜色空间的各个颜色维度的信息组合,得到每个区域中各个颜色空间的组合特征向量;Combining the information of each color dimension of each region in each color space to obtain the combined feature vector of each color space in each region;

将所述每个区域中各个颜色空间的组合特征向量进行拼接,得到每个区域在多个颜色空间的组合特征向量;splicing the combined eigenvectors of each color space in each region to obtain the combined eigenvectors of each region in multiple color spaces;

将所述每个区域在多个颜色空间的组合特征向量进行拼接,得到所述目标图像在所述至少两个区域的多个颜色空间的组合特征向量。The combined feature vectors of each area in multiple color spaces are spliced to obtain combined feature vectors of the target image in multiple color spaces of the at least two areas.

其中,特征表达模块204将每个区域在每个颜色空间的各个颜色维度的信息组合,得到每个区域中各个颜色空间的组合特征向量,即为对于region1这一区域,可将表示该区域在每个颜色空间的各个颜色维度的信息的特征向量进行拼接,得到该区域中各个颜色空间的特征向量:Among them, the feature expression module 204 combines the information of each color dimension of each region in each color space to obtain the combined feature vector of each color space in each region, that is, for the region of region1, it can represent that the region is in The eigenvectors of the information of each color dimension of each color space are concatenated to obtain the eigenvectors of each color space in this area:

[r1,r2,...,r7,r8,g1,g2,...,g7,g8,b1,b2,...,b7,b8][r 1 , r 2 ,..., r 7 , r 8 , g 1 , g 2 ,..., g 7 , g 8 , b 1 , b 2 ,..., b 7 , b 8 ]

[h1,h2,...,h7,h8,s1,s2,...,s7,s8,v1,v2,...,v7,v8][h 1 , h 2 ,..., h 7 , h 8 , s 1 , s 2 ,..., s 7 , s 8 , v 1 , v 2 ,..., v 7 , v 8 ]

[l1,l2,...,l15,l16,a1,a2,...,a15,a16,b1,b2,...,b16][l 1 , l 2 ,..., l 15 , l 16 , a 1 , a 2 ,..., a 15 , a 16 , b 1 , b 2 ,..., b 16 ]

接着,特征表达模块204将每个区域中各个颜色空间的组合特征向量进行拼接,即将一个区域的所有颜色空间的特征向量拼接为一个组合特征向量,对于region1这一区域,可将表示各个颜色空间的信息的特征向量进行拼接,得到该区域在多个颜色空间的组合特征向量:Next, the feature expression module 204 splices the combined feature vectors of each color space in each region, that is, splicing the feature vectors of all color spaces in a region into a combined feature vector. For the region region1, each color space can be represented by The eigenvectors of the information are spliced to obtain the combined eigenvectors of the region in multiple color spaces:

[r1,...,r8,g1,...,g8,b1,...,b8,h1,...,h8,s1,...,s8,v1,...,v8,l1,...,l8,a1,...,a8,b1,...,b8][r 1 ,...,r 8 ,g 1 ,...,g 8 ,b 1 ,...,b 8 ,h 1 ,...,h 8 ,s 1 ,...,s 8 ,v 1 ,...,v 8 ,l 1 ,...,l 8 ,a 1 ,...,a 8 ,b 1 ,...,b 8 ]

=[RGB1HSV1LAB1]=[RGB 1 HSV 1 LAB 1 ]

因此,目标图像划分后的每个区域都可以得到在多个颜色空间的组合特征向量,特征表达模块204将每个区域在多个颜色空间的组合特征向量进行拼接,得到目标图像在至少两个区域的多个颜色空间的组合特征向量:Therefore, each region after the target image is divided can obtain combined feature vectors in multiple color spaces, and the feature expression module 204 splices the combined feature vectors of each region in multiple color spaces to obtain the target image in at least two Combined eigenvectors of multiple color spaces for a region:

[Region1,Region2,Region3][Region1, Region2, Region3]

=[RGB1HSV1LAB1,RGB2HSV2LAB2,RGB3HSV3LAB3]=[RGB 1 HSV 1 LAB 1 , RGB 2 HSV 2 LAB 2 , RGB 3 HSV 3 LAB 3 ]

通过特征表达模块204完成了对目标图像的特征提取,得到了表示目标图像的组合特征向量。The feature extraction of the target image is completed through the feature expression module 204, and a combined feature vector representing the target image is obtained.

作为一种可选的实施方式,在一个实施例中,本发明提供的特征提取装置还包括:As an optional implementation, in one embodiment, the feature extraction device provided by the present invention further includes:

降维模块,用于对表示所述目标图像的组合特征向量进行降维处理。A dimensionality reduction module, configured to perform dimensionality reduction processing on the combined feature vector representing the target image.

在得到表示目标图像的组合特征向量之后,为了使表达式更简洁,便于后续使用,可将表示目标图像的组合特征向量进行降维处理,以减少后续使用时的运算复杂度,提高运算效率。After obtaining the combined feature vector representing the target image, in order to make the expression more concise and convenient for subsequent use, the combined feature vector representing the target image can be subjected to dimensionality reduction processing to reduce the computational complexity of subsequent use and improve computational efficiency.

例如,降维方法有主成分分析(Principal Component Analysis,PCA),可通过PCA对表示目标图像的组合特征向量进行降维。For example, the dimensionality reduction method includes principal component analysis (Principal Component Analysis, PCA), which can reduce the dimensionality of the combined feature vector representing the target image through PCA.

同时降维的方法不限于以上提到的PCA,还可以是反向特征消除、组合数等任意降维方法对表示目标图像的组合特征向量进行降维。At the same time, the method of dimensionality reduction is not limited to the PCA mentioned above, and any dimensionality reduction method such as reverse feature elimination and combination number can also be used to reduce the dimensionality of the combined feature vector representing the target image.

作为一种可选的实施方式,在一个实施例中,本发明提供的特征提取装置所提取的目标图像的组合特征向量可以用于图像的识别和跟踪,在用于图像识别和跟踪时,可以包括:As an optional implementation, in one embodiment, the combined feature vector of the target image extracted by the feature extraction device provided by the present invention can be used for image recognition and tracking, and when used for image recognition and tracking, can include:

计算所述表示所述目标图像的组合特征向量与图像库中样本图像的特征向量之间的距离以判断图像之间的相似性;calculating the distance between the combined feature vector representing the target image and the feature vector of the sample image in the image library to judge the similarity between the images;

选取所述图像库中与所述目标图像的相似性最高的样本图像为图像识别结果;Selecting the sample image with the highest similarity to the target image in the image library as the image recognition result;

根据所述图像识别结果对所述目标图像进行跟踪。The target image is tracked according to the image recognition result.

其中,可以计算降维之后的表示目标图像的组合特征向量或者是降维之前的表示目标图像的组合特征向量与图像库中样本图像的特征向量之间的距离。Wherein, the combined feature vector representing the target image after dimension reduction or the distance between the combined feature vector representing the target image before dimension reduction and the feature vector of the sample image in the image library can be calculated.

优选的,计算降维之后的表示目标图像的组合特征向量与图像库中样本图像的特征向量之间的距离,可以进一步提高运算的效率,降低运算复杂度。Preferably, calculating the distance between the combined feature vector representing the target image after dimensionality reduction and the feature vector of the sample image in the image library can further improve the efficiency of the operation and reduce the complexity of the operation.

其中,图像库中可包含多个样本图像的信息。例如,图像库中包括多个样本图像的名称、编号及特征向量等。比如包括A用户图像的名称、编号与A用户图像的特征向量,通过A用户图像的名称可以在图像库中唯一标识该样本,通过A用户图像的特征向量可以用于表达A用户图像的特征。Wherein, the image library may contain information of multiple sample images. For example, the image library includes names, serial numbers, and feature vectors of multiple sample images. For example, it includes the name and serial number of user A's image, and the feature vector of user A's image. The name of user A's image can uniquely identify the sample in the image library, and the feature vector of user A's image can be used to express the characteristics of user A's image.

在进行距离计算时,可以通过距离公式进行计算,距离公式包括但不限于欧式距离、明氏距离、马氏距离。具体使用哪个距离公式可以根据需要进行选择。距离公式可从现有技术中进行获取,此处不再赘述。对于不同的距离公式有不同的确定相似性的方法,例如,根据欧式距离得到的距离值越小,表明图像之间的相似度越大。When calculating the distance, the distance formula can be used for calculation, and the distance formula includes but not limited to Euclidean distance, Mingren distance, and Mahalanobis distance. Which distance formula to use can be selected according to needs. The distance formula can be obtained from the prior art, and will not be repeated here. There are different methods for determining similarity for different distance formulas. For example, the smaller the distance value obtained according to the Euclidean distance, the greater the similarity between images.

在计算表示目标图像的组合特征向量与图像库中样本图像的特征向量之间的距离时,可以将表示目标图像的组合特征向量与图像库中多个样本图像的特征向量分别进行计算,以获取与目标图像相似度最高的图像,从而得到图像识别结果,即目标图像中是否包含某一目标对象。When calculating the distance between the combined feature vector representing the target image and the feature vectors of the sample images in the image library, the combined feature vector representing the target image and the feature vectors of multiple sample images in the image library can be calculated separately to obtain The image with the highest similarity to the target image is used to obtain the image recognition result, that is, whether the target image contains a certain target object.

例如,将M图像进行特征提取,得到表示M图像的组合特征向量x,若图像库中包括A用户图像、B用户图像、C用户图像,其中A用户图像的特征向量为ya,B用户图像的特征向量为yb,C用户图像的特征向量为yc,则根据欧式距离分别计算特征向量x与ya,特征向量x与yb,特征向量x与yc的距离。若计算得到特征向量x与yb的距离最小,识别B用户图像为与目标图像最相似,目标图像中包括B用户。For example, the M image is subjected to feature extraction to obtain the combined feature vector x representing the M image. If the image library includes A user image, B user image, and C user image, the feature vector of A user image is y a , and the B user image The feature vector of user C is y b , and the feature vector of C user image is y c , then calculate the distances between feature vectors x and y a , feature vectors x and y b , and feature vectors x and y c according to the Euclidean distance. If the calculated distance between the eigenvectors x and y b is the smallest, the image of user B is identified as the most similar to the target image, and the target image includes user B.

在得到对目标图像的识别结果后,可以根据图像识别结果对目标图像进行跟踪,具体的是对目标图像中识别到的目标对象进行跟踪。例如,对M图像中的B用户进行跟踪。After the recognition result of the target image is obtained, the target image can be tracked according to the image recognition result, specifically, the target object recognized in the target image can be tracked. For example, the B user in the M image is tracked.

在进行图像跟踪时,可以选择现有的图像跟踪算法进行跟踪,此处不再赘述。When performing image tracking, an existing image tracking algorithm can be selected for tracking, which will not be repeated here.

由于表示目标图像的组合特征向量是特征提取的结果,可以用于表示目标图像,因此可以根据特征提取的结果对目标图像中包括的内容进行识别和跟踪。Since the combined feature vector representing the target image is the result of feature extraction and can be used to represent the target image, the content included in the target image can be identified and tracked according to the result of feature extraction.

若对目标图像的特征提取的准确度越高,则图像识别和图像跟踪的准确度会越高,若特征提取的准确度不高,则图像识别和图像跟踪的准确度也会降低。If the accuracy of feature extraction of the target image is higher, the accuracy of image recognition and image tracking will be higher; if the accuracy of feature extraction is not high, the accuracy of image recognition and image tracking will also be reduced.

同时,除了进行图像识别和图像跟踪以外,还可以进行图像识别以外的其他的图像处理操作,例如,图像检索,对于目标图像的特征提取的越准确,则对于后续进行其他图像处理操作时的准确度和效率越高。At the same time, in addition to image recognition and image tracking, other image processing operations other than image recognition can also be performed, such as image retrieval. The more accurate the feature extraction of the target image is, the more accurate it is for subsequent other image processing operations. Higher degree and efficiency.

本发明实施例中,获取模块获取目标图像;区域划分模块按照所述目标图像中人物直立的方向将所述目标图像划分为至少两个区域;多颜色空间处理模块提取每个区域在多个颜色空间的色彩信息;特征表达模块将从所述至少两个区域中提取到的多个颜色空间的色彩信息组合,得到表示所述目标图像的组合特征向量。通过将目标图像划分区域,并在每个区域的多颜色空间提取色彩信息,从多个维度对图像的色彩进行了表达,充分体现了图像不同部分的特征及颜色分布,使得无论在何种光照条件下的图像都可以准确的表示图像。通过多区域及多颜色空间进行特征提取从而实现了准确地提取图像的特征的目的。In the embodiment of the present invention, the acquisition module acquires the target image; the area division module divides the target image into at least two areas according to the upright direction of the person in the target image; the multi-color space processing module extracts each area in multiple colors Space color information; the feature expression module combines the color information of multiple color spaces extracted from the at least two regions to obtain a combined feature vector representing the target image. By dividing the target image into regions and extracting color information in the multi-color space of each region, the color of the image is expressed from multiple dimensions, fully reflecting the characteristics and color distribution of different parts of the image, so that no matter what kind of lighting The image under the conditions can accurately represent the image. The purpose of extracting the features of the image is realized accurately through the feature extraction of multiple regions and multiple color spaces.

本发明根据目标图像中人物直立的方向划分图像的空间区域,在每个区域中,分别提取多个颜色空间的色彩信息,将每个颜色空间的三维直方图拼接为单维,再连接该区域不同颜色空间的直方图,以及连接所有区域的直方图获得多区域多颜色空间的组合特征向量,从而克服了在目标对象的跟踪识别中的局限性,增加颜色空间特征的信息量,同时高效表征目标对象的空间信息。The present invention divides the spatial regions of the image according to the upright direction of the person in the target image, extracts color information of multiple color spaces in each region, stitches the three-dimensional histograms of each color space into a single dimension, and then connects the regions The histograms of different color spaces and the histograms of all regions are connected to obtain the combined feature vector of multi-region and multi-color spaces, thereby overcoming the limitations in the tracking and identification of target objects, increasing the amount of information of color space features, and efficiently representing Spatial information of the target object.

再将获得的多区域多颜色空间的组合特征向量降维,以减小运算量并提高了鲁棒性,之后再根据获得的多区域多颜色空间的组合特征向量计算图像之间的相似性来对目标图像进行识别和跟踪。Then reduce the dimensionality of the obtained combined eigenvectors of multi-region and multi-color spaces to reduce the amount of computation and improve the robustness, and then calculate the similarity between images according to the obtained combined eigenvectors of multi-region and multi-color spaces. Identify and track target images.

实施例Example

本发明还提供一种图像识别装置,所述图像识别装置包括:The present invention also provides an image recognition device, which includes:

获取模块,用于获取目标图像;An acquisition module, configured to acquire a target image;

区域划分模块,用于按照所述目标图像中人物直立的方向将所述目标图像划分为至少两个区域;An area division module, configured to divide the target image into at least two areas according to the upright direction of the person in the target image;

多颜色空间处理模块,用于提取每个区域在多个颜色空间的色彩信息;A multi-color space processing module, used to extract color information of each region in multiple color spaces;

特征表达模块,用于将从所述至少两个区域中提取到的多个颜色空间的色彩信息组合,得到表示所述目标图像的组合特征向量;A feature expression module, configured to combine the color information of multiple color spaces extracted from the at least two regions to obtain a combined feature vector representing the target image;

图像识别模块,用于计算所述表示所述目标图像的降维后的组合特征向量与图像库中样本图像的特征向量之间的距离以判断图像之间的相似性,选取所述图像库中与所述目标图像的相似性最高的样本图像为图像识别结果,根据所述图像识别结果对所述目标图像进行跟踪。The image recognition module is used to calculate the distance between the combined feature vector representing the dimensionality reduction of the target image and the feature vector of the sample image in the image library to judge the similarity between the images, and select the image in the image library The sample image with the highest similarity to the target image is an image recognition result, and the target image is tracked according to the image recognition result.

作为一种优选的实施方式,本发明装置还包括:As a preferred embodiment, the device of the present invention also includes:

降维模块,用于对表示所述目标图像的组合特征向量进行降维处理。A dimensionality reduction module, configured to perform dimensionality reduction processing on the combined feature vector representing the target image.

降维模块可以在计算所述表示所述目标图像的组合特征向量与图像库中样本图像的特征向量之间的距离之前对表示所述目标图像的组合特征向量进行降维处理。The dimensionality reduction module may perform dimensionality reduction processing on the combined feature vector representing the target image before calculating the distance between the combined feature vector representing the target image and the feature vectors of the sample images in the image library.

在得到表示目标图像的组合特征向量之后,为了使表达式更简洁,便于后续使用,可将表示目标图像的组合特征向量进行降维处理,以减少后续使用时的运算复杂度,提高运算效率。After obtaining the combined feature vector representing the target image, in order to make the expression more concise and convenient for subsequent use, the combined feature vector representing the target image can be subjected to dimensionality reduction processing to reduce the computational complexity of subsequent use and improve computational efficiency.

所述降维的方法有主成分分析(Principal Component Analysis,PCA),可通过PCA对表示目标图像的组合特征向量进行降维。The dimensionality reduction method includes principal component analysis (Principal Component Analysis, PCA), which can reduce the dimensionality of the combined feature vector representing the target image through PCA.

同时降维的方法不限于以上提到的PCA,还可以是反向特征消除、组合数等任意降维方法对表示目标图像的组合特征向量进行降维。At the same time, the method of dimensionality reduction is not limited to the PCA mentioned above, and any dimensionality reduction method such as reverse feature elimination and combination number can also be used to reduce the dimensionality of the combined feature vector representing the target image.

对于图像识别装置的有关描述请参照上述特征提取装置中相关步骤的描述。此处不再赘述。For the relevant description of the image recognition device, please refer to the description of the relevant steps in the above-mentioned feature extraction device. I won't repeat them here.

实施例Example

请参照图4,图4是本发明实施例提供的电子设备1的示意图。所述电子设备1包括存储器20、处理器30以及存储在所述存储器20中并可在所述处理器30上运行的程序40,例如特征提取程序。所述处理器30执行所述程序40时实现上述特征提取方法实施例中的步骤,例如图1所示的步骤S10~S13;或者,所述处理器30执行所述程序40时实现上述装置实施例中各模块/单元的功能,例如模块201~204。Please refer to FIG. 4 , which is a schematic diagram of an electronic device 1 provided by an embodiment of the present invention. The electronic device 1 includes a memory 20 , a processor 30 and a program 40 stored in the memory 20 and executable on the processor 30 , such as a feature extraction program. When the processor 30 executes the program 40, it realizes the steps in the embodiment of the above feature extraction method, such as steps S10 to S13 shown in FIG. 1; or, when the processor 30 executes the program 40, it realizes the implementation of the above device The functions of each module/unit in the example, such as modules 201-204.

示例性的,所述程序40可以被分割成一个或多个模块/单元,所述一个或者多个模块/单元被存储在所述存储器20中,并由所述处理器30执行,以完成本发明。所述一个或多个模块/单元可以是能够完成特定功能的一系列程序指令段,该指令段用于描述所述程序40在所述电子设备1中的执行过程。例如,所述程序40可以被分割成图3中的获取模块201、区域划分模块202、多颜色空间处理模块203和特征表达模块204,各模块具体功能参见前述实施例。Exemplarily, the program 40 can be divided into one or more modules/units, and the one or more modules/units are stored in the memory 20 and executed by the processor 30 to complete this invention. The one or more modules/units may be a series of program instruction segments capable of accomplishing specific functions, and the instruction segments are used to describe the execution process of the program 40 in the electronic device 1 . For example, the program 40 can be divided into an acquisition module 201, an area division module 202, a multi-color space processing module 203, and a feature expression module 204 in FIG.

所述电子设备1可以是桌上型计算机、笔记本电脑、掌上电脑及云端服务器等计算机设备,还可以是嵌入式计算设备,例如摄像机等。本领域技术人员可以理解,所述示意图4仅仅是电子设备1的示例,并不构成对电子设备1的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件,例如所述电子设备1还可以包括输入输出设备、网络接入设备、总线等。The electronic device 1 may be a computer device such as a desktop computer, a notebook computer, a palmtop computer, or a cloud server, or may be an embedded computing device such as a video camera. Those skilled in the art can understand that the schematic diagram 4 is only an example of the electronic device 1, and does not constitute a limitation to the electronic device 1. It may include more or less components than those shown in the figure, or combine certain components, or be different. For example, the electronic device 1 may also include input and output devices, network access devices, buses, and the like.

所称处理器30可以是中央处理单元(Central Processing Unit,CPU),还可以是其他通用处理器、数字信号处理器(Digital SignalProcessor,DSP)、专用集成电路(Application Specific IntegratedCircuit,ASIC)、现成可编程门阵列(Field-Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者该处理器30也可以是任何常规的处理器等,所述处理器30是所述电子设备1的控制中心,利用各种接口和线路连接整个电子设备1的各个部分。The so-called processor 30 may be a central processing unit (Central Processing Unit, CPU), and may also be other general-purpose processors, digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), off-the-shelf Field-Programmable Gate Array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or the processor 30 can also be any conventional processor, etc., the processor 30 is the control center of the electronic device 1, and uses various interfaces and lines to connect the entire electronic device 1. various parts.

所述存储器20可用于存储所述程序40和/或模块/单元,所述处理器30通过运行或执行存储在所述存储器20内的计算机程序和/或模块/单元,以及调用存储在存储器20内的数据,实现所述电子设备1的各种功能。所述存储器20可主要包括存储程序区和存储数据区,其中,存储程序区可存储操作装置、至少一个功能所需的应用程序(比如声音播放功能、图像播放功能等)等;存储数据区可存储根据电子设备1的使用所创建的数据(比如音频数据、视频数据等)等。此外,存储器20可以包括高速随机存取存储器,还可以包括非易失性存储器,例如硬盘、内存、插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)、至少一个磁盘存储器件、闪存器件、或其他易失性固态存储器件。The memory 20 can be used to store the program 40 and/or module/unit, and the processor 30 runs or executes the computer program and/or module/unit stored in the memory 20, and calls the computer program stored in the memory 20 The data in it realizes various functions of the electronic device 1 . The memory 20 can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating device, at least one function required application program (such as a sound playback function, an image playback function, etc.) and the like; the storage data area can be Data created according to use of the electronic device 1 (such as audio data, video data, etc.) and the like are stored. In addition, the memory 20 can include a high-speed random access memory, and can also include a non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, flash memory card (Flash Card), at least one magnetic disk storage device, flash memory device, or other volatile solid state storage devices.

所述电子设备1集成的模块/单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本发明实现上述实施例方法中的全部或部分流程,也可以通过程序来指令相关的硬件来完成,所述的程序可存储于一计算机可读存储介质中,该程序在被处理器执行时,可实现上述各个方法实施例的步骤。其中,所述程序包括程序代码,所述程序代码可以为源代码形式、对象代码形式、可执行文件或某些中间形式等。所述计算机可读介质可以包括:能够携带所述程序代码的任何实体或装置、记录介质、U盘、移动硬盘、磁碟、光盘、计算机存储器、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、电载波信号、电信信号以及软件分发介质等。需要说明的是,所述计算机可读介质包含的内容可以根据司法管辖区内立法和专利实践的要求进行适当的增减,例如在某些司法管辖区,根据立法和专利实践,计算机可读介质不包括电载波信号和电信信号。If the integrated modules/units of the electronic device 1 are realized in the form of software function units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the present invention realizes all or part of the processes in the methods of the above embodiments, and can also be completed by instructing related hardware through a program. The program can be stored in a computer-readable storage medium. When executed by a processor, the steps in the foregoing method embodiments can be realized. Wherein, the program includes program code, and the program code may be in the form of source code, object code, executable file or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the program code, a recording medium, a U disk, a removable hard disk, a magnetic disk, an optical disk, a computer memory, a read-only memory (ROM, Read-Only Memory), Random Access Memory (RAM, Random Access Memory), electrical carrier signals, telecommunication signals, and software distribution media, etc. It should be noted that the content contained in the computer-readable medium may be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, computer-readable media Excludes electrical carrier signals and telecommunication signals.

在本发明所提供的几个实施例中,应该理解到,所揭露的方法和装置,也可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述模块的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。In the several embodiments provided by the present invention, it should be understood that the disclosed methods and devices may also be implemented in other ways. For example, the device embodiments described above are only illustrative. For example, the division of the modules is only a logical function division, and there may be other division methods in actual implementation.

最后应说明的是,以上实施例仅用以说明本发明的技术方案而非限制,尽管参照较佳实施例对本发明进行了详细说明,本领域的普通技术人员应当理解,可以对本发明的技术方案进行修改或等同替换,而不脱离本发明技术方案的精神和范围。Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention without limitation. Although the present invention has been described in detail with reference to the preferred embodiments, those of ordinary skill in the art should understand that the technical solutions of the present invention can be Modifications or equivalent replacements can be made without departing from the spirit and scope of the technical solutions of the present invention.

Claims (11)

1. a kind of feature extracting method, it is characterised in that methods described includes:
Obtain target image;
The target image is divided at least two regions according to the upright direction of personage in the target image;
Extract color information of each region in multiple color spaces;
The color information of the multiple color spaces extracted from least two region is combined, obtains representing the target The assemblage characteristic vector of image.
2. the method as described in claim 1, it is characterised in that believe in the color of multiple color spaces in each region of extraction Breath includes:
Each region is extracted in multiple color spaces according to color histogram and the information of each color dimension and uses characteristic vector It is indicated.
3. method as claimed in claim 2, it is characterised in that it is described will be extracted from least two region it is multiple The color information combination of color space, obtains representing that the assemblage characteristic vector of the target image includes:
By each region in the information combination of each color dimension of each color space, it is empty to obtain each color in each region Between assemblage characteristic vector;
The assemblage characteristic vector of each color space in each region is spliced, obtains each region in multiple colors The assemblage characteristic vector in space;
Each region is spliced in the assemblage characteristic vector of multiple color spaces, obtains the target image described The assemblage characteristic vector of multiple color spaces at least two regions.
4. the method as described in claim 1, it is characterised in that methods described also includes:
Dimension-reduction treatment is carried out to the assemblage characteristic vector for representing the target image.
5. a kind of image-recognizing method, it is characterised in that methods described includes:
Obtain target image;
The target image is divided at least two regions according to the upright direction of personage in the target image;
Extract color information of each region in multiple color spaces;
The color information of the multiple color spaces extracted from least two region is combined, obtains representing the target The assemblage characteristic vector of image;
Calculate in the assemblage characteristic vector for representing the target image and image library between the characteristic vector of sample image Distance is to judge the similitude in target image and described image storehouse between sample image;
The similitude highest sample image chosen in described image storehouse with the target image is image recognition result;
The target image is tracked according to described image recognition result.
6. image-recognizing method as claimed in claim 5, it is characterised in that calculate the expression target image described Assemblage characteristic vector and sample image in image library the distance between characteristic vector to judge target image and described image Also include before similitude in storehouse between sample image:
Dimension-reduction treatment is carried out to the assemblage characteristic vector for representing the target image.
7. a kind of feature deriving means, it is characterised in that described device includes:
Acquisition module, for obtaining target image;
Region division module, for being divided into the target image at least according to the upright direction of personage in the target image Two regions;
Multiple color spaces processing module, for extracting color information of each region in multiple color spaces;
Feature representation module, for the color information group for the multiple color spaces that will be extracted from least two region Close, obtain representing the assemblage characteristic vector of the target image.
8. feature deriving means as claimed in claim 7, it is characterised in that described device also includes:
Dimensionality reduction module, for carrying out dimension-reduction treatment to the assemblage characteristic vector for representing the target image.
9. a kind of pattern recognition device, it is characterised in that described device includes:
Acquisition module, for obtaining target image;
Region division module, for being divided into the target image at least according to the upright direction of personage in the target image Two regions;
Multiple color spaces processing module, for extracting color information of each region in multiple color spaces;
Feature representation module, for the color information group for the multiple color spaces that will be extracted from least two region Close, obtain representing the assemblage characteristic vector of the target image;
Picture recognition module, for calculate the assemblage characteristic vector after the dimensionality reduction for representing the target image with image library The distance between characteristic vector of sample image to judge the similitude between image, choose in described image storehouse with the target The similitude highest sample image of image is image recognition result, and the target image is entered according to described image recognition result Line trace.
10. device as claimed in claim 9, it is characterised in that described device also includes:
Dimensionality reduction module, for representing that the assemblage characteristic vector of the target image carries out dimension-reduction treatment.
11. a kind of electronic equipment, it is characterised in that the electronic equipment includes memory and processor, and the memory is used for At least one instruction is stored, the processor is realized when being used to perform the program stored in memory as appointed in claim 1-4 One feature extracting method of meaning and/or such as claim 5-6 described image recognition methods.
CN201710766531.5A 2017-08-30 2017-08-30 Feature extracting method, image-recognizing method, device and electronic equipment Pending CN107506738A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710766531.5A CN107506738A (en) 2017-08-30 2017-08-30 Feature extracting method, image-recognizing method, device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710766531.5A CN107506738A (en) 2017-08-30 2017-08-30 Feature extracting method, image-recognizing method, device and electronic equipment

Publications (1)

Publication Number Publication Date
CN107506738A true CN107506738A (en) 2017-12-22

Family

ID=60693080

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710766531.5A Pending CN107506738A (en) 2017-08-30 2017-08-30 Feature extracting method, image-recognizing method, device and electronic equipment

Country Status (1)

Country Link
CN (1) CN107506738A (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108256588A (en) * 2018-02-12 2018-07-06 兰州工业学院 A kind of several picture identification feature extracting method and system
CN108822186A (en) * 2018-07-06 2018-11-16 广东石油化工学院 A kind of molecular biology test extraction mortar and its extracting method
CN110659541A (en) * 2018-06-29 2020-01-07 深圳云天励飞技术有限公司 Image recognition method, device and storage medium
CN110674834A (en) * 2018-07-03 2020-01-10 百度在线网络技术(北京)有限公司 Geo-fence identification method, device, equipment and computer-readable storage medium
CN113158715A (en) * 2020-11-05 2021-07-23 西安天伟电子系统工程有限公司 Ship detection method and device
CN113223041A (en) * 2021-06-25 2021-08-06 上海添音生物科技有限公司 Method, system and storage medium for automatically extracting target area in image
CN115050487A (en) * 2022-06-10 2022-09-13 奇医天下大数据科技(珠海横琴)有限公司 Internet medical service management system based on artificial intelligence

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102072885A (en) * 2010-12-06 2011-05-25 浙江大学 Machine vision-based paddy neck blast infection degree grading method
CN105187785A (en) * 2015-08-31 2015-12-23 桂林电子科技大学 Cross-checkpost pedestrian identification system and method based on dynamic obvious feature selection
CN105303152A (en) * 2014-07-15 2016-02-03 中国人民解放军理工大学 Human body re-recognition method
CN105630906A (en) * 2015-12-21 2016-06-01 苏州科达科技股份有限公司 Person searching method, apparatus and system
CN106023228A (en) * 2016-06-02 2016-10-12 公安部物证鉴定中心 Counterfeit money ultraviolet fluorescent image segmentation method based on support vector machine

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102072885A (en) * 2010-12-06 2011-05-25 浙江大学 Machine vision-based paddy neck blast infection degree grading method
CN105303152A (en) * 2014-07-15 2016-02-03 中国人民解放军理工大学 Human body re-recognition method
CN105187785A (en) * 2015-08-31 2015-12-23 桂林电子科技大学 Cross-checkpost pedestrian identification system and method based on dynamic obvious feature selection
CN105630906A (en) * 2015-12-21 2016-06-01 苏州科达科技股份有限公司 Person searching method, apparatus and system
CN106023228A (en) * 2016-06-02 2016-10-12 公安部物证鉴定中心 Counterfeit money ultraviolet fluorescent image segmentation method based on support vector machine

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
林晓津: "基于视觉颜色处理机制的运动人体识别算法", 《中国优秀硕士学位论文全文数据库》 *

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108256588A (en) * 2018-02-12 2018-07-06 兰州工业学院 A kind of several picture identification feature extracting method and system
CN110659541A (en) * 2018-06-29 2020-01-07 深圳云天励飞技术有限公司 Image recognition method, device and storage medium
CN110674834A (en) * 2018-07-03 2020-01-10 百度在线网络技术(北京)有限公司 Geo-fence identification method, device, equipment and computer-readable storage medium
CN108822186A (en) * 2018-07-06 2018-11-16 广东石油化工学院 A kind of molecular biology test extraction mortar and its extracting method
CN113158715A (en) * 2020-11-05 2021-07-23 西安天伟电子系统工程有限公司 Ship detection method and device
CN113223041A (en) * 2021-06-25 2021-08-06 上海添音生物科技有限公司 Method, system and storage medium for automatically extracting target area in image
CN113223041B (en) * 2021-06-25 2024-01-12 上海添音生物科技有限公司 Method, system and storage medium for automatically extracting target area in image
CN115050487A (en) * 2022-06-10 2022-09-13 奇医天下大数据科技(珠海横琴)有限公司 Internet medical service management system based on artificial intelligence

Similar Documents

Publication Publication Date Title
CN107506738A (en) Feature extracting method, image-recognizing method, device and electronic equipment
CN108765278B (en) Image processing method, mobile terminal and computer readable storage medium
Aquino et al. vitisBerry: An Android-smartphone application to early evaluate the number of grapevine berries by means of image analysis
WO2019169772A1 (en) Picture processing method, electronic apparatus, and storage medium
WO2020143330A1 (en) Facial image capturing method, computer-readable storage medium and terminal device
CN102667810B (en) Face recognition in digital images
WO2019100282A1 (en) Face skin color recognition method, device and intelligent terminal
CN113011403B (en) Gesture recognition method, system, medium and device
US9292733B2 (en) Information processing device, information processing method, and program
WO2022174605A1 (en) Gesture recognition method, gesture recognition apparatus, and smart device
CN107944020A (en) Facial image lookup method and device, computer installation and storage medium
WO2020024744A1 (en) Image feature point detecting method, terminal device, and storage medium
CN109948420B (en) Face comparison method and device and terminal equipment
WO2023010758A1 (en) Action detection method and apparatus, and terminal device and storage medium
Qiao et al. Bird species recognition based on SVM classifier and decision tree
WO2020077869A1 (en) Image retrieval method, device, terminal, and storage medium
CN109871767B (en) Face recognition method, device, electronic device and computer-readable storage medium
CN107886110A (en) Method for detecting human face, device and electronic equipment
CN111161281A (en) Face region identification method and device and storage medium
CN113052194A (en) Garment color cognition system based on deep learning and cognition method thereof
US11189024B2 (en) Information processing apparatus and information processing method
CN111210410A (en) Method and device for detecting the state of a signal light
CN110991371B (en) Intelligent reading learning method based on coordinate recognition
CN108682021A (en) Rapid hand tracking, device, terminal and storage medium
KR100488014B1 (en) YCrCb color based human face location detection method

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination