[go: up one dir, main page]

CN107169930A - Image processing method and device - Google Patents

Image processing method and device Download PDF

Info

Publication number
CN107169930A
CN107169930A CN201610128429.8A CN201610128429A CN107169930A CN 107169930 A CN107169930 A CN 107169930A CN 201610128429 A CN201610128429 A CN 201610128429A CN 107169930 A CN107169930 A CN 107169930A
Authority
CN
China
Prior art keywords
color value
image
images
foreground object
lighting condition
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201610128429.8A
Other languages
Chinese (zh)
Inventor
刘永亮
白博
陈茂林
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN201610128429.8A priority Critical patent/CN107169930A/en
Priority to PCT/CN2017/075781 priority patent/WO2017152822A1/en
Publication of CN107169930A publication Critical patent/CN107169930A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/77Retouching; Inpainting; Scratch removal
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/50Image enhancement or restoration using two or more images, e.g. averaging or subtraction
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/40Extraction of image or video features
    • G06V10/56Extraction of image or video features relating to colour
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V20/00Scenes; Scene-specific elements
    • G06V20/50Context or environment of the image
    • G06V20/52Surveillance or monitoring of activities, e.g. for recognising suspicious objects
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10024Color image
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20212Image combination
    • G06T2207/20221Image fusion; Image merging

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Multimedia (AREA)
  • Image Analysis (AREA)
  • Image Processing (AREA)

Abstract

本发明公开了一种图像处理方法和装置,以提高图像处理的准确性。在本发明一些可行的实施方式中,方法包括:获取第一光照条件下拍摄的参考图像中的参考背景对象的第一颜色值;获取第二光照条件下拍摄的待处理图像中的所述参考背景对象的第二颜色值和前景对象的第三颜色值;根据所述第一颜色值,第二颜色值和第三颜色值,估算第一光照条件下拍摄所述前景对象的第四颜色值;利用所述第四颜色值对所述前景对象进行处理例如检索或查询等。

The invention discloses an image processing method and device to improve the accuracy of image processing. In some feasible implementations of the present invention, the method includes: acquiring the first color value of the reference background object in the reference image captured under the first lighting condition; acquiring the reference background object in the image to be processed captured under the second lighting condition The second color value of the background object and the third color value of the foreground object; according to the first color value, the second color value and the third color value, estimate the fourth color value of the foreground object photographed under the first lighting condition ; Use the fourth color value to perform processing on the foreground object, such as retrieval or query.

Description

图像处理方法和装置Image processing method and device

技术领域technical field

本发明涉及图像处理技术领域,具体涉及一种图像处理方法和装置。The present invention relates to the technical field of image processing, in particular to an image processing method and device.

背景技术Background technique

在很多应用中,如人脸识别、虹膜识别和视频监控系统中,需要进行图像处理,但是,光照影响会显著改变图像对象的颜色值,这对于依赖于颜色值进行检索或者识别图像的系统的有效性是一个非常有挑战性的问题。In many applications, such as face recognition, iris recognition, and video surveillance systems, image processing is required, but the impact of illumination can significantly change the color values of image objects, which is critical for systems that rely on color values for retrieval or recognition of images. Validity is a very challenging problem.

为了有效去除光照对图像颜色值的影响,很多对图像进行光照处理以恢复图像颜色的方案被提出,包括基于视网膜大脑皮层理论(Retinex)的方案、暗通道处理技术、高动态范围压缩、低动态范围压缩技术、基于梯度理论、基于偏微分方程以及基于变分极值理论的方案等。In order to effectively remove the influence of illumination on image color values, many schemes for image illumination processing to restore image color have been proposed, including schemes based on retinal cortex theory (Retinex), dark channel processing technology, high dynamic range compression, low dynamic Range compression technology, schemes based on gradient theory, partial differential equations, and variational extremum theory, etc.

这些方案的原理,普遍是首先对光照进行估计,然后在获得光照估计值的基础上,通过剥离光照值的方式对图像对象固有的反射系数进行估计,以获得不受光照影响的对象固有的颜色值。例如,基本思路可以简单理解为:通过估计光照值L,根据光照数学模型S=R*L或是更复杂一些的模型S=R*L+N,来求解反射图像R,其中,N表示噪声,S表示颜色值。The principle of these schemes is generally to first estimate the illumination, and then estimate the intrinsic reflection coefficient of the image object by stripping the illumination value on the basis of obtaining the estimated illumination value, so as to obtain the intrinsic color of the object that is not affected by illumination. value. For example, the basic idea can be simply understood as: by estimating the illumination value L, according to the illumination mathematical model S=R*L or a more complex model S=R*L+N, to solve the reflection image R, where N represents noise , S represents the color value.

实践发现,上述多种方案都需要在获得光照估计值的基础上进行计算,但是,现有技术中对光照进行估计的方法不够理想,得到的光照估计值不够准确,进而导致采用上述多种方案进行图像处理时准确性不够好。Practice has found that the above-mentioned various schemes need to be calculated on the basis of obtaining the estimated illumination value. However, the method for estimating illumination in the prior art is not ideal, and the obtained estimated illumination value is not accurate enough, which leads to the adoption of the above-mentioned various schemes. Accuracy is not good enough for image processing.

发明内容Contents of the invention

本发明实施例提供一种图像处理方法和装置,以提高图像处理的准确性。Embodiments of the present invention provide an image processing method and device, so as to improve the accuracy of image processing.

本发明实施例的第一方面提供一种图像处理方法,该方法可以将不同光照条件下的对象颜色统一到“同一”参考光照条件下,具体实现中,可以在获取第一光照条件下拍摄的参考图像中的参考背景对象的第一颜色值,以及获取第二光照条件下拍摄的待处理图像中的所述参考背景对象的第二颜色值和前景对象的第三颜色值之后,根据所述第一颜色值,第二颜色值和第三颜色值,估算第一光照条件下拍摄所述前景对象的第四颜色值,实现将将不同光照条件下的前景对象的颜色值统一到第一光照条件下,后续利用前景对象在第一光照条件下的第四颜色值对前景对象进行处理,例如检索或查询以及图像编辑等。与现有技术相比,该方案不必剥离图像的光照值,避免了对光照值进行估计,从而避免了光照估计过程中产生的误差,解决了现有技术中难以获得精确的光照估计值的问题,提高了图像处理的精确度。The first aspect of the embodiments of the present invention provides an image processing method, which can unify the object colors under different lighting conditions to the "same" reference lighting condition. After obtaining the first color value of the reference background object in the reference image, and obtaining the second color value of the reference background object and the third color value of the foreground object in the image to be processed captured under the second lighting condition, according to the The first color value, the second color value and the third color value estimate the fourth color value of the foreground object captured under the first lighting condition, so as to unify the color values of the foreground object under different lighting conditions to the first lighting condition Conditions, the fourth color value of the foreground object under the first lighting condition is subsequently used to process the foreground object, such as retrieval or query and image editing. Compared with the existing technology, this scheme does not need to strip the illumination value of the image, avoids the estimation of the illumination value, thereby avoids the error generated in the illumination estimation process, and solves the problem that it is difficult to obtain an accurate illumination estimation value in the prior art , which improves the accuracy of image processing.

本发明实施例的第二方面提供一种图像处理装置,该装置可以将不同光照条件下的对象颜色统一到“同一”参考光照条件下,具体实现中,该装置可以包括:获取模块,颜色值计算模块,以及处理模块,其中,获取模块获取第一光照条件下拍摄的参考图像中的参考背景对象的第一颜色值,获取第二光照条件下拍摄的待处理图像中的所述参考背景对象的第二颜色值和前景对象的第三颜色值;颜色值计算模块根据所述第一,第二和第三,计算第一光照条件下拍摄所述前景对象的第四颜色值;处理模块利用所述第四颜色值对前景对象进行处理,例如检索或查询以及图像编辑等。与现有技术相比,该方案不必剥离图像的光照值,避免了对光照值进行估计,从而避免了光照估计过程中产生的误差,解决了现有技术中难以获得精确的光照估计值的问题,提高了图像处理的精确度。The second aspect of the embodiments of the present invention provides an image processing device, which can unify the object colors under different lighting conditions under the "same" reference lighting conditions. In specific implementation, the device can include: an acquisition module, a color value A calculation module, and a processing module, wherein the acquisition module acquires the first color value of the reference background object in the reference image taken under the first lighting condition, and acquires the reference background object in the image to be processed taken under the second lighting condition The second color value of the second color value and the third color value of the foreground object; the color value calculation module calculates the fourth color value of shooting the foreground object under the first lighting condition according to the first, second and third; the processing module utilizes The fourth color value performs processing on the foreground object, such as retrieval or query and image editing. Compared with the existing technology, this scheme does not need to strip the illumination value of the image, avoids the estimation of the illumination value, thereby avoids the error generated in the illumination estimation process, and solves the problem that it is difficult to obtain an accurate illumination estimation value in the prior art , which improves the accuracy of image processing.

基于上述的方法或装置,还可以提供其它一些可行的实施方式,例如:Based on the above method or device, some other feasible implementation modes may also be provided, such as:

可选的,记所述第一,第二和第三以及第四颜色值分别为S1,S2,S3,S4,则可以采用公式S4=S3-(S2-S1)计算第四颜色值。需要说明的是,S1,S2,S3,S4可以是对原始观测值取对数之后的对数值,且原始观测值可以是RGB值,也就是说,S1,S2,S3,S4可以为对数域上的RGB值。Optionally, record the first, second, third and fourth color values as S 1 , S 2 , S 3 , S 4 respectively, then the formula S 4 =S 3 -(S 2 -S 1 ) to calculate the fourth color value. It should be noted that S 1 , S 2 , S 3 , and S 4 can be the logarithmic values of the original observed values, and the original observed values can be RGB values, that is, S 1 , S 2 , S 3 , S 4 can be the RGB value on the logarithmic domain.

可选的,可以预先设定一个参考图像,将参考图像的光照条件定义为第一光照条件,将待处理图像的光照条件定义为第二光照条件,则可以从所述参考图像中获取第一光照条件下参考背景对象的第一颜色值,从所述待处理图像中获取第二光照条件下所述参考背景对象的第二颜色值和前景对象的第三颜色值。Optionally, a reference image can be preset, the lighting condition of the reference image is defined as the first lighting condition, and the lighting condition of the image to be processed is defined as the second lighting condition, then the first lighting condition can be obtained from the reference image. The first color value of the reference background object under the lighting condition, and the second color value of the reference background object and the third color value of the foreground object under the second lighting condition are obtained from the image to be processed.

