CN108764325A - Image-recognizing method, device, computer equipment and storage medium - Google Patents

Image-recognizing method, device, computer equipment and storage medium Download PDF

Info

Publication number
CN108764325A
CN108764325A CN201810502263.0A CN201810502263A CN108764325A CN 108764325 A CN108764325 A CN 108764325A CN 201810502263 A CN201810502263 A CN 201810502263A CN 108764325 A CN108764325 A CN 108764325A
Authority
CN
China
Prior art keywords
image
area
current
probability
pixel
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.)
Granted
Application number
CN201810502263.0A
Other languages
Chinese (zh)
Other versions
CN108764325B (en
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.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen 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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201810502263.0A priority Critical patent/CN108764325B/en
Publication of CN108764325A publication Critical patent/CN108764325A/en
Application granted granted Critical
Publication of CN108764325B publication Critical patent/CN108764325B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • 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/214Generating training patterns; Bootstrap methods, e.g. bagging or boosting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/22Matching criteria, e.g. proximity measures
    • 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/44Local feature extraction by analysis of parts of the pattern, e.g. by detecting edges, contours, loops, corners, strokes or intersections; Connectivity analysis, e.g. of connected components

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • General Physics & Mathematics (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Evolutionary Biology (AREA)
  • Evolutionary Computation (AREA)
  • Artificial Intelligence (AREA)
  • General Engineering & Computer Science (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Multimedia (AREA)
  • Image Analysis (AREA)

Abstract

本发明涉及一种图像识别方法、装置、计算机设备和存储介质,所述方法包括:获取待识别目标的当前图像;从所述当前图像中获取当前像素点,根据所述当前像素点的位置确定对应的背景参考区域;根据所述背景参考区域计算所述当前像素点对应的背景相似度;根据已训练的图像目标识别模型对所述当前像素点对应的图像特征进行处理,得到所述当前像素点对应的第一概率,所述第一概率为所述当前像素点属于目标对象像素点的概率;计算得到所述当前图像中的各个像素点对应的背景相似度和第一概率,根据所述各个像素点对应的背景相似度和第一概率识别得到所述当前图像中目标对象所在的图像区域。上述方法图像识别准确度高。

The present invention relates to an image recognition method, device, computer equipment and storage medium. The method includes: obtaining a current image of an object to be recognized; obtaining a current pixel point from the current image, and determining according to the position of the current pixel point The corresponding background reference area; calculate the background similarity corresponding to the current pixel according to the background reference area; process the image feature corresponding to the current pixel according to the trained image target recognition model to obtain the current pixel The first probability corresponding to the point, the first probability is the probability that the current pixel belongs to the pixel of the target object; the background similarity and the first probability corresponding to each pixel in the current image are calculated, according to the The background similarity corresponding to each pixel and the first probability identify the image area where the target object is located in the current image. The image recognition accuracy of the above method is high.

Description

图像识别方法、装置、计算机设备和存储介质Image recognition method, device, computer equipment and storage medium

技术领域technical field

本发明涉及图像处理领域,特别是涉及图像识别方法、装置、计算机设备和存储介质。The invention relates to the field of image processing, in particular to an image recognition method, device, computer equipment and storage medium.

背景技术Background technique

随着科学技术的发展,图像中包括的信息越来越多,为了获取图像中的内容,需要对图像内容进行识别处理,例如在对监控图像进行分析时,需要从图像中识别出进行监控的目标对象。With the development of science and technology, more and more information is included in the image. In order to obtain the content in the image, it is necessary to identify and process the image content. target.

目前,当需要识别图像中的目标对象时,往往会根据图像背景的灰度值比较小将灰度值大于一定阈值的区域作为目标所在的区域,然而背景的灰度值也可能会很大或者目标的灰度值也可能会很小,因此,仅根据灰度值识别图像中目标对象的方法并不准确。At present, when it is necessary to identify the target object in the image, the area whose gray value is greater than a certain threshold is often regarded as the area where the target is located according to the relatively small gray value of the background of the image. However, the gray value of the background may also be large or the target The gray value of the image may also be very small, therefore, the method of identifying the target object in the image only based on the gray value is not accurate.

发明内容Contents of the invention

基于此,有必要针对上述的问题,提供一种图像识别方法、装置、计算机设备和存储介质,由于背景相似度能够反映像素点是否为背景,而利用模型得到的概率正面反映像素点是否为目标,结合像素点对应的背景相似度以及像素点属于目标对象像素点的概率识别得到目标对象所在的图像区域,图像识别准确度高。Based on this, it is necessary to provide an image recognition method, device, computer equipment, and storage medium for the above-mentioned problems. Since the background similarity can reflect whether a pixel is a background, the probability obtained by using the model positively reflects whether a pixel is a target. , combined with the background similarity corresponding to the pixel and the probability that the pixel belongs to the pixel of the target object to identify the image area where the target object is located, the image recognition accuracy is high.

一种图像识别方法,所述方法包括:获取待识别目标的当前图像;从所述当前图像中获取当前像素点,根据所述当前像素点的位置确定对应的背景参考区域;根据所述背景参考区域计算所述当前像素点对应的背景相似度;根据已训练的图像目标识别模型对所述当前像素点对应的图像特征进行处理,得到所述当前像素点对应的第一概率,所述第一概率为所述当前像素点属于目标对象像素点的概率;计算得到所述当前图像中的各个像素点对应的背景相似度和第一概率,根据所述各个像素点对应的背景相似度和第一概率识别得到所述当前图像中目标对象所在的图像区域。An image recognition method, the method comprising: acquiring a current image of an object to be identified; acquiring a current pixel from the current image, determining a corresponding background reference area according to the position of the current pixel; Calculate the background similarity corresponding to the current pixel in the region; process the image feature corresponding to the current pixel according to the trained image target recognition model to obtain the first probability corresponding to the current pixel, the first The probability is the probability that the current pixel belongs to the pixel of the target object; the background similarity and the first probability corresponding to each pixel in the current image are calculated, and according to the background similarity and the first probability corresponding to each pixel The image region where the target object is located in the current image is obtained through probabilistic identification.

一种图像识别装置,所述装置包括:当前图像获取模块,用于获取待识别目标的当前图像;背景区域确定模块,用于从所述当前图像中获取当前像素点,根据所述当前像素点的位置确定对应的背景参考区域;相似度计算模块,用于根据所述背景参考区域计算所述当前像素点对应的背景相似度;第一概率得到模块,用于根据已训练的图像目标识别模型对所述当前像素点对应的图像特征进行处理,得到所述当前像素点对应的第一概率,所述第一概率为所述当前像素点属于目标对象像素点的概率;目标区域识别模块,用于计算得到所述当前图像中的各个像素点对应的背景相似度和第一概率,根据所述各个像素点对应的背景相似度和第一概率识别得到所述当前图像中目标对象所在的图像区域。An image recognition device, the device comprising: a current image acquisition module, configured to acquire a current image of an object to be identified; a background area determination module, configured to acquire a current pixel from the current image, and according to the current pixel The position determines the corresponding background reference area; the similarity calculation module is used to calculate the background similarity corresponding to the current pixel point according to the background reference area; the first probability acquisition module is used to identify the model based on the trained image target The image feature corresponding to the current pixel is processed to obtain the first probability corresponding to the current pixel, and the first probability is the probability that the current pixel belongs to the pixel of the target object; the target area identification module uses Calculate the background similarity and first probability corresponding to each pixel in the current image, and identify the image area where the target object is located in the current image according to the background similarity and first probability corresponding to each pixel .

在其中一个实施例中,所述背景区域确定模块包括:第一区域获取单元,用于根据所述当前像素点的位置在所述当前图像上获取第一区域和第二区域,其中,所述第二区域为所述第一区域的子区域,所述当前像素点位于所述第二区域内部;第一区域确定单元,用于将所述第一区域和第二区域之间的非重叠图像区域作为所述背景参考区域。In one of the embodiments, the background area determination module includes: a first area acquisition unit, configured to acquire a first area and a second area on the current image according to the position of the current pixel point, wherein the The second area is a sub-area of the first area, and the current pixel is located inside the second area; the first area determination unit is configured to combine non-overlapping images between the first area and the second area area as the background reference area.

在其中一个实施例中,所述装置还包括:训练区域获取模块,用于获取训练图像,获取所述训练图像中的目标对象对应的训练区域;训练特征获取模块,用于获取所述训练区域中各个像素点对应的训练图像特征;训练模块,用于根据所述训练图像特征进行模型训练,得到将所述训练图像特征映射到最小的特征空间的特征映射函数以及所述特征空间的中心值。In one of the embodiments, the device further includes: a training area acquisition module, configured to acquire a training image, and acquire a training area corresponding to a target object in the training image; a training feature acquisition module, configured to acquire the training area The training image features corresponding to each pixel in the training module; the training module is used to perform model training according to the training image features, and obtain the feature mapping function that maps the training image features to the minimum feature space and the central value of the feature space .

在其中一个实施例中,所述装置还包括:第二区域获取单元,用于根据所述当前像素点的位置在所述当前图像上获取第三区域和第四区域,其中,所述第四区域为所述第三区域的子区域,所述当前像素点位于所述第四区域内部;第二区域确定单元,用于获取所述第三区域和第四区域之间的非重叠图像区域;第一统计单元,用于对所述非重叠图像区域对应的像素点的灰度值进行统计,得到第一统计结果,对所述第四区域对应的像素点的灰度值进行统计,得到第二统计结果;对比度特征得到单元,用于根据所述第一统计结果以及第二统计结果得到所述对比度特征。In one of the embodiments, the device further includes: a second area acquisition unit, configured to acquire a third area and a fourth area on the current image according to the position of the current pixel point, wherein the fourth area The area is a sub-area of the third area, and the current pixel point is located inside the fourth area; the second area determination unit is configured to obtain a non-overlapping image area between the third area and the fourth area; The first statistical unit is configured to perform statistics on the grayscale values of the pixels corresponding to the non-overlapping image areas to obtain a first statistical result, and to perform statistics on the grayscale values of the pixels corresponding to the fourth area to obtain the first statistical result. Two statistical results: a contrast feature obtaining unit, configured to obtain the contrast feature according to the first statistical result and the second statistical result.

在其中一个实施例中,所述目标区域识别模块包括:第二概率得到单元,用于根据所述背景相似度得到所述当前像素点对应的第二概率,其中,所述第二概率为所述当前像素点属于目标对象像素点的概率,所述第二概率与所述背景相似度呈负相关关系;目标概率得到单元,用于根据所述第一概率以及所述第二概率确定所述当前像素点对应的当前目标概率,所述当前目标概率为所述当前像素点属于目标对象像素点的概率;目标区域识别单元,用于根据所述当前图像中各个像素点对应的目标概率识别得到所述当前图像中目标对象所在的图像区域。In one of the embodiments, the target area identification module includes: a second probability obtaining unit, configured to obtain a second probability corresponding to the current pixel point according to the background similarity, wherein the second probability is the The probability that the current pixel point belongs to the pixel point of the target object, the second probability is negatively correlated with the background similarity; the target probability obtaining unit is used to determine the The current target probability corresponding to the current pixel point, the current target probability is the probability that the current pixel point belongs to the target object pixel point; the target area identification unit is used to identify and obtain according to the target probability corresponding to each pixel point in the current image The image area where the target object is located in the current image.

在其中一个实施例中,所述目标区域识别单元用于:获取所述当前图像中目标概率大于第一阈值的第一像素点;获取所述第一像素点对应的目标概率的分布特征;根据所述分布特征得到第二阈值;获取所述当前图像中目标概率大于所述第二阈值的第一像素点组合得到的区域,作为所述当前图像中目标对象所在的图像区域。In one of the embodiments, the target area identification unit is configured to: acquire the first pixel in the current image whose target probability is greater than the first threshold; acquire the distribution feature of the target probability corresponding to the first pixel; according to The distribution feature obtains a second threshold; and an area obtained by combining first pixels in the current image with a target probability greater than the second threshold is acquired as an image area where the target object is located in the current image.

一种计算机设备,包括存储器和处理器,所述存储器中存储有计算机程序,所述计算机程序被所述处理器执行时,使得所述处理器执行上述图像识别方法的步骤。A computer device includes a memory and a processor, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the processor is made to execute the steps of the above image recognition method.

一种计算机可读存储介质,其特征在于,所述计算机可读存储介质上存储有计算机程序,所述计算机程序被处理器执行时,使得所述处理器执行上述图像识别方法的步骤。A computer-readable storage medium, characterized in that a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the processor is made to execute the steps of the above-mentioned image recognition method.

上述图像识别方法、装置、计算机设备和存储介质,获取待识别目标的当前图像,从当前图像中获取当前像素点,根据当前像素点的位置确定对应的背景参考区域,根据背景参考区域计算当前像素点对应的背景相似度,根据已训练的图像目标识别模型对当前像素点对应的图像特征进行处理,得到当前像素点对应的第一概率,第一概率为当前像素点属于目标对象像素点的概率,计算得到当前图像中的各个像素点对应的背景相似度和第一概率,根据各个像素点对应的背景相似度和第一概率识别得到当前图像中目标对象所在的图像区域。由于背景相似度能够反映像素点是否为背景,而利用模型得到的概率正面反映像素点是否为目标,结合像素点对应的背景相似度以及像素点属于目标对象像素点的概率识别得到目标对象所在的图像区域,图像识别准确度高。The above image recognition method, device, computer equipment and storage medium acquire the current image of the target to be recognized, obtain the current pixel from the current image, determine the corresponding background reference area according to the position of the current pixel, and calculate the current pixel according to the background reference area. The background similarity corresponding to the point, according to the trained image target recognition model, the image feature corresponding to the current pixel is processed to obtain the first probability corresponding to the current pixel, the first probability is the probability that the current pixel belongs to the pixel of the target object , calculate the background similarity and first probability corresponding to each pixel in the current image, and identify the image area where the target object is located in the current image according to the background similarity and first probability corresponding to each pixel. Since the background similarity can reflect whether the pixel is the background, and the probability obtained by using the model positively reflects whether the pixel is the target, combined with the background similarity corresponding to the pixel and the probability that the pixel belongs to the pixel of the target object, the location of the target object can be obtained. Image area, image recognition accuracy is high.

附图说明Description of drawings

图1为一个实施例中提供的图像识别方法的应用环境图;Fig. 1 is the application environment diagram of the image recognition method provided in one embodiment;

图2为一个实施例中图像识别方法的流程图;Fig. 2 is the flowchart of image recognition method in an embodiment;

图3A为一个实施例中第一区域与第二区域的示意图;Figure 3A is a schematic diagram of a first area and a second area in one embodiment;

图3B为一个实施例中第一区域与第二区域的示意图;Fig. 3B is a schematic diagram of the first area and the second area in one embodiment;

图4为一个实施例中根据背景参考区域计算当前像素点对应的背景相似度的流程图;Fig. 4 is a flow chart of calculating the background similarity corresponding to the current pixel according to the background reference area in one embodiment;

图5为一个实施例中将背景参考区域分为多个子区域的示意图;Fig. 5 is a schematic diagram of dividing a background reference area into a plurality of sub-areas in an embodiment;

图6为一个实施例中根据已训练的图像目标识别模型对当前像素点对应的图像特征进行处理,得到当前像素点对应的第一概率的流程图;Fig. 6 is a flow chart of processing the image feature corresponding to the current pixel point according to the trained image target recognition model to obtain the first probability corresponding to the current pixel point;

图7A为一个实施例中得到图像目标识别模型的流程图;Fig. 7A is a flow chart of obtaining the image target recognition model in one embodiment;

图7B为一个实施例中训练图像的目标对象对应的区域的示意图;FIG. 7B is a schematic diagram of an area corresponding to a target object in a training image in an embodiment;

图8为一个实施例中得到当前像素点对应的对比度特征的流程图;Fig. 8 is a flow chart of obtaining the contrast feature corresponding to the current pixel point in one embodiment;

图9为一个实施例中得到当前像素点对应的灰度梯度特征的流程图;Fig. 9 is a flow chart of obtaining the gray gradient feature corresponding to the current pixel point in one embodiment;

图10为一个实施例中根据各个像素点对应的背景相似度和第一概率识别得到当前图像中目标对象所在的图像区域的流程图;Fig. 10 is a flow chart of identifying the image area where the target object is located in the current image according to the background similarity corresponding to each pixel point and the first probability in one embodiment;

图11为一个实施例中根据当前图像中各个像素点对应的目标概率识别得到当前图像中目标对象所在的图像区域的流程图;Fig. 11 is a flow chart of identifying and obtaining the image area where the target object is located in the current image according to the target probability corresponding to each pixel in the current image in one embodiment;

图12为一个实施例中当前图像的各个像素点对应的目标概率示意图;Fig. 12 is a schematic diagram of target probabilities corresponding to each pixel of the current image in an embodiment;

图13为一个实施例中图像检测结果的示意图;Fig. 13 is a schematic diagram of image detection results in an embodiment;

图14为一个实施例中图像识别装置的结构框图;Fig. 14 is a structural block diagram of an image recognition device in an embodiment;

图15为一个实施例中背景区域确定模块的结构框图;Fig. 15 is a structural block diagram of a background area determination module in an embodiment;

图16为一个实施例中目标区域识别模块的结构框图;Fig. 16 is a structural block diagram of a target area identification module in an embodiment;

图17为一个实施例中计算机设备的内部结构框图。Figure 17 is a block diagram of the internal structure of a computer device in one embodiment.

具体实施方式Detailed ways

为了使本发明的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本发明进行进一步详细说明。应当理解,此处所描述的具体实施例仅仅用以解释本发明,并不用于限定本发明。In order to make the object, technical solution and advantages of the present invention clearer, the present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described here are only used to explain the present invention, not to limit the present invention.

图1为一个实施例中提供的图像识别方法的应用环境图,如图1所示,在该应用环境中,包括摄像装置110以及计算机设备120。当摄像装置110进行摄像获取到当前图像后,发送到计算机设备120中,计算机设备120获取到待识别目标的当前图像,执行本发明实施例提供的图像识别方法,识别得到当前图像中目标对象所在的图像区域。FIG. 1 is an application environment diagram of an image recognition method provided in an embodiment. As shown in FIG. 1 , the application environment includes a camera 110 and a computer device 120 . After the camera device 110 captures the current image, it sends it to the computer device 120, and the computer device 120 obtains the current image of the target to be recognized, executes the image recognition method provided by the embodiment of the present invention, and recognizes the location of the target object in the current image. image area.

在一个实施例中,得到当前图像中目标对象所在的图像区域后,计算机120可以显示该当前图像,并对目标对象所在的图像区域进行标识,例如,在当前图像上增加箭头,箭头所指向的区域为目标对象所在的图像区域。In one embodiment, after obtaining the image area where the target object is located in the current image, the computer 120 can display the current image and identify the image area where the target object is located, for example, add an arrow on the current image, and the arrow points to Region is the image region where the target object is located.

在一个实施例中,得到当前图像中目标对象所在的图像区域后,还可以将目标对象所在的图像区域的像素点灰度值设为1,将当前图像中不是目标对象所在的图像区域的像素点灰度值设为0,得到当前图像对应的二值化图像。In one embodiment, after obtaining the image area where the target object is located in the current image, the pixel gray value of the image area where the target object is located can also be set to 1, and the pixels in the current image that are not in the image area where the target object is located The point gray value is set to 0 to obtain the binarized image corresponding to the current image.

在一个实施例中,当前图像为红外图像,摄像装置110可以为红外摄像装置。In one embodiment, the current image is an infrared image, and the camera 110 may be an infrared camera.

在一个实施例中,计算机设备120可以是独立的物理服务器或终端,也可以是多个物理服务器构成的服务器集群,可以是提供云服务器、云数据库、云存储和CDN等基础云计算服务的云服务器。In one embodiment, the computer device 120 can be an independent physical server or terminal, or a server cluster composed of multiple physical servers, or a cloud that provides basic cloud computing services such as cloud server, cloud database, cloud storage, and CDN. server.

需要说明的是,上述的应用场景仅为一种示例,并不能视为对本发明的限制,在实际应用中,还可以存在其他的应用场景。例如,计算机设备120可以从本地存储中获取当前图像或者从其他设备中获取当前图像。或者,计算机设备120与摄像装置110可以是同一设备。It should be noted that the above-mentioned application scenario is only an example, and should not be regarded as a limitation to the present invention. In actual applications, other application scenarios may also exist. For example, computer device 120 may obtain the current image from local storage or obtain the current image from other devices. Alternatively, the computer device 120 and the imaging device 110 may be the same device.

如图2所示,在一个实施例中,提出了一种图像识别方法,本实施例主要以该方法应用于上述图1中的计算机设备120来举例说明。具体可以包括以下步骤:As shown in FIG. 2 , in one embodiment, an image recognition method is proposed, and this embodiment is mainly illustrated by taking the method applied to the computer device 120 in the above-mentioned FIG. 1 as an example. Specifically, the following steps may be included:

步骤S202,获取待识别目标的当前图像。Step S202, acquiring the current image of the target to be identified.

具体地,当前图像是指当前需要识别目标对象的图像。当前图像可以是摄像装置实时或定时地传输到计算机设备中的,当前图像也可以是计算机设备本地存储的图像。计算机设备也可以响应于图像识别请求获取待识别目标的当前图像。例如,当用户需要识别图像中的目标对象时,可以发送图像识别请求,图像识别请求中可以携带图像或者图像标识,计算机设备接收到图像识别请求后,根据图像识别请求获取当前图像。目标对象是指需要识别的对象,例如,目标对象可以是人脸,一只猫或者一辆飞机等,目标对象具体可以根据需要进行设置。Specifically, the current image refers to an image that currently needs to identify a target object. The current image may be transmitted to the computer device by the camera device in real time or periodically, and the current image may also be an image locally stored by the computer device. The computer device may also acquire a current image of the target to be identified in response to the image recognition request. For example, when a user needs to identify a target object in an image, an image recognition request can be sent, and the image recognition request can carry an image or an image identifier. After receiving the image recognition request, the computer device obtains the current image according to the image recognition request. The target object refers to an object that needs to be recognized. For example, the target object can be a human face, a cat, or an airplane, and the specific target object can be set according to needs.

步骤S204,从当前图像中获取当前像素点,根据当前像素点的位置确定对应的背景参考区域。Step S204, obtaining the current pixel point from the current image, and determining the corresponding background reference area according to the position of the current pixel point.

具体地,像素点是由数字序列表示的图像中的最小图像单位。当前图像包括多个像素点(pixel),对当前图像进行图像识别时是以像素点为单位进行识别的。当前像素点是指当前获取的像素点。对于当前图像的各个像素点,可以依次作为当前像素点执行步骤S204~S208,也可以同时将多个像素点作为当前像素点,对每一个当前像素点分别执行步骤S204~S208。背景参考区域为背景对应的图像区域,背景参考区域是根据当前像素点的位置确定的。例如,可以将与当前像素点相邻的像素点组成的区域作为背景参考区域。也可以将位于当前像素点预设范围内的区域作为背景参考区域。Specifically, a pixel is the smallest image unit in an image represented by a sequence of numbers. The current image includes a plurality of pixels (pixels), and the image recognition of the current image is performed in units of pixels. The current pixel point refers to the currently acquired pixel point. For each pixel of the current image, steps S204-S208 may be performed sequentially as the current pixel, or multiple pixels may be used as the current pixel at the same time, and steps S204-S208 may be respectively performed for each current pixel. The background reference area is an image area corresponding to the background, and the background reference area is determined according to the position of the current pixel. For example, an area composed of pixels adjacent to the current pixel can be used as a background reference area. The area within the preset range of the current pixel can also be used as the background reference area.

在一个实施例中,根据当前像素点的位置确定对应的背景参考区域包括:根据当前像素点的位置在当前图像上获取第一区域和第二区域,将第一区域和第二区域之间的非重叠图像区域作为背景参考区域。其中,第二区域为第一区域的子区域,当前像素点位于第二区域内部。In one embodiment, determining the corresponding background reference area according to the position of the current pixel includes: acquiring the first area and the second area on the current image according to the position of the current pixel, and dividing the area between the first area and the second area Non-overlapping image regions serve as background reference regions. Wherein, the second area is a sub-area of the first area, and the current pixel is located inside the second area.

具体地,第一区域与第二区域的大小具体可以根据需要设置。第一区域以及第二区域可以为当前图像中的部分区域。例如,第一区域可以包括7*7个像素点,第二区域可以包括3*3个像素点。第二区域为第一区域的子区域是指第二区域是属于第一区域的。可以理解,由于当前像素点位于第二区域内,而第二区域为第一区域的子区域,因此,当前像素点也位于第一区域内。得到第一区域和第二区域之后,将第一区域中第二区域之外的区域,即第一区域与第二区域的非重叠区域作为背景参考区域。本发明实施例中,由于当前像素点周围的像素点也可能是目标对象对应的像素点,因此将第一区域和第二区域之间的非重叠图像区域作为背景参考区域,提高了选取的背景参考区域的准确性。Specifically, the sizes of the first area and the second area can be set as required. The first area and the second area may be partial areas in the current image. For example, the first area may include 7*7 pixels, and the second area may include 3*3 pixels. The fact that the second area is a sub-area of the first area means that the second area belongs to the first area. It can be understood that since the current pixel point is located in the second area, and the second area is a sub-area of the first area, the current pixel point is also located in the first area. After the first area and the second area are obtained, the area outside the second area in the first area, that is, the non-overlapping area between the first area and the second area is used as the background reference area. In the embodiment of the present invention, since the pixels around the current pixel may also be the pixels corresponding to the target object, the non-overlapping image area between the first area and the second area is used as the background reference area, which improves the selection of the background. The accuracy of the reference area.

如图3A所示,假设图3A中的一个方格代表一个像素点,Pij表示第i行第j列的像素点,其中P44为当前像素点,P32、P33、P34、P42、P43、P44、P52、P53以及P54为第二区域,即图3A中斜线对应的区域,第一区域为图3中的全部像素点组成的区域,则非重叠区域即背景参考区域为图3A中除斜线对应的区域之外的区域,。As shown in Figure 3A, assume that a square in Figure 3A represents a pixel point, P ij represents the pixel point in row i and column j, where P 44 is the current pixel point, P 32 , P 33 , P 34 , P 42 , P 43 , P 44 , P 52 , P 53 and P 54 are the second area, that is, the area corresponding to the oblique line in Figure 3A, the first area is the area composed of all the pixels in Figure 3, and the non-overlapping area That is, the background reference area is the area in Figure 3A except the area corresponding to the oblique line.

在一个实施例中,第一区域以及第二区域中的至少一个以当前像素点为对称中心。例如,当第一区域的形状为长方形时,对称中心为对角线的交点。如图3B所示,P44为当前像素点,第二区域为斜线对应的区域,背景参考区域为图3B中斜线对应的区域之外的区域。In one embodiment, at least one of the first area and the second area takes the current pixel as a symmetrical center. For example, when the shape of the first region is a rectangle, the center of symmetry is the intersection point of the diagonals. As shown in FIG. 3B , P 44 is the current pixel point, the second area is the area corresponding to the oblique line, and the background reference area is an area other than the area corresponding to the oblique line in FIG. 3B .

步骤S206,根据背景参考区域计算当前像素点对应的背景相似度。Step S206, calculating the background similarity corresponding to the current pixel point according to the background reference area.

具体地,背景相似度用于表示当前像素点与背景相似的程度。相似度越大,则当前像素点为背景的可能性越大。得到背景参考区域后,可以将各个像素点均作为目标像素点,计算背景参考区域中各个像素点与当前像素点的相似度。也可以从背景参考区域中选取部分像素点作为目标像素点,计算目标像素点与当前像素点的相似度。得到目标像素点与当前像素点的相似度后,根据计算得到的相似度得到背景相似度。例如,可以将计算得到的相似度的平均值、最大相似度、最小相似度或者相似度中间值作为背景相似度。相似度的计算方法可以根据需要进行设置。例如,可以获取像素点对应的像素特征,计算像素特征间的相似程度。像素特征可以颜色特征、纹理特征以及灰度特征中的一种或多种。Specifically, the background similarity is used to indicate the degree of similarity between the current pixel and the background. The greater the similarity, the greater the possibility that the current pixel is the background. After the background reference area is obtained, each pixel can be used as a target pixel to calculate the similarity between each pixel in the background reference area and the current pixel. It is also possible to select some pixels from the background reference area as the target pixels, and calculate the similarity between the target pixels and the current pixel. After obtaining the similarity between the target pixel and the current pixel, the background similarity is obtained according to the calculated similarity. For example, the average value, the maximum similarity, the minimum similarity, or the median value of the calculated similarity may be used as the background similarity. The calculation method of the similarity can be set as required. For example, the pixel features corresponding to the pixel points can be obtained, and the similarity between the pixel features can be calculated. The pixel features can be one or more of color features, texture features, and grayscale features.

在一个实施例中,可以根据像素点的灰度值计算得到相似度。例如,可以获取像素点的灰度值,对像素点的灰度值进行取反运算,得到互补当前灰度值,然后将像素点对应的灰度值和互补灰度值组成灰度值向量。再计算向量间的相似度,得到像素点与像素点之间的相似度。向量间的相似度可以利用余弦相似度算法、欧式距离相似度算法进行计算。In one embodiment, the similarity can be calculated according to the gray value of the pixel. For example, the gray value of the pixel can be obtained, and the gray value of the pixel can be reversed to obtain the complementary current gray value, and then the gray value corresponding to the pixel and the complementary gray value can be combined into a gray value vector. Then calculate the similarity between vectors to obtain the similarity between pixels. The similarity between vectors can be calculated using the cosine similarity algorithm and the Euclidean distance similarity algorithm.

步骤S208,根据已训练的图像目标识别模型对当前像素点对应的图像特征进行处理,得到当前像素点对应的第一概率,第一概率为当前像素点属于目标对象像素点的概率。Step S208: Process the image features corresponding to the current pixel according to the trained image object recognition model to obtain a first probability corresponding to the current pixel, where the first probability is the probability that the current pixel belongs to the pixel of the target object.

具体地,图像特征用于表示图像对应的性质,例如像素点对应的对比度特征、颜色特征或者灰度特征中的一种或多种等等,具体可以根据需要选取。目标对象像素点为目标对象对应的像素点。根据已训练的图像目标识别模型对图像特征进行处理之前,需要通过训练数据进行模型训练确定图像目标识别模型对应的模型参数,建立起图像特征到像素点属于目标对象像素点的概率的映射。模型训练的方法可以是有监督训练方法或者无监督训练方法。对于有监督训练方法,训练数据中的像素点是否为目标对象像素点是已知的,有监督训练模型例如可以为支持向量机或者深度神经学习模型等。对于无监督训练方法,训练数据中的像素点是否为目标对象像素点可以是未知的,无监督训练模型例如可以为聚类算法。Specifically, the image features are used to represent the properties corresponding to the image, such as one or more of the contrast features, color features, or grayscale features corresponding to the pixels, which can be selected according to needs. The pixel point of the target object is a pixel point corresponding to the target object. Before processing the image features according to the trained image target recognition model, it is necessary to carry out model training through the training data to determine the model parameters corresponding to the image target recognition model, and establish a mapping from image features to the probability that the pixel belongs to the pixel of the target object. The method of model training can be a supervised training method or an unsupervised training method. For a supervised training method, it is known whether the pixels in the training data are the pixels of the target object, and the supervised training model can be, for example, a support vector machine or a deep neural learning model. For the unsupervised training method, it may be unknown whether the pixels in the training data are the pixels of the target object, and the unsupervised training model may be, for example, a clustering algorithm.

步骤S210,计算得到当前图像中的各个像素点对应的背景相似度和第一概率,根据各个像素点对应的背景相似度和第一概率识别得到当前图像中目标对象所在的图像区域。Step S210, calculate the background similarity and first probability corresponding to each pixel in the current image, and identify the image area where the target object is located in the current image according to the background similarity and first probability corresponding to each pixel.

具体地,按照步骤S202~208计算得到当前图像中各个像素点对应的背景相似度以及第一概率,再结合各个像素点对应的背景相似度和第一概率识别得到当前图像中目标对象所在的图像区域。Specifically, calculate the background similarity and first probability corresponding to each pixel in the current image according to steps S202-208, and then identify the image where the target object is located in the current image by combining the background similarity and first probability corresponding to each pixel area.

在一个实施例中,可以是将背景相似度小于预设相似度,且第一概率大于预设概率的像素点作为目标对象像素点。In one embodiment, pixels whose background similarity is less than a preset similarity and whose first probability is greater than a preset probability may be used as target object pixels.

在一个实施例中,也可以设置目标对象对应的图像区域的像素点个数,结合目标对象对应的图像区域的像素点个数得到当前图像中目标对象所在的图像区域。例如当预先设置目标对象所在的图像区域的像素点个数为8个时,可以获取背景相似度最小的10个像素点,再从这10个像素点中获取第一概率排序为前8位的像素点作为目标对象像素点,将目标对象像素点组成的区域作为目标对象所在的图像区域。In an embodiment, the number of pixels of the image area corresponding to the target object may also be set, and combined with the number of pixels of the image area corresponding to the target object, the image area where the target object is located in the current image can be obtained. For example, when the number of pixels in the image area where the target object is located is preset to 8, the 10 pixels with the smallest background similarity can be obtained, and then the first probability ranking of the top 8 pixels can be obtained from these 10 pixels. Pixels are used as the pixels of the target object, and the area formed by the pixels of the target object is used as the image area where the target object is located.

在一个实施例中,还可以结合像素点的位置得到当前图像中目标对象所在的图像区域。可以选取背景相似度小于预设相似度,且第一概率大于预设概率的像素点,然后获取这些选取的像素点的位置,将选取的像素点组成的连续图像区域作为当前图像中目标对象所在的图像区域。In an embodiment, the image area where the target object is located in the current image can also be obtained by combining the positions of the pixel points. You can select pixels whose background similarity is less than the preset similarity and whose first probability is greater than the preset probability, and then obtain the positions of these selected pixels, and use the continuous image area composed of the selected pixels as the target object in the current image image area.

在一个实施例中,还可以根据背景相似度得到第二概率,第二概率为当前像素点属于目标对象像素点的概率。然后将第一概率以及第二概率相乘得到目标概率,将目标概率大于预设值的像素点作为当前图像中的目标对象像素点,得到目标对象所在的图像区域。In one embodiment, the second probability can also be obtained according to the similarity of the background, and the second probability is the probability that the current pixel belongs to the pixel of the target object. Then multiply the first probability and the second probability to obtain the target probability, and use the pixel points whose target probability is greater than the preset value as the target object pixel points in the current image to obtain the image area where the target object is located.

在一个实施例中,还可以将当前图像中确定为目标对象像素点的灰度值设置为1,其他像素点的灰度值设置为0,并显示当前图像对应的二值化图像。In an embodiment, the gray value of the pixel determined as the target object in the current image may also be set to 1, and the gray value of other pixels may be set to 0, and a binarized image corresponding to the current image may be displayed.

上述图像识别方法,获取待识别目标的当前图像,从当前图像中获取当前像素点,根据当前像素点的位置确定对应的背景参考区域,根据背景参考区域计算当前像素点对应的背景相似度,根据已训练的图像目标识别模型对当前像素点对应的图像特征进行处理,得到当前像素点对应的第一概率,第一概率为当前像素点属于目标对象像素点的概率,计算得到当前图像中的各个像素点对应的背景相似度和第一概率,根据各个像素点对应的背景相似度和第一概率识别得到当前图像中目标对象所在的图像区域。由于背景相似度能够反映像素点是否为背景,而利用模型得到的概率正面反映像素点是否为目标,结合像素点对应的背景相似度以及像素点属于目标对象像素点的概率识别得到目标对象所在的图像区域,图像识别准确度高。The above image recognition method obtains the current image of the target to be recognized, obtains the current pixel from the current image, determines the corresponding background reference area according to the position of the current pixel, and calculates the background similarity corresponding to the current pixel according to the background reference area. The trained image target recognition model processes the image features corresponding to the current pixel to obtain the first probability corresponding to the current pixel. The first probability is the probability that the current pixel belongs to the pixel of the target object. The background similarity and the first probability corresponding to the pixel points are used to identify the image area where the target object is located in the current image according to the background similarity and the first probability corresponding to each pixel point. Since the background similarity can reflect whether the pixel is the background, and the probability obtained by using the model positively reflects whether the pixel is the target, combined with the background similarity corresponding to the pixel and the probability that the pixel belongs to the pixel of the target object, the location of the target object can be obtained. Image area, image recognition accuracy is high.

本发明实施例提供的方法可以应用于红外图像的目标对象识别中,红外图像是通过红外成像技术得到的图像,在光强不足及对比度差的环境中,基于红外探测技术成像方法可以在不依赖光照的情况下获取得到图像,而红外图像中的目标对象一般比较小,例如目标对象对应的图像区域的大小一般为在1×1像素至6×6像素之间,且通常湮没在复杂背景中,再加上大气热辐射的不均匀性、不同气象条件下的大气衰减以及红外探测器的内部噪声等因素影响,导致红外图像灰度变化剧烈,与传统的可见光图像灰度变化缓慢有很大的不同。因此,采用传统的图像识别方法识别目标对象的效果差。而采用本发明实施例提供的方法,利用当前像素点与背景参考区域的像素点的相似度得到背景相似度,利用图像识别模型确定像素点为目标对象像素点的概率,两种方法结合从一正一反两个角度综合确定像素点是否为目标对象像素点,因此图像识别效果好。The method provided by the embodiment of the present invention can be applied to target object recognition of infrared images. Infrared images are images obtained by infrared imaging technology. In an environment with insufficient light intensity and poor contrast, the imaging method based on infrared detection technology can be used without relying on The image is obtained under the condition of light, and the target object in the infrared image is generally relatively small. For example, the size of the image area corresponding to the target object is generally between 1×1 pixel and 6×6 pixel, and it is usually buried in a complex background. , coupled with the inhomogeneity of atmospheric thermal radiation, atmospheric attenuation under different meteorological conditions, and the internal noise of infrared detectors, etc., lead to drastic changes in the gray scale of infrared images, which is very different from the slow change in gray scale of traditional visible light images. s difference. Therefore, the effect of identifying the target object using the traditional image recognition method is poor. However, the method provided by the embodiment of the present invention uses the similarity between the current pixel point and the pixel point in the background reference area to obtain the background similarity, and uses the image recognition model to determine the probability that the pixel point is the pixel point of the target object. The two methods are combined from one The positive and negative angles comprehensively determine whether the pixel is the pixel of the target object, so the image recognition effect is good.

在一个实施例中,如图4所示,步骤S206即根据背景参考区域计算当前像素点对应的背景相似度可以包括以下步骤:In one embodiment, as shown in FIG. 4, step S206, that is, calculating the background similarity corresponding to the current pixel point according to the background reference area may include the following steps:

步骤S402,从背景参考区域获取目标像素点,获取目标像素点和当前像素点对应的灰度值。In step S402, the target pixel is obtained from the background reference area, and the gray value corresponding to the target pixel and the current pixel is obtained.

具体地,目标像素点可以为一个或多个。目标像素点可以是背景参考区域的全部像素点,当然也可以根据预设的像素点筛选规则获取目标像素点。例如,可以是获取背景参考区域中,灰度值为背景参考区域中各个像素点的灰度值的中位数的像素点作为目标像素点。Specifically, there may be one or more target pixel points. The target pixels can be all the pixels in the background reference area, and of course the target pixels can also be obtained according to preset pixel filtering rules. For example, in the background reference area, the pixel point whose gray value is the median of the gray value of each pixel point in the background reference area may be acquired as the target pixel point.

在一个实施例中,还可以将背景参考区域分为多个子区域,从各个子区域中获取目标像素点。例如,将各个子区域中灰度值为子区域中各个像素点的灰度值的中位数对应的像素点作为目标像素点。如图5所示,可以将水平方向上垂直经过第一区域的中心点的线段Q1所经过的像素点组成的区域作为第一子区域,将竖直方向上垂直经过第一区域的中心点的线段Q2所经过的像素点作为第二子区域,第一区域的对角线Q3、Q4所经过的像素点组成的区域分别作为第三子区域以及第四子区域。然后获取各个子区域中像素点的灰度值的中位数,将各个子区域中灰度值为中位数的像素点作为目标像素点。In an embodiment, the background reference area may also be divided into multiple sub-areas, and target pixel points are acquired from each sub-area. For example, a pixel point whose gray value in each sub-region corresponds to the median of the gray values of the pixels in the sub-region is used as the target pixel point. As shown in Figure 5, the area composed of pixels passed by the line segment Q1 passing through the center point of the first area vertically in the horizontal direction can be used as the first sub-area, and the line segment Q1 vertically passing through the center point of the first area in the vertical direction can be used as the first sub-area. The pixels passed by the line segment Q2 are used as the second sub-area, and the areas formed by the pixels passed by the diagonal lines Q3 and Q4 of the first area are respectively used as the third sub-area and the fourth sub-area. Then, the median of the grayscale values of the pixels in each sub-region is obtained, and the pixel with the grayscale value of the median in each sub-region is used as the target pixel.

在一个实施例中,当存在第二区域时,可以理解,各个子区域对应的像素点不包括第二区域中的像素点。例如,对于线段Q4对应的第四子区域,可以是P11、P22、P66、P77所组成的区域,并不包括P33、P44、P55In an embodiment, when there is a second area, it can be understood that the pixels corresponding to each sub-area do not include the pixels in the second area. For example, the fourth sub-area corresponding to the line segment Q4 may be an area composed of P 11 , P 22 , P 66 , and P 77 , excluding P 33 , P 44 , and P 55 .

步骤S404,根据目标像素点的灰度值计算得到参考灰度值,对参考灰度值进行取反运算得到对应的互补参考灰度值,将参考灰度值和互补参考灰度值组成参考灰度值向量。Step S404, calculate the reference gray value according to the gray value of the target pixel point, perform an inverse operation on the reference gray value to obtain the corresponding complementary reference gray value, and combine the reference gray value and the complementary reference gray value to form a reference gray A vector of degree values.

具体地,参考灰度值可以是各个目标像素点对应的灰度值的中位数。也可以是对目标像素点的灰度值进行归一化后得到的灰度值,也可以是对目标像素点对应的灰度值的中位数进行归一化得到的灰度值。例如,当目标像素点的灰度值为200时,由于灰度值的范围为0~255,因此,将200除以255得到归一化的参考灰度值为0.784。或者当目标像素点包括4个,分别为100、250、200以及210,先获取灰度值中位数为(200+210=)/2=205,对应的参考灰度值为205/255=0.804。取反运算用于获取图像的补图像,互补是指两个灰度值相加等于灰度的最大值,如为255或者1。例如,当参考灰度值为0.804,则互补参考灰度值为1-0.804=0.196。得到参考灰度值以及互补参考灰度值后,组成参考灰度值向量,参考灰度值向量为[0.804,0.196]。Specifically, the reference grayscale value may be a median of grayscale values corresponding to each target pixel point. It may also be a gray value obtained by normalizing the gray value of the target pixel, or may be a gray value obtained by normalizing the median of the gray values corresponding to the target pixel. For example, when the grayscale value of the target pixel is 200, since the grayscale value ranges from 0 to 255, dividing 200 by 255 results in a normalized reference grayscale value of 0.784. Or when the target pixel points include 4, respectively 100, 250, 200 and 210, the median gray value obtained first is (200+210=)/2=205, and the corresponding reference gray value is 205/255= 0.804. The inverse operation is used to obtain the complementary image of the image. Complementary means that the addition of two grayscale values is equal to the maximum value of the grayscale, such as 255 or 1. For example, when the reference gray value is 0.804, the complementary reference gray value is 1−0.804=0.196. After obtaining the reference gray value and the complementary reference gray value, a reference gray value vector is formed, and the reference gray value vector is [0.804, 0.196].

步骤S406,对当前像素点对应的灰度值进行取反运算得到对应的互补当前灰度值,将当前像素点对应的灰度值和互补当前灰度值组成当前灰度值向量。Step S406, performing an inverse operation on the gray value corresponding to the current pixel to obtain a corresponding complementary current gray value, and combining the gray value corresponding to the current pixel and the complementary current gray value to form a current gray value vector.

具体地,当前像素点对应的灰度值可以是归一化后的灰度值,也可以是未归一化的灰度值。得到当前像素点对应的灰度值后,也对当前像素点对应的灰度值进行取反运算得到对应的互补当前灰度值,然后将当前像素点对应的灰度值和互补当前灰度值组成当前灰度值向量。例如,当当前像素点对应的灰度值为0.901,则互补当前灰度值为1-0.901=0.099。当前考灰度值向量为[0.901,0.099]。Specifically, the gray value corresponding to the current pixel point may be a normalized gray value or an unnormalized gray value. After the gray value corresponding to the current pixel is obtained, the gray value corresponding to the current pixel is also inverted to obtain the corresponding complementary current gray value, and then the gray value corresponding to the current pixel and the complementary current gray value Make up the current gray value vector. For example, when the grayscale value corresponding to the current pixel is 0.901, the complementary current grayscale value is 1-0.901=0.099. The current test gray value vector is [0.901,0.099].

步骤S408,根据参考灰度值向量和当前灰度值向量计算得到当前像素点对应的背景相似度。Step S408, calculating the background similarity corresponding to the current pixel according to the reference gray value vector and the current gray value vector.

具体地,根据参考灰度值向量和当前灰度值向量计算背景相似度的方法可以根据实际需要进行设置。例如,可以采用余弦相似度算法,也可以采用欧式距离计算方法进行计算。Specifically, the method of calculating the background similarity according to the reference gray value vector and the current gray value vector can be set according to actual needs. For example, the cosine similarity algorithm may be used, or the Euclidean distance calculation method may be used for calculation.

在一个实施例中,当参考灰度值向量包括多个时,可以分别计算各个参考灰度值向量和当前灰度值向量之间的相似度,再根据各个参考灰度值向量和当前灰度值向量之间的相似度得到背景相似度。例如,可以取各个参考灰度值向量和当前灰度值向量之间的相似度的中间值、平均值、最大值以及最小值中的一个作为背景相似度。In one embodiment, when there are multiple reference grayscale value vectors, the similarity between each reference grayscale value vector and the current grayscale value vector can be calculated respectively, and then according to each reference grayscale value vector and the current grayscale value vector The similarity between the value vectors yields the background similarity. For example, one of the median value, the average value, the maximum value and the minimum value of the similarity between each reference gray value vector and the current gray value vector may be taken as the background similarity.

在一个实施例中,计算背景相似度的方法包括:将参考灰度值向量和当前灰度值向量中相同位置的向量值进行比较,获取各个位置对应的最小向量值。将最小值进行组合,得到重组向量,计算重组向量的模的平方,根据重组向量的模的平方、当前灰度值向量的模以及参考灰度值向量的模得到当前像素点对应的背景模糊隶属度,根据背景模糊隶属度得到背景相似度。In one embodiment, the method for calculating the background similarity includes: comparing the reference gray value vector with the vector value at the same position in the current gray value vector, and obtaining the minimum vector value corresponding to each position. Combine the minimum values to obtain the recombination vector, calculate the square of the modulus of the recombination vector, and obtain the background blur membership corresponding to the current pixel according to the square of the modulus of the recombination vector, the modulus of the current gray value vector, and the modulus of the reference gray value vector degree, the background similarity is obtained according to the background fuzzy membership degree.

具体地,背景模糊隶属度用于表示当前像素点隶属于背景的程度,根据背景模糊隶属度得到背景相似度的算法可以根据需要进行设置。例如,当背景模糊隶属度只有一个时,可以将模糊隶属度作为背景相似度。当背景模糊隶属度为多个时,可以将模糊隶属度的中间值、平均值、最大值以及最小值中的一个作为背景相似度。重组向量的获取方法举例如下,如果当前灰度值向量为[0.901,0.099],参考灰度值向量[0.804,0.196],则重组向量为[0.804,0.099]假设目标像素点为4个,则上述计算背景相似度的方法用公式(1)~(4)表示如下:Specifically, the background blur membership degree is used to indicate the degree to which the current pixel belongs to the background, and the algorithm for obtaining the background similarity according to the background blur membership degree can be set as required. For example, when there is only one background fuzzy membership degree, the fuzzy membership degree can be used as the background similarity degree. When there are multiple background fuzzy membership degrees, one of the middle value, average value, maximum value, and minimum value of the fuzzy membership degrees can be used as the background similarity. An example of how to obtain the reorganization vector is as follows. If the current gray value vector is [0.901,0.099] and the reference gray value vector is [0.804,0.196], then the reorganization vector is [0.804,0.099]. Assuming that there are 4 target pixels, then The above method of calculating background similarity is expressed as follows with formulas (1)-(4):

I=[Ft(x,y),Ft(x,y)c],Ft(x,y)c=1-Ft(x,y) (1)I=[F t (x, y), F t (x, y) c ], F t (x, y) c = 1-F t (x, y) (1)

Bg(x,y)=max{Pj|j=1...4} (4)Bg(x,y)=max{P j |j=1...4} (4)

其中,上述公式中,Ft(x,y)为当前像素点t对应的灰度值,Ft(x,y)c为当前像素点t的互补当前灰度值,I为当前灰度值向量。wj为第j个目标像素点对应的参考灰度值,wj c为第j个目标像素点的互补参考灰度值,Wj为第j个目标像素点参考灰度值向量,Pj为当前像素点与第j个目标像素点之间的模糊隶属度,为防止模糊隶属度等于1而设置的参数,具体可以根据需要设置。“^”为模糊交运算子,其计算结果取两个向量间相同位置的向量值的最小值。“||”表示向量的模,Bg(x,y)为背景相似度,max表示取最大值,即背景相似度为最大的PjAmong them, in the above formula, F t (x, y) is the gray value corresponding to the current pixel point t, F t (x, y) c is the complementary current gray value of the current pixel point t, and I is the current gray value vector. w j is the reference gray value corresponding to the jth target pixel, w j c is the complementary reference gray value of the jth target pixel, W j is the reference gray value vector of the jth target pixel, P j is the fuzzy membership degree between the current pixel and the jth target pixel, The parameters set to prevent the fuzzy membership degree from being equal to 1 can be set as required. "^" is a fuzzy intersection operator, and its calculation result is the minimum value of the vector values at the same position between two vectors. "||" represents the modulus of the vector, Bg(x, y) represents the background similarity, and max represents the maximum value, that is, P j with the maximum background similarity.

在一个实施例中,图像目标识别模型为支持向量聚类模型,如图6所示,步骤S208即根据已训练的图像目标识别模型对当前像素点对应的图像特征进行处理,得到当前像素点对应的第一概率的步骤具体可以包括:In one embodiment, the image object recognition model is a support vector clustering model, as shown in FIG. 6 , step S208 is to process the image features corresponding to the current pixel according to the trained image object recognition model, and obtain the current pixel corresponding to The specific steps of the first probability may include:

步骤S602,获取图像目标识别模型对应的特征映射函数,获取与特征映射函数对应的特征空间的中心值。Step S602, obtaining a feature mapping function corresponding to the image target recognition model, and obtaining a central value of a feature space corresponding to the feature mapping function.

具体地,支持向量聚类模型的基本思想是:对于输入的用于模型训练的特征,可以采用一个特征映射函数将输入的特征映射到特征空间,得到特征映射值,该特征空间为最小的能够覆盖映射后得到的映射值的特征空间,特征空间的中心值为特征映射函数映射后得到的特征映射值的中心值。例如特征空间可以为一个超球体,特征空间的中心为超球体的球心。在进行训练时,由于找到一个完全覆盖所有特征向量的最小特征空间会导致特征空间比较大,因此,可以设置模型训练条件,当达到模型训练条件时则将得到的特征空间作为满足条件的最小特征空间,模型训练的方法在后文中叙述。因此,对于已训练得到的图像目标识别模型,可以获取对应的特征映射函数,获取与特征映射函数对应的特征空间的中心值。Specifically, the basic idea of the support vector clustering model is: for the input features used for model training, a feature mapping function can be used to map the input features to the feature space to obtain the feature map value. The feature space is the smallest possible The feature space of the mapped value obtained after the overlay mapping, and the center value of the feature space is the center value of the feature map value obtained after the feature map function is mapped. For example, the feature space can be a hypersphere, and the center of the feature space is the center of the hypersphere. During training, since finding a minimum feature space that completely covers all feature vectors will result in a relatively large feature space, the model training conditions can be set, and when the model training conditions are met, the obtained feature space will be used as the minimum feature that satisfies the conditions Space, the method of model training is described later. Therefore, for the trained image target recognition model, the corresponding feature mapping function can be obtained, and the central value of the feature space corresponding to the feature mapping function can be obtained.

步骤S604,根据特征映射函数对图像特征进行计算,得到图像特征对应的映射值。Step S604, calculate the image feature according to the feature mapping function, and obtain the mapping value corresponding to the image feature.

具体地,得到特征映射函数后,利用特征映射函数将图像特征映射到特征空间中,得到对应的映射值。Specifically, after the feature mapping function is obtained, the feature mapping function is used to map the image feature into the feature space to obtain the corresponding mapping value.

步骤S606,计算映射值与中心值的第一距离。Step S606, calculating a first distance between the mapping value and the central value.

具体地,得到映射值后,根据映射值得到特征空间中映射值与中心值的距离。假设图像特征为s(i),特征映射函数为Φ,中心值为a,则映射值与中心值的第一距离可以表示为|Φ(s(i))-a|,其中“||”表示计算的是欧式距离。Specifically, after the mapping value is obtained, the distance between the mapping value and the central value in the feature space is obtained according to the mapping value. Suppose the image feature is s(i), the feature mapping function is Φ, and the center value is a, then the first distance between the mapped value and the center value can be expressed as |Φ(s(i))-a|, where “||” Indicates that the Euclidean distance is calculated.

步骤S608,根据第一距离计算得到当前像素点对应的第一概率,其中,第一距离与第一概率呈负相关关系。Step S608, calculating a first probability corresponding to the current pixel point according to the first distance, wherein the first distance has a negative correlation with the first probability.

具体地,第一距离与第一概率呈负相关关系,即第一概率随着第一距离的增大而变小。例如,第一概率可以是第一距离的倒数。Specifically, the first distance has a negative correlation with the first probability, that is, the first probability becomes smaller as the first distance increases. For example, the first probability may be the inverse of the first distance.

在一个实施例中,还可以获取特征空间的中心到特征空间的边界的第二距离。根据第一距离计算得到当前像素点为目标对应的像素点的第一概率包括:计算第一距离与第二距离的比例值。根据比例值计算得到当前像素点对应的第一概率,其中,比例值与第一概率呈负相关关系。In an embodiment, a second distance from the center of the feature space to the boundary of the feature space may also be obtained. Calculating the first probability that the current pixel is a pixel corresponding to the target according to the first distance includes: calculating a ratio of the first distance to the second distance. The first probability corresponding to the current pixel point is calculated according to the proportional value, wherein the proportional value and the first probability are negatively correlated.

具体地,第二距离为特征空间的边界到特征空间的中心的距离,当特征空间为超球体时,边界到特征空间的中心的距离为球体的球心到球体的表面的距离,即球体的半径。可以设置比例值与第一概率的对应关系,例如,可以设置当比例值为0~10%对应的第一概率为0.8,当比例值为10~20%对应的第一概率为0.6。Specifically, the second distance is the distance from the boundary of the feature space to the center of the feature space. When the feature space is a hypersphere, the distance from the boundary to the center of the feature space is the distance from the center of the sphere to the surface of the sphere, that is, the distance of the sphere radius. The corresponding relationship between the proportional value and the first probability can be set. For example, when the proportional value is 0-10%, the corresponding first probability can be set as 0.8, and when the proportional value is 10-20%, the corresponding first probability can be set as 0.6.

在一个实施例中,第一概率为1减去比例值,用公式(5)表示如下,其中Ht(x,y)为第一概率,Φ(s(i))为当前像素点的图像特征对应的映射值,a为中心值,R第二距离,“||”表示计算的是欧式距离。In one embodiment, the first probability is 1 minus the proportional value, expressed as follows with formula (5), where H t (x, y) is the first probability, and Φ(s(i)) is the image of the current pixel The mapping value corresponding to the feature, a is the central value, R is the second distance, and "||" indicates that the Euclidean distance is calculated.

本发明实施例中,通过计算当前像素点的映射值与支持向量聚类模型对应的中心值的第一距离,第一距离与第一概率呈负相关关系,即距离特征空间的中心越远的特征映射值对应的像素点属于目标对象所在的像素点的可能性越小,因此,能够对当前像素点为目标对象像素点的概率进行准确的量化,进一步提高了图像识别的准确度。In the embodiment of the present invention, by calculating the first distance between the mapping value of the current pixel point and the central value corresponding to the support vector clustering model, the first distance is negatively correlated with the first probability, that is, the farther away from the center of the feature space The pixel corresponding to the feature map value is less likely to belong to the pixel of the target object. Therefore, the probability that the current pixel is the pixel of the target object can be accurately quantified, which further improves the accuracy of image recognition.

图7示出了一个实施例得到图像目标识别模型的实现流程图,具体可以包括以下步骤:Fig. 7 shows an embodiment to obtain the implementation flowchart of the image target recognition model, which may specifically include the following steps:

步骤S702,获取训练图像,获取训练图像中的目标对象对应的训练区域。Step S702, acquiring a training image, and acquiring a training area corresponding to a target object in the training image.

具体地,训练图像用于进行模型训练。训练区域为训练图像中目标对象所在的图像区域。训练区域可以是人工标注得到的,如图7A所示,图7A中的矩形框包围的区域为通过人工识别得到目标对象对应的区域。Specifically, training images are used for model training. The training area is the image area where the target object is located in the training image. The training area may be manually marked, as shown in FIG. 7A , the area surrounded by the rectangular frame in FIG. 7A is the area corresponding to the target object obtained through manual recognition.

步骤S704,获取训练区域中各个像素点对应的训练图像特征。Step S704, acquiring training image features corresponding to each pixel in the training area.

具体地,图像特征用于表示图像对应的性质,例如像素点对应的对比度特征、颜色特征或者灰度特征中的一种或多种等等,具体可以根据需要选取。Specifically, the image features are used to represent the properties corresponding to the image, such as one or more of the contrast features, color features, or grayscale features corresponding to the pixels, which can be selected according to needs.

步骤S706,根据训练图像特征进行模型训练,得到将训练图像特征映射到最小的特征空间的特征映射函数以及特征空间的中心值。Step S706, perform model training according to the training image features, and obtain a feature mapping function that maps the training image features to the smallest feature space and a central value of the feature space.

具体地,最小的特征空间是根据模型训练条件而言的,可以设置模型训练条件,当达到模型训练条件时则将得到的特征空间作为最小特征空间。对于支持向量聚类模型,可以将模型训练的优化目标表示为如下公式,其中min表示求最小值,s.t.表示subject to,表示求最小值的公式受s.t.后的公式的约束。R表示超球体的半径,a表示超球体的球心,Φ为特征映射函数,ξi为松弛变量,表示可以允许部分训练样本对应的映射值位于在超球体之外,松弛变量具体可以根据需要进行设置,n为训练样本的数量,x(i)表示图像特征。C为惩罚函数,用于调整误差与超球体的边界之间的平衡。因此,优化目标可以概述为:在惩罚函数以及设置的松弛变量的条件下,根据训练样本训练得到特征映射函数以及最小超球体。最小超球体的中心值为a,半径值为R。Specifically, the minimum feature space is based on the model training conditions. The model training conditions can be set, and when the model training conditions are met, the obtained feature space is used as the minimum feature space. For the support vector clustering model, the optimization goal of model training can be expressed as the following formula, where min means seeking the minimum value, st means subject to, and means that the formula for finding the minimum value is constrained by the formula after st. R represents the radius of the hypersphere, a represents the center of the hypersphere, Φ is the feature mapping function, and ξ i is the relaxation variable, which means that the mapping value corresponding to some training samples can be located outside the hypersphere, and the relaxation variable can be specified according to the needs To set, n is the number of training samples, x(i) represents image features. C is a penalty function, which is used to adjust the balance between the error and the boundary of the hypersphere. Therefore, the optimization objective can be summarized as: under the condition of the penalty function and the set slack variable, the feature mapping function and the minimum hypersphere are obtained according to the training samples. The smallest hypersphere has a center value a and a radius value R.

S.t.|Φ((xi)-a)2|≤R2i且ξi≥0St|Φ((x i )-a) 2 |≤R 2i and ξ i ≥0

在一个实施例中,如图8所示,图像特征包括对比度特征,得到当前像素点对应的对比度特征的步骤包括:In one embodiment, as shown in FIG. 8, the image feature includes a contrast feature, and the step of obtaining the contrast feature corresponding to the current pixel includes:

步骤S802,根据当前像素点的位置在当前图像上获取第三区域和第四区域,其中,第四区域为第三区域的子区域,当前像素点位于第四区域内部。Step S802, acquiring a third area and a fourth area on the current image according to the position of the current pixel, wherein the fourth area is a sub-area of the third area, and the current pixel is located inside the fourth area.

具体地,对比度指图像的明暗对比程度,第三区域与第四区域的大小具体可以根据需要设置,例如,第三区域可以包括9*9个像素点,第四区域可以包括3*3个像素点。可以理解,由于当前像素点位于第四区域内,而第四区域为第三区域的子区域,因此,当前像素点也位于第三区域内。Specifically, the contrast refers to the degree of light and dark contrast of the image, and the size of the third area and the fourth area can be set according to needs, for example, the third area can include 9*9 pixels, and the fourth area can include 3*3 pixels point. It can be understood that since the current pixel point is located in the fourth area, and the fourth area is a sub-area of the third area, the current pixel point is also located in the third area.

在一个实施例中,第四区域可以与第二区域相同,第三区域可以与第一区域相同。In one embodiment, the fourth area may be the same as the second area, and the third area may be the same as the first area.

在一个实施例中,第四区域以及第三区域中的至少一个以当前像素点为对称中心。In one embodiment, at least one of the fourth area and the third area takes the current pixel as a symmetrical center.

步骤S804,获取第三区域和第四区域之间的非重叠图像区域。Step S804, acquiring non-overlapping image areas between the third area and the fourth area.

具体地,由于第四区域为第三区域的子区域,因此第三区域和第四区域之间的非重叠图像区域为第三区域中除了第四区域之外的区域。Specifically, since the fourth area is a sub-area of the third area, the non-overlapping image area between the third area and the fourth area is an area in the third area except the fourth area.

步骤S806,对非重叠图像区域对应的像素点的灰度值进行统计,得到第一统计结果,对第四区域对应的像素点的灰度值进行统计,得到第二统计结果。Step S806 , performing statistics on the grayscale values of the pixels corresponding to the non-overlapping image regions to obtain a first statistical result, and performing statistics on the grayscale values of the pixels corresponding to the fourth region to obtain a second statistical result.

具体地,第一统计结果以及第二统计结果可以是灰度值的和也可以是灰度值的平均值。例如,可以将非重叠区域的各个像素点的灰度值进行相加求和,再除以非重叠区域中像素点的数量,得到非重叠区域对应的像素点的平均灰度值,作为第一统计结果。可以将第四区域的各个像素点的灰度值进行相加求和,再除以第四区域中像素点的数量,得到第四区域对应的像素点的平均灰度值,作为第二统计结果。Specifically, the first statistical result and the second statistical result may be a sum of gray values or an average value of gray values. For example, the gray value of each pixel in the non-overlapping area can be added and summed, and then divided by the number of pixels in the non-overlapping area to obtain the average gray value of the pixel corresponding to the non-overlapping area, as the first statistical results. The gray value of each pixel in the fourth area can be added and summed, and then divided by the number of pixels in the fourth area to obtain the average gray value of the pixel corresponding to the fourth area as the second statistical result .

步骤S808,根据第一统计结果以及第二统计结果得到对比度特征。Step S808, obtaining the contrast feature according to the first statistical result and the second statistical result.

具体地,得到第一统计结果以及第二统计结果后,结合第一统计结果以及第二统计结果得到对比度特征。例如,对比度特征可以是第一统计结果与第二统计结果的比例值,或者对比度特征也可以是第一统计结果与第二统计结果的差值。Specifically, after the first statistical result and the second statistical result are obtained, the contrast feature is obtained by combining the first statistical result and the second statistical result. For example, the contrast feature may be the ratio of the first statistical result to the second statistical result, or the contrast feature may also be the difference between the first statistical result and the second statistical result.

在一个实施例中,当统计结果是灰度值的平均值,对比度特征是第一统计结果与第二统计结果的差值时,对比度特征的计算公式为公式(6),其中lmci为第i个当前像素点对应的对比度特征,nin为第四区域的像素点个数,nout为第三区域的像素点个数,F(x,y)表示像素点的灰度值。In one embodiment, when the statistical result is the average value of the gray value, and the contrast feature is the difference between the first statistical result and the second statistical result, the calculation formula of the contrast feature is formula (6), wherein lmci is the ith Contrast features corresponding to current pixels, n in is the number of pixels in the fourth area, n out is the number of pixels in the third area, F(x, y) represents the gray value of the pixels.

在一个实施例中,如图9所示,图像特征包括灰度梯度特征,得到当前像素点对应的灰度梯度特征的步骤包括:In one embodiment, as shown in FIG. 9, the image feature includes a grayscale gradient feature, and the step of obtaining the grayscale gradient feature corresponding to the current pixel includes:

步骤S902,根据当前像素点的位置在当前图像上获取第三区域和第四区域,其中,第四区域为第三区域的子区域,当前像素点位于第四区域内部。Step S902, acquiring a third area and a fourth area on the current image according to the position of the current pixel, wherein the fourth area is a sub-area of the third area, and the current pixel is located inside the fourth area.

具体地,灰度梯度特征是指像素与像素间的灰度差异相关的特征。第三区域和第四区域可以参照步骤S802的方法获得,具体不再赘述。Specifically, the grayscale gradient feature refers to a feature related to the grayscale difference between pixels. The third area and the fourth area can be obtained by referring to the method in step S802, and details are not repeated here.

步骤S904,获取第三区域和第四区域之间的非重叠图像区域。Step S904, acquiring non-overlapping image areas between the third area and the fourth area.

具体地,由于第四区域为第三区域的子区域,因此第三区域和第四区域之间的非重叠图像区域为第三区域中除了第四区域之外的区域。Specifically, since the fourth area is a sub-area of the third area, the non-overlapping image area between the third area and the fourth area is an area in the third area except the fourth area.

步骤S906,获取非重叠图像区域中各个像素点与相邻像素点的第一灰度差值,获取第四区域中各个像素点与相邻像素点的第二灰度差值。Step S906, acquiring a first grayscale difference between each pixel in the non-overlapping image area and adjacent pixels, and acquiring a second grayscale difference between each pixel in the fourth area and adjacent pixels.

具体地,相邻像素点是指与像素点存在重合边界的像素点,可以计算与全部相邻像素点的灰度差值,也可以计算部分相邻像素点的灰度差值。在一个实施例中,可以将灰度差值分为水平方向的灰度差值以及垂直方向上的灰度差值,灰度差值可以为水平方向的灰度差值与垂直方向的灰度差值中的一个,或者灰度差值可以为水平方向的灰度差值与垂直方向的灰度差值的和。以计算图3A的像素点P44对应的第一灰度差值为例,可以将P44与P45之间的灰度差值的绝对值作为P44对应的水平方向上的灰度差值,将P44与P54之间的灰度差值的绝对值作为P44对应的垂直方向上的灰度差值,然后将水平方向上的灰度差值与垂直方向上的灰度差值相加,得到P44对应的第一灰度差值。灰度差值的计算方法用公式表示为:Specifically, an adjacent pixel point refers to a pixel point that has an overlapping boundary with the pixel point, and the grayscale difference value with all adjacent pixel points may be calculated, or the grayscale difference value between some adjacent pixel points may be calculated. In one embodiment, the grayscale difference can be divided into the grayscale difference in the horizontal direction and the grayscale difference in the vertical direction. The grayscale difference can be the grayscale difference in the horizontal direction and the grayscale difference in the vertical direction. One of the differences, or the grayscale difference, may be the sum of the grayscale difference in the horizontal direction and the grayscale difference in the vertical direction. Taking the calculation of the first grayscale difference corresponding to pixel point P44 in Figure 3A as an example, the absolute value of the grayscale difference between P44 and P45 can be used as the grayscale difference in the horizontal direction corresponding to P44 , the absolute value of the grayscale difference between P44 and P54 is taken as the grayscale difference in the vertical direction corresponding to P44 , and then the grayscale difference in the horizontal direction and the grayscale difference in the vertical direction Add them together to get the first grayscale difference corresponding to P 44 . The calculation method of the gray level difference is expressed by the formula:

Gh(x,y)=|F(x,y)-F(x+1,y)| (7)G h (x,y)=|F(x,y)-F(x+1,y)| (7)

Gv(x,y)=|F(x,y)-F(x,y+1)| (8)G v (x,y)=|F(x,y)-F(x,y+1)| (8)

G(x,y)=Gh(x,y)+Gv(x,y) (9)G(x,y)=G h (x,y)+G v (x,y) (9)

其中,Gh(x,y)表示水平方向上的灰度差值,Gv(x,y)表示垂直方向上的灰度差值,G(x,y)为像素点对应的灰度差值,F(x,y)指像素点(x,y)对应的灰度值,x可以表示行,y表示列。Among them, G h (x, y) represents the gray level difference in the horizontal direction, G v (x, y) represents the gray level difference in the vertical direction, and G(x, y) is the gray level difference corresponding to the pixel Value, F(x, y) refers to the gray value corresponding to the pixel point (x, y), x can represent a row, and y represents a column.

步骤S908,对非重叠图像区域中各个像素点对应的第一灰度差值进行统计,得到第三统计结果,对第四区域中各个像素点对应的第二灰度差值进行统计,得到第四统计结果。Step S908: Perform statistics on the first grayscale difference corresponding to each pixel in the non-overlapping image area to obtain a third statistical result, and perform statistics on the second grayscale difference corresponding to each pixel in the fourth area to obtain the first grayscale difference 4. Statistical results.

具体地,第三统计结果以及第四统计结果可以是灰度差值的和也可以是灰度差值的平均值。例如,可以将非重叠区域的各个像素点的第一灰度差值进行相加求和,再除以非重叠区域中像素点的数量,得到非重叠区域对应的像素点的平均灰度差值,作为第三统计结果。可以将第四区域的各个像素点的第二灰度差值进行相加求和,再除以第四区域中像素点的数量,得到第四区域对应的像素点的平均灰度差值,作为第四统计结果。Specifically, the third statistical result and the fourth statistical result may be a sum of grayscale differences or an average value of grayscale differences. For example, the first grayscale difference of each pixel in the non-overlapping area can be added and summed, and then divided by the number of pixels in the non-overlapping area to obtain the average grayscale difference of the pixels corresponding to the non-overlapping area , as the third statistical result. The second grayscale difference of each pixel in the fourth area can be added and summed, and then divided by the number of pixels in the fourth area to obtain the average grayscale difference of the pixel corresponding to the fourth area, as The fourth statistical result.

步骤S910,根据第三统计结果以及第四统计结果得到灰度梯度特征。In step S910, the gray gradient feature is obtained according to the third statistical result and the fourth statistical result.

具体地,得到第三统计结果以及第四统计结果后,结合第三统计结果以及第四统计结果得到灰度梯度特征。例如,对比度特征可以是第三统计结果与第四统计结果的比例值,或者灰度梯度特征也可以是第三统计结果与第四统计结果的差值。当灰度梯度特征是第三统计结果与第四统计结果的差值,第三统计结果以及第四统计结果是灰度差值的平均值时,灰度梯度特征的计算公式如下,其中lmgi为第i个当前像素点对应的灰度梯度特征,nin为第四区域的像素点个数,nout为第三区域的像素点个数,G(x,y)表示灰度差值。Specifically, after the third statistical result and the fourth statistical result are obtained, the gray gradient feature is obtained by combining the third statistical result and the fourth statistical result. For example, the contrast feature may be the ratio of the third statistical result to the fourth statistical result, or the gray gradient feature may also be the difference between the third statistical result and the fourth statistical result. When the grayscale gradient feature is the difference between the third statistical result and the fourth statistical result, and the third statistical result and the fourth statistical result are the average value of the grayscale difference, the calculation formula of the grayscale gradient feature is as follows, where lmgi is The grayscale gradient feature corresponding to the i-th current pixel, n in is the number of pixels in the fourth area, n out is the number of pixels in the third area, G(x, y) represents the grayscale difference.

本发明实施例中,在计算当前像素点对应的图像特征时,计算的是当前像素点对应的区域的图像特征,而且分为两个区域进行计算,因此得到的图像特征能够反映当前像素点所处的环境,得到的第一概率准确度高。In the embodiment of the present invention, when calculating the image feature corresponding to the current pixel point, the image feature of the area corresponding to the current pixel point is calculated, and it is divided into two areas for calculation, so the obtained image feature can reflect the image feature of the current pixel point. environment, the accuracy of the obtained first probability is high.

在一个实施例中,图像特征可以包括对比度特征以及灰度梯度特征中的一种或者两种。In an embodiment, the image features may include one or both of contrast features and grayscale gradient features.

在一个实施例中,如图10所示,步骤S210即根据各个像素点对应的背景相似度和第一概率识别得到当前图像中目标对象所在的图像区域包括:In one embodiment, as shown in FIG. 10 , step S210 is to identify the image area where the target object is located in the current image according to the background similarity corresponding to each pixel point and the first probability, including:

步骤S1002,根据背景相似度得到当前像素点对应的第二概率,其中,第二概率为当前像素点属于目标对象像素点的概率,第二概率与背景相似度呈负相关关系。Step S1002, obtain a second probability corresponding to the current pixel according to the background similarity, wherein the second probability is the probability that the current pixel belongs to the pixel of the target object, and the second probability is negatively correlated with the background similarity.

具体地,背景相似度与第二概率呈负相关关系是指随着背景相似度的增大,第二概率变小。例如,第二概率可以是背景相似度的倒数。或者可以设置背景相似度的范围与第二概率的对应关系,如可以设置背景相似度为0~10%时,对应的第二概率为90%,当背景相似度为11~20%时,对应的第二概率为80%。或者,第二概率可以用如下公式表示,其中Bg(x,y)为背景相似度,Hb(x,y)表示像素点(x,y)对应的第二概率。Specifically, the negative correlation between the background similarity and the second probability means that as the background similarity increases, the second probability becomes smaller. For example, the second probability may be the inverse of the background similarity. Or you can set the corresponding relationship between the range of background similarity and the second probability. For example, when the background similarity can be set to 0-10%, the corresponding second probability is 90%. When the background similarity is 11-20%, the corresponding The second probability is 80%. Alternatively, the second probability may be represented by the following formula, where Bg(x, y) is the background similarity, and H b (x, y) represents the second probability corresponding to the pixel point (x, y).

Hb(x,y)=1-Bg(x,y) (11) Hb (x,y)=1-Bg(x,y) (11)

步骤S1004,根据第一概率以及第二概率确定当前像素点对应的当前目标概率,当前目标概率为当前像素点属于目标对象像素点的概率。Step S1004, determine the current target probability corresponding to the current pixel point according to the first probability and the second probability, the current target probability is the probability that the current pixel point belongs to the target object pixel point.

具体地,根据第一概率以及第二概率确定当前像素点对应的当前目标概率的方法可以根据需要设置,例如,可以将第一概率与第二概率相乘,将得到的乘积作为当前目标概率。或者将第一概率与第二概率的平均值作为当前目标概率。当然,也可以进一步设置乘积与目标概率的对应关系,根据乘积得到目标概率。也可以再结合另一种方法得到的当前像素点属于目标对象像素点的第三概率得到目标概率。例如,目标概率可以是第一概率、第二概率以及第三概率的乘积。Specifically, the method of determining the current target probability corresponding to the current pixel point according to the first probability and the second probability can be set as required, for example, the first probability can be multiplied by the second probability, and the obtained product can be used as the current target probability. Alternatively, the average value of the first probability and the second probability is used as the current target probability. Of course, it is also possible to further set the corresponding relationship between the product and the target probability, and obtain the target probability according to the product. The target probability can also be obtained by combining the third probability that the current pixel point belongs to the pixel point of the target object obtained by another method. For example, the target probability may be the product of the first probability, the second probability, and the third probability.

步骤S1006,根据当前图像中各个像素点对应的目标概率识别得到当前图像中目标对象所在的图像区域。Step S1006, according to the target probability corresponding to each pixel in the current image, identify the image area where the target object is located in the current image.

具体地,当前图像包括多个像素点,需要根据各个像素点对应的目标概率得到目标对象所在的图像区域。例如可以将目标概率大于预设概率的像素点作为目标对象像素点,将目标对象像素点组成的区域作为目标对象所在的图像区域。Specifically, the current image includes multiple pixels, and it is necessary to obtain the image region where the target object is located according to the target probability corresponding to each pixel. For example, pixels whose target probability is greater than a preset probability may be used as target object pixels, and an area composed of target object pixel points may be used as an image area where the target object is located.

在一个实施例中,还可以根据像素点的位置关系得到当前图像中目标对象所在的图像区域。例如,对于对应的区域为连续区域的目标对象,若存在目标概率虽然大于预设概率,但是为单独存在的像素点,即周围不存在目标概率大于预设概率的像素点,则该像素点也可以不是目标对象像素点。In one embodiment, the image area where the target object is located in the current image can also be obtained according to the positional relationship of the pixel points. For example, for a target object whose corresponding area is a continuous area, if there is a pixel point that exists alone although the target probability is greater than the preset probability, that is, there is no pixel around the target probability greater than the preset probability, then the pixel point is also It may not be the pixel of the target object.

在一个实施例中,如图11所示,步骤S1006即根据当前图像中各个像素点对应的目标概率识别得到当前图像中目标对象所在的图像区域包括:In one embodiment, as shown in FIG. 11 , step S1006 is to identify the image area where the target object is located in the current image according to the target probability corresponding to each pixel in the current image, including:

步骤S1102,获取当前图像中目标概率大于第一阈值的第一像素点。Step S1102, acquiring the first pixel in the current image whose target probability is greater than the first threshold.

具体地,第一阈值具体可以根据需要例如对识别准确度的要求进行设置,通过实验,发现当第一阈值为0.85时,识别准确度高。Specifically, the first threshold can be set according to needs, for example, requirements for recognition accuracy. Through experiments, it is found that when the first threshold is 0.85, the recognition accuracy is high.

在一个实施例中,对于目标概率小于第一阈值的像素点,可以将该像素点作为背景素点,将其对应的目标概率更新为0。In one embodiment, for a pixel point whose target probability is less than the first threshold, the pixel point may be used as a background pixel point, and its corresponding target probability is updated to 0.

步骤S1104,获取第一像素点对应的目标概率的分布特征。Step S1104, acquiring the distribution feature of the target probability corresponding to the first pixel.

具体地,分布特征反映了得到的目标概率的分布情况,可以包括目标概率最大值、最小值、平均值中以及在各个数值范围的分布比例或者个数的一种或多种。具体可以根据需要设置。各个数值范围可以是预先设置的,例如,可以设置0.85~0.88为第一个数值范围,0.89~0.92为第二个数值范围。Specifically, the distribution feature reflects the distribution of the obtained target probability, and may include one or more of the distribution ratio or number in the maximum value, minimum value, average value, and in each numerical range of the target probability. Specifically, it can be set as required. Each numerical range may be preset, for example, 0.85-0.88 may be set as the first numerical range, and 0.89-0.92 may be set as the second numerical range.

步骤S1106,根据分布特征得到第二阈值。Step S1106, obtaining a second threshold according to the distribution feature.

具体地,得到分布特征后,根据各个分布特征得到第二阈值。得到第二阈值的方法可以根据需要进行设置,例如可以采用图像阈值分割算法计算得到第二阈值,图像阈值分割算法例如可以包括OTSU(最大类间方差算法)、迭代求最大方差法以及最大熵法等中的一种或多种方法,其中在利用图像分割算法得到第二阈值时,将灰度值特征替换为第一像素点对应的目标概率进行计算,得到第二阈值。Specifically, after the distribution features are obtained, the second threshold is obtained according to each distribution feature. The method for obtaining the second threshold can be set as required. For example, the image threshold segmentation algorithm can be used to calculate the second threshold. The image threshold segmentation algorithm can include, for example, OTSU (maximum inter-class variance algorithm), iterative maximum variance method and maximum entropy method One or more methods in etc., wherein when using the image segmentation algorithm to obtain the second threshold, the gray value feature is replaced by the target probability corresponding to the first pixel point for calculation to obtain the second threshold.

步骤S1108,获取当前图像中目标概率大于第二阈值的第一像素点组合得到的区域,作为当前图像中目标对象所在的图像区域。Step S1108, acquiring an area obtained by combining the first pixel points in the current image whose target probability is greater than the second threshold, as the image area where the target object is located in the current image.

具体地,具体地,得到第二阈值后,将目标概率大于第二阈值的第一像素点作为目标对象像素点,将目标对象像素点组合得到的区域作为当前图像中目标对象所在的图像区域。Specifically, after the second threshold is obtained, the first pixel whose target probability is greater than the second threshold is used as the target object pixel, and the area obtained by combining the target object pixel points is used as the image area where the target object is located in the current image.

本发明实施例中,通过根据目标概率的分布特征得到第二阈值,根据第二阈值都图像进行再一次分割,由于可以通过第一阈值对像素点进行初步筛选后,再根据具体的图像对应的像素点的概率分布进一步筛选出目标对象像素点,因此,进一步提高了图像识别准确度。In the embodiment of the present invention, the second threshold is obtained according to the distribution characteristics of the target probability, and the image is segmented again according to the second threshold, since the pixels can be preliminarily screened through the first threshold, and then according to the specific image corresponding The probability distribution of the pixel points further screens out the pixel points of the target object, thus further improving the image recognition accuracy.

以一个具体的实施例对本发明实施例提供的方法进行说明,包括以下步骤:The method provided by the embodiment of the present invention is described with a specific embodiment, including the following steps:

1、获取待识别目标的当前图像,假设当前图像为7*7像素的图像,即包括7*7个像素点,共有7行以及7列。1. Obtain the current image of the target to be identified. Assume that the current image is an image of 7*7 pixels, that is, it includes 7*7 pixels, and there are 7 rows and 7 columns in total.

2、将各个像素点作为当前像素点,根据本发明实施例提供的方法分别计算每一个当前像素点对应的背景相似度以及对应的第一概率。其中,在计算背景相似度时,第一区域以及第三区域的大小为5*5像素,第二区域以及第四区域的大小为3*3像素。2. Using each pixel as a current pixel, calculate the background similarity and corresponding first probability corresponding to each current pixel according to the method provided by the embodiment of the present invention. Wherein, when calculating the background similarity, the size of the first area and the third area is 5*5 pixels, and the size of the second area and the fourth area is 3*3 pixels.

3、根据各个像素点对应的背景相似度计算各个像素点对应的第二概率,其中第二概率=1-背景相似度。3. Calculate the second probability corresponding to each pixel according to the background similarity corresponding to each pixel, where the second probability=1-background similarity.

4、根据第一概率以及第二概率得到各个像素点对应的目标概率,其中目标概率为第一概率与第二概率的乘积。如图12所示,图12中的一个方格代表一个像素,像素中的数字为像素点对应的目标概率。4. Obtain the target probability corresponding to each pixel according to the first probability and the second probability, wherein the target probability is the product of the first probability and the second probability. As shown in FIG. 12 , a square in FIG. 12 represents a pixel, and the number in the pixel is the target probability corresponding to the pixel.

5、获取当前图像中目标概率大于第一阈值的第一像素点,假设第一阈值为0.85,则图12所示的P16、P25、P26、P34、P35、P36、P45以及P46为第一像素点。5. Obtain the first pixel in the current image whose target probability is greater than the first threshold. Assuming the first threshold is 0.85, then P 16 , P 25 , P 26 , P 34 , P 35 , P 36 , P 45 and P 46 are the first pixel.

6、获取第二阈值。可以采用迭代法选择阈值的方法得到第二阈值,迭代法选择阈值算法首先选择一个初始阈值T,将图像分割成两个部分:R1和R2,计算出区域R1和R2的均值u1和u2,再选择新的阈值T=(u1+u2)/2,重复上面的过程,直到新的阈值相比上一次的阈值不再变化或者变化小于设定的阈值为止。在本发明实施例中,首先获取第一像素点中对应的最大目标概率以及最小目标概率,分别为0.86以及0.96,因此初始阈值为0.86+0.96=0.91,将0.91作为阈值,对第一像素点进行分类,可以得到P26、P36、P45为目标对象像素点,其他的为背景像素点。计算目标对象像素点P26、P36、P45的目标概率平均值,为(0.96+0.91+0.96)/3=0.94。计算背景像素点的目标概率平均值,为0.89+0.86+0.87+0.87+0.89=0.876,故新的阈值为(0.876+0.94)/2=0.913,新的阈值与初始阈值的变化值为0.913-0.91=0.003,假设该变化值小于设定的阈值,则0.913为第二阈值,假设该变化值大于设定的阈值,则可以继续将0.913作为阈值对第一像素点进行分类,然后重复上述步骤,直至新的阈值相比上一次的阈值不再变化或者变化小于设定的阈值为止。6. Obtain the second threshold. The second threshold can be obtained by using the iterative method to select the threshold value. The iterative method selects the threshold value algorithm first selects an initial threshold value T, divides the image into two parts: R1 and R2, calculates the mean values u1 and u2 of the regions R1 and R2, and then Select a new threshold T=(u1+u2)/2, and repeat the above process until the new threshold does not change from the previous threshold or the change is smaller than the set threshold. In the embodiment of the present invention, first obtain the corresponding maximum target probability and minimum target probability in the first pixel point, which are 0.86 and 0.96 respectively, so the initial threshold value is 0.86+0.96=0.91, and 0.91 is used as the threshold value, for the first pixel point After classification, it can be obtained that P 26 , P 36 , and P 45 are target pixel points, and the others are background pixel points. Calculate the target probability average value of the target object pixel points P 26 , P 36 , and P 45 , which is (0.96+0.91+0.96)/3=0.94. Calculate the average target probability of background pixels, which is 0.89+0.86+0.87+0.87+0.89=0.876, so the new threshold is (0.876+0.94)/2=0.913, and the change value between the new threshold and the initial threshold is 0.913- 0.91=0.003, assuming that the change value is less than the set threshold, then 0.913 is the second threshold, assuming that the change value is greater than the set threshold, you can continue to use 0.913 as the threshold to classify the first pixel, and then repeat the above steps , until the new threshold does not change from the previous threshold or the change is smaller than the set threshold.

7、获取当前图像中目标概率大于第二阈值的第一像素点组合得到的区域,作为当前图像中目标对象所在的图像区域。假设第二阈值最终为0.87,则图12中,P16、P26、P36、P45、P46这4个像素点组成的区域为目标对象当前图像中目标对象所在的图像区域。7. Obtain an area obtained by combining the first pixel points in the current image whose target probability is greater than the second threshold, and use it as the image area where the target object is located in the current image. Assuming that the second threshold is finally 0.87, in FIG. 12 , the area composed of four pixels P 16 , P 26 , P 36 , P 45 , and P 46 is the image area where the target object is located in the current image of the target object.

在一个实施例中,以采用特征选择性滤波法(CSF)、最大最小值差分法(DMMF)和多尺度梯度法(MSG)以及本发明实施例提供的方法对九段红外视频进行图像识别后进行背景抑制为例,对本发明实施例提供的方法的效果进行进一步说明,并采用信噪比增益(ISNR)、对比度增益(ISCR)和背景抑制因子(BSF)这三种指标来评价背景抑制结果。其中,背景抑制因子越大,则说明全局背景平滑效果越好。信噪比增益和对比度增益越大,则说明方法抑制杂波增强弱小目标的能力越强。具体的指标结果如表1所示,其中表中的seq表示视频,seq后的数字为视频的标号,由表1可以看出:特征选择性滤波法(CSF)的BSF较高、ISNR及ISCR较低,说明其具有较好的全局背景平滑性能,但杂波抑制效果欠佳,最大最小值差分法(DMMF)的ISCR较高,但ISNR及BSF较低,说明其目标信噪比提升度不强,全局背景抑制度欠佳。多尺度梯度法(MSG)的三种指标均较低,说明其背景抑制性能一般。而本方法同时具有较高的ISNR、ISCR及BSF指标,其全局背景平滑与局部杂波抑制效果较好,能有效抑制复杂背景杂波,突显目标。In one embodiment, after performing image recognition on nine segments of infrared video by adopting Feature Selective Filtering (CSF), Maximum-Minimum Difference (DMMF) and Multi-Scale Gradient (MSG) and the method provided by the embodiment of the present invention Taking background suppression as an example, the effect of the method provided by the embodiment of the present invention is further described, and three indexes, signal-to-noise ratio gain (ISNR), contrast gain (ISCR) and background suppression factor (BSF), are used to evaluate the background suppression result. Among them, the larger the background suppression factor is, the better the global background smoothing effect is. The greater the SNR gain and contrast gain, the stronger the ability of the method to suppress clutter and enhance weak targets. The specific index results are shown in Table 1, where seq in the table represents the video, and the number after seq is the video label. It can be seen from Table 1 that the BSF, ISNR and ISCR of the feature selective filtering method (CSF) are relatively high Low, indicating that it has good global background smoothing performance, but the clutter suppression effect is not good. The ISCR of the maximum and minimum difference method (DMMF) is high, but the ISNR and BSF are low, indicating that the target signal-to-noise ratio is improved. Not strong, poor global background suppression. The three indicators of the multi-scale gradient method (MSG) are all low, indicating that its background suppression performance is average. However, this method has higher ISNR, ISCR and BSF indicators at the same time, and its global background smoothing and local clutter suppression effects are better, which can effectively suppress complex background clutter and highlight the target.

表1四种检测算法的图像识别评价指标Table 1 Image recognition evaluation indicators of four detection algorithms

在一个实施例中,还可以采用检测率(r)、准确率(p)和综合指标(F1)来评价弱小目标的识别效果。其中,r为检测到的正确目标数与真实目标总数之比,p为检测到的正确目标数与检测到的目标总数之比,F1为r和p指标的综合指数,可以为r与p对应的加权调和平均值。具有较高的r值,同时保持较高的p值,较高的F1值也意味着好的识别性能。In one embodiment, detection rate (r), accuracy rate (p) and comprehensive index (F1) can also be used to evaluate the recognition effect of weak and small targets. Among them, r is the ratio of the number of detected correct targets to the total number of real targets, p is the ratio of the number of detected correct targets to the total number of detected targets, F1 is the comprehensive index of r and p indicators, which can be r and p The weighted harmonic mean of . Having a higher r value while maintaining a higher p value, a higher F1 value also means good recognition performance.

四种方法针对九段红外视频的检测评价结果如表2所示。从表2中可以看出:特征选择性滤波法(CSF)具有较高的检测率,但准确率较低,整体检测性能一般。多尺度梯度法(MSG)和最大最小值差分法(DMMF)具有较高的检测率,但准确率较低,而本方法同时具有较高的检测率和准确率,其F1指标高达97.7%,具有较好的检测稳定性。The detection and evaluation results of the four methods for the nine-segment infrared video are shown in Table 2. It can be seen from Table 2 that the feature selective filtering method (CSF) has a high detection rate, but the accuracy rate is low, and the overall detection performance is average. The multi-scale gradient method (MSG) and the maximum-minimum difference method (DMMF) have a high detection rate, but the accuracy rate is low, while this method has a high detection rate and accuracy rate at the same time, and its F1 index is as high as 97.7%. It has good detection stability.

表2四种检测方法的平均目标检测评价指标Table 2 The average target detection evaluation index of the four detection methods

此外,选取三张图像,其中第一张图像的背景为无云且天空颜色为深色,其中第二张图像的背景为有云且摄像距离远,第三张图像的背景为有云且摄像距离近,如图13所示,第一列的图像为原始图像,方框内的小点表示目标对象实际的位置,并采用上述的四种方法识别图像中的目标对象,图13中第2列到第4列的图像分别为特征选择性滤波法(CSF)、最大最小值差分法(DMMF)和多尺度梯度法(MSG)以及本发明实施例提供的方法对应的目标对象的检测结果,由图13可以看出,本发明实施例提供的方法,能够准确识别出目标对象所在的图像位置。In addition, three images are selected, the background of the first image is cloudless and the sky color is dark, the background of the second image is cloudy and the camera distance is far away, the background of the third image is cloudy and the camera The distance is short, as shown in Figure 13, the image in the first column is the original image, the dots in the box indicate the actual position of the target object, and the above four methods are used to identify the target object in the image, the second column in Figure 13 The images in columns 4 to 4 are respectively the detection results of the target object corresponding to the feature selective filter method (CSF), the maximum and minimum difference method (DMMF), the multi-scale gradient method (MSG) and the method provided by the embodiment of the present invention, It can be seen from FIG. 13 that the method provided by the embodiment of the present invention can accurately identify the image position where the target object is located.

如图14所示,在一个实施例中,提供了一种图像识别装置,该图像识别装置可以集成于上述的计算机设备120中,具体可以包括当前图像获取模块1402、背景区域确定模块1404、相似度计算模块1406、第一概率得到模块1408以及目标区域识别模块1410。As shown in FIG. 14, in one embodiment, an image recognition device is provided, which can be integrated into the above-mentioned computer device 120, and specifically can include a current image acquisition module 1402, a background area determination module 1404, similar A degree calculation module 1406 , a first probability obtaining module 1408 and a target area identification module 1410 .

当前图像获取模块1402,用于获取待识别目标的当前图像。The current image acquiring module 1402 is configured to acquire the current image of the target to be identified.

背景区域确定模块1404,用于从当前图像中获取当前像素点,根据当前像素点的位置确定对应的背景参考区域。The background area determination module 1404 is configured to obtain the current pixel point from the current image, and determine the corresponding background reference area according to the position of the current pixel point.

相似度计算模块1406,用于根据背景参考区域计算当前像素点对应的背景相似度。A similarity calculation module 1406, configured to calculate the background similarity corresponding to the current pixel point according to the background reference area.

第一概率得到模块1408,用于根据已训练的图像目标识别模型对当前像素点对应的图像特征进行处理,得到当前像素点对应的第一概率,第一概率为当前像素点属于目标对象像素点的概率。The first probability obtaining module 1408 is used to process the image feature corresponding to the current pixel according to the trained image target recognition model to obtain the first probability corresponding to the current pixel. The first probability is that the current pixel belongs to the pixel of the target object The probability.

目标区域识别模块1410,用于计算得到当前图像中的各个像素点对应的背景相似度和第一概率,根据各个像素点对应的背景相似度和第一概率识别得到当前图像中目标对象所在的图像区域。The target area identification module 1410 is used to calculate the background similarity and first probability corresponding to each pixel in the current image, and identify the image where the target object is located in the current image according to the background similarity and first probability corresponding to each pixel area.

在其中一个实施例中,背景区域确定模块1404包括:In one of the embodiments, the background area determination module 1404 includes:

第一区域获取单元,用于根据当前像素点的位置在当前图像上获取第一区域和第二区域,其中,第二区域为第一区域的子区域,当前像素点位于第二区域内部。The first area acquisition unit is configured to acquire a first area and a second area on the current image according to the position of the current pixel, wherein the second area is a sub-area of the first area, and the current pixel is located inside the second area.

第一区域确定单元,用于将第一区域和第二区域之间的非重叠图像区域作为背景参考区域。The first area determining unit is configured to use the non-overlapping image area between the first area and the second area as a background reference area.

在其中一个实施例中,如图15所示,相似度计算模块1406包括:In one of the embodiments, as shown in FIG. 15, the similarity calculation module 1406 includes:

灰度值获取单元1406A,用于从背景参考区域获取目标像素点,获取目标像素点和当前像素点对应的灰度值。The gray value obtaining unit 1406A is configured to obtain the target pixel from the background reference area, and obtain the gray value corresponding to the target pixel and the current pixel.

参考向量组成单元1406B,用于根据目标像素点的灰度值计算得到参考灰度值,对参考灰度值进行取反运算得到对应的互补参考灰度值,将参考灰度值和互补参考灰度值组成参考灰度值向量。The reference vector composition unit 1406B is used to calculate the reference gray value according to the gray value of the target pixel point, perform an inverse operation on the reference gray value to obtain the corresponding complementary reference gray value, and combine the reference gray value and the complementary reference gray value Intensity values constitute the reference gray value vector.

当前向量组成单元1406C,用于对当前像素点对应的灰度值进行取反运算得到对应的互补当前灰度值,将当前像素点对应的灰度值和互补当前灰度值组成当前灰度值向量。The current vector composition unit 1406C is used to invert the gray value corresponding to the current pixel to obtain the corresponding complementary current gray value, and to combine the gray value corresponding to the current pixel and the complementary current gray value to form the current gray value vector.

相似度计算单元1406D,用于根据参考灰度值向量和当前灰度值向量计算得到当前像素点对应的背景相似度。The similarity calculation unit 1406D is configured to calculate the background similarity corresponding to the current pixel according to the reference gray value vector and the current gray value vector.

在其中一个实施例中,图像目标识别模型为支持向量聚类模型,第一概率得到模块包括:In one of the embodiments, the image target recognition model is a support vector clustering model, and the first probability obtaining module includes:

模型参数获取单元,用于获取图像目标识别模型对应的特征映射函数,获取与特征映射函数对应的特征空间的中心值。The model parameter acquisition unit is configured to acquire a feature mapping function corresponding to the image target recognition model, and acquire a central value of a feature space corresponding to the feature mapping function.

映射值计算单元,用于根据特征映射函数对图像特征进行计算,得到图像特征对应的映射值。The mapping value calculation unit is used to calculate the image feature according to the feature mapping function to obtain the mapping value corresponding to the image feature.

第一距离计算单元,用于计算映射值与中心值的第一距离。A first distance calculation unit, configured to calculate a first distance between the mapped value and the central value.

第一概率得到单元,用于根据第一距离计算得到当前像素点对应的第一概率,其中,第一距离与第一概率呈负相关关系。The first probability obtaining unit is configured to calculate and obtain the first probability corresponding to the current pixel point according to the first distance, wherein the first distance has a negative correlation with the first probability.

在其中一个实施例中,图像识别装置还包括:In one of the embodiments, the image recognition device further includes:

第二距离获取模块,用于获取特征空间的中心到特征空间的边界的第二距离。A second distance acquisition module, configured to acquire a second distance from the center of the feature space to the boundary of the feature space.

第一概率得到单元用于:计算第一距离与第二距离的比例值。根据比例值计算得到当前像素点对应的第一概率,其中,比例值与第一概率呈负相关关系。The first probability obtaining unit is used for: calculating a ratio value of the first distance to the second distance. The first probability corresponding to the current pixel point is calculated according to the proportional value, wherein the proportional value and the first probability are negatively correlated.

在其中一个实施例中,图像识别装置还包括:In one of the embodiments, the image recognition device further includes:

训练区域获取模块,用于获取训练图像,获取训练图像中的目标对象对应的训练区域。The training area acquiring module is configured to acquire the training image, and acquire the training area corresponding to the target object in the training image.

训练特征获取模块,用于获取训练区域中各个像素点对应的训练图像特征。The training feature acquisition module is used to acquire training image features corresponding to each pixel in the training area.

训练模块,用于根据训练图像特征进行模型训练,得到将训练图像特征映射到最小的特征空间的特征映射函数以及特征空间的中心值。The training module is used for performing model training according to the training image features, and obtaining a feature mapping function for mapping the training image features to the smallest feature space and a central value of the feature space.

在其中一个实施例中,图像装置还包括:In one of the embodiments, the image device further includes:

第二区域获取单元,用于根据当前像素点的位置在当前图像上获取第三区域和第四区域,其中,第四区域为第三区域的子区域,当前像素点位于第四区域内部。The second area acquisition unit is configured to acquire a third area and a fourth area on the current image according to the position of the current pixel, wherein the fourth area is a sub-area of the third area, and the current pixel is located inside the fourth area.

第二区域确定单元,用于获取第三区域和第四区域之间的非重叠图像区域。The second area determination unit is configured to acquire non-overlapping image areas between the third area and the fourth area.

第一统计单元,用于对非重叠图像区域对应的像素点的灰度值进行统计,得到第一统计结果,对第四区域对应的像素点的灰度值进行统计,得到第二统计结果。The first statistical unit is configured to perform statistics on the grayscale values of pixels corresponding to the non-overlapping image regions to obtain a first statistical result, and to collect statistics on the grayscale values of pixels corresponding to the fourth region to obtain a second statistical result.

对比度特征得到单元,用于根据第一统计结果以及第二统计结果得到对比度特征。The contrast feature obtaining unit is configured to obtain the contrast feature according to the first statistical result and the second statistical result.

在其中一个实施例中,如图16所示,目标区域识别模块1410包括:In one of the embodiments, as shown in FIG. 16 , the target area identification module 1410 includes:

第二概率得到单元1410A,用于根据背景相似度得到当前像素点对应的第二概率,其中,第二概率为当前像素点属于目标对象像素点的概率,第二概率与背景相似度呈负相关关系。The second probability obtaining unit 1410A is configured to obtain the second probability corresponding to the current pixel point according to the background similarity, wherein the second probability is the probability that the current pixel point belongs to the target object pixel point, and the second probability is negatively correlated with the background similarity relation.

目标概率得到单元1410B,用于根据第一概率以及第二概率确定当前像素点对应的当前目标概率,当前目标概率为当前像素点属于目标对象像素点的概率。The target probability obtaining unit 1410B is configured to determine the current target probability corresponding to the current pixel point according to the first probability and the second probability, and the current target probability is the probability that the current pixel point belongs to the target object pixel point.

目标区域识别单元1410C,用于根据当前图像中各个像素点对应的目标概率识别得到当前图像中目标对象所在的图像区域。The target area identification unit 1410C is configured to identify the image area where the target object is located in the current image according to the target probability corresponding to each pixel in the current image.

在其中一个实施例中,目标区域识别单元1410C用于:获取当前图像中目标概率大于第一阈值的第一像素点。获取第一像素点对应的目标概率的分布特征。根据分布特征得到第二阈值。获取当前图像中目标概率大于第二阈值的第一像素点组合得到的区域,作为当前图像中目标对象所在的图像区域。In one of the embodiments, the target area identifying unit 1410C is configured to: acquire a first pixel point in the current image whose target probability is greater than a first threshold. Obtain the distribution feature of the target probability corresponding to the first pixel point. The second threshold is obtained according to the distribution characteristics. An area obtained by combining the first pixel points in the current image with a target probability greater than the second threshold is acquired as the image area where the target object is located in the current image.

图17示出了一个实施例中计算机设备的内部结构图。该计算机设备具体可以是图1中的计算器设备120。如图17所示,该计算机设备包括该计算机设备包括通过系统总线连接的处理器、存储器、网络接口以及输入装置。其中,存储器包括非易失性存储介质和内存储器。该计算机设备的非易失性存储介质存储有操作系统,还可存储有计算机程序,该计算机程序被处理器执行时,可使得处理器实现图像识别方法。该内存储器中也可储存有计算机程序,该计算机程序被处理器执行时,可使得处理器执行图像识别方法。计算机设备的输入装置可以是显示屏上覆盖的触摸层,也可以是计算机设备外壳上设置的按键、轨迹球或触控板,还可以是外接的键盘、触控板或鼠标等。Figure 17 shows an internal block diagram of a computer device in one embodiment. The computer device may specifically be the calculator device 120 in FIG. 1 . As shown in FIG. 17 , the computer equipment includes a processor, a memory, a network interface, and an input device connected through a system bus. Wherein, the memory includes a non-volatile storage medium and an internal memory. The non-volatile storage medium of the computer device stores an operating system, and may also store a computer program. When the computer program is executed by the processor, the processor can realize the image recognition method. A computer program may also be stored in the internal memory, and when the computer program is executed by the processor, the processor may execute the image recognition method. The input device of the computer equipment may be a touch layer covered on the display screen, or a button, a trackball or a touch pad provided on the casing of the computer equipment, or an external keyboard, touch pad or mouse.

本领域技术人员可以理解,图17中示出的结构,仅仅是与本申请方案相关的部分结构的框图,并不构成对本申请方案所应用于其上的计算机设备的限定,具体的计算机设备可以包括比图中所示更多或更少的部件,或者组合某些部件,或者具有不同的部件布置。Those skilled in the art can understand that the structure shown in Figure 17 is only a block diagram of a partial structure related to the solution of this application, and does not constitute a limitation on the computer equipment on which the solution of this application is applied. The specific computer equipment can be More or fewer components than shown in the figures may be included, or some components may be combined, or have a different arrangement of components.

在一个实施例中,本申请提供的图像识别装置可以实现为一种计算机程序的形式,计算机程序可在如图17所示的计算机设备上运行。计算机设备的存储器中可存储组成该图像识别装置的各个程序模块,比如,图14所示的当前图像获取模块1402、背景区域确定模块1404、相似度计算模块1406、第一概率得到模块1408以及目标区域识别模块1410。各个程序模块构成的计算机程序使得处理器执行本说明书中描述的本申请各个实施例的图像识别方法中的步骤。In one embodiment, the image recognition apparatus provided in the present application can be implemented in the form of a computer program, and the computer program can be run on the computer device as shown in FIG. 17 . Various program modules that make up the image recognition device can be stored in the memory of the computer equipment, such as the current image acquisition module 1402 shown in FIG. Region identification module 1410 . The computer program constituted by each program module enables the processor to execute the steps in the image recognition method of each embodiment of the application described in this specification.

例如,图17所示的计算机设备可以通过如图14所示的图像识别装置中的当前图像获取模块1402获取待识别目标的当前图像;通过背景区域确定模块1404从当前图像中获取当前像素点,根据当前像素点的位置确定对应的背景参考区域;通过相似度计算模块1406根据背景参考区域计算当前像素点对应的背景相似度;通过第一概率得到模块1408根据已训练的图像目标识别模型对当前像素点对应的图像特征进行处理,得到当前像素点对应的第一概率,第一概率为当前像素点属于目标对象像素点的概率;通过目标区域识别模块1410计算得到当前图像中的各个像素点对应的背景相似度和第一概率,根据各个像素点对应的背景相似度和第一概率识别得到当前图像中目标对象所在的图像区域。For example, the computer equipment shown in FIG. 17 can obtain the current image of the target to be recognized through the current image acquisition module 1402 in the image recognition device as shown in FIG. 14; obtain the current pixel from the current image through the background area determination module 1404, Determine the corresponding background reference area according to the position of the current pixel point; calculate the background similarity corresponding to the current pixel point by the similarity calculation module 1406 according to the background reference area; obtain the current pixel point by the first probability module 1408 according to the trained image target recognition model The image feature corresponding to the pixel is processed to obtain the first probability corresponding to the current pixel, and the first probability is the probability that the current pixel belongs to the pixel of the target object; through the calculation of the target area recognition module 1410, each pixel in the current image corresponds to The background similarity and first probability corresponding to each pixel point are identified to obtain the image area where the target object is located in the current image according to the background similarity and first probability corresponding to each pixel.

在一个实施例中,提出了一种计算机设备,计算机设备包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,处理器执行计算机程序时实现以下步骤:获取待识别目标的当前图像;从当前图像中获取当前像素点,根据当前像素点的位置确定对应的背景参考区域;根据背景参考区域计算当前像素点对应的背景相似度;根据已训练的图像目标识别模型对当前像素点对应的图像特征进行处理,得到当前像素点对应的第一概率,第一概率为当前像素点属于目标对象像素点的概率;计算得到当前图像中的各个像素点对应的背景相似度和第一概率,根据各个像素点对应的背景相似度和第一概率识别得到当前图像中目标对象所在的图像区域。In one embodiment, a computer device is proposed. The computer device includes a memory, a processor, and a computer program stored on the memory and operable on the processor. When the processor executes the computer program, the following steps are implemented: acquiring the target to be identified the current image; obtain the current pixel from the current image, and determine the corresponding background reference area according to the position of the current pixel; calculate the background similarity corresponding to the current pixel according to the background reference area; The image features corresponding to the pixels are processed to obtain the first probability corresponding to the current pixel. The first probability is the probability that the current pixel belongs to the pixel of the target object; the background similarity and the first probability corresponding to each pixel in the current image are calculated. One probability, according to the background similarity corresponding to each pixel and the first probability, the image area where the target object is located in the current image is identified.

在一个实施例中,处理器执行的根据当前像素点的位置确定对应的背景参考区域包括:根据当前像素点的位置在当前图像上获取第一区域和第二区域,其中,第二区域为第一区域的子区域,当前像素点位于第二区域内部;将第一区域和第二区域之间的非重叠图像区域作为背景参考区域。In one embodiment, the determination of the corresponding background reference area according to the position of the current pixel by the processor includes: acquiring a first area and a second area on the current image according to the position of the current pixel, wherein the second area is the first A sub-area of the first area, the current pixel is located inside the second area; the non-overlapping image area between the first area and the second area is used as the background reference area.

在一个实施例中,处理器执行的根据背景参考区域计算当前像素点对应的背景相似度,包括:从背景参考区域获取目标像素点,获取目标像素点和当前像素点对应的灰度值;根据目标像素点的灰度值计算得到参考灰度值,对参考灰度值进行取反运算得到对应的互补参考灰度值,将参考灰度值和互补参考灰度值组成参考灰度值向量;对当前像素点对应的灰度值进行取反运算得到对应的互补当前灰度值,将当前像素点对应的灰度值和互补当前灰度值组成当前灰度值向量;根据参考灰度值向量和当前灰度值向量计算得到当前像素点对应的背景相似度。In one embodiment, the calculation of the background similarity corresponding to the current pixel point according to the background reference area performed by the processor includes: obtaining the target pixel point from the background reference area, and obtaining the gray value corresponding to the target pixel point and the current pixel point; The gray value of the target pixel is calculated to obtain a reference gray value, and the reference gray value is inverted to obtain a corresponding complementary reference gray value, and the reference gray value and the complementary reference gray value are composed of a reference gray value vector; The gray value corresponding to the current pixel is inverted to obtain the corresponding complementary current gray value, and the gray value corresponding to the current pixel and the complementary current gray value form the current gray value vector; according to the reference gray value vector Calculate the background similarity corresponding to the current pixel with the current gray value vector.

在一个实施例中,图像目标识别模型为支持向量聚类模型,处理器执行根据已训练的图像目标识别模型对当前像素点对应的图像特征进行处理,得到当前像素点对应的第一概率包括:获取图像目标识别模型对应的特征映射函数,获取与特征映射函数对应的特征空间的中心值;根据特征映射函数对图像特征进行计算,得到图像特征对应的映射值;计算映射值与中心值的第一距离;根据第一距离计算得到当前像素点对应的第一概率,其中,第一距离与第一概率呈负相关关系。In one embodiment, the image target recognition model is a support vector clustering model, and the processor executes processing the image features corresponding to the current pixel according to the trained image target recognition model, and obtaining the first probability corresponding to the current pixel includes: Obtain the feature mapping function corresponding to the image target recognition model, and obtain the central value of the feature space corresponding to the feature mapping function; calculate the image feature according to the feature mapping function, and obtain the mapping value corresponding to the image feature; calculate the first mapping value and the central value A distance: calculating a first probability corresponding to the current pixel point according to the first distance, wherein the first distance is negatively correlated with the first probability.

在一个实施例中,计算机程序还使得处理器执行如下步骤:获取特征空间的中心到特征空间的边界的第二距离;根据第一距离计算得到当前像素点为目标对应的像素点的第一概率包括:计算第一距离与第二距离的比例值;根据比例值计算得到当前像素点对应的第一概率,其中,比例值与第一概率呈负相关关系。In one embodiment, the computer program further enables the processor to perform the following steps: obtain the second distance from the center of the feature space to the boundary of the feature space; calculate the first probability that the current pixel point is the pixel point corresponding to the target according to the first distance The method includes: calculating a ratio value between the first distance and the second distance; calculating a first probability corresponding to the current pixel point according to the ratio value, wherein the ratio value and the first probability have a negative correlation.

在一个实施例中,处理器执行的得到图像目标识别模型的步骤包括:获取训练图像,获取训练图像中的目标对象对应的训练区域;获取训练区域中各个像素点对应的训练图像特征;根据训练图像特征进行模型训练,得到将训练图像特征映射到最小的特征空间的特征映射函数以及特征空间的中心值。In one embodiment, the step of obtaining the image target recognition model performed by the processor includes: obtaining a training image, obtaining a training area corresponding to a target object in the training image; obtaining training image features corresponding to each pixel in the training area; The image features are used for model training, and the feature mapping function that maps the training image features to the smallest feature space and the center value of the feature space are obtained.

在一个实施例中,处理器执行的,图像特征包括对比度特征,得到当前像素点对应的对比度特征的步骤包括:根据当前像素点的位置在当前图像上获取第三区域和第四区域,其中,第四区域为第三区域的子区域,当前像素点位于第四区域内部;获取第三区域和第四区域之间的非重叠图像区域;对非重叠图像区域对应的像素点的灰度值进行统计,得到第一统计结果,对第四区域对应的像素点的灰度值进行统计,得到第二统计结果;根据第一统计结果以及第二统计结果得到对比度特征。In one embodiment, the image features executed by the processor include contrast features, and the step of obtaining the contrast feature corresponding to the current pixel point includes: acquiring the third area and the fourth area on the current image according to the position of the current pixel point, wherein, The fourth area is a sub-area of the third area, and the current pixel is located inside the fourth area; the non-overlapping image area between the third area and the fourth area is obtained; the gray value of the pixel point corresponding to the non-overlapping image area is calculated Statistics, to obtain a first statistical result, and perform statistics on the gray values of pixels corresponding to the fourth area to obtain a second statistical result; obtain a contrast feature according to the first statistical result and the second statistical result.

在一个实施例中,处理器执行的根据各个像素点对应的背景相似度和第一概率识别得到当前图像中目标对象所在的图像区域包括:根据背景相似度得到当前像素点对应的第二概率,其中,第二概率为当前像素点属于目标对象像素点的概率,第二概率与背景相似度呈负相关关系;根据第一概率以及第二概率确定当前像素点对应的当前目标概率,当前目标概率为当前像素点属于目标对象像素点的概率;根据当前图像中各个像素点对应的目标概率识别得到当前图像中目标对象所在的图像区域。In one embodiment, the process performed by the processor to identify the image region where the target object is located in the current image according to the background similarity corresponding to each pixel and the first probability includes: obtaining the second probability corresponding to the current pixel according to the background similarity, Wherein, the second probability is the probability that the current pixel belongs to the pixel of the target object, and the second probability is negatively correlated with the background similarity; the current target probability corresponding to the current pixel is determined according to the first probability and the second probability, and the current target probability is the probability that the current pixel belongs to the pixel of the target object; the image area where the target object is located in the current image is identified according to the target probability corresponding to each pixel in the current image.

在一个实施例中,处理器执行的根据当前图像中各个像素点对应的目标概率识别得到当前图像中目标对象所在的图像区域包括:获取当前图像中目标概率大于第一阈值的第一像素点;获取第一像素点对应的目标概率的分布特征;根据分布特征得到第二阈值;获取当前图像中目标概率大于第二阈值的第一像素点组合得到的区域,作为当前图像中目标对象所在的图像区域。In one embodiment, the identifying the image region where the target object is located in the current image according to the target probability corresponding to each pixel in the current image performed by the processor includes: acquiring a first pixel in the current image with a target probability greater than a first threshold; Obtain the distribution feature of the target probability corresponding to the first pixel point; obtain the second threshold according to the distribution feature; obtain the area obtained by combining the first pixel points in the current image whose target probability is greater than the second threshold value, and use it as the image where the target object is located in the current image area.

在一个实施例中,提供一种计算机可读存储介质,计算机可读存储介质上存储有计算机程序,计算机程序被处理器执行时,使得处理器执行以下步骤:获取待识别目标的当前图像;从当前图像中获取当前像素点,根据当前像素点的位置确定对应的背景参考区域;根据背景参考区域计算当前像素点对应的背景相似度;根据已训练的图像目标识别模型对当前像素点对应的图像特征进行处理,得到当前像素点对应的第一概率,第一概率为当前像素点属于目标对象像素点的概率;计算得到当前图像中的各个像素点对应的背景相似度和第一概率,根据各个像素点对应的背景相似度和第一概率识别得到当前图像中目标对象所在的图像区域。In one embodiment, a computer-readable storage medium is provided. A computer program is stored on the computer-readable storage medium. When the computer program is executed by a processor, the processor is made to perform the following steps: acquire the current image of the target to be identified; Obtain the current pixel in the current image, determine the corresponding background reference area according to the position of the current pixel; calculate the background similarity corresponding to the current pixel according to the background reference area; Features are processed to obtain the first probability corresponding to the current pixel point, the first probability is the probability that the current pixel point belongs to the target object pixel point; the background similarity and the first probability corresponding to each pixel point in the current image are calculated, and according to each The background similarity corresponding to the pixel points and the first probability identify the image area where the target object is located in the current image.

在一个实施例中,处理器执行的根据当前像素点的位置确定对应的背景参考区域包括:根据当前像素点的位置在当前图像上获取第一区域和第二区域,其中,第二区域为第一区域的子区域,当前像素点位于第二区域内部;将第一区域和第二区域之间的非重叠图像区域作为背景参考区域。In one embodiment, the determination of the corresponding background reference area according to the position of the current pixel by the processor includes: acquiring a first area and a second area on the current image according to the position of the current pixel, wherein the second area is the first A sub-area of the first area, the current pixel is located inside the second area; the non-overlapping image area between the first area and the second area is used as the background reference area.

在一个实施例中,处理器执行的根据背景参考区域计算当前像素点对应的背景相似度,包括:从背景参考区域获取目标像素点,获取目标像素点和当前像素点对应的灰度值;根据目标像素点的灰度值计算得到参考灰度值,对参考灰度值进行取反运算得到对应的互补参考灰度值,将参考灰度值和互补参考灰度值组成参考灰度值向量;对当前像素点对应的灰度值进行取反运算得到对应的互补当前灰度值,将当前像素点对应的灰度值和互补当前灰度值组成当前灰度值向量;根据参考灰度值向量和当前灰度值向量计算得到当前像素点对应的背景相似度。In one embodiment, the calculation of the background similarity corresponding to the current pixel point according to the background reference area performed by the processor includes: obtaining the target pixel point from the background reference area, and obtaining the gray value corresponding to the target pixel point and the current pixel point; The gray value of the target pixel is calculated to obtain a reference gray value, and the reference gray value is inverted to obtain a corresponding complementary reference gray value, and the reference gray value and the complementary reference gray value are composed of a reference gray value vector; The gray value corresponding to the current pixel is inverted to obtain the corresponding complementary current gray value, and the gray value corresponding to the current pixel and the complementary current gray value form the current gray value vector; according to the reference gray value vector Calculate the background similarity corresponding to the current pixel with the current gray value vector.

在一个实施例中,图像目标识别模型为支持向量聚类模型,处理器执行根据已训练的图像目标识别模型对当前像素点对应的图像特征进行处理,得到当前像素点对应的第一概率包括:获取图像目标识别模型对应的特征映射函数,获取与特征映射函数对应的特征空间的中心值;根据特征映射函数对图像特征进行计算,得到图像特征对应的映射值;计算映射值与中心值的第一距离;根据第一距离计算得到当前像素点对应的第一概率,其中,第一距离与第一概率呈负相关关系。In one embodiment, the image target recognition model is a support vector clustering model, and the processor executes processing the image features corresponding to the current pixel according to the trained image target recognition model, and obtaining the first probability corresponding to the current pixel includes: Obtain the feature mapping function corresponding to the image target recognition model, and obtain the central value of the feature space corresponding to the feature mapping function; calculate the image feature according to the feature mapping function, and obtain the mapping value corresponding to the image feature; calculate the first mapping value and the central value A distance: calculating a first probability corresponding to the current pixel point according to the first distance, wherein the first distance is negatively correlated with the first probability.

在一个实施例中,计算机程序还使得处理器执行如下步骤:获取特征空间的中心到特征空间的边界的第二距离;根据第一距离计算得到当前像素点为目标对应的像素点的第一概率包括:计算第一距离与第二距离的比例值;根据比例值计算得到当前像素点对应的第一概率,其中,比例值与第一概率呈负相关关系。In one embodiment, the computer program further enables the processor to perform the following steps: obtain the second distance from the center of the feature space to the boundary of the feature space; calculate the first probability that the current pixel point is the pixel point corresponding to the target according to the first distance The method includes: calculating a ratio value between the first distance and the second distance; calculating a first probability corresponding to the current pixel point according to the ratio value, wherein the ratio value and the first probability have a negative correlation.

在一个实施例中,处理器执行的得到图像目标识别模型的步骤包括:获取训练图像,获取训练图像中的目标对象对应的训练区域;获取训练区域中各个像素点对应的训练图像特征;根据训练图像特征进行模型训练,得到将训练图像特征映射到最小的特征空间的特征映射函数以及特征空间的中心值。In one embodiment, the step of obtaining the image target recognition model performed by the processor includes: obtaining a training image, obtaining a training area corresponding to a target object in the training image; obtaining training image features corresponding to each pixel in the training area; The image features are used for model training, and the feature mapping function that maps the training image features to the smallest feature space and the center value of the feature space are obtained.

在一个实施例中,处理器执行的,图像特征包括对比度特征,得到当前像素点对应的对比度特征的步骤包括:根据当前像素点的位置在当前图像上获取第三区域和第四区域,其中,第四区域为第三区域的子区域,当前像素点位于第四区域内部;获取第三区域和第四区域之间的非重叠图像区域;对非重叠图像区域对应的像素点的灰度值进行统计,得到第一统计结果,对第四区域对应的像素点的灰度值进行统计,得到第二统计结果;根据第一统计结果以及第二统计结果得到对比度特征。In one embodiment, the image features executed by the processor include contrast features, and the step of obtaining the contrast feature corresponding to the current pixel point includes: acquiring the third area and the fourth area on the current image according to the position of the current pixel point, wherein, The fourth area is a sub-area of the third area, and the current pixel is located inside the fourth area; the non-overlapping image area between the third area and the fourth area is obtained; the gray value of the pixel point corresponding to the non-overlapping image area is calculated Statistics, to obtain a first statistical result, and perform statistics on the gray values of pixels corresponding to the fourth area to obtain a second statistical result; obtain a contrast feature according to the first statistical result and the second statistical result.

在一个实施例中,处理器执行的根据各个像素点对应的背景相似度和第一概率识别得到当前图像中目标对象所在的图像区域包括:根据背景相似度得到当前像素点对应的第二概率,其中,第二概率为当前像素点属于目标对象像素点的概率,第二概率与背景相似度呈负相关关系;根据第一概率以及第二概率确定当前像素点对应的当前目标概率,当前目标概率为当前像素点属于目标对象像素点的概率;根据当前图像中各个像素点对应的目标概率识别得到当前图像中目标对象所在的图像区域。In one embodiment, the process performed by the processor to identify the image region where the target object is located in the current image according to the background similarity corresponding to each pixel and the first probability includes: obtaining the second probability corresponding to the current pixel according to the background similarity, Wherein, the second probability is the probability that the current pixel belongs to the pixel of the target object, and the second probability is negatively correlated with the background similarity; the current target probability corresponding to the current pixel is determined according to the first probability and the second probability, and the current target probability is the probability that the current pixel belongs to the pixel of the target object; the image area where the target object is located in the current image is identified according to the target probability corresponding to each pixel in the current image.

在一个实施例中,处理器执行的根据当前图像中各个像素点对应的目标概率识别得到当前图像中目标对象所在的图像区域包括:获取当前图像中目标概率大于第一阈值的第一像素点;获取第一像素点对应的目标概率的分布特征;根据分布特征得到第二阈值;获取当前图像中目标概率大于第二阈值的第一像素点组合得到的区域,作为当前图像中目标对象所在的图像区域。In one embodiment, the identifying the image region where the target object is located in the current image according to the target probability corresponding to each pixel in the current image performed by the processor includes: acquiring a first pixel in the current image with a target probability greater than a first threshold; Obtain the distribution feature of the target probability corresponding to the first pixel point; obtain the second threshold according to the distribution feature; obtain the area obtained by combining the first pixel points in the current image whose target probability is greater than the second threshold value, and use it as the image where the target object is located in the current image area.

应该理解的是,虽然本发明各实施例的流程图中的各个步骤按照箭头的指示依次显示,但是这些步骤并不是必然按照箭头指示的顺序依次执行。除非本文中有明确的说明,这些步骤的执行并没有严格的顺序限制,这些步骤可以以其它的顺序执行。而且,各实施例中的至少一部分步骤可以包括多个子步骤或者多个阶段,这些子步骤或者阶段并不必然是在同一时刻执行完成,而是可以在不同的时刻执行,这些子步骤或者阶段的执行顺序也不必然是依次进行,而是可以与其它步骤或者其它步骤的子步骤或者阶段的至少一部分轮流或者交替地执行。It should be understood that although the various steps in the flow charts of the embodiments of the present invention are shown sequentially according to the arrows, these steps are not necessarily executed sequentially in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and these steps can be executed in other orders. Moreover, at least some of the steps in each embodiment may include multiple sub-steps or multiple stages, these sub-steps or stages are not necessarily executed at the same time, but may be executed at different times, the sub-steps or stages The order of execution is not necessarily performed sequentially, but may be performed alternately or alternately with at least a part of other steps or sub-steps or stages of other steps.

本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成,所述的程序可存储于一非易失性计算机可读取存储介质中,该程序在执行时,可包括如上述各方法的实施例的流程。其中,本申请所提供的各实施例中所使用的对存储器、存储、数据库或其它介质的任何引用,均可包括非易失性和/或易失性存储器。非易失性存储器可包括只读存储器(ROM)、可编程ROM(PROM)、电可编程ROM(EPROM)、电可擦除可编程ROM(EEPROM)或闪存。易失性存储器可包括随机存取存储器(RAM)或者外部高速缓冲存储器。作为说明而非局限,RAM以多种形式可得,诸如静态RAM(SRAM)、动态RAM(DRAM)、同步DRAM(SDRAM)、双数据率SDRAM(DDRSDRAM)、增强型SDRAM(ESDRAM)、同步链路(Synchlink)DRAM(SLDRAM)、存储器总线(Rambus)直接RAM(RDRAM)、直接存储器总线动态RAM(DRDRAM)、以及存储器总线动态RAM(RDRAM)等。Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be realized through computer programs to instruct related hardware, and the programs can be stored in a non-volatile computer-readable storage medium When the program is executed, it may include the processes of the embodiments of the above-mentioned methods. Wherein, any references to memory, storage, database or other media used in the various embodiments provided in the present application may include non-volatile and/or volatile memory. Nonvolatile memory can include read only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced SDRAM (ESDRAM), Synchronous Chain Synchlink DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

以上所述实施例的各技术特征可以进行任意的组合,为使描述简洁,未对上述实施例中的各个技术特征所有可能的组合都进行描述,然而,只要这些技术特征的组合不存在矛盾,都应当认为是本说明书记载的范围。The technical features of the above-mentioned embodiments can be combined arbitrarily. To make the description concise, all possible combinations of the technical features in the above-mentioned embodiments are not described. However, as long as there is no contradiction in the combination of these technical features, should be considered as within the scope of this specification.

以上所述实施例仅表达了本发明的几种实施方式,其描述较为具体和详细,但并不能因此而理解为对本发明专利范围的限制。应当指出的是,对于本领域的普通技术人员来说,在不脱离本发明构思的前提下,还可以做出若干变形和改进,这些都属于本发明的保护范围。因此,本发明专利的保护范围应以所附权利要求为准。The above-mentioned embodiments only express several implementation modes of the present invention, and the descriptions thereof are relatively specific and detailed, but should not be construed as limiting the patent scope of the present invention. It should be noted that those skilled in the art can make several modifications and improvements without departing from the concept of the present invention, and these all belong to the protection scope of the present invention. Therefore, the protection scope of the patent for the present invention should be based on the appended claims.

Claims (15)

1.一种图像识别方法,所述方法包括:1. An image recognition method, said method comprising: 获取待识别目标的当前图像;Obtain the current image of the target to be identified; 从所述当前图像中获取当前像素点,根据所述当前像素点的位置确定对应的背景参考区域;Obtaining a current pixel point from the current image, and determining a corresponding background reference area according to the position of the current pixel point; 根据所述背景参考区域计算所述当前像素点对应的背景相似度;calculating the background similarity corresponding to the current pixel according to the background reference area; 根据已训练的图像目标识别模型对所述当前像素点对应的图像特征进行处理,得到所述当前像素点对应的第一概率,所述第一概率为所述当前像素点属于目标对象像素点的概率;According to the trained image target recognition model, the image feature corresponding to the current pixel is processed to obtain the first probability corresponding to the current pixel, and the first probability is that the current pixel belongs to the pixel of the target object probability; 计算得到所述当前图像中的各个像素点对应的背景相似度和第一概率,根据所述各个像素点对应的背景相似度和第一概率识别得到所述当前图像中目标对象所在的图像区域。Calculate the background similarity and first probability corresponding to each pixel in the current image, and identify the image area where the target object is located in the current image according to the background similarity and first probability corresponding to each pixel. 2.根据权利要求1所述的方法,其特征在于,所述根据所述当前像素点的位置确定对应的背景参考区域包括:2. The method according to claim 1, wherein the determining the corresponding background reference area according to the position of the current pixel comprises: 根据所述当前像素点的位置在所述当前图像上获取第一区域和第二区域,其中,所述第二区域为所述第一区域的子区域,所述当前像素点位于所述第二区域内部;Acquire a first area and a second area on the current image according to the position of the current pixel, wherein the second area is a sub-area of the first area, and the current pixel is located in the second inside the area; 将所述第一区域和第二区域之间的非重叠图像区域作为所述背景参考区域。A non-overlapping image area between the first area and the second area is used as the background reference area. 3.根据权利要求1所述的方法,其特征在于,所述根据所述背景参考区域计算所述当前像素点对应的背景相似度,包括:3. The method according to claim 1, wherein the calculating the background similarity corresponding to the current pixel according to the background reference area comprises: 从所述背景参考区域获取目标像素点,获取所述目标像素点和所述当前像素点对应的灰度值;acquiring a target pixel from the background reference area, and acquiring gray values corresponding to the target pixel and the current pixel; 根据所述目标像素点的灰度值计算得到参考灰度值,对所述参考灰度值进行取反运算得到对应的互补参考灰度值,将所述参考灰度值和所述互补参考灰度值组成参考灰度值向量;Calculate the reference gray value according to the gray value of the target pixel point, perform an inverse operation on the reference gray value to obtain a corresponding complementary reference gray value, and combine the reference gray value and the complementary reference gray value The gray value constitutes the reference gray value vector; 对所述当前像素点对应的灰度值进行取反运算得到对应的互补当前灰度值,将所述当前像素点对应的灰度值和所述互补当前灰度值组成当前灰度值向量;performing an inversion operation on the gray value corresponding to the current pixel to obtain a corresponding complementary current gray value, and combining the gray value corresponding to the current pixel and the complementary current gray value to form a current gray value vector; 根据所述参考灰度值向量和所述当前灰度值向量计算得到所述当前像素点对应的背景相似度。The background similarity corresponding to the current pixel is calculated according to the reference gray value vector and the current gray value vector. 4.根据权利要求1所述的方法,其特征在于,所述图像目标识别模型为支持向量聚类模型,所述根据已训练的图像目标识别模型对所述当前像素点对应的图像特征进行处理,得到所述当前像素点对应的第一概率包括:4. The method according to claim 1, wherein the image target recognition model is a support vector clustering model, and the image feature corresponding to the current pixel is processed according to the trained image target recognition model , obtaining the first probability corresponding to the current pixel includes: 获取所述图像目标识别模型对应的特征映射函数,获取与所述特征映射函数对应的特征空间的中心值;Obtaining the feature mapping function corresponding to the image target recognition model, and acquiring the central value of the feature space corresponding to the feature mapping function; 根据所述特征映射函数对所述图像特征进行计算,得到所述图像特征对应的映射值;calculating the image feature according to the feature mapping function to obtain a mapping value corresponding to the image feature; 计算所述映射值与所述中心值的第一距离;calculating a first distance between the mapped value and the central value; 根据所述第一距离计算得到所述当前像素点对应的第一概率,其中,所述第一距离与所述第一概率呈负相关关系。A first probability corresponding to the current pixel point is calculated according to the first distance, where the first distance is negatively correlated with the first probability. 5.根据权利要求4所述的方法,其特征在于,所述方法还包括:5. method according to claim 4, is characterized in that, described method also comprises: 获取所述特征空间的中心到所述特征空间的边界的第二距离;obtaining a second distance from the center of the feature space to the boundary of the feature space; 所述根据所述第一距离计算得到所述当前像素点为目标对应的像素点的第一概率包括:The calculation according to the first distance to obtain the first probability that the current pixel point is the pixel point corresponding to the target includes: 计算所述第一距离与所述第二距离的比例值;calculating a ratio of the first distance to the second distance; 根据所述比例值计算得到所述当前像素点对应的第一概率,其中,所述比例值与所述第一概率呈负相关关系。A first probability corresponding to the current pixel point is calculated according to the proportional value, where the proportional value is negatively correlated with the first probability. 6.根据权利要求4所述的方法,其特征在于,得到所述图像目标识别模型的步骤包括:6. The method according to claim 4, wherein the step of obtaining the image target recognition model comprises: 获取训练图像,获取所述训练图像中的目标对象对应的训练区域;Obtain a training image, and obtain a training area corresponding to the target object in the training image; 获取所述训练区域中各个像素点对应的训练图像特征;Acquiring training image features corresponding to each pixel in the training area; 根据所述训练图像特征进行模型训练,得到将所述训练图像特征映射到最小的特征空间的特征映射函数以及所述特征空间的中心值。Model training is performed according to the training image features, and a feature mapping function for mapping the training image features to a minimum feature space and a central value of the feature space are obtained. 7.根据权利要求1所述的方法,其特征在于,所述图像特征包括对比度特征,得到所述当前像素点对应的对比度特征的步骤包括:7. The method according to claim 1, wherein the image feature comprises a contrast feature, and the step of obtaining the contrast feature corresponding to the current pixel comprises: 根据所述当前像素点的位置在所述当前图像上获取第三区域和第四区域,其中,所述第四区域为所述第三区域的子区域,所述当前像素点位于所述第四区域内部;Acquire a third area and a fourth area on the current image according to the position of the current pixel, wherein the fourth area is a sub-area of the third area, and the current pixel is located in the fourth inside the area; 获取所述第三区域和第四区域之间的非重叠图像区域;acquiring non-overlapping image areas between the third area and the fourth area; 对所述非重叠图像区域对应的像素点的灰度值进行统计,得到第一统计结果,对所述第四区域对应的像素点的灰度值进行统计,得到第二统计结果;performing statistics on the grayscale values of the pixels corresponding to the non-overlapping image regions to obtain a first statistical result, and performing statistics on the grayscale values of the pixels corresponding to the fourth region to obtain a second statistical result; 根据所述第一统计结果以及所述第二统计结果得到所述对比度特征。The contrast feature is obtained according to the first statistical result and the second statistical result. 8.根据权利要求1所述的方法,其特征在于,所述根据各个像素点对应的背景相似度和第一概率识别得到所述当前图像中目标对象所在的图像区域包括:8. The method according to claim 1, wherein said identifying the image area where the target object is located in the current image according to the background similarity corresponding to each pixel point and the first probability comprises: 根据所述背景相似度得到所述当前像素点对应的第二概率,其中,所述第二概率为所述当前像素点属于目标对象像素点的概率,所述第二概率与所述背景相似度呈负相关关系;Obtain the second probability corresponding to the current pixel according to the background similarity, wherein the second probability is the probability that the current pixel belongs to the target object pixel, and the second probability is the same as the background similarity There is a negative correlation; 根据所述第一概率以及所述第二概率确定所述当前像素点对应的当前目标概率,所述当前目标概率为所述当前像素点属于目标对象像素点的概率;determining a current target probability corresponding to the current pixel according to the first probability and the second probability, where the current target probability is a probability that the current pixel belongs to a pixel of a target object; 根据所述当前图像中各个像素点对应的目标概率识别得到所述当前图像中目标对象所在的图像区域。The image area where the target object is located in the current image is obtained by identifying according to the target probability corresponding to each pixel in the current image. 9.根据权利要求8所述的方法,其特征在于,所述根据所述当前图像中各个像素点对应的目标概率识别得到所述当前图像中目标对象所在的图像区域包括:9. The method according to claim 8, wherein the identifying the image area where the target object is located in the current image according to the target probability corresponding to each pixel in the current image comprises: 获取所述当前图像中目标概率大于第一阈值的第一像素点;Acquiring a first pixel point in the current image whose target probability is greater than a first threshold; 获取所述第一像素点对应的目标概率的分布特征;Obtaining the distribution characteristics of the target probability corresponding to the first pixel point; 根据所述分布特征得到第二阈值;obtaining a second threshold according to the distribution feature; 获取所述当前图像中目标概率大于所述第二阈值的第一像素点组合得到的区域,作为所述当前图像中目标对象所在的图像区域。Acquiring an area obtained by combining first pixel points in the current image with a target probability greater than the second threshold as the image area where the target object is located in the current image. 10.一种图像识别装置,所述装置包括:10. An image recognition device, said device comprising: 当前图像获取模块,用于获取待识别目标的当前图像;The current image acquisition module is used to acquire the current image of the target to be identified; 背景区域确定模块,用于从所述当前图像中获取当前像素点,根据所述当前像素点的位置确定对应的背景参考区域;A background area determination module, configured to obtain a current pixel point from the current image, and determine a corresponding background reference area according to the position of the current pixel point; 相似度计算模块,用于根据所述背景参考区域计算所述当前像素点对应的背景相似度;A similarity calculation module, configured to calculate the background similarity corresponding to the current pixel according to the background reference area; 第一概率得到模块,用于根据已训练的图像目标识别模型对所述当前像素点对应的图像特征进行处理,得到所述当前像素点对应的第一概率,所述第一概率为所述当前像素点属于目标对象像素点的概率;The first probability obtaining module is used to process the image feature corresponding to the current pixel point according to the trained image target recognition model to obtain the first probability corresponding to the current pixel point, and the first probability is the current The probability that the pixel belongs to the pixel of the target object; 目标区域识别模块,用于计算得到所述当前图像中的各个像素点对应的背景相似度和第一概率,根据所述各个像素点对应的背景相似度和第一概率识别得到所述当前图像中目标对象所在的图像区域。A target area identification module, configured to calculate the background similarity and first probability corresponding to each pixel in the current image, and identify the background similarity and first probability corresponding to each pixel to obtain the background similarity and first probability in the current image The image area where the target object is located. 11.根据权利要求10所述的装置,其特征在于,所述相似度计算模块包括:11. The device according to claim 10, wherein the similarity calculation module comprises: 灰度值获取单元,用于从所述背景参考区域获取目标像素点,获取所述目标像素点和所述当前像素点对应的灰度值;a gray value obtaining unit, configured to obtain a target pixel from the background reference area, and obtain a gray value corresponding to the target pixel and the current pixel; 参考向量组成单元,用于根据所述目标像素点的灰度值计算得到参考灰度值,对所述参考灰度值进行取反运算得到对应的互补参考灰度值,将所述参考灰度值和所述互补参考灰度值组成参考灰度值向量;The reference vector composition unit is used to calculate a reference gray value according to the gray value of the target pixel point, perform an inverse operation on the reference gray value to obtain a corresponding complementary reference gray value, and convert the reference gray value to value and the complementary reference gray value to form a reference gray value vector; 当前向量组成单元,用于对所述当前像素点对应的灰度值进行取反运算得到对应的互补当前灰度值,将所述当前像素点对应的灰度值和所述互补当前灰度值组成当前灰度值向量;The current vector composition unit is used to invert the gray value corresponding to the current pixel to obtain a corresponding complementary current gray value, and combine the gray value corresponding to the current pixel with the complementary current gray value Form the current gray value vector; 相似度计算单元,用于根据所述参考灰度值向量和所述当前灰度值向量计算得到所述当前像素点对应的背景相似度。A similarity calculation unit, configured to calculate the background similarity corresponding to the current pixel according to the reference gray value vector and the current gray value vector. 12.根据权利要求10所述的装置,其特征在于,所述图像目标识别模型为支持向量聚类模型,所述第一概率得到模块包括:12. The device according to claim 10, wherein the image target recognition model is a support vector clustering model, and the first probability obtaining module includes: 模型参数获取单元,用于获取所述图像目标识别模型对应的特征映射函数,获取与所述特征映射函数对应的特征空间的中心值;A model parameter acquisition unit, configured to acquire a feature mapping function corresponding to the image target recognition model, and acquire a central value of a feature space corresponding to the feature mapping function; 映射值计算单元,用于根据所述特征映射函数对所述图像特征进行计算,得到所述图像特征对应的映射值;A mapping value calculation unit, configured to calculate the image feature according to the feature mapping function, to obtain a mapping value corresponding to the image feature; 第一距离计算单元,用于计算所述映射值与所述中心值的第一距离;a first distance calculation unit, configured to calculate a first distance between the mapping value and the central value; 第一概率得到单元,用于根据所述第一距离计算得到所述当前像素点对应的第一概率,其中,所述第一距离与所述第一概率呈负相关关系。The first probability obtaining unit is configured to calculate and obtain a first probability corresponding to the current pixel point according to the first distance, wherein the first distance has a negative correlation with the first probability. 13.根据权利要求12所述的装置,其特征在于,所述装置还包括:13. The device according to claim 12, further comprising: 第二距离获取模块,用于获取所述特征空间的中心到所述特征空间的边界的第二距离;A second distance acquisition module, configured to acquire a second distance from the center of the feature space to the boundary of the feature space; 所述第一概率得到单元用于:The first probability obtaining unit is used for: 计算所述第一距离与所述第二距离的比例值;calculating a ratio of the first distance to the second distance; 根据所述比例值计算得到所述当前像素点对应的第一概率,其中,所述比例值与所述第一概率呈负相关关系。A first probability corresponding to the current pixel point is calculated according to the proportional value, where the proportional value is negatively correlated with the first probability. 14.一种计算机设备,其特征在于,包括存储器和处理器,所述存储器中存储有计算机程序,所述计算机程序被所述处理器执行时,使得所述处理器执行权利要求1至9中任一项权利要求所述图像识别方法的步骤。14. A computer device, characterized in that it comprises a memory and a processor, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the processor executes the process according to claims 1 to 9. The steps of the image recognition method according to any claim. 15.一种计算机可读存储介质,其特征在于,所述计算机可读存储介质上存储有计算机程序,所述计算机程序被处理器执行时,使得所述处理器执行权利要求1至9中任一项权利要求所述图像识别方法的步骤。15. A computer-readable storage medium, wherein a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the processor can perform any one of claims 1-9. A claim to the steps of the image recognition method.
CN201810502263.0A 2018-05-23 2018-05-23 Image recognition method and device, computer equipment and storage medium Active CN108764325B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810502263.0A CN108764325B (en) 2018-05-23 2018-05-23 Image recognition method and device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810502263.0A CN108764325B (en) 2018-05-23 2018-05-23 Image recognition method and device, computer equipment and storage medium

Publications (2)

Publication Number Publication Date
CN108764325A true CN108764325A (en) 2018-11-06
CN108764325B CN108764325B (en) 2022-07-08

Family

ID=64005379

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810502263.0A Active CN108764325B (en) 2018-05-23 2018-05-23 Image recognition method and device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN108764325B (en)

Cited By (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109587248A (en) * 2018-12-06 2019-04-05 腾讯科技(深圳)有限公司 User identification method, device, server and storage medium
CN109635723A (en) * 2018-12-11 2019-04-16 讯飞智元信息科技有限公司 A kind of occlusion detection method and device
CN109697460A (en) * 2018-12-05 2019-04-30 华中科技大学 Object detection model training method, target object detection method
CN110363241A (en) * 2019-07-11 2019-10-22 合肥联宝信息技术有限公司 A kind of picture comparative approach and device
CN110490212A (en) * 2019-02-26 2019-11-22 腾讯科技(深圳)有限公司 Molybdenum target image processing arrangement, method and apparatus
CN111598088A (en) * 2020-05-15 2020-08-28 京东方科技集团股份有限公司 Target detection method and device, computer equipment and readable storage medium
CN111639653A (en) * 2020-05-08 2020-09-08 浙江大华技术股份有限公司 False detection image determining method, device, equipment and medium
CN111754538A (en) * 2019-06-29 2020-10-09 浙江大学 A Threshold Segmentation Method for USB Surface Defect Detection
CN111932447A (en) * 2020-08-04 2020-11-13 中国建设银行股份有限公司 Picture processing method, device, equipment and storage medium
CN112668582A (en) * 2020-12-31 2021-04-16 北京迈格威科技有限公司 Image recognition method, device, equipment and storage medium
CN113017699A (en) * 2019-10-18 2021-06-25 深圳北芯生命科技有限公司 Image noise reduction method for reducing noise of ultrasonic image
CN114151942A (en) * 2021-09-14 2022-03-08 海信家电集团股份有限公司 Air conditioner and human face area detection method
CN114550244A (en) * 2022-02-11 2022-05-27 支付宝(杭州)信息技术有限公司 A kind of living body detection method, device and equipment
CN114820601A (en) * 2022-06-27 2022-07-29 合肥新晶集成电路有限公司 Target image updating method and system, wafer detection method and computer equipment
CN117834891A (en) * 2024-03-06 2024-04-05 成都凌亚科技有限公司 Video signal compression processing and sending platform and method
CN117853932A (en) * 2024-03-05 2024-04-09 华中科技大学 Sea surface target detection method, detection platform and system based on photoelectric pod

Citations (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103632361A (en) * 2012-08-20 2014-03-12 阿里巴巴集团控股有限公司 An image segmentation method and a system
CN103996189A (en) * 2014-05-05 2014-08-20 小米科技有限责任公司 Image segmentation method and device
CN104392468A (en) * 2014-11-21 2015-03-04 南京理工大学 Improved visual background extraction based movement target detection method
CN104504007A (en) * 2014-12-10 2015-04-08 成都品果科技有限公司 Method and system for acquiring similarity degree of images
US20150156484A1 (en) * 2013-11-29 2015-06-04 Canon Kabushiki Kaisha Image processing apparatus, method, and storage medium
CN104992144A (en) * 2015-06-11 2015-10-21 电子科技大学 Method for distinguishing transmission line from road in remote sensing image
CN105957093A (en) * 2016-06-07 2016-09-21 浙江树人大学 ATM retention detection method of texture discrimination optimization HOG operator
CN106023249A (en) * 2016-05-13 2016-10-12 电子科技大学 Moving object detection method based on local binary similarity pattern
CN106056606A (en) * 2016-05-30 2016-10-26 乐视控股(北京)有限公司 Image processing method and device
US20160328853A1 (en) * 2014-06-17 2016-11-10 Tencent Technology (Shenzhen) Company Limited Image processing method and apparatus
CN106878674A (en) * 2017-01-10 2017-06-20 哈尔滨工业大学深圳研究生院 A parking detection method and device based on surveillance video
US20170301081A1 (en) * 2015-09-30 2017-10-19 Shanghai United Imaging Healthcare Co., Ltd. System and method for determining a breast region in a medical image
CN107833242A (en) * 2017-10-30 2018-03-23 南京理工大学 One kind is based on marginal information and improves VIBE moving target detecting methods
CN108010034A (en) * 2016-11-02 2018-05-08 广州图普网络科技有限公司 Commodity image dividing method and device

Patent Citations (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103632361A (en) * 2012-08-20 2014-03-12 阿里巴巴集团控股有限公司 An image segmentation method and a system
US20150156484A1 (en) * 2013-11-29 2015-06-04 Canon Kabushiki Kaisha Image processing apparatus, method, and storage medium
CN103996189A (en) * 2014-05-05 2014-08-20 小米科技有限责任公司 Image segmentation method and device
US20160328853A1 (en) * 2014-06-17 2016-11-10 Tencent Technology (Shenzhen) Company Limited Image processing method and apparatus
CN104392468A (en) * 2014-11-21 2015-03-04 南京理工大学 Improved visual background extraction based movement target detection method
CN104504007A (en) * 2014-12-10 2015-04-08 成都品果科技有限公司 Method and system for acquiring similarity degree of images
CN104992144A (en) * 2015-06-11 2015-10-21 电子科技大学 Method for distinguishing transmission line from road in remote sensing image
US20170301081A1 (en) * 2015-09-30 2017-10-19 Shanghai United Imaging Healthcare Co., Ltd. System and method for determining a breast region in a medical image
CN106023249A (en) * 2016-05-13 2016-10-12 电子科技大学 Moving object detection method based on local binary similarity pattern
CN106056606A (en) * 2016-05-30 2016-10-26 乐视控股(北京)有限公司 Image processing method and device
CN105957093A (en) * 2016-06-07 2016-09-21 浙江树人大学 ATM retention detection method of texture discrimination optimization HOG operator
CN108010034A (en) * 2016-11-02 2018-05-08 广州图普网络科技有限公司 Commodity image dividing method and device
CN106878674A (en) * 2017-01-10 2017-06-20 哈尔滨工业大学深圳研究生院 A parking detection method and device based on surveillance video
CN107833242A (en) * 2017-10-30 2018-03-23 南京理工大学 One kind is based on marginal information and improves VIBE moving target detecting methods

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
朱松豪等: "基于背景相似性匹配的人脸识别", 《中南大学学报(自然科学版) 》 *

Cited By (29)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109697460A (en) * 2018-12-05 2019-04-30 华中科技大学 Object detection model training method, target object detection method
US11640678B2 (en) 2018-12-05 2023-05-02 Tencent Technology (Shenzhen) Company Limited Method for training object detection model and target object detection method
CN109697460B (en) * 2018-12-05 2021-06-29 华中科技大学 Object detection model training method, target object detection method
CN109587248B (en) * 2018-12-06 2023-08-29 腾讯科技(深圳)有限公司 User identification method, device, server and storage medium
CN109587248A (en) * 2018-12-06 2019-04-05 腾讯科技(深圳)有限公司 User identification method, device, server and storage medium
CN109635723A (en) * 2018-12-11 2019-04-16 讯飞智元信息科技有限公司 A kind of occlusion detection method and device
CN109635723B (en) * 2018-12-11 2021-02-09 讯飞智元信息科技有限公司 Shielding detection method and device
CN110490212B (en) * 2019-02-26 2022-11-08 腾讯科技(深圳)有限公司 Mammography target image processing equipment, method and device
CN110490212A (en) * 2019-02-26 2019-11-22 腾讯科技(深圳)有限公司 Molybdenum target image processing arrangement, method and apparatus
CN111754538A (en) * 2019-06-29 2020-10-09 浙江大学 A Threshold Segmentation Method for USB Surface Defect Detection
CN110363241A (en) * 2019-07-11 2019-10-22 合肥联宝信息技术有限公司 A kind of picture comparative approach and device
CN113017699A (en) * 2019-10-18 2021-06-25 深圳北芯生命科技有限公司 Image noise reduction method for reducing noise of ultrasonic image
CN111639653B (en) * 2020-05-08 2023-10-10 浙江大华技术股份有限公司 False detection image determining method, device, equipment and medium
CN111639653A (en) * 2020-05-08 2020-09-08 浙江大华技术股份有限公司 False detection image determining method, device, equipment and medium
CN111598088B (en) * 2020-05-15 2023-12-29 京东方科技集团股份有限公司 Target detection method, device, computer equipment and readable storage medium
CN111598088A (en) * 2020-05-15 2020-08-28 京东方科技集团股份有限公司 Target detection method and device, computer equipment and readable storage medium
US12056897B2 (en) 2020-05-15 2024-08-06 Boe Technology Group Co., Ltd. Target detection method, computer device and non-transitory readable storage medium
WO2021227723A1 (en) * 2020-05-15 2021-11-18 京东方科技集团股份有限公司 Target detection method and apparatus, computer device and readable storage medium
CN111932447A (en) * 2020-08-04 2020-11-13 中国建设银行股份有限公司 Picture processing method, device, equipment and storage medium
CN111932447B (en) * 2020-08-04 2024-03-22 中国建设银行股份有限公司 Picture processing method, device, equipment and storage medium
CN112668582A (en) * 2020-12-31 2021-04-16 北京迈格威科技有限公司 Image recognition method, device, equipment and storage medium
CN114151942A (en) * 2021-09-14 2022-03-08 海信家电集团股份有限公司 Air conditioner and human face area detection method
CN114151942B (en) * 2021-09-14 2024-09-06 海信家电集团股份有限公司 Air conditioner and face area detection method
CN114550244A (en) * 2022-02-11 2022-05-27 支付宝(杭州)信息技术有限公司 A kind of living body detection method, device and equipment
CN114820601A (en) * 2022-06-27 2022-07-29 合肥新晶集成电路有限公司 Target image updating method and system, wafer detection method and computer equipment
CN117853932A (en) * 2024-03-05 2024-04-09 华中科技大学 Sea surface target detection method, detection platform and system based on photoelectric pod
CN117853932B (en) * 2024-03-05 2024-05-14 华中科技大学 Sea surface target detection method, detection platform and system based on photoelectric pod
CN117834891A (en) * 2024-03-06 2024-04-05 成都凌亚科技有限公司 Video signal compression processing and sending platform and method
CN117834891B (en) * 2024-03-06 2024-05-07 成都凌亚科技有限公司 Video signal compression processing and transmitting method

Also Published As

Publication number Publication date
CN108764325B (en) 2022-07-08

Similar Documents

Publication Publication Date Title
CN108764325B (en) Image recognition method and device, computer equipment and storage medium
CN111860670B (en) Domain adaptive model training method, image detection method, device, equipment and medium
CN112800964B (en) Remote sensing image target detection method and system based on multi-module fusion
Manzanera et al. Line and circle detection using dense one-to-one Hough transforms on greyscale images
Feng et al. A novel change detection approach based on visual saliency and random forest from multi-temporal high-resolution remote-sensing images
CN109146912B (en) Visual target tracking method based on target analysis
Jung Detecting building changes from multitemporal aerial stereopairs
Wan et al. Multi-sensor remote sensing image change detection based on sorted histograms
US20140169639A1 (en) Image Detection Method and Device
Gong et al. A coupling translation network for change detection in heterogeneous images
JP6393230B2 (en) Object detection method and image search system
CN110610143B (en) Crowd counting network method, system, medium and terminal for multi-task combined training
Conte et al. Counting moving persons in crowded scenes
WO2023116632A1 (en) Video instance segmentation method and apparatus based on spatio-temporal memory information
CN113269706B (en) Laser radar image quality evaluation method, device, equipment and storage medium
CN112101195A (en) Crowd density estimation method and device, computer equipment and storage medium
US20170053172A1 (en) Image processing apparatus, and image processing method
Morandeira et al. Assessment of SAR speckle filters in the context of object-based image analysis
Oga et al. River state classification combining patch-based processing and CNN
Tabernik et al. Dense center-direction regression for object counting and localization with point supervision
Hao et al. A novel change detection approach for VHR remote sensing images by integrating multi-scale features
CN113239996B (en) Active learning method, device, equipment and storage medium based on target detection
Majidi et al. A saliency-guided neighbourhood ratio model for automatic change detection of SAR images
Su et al. Change detection in synthetic aperture radar images based on non-local means with ratio similarity measurement
Negri et al. Examining region-based methods for land cover classification using stochastic distances

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
GR01 Patent grant
GR01 Patent grant
TG01 Patent term adjustment
TG01 Patent term adjustment