可选的,获取多张图像;获取所述多张图像中的一张图像作为所述参考图像;获取所述多张图像中除所述参考图像以外的任一张图像作为所述待处理图像;所述参考图像包括所述参考背景对象,所述待处理图像包括所述参考背景对象和所述前景对象。Optionally, acquire a plurality of images; acquire an image in the plurality of images as the reference image; acquire any image in the plurality of images except the reference image as the image to be processed ; The reference image includes the reference background object, and the image to be processed includes the reference background object and the foreground object.

可选的,可以根据所述多张图像的亮度值和/或拍摄时间,从所述多张图像中选择一张图像作为所述参考图像,例如将亮度值在设定的阈值范围内和/或拍摄时间在预设的时间范围内的一张图像设置为参考图像。Optionally, an image may be selected from the plurality of images as the reference image according to the brightness values and/or shooting time of the plurality of images, for example, the brightness value is within a set threshold range and/or Or an image whose shooting time is within a preset time range is set as a reference image.

可选的,在所述多张图像来自于多个相机时,可以预先对所述多个相机的颜色进行校准;分别计算所述多个相机中除参考相机之外的每个相机与所述参考相机各自拍摄的图像中的参考背景对象的光照差异;从所述前景对象的第四颜色值中去除相应的光照差异,利用去除光照差异后的第四颜色值对所述前景对象进行处理。从而降低相机间的差异对图像处理的影响。Optionally, when the multiple images come from multiple cameras, the color calibration of the multiple cameras may be performed in advance; Refer to the illumination difference of the reference background object in the images captured by the respective cameras; remove the corresponding illumination difference from the fourth color value of the foreground object, and use the fourth color value after the illumination difference to process the foreground object. Thereby reducing the impact of differences between cameras on image processing.

本发明实施例的第三方面还提供一种计算机设备,其特征在于,所述计算机设备包括处理器、存储器、总线和通信接口;所述存储器用于存储程序,所述处理器与所述存储器通过所述总线连接,当所述计算机设备运行时,所述处理器执行所述存储器存储的所述程序,以使所述计算机设备执行如上文所述的图像处理方法。The third aspect of the embodiments of the present invention also provides a computer device, which is characterized in that the computer device includes a processor, a memory, a bus, and a communication interface; the memory is used to store programs, and the processor and the memory Through the bus connection, when the computer device is running, the processor executes the program stored in the memory, so that the computer device executes the image processing method as described above.

本发明实施例的第四方面还提供一种存储一个或多个程序的计算机可读存储介质,所述一个或多个程序包括指令,所述指令当被包括一个或多个处理器的计算机设备执行时,使所述计算机设备执行如上文所述的图像处理方法。A fourth aspect of the embodiments of the present invention also provides a computer-readable storage medium storing one or more programs, the one or more programs including instructions, and the instructions are executed by a computer device including one or more processors When executed, the computer device is made to execute the above-mentioned image processing method.

由上可见,在本发明实施例的一些可行的实施方式中,根据参考背景对象在第一和第二光照条件下的颜色值,以及前景对象在第二光照条件下的颜色值,来计算前景对象在第一光照条件下的颜色值,从而将待处理图像中的前景对象统一到第一光照条件下,后续可统一使用第一光照条件下前景对象的颜色值进行检索或查询等处理,相对于现有技术,不必剥离图像的光照值,解决了现有技术中难以获得精确的光照估计值的问题,提高了图像处理的精确度。It can be seen from the above that in some feasible implementations of the embodiments of the present invention, the foreground is calculated according to the color values of the reference background object under the first and second lighting conditions, and the color value of the foreground object under the second lighting condition The color value of the object under the first lighting condition, so as to unify the foreground object in the image to be processed under the first lighting condition, and then use the color value of the foreground object under the first lighting condition to perform retrieval or query processing. Compared with the prior art, it is not necessary to strip the illumination value of the image, which solves the problem that it is difficult to obtain an accurate illumination estimation value in the prior art, and improves the accuracy of image processing.

附图说明Description of drawings

为了更清楚地说明本发明实施例技术方案,下面将对实施例和现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其它的附图。In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following will briefly introduce the accompanying drawings that are required in the description of the embodiments and prior art. Obviously, the accompanying drawings in the following description are only some implementations of the present invention For example, those skilled in the art can also obtain other drawings based on these drawings without creative work.

图1是本发明一个实施例提供的图像处理方法的流程示意图;Fig. 1 is a schematic flow chart of an image processing method provided by an embodiment of the present invention;

图2是本发明另一实施例提供的图像处理方法的流程示意图;Fig. 2 is a schematic flowchart of an image processing method provided by another embodiment of the present invention;

图3a和3b分别是处理前后的图像的示意图;Figures 3a and 3b are schematic diagrams of images before and after processing, respectively;

图4是本发明又一实施例提供的图像处理方法的流程示意图;Fig. 4 is a schematic flowchart of an image processing method provided by another embodiment of the present invention;

图5是本发明一个实施例提供的图像处理装置的结构示意图;Fig. 5 is a schematic structural diagram of an image processing device provided by an embodiment of the present invention;

图6是本发明另一实施例提供的图像处理装置的结构示意图;Fig. 6 is a schematic structural diagram of an image processing device provided by another embodiment of the present invention;

图7是本发明一个实施例提供的计算机设备的结构示意图。Fig. 7 is a schematic structural diagram of a computer device provided by an embodiment of the present invention.

具体实施方式detailed description

为了使本技术领域的人员更好地理解本发明方案,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分的实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都应当属于本发明保护的范围。In order to enable those skilled in the art to better understand the solutions of the present invention, the following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only It is an embodiment of a part of the present invention, but not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by persons of ordinary skill in the art without making creative efforts shall fall within the protection scope of the present invention.

本发明的说明书和权利要求书及上述附图中的术语“第一”、“第二”、“第三”等是用于区别不同的对象,而不是用于描述特定顺序。此外,术语“包括”和“具有”以及它们任何变形,意图在于覆盖不排他的包含。例如包含了一系列步骤或单元的过程、方法、系统、产品或设备没有限定于已列出的步骤或单元,而是可选地还包括没有列出的步骤或单元,或可选地还包括对于这些过程、方法、产品或设备固有的其它步骤或单元。The terms "first", "second", "third" and the like in the description and claims of the present invention and the above drawings are used to distinguish different objects, rather than to describe a specific order. Furthermore, the terms "include" and "have", as well as any variations thereof, are intended to cover a non-exclusive inclusion. For example, a process, method, system, product or device comprising a series of steps or units is not limited to the listed steps or units, but optionally also includes unlisted steps or units, or optionally further includes For other steps or units inherent in these processes, methods, products or apparatuses.

本发明实施例技术方案应用人脸识别、虹膜识别和视频监控等各种涉及图像处理的计算机系统,该计算机系统可以包括:用于获取图像的图像采集单元,例如各种相机、摄像机、摄像模组等;用于存储图像的存储单元,例如只读存储器(英文全称:Read-Only Memory,英文简称:ROM)、随机存取存储器(英文全称:Random Access Memory,英文简称:RAM)、移动硬盘、磁碟或者光盘等;用于进行图像处理的处理单元,例如中央处理器(英文全称:CentralProcessing Unit,英文简称:CPU),或者特定集成电路(英文全称:ApplicationSpecific Integrated Circuit,英文简称:ASIC)等;用于显示图像的显示单元,例如阴极射线管显示器(英文全称:Cathode Ray Tube,英文简称:CRT),等离子显示器(英文全称:Plasma Display Panel,英文简称:PDP),液晶显示器(英文全称:Liquid Crystal Display,英文简称:LCD)等;和连接上述各个单元、用于上述各个单元之间相互通信的总线,例如工业标准体系结构(Industry Standard Architecture,简称为ISA)总线或外部设备互连(PeripheralComponent,简称为PCI)总线或扩展工业标准体系结构(Extended IndustryStandard Architecture,简称为EISA)总线等;以及通信接口等。The technical solution of the embodiment of the present invention applies to various computer systems related to image processing such as face recognition, iris recognition, and video surveillance. Group, etc.; storage unit for storing images, such as read-only memory (full English name: Read-Only Memory, English abbreviation: ROM), random access memory (English full name: Random Access Memory, English abbreviation: RAM), mobile hard disk , magnetic disk or optical disc, etc.; a processing unit for image processing, such as a central processing unit (English full name: Central Processing Unit, English abbreviation: CPU), or a specific integrated circuit (English full name: Application Specific Integrated Circuit, English abbreviation: ASIC) etc.; a display unit for displaying images, such as a cathode ray tube display (English full name: Cathode Ray Tube, English abbreviation: CRT), plasma display (English full name: Plasma Display Panel, English abbreviation: PDP), liquid crystal display (English full name: : Liquid Crystal Display, English abbreviation: LCD), etc.; and a bus that connects the above-mentioned units and is used for mutual communication between the above-mentioned units, such as an Industry Standard Architecture (Industry Standard Architecture, referred to as ISA) bus or external device interconnection (Peripheral Component, referred to as PCI) bus or Extended Industry Standard Architecture (Extended Industry Standard Architecture, referred to as EISA) bus, etc.; and a communication interface, etc.

不同光照条件下拍摄的图像中,同一物理对象的颜色值会发生改变,进而影响以颜色为主要特征进行查询检索的结果。本发明致力于解决此问题。In images taken under different lighting conditions, the color value of the same physical object will change, which will affect the results of query and retrieval with color as the main feature. The present invention addresses this problem.

本发明实施例技术方案可用于这样的场景:在已给出的多张图像中,给定一张图像,将给定的图像中的前景对象作为查询目标,将该查询目标与其它图像中的前景对象进行匹配,判断是否是同一对象,以查询或检索出所有包含查询目标的图像。The technical solution of the embodiment of the present invention can be used in such a scene: in the given multiple images, given an image, the foreground object in the given image is used as the query target, and the query target is compared with other images Foreground objects are matched to determine whether they are the same object, so as to query or retrieve all images containing the query target.

请参考图3a,是以左上角第一张图像中的人像为查询目标,直接从多张图像中进行查询,查找包含该查询目标的图像的查询结果,查询结果显示,第一行的第一至第七共7张图像都包含该查询目标,或者说,这7张图像中的人像是同一人。然而,由于各张图像的颜色值受到光照值影响,查询结果难以找出包含查询目标的所有图像,假设多张图像中包含查询目标的图像共有15张,则查询命中率仅为7/15=47%。Please refer to Figure 3a. The person in the first image in the upper left corner is used as the query target, and the query is directly performed from multiple images to find the query results of the image containing the query target. The query results show that the first row of the first row A total of 7 images from the seventh to the seventh all contain the query target, or in other words, the portraits in these 7 images are the same person. However, since the color value of each image is affected by the light value, it is difficult to find all the images containing the query target in the query result. Assuming that there are 15 images containing the query target in the multiple images, the query hit rate is only 7/15= 47%.

本发明一个实施例提供的图像处理方法可包括:获取第一光照条件下拍摄的参考图像中的参考背景对象的第一颜色值;获取第二光照条件下拍摄的待处理图像中的所述参考背景对象的第二颜色值和前景对象的第三颜色值;根据所述第一颜色值,第二颜色值和第三颜色值,估算第一光照条件下拍摄所述前景对象的第四颜色值;利用所述第四颜色值对所述待处理图像中的所述前景对象进行处理,例如进行检索或查询。The image processing method provided by an embodiment of the present invention may include: acquiring the first color value of the reference background object in the reference image captured under the first lighting condition; acquiring the reference background object in the image to be processed captured under the second lighting condition The second color value of the background object and the third color value of the foreground object; according to the first color value, the second color value and the third color value, estimate the fourth color value of the foreground object photographed under the first lighting condition ; Using the fourth color value to process the foreground object in the image to be processed, for example, perform retrieval or query.

由上,为了避免对光照值进行估计,并避免基于估计的光照值再估计图像的反射系数(固有色彩),从而避免光照估计过程中产生的误差,本发明实施例方案中,将不同光照条件下的对象颜色统一到“同一”参考光照条件即第一光照条件下,以获得对象在近似同一光照条件下的颜色值。From the above, in order to avoid estimating the illumination value and re-estimating the reflection coefficient (intrinsic color) of the image based on the estimated illumination value, so as to avoid errors in the illumination estimation process, in the embodiment of the present invention, different illumination conditions The color of the object under the same lighting condition is unified to the "same" reference lighting condition, that is, the first lighting condition, so as to obtain the color value of the object under approximately the same lighting condition.

为此,本发明实施例假定可以获得光照较好情况下的参考背景对象的颜色值,通常情况下这是可能的。例如,对于视频监控应用,可在白天某时刻获得光照较好情况下的参考背景对象的颜色值。使用光照较好情况下的参考背景对象的颜色值作为先验信息,本文中将该光照较好情况下的光照条件称为第一光照条件。在光照均匀的情况下,可以利用不同光照条件下同一或同种参照背景对象的颜色值的差异,来计算前景对象在第一光照条件下的颜色值,将前景对象统一到第一光照条件下。For this reason, the embodiment of the present invention assumes that the color value of the reference background object under the condition of better illumination can be obtained, which is usually possible. For example, for video surveillance applications, the color value of a reference background object under better lighting conditions can be obtained at a certain time during the day. The color value of the reference background object under better lighting is used as prior information, and the lighting condition under better lighting is called the first lighting condition in this paper. In the case of uniform lighting, the color value of the foreground object under the first lighting condition can be calculated by using the difference of the color value of the same or the same reference background object under different lighting conditions, and the foreground object can be unified under the first lighting condition .

请参考图3b,是采用本发明实例方法将多张图像的前景对象统一到第一光照条件下后,以左上角第一张图像中的人像为查询目标,从多张图像中进行查询,查找同一人的图像的查询结果。查询结果显示,共找出15张包含查询目标的图像,如图3b中第一行的前15张图像,查询命中率为15/15=100%。Please refer to Fig. 3b, after using the example method of the present invention to unify the foreground objects of multiple images under the first lighting condition, the portrait in the first image in the upper left corner is used as the query target, and the query is performed from multiple images to find Query results for images of the same person. The query results show that a total of 15 images containing the query target are found, such as the first 15 images in the first row in Figure 3b, and the query hit rate is 15/15=100%.

请参考图1,本发明一个实施例提供的图像处理方法的具体过程可包括:Please refer to Fig. 1, the specific process of the image processing method provided by one embodiment of the present invention may include:

110、获取第一光照条件下拍摄的参考图像中的参考背景对象的第一颜色值。110. Acquire a first color value of a reference background object in a reference image captured under a first lighting condition.

本发明实施例中,可以从包含参考背景对象的参考图像中,获取第一光照条件下参考背景对象的第一颜色值。所谓的第一光照条件,可以理解为拍摄参考图像的光照条件。本发明实施例中,可以在获取的需要进行处理的多张图像中,任选一张作为参考图像,将该参考图像的光照条件定义为第一光照条件。其中,获取的多张图像中应包括同一个或同一种参考背景对象,例如道路、树木、墙壁等,本文对于参考背景对象的具体类别不加限定。In the embodiment of the present invention, the first color value of the reference background object under the first lighting condition may be acquired from the reference image including the reference background object. The so-called first lighting condition may be understood as the lighting condition for shooting the reference image. In the embodiment of the present invention, one of the acquired images that need to be processed may be selected as a reference image, and the lighting condition of the reference image is defined as the first lighting condition. Among them, the multiple acquired images should include the same or the same kind of reference background objects, such as roads, trees, walls, etc. This article does not limit the specific category of the reference background objects.

本文中,将所述多张图像中除所述参考图像以外的图像称为待处理图像。可选的,步骤110之前还可以包括:获取多张图像;获取所述多张图像中的一张图像作为所述参考图像;获取所述多张图像中除所述参考图像以外的任一张图像作为所述待处理图像。Herein, the images in the plurality of images except the reference image are referred to as images to be processed. Optionally, before step 110, it may also include: acquiring a plurality of images; acquiring an image in the plurality of images as the reference image; acquiring any one of the plurality of images except the reference image image as the image to be processed.

所说的第一颜色值,以及后文将提到的第二、第三或第四颜色值等,可简称为颜色值或色值,具体可以是指RGB值,RGB用英文表示就是R(red)、G(green)、B(blue)。RGB色彩模式是工业界的一种颜色标准,是通过对红(R)、绿(G)、蓝(B)三个颜色通道的变化以及它们相互之间的叠加来得到各式各样的颜色的,RGB即是代表红、绿、蓝三个通道的颜色,这个标准几乎包括了人类视力所能感知的所有颜色,是目前运用最广的颜色系统之一。RGB是指亮度,并使用整数来表示。通常情况下,R、G、B各有256级亮度,用数字表示为从0、1、2...直到255,共256级。Said first color value, and the second, third or fourth color value mentioned later, etc., can be referred to as color value or color value for short, specifically can refer to RGB value, and RGB expresses in English and is exactly R ( red), G (green), B (blue). The RGB color mode is a color standard in the industry. It obtains a variety of colors by changing the three color channels of red (R), green (G), and blue (B) and superimposing them with each other. Yes, RGB is the color that represents the three channels of red, green, and blue. This standard includes almost all the colors that human vision can perceive. It is one of the most widely used color systems at present. RGB refers to brightness and is expressed using integers. Normally, R, G, and B each have 256 levels of brightness, which are represented by numbers from 0, 1, 2... until 255, a total of 256 levels.

对一种颜色进行编码的方法统称为“颜色空间”或“色域”。任何一种颜色的“颜色空间”都可定义成一个固定的数字或变量。采用RGB这种编码方法,每种颜色都可用三个变量来表示-红色、绿色以及蓝色的亮度。可以采用多种RGB格式来表示一种颜色,例如一种格式称为RGB555,RGB555是一种16位的RGB格式,RGB的三个分量都用5位表示,剩下的1位不用;这样,图像中每个像素的颜色都可以用一个16位的二进制数字表示。实际应用中,不限于RGB555这种格式,也可以采用RGB565,RGB24,RGB32等格式,这里不再赘述。The methods of encoding a color are collectively referred to as "color spaces" or "gamuts". The "color space" of any color can be defined as a fixed number or variable. With the RGB encoding method, each color can be represented by three variables—the brightness of red, green, and blue. A variety of RGB formats can be used to represent a color, for example, a format called RGB555, RGB555 is a 16-bit RGB format, the three components of RGB are represented by 5 bits, and the remaining 1 bit is not used; thus, The color of each pixel in an image can be represented by a 16-bit binary number. In practical applications, the format is not limited to RGB555, and formats such as RGB565, RGB24, and RGB32 can also be used, which will not be repeated here.

为了提高图像处理的准确度,本文中可以选择光照条件较好情况下拍摄的图像作为参考图像。其中,光照条件较好可以理解为图像亮度值在设定的阈值范围内,和/或,拍摄时间在设定的时间范围内。一些实施例中,可以根据所述多张图像的亮度值和/或拍摄时间,例如,亮度值在4.5到5.5之间,且拍摄时间为上午,从所述多张图像中选择一张图像作为所述参考图像。其中,亮度值的单位可以是堪德拉每平米(cd/m2)。In order to improve the accuracy of image processing, the image taken under better lighting conditions can be selected as the reference image in this paper. Wherein, the lighting condition can be better understood as the image brightness value is within a set threshold range, and/or, the shooting time is within a set time range. In some embodiments, one image may be selected from the multiple images as The reference image. Wherein, the unit of the luminance value may be candela per square meter (cd/m2).

120、获取第二光照条件下拍摄的待处理图像中的所述参考背景对象的第二颜色值和前景对象的第三颜色值。120. Acquire the second color value of the reference background object and the third color value of the foreground object in the image to be processed captured under the second lighting condition.

本步骤中,具体可以从同时包含参考背景对象和前景对象的待处理图像中,获取第二光照条件下参考背景对象的第二颜色值和前景对象的第三颜色值。所谓的第二光照条件,可以理解为拍摄待处理图像的光照条件。所述待处理图像可以是指上一个步骤中获取的多张图像中,除了选定的参考图像以外的任一图像。In this step, specifically, the second color value of the reference background object and the third color value of the foreground object under the second lighting condition may be acquired from the image to be processed that includes both the reference background object and the foreground object. The so-called second lighting condition may be understood as the lighting condition for capturing the image to be processed. The image to be processed may refer to any image except the selected reference image among the multiple images acquired in the previous step.

130、根据所述第一颜色值,第二颜色值和第三颜色值,估算第一光照条件下拍摄所述前景对象的第四颜色值。130. Estimate a fourth color value for shooting the foreground object under the first lighting condition according to the first color value, the second color value and the third color value.

记所述第一颜色值,第二颜色值和第三颜色值以及第四颜色值分别为S1,S2,S3,S4,则有S4=S3-(S2-S1);需要说明的是,这里的S1,S2,S3,S4是对原始观测值取对数之后的值。所述原始观测值可以是RGB值。也就是说,S1,S2,S3,S4为对数域上的RGB值,对数域上的RGB值具体是指对RGB值取对数得到的值。通过取对数,既符合人眼视觉特性,也起到数据压缩作用。Record the first color value, the second color value, the third color value and the fourth color value as S 1 , S 2 , S 3 , S 4 respectively, then S 4 =S 3 -(S 2 -S 1 ); It should be noted that S 1 , S 2 , S 3 , and S 4 here are the values after taking the logarithm of the original observed value. The original observed values may be RGB values. That is to say, S 1 , S 2 , S 3 , and S 4 are RGB values in the logarithmic domain, and the RGB values in the logarithmic domain specifically refer to values obtained by taking logarithms of the RGB values. By taking the logarithm, it not only conforms to the visual characteristics of the human eye, but also plays a role in data compression.

计算原理简单说明如下,根据参考背景对象分别在第一和第二光照条件下的颜色值S1,S2,可计算得到第一和第二光照条件下的光照值的差异为ΔS=(S2-S1);同理,可以得到ΔS=(S4-S3);则有ΔS=(S2-S1)=(S4-S3),可以计算得到S4=S3-(S2-S1)。于是,获得了前景对象在第一光照条件下的颜色值,实现了将第二光照条件下的前景对象的颜色统一到第一光照条件下。The calculation principle is briefly explained as follows. According to the color values S 1 and S 2 of the reference background object under the first and second lighting conditions respectively, the difference between the lighting values under the first and second lighting conditions can be calculated as ΔS=(S 2 -S 1 ); similarly, ΔS=(S 4 -S 3 ); then ΔS=(S 2 -S 1 )=(S 4 -S 3 ), and S 4 =S 3 - (S 2 -S 1 ). Thus, the color value of the foreground object under the first lighting condition is obtained, and the color of the foreground object under the second lighting condition is unified to that under the first lighting condition.

基于该算法,可以计算得到任一张需要处理的图像中的前景对象在第一光照条件下的颜色值,实现了不同光照条件下的多张图像中的前景对象的颜色统一到第一光照条件下。Based on this algorithm, the color value of the foreground object in any image to be processed under the first lighting condition can be calculated, and the color of the foreground object in multiple images under different lighting conditions can be unified to the first lighting condition Down.

140、利用所述第四颜色值对所述前景对象进行处理。140. Process the foreground object by using the fourth color value.

本步骤中,就可以利用前景对象统一到第一光照条件下的颜色值来进行图像处理,包括检索或查询等等。例如图3b所示,可以从图3b所示的图像中选择一张清晰度较高的图像作为参考图像,将其它图像中的前景对象(具体为人像)的颜色值统一到拍摄该参考图像的第一光照条件下,利用各张图像的前景对象估算得到的第一光照条件下的颜色值进行检索或查询,其中,可将左上角第一张图像中的人像作为查询目标,将其它任一张图像中的人像与该查询目标进行匹配,判断是否是同一人,以查找包含该查找目标的所有图像,最终查询得到15张包含查询目标的图像,如图3b中第一行的前15张图像。In this step, the color value of the foreground object unified under the first lighting condition can be used for image processing, including retrieval or query. For example, as shown in Figure 3b, an image with higher definition can be selected from the images shown in Figure 3b as a reference image, and the color values of the foreground objects (specifically, portraits) in other images can be unified to the color value of the reference image. Under the first lighting condition, the color value under the first lighting condition estimated by using the foreground object of each image is used for retrieval or query, wherein, the portrait in the first image in the upper left corner can be used as the query target, and any other The portraits in the images are matched with the query target to determine whether they are the same person to find all images containing the search target, and finally 15 images containing the query target are obtained from the query, as shown in the first 15 images in the first row in Figure 3b image.

下面,对本方案的技术原理做进一步的介绍:The following is a further introduction to the technical principles of this solution:

目前广泛应用的一个光照模型是Retinex数学模型,本发明技术原理在此模型基础上,并在假定可以获取第一光照条件L0下的参考背景对象的颜色值的情况下,推导出在第二光照条件L1下得到的前景对象在L0光照下的颜色值,其中,L0和L1的具体取值不需要知道。An illumination model widely used at present is the Retinex mathematical model, and the technical principle of the present invention is based on this model, and under the assumption that the color value of the reference background object under the first illumination condition L0 can be obtained, deduce that in the second illumination condition L0 The color value of the foreground object obtained under the condition L1 under the illumination of L0, where the specific values of L0 and L1 do not need to be known.

Retinex模型如下:The Retinex model is as follows:

s(x,y)=l(x,y)*r(x,y) (1.1)s(x,y)=l(x,y)*r(x,y) (1.1)

其中,s(x,y)为颜色值,l(x,y)为光照值,r(x,y)为对象的反射系数。Among them, s(x,y) is the color value, l(x,y) is the light value, and r(x,y) is the reflection coefficient of the object.

通过对(1)式两端取对数,并对符号简化,(1.1)式等价于By taking the logarithm of both sides of formula (1) and simplifying the sign, formula (1.1) is equivalent to

S(x,y)=L(x,y)+R(x,y) (1.2)S(x,y)=L(x,y)+R(x,y) (1.2)

式(2)中,分别用大写的S(x,y),L(x,y),R(x,y)表示s(x,y),l(x,y),r(x,y)取对数之后的值。In formula (2), use uppercase S(x, y), L(x, y), R(x, y) respectively to represent s(x, y), l(x, y), r(x, y ) takes the value after the logarithm.

在光照L0情况下,对于参考背景对象有下式成立In the case of illumination L0, the following formula holds for the reference background object

SBG,0=L0(x,y)+RBG(x,y) (1.2.1)S BG,0 =L 0 (x,y)+R BG (x,y) (1.2.1)

其中,下标BG表示背景对象,下标0表示光照L0。Among them, the subscript BG represents the background object, and the subscript 0 represents the light L0.

在新的光照L1情况下,对于背景对象有In the new lighting L1 case, for background objects there are

SBG,1=L1(x,y)+RBG(x,y) (1.2.2)S BG,1 =L 1 (x,y)+R BG (x,y) (1.2.2)

其中,下标BG表示背景对象,下标1表示光照L1。Among them, the subscript BG represents the background object, and the subscript 1 represents the light L1.

此时,对于前景对象有At this point, for the foreground object there are

SFG,1=L1(x,y)+RFG(x,y) (1.2.3)S FG,1 =L 1 (x,y)+R FG (x,y) (1.2.3)

其中,下标FG表示前景对象,下标1表示光照L1。Among them, the subscript FG represents the foreground object, and the subscript 1 represents the light L1.

由(1.2.2)减去(1.2.1),可以得到Subtract (1.2.1) from (1.2.2) to get

SBG,1-SBG,0=L1(x,y)-L0(x,y)S BG,1 -S BG,0 =L 1 (x,y)-L 0 (x,y)

进而得到And then get

L1(x,y)=L0(x,y)+(SBG,1-SBG,0),L 1 (x,y)=L 0 (x,y)+(S BG,1 -S BG,0 ),

将得到的L1(x,y)代入到式(1.2.3),则有Substituting the obtained L 1 (x,y) into formula (1.2.3), then we have

SFG,1=RFG(x,y)+L0(x,y)+(SBG,1-SBG,0)S FG,1 =R FG (x,y)+L 0 (x,y)+(S BG,1 -S BG,0 )

进一步,可以得到Further, one can get

RFG(x,y)+L0(x,y)=SFG,1-(SBG,1-SBG,0) (1.2.4)R FG (x,y)+L 0 (x,y)=S FG,1 -(S BG,1 -S BG,0 ) (1.2.4)

公式(1.2.4)右端都是观测得到的颜色值,为已知。左端恰是前景对象在光照L0情况下的颜色值,可记为SFG,0The right end of the formula (1.2.4) is the observed color value, which is known. The left end is exactly the color value of the foreground object under the illumination L0, which can be recorded as S FG,0 .

公式(1.2.4)也可写成SFG,0=SFG,1-(SBG,1-SBG,0)Formula (1.2.4) can also be written as S FG,0 =S FG,1 -(S BG,1 -S BG,0 )

可以理解,本发明实施例上述方案例如可以在计算机设备具体实施。该方案根据参考背景对象在第一和第二光照条件下的颜色值,以及前景对象在第二光照条件下的颜色值,来计算前景对象在第一光照条件下的颜色值,从而将待处理图像中的前景对象统一到第一光照条件下,后续可统一使用第一光照条件下前景对象的颜色值进行检索或查询等处理,相对于现有技术,不必剥离图像的光照值,解决了现有技术中难以获得精确的光照估计值的问题,提高了图像处理的精确度。It can be understood that the above solutions of the embodiments of the present invention may be specifically implemented in computer equipment, for example. This scheme calculates the color value of the foreground object under the first lighting condition according to the color value of the reference background object under the first and second lighting conditions, and the color value of the foreground object under the second lighting condition, so that the to-be-processed The foreground objects in the image are unified under the first lighting condition, and the color value of the foreground object under the first lighting condition can be used for subsequent processing such as retrieval or query. Compared with the existing technology, it is not necessary to strip the lighting value of the image, which solves the problem There is a problem that it is difficult to obtain accurate lighting estimates in the technology, and the accuracy of image processing is improved.

为便于更好的理解本发明实施例提供的技术方案,下面通过一个具体场景下的实施方式为例进行介绍。In order to facilitate a better understanding of the technical solutions provided by the embodiments of the present invention, an implementation manner in a specific scenario is used as an example to introduce below.

请参考图2,本发明实施例的另一种图像处理方法。可包括:Please refer to FIG. 2 , another image processing method according to the embodiment of the present invention. May include:

210、获取多张图像,所述多张图像均包括参考背景对象。210. Acquire multiple images, where the multiple images all include a reference background object.

本实施例方案操作处理的对象是一组有相同背景对象的图像集,包括多张图像,且多张图像均包括相同的背景对象,该相同的背景对象定义为参考背景对象。图像集中的多张图像可以是同一相机拍摄的,有着相同或相近的背景对象;也可以是不同相机拍摄的,不同相机之间拍摄的图像有着重叠区域,或者没有重叠区域,但具有相同的背景对象,比如同样材质的地面(如柏油马路)。The object to be processed by the scheme of this embodiment is a group of image sets with the same background object, including multiple images, and the multiple images all include the same background object, and the same background object is defined as a reference background object. Multiple images in an image set can be taken by the same camera and have the same or similar background objects; they can also be taken by different cameras, and the images taken by different cameras have overlapping areas, or no overlapping areas, but have the same background Objects, such as ground of the same material (such as asphalt road).

220、根据所述多张图像的亮度值和/或拍摄时间,从所述多张图像中选择一张设为所述参考图像。220. Select one of the multiple images as the reference image according to the brightness values and/or shooting time of the multiple images.

可以根据所述多张图像的亮度值和/或拍摄时间,选定在光照强度较好情况下拍摄的一张图像,设为参考图像。例如可以认为亮度值在4.5到5.5之间,且拍摄时间为上午时,光照强度较好,拍摄的图像较为清晰,则可以选择这样的一张图像,设为参考图像。According to the luminance values and/or shooting time of the multiple images, an image shot under the condition of good light intensity may be selected as a reference image. For example, it can be considered that the brightness value is between 4.5 and 5.5, and the shooting time is in the morning, the light intensity is better, and the captured image is relatively clear, then such an image can be selected as a reference image.

选定参考图像中特定背景对象作为参考背景对象(SBG,0),该参考背景对象的选择要求是出现在前述待处理图像集的多张图像中。该参考背景对象对应的光照强度作为参考光照水平,即前文所述的第一光照条件L0。A specific background object in the reference image is selected as the reference background object (SBG,0), and the selection requirement of the reference background object is to appear in multiple images of the aforementioned image set to be processed. The light intensity corresponding to the reference background object is used as a reference light level, that is, the first light condition L0 mentioned above.

230、获取参考图像和待处理图像。230. Acquire a reference image and an image to be processed.

将图像集中除参考图像外的其它图像定义为待处理图像,可以根据参考图像对任一待处理图像进行处理,包括如下步骤:Define images other than the reference image in the image set as images to be processed, and any image to be processed can be processed according to the reference image, including the following steps:

240、从所述参考图像中获取第一光照条件下参考背景对象的第一颜色值;从所述待处理图像中获取第二光照条件下所述参考背景对象的第二颜色值和前景对象的第三颜色值。240. Acquire the first color value of the reference background object under the first lighting condition from the reference image; acquire the second color value of the reference background object and the foreground object under the second lighting condition from the image to be processed Tertiary color value.

从参考图像中提取参考背景对象的颜色值SBG,0,对前述待处理的图像集中的每一张待处理图像,提取和参考背景对象相同的背景对象SBG,1以及希望恢复到参考光照水平的前景对象SFG,1。记所述第一颜色值,第二颜色值和第三颜色值分别为SBG,0,SBG,1,SFG,1Extract the color value S BG,0 of the reference background object from the reference image, and for each image to be processed in the aforementioned image set to be processed, extract the same background object S BG,1 as the reference background object and hope to return to the reference illumination Horizontal foreground object S FG,1 . Note that the first color value, the second color value and the third color value are respectively S BG,0 , S BG,1 , and S FG,1 .

250、计算第一光照条件下所述前景对象的第四颜色值SFG,0250. Calculate the fourth color value S FG,0 of the foreground object under the first lighting condition;

利用公式(1.2.4),可以得到SFG,0=SFG,1-(SBG,1-SBG,0)Using the formula (1.2.4), we can get S FG,0 =S FG,1 -(S BG,1 -S BG,0 )

或者,将第一,第二,第三以及第四颜色值分别记为S1,S2,S3,S4。则有S4=S3-(S2-S1)。Or, denote the first, second, third and fourth color values as S 1 , S 2 , S 3 , S 4 respectively. Then there is S 4 =S 3 -(S 2 -S 1 ).

260、利用第四颜色值对待处理图像中的前景对象进行处理。260. Use the fourth color value to process the foreground object in the image to be processed.

输入的计算结果—第四颜色值SFG,0,可用于后续的创建索引进行检索或查询等处理。例如,当前景对象为人时,希望从图像集中找出某个人的图像,则可以将图像集中各图像的前景对象的颜色值统一到参考光照水平下,然后利用参考光照水平下的颜色值进行人像检索或查询。请参考图3a,是未做上述图像处理的情况下以左上角第一幅图像作为查询对象得到的查询结果,如图中的线框所示,找出7张包含查询目标的图像,如图3a中第一行的前7张图像,但实际上,图片集合中共包括该查询对象的15张图像,因此,查询命中率为7/15=47%;请参考图3b,是先对所有图像进行上述图像处理,将所有图像都统一到同一个光照条件下之后,仍以左上角第一幅图像作为查询对象得到的查询结果,如图中的线框所示,找出15张包含查询目标的图像,如图3b中第一行的前15张图像,命中率为15/15=100%。The input calculation result—the fourth color value S FG,0 , can be used for subsequent index creation for retrieval or query processing. For example, when the foreground object is a person and it is desired to find an image of a certain person from the image set, the color values of the foreground object in each image in the image set can be unified to the reference light level, and then use the color value under the reference light level to perform portrait search or query. Please refer to Figure 3a, which is the query result obtained by using the first image in the upper left corner as the query object without the above image processing, as shown in the wireframe in the figure, find 7 images containing the query target, as shown in the figure The first 7 images of the first row in 3a, but in fact, the image collection includes 15 images of the query object, so the query hit rate is 7/15=47%; please refer to Figure 3b, it is first for all images After performing the above image processing and unifying all the images under the same lighting condition, the first image in the upper left corner is still used as the query object to obtain the query result, as shown in the wireframe in the figure, find 15 images containing the query object images, such as the first 15 images in the first row in Figure 3b, the hit rate is 15/15=100%.

需要说明的是,一些实施例中可以根据第四颜色值对待处理图像中的前景对象进行颜色校正,将校正后的待处理图像显示出来;另一些实施例中,也可以仅仅将第四颜色值用来进行检索和查询,而不对前景对象进行颜色校正,且不显示校正后的待处理图像;是否显示可根据实际需要决定。It should be noted that, in some embodiments, color correction can be performed on the foreground object in the image to be processed according to the fourth color value, and the corrected image to be processed can be displayed; in other embodiments, it is also possible to only use the fourth color value It is used for retrieval and query without color correction of the foreground object, and does not display the corrected image to be processed; whether to display it can be determined according to actual needs.

以上,如图2所示的实施例,对本发明实施例图像处理方法进行了进一步说明,其中,所处理的图像集中的多张图像可以是同一相机拍摄的,也可以是不同相机拍摄的,不同相机之间拍摄的图像可以有重叠区域;或者没有重叠区域,但具有同样的参考背景对象,比如同样材质的地面,如柏油马路。即,本发明实施例技术方案可以直接应用于跨摄像头的应用。Above, the embodiment shown in FIG. 2 has further described the image processing method of the embodiment of the present invention, wherein the multiple images in the processed image set may be taken by the same camera or by different cameras. The images captured by the cameras can have overlapping areas; or have no overlapping areas, but have the same reference background object, such as the ground of the same material, such as an asphalt road. That is, the technical solutions of the embodiments of the present invention can be directly applied to cross-camera applications.

对于每一个相机拍摄的图像,可以选取光照较好的第一光照条件如L0的一张图像,设为参考图像,将每一相机拍摄的图像的前景对象都映射到L0下,也就是估算出在第一光照条件L0下的颜色值。为了下文描述方便,将这个过程,也就是上文中的步骤110~130描述的过程,或者,步骤210~250描述的过程,称作光照预处理。尽管不同相机选择了可能不同的参考光照水平,但由于都是相对较好的光照,对于很多应用,经过这样光照预处理后的图像可以基本符合查询或检索的需求。For each image captured by a camera, an image of the first light condition with better illumination, such as L0, can be selected as a reference image, and the foreground objects of each image captured by the camera are mapped to L0, that is, the estimated The color value under the first lighting condition L0. For the convenience of description below, this process, that is, the process described in steps 110-130 above, or the process described in steps 210-250, is called illumination preprocessing. Although different cameras may choose different reference lighting levels, because they are all relatively good lighting, for many applications, images after such lighting preprocessing can basically meet the requirements of query or retrieval.

但是,某些情况中相机之间的差异较大,对于多个相机拍摄的多张图像进行上述的光照预处理后,如果出现仍无法满足应用的情况,可以通过一些技术手段对不同相机拍摄的已经经过光照预处理的图像再次进行处理,将它们映射到近似相同的参考光照水平。以下实施例描述了一种技术方法以达到此目的。However, in some cases, there are large differences between cameras. After performing the above-mentioned lighting preprocessing on multiple images taken by multiple cameras, if the situation still cannot meet the application, some technical means can be used to analyze the images taken by different cameras. Images that have been pre-lighted are processed again to map them to approximately the same reference lighting level. The following example describes a technical approach to this end.

请参考图4,一些实施例中,本发明实施例的图像处理方法可以包括:Please refer to FIG. 4, in some embodiments, the image processing method of the embodiment of the present invention may include:

410、相机间颜色校准。410. Color calibration between cameras.

可以在安装相机时,预先对多个相机的颜色进行校准。Color calibration for multiple cameras can be pre-calibrated when the cameras are installed.

420、相机间不同参考背景对象间对应的参考光照水平校准。420. Calibrate the corresponding reference light levels between different reference background objects between cameras.

本步骤中,分别计算所述多个相机中除参考相机之外的每个相机与参考相机各自拍摄的图像中的参考背景对象的光照差异。在缺乏可公共参考的背景对象时,可以使用每一个相机对同一调色板的多个颜色进行拍照,同时对背景环境进行拍照。此时得到的调色板颜色的图像与背景对象的光照水平是一致的。可以使用每个相机拍摄得到的调色板颜色图像,来计算估计不同相机拍摄的参考背景对象之间的光照差异ΔL。为了避免大量的计算负担,可以选定某一相机作为比较标准,这里称作参考标准相机,计算所有其他相机拍摄的参考背景对象与参考标准相机拍摄的参考背景对象之间的光照差异ΔSL。分别计算多个相机中的每个相机与参考相机各自拍摄的图像中的参考背景对象的光照差异ΔSL。In this step, the illumination difference of the reference background object in the images captured by each camera except the reference camera among the plurality of cameras and the reference camera is respectively calculated. In the absence of a publicly referenced background object, each camera can be used to take pictures of multiple colors of the same palette while taking pictures of the background environment. The resulting palette color image is consistent with the light level of the background object. The palette color image captured by each camera can be used to calculate and estimate the illumination difference ΔL between reference background objects captured by different cameras. In order to avoid a large amount of computational burden, a certain camera can be selected as a comparison standard, here called the reference standard camera, and the illumination difference ΔSL between the reference background objects captured by all other cameras and the reference background objects captured by the reference standard camera can be calculated. The illumination difference ΔSL of the reference background object in the images captured by each of the plurality of cameras and the reference camera is respectively calculated.

430、对每个相机拍摄的前景对象做光照预处理。430. Perform lighting preprocessing on the foreground object captured by each camera.

本步骤中对每一相机拍摄的图像,进行光照预处理操作。光照预处理的具体过程对应于上文中的步骤110~130描述的过程,或者,步骤210~250描述的过程,这里不再详细赘述。In this step, an illumination preprocessing operation is performed on images captured by each camera. The specific process of illumination preprocessing corresponds to the process described in steps 110-130 above, or the process described in steps 210-250, and will not be described in detail here.

440、对不同相机拍摄的光照预处理后前景对象做去除光照差异处理。440. Perform illumination difference removal processing on foreground objects after illumination preprocessing captured by different cameras.

本步骤中,从每一张待处理图像的前景对象的第四颜色值中去除相应的光照差异,得到修正后的第四颜色值。也就是说,对得到的前景对象序列,去除光照差异ΔSL。注意,对于参考标准相机拍摄的图像序列,进行光照预处理步骤之后,不需要去除光照差异的步骤,因为自身之间不存在差异。去除光照差异后得到的图像序列可称作光照无差异估计图像序列。所得到的光照无差异估计图像序列即可用于应用中的查询检索。In this step, the corresponding illumination difference is removed from the fourth color value of the foreground object in each image to be processed to obtain a corrected fourth color value. That is to say, for the obtained foreground object sequence, the illumination difference ΔSL is removed. Note that for the image sequence captured by the reference standard camera, after the illumination preprocessing step, the step of removing the illumination difference is not required, because there is no difference among themselves. The image sequence obtained after removing the illumination difference can be called the illumination indifferent estimation image sequence. The obtained illumination invariant estimation image sequence can be used for query retrieval in applications.

450、利用前景对象的、经上述步骤处理后得到的颜色值进行检索或查询等处理。450. Use the color value of the foreground object obtained after the above steps to perform retrieval or query processing.

本步骤中,利用上述步骤的输出结果图像进行图像查询检索,即,利用光照无差异估计图像序列的、修正后的第四颜色值进行检索或查询等处理。In this step, the image query and retrieval is performed using the output result image of the above steps, that is, the retrieval or query is performed using the corrected fourth color value of the image sequence of the illumination indifference estimation image sequence.

需要说明的是,上述步骤440也可以在步骤430之前执行。It should be noted that the above step 440 may also be performed before step 430 .

由上可见,在本发明的一些可行的实施方式中,提供了一种图像处理方法,根据参考背景对象在第一和第二光照条件下的颜色值,以及前景对象在第二光照条件下的颜色值,来计算前景对象在第一光照条件下的颜色值,从而将待处理图像中的前景对象统一到第一光照条件下,后续可统一使用第一光照条件下前景对象的颜色值进行检索或查询等处理,相对于现有技术,不必剥离图像的光照值,解决了现有技术中难以获得精确的光照估计值的问题,提高了图像处理的精确度。As can be seen from the above, in some feasible implementations of the present invention, an image processing method is provided, according to the color values of the reference background object under the first and second lighting conditions, and the color value of the foreground object under the second lighting condition Color value to calculate the color value of the foreground object under the first lighting condition, so that the foreground object in the image to be processed is unified under the first lighting condition, and the color value of the foreground object under the first lighting condition can be used for subsequent retrieval Compared with the prior art, it is not necessary to peel off the illumination value of the image, which solves the problem that it is difficult to obtain an accurate illumination estimation value in the prior art, and improves the accuracy of image processing.

为了更好的实施本发明实施例的上述方案,下面还提供用于配合实施上述方案的相关装置。In order to better implement the above solutions of the embodiments of the present invention, related devices for coordinating the implementation of the above solutions are also provided below.

请参考图5,本发明实施例提供一种图像处理装置500,可包括:Please refer to FIG. 5, an embodiment of the present invention provides an image processing device 500, which may include:

获取模块510,用于获取第一光照条件下拍摄的参考图像中的参考背景对象的第一颜色值;获取第二光照条件下拍摄的待处理图像中的所述参考背景对象的第二颜色值和前景对象的第三颜色值;An acquisition module 510, configured to acquire a first color value of the reference background object in the reference image captured under the first lighting condition; acquire a second color value of the reference background object in the image to be processed captured under the second lighting condition and the third color value of the foreground object;

颜色值计算模块520,用于根据所述第一颜色值,第二颜色值和第三颜色值,估算第一光照条件下拍摄所述前景对象的第四颜色值;A color value calculation module 520, configured to estimate a fourth color value of the foreground object photographed under the first lighting condition according to the first color value, the second color value and the third color value;

处理模块530,用于利用所述第四颜色值对所述前景对象进行处理。A processing module 530, configured to process the foreground object by using the fourth color value.

其中,颜色值可简称为色值。Wherein, the color value may be referred to as a color value for short.

在一些实施例中,所述第一颜色值,第二颜色值和第三颜色值以及第四颜色值为RGB值或对数域上的RGB值。In some embodiments, the first color value, the second color value, the third color value and the fourth color value are RGB values or RGB values in logarithmic domain.

在一些实施例中,所述颜色值计算模块520,具体用于采用以下公式计算所述第四颜色值:S4=S3-(S2-S1);其中,S1,S2,S3,S4分别为所述第一颜色值,第二颜色值和第三颜色值以及第四颜色值,且S1,S2,S3,S4为对数域上的RGB值。In some embodiments, the color value calculation module 520 is specifically configured to calculate the fourth color value using the following formula: S 4 =S 3 -(S 2 -S 1 ); wherein, S 1 , S 2 , S 3 , S 4 are the first color value, the second color value, the third color value and the fourth color value respectively, and S 1 , S 2 , S 3 , S 4 are RGB values in the logarithmic domain.

请参考图6,在一些实施例中,所述获取模块510还用于:获取多张图像;获取所述多张图像中的一张图像作为所述参考图像;获取所述多张图像中除所述参考图像以外的任一张图像作为所述待处理图像;所述参考图像包括所述参考背景对象,所述待处理图像包括所述参考背景对象和所述前景对象。Please refer to FIG. 6 , in some embodiments, the acquiring module 510 is further configured to: acquire a plurality of images; acquire an image in the plurality of images as the reference image; acquire all but one of the plurality of images Any image other than the reference image is used as the image to be processed; the reference image includes the reference background object, and the image to be processed includes the reference background object and the foreground object.

请参考图6,在一些实施例中,图像处理装置500还包括:设置模块540;Please refer to FIG. 6, in some embodiments, the image processing device 500 further includes: a setting module 540;

所述设置模块540,用于根据所述多张图像的亮度值和/或拍摄时间,从所述多张图像中选择一张图像作为所述参考图像。The setting module 540 is configured to select an image from the multiple images as the reference image according to the brightness values and/or shooting time of the multiple images.

请参考图6,在一些实施例中,图像处理装置500还包括:Please refer to FIG. 6, in some embodiments, the image processing device 500 further includes:

校准模块550,用于预先对所述多个相机的颜色进行校准;A calibration module 550, configured to calibrate the colors of the plurality of cameras in advance;

差异计算模块560,用于分别计算所述多个相机中除参考相机之外的每个相机与参考相机各自拍摄的图像中的所述参考背景对象的光照差异;A difference calculation module 560, configured to separately calculate the illumination difference of the reference background object in the images captured by each camera except the reference camera among the plurality of cameras and the reference camera;

所述处理模块530,还用于从所述第四颜色值中去除相应的光照差异,利用去除光照差异后的第四颜色值对所述前景对象进行处理。The processing module 530 is further configured to remove the corresponding illumination difference from the fourth color value, and use the fourth color value after the illumination difference to process the foreground object.

在一些实施例中,所述处理模块530,具体用于对所述前景对象进行检索或查询。In some embodiments, the processing module 530 is specifically configured to retrieve or query the foreground object.

本发明实施例的图像处理装置例如可以是计算机设备。上述各个功能模块可以由计算机设备的处理器执行存储器中存储的程序来实现。The image processing apparatus in the embodiment of the present invention may be, for example, computer equipment. The above functional modules can be realized by the processor of the computer device executing the programs stored in the memory.

可以理解,本发明实施例的图像处理装置的各个功能模块的功能可根据上述方法实施例中的方法具体实现,其具体实现过程可参照上述方法实施例中的相关描述,此处不再赘述。It can be understood that the functions of each functional module of the image processing device in the embodiment of the present invention can be specifically implemented according to the method in the above method embodiment, and the specific implementation process can refer to the relevant description in the above method embodiment, and will not be repeated here.

由上可见,在本发明的一些可行的实施方式中,提供了一种图像处理装置,根据参考背景对象在第一和第二光照条件下的颜色值,以及前景对象在第二光照条件下的颜色值,来计算前景对象在第一光照条件下的颜色值,从而将待处理图像中的前景对象统一到第一光照条件下,后续可统一使用第一光照条件下前景对象的颜色值进行检索或查询等处理,相对于现有技术,不必剥离图像的光照值,解决了现有技术中难以获得精确的光照估计值的问题,提高了图像处理的精确度。As can be seen from the above, in some feasible implementation manners of the present invention, an image processing device is provided, according to the color values of the reference background object under the first and second lighting conditions, and the color value of the foreground object under the second lighting condition Color value to calculate the color value of the foreground object under the first lighting condition, so that the foreground object in the image to be processed is unified under the first lighting condition, and the color value of the foreground object under the first lighting condition can be used for subsequent retrieval Compared with the prior art, it is not necessary to peel off the illumination value of the image, which solves the problem that it is difficult to obtain an accurate illumination estimation value in the prior art, and improves the accuracy of image processing.

请参考图7,本发明实施例还提供一种计算机设备700,可包括:Please refer to FIG. 7, the embodiment of the present invention also provides a computer device 700, which may include:

处理器710,存储器720,通信接口730,总线740;Processor 710, memory 720, communication interface 730, bus 740;

所述处理器710,存储器720,通信接口730通过所述总线740连接并相互的通信;所述通信接口730,用于接收和发送数据;所述存储器720用于存储程序750;所述处理器710用于执行所述存储器中的所述程序750;当所述计算机设备700运行时,所述处理器710执行所述存储器720存储的所述程序750,以使所述计算机设备700执行如上文方法实施例所述的图像处理方法。The processor 710, memory 720, and communication interface 730 are connected and communicate with each other through the bus 740; the communication interface 730 is used to receive and send data; the memory 720 is used to store a program 750; the processor 710 is used to execute the program 750 in the memory; when the computer device 700 is running, the processor 710 executes the program 750 stored in the memory 720, so that the computer device 700 performs as above The image processing method described in the method embodiment.

其中,处理器710可以执行以下步骤:获取第一光照条件下拍摄的参考图像中的参考背景对象的第一颜色值;获取第二光照条件下拍摄的待处理图像中的所述参考背景对象的第二颜色值和前景对象的第三颜色值;根据所述第一颜色值,第二颜色值和第三颜色值,估算第一光照条件下拍摄所述前景对象的第四颜色值;利用所述第四颜色值对所述前景对象进行处理。Wherein, the processor 710 may perform the following steps: acquire the first color value of the reference background object in the reference image taken under the first lighting condition; acquire the first color value of the reference background object in the image to be processed taken under the second lighting condition The second color value and the third color value of the foreground object; according to the first color value, the second color value and the third color value, estimate the fourth color value of the foreground object photographed under the first lighting condition; use the The fourth color value is used to process the foreground object.

所述总线740可以是工业标准体系结构(Industry Standard Architecture,简称为ISA)总线或外部设备互连(Peripheral Component,简称为PCI)总线或扩展工业标准体系结构(Extended Industry Standard Architecture,简称为EISA)总线等。所述总线可以分为地址总线、数据总线、控制总线中的一种或多种。为便于表示,图中仅用一条粗线表示,但并不表示仅有一根总线或一种类型的总线。The bus 740 may be an Industry Standard Architecture (Industry Standard Architecture, referred to as ISA) bus or a Peripheral Component Interconnect (Pipheral Component, referred to as PCI) bus or an Extended Industry Standard Architecture (Extended Industry Standard Architecture, referred to as EISA) bus etc. The bus can be classified into one or more of address bus, data bus and control bus. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.

所述存储器720可以包含高速RAM(Ramdom Access Memory)存储器。可选地,所述存储器720还可以还包括非易失性存储器(non-volatile memory)。例如所述存储器720可以包括磁盘存储器。The memory 720 may include a high-speed RAM (Ramdom Access Memory) memory. Optionally, the memory 720 may further include a non-volatile memory (non-volatile memory). For example, the memory 720 may include disk storage.

所述处理器710可以是一个中央处理器(Central Processing Unit,简称为CPU),或者所述处理器710可以是特定集成电路(Application Specific IntegratedCircuit,简称为ASIC),或者所述处理器710可以是被配置成实施本发明实施例的一个或多个集成电路。The processor 710 may be a central processing unit (Central Processing Unit, referred to as CPU), or the processor 710 may be a specific integrated circuit (Application Specific Integrated Circuit, referred to as ASIC), or the processor 710 may be One or more integrated circuits configured to implement embodiments of the invention.

可以理解,本发明实施例的计算机设备的功能可根据上述方法实施例中的方法具体实现,其具体实现过程可参照上述方法实施例中的相关描述,此处不再赘述。该计算机设备通过实施上述方法实施例中的方法,可以取得上述方法实施例所能取得的技术效果。It can be understood that the functions of the computer device in the embodiments of the present invention can be specifically implemented according to the methods in the above method embodiments, and the specific implementation process can refer to the relevant descriptions in the above method embodiments, which will not be repeated here. By implementing the methods in the above method embodiments, the computer equipment can obtain the technical effects obtained by the above method embodiments.

(实施例三、)本发明实施例还提供一种存储一个或多个程序的计算机可读存储介质,所述一个或多个程序包括指令,所述指令当被包括一个或多个处理器的计算机设备执行时,使所述计算机设备执行如上文方法实施例所述的图像处理方法。(Embodiment 3) The embodiment of the present invention also provides a computer-readable storage medium that stores one or more programs, and the one or more programs include instructions, and when the instructions are executed by one or more processors When the computer device executes, the computer device is made to execute the image processing method described in the above method embodiments.

在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详细描述的部分,可以参见其它实施例的相关描述。In the foregoing embodiments, the descriptions of each embodiment have their own emphases, and for parts not described in detail in a certain embodiment, reference may be made to relevant descriptions of other embodiments.

需要说明的是,对于前述的各方法实施例,为了简单描述,故将其都表述为一系列的动作组合,但是本领域技术人员应该知悉,本发明并不受所描述动作顺序的限制,因为依据本发明,某些步骤可以采用其它顺序或者同时进行。其次,本领域技术人员也应该知悉,说明书中所描述的实施例均属于优选实施例,所涉及的动作和模块并不一定是本发明所必须的。It should be noted that for the foregoing method embodiments, for the sake of simple description, they are expressed as a series of action combinations, but those skilled in the art should know that the present invention is not limited by the described action sequence, because Certain steps may be performed in other orders or simultaneously in accordance with the present invention. Secondly, those skilled in the art should also know that the embodiments described in the specification belong to preferred embodiments, and the actions and modules involved are not necessarily required by the present invention.

所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统,装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that for the convenience and brevity of the description, the specific working process of the above-described system, device and unit can refer to the corresponding process in the foregoing method embodiment, which will not be repeated here.

在本申请所提供的几个实施例中,应该理解到,所揭露的系统,装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided in this application, it should be understood that the disclosed system, device and method can be implemented in other ways. For example, the device embodiments described above are only illustrative. For example, the division of units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or integrated. to another system, or some features may be ignored, or not implemented. In another point, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces, and the indirect coupling or communication connection of devices or units may be in electrical, mechanical or other forms.

作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。A unit described as a separate component may or may not be physically separated, and a component displayed as a unit may or may not be a physical unit, that is, it may be located in one place, or may be distributed to multiple network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

另外,在本发明各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, each unit may exist separately physically, or two or more units may be integrated into one unit. The above-mentioned integrated units can be implemented in the form of hardware or in the form of software functional units.

集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本发明各个实施例方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质。If the integrated unit is realized in the form of a software function unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the essence of the technical solution of the present invention or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium , including several instructions to make a computer device (which may be a personal computer, a server, or a network device, etc.) execute all or part of the steps of the methods in various embodiments of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), magnetic disk or optical disk and other media that can store program codes. .

以上对本发明实施例所提供的图像处理方法和装置进行了详细介绍,本文中应用了具体个例对本发明的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本发明的方法及其核心思想;同时,对于本领域的一般技术人员,依据本发明的思想,在具体实施方式及应用范围上均会有改变之处,综上所述,本说明书内容不应理解为对本发明的限制。The image processing method and device provided by the embodiments of the present invention have been introduced in detail above. In this paper, specific examples are used to illustrate the principle and implementation of the present invention. The description of the above embodiments is only used to help understand the method of the present invention. and its core idea; at the same time, for those of ordinary skill in the art, according to the idea of the present invention, there will be changes in the specific implementation and scope of application. limits.

Claims (15)

1.一种图像处理方法,其特征在于,包括:1. An image processing method, characterized in that, comprising: 获取第一光照条件下拍摄的参考图像中的参考背景对象的第一颜色值;Acquiring a first color value of a reference background object in a reference image captured under a first lighting condition; 获取第二光照条件下拍摄的待处理图像中的所述参考背景对象的第二颜色值和前景对象的第三颜色值;Acquiring the second color value of the reference background object and the third color value of the foreground object in the image to be processed captured under the second lighting condition; 根据所述第一颜色值,第二颜色值和第三颜色值,估算第一光照条件下拍摄所述前景对象的第四颜色值;Estimating a fourth color value of the foreground object photographed under the first lighting condition according to the first color value, the second color value and the third color value; 利用所述第四颜色值对所述前景对象进行处理。The foreground object is processed using the fourth color value. 2.根据权利要求1所述的方法,其特征在于,所述第一颜色值,第二颜色值和第三颜色值以及第四颜色值为RGB值或对数域上的RGB值。2. The method according to claim 1, wherein the first color value, the second color value, the third color value and the fourth color value are RGB values or RGB values in a logarithmic domain. 3.根据权利要求2所述的方法,其特征在于,根据所述第一颜色值,第二颜色值和第三颜色值,估算第一光照条件下拍摄所述前景对象的第四颜色值包括:3. The method according to claim 2, wherein, according to the first color value, the second color value and the third color value, estimating the fourth color value of shooting the foreground object under the first lighting condition comprises : 采用以下公式计算所述第四颜色值:The fourth color value is calculated using the following formula: S4=S3-(S2-S1);S 4 =S 3 -(S 2 -S 1 ); 其中,S1,S2,S3,S4分别为所述第一颜色值,第二颜色值和第三颜色值以及第四颜色值,且S1,S2,S3,S4为对数域上的RGB值。Wherein, S 1 , S 2 , S 3 , S 4 are respectively the first color value, the second color value, the third color value and the fourth color value, and S 1 , S 2 , S 3 , S 4 are RGB value on the logarithmic domain. 4.根据权利要求1所述的方法,其特征在于,所述获取第一光照条件下拍摄的参考图像中的参考背景对象的第一颜色值之前,还包括:4. The method according to claim 1, wherein, before the acquisition of the first color value of the reference background object in the reference image taken under the first lighting condition, further comprising: 获取多张图像;get multiple images; 获取所述多张图像中的一张图像作为所述参考图像;Acquiring one of the plurality of images as the reference image; 获取所述多张图像中除所述参考图像以外的任一张图像作为所述待处理图像;Acquiring any one of the plurality of images except the reference image as the image to be processed; 所述参考图像包括所述参考背景对象,所述待处理图像包括所述参考背景对象和所述前景对象。The reference image includes the reference background object, and the image to be processed includes the reference background object and the foreground object. 5.根据权利要求4所述的方法,其特征在于,所述获取所述多张图像中的一张图像作为所述参考图像包括:5. The method according to claim 4, wherein said acquiring an image in said plurality of images as said reference image comprises: 根据所述多张图像的亮度值和/或拍摄时间,从所述多张图像中选择一张图像作为所述参考图像。An image is selected from the multiple images as the reference image according to the brightness values and/or shooting time of the multiple images. 6.根据权利要求4所述的方法,其特征在于,在所述多张图像来自于多个相机时,所述获取第一光照条件下拍摄的参考图像中的参考背景对象的第一颜色值之前,还包括:6. The method according to claim 4, wherein when the multiple images are from multiple cameras, the acquisition of the first color value of the reference background object in the reference image taken under the first lighting condition Previously, also included: 预先对所述多个相机的颜色进行校准;Calibrating the colors of the plurality of cameras in advance; 分别计算所述多个相机中除参考相机之外的每个相机与所述参考相机各自拍摄的图像中的所述参考背景对象的光照差异;separately calculating the illumination difference of the reference background object in the images captured by each camera except the reference camera among the plurality of cameras and the reference camera; 所述利用所述第四颜色值对所述前景对象进行处理包括:The processing the foreground object by using the fourth color value includes: 从所述第四颜色值中去除相应的光照差异,利用去除光照差异后的第四颜色值对所述前景对象进行处理。The corresponding illumination difference is removed from the fourth color value, and the foreground object is processed by using the fourth color value after the illumination difference is removed. 7.根据权利要求1-6任一所述的方法,其特征在于,所述对所述前景对象进行处理包括:7. The method according to any one of claims 1-6, wherein said processing said foreground object comprises: 对所述前景对象进行检索或查询。The foreground object is retrieved or queried. 8.一种图像处理装置,其特征在于,包括:8. An image processing device, comprising: 获取模块,用于获取第一光照条件下拍摄的参考图像中的参考背景对象的第一颜色值;获取第二光照条件下拍摄的待处理图像中的所述参考背景对象的第二颜色值和前景对象的第三颜色值;An acquisition module, configured to acquire the first color value of the reference background object in the reference image taken under the first lighting condition; acquire the second color value and the value of the reference background object in the image to be processed taken under the second lighting condition the third color value of the foreground object; 颜色值计算模块,用于根据所述第一颜色值,第二颜色值和第三颜色值,估算第一光照条件下拍摄所述前景对象的第四颜色值;A color value calculation module, configured to estimate a fourth color value of the foreground object photographed under the first lighting condition according to the first color value, the second color value and the third color value; 处理模块,用于利用所述第四颜色值对所述前景对象进行处理。A processing module, configured to process the foreground object by using the fourth color value. 9.根据权利要求8所述的方法,其特征在于,所述第一颜色值,第二颜色值和第三颜色值以及第四颜色值为RGB值或对数域上的RGB值。9. The method according to claim 8, wherein the first color value, the second color value, the third color value and the fourth color value are RGB values or RGB values in a logarithmic domain. 10.根据权利要求9所述的装置,其特征在于,10. The apparatus of claim 9, wherein: 所述颜色值计算模块,具体用于采用以下公式计算所述第四颜色值:The color value calculation module is specifically used to calculate the fourth color value using the following formula: S4=S3-(S2-S1);S 4 =S 3 -(S 2 -S 1 ); 其中,S1,S2,S3,S4分别为所述第一颜色值,第二颜色值和第三颜色值以及第四颜色值,且S1,S2,S3,S4为对数域上的RGB值。Wherein, S 1 , S 2 , S 3 , S 4 are respectively the first color value, the second color value, the third color value and the fourth color value, and S 1 , S 2 , S 3 , S 4 are RGB value on the logarithmic domain. 11.根据权利要求8所述的装置,其特征在于,11. The apparatus of claim 8, wherein: 所述获取模块还用于:获取多张图像;获取所述多张图像中的一张图像作为所述参考图像;获取所述多张图像中除所述参考图像以外的任一张图像作为所述待处理图像;所述参考图像包括所述参考背景对象,所述待处理图像包括所述参考背景对象和所述前景对象。The acquisition module is also used to: acquire a plurality of images; acquire an image in the plurality of images as the reference image; acquire any image in the plurality of images except the reference image as the reference image The image to be processed; the reference image includes the reference background object, and the image to be processed includes the reference background object and the foreground object. 12.根据权利要求11所述的装置,其特征在于,还包括:12. The device of claim 11, further comprising: 设置模块,用于根据所述多张图像的亮度值和/或拍摄时间,从所述多张图像中选择一张图像作为所述参考图像。A setting module, configured to select an image from the plurality of images as the reference image according to brightness values and/or shooting time of the plurality of images. 13.根据权利要求11所述的装置,其特征在于,还包括:13. The device of claim 11, further comprising: 校准模块,用于预先对所述多个相机的颜色进行校准;A calibration module, configured to calibrate the colors of the plurality of cameras in advance; 差异计算模块,用于分别计算所述多个相机中除参考相机之外的每个相机与所述参考相机各自拍摄的图像中的所述参考背景对象的光照差异;a difference calculation module, configured to separately calculate the illumination difference of the reference background object in the images captured by each of the plurality of cameras except the reference camera and the reference camera; 所述处理模块,还用于从所述第四颜色值中去除相应的光照差异,利用去除光照差异后的第四颜色值对所述前景对象进行处理。The processing module is further configured to remove the corresponding illumination difference from the fourth color value, and process the foreground object by using the fourth color value after the illumination difference is removed. 14.根据权利要求8-13任一所述的装置,其特征在于,14. The device according to any one of claims 8-13, characterized in that, 所述处理模块,具体用于对所述前景对象进行检索或查询。The processing module is specifically configured to retrieve or query the foreground object. 15.一种计算机设备,其特征在于,所述计算机设备包括处理器、存储器、总线和通信接口;15. A computer device, characterized in that the computer device comprises a processor, a memory, a bus and a communication interface; 所述存储器用于存储程序,所述处理器与所述存储器通过所述总线连接,当所述计算机设备运行时,所述处理器执行所述存储器存储的所述程序,以使所述计算机设备执行如权利要求1-7中任一项所述的图像处理方法。The memory is used to store programs, and the processor is connected to the memory through the bus. When the computer device is running, the processor executes the program stored in the memory, so that the computer device Executing the image processing method described in any one of claims 1-7.
CN201610128429.8A 2016-03-07 2016-03-07 Image processing method and device Pending CN107169930A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201610128429.8A CN107169930A (en) 2016-03-07 2016-03-07 Image processing method and device
PCT/CN2017/075781 WO2017152822A1 (en) 2016-03-07 2017-03-06 Image processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610128429.8A CN107169930A (en) 2016-03-07 2016-03-07 Image processing method and device

Publications (1)

Publication Number Publication Date
CN107169930A true CN107169930A (en) 2017-09-15

Family

ID=59788969

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610128429.8A Pending CN107169930A (en) 2016-03-07 2016-03-07 Image processing method and device

Country Status (2)

Country Link
CN (1) CN107169930A (en)
WO (1) WO2017152822A1 (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110610525B (en) * 2018-06-15 2023-04-07 中兴通讯股份有限公司 Image processing method and device and computer readable storage medium
CN111861632B (en) * 2020-06-05 2023-06-30 北京旷视科技有限公司 Virtual makeup test method, device, electronic equipment and readable storage medium
CN113139953B (en) * 2021-05-10 2022-11-04 宁波永新光学股份有限公司 Method and computer-readable storage medium for detecting and identifying particulate contamination in images
CN113436284B (en) * 2021-07-30 2024-10-29 上海商汤智能科技有限公司 Image processing method, device, computer equipment and storage medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110069070A1 (en) * 2009-09-21 2011-03-24 Klaus Engel Efficient visualization of object properties using volume rendering
CN102067582A (en) * 2008-06-17 2011-05-18 皇家飞利浦电子股份有限公司 Color adjustment
CN102542548A (en) * 2011-12-30 2012-07-04 深圳市万兴软件有限公司 Method and device for correcting color between images
CN102760287A (en) * 2011-04-29 2012-10-31 国际商业机器公司 Color correction method for static cameras and apparatus thereof
CN104200473A (en) * 2014-09-02 2014-12-10 中航高科技发展有限公司 Image background subtraction based dynamic vision measuring method
US20150172513A1 (en) * 2013-12-18 2015-06-18 Nokia Corporation Methods And Apparatus For Color Balance Correction
US20150371398A1 (en) * 2014-06-23 2015-12-24 Gang QIAO Method and system for updating background model based on depth

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102067582A (en) * 2008-06-17 2011-05-18 皇家飞利浦电子股份有限公司 Color adjustment
US20110069070A1 (en) * 2009-09-21 2011-03-24 Klaus Engel Efficient visualization of object properties using volume rendering
CN102760287A (en) * 2011-04-29 2012-10-31 国际商业机器公司 Color correction method for static cameras and apparatus thereof
CN102542548A (en) * 2011-12-30 2012-07-04 深圳市万兴软件有限公司 Method and device for correcting color between images
US20150172513A1 (en) * 2013-12-18 2015-06-18 Nokia Corporation Methods And Apparatus For Color Balance Correction
CN104735434A (en) * 2013-12-18 2015-06-24 诺基亚公司 Method and apparatus for color balance correction
US20150371398A1 (en) * 2014-06-23 2015-12-24 Gang QIAO Method and system for updating background model based on depth
CN104200473A (en) * 2014-09-02 2014-12-10 中航高科技发展有限公司 Image background subtraction based dynamic vision measuring method

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
王金华等: "《图像理解——颜色认知计算》", 31 December 2013, 清华大学出版社 *

Also Published As

Publication number Publication date
WO2017152822A1 (en) 2017-09-14

Similar Documents

Publication Publication Date Title
CN109961406B (en) Image processing method and device and terminal equipment
CN105100770B (en) Three-dimensional source images calibration method and equipment
CN112802081B (en) Depth detection method and device, electronic equipment and storage medium
CN106611429B (en) Detect the method for skin area and the device of detection skin area
US10165248B2 (en) Optimization method of image depth information and image processing apparatus
US9699380B2 (en) Fusion of panoramic background images using color and depth data
CN107909569B (en) Screen-patterned detection method, screen-patterned detection device and electronic equipment
CN112669758B (en) Display screen correction method, device, system and computer readable storage medium
US11074742B2 (en) Image processing apparatus, image processing method, and storage medium
CN106331492A (en) An image processing method and terminal
CN108769634B (en) Image processing method, image processing device and terminal equipment
US20170206690A1 (en) Image processing apparatus, image processing method, and storage medium
CN105243371A (en) Human face beauty degree detection method and system and shooting terminal
JP2017050683A (en) Image processor, imaging apparatus, and image processing method and program
Faridul et al. Approximate cross channel color mapping from sparse color correspondences
CN107169930A (en) Image processing method and device
CN110689565A (en) Depth map determination method and device and electronic equipment
CN105791793A (en) Image processing method and electronic device thereof
CN113781334A (en) Method, device, terminal and storage medium for comparing difference between images based on colors
CN104517264B (en) Image processing method and device
CN108810407B (en) Image processing method, mobile terminal and computer-readable storage medium
CN117455818A (en) A correction method, device, electronic device and storage medium for smart glasses screen
CN108470327B (en) Image enhancement method and device, electronic equipment and storage medium
US12062175B2 (en) Method for processing images, electronic device, and storage medium
CN108805883A (en) Image segmentation method, image segmentation device and electronic equipment

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
RJ01 Rejection of invention patent application after publication

Application publication date: 20170915

RJ01 Rejection of invention patent application after publication