WO2017152822A1 - 图像处理方法和装置 - Google Patents

图像处理方法和装置 Download PDF

Info

Publication number
WO2017152822A1
WO2017152822A1 PCT/CN2017/075781 CN2017075781W WO2017152822A1 WO 2017152822 A1 WO2017152822 A1 WO 2017152822A1 CN 2017075781 W CN2017075781 W CN 2017075781W WO 2017152822 A1 WO2017152822 A1 WO 2017152822A1
Authority
WO
WIPO (PCT)
Prior art keywords
color value
image
illumination
images
foreground object
Prior art date
Application number
PCT/CN2017/075781
Other languages
English (en)
French (fr)
Inventor
刘永亮
白博
陈茂林
Original Assignee
华为技术有限公司
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 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2017152822A1 publication Critical patent/WO2017152822A1/zh

Links

Images

Classifications

    • G06T5/77
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/50Image enhancement or restoration by the use of more than one image, e.g. averaging, subtraction
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/40Extraction of image or video features
    • G06V10/56Extraction of image or video features relating to colour
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • 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; CALCULATING OR 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; CALCULATING OR 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

Definitions

  • the present invention relates to the field of image processing technologies, and in particular, to an image processing method and apparatus.
  • the principle of these schemes is generally to first estimate the illumination, and then based on the estimation of the illumination, the reflection coefficient inherent to the image object is estimated by stripping the illumination value to obtain the inherent color of the object that is not affected by the illumination. value.
  • Embodiments of the present invention provide an image processing method and apparatus to improve the accuracy of image processing.
  • a first aspect of the embodiments of the present invention provides an image processing method, which can unify object colors under different illumination conditions to "same" reference illumination conditions.
  • the image can be captured under the first illumination condition.
  • the first color value, the second color value, and the third color value are used to estimate a fourth color value of the foreground object under the first illumination condition, so as to unify the color value of the foreground object under different illumination conditions to the first illumination Under the condition, the foreground object is processed by the fourth color value of the foreground object under the first illumination condition, such as retrieval or query and image editing.
  • the scheme does not need to strip the illumination value of the image, thereby avoiding the estimation of the illumination value, thereby avoiding the error generated in the illumination estimation process, and solving the problem that it is difficult to obtain an accurate illumination estimation value in the prior art. Improves the accuracy of image processing.
  • a second aspect of the embodiments of the present invention provides an image processing apparatus, which can unify an object color under different illumination conditions to a "same" reference illumination condition.
  • the apparatus may include: an acquisition module, a color value. a calculation module, and a processing module, wherein the acquisition module acquires a first color value of the reference background object in the reference image captured under the first illumination condition, and acquires the reference background object in the image to be processed captured under the second illumination condition a second color value and a third color value of the foreground object; the color value calculation module is based on the first, second, and third The fourth color value of the foreground object is captured under the first lighting condition; the processing module processes the foreground object using the fourth color value, such as a search or query, an image editing, and the like.
  • the scheme does not need to strip the illumination value of the image, thereby avoiding the estimation of the illumination value, thereby avoiding the error generated in the illumination estimation process, and solving the problem that it is difficult to obtain an accurate illumination estimation value in the prior art. Improves the accuracy of image processing.
  • the formula S 4 S 3 -(S 2 -S 1 may be used. ) Calculate the fourth color value.
  • S 1 , S 2 , S 3 , and S 4 may be logarithmic values after the logarithm of the original observation value, and the original observation value may be an RGB value, that is, S 1 , S 2 , S 3 , S 4 can be an RGB value on a logarithmic domain.
  • a reference image may be preset, the illumination condition of the reference image is defined as a first illumination condition, and the illumination condition of the image to be processed is defined as a second illumination condition, and the first image may be obtained from the reference image.
  • the second color value of the reference background object and the third color value of the foreground object under the second illumination condition are obtained from the image to be processed with reference to the first color value of the background object under illumination conditions.
  • acquiring a plurality of images acquiring one of the plurality of images as the reference image; acquiring any one of the plurality of images other than the reference image as the image to be processed
  • the reference image includes the reference background object, the image to be processed including the reference background object and the foreground object.
  • an image may be selected from the plurality of images as the reference image according to the brightness value and/or the shooting time of the multiple images, for example, the brightness value is within a set threshold range and/or Or an image whose shooting time is within the preset time range is set as the reference image.
  • the colors of the plurality of cameras may be calibrated in advance; and each of the plurality of cameras except the reference camera is separately calculated and Referencing the illumination difference of the reference background object in the respective captured images of the camera; removing the corresponding illumination difference from the fourth color value of the foreground object, and processing the foreground object with the fourth color value after removing the illumination difference.
  • each of the plurality of cameras except the reference camera is separately calculated and Referencing the illumination difference of the reference background object in the respective captured images of the camera; removing the corresponding illumination difference from the fourth color value of the foreground object, and processing the foreground object with the fourth color value after removing the illumination difference.
  • a third aspect of the embodiments of the present invention further provides a computer device, comprising: a processor, a memory, a bus, and a communication interface; the memory is configured to store a program, the processor and the memory Through the bus connection, the processor executes the program stored by the memory when the computer device is running to cause the computer device to perform an image processing method as described above.
  • a fourth aspect of an embodiment of the present invention also provides a computer readable storage medium storing one or more programs, the one or more programs comprising instructions, when the computer device is included as one or more processors When executed, the computer device is caused to perform an image processing method as described above.
  • the foreground is calculated according to the color values of the reference background object under the first and second illumination conditions and the color value of the foreground object under the second illumination condition.
  • the color value of the object under the first illumination condition thereby unifying the foreground object in the image to be processed to the first illumination condition, and subsequently uniformly using the color value of the foreground object under the first illumination condition for searching or querying, etc.
  • 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.
  • FIG. 1 is a schematic flow chart of an image processing method according to an embodiment of the present invention.
  • FIG. 2 is a schematic flowchart of an image processing method according to another embodiment of the present invention.
  • Figures 3a and 3b are schematic views of images before and after processing, respectively;
  • FIG. 4 is a schematic flowchart of an image processing method according to another embodiment of the present invention.
  • FIG. 5 is a schematic structural diagram of an image processing apparatus according to an embodiment of the present invention.
  • FIG. 6 is a schematic structural diagram of an image processing apparatus according to another embodiment of the present invention.
  • FIG. 7 is a schematic structural diagram of a computer device according to an embodiment of the present invention.
  • the technical solution of the embodiments of the present invention applies various computer systems related to image processing, such as face recognition, iris recognition, and video monitoring, and the computer system may include: an image acquisition unit for acquiring images, such as various cameras, cameras, and camera modules. Group, etc.; storage unit for storing images, such as read-only memory (English full name: Read-Only Memory, English abbreviation: ROM), random access memory (English full name: Random Access Memory, English abbreviation: RAM), mobile hard disk , a disk or an optical disk, 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.; display unit for displaying images, such as cathode ray tube display (English name: Cathode Ray Tube, English abbreviation: CRT), plasma display (English full name: Plasma Display Panel, English abbreviation: PDP), liquid crystal
  • the present invention is directed to solving this problem.
  • the technical solution of the embodiment of the present invention can be used in a scenario in which, given a plurality of images, an image is given, and a foreground object in a given image is used as a query target, and the query target is compared with other images.
  • the foreground objects are matched to determine whether they are the same object to query or retrieve all images containing the query target.
  • FIG. 3a is a query object in the first image in the upper left corner, and directly queries from multiple images to search for the query result of the image containing the query target, and the query result shows that the first row is the first.
  • the seventh image is included in the seventh image, or the portraits in the seven images are the same person.
  • An image processing method may include: acquiring a first color value of a reference background object in a reference image captured under a first illumination condition; and acquiring the reference in a to-be-processed image captured under a second illumination condition a second color value of the background object and a third color value of the foreground object; estimating a fourth color value of the foreground object under the first illumination condition according to the first color value, the second color value, and the third color value And processing, by the fourth color value, the foreground object in the image to be processed, for example, performing a search or query.
  • the embodiment of the present invention assumes that the color value of the reference background object in the case where the illumination is good can be obtained, which is usually possible.
  • the color value of the reference background object in the case of better illumination can be obtained at some time during the day.
  • the color value of the reference background object in the case of better illumination is used as the a priori information, and the illumination condition in the case where the illumination is better is referred to as the first illumination condition.
  • the color value of the foreground object under the first illumination condition can be calculated by using the difference of the color values of the same or the same reference background object under different illumination conditions, and the foreground object is unified under the first illumination condition. .
  • the portrait in the first image in the upper left corner is used as a query target, and the query is performed from multiple images to find The result of the query of the same person's image.
  • a specific process of an image processing method according to an embodiment of the present invention may include:
  • the first color value of the reference background object under the first illumination condition may be obtained from the reference image including the reference background object.
  • the so-called first illumination condition can be understood as the illumination condition of the reference image.
  • any one of the acquired multiple images that need to be processed may be used as a reference image, and the illumination condition of the reference image is defined as the first illumination condition.
  • the acquired multiple images should include the same or the same reference background object, such as roads, trees, walls, etc., and the specific categories of the reference background objects are not limited herein.
  • the method may further include: acquiring a plurality of images; acquiring one of the plurality of images as the reference image; acquiring any one of the plurality of images except the reference image The image serves as the image to be processed.
  • the first color value, and the second, third or fourth color value, etc., which will be mentioned later, may be simply referred to as a color value or a color value, and may specifically refer to an RGB value, and RGB is expressed in English as R ( Red), G(green), B(blue).
  • the RGB color mode is a color standard in the industry, which is obtained by changing the three color channels of red (R), green (G), and blue (B) and superimposing them on each other.
  • RGB is the color of the three channels of red, green and blue. This standard includes almost all colors that human vision can perceive. It is one of the most widely used color systems.
  • RGB refers to brightness and is represented by an integer. Normally, R, G, and B each have 256 levels of brightness, which are represented by numbers from 0, 1, 2, ... up to 255, for a total of 256 levels.
  • the method of encoding a color is collectively referred to as "color space” or “gamut.”
  • the "color space” of any color can be defined as a fixed number or variable.
  • 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.
  • one format is called RGB555, and 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 the image can be represented by a 16-bit binary number.
  • the format is not limited to RGB555, and formats such as RGB565, RGB24, and RGB32 may also be used, and details are not described herein.
  • the image taken under better illumination conditions can be selected as the reference image.
  • the illumination condition is better understood to be that the image brightness value is within a set threshold range, and/or the shooting time is within a set time range.
  • an image may be selected from the plurality of images according to a brightness value and/or a shooting time of the plurality of images, for example, a brightness value between 4.5 and 5.5, and a shooting time of AM.
  • the reference image may be candela per square meter (cd/m2).
  • the second color value of the reference background object and the third color value of the foreground object under the second illumination condition may be acquired from the to-be-processed image including the reference background object and the foreground object.
  • the so-called second illumination condition can be understood as the illumination condition of the image to be processed.
  • the image to be processed may refer to any image other than the selected reference image among the plurality of images acquired in the previous step.
  • S 1 , S 2 , S 3 , and S 4 are values after the logarithm of the original observation value.
  • the raw observations can be RGB values. That is, S 1 , S 2 , S 3 , and S 4 are RGB values on a logarithmic domain, and RGB values on a logarithmic domain specifically refer to values obtained by taking logarithmically on RGB values. By taking the logarithm, it is both in line with human visual characteristics and data compression.
  • the color value of the foreground object in the image to be processed under the first illumination condition can be calculated, and the color of the foreground object in the multiple images under different illumination conditions is unified to the first illumination condition. under.
  • the foreground object can be unified to the color value under the first lighting condition for image processing, including retrieval or query.
  • a higher definition image may be selected from the image shown in FIG. 3b as a reference image, and the color values of the foreground object (in particular, a portrait) in other images may be unified to the reference image.
  • the color value under the first illumination condition estimated by the foreground object of each image is used for searching or querying, wherein the portrait in the first image in the upper left corner can be used as the query target, and any other
  • the portrait in the image matches the query target, determines whether it is the same person, finds all the images containing the search target, and finally obtains 15 images containing the query target, as shown in the first 15 of the first row in Figure 3b. image.
  • One illumination model widely used at present is the Retinex mathematical model.
  • the technical principle of the present invention is based on this model, and the second illumination is derived under the assumption that the color value of the reference background object under the first illumination condition L0 can be obtained.
  • the Retinex model is as follows:
  • s(x, y) is the color value
  • l(x, y) is the illumination value
  • r(x, y) is the reflection coefficient of the object.
  • Equation (2) uppercase S(x, y), L(x, y), R(x, y) are used to denote s(x, y), l(x, y), r(x, y, respectively. ) Take the value after the logarithm.
  • the subscript BG represents the background object
  • the subscript 0 represents the illumination L0.
  • the subscript BG represents the background object
  • the subscript 1 represents the illumination L1.
  • the subscript FG represents the foreground object
  • the subscript 1 represents the illumination L1.
  • the right end of the formula (1.2.4) is the observed color value and is known.
  • the left end is just the color value of the foreground object in the case of illumination L0, which can be recorded as S FG,0 .
  • the solution calculates the color value of the foreground object under the first illumination condition according to the color value of the reference background object under the first and second illumination conditions and the color value of the foreground object under the second illumination condition, thereby to be processed
  • the foreground object in the image is unified to the first illumination condition, and the color value of the foreground object under the first illumination condition can be uniformly used for searching or querying, etc., compared with the prior art, the illumination value of the image does not need to be stripped, and the current solution is solved.
  • There is a problem in the art that it is difficult to obtain accurate illumination estimates, which improves the accuracy of image processing.
  • FIG. 2 another image processing method according to an embodiment of the present invention.
  • Can include:
  • the object processed by the scheme of this embodiment is a set of images having the same background object, including a plurality of images, and the plurality of images all include the same background object, and the same background object is defined as a reference background object.
  • Multiple images in the image set can be captured by the same camera, with the same or similar background objects; or can be taken by different cameras, images captured between different cameras have overlapping areas, or no overlapping areas, but have the same background Objects, such as the same material floor (such as asphalt road).
  • An image taken with a good illumination intensity may be selected according to the brightness value and/or the shooting time of the plurality of images, and set as a reference image.
  • the brightness value is between 4.5 and 5.5
  • the shooting time is morning, the light intensity is good, and the captured image is relatively clear, then one such image can be selected and set as the reference image.
  • 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 a plurality of images of the aforementioned image set to be processed.
  • the illumination intensity corresponding to the reference background object is used as the reference illumination level, that is, the first illumination condition L0 described above.
  • Defining other images in the image set other than the reference image as the image to be processed, and processing any image to be processed according to the reference image includes the following steps:
  • the first color value, the second color value and the third color value are respectively S BG,0 , S BG,1 , S FG,1 .
  • the input calculation result - the fourth color value S FG,0 can be used for subsequent creation of an index for retrieval or query processing.
  • the current scene object is a person
  • Search or query Please refer to FIG. 3a, which is the result of the query obtained by using the first image in the upper left corner as the query object in the case where the above image processing is not performed.
  • FIG. 3a is the result of the query obtained by using the first image in the upper left corner as the query object in the case where the above image processing is not performed.
  • 7 images containing the query target are found, as shown in the figure.
  • the foreground object in the image to be processed may be color-corrected according to the fourth color value, and the corrected image to be processed may be displayed; in other embodiments, only the fourth color value may be used. It is used for searching and querying, without color correction of the foreground object, and does not display the corrected image to be processed; whether the display can be determined according to actual needs.
  • the image processing method according to the embodiment of the present invention is further described above, wherein the plurality of images in the processed image set may be captured by the same camera or may be captured by different cameras. Images taken between cameras can have overlapping areas; or no overlapping areas, but with the same reference background objects, such as the same material floor, such as asphalt roads. That is, the technical solution of the embodiment of the present invention can be directly applied to an application across a camera.
  • an image with a better illumination of the first illumination condition such as L0
  • L0 the reference image
  • the foreground objects of the images captured by each camera are mapped to L0, that is, estimated The color value under the first lighting condition L0.
  • this process that is, the process described in steps 110-130 above, or the process described in steps 210-250, is referred to as illumination pre-processing.
  • different cameras have chosen different reference lighting levels, they are relatively well-lit, and for many applications, images that have been pre-processed with such illumination can be substantially compliant with the query or retrieval requirements.
  • the difference between the cameras is large.
  • some technical means can be used to shoot different cameras. Images that have been pre-processed by illumination are processed again, mapping them to approximately the same reference illumination level. The following examples describe a technical method to achieve this.
  • the image processing method of the embodiment of the present invention may include:
  • the illumination difference of the reference background object in the image captured by each of the plurality of cameras except the reference camera and the reference camera is separately calculated.
  • each camera can be used to take multiple photos of the same color palette while taking pictures of the background environment.
  • the image of the palette color obtained at this time is consistent with the illumination level of the background object.
  • the palette color image taken by each camera can be used to calculate the illumination difference ⁇ L between the reference background objects captured by different cameras.
  • the illumination difference ⁇ SL of the reference background object in each of the images captured by each of the plurality of cameras and the reference camera is separately calculated.
  • an image pre-processing operation is performed on the image taken by each camera.
  • the specific process of the illumination pre-processing 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 herein.
  • the corresponding illumination difference is removed from the fourth color value of the foreground object of each image to be processed, and the corrected fourth color value is obtained. That is to say, the illumination difference ⁇ SL is removed for the obtained foreground object sequence.
  • the sequence of images obtained after removing the difference in illumination may be referred to as an illumination indifference estimation image sequence.
  • the resulting illumination-invariant estimation image sequence can be used for query retrieval in an application.
  • the image query search is performed by using the output result image of the above step, that is, the corrected fourth color value of the image sequence is estimated by the illumination without difference, and the processing such as searching or querying is performed.
  • step 440 can also be performed before step 430.
  • an image processing method is provided, according to the color values of the reference background object under the first and second illumination conditions, and the foreground object under the second illumination condition.
  • the color value is used to calculate the color value of the foreground object under the first illumination condition, thereby unifying the foreground object in the image to be processed to the first illumination condition, and subsequently retrieving the color value of the foreground object under the first illumination condition
  • the processing such as querying, 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.
  • an image processing apparatus 500 which may include:
  • the obtaining module 510 is configured to acquire a first color value of the reference background object in the reference image captured under the first lighting condition; and acquire a second color value of the reference background object in the image to be processed captured in the second lighting condition And a third color value of the foreground object;
  • the color value calculation module 520 is configured to estimate, according to the first color value, the second color value, and the third color value, the fourth color value of the foreground object under the first illumination condition;
  • the processing module 530 is configured to process the foreground object by using the fourth color value.
  • the color value can be simply referred to as the color value.
  • the first color value, the second color value and the third color value, and the fourth color value are RGB values or RGB values on a logarithmic domain.
  • the acquiring module 510 is further configured to: acquire multiple images; acquire the multiple One image in the image as the reference image; acquiring any one of the plurality of images other than the reference image as the image to be processed; the reference image includes the reference background object, The processed image includes the reference background object and the foreground object.
  • the image processing apparatus 500 further includes: a setting module 540;
  • the setting module 540 is configured to select one image from the plurality of images as the reference image according to the brightness value and/or the shooting time of the plurality of images.
  • the image processing apparatus 500 further includes:
  • a calibration module 550 configured to pre-calibrate colors of the plurality of cameras
  • a difference calculation module 560 configured to separately calculate illumination differences of the reference background objects in respective images captured by each of the plurality of cameras except the reference camera;
  • the processing module 530 is further configured to remove a corresponding illumination difference from the fourth color value, and process the foreground object by using a fourth color value after removing the illumination difference.
  • the processing module 530 is specifically configured to retrieve or query the foreground object.
  • the image processing apparatus of the embodiment of the present invention may be, for example, a computer device.
  • Each of the above functional modules may be implemented by a processor of a computer device executing a program stored in a memory.
  • an image processing apparatus according to a color value of a reference background object under first and second illumination conditions, and a foreground object under a second illumination condition
  • the color value is used to calculate the color value of the foreground object under the first illumination condition, thereby unifying the foreground object in the image to be processed to the first illumination condition, and subsequently retrieving the color value of the foreground object under the first illumination condition
  • the processing such as querying, 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.
  • an embodiment of the present invention further provides a computer device 700, which may include:
  • Processor 710 memory 720, communication interface 730, bus 740;
  • the processor 710, the memory 720, the communication interface 730 are connected and communicate with each other through the bus 740; the communication interface 730 is configured to receive and transmit data; the memory 720 is used to store the program 750; the processor 710 is for executing the program 750 in the memory; when the computer device 700 is running, the processor 710 executes the program 750 stored by the memory 720 to cause the computer device 700 to perform as above
  • the processor 710 may perform the steps of: acquiring a first color value of the reference background object in the reference image captured under the first illumination condition; acquiring the reference background object in the to-be-processed image captured under the second illumination condition a second color value and a third color value of the foreground object; estimating a fourth color value of the foreground object under the first illumination condition according to the first color value, the second color value, and the third color value; The fourth color value processes the foreground object.
  • the bus 740 can be an Industry Standard Architecture (ISA).
  • ISA Industry Standard Architecture
  • PCI Peripheral Component
  • EISA Extended Industry Standard Architecture
  • the bus can be divided into one or more of an address bus, a data bus, and a control bus. For ease of representation, only one thick line is shown in the figure, but it does not mean that there is only one bus or one type of bus.
  • the memory 720 can include a high speed RAM (Ramdom Access Memory) memory.
  • the memory 720 may further include a non-volatile memory.
  • the memory 720 can include a disk storage.
  • the processor 710 may be a central processing unit (CPU), or the processor 710 may be an application specific integrated circuit (ASIC), or the processor 710 may Is one or more integrated circuits that are configured to implement embodiments of the present invention.
  • CPU central processing unit
  • ASIC application specific integrated circuit
  • the embodiment of the present invention further provides a computer readable storage medium storing one or more programs, the one or more programs comprising instructions, when the instructions are included in one or more processors
  • the computer device when executed, causes the computer device to perform the image processing method as described in the method embodiments above.
  • the disclosed system, apparatus, and method may be implemented in other manners.
  • the device embodiments described above are merely illustrative.
  • the division of cells is only a logical function division.
  • multiple units or components may be combined or integrated. Go to another system, or some features can be ignored or not executed.
  • the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device or unit, and may be in an electrical, mechanical or other form.
  • the units described as separate components may or may not be physically separate, and the components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of the embodiment.
  • each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
  • the above integrated unit is It can be implemented in the form of hardware or in the form of a software functional unit.
  • An integrated unit if implemented in the form of a software functional unit and sold or used as a standalone product, can be stored in a computer readable storage medium.
  • the technical solution of the present invention which is essential or contributes to the prior art, or all or part of the technical solution, may be embodied in the form of a software product stored in a storage medium.
  • a number of instructions are included to cause a computer device (which may be a personal computer, server, or network device, etc.) to perform all or part of the steps of the various embodiments of the present invention.
  • the foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, and the like. .

Abstract

一种图像处理方法和装置,以提高图像处理的准确性。所述方法包括:获取第一光照条件下拍摄的参考图像中的参考背景对象的第一颜色值(110);获取第二光照条件下拍摄的待处理图像中的所述参考背景对象的第二颜色值和前景对象的第三颜色值(120);根据所述第一颜色值,第二颜色值和第三颜色值,估算第一光照条件下拍摄所述前景对象的第四颜色值(130);利用所述第四颜色值对所述前景对象进行处理(140)。

Description

图像处理方法和装置 技术领域
本发明涉及图像处理技术领域,具体涉及一种图像处理方法和装置。
背景技术
在很多应用中,如人脸识别、虹膜识别和视频监控系统中,需要进行图像处理,但是,光照影响会显著改变图像对象的颜色值,这对于依赖于颜色值进行检索或者识别图像的系统的有效性是一个非常有挑战性的问题。
为了有效去除光照对图像颜色值的影响,很多对图像进行光照处理以恢复图像颜色的方案被提出,包括基于视网膜大脑皮层理论(Retinex)的方案、暗通道处理技术、高动态范围压缩、低动态范围压缩技术、基于梯度理论、基于偏微分方程以及基于变分极值理论的方案等。
这些方案的原理,普遍是首先对光照进行估计,然后在获得光照估计值的基础上,通过剥离光照值的方式对图像对象固有的反射系数进行估计,以获得不受光照影响的对象固有的颜色值。例如,基本思路可以简单理解为:通过估计光照值L,根据光照数学模型S=R*L或是更复杂一些的模型S=R*L+N,来求解反射图像R,其中,N表示噪声,S表示颜色值。
实践发现,上述多种方案都需要在获得光照估计值的基础上进行计算,但是,现有技术中对光照进行估计的方法不够理想,得到的光照估计值不够准确,进而导致采用上述多种方案进行图像处理时准确性不够好。
发明内容
本发明实施例提供一种图像处理方法和装置,以提高图像处理的准确性。
本发明实施例的第一方面提供一种图像处理方法,该方法可以将不同光照条件下的对象颜色统一到“同一”参考光照条件下,具体实现中,可以在获取第一光照条件下拍摄的参考图像中的参考背景对象的第一颜色值,以及获取第二光照条件下拍摄的待处理图像中的所述参考背景对象的第二颜色值和前景对象的第三颜色值之后,根据所述第一颜色值,第二颜色值和第三颜色值,估算第一光照条件下拍摄所述前景对象的第四颜色值,实现将将不同光照条件下的前景对象的颜色值统一到第一光照条件下,后续利用前景对象在第一光照条件下的第四颜色值对前景对象进行处理,例如检索或查询以及图像编辑等。与现有技术相比,该方案不必剥离图像的光照值,避免了对光照值进行估计,从而避免了光照估计过程中产生的误差,解决了现有技术中难以获得精确的光照估计值的问题,提高了图像处理的精确度。
本发明实施例的第二方面提供一种图像处理装置,该装置可以将不同光照条件下的对象颜色统一到“同一”参考光照条件下,具体实现中,该装置可以包括:获取模块,颜色值计算模块,以及处理模块,其中,获取模块获取第一光照条件下拍摄的参考图像中的参考背景对象的第一颜色值,获取第二光照条件下拍摄的待处理图像中的所述参考背景对象的第二颜色值和前景对象的第三颜色值;颜色值计算模块根据所述第一,第二和第三,计 算第一光照条件下拍摄所述前景对象的第四颜色值;处理模块利用所述第四颜色值对前景对象进行处理,例如检索或查询以及图像编辑等。与现有技术相比,该方案不必剥离图像的光照值,避免了对光照值进行估计,从而避免了光照估计过程中产生的误差,解决了现有技术中难以获得精确的光照估计值的问题,提高了图像处理的精确度。
基于上述的方法或装置,还可以提供其它一些可行的实施方式,例如:
可选的,记所述第一,第二和第三以及第四颜色值分别为S1,S2,S3,S4,则可以采用公式S4=S3-(S2-S1)计算第四颜色值。需要说明的是,S1,S2,S3,S4可以是对原始观测值取对数之后的对数值,且原始观测值可以是RGB值,也就是说,S1,S2,S3,S4可以为对数域上的RGB值。
可选的,可以预先设定一个参考图像,将参考图像的光照条件定义为第一光照条件,将待处理图像的光照条件定义为第二光照条件,则可以从所述参考图像中获取第一光照条件下参考背景对象的第一颜色值,从所述待处理图像中获取第二光照条件下所述参考背景对象的第二颜色值和前景对象的第三颜色值。
可选的,获取多张图像;获取所述多张图像中的一张图像作为所述参考图像;获取所述多张图像中除所述参考图像以外的任一张图像作为所述待处理图像;所述参考图像包括所述参考背景对象,所述待处理图像包括所述参考背景对象和所述前景对象。
可选的,可以根据所述多张图像的亮度值和/或拍摄时间,从所述多张图像中选择一张图像作为所述参考图像,例如将亮度值在设定的阈值范围内和/或拍摄时间在预设的时间范围内的一张图像设置为参考图像。
可选的,在所述多张图像来自于多个相机时,可以预先对所述多个相机的颜色进行校准;分别计算所述多个相机中除参考相机之外的每个相机与所述参考相机各自拍摄的图像中的参考背景对象的光照差异;从所述前景对象的第四颜色值中去除相应的光照差异,利用去除光照差异后的第四颜色值对所述前景对象进行处理。从而降低相机间的差异对图像处理的影响。
本发明实施例的第三方面还提供一种计算机设备,其特征在于,所述计算机设备包括处理器、存储器、总线和通信接口;所述存储器用于存储程序,所述处理器与所述存储器通过所述总线连接,当所述计算机设备运行时,所述处理器执行所述存储器存储的所述程序,以使所述计算机设备执行如上文所述的图像处理方法。
本发明实施例的第四方面还提供一种存储一个或多个程序的计算机可读存储介质,所述一个或多个程序包括指令,所述指令当被包括一个或多个处理器的计算机设备执行时,使所述计算机设备执行如上文所述的图像处理方法。
由上可见,在本发明实施例的一些可行的实施方式中,根据参考背景对象在第一和第二光照条件下的颜色值,以及前景对象在第二光照条件下的颜色值,来计算前景对象在第一光照条件下的颜色值,从而将待处理图像中的前景对象统一到第一光照条件下,后续可统一使用第一光照条件下前景对象的颜色值进行检索或查询等处理,相对于现有技术,不必剥离图像的光照值,解决了现有技术中难以获得精确的光照估计值的问题,提高了图像处理的精确度。
附图说明
为了更清楚地说明本发明实施例技术方案,下面将对实施例和现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其它的附图。
图1是本发明一个实施例提供的图像处理方法的流程示意图;
图2是本发明另一实施例提供的图像处理方法的流程示意图;
图3a和3b分别是处理前后的图像的示意图;
图4是本发明又一实施例提供的图像处理方法的流程示意图;
图5是本发明一个实施例提供的图像处理装置的结构示意图;
图6是本发明另一实施例提供的图像处理装置的结构示意图;
图7是本发明一个实施例提供的计算机设备的结构示意图。
具体实施方式
为了使本技术领域的人员更好地理解本发明方案,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分的实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都应当属于本发明保护的范围。
本发明的说明书和权利要求书及上述附图中的术语“第一”、“第二”、“第三”等是用于区别不同的对象,而不是用于描述特定顺序。此外,术语“包括”和“具有”以及它们任何变形,意图在于覆盖不排他的包含。例如包含了一系列步骤或单元的过程、方法、系统、产品或设备没有限定于已列出的步骤或单元,而是可选地还包括没有列出的步骤或单元,或可选地还包括对于这些过程、方法、产品或设备固有的其它步骤或单元。
本发明实施例技术方案应用人脸识别、虹膜识别和视频监控等各种涉及图像处理的计算机系统,该计算机系统可以包括:用于获取图像的图像采集单元,例如各种相机、摄像机、摄像模组等;用于存储图像的存储单元,例如只读存储器(英文全称:Read-Only Memory,英文简称:ROM)、随机存取存储器(英文全称:Random Access Memory,英文简称:RAM)、移动硬盘、磁碟或者光盘等;用于进行图像处理的处理单元,例如中央处理器(英文全称:Central Processing Unit,英文简称:CPU),或者特定集成电路(英文全称:Application Specific Integrated Circuit,英文简称:ASIC)等;用于显示图像的显示单元,例如阴极射线管显示器(英文全称:Cathode Ray Tube,英文简称:CRT),等离子显示器(英文全称:Plasma Display Panel,英文简称:PDP),液晶显示器(英文全称:Liquid Crystal Display,英文简称:LCD)等;和连接上述各个单元、用于上述各个单元之间相互通信的总线,例如工业标准体系结构(Industry Standard Architecture,简称为ISA)总线或外部设备互连(Peripheral Component,简称为PCI)总线或扩展工业标准体系结构(Extended Industry Standard Architecture,简称为EISA)总线等;以及通信接口等。
不同光照条件下拍摄的图像中,同一物理对象的颜色值会发生改变,进而影响以颜色 为主要特征进行查询检索的结果。本发明致力于解决此问题。
本发明实施例技术方案可用于这样的场景:在已给出的多张图像中,给定一张图像,将给定的图像中的前景对象作为查询目标,将该查询目标与其它图像中的前景对象进行匹配,判断是否是同一对象,以查询或检索出所有包含查询目标的图像。
请参考图3a,是以左上角第一张图像中的人像为查询目标,直接从多张图像中进行查询,查找包含该查询目标的图像的查询结果,查询结果显示,第一行的第一至第七共7张图像都包含该查询目标,或者说,这7张图像中的人像是同一人。然而,由于各张图像的颜色值受到光照值影响,查询结果难以找出包含查询目标的所有图像,假设多张图像中包含查询目标的图像共有15张,则查询命中率仅为7/15=47%。
本发明一个实施例提供的图像处理方法可包括:获取第一光照条件下拍摄的参考图像中的参考背景对象的第一颜色值;获取第二光照条件下拍摄的待处理图像中的所述参考背景对象的第二颜色值和前景对象的第三颜色值;根据所述第一颜色值,第二颜色值和第三颜色值,估算第一光照条件下拍摄所述前景对象的第四颜色值;利用所述第四颜色值对所述待处理图像中的所述前景对象进行处理,例如进行检索或查询。
由上,为了避免对光照值进行估计,并避免基于估计的光照值再估计图像的反射系数(固有色彩),从而避免光照估计过程中产生的误差,本发明实施例方案中,将不同光照条件下的对象颜色统一到“同一”参考光照条件即第一光照条件下,以获得对象在近似同一光照条件下的颜色值。
为此,本发明实施例假定可以获得光照较好情况下的参考背景对象的颜色值,通常情况下这是可能的。例如,对于视频监控应用,可在白天某时刻获得光照较好情况下的参考背景对象的颜色值。使用光照较好情况下的参考背景对象的颜色值作为先验信息,本文中将该光照较好情况下的光照条件称为第一光照条件。在光照均匀的情况下,可以利用不同光照条件下同一或同种参照背景对象的颜色值的差异,来计算前景对象在第一光照条件下的颜色值,将前景对象统一到第一光照条件下。
请参考图3b,是采用本发明实例方法将多张图像的前景对象统一到第一光照条件下后,以左上角第一张图像中的人像为查询目标,从多张图像中进行查询,查找同一人的图像的查询结果。查询结果显示,共找出15张包含查询目标的图像,如图3b中第一行的前15张图像,查询命中率为15/15=100%。
请参考图1,本发明一个实施例提供的图像处理方法的具体过程可包括:
110、获取第一光照条件下拍摄的参考图像中的参考背景对象的第一颜色值。
本发明实施例中,可以从包含参考背景对象的参考图像中,获取第一光照条件下参考背景对象的第一颜色值。所谓的第一光照条件,可以理解为拍摄参考图像的光照条件。本发明实施例中,可以在获取的需要进行处理的多张图像中,任选一张作为参考图像,将该参考图像的光照条件定义为第一光照条件。其中,获取的多张图像中应包括同一个或同一种参考背景对象,例如道路、树木、墙壁等,本文对于参考背景对象的具体类别不加限定。
本文中,将所述多张图像中除所述参考图像以外的图像称为待处理图像。可选的,步骤110之前还可以包括:获取多张图像;获取所述多张图像中的一张图像作为所述参考图像;获取所述多张图像中除所述参考图像以外的任一张图像作为所述待处理图像。
所说的第一颜色值,以及后文将提到的第二、第三或第四颜色值等,可简称为颜色值或色值,具体可以是指RGB值,RGB用英文表示就是R(red)、G(green)、B(blue)。RGB色彩模式是工业界的一种颜色标准,是通过对红(R)、绿(G)、蓝(B)三个颜色通道的变化以及它们相互之间的叠加来得到各式各样的颜色的,RGB即是代表红、绿、蓝三个通道的颜色,这个标准几乎包括了人类视力所能感知的所有颜色,是目前运用最广的颜色系统之一。RGB是指亮度,并使用整数来表示。通常情况下,R、G、B各有256级亮度,用数字表示为从0、1、2...直到255,共256级。
对一种颜色进行编码的方法统称为“颜色空间”或“色域”。任何一种颜色的“颜色空间”都可定义成一个固定的数字或变量。采用RGB这种编码方法,每种颜色都可用三个变量来表示-红色、绿色以及蓝色的亮度。可以采用多种RGB格式来表示一种颜色,例如一种格式称为RGB555,RGB555是一种16位的RGB格式,RGB的三个分量都用5位表示,剩下的1位不用;这样,图像中每个像素的颜色都可以用一个16位的二进制数字表示。实际应用中,不限于RGB555这种格式,也可以采用RGB565,RGB24,RGB32等格式,这里不再赘述。
为了提高图像处理的准确度,本文中可以选择光照条件较好情况下拍摄的图像作为参考图像。其中,光照条件较好可以理解为图像亮度值在设定的阈值范围内,和/或,拍摄时间在设定的时间范围内。一些实施例中,可以根据所述多张图像的亮度值和/或拍摄时间,例如,亮度值在4.5到5.5之间,且拍摄时间为上午,从所述多张图像中选择一张图像作为所述参考图像。其中,亮度值的单位可以是堪德拉每平米(cd/m2)。
120、获取第二光照条件下拍摄的待处理图像中的所述参考背景对象的第二颜色值和前景对象的第三颜色值。
本步骤中,具体可以从同时包含参考背景对象和前景对象的待处理图像中,获取第二光照条件下参考背景对象的第二颜色值和前景对象的第三颜色值。所谓的第二光照条件,可以理解为拍摄待处理图像的光照条件。所述待处理图像可以是指上一个步骤中获取的多张图像中,除了选定的参考图像以外的任一图像。
130、根据所述第一颜色值,第二颜色值和第三颜色值,估算第一光照条件下拍摄所述前景对象的第四颜色值。
记所述第一颜色值,第二颜色值和第三颜色值以及第四颜色值分别为S1,S2,S3,S4,则有S4=S3-(S2-S1);需要说明的是,这里的S1,S2,S3,S4是对原始观测值取对数之后的值。所述原始观测值可以是RGB值。也就是说,S1,S2,S3,S4为对数域上的RGB值,对数域上的RGB值具体是指对RGB值取对数得到的值。通过取对数,既符合人眼视觉特性,也起到数据压缩作用。
计算原理简单说明如下,根据参考背景对象分别在第一和第二光照条件下的颜色值S1,S2,可计算得到第一和第二光照条件下的光照值的差异为ΔS=(S2-S1);同理,可以得到ΔS=(S4-S3);则有ΔS=(S2-S1)=(S4-S3),可以计算得到S4=S3-(S2-S1)。于是,获得了前景对象在第一光照条件下的颜色值,实现了将第二光照条件下的前景对象的颜色统一到第一光照条件下。
基于该算法,可以计算得到任一张需要处理的图像中的前景对象在第一光照条件下的颜色值,实现了不同光照条件下的多张图像中的前景对象的颜色统一到第一光照条件下。
140、利用所述第四颜色值对所述前景对象进行处理。
本步骤中,就可以利用前景对象统一到第一光照条件下的颜色值来进行图像处理,包括检索或查询等等。例如图3b所示,可以从图3b所示的图像中选择一张清晰度较高的图像作为参考图像,将其它图像中的前景对象(具体为人像)的颜色值统一到拍摄该参考图像的第一光照条件下,利用各张图像的前景对象估算得到的第一光照条件下的颜色值进行检索或查询,其中,可将左上角第一张图像中的人像作为查询目标,将其它任一张图像中的人像与该查询目标进行匹配,判断是否是同一人,以查找包含该查找目标的所有图像,最终查询得到15张包含查询目标的图像,如图3b中第一行的前15张图像。
下面,对本方案的技术原理做进一步的介绍:
目前广泛应用的一个光照模型是Retinex数学模型,本发明技术原理在此模型基础上,并在假定可以获取第一光照条件L0下的参考背景对象的颜色值的情况下,推导出在第二光照条件L1下得到的前景对象在L0光照下的颜色值,其中,L0和L1的具体取值不需要知道。
Retinex模型如下:
s(x,y)=l(x,y)*r(x,y)    (1.1)
其中,s(x,y)为颜色值,l(x,y)为光照值,r(x,y)为对象的反射系数。
通过对(1)式两端取对数,并对符号简化,(1.1)式等价于
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)取对数之后的值。
在光照L0情况下,对于参考背景对象有下式成立
SBG,0=L0(x,y)+RBG(x,y)    (1.2.1)
其中,下标BG表示背景对象,下标0表示光照L0。
在新的光照L1情况下,对于背景对象有
SBG,1=L1(x,y)+RBG(x,y)    (1.2.2)
其中,下标BG表示背景对象,下标1表示光照L1。
此时,对于前景对象有
SFG,1=L1(x,y)+RFG(x,y)    (1.2.3)
其中,下标FG表示前景对象,下标1表示光照L1。
由(1.2.2)减去(1.2.1),可以得到
SBG,1-SBG,0=L1(x,y)-L0(x,y)
进而得到
L1(x,y)=L0(x,y)+(SBG,1-SBG,0),
将得到的L1(x,y)代入到式(1.2.3),则有
SFG,1=RFG(x,y)+L0(x,y)+(SBG,1-SBG,0)
进一步,可以得到
RFG(x,y)+L0(x,y)=SFG,1-(SBG,1-SBG,0)    (1.2.4)
公式(1.2.4)右端都是观测得到的颜色值,为已知。左端恰是前景对象在光照L0情况下的颜色值,可记为SFG,0
公式(1.2.4)也可写成SFG,0=SFG,1-(SBG,1-SBG,0)
可以理解,本发明实施例上述方案例如可以在计算机设备具体实施。该方案根据参考背景对象在第一和第二光照条件下的颜色值,以及前景对象在第二光照条件下的颜色值,来计算前景对象在第一光照条件下的颜色值,从而将待处理图像中的前景对象统一到第一光照条件下,后续可统一使用第一光照条件下前景对象的颜色值进行检索或查询等处理,相对于现有技术,不必剥离图像的光照值,解决了现有技术中难以获得精确的光照估计值的问题,提高了图像处理的精确度。
为便于更好的理解本发明实施例提供的技术方案,下面通过一个具体场景下的实施方式为例进行介绍。
请参考图2,本发明实施例的另一种图像处理方法。可包括:
210、获取多张图像,所述多张图像均包括参考背景对象。
本实施例方案操作处理的对象是一组有相同背景对象的图像集,包括多张图像,且多张图像均包括相同的背景对象,该相同的背景对象定义为参考背景对象。图像集中的多张图像可以是同一相机拍摄的,有着相同或相近的背景对象;也可以是不同相机拍摄的,不同相机之间拍摄的图像有着重叠区域,或者没有重叠区域,但具有相同的背景对象,比如同样材质的地面(如柏油马路)。
220、根据所述多张图像的亮度值和/或拍摄时间,从所述多张图像中选择一张设为所述参考图像。
可以根据所述多张图像的亮度值和/或拍摄时间,选定在光照强度较好情况下拍摄的一张图像,设为参考图像。例如可以认为亮度值在4.5到5.5之间,且拍摄时间为上午时,光照强度较好,拍摄的图像较为清晰,则可以选择这样的一张图像,设为参考图像。
选定参考图像中特定背景对象作为参考背景对象(SBG,0),该参考背景对象的选择要求是出现在前述待处理图像集的多张图像中。该参考背景对象对应的光照强度作为参考光照水平,即前文所述的第一光照条件L0。
230、获取参考图像和待处理图像。
将图像集中除参考图像外的其它图像定义为待处理图像,可以根据参考图像对任一待处理图像进行处理,包括如下步骤:
240、从所述参考图像中获取第一光照条件下参考背景对象的第一颜色值;从所述待处理图像中获取第二光照条件下所述参考背景对象的第二颜色值和前景对象的第三颜色值。
从参考图像中提取参考背景对象的颜色值SBG,0,对前述待处理的图像集中的每一张待处理图像,提取和参考背景对象相同的背景对象SBG,1以及希望恢复到参考光照水平的前景对象SFG,1。记所述第一颜色值,第二颜色值和第三颜色值分别为SBG,0,SBG,1,SFG,1
250、计算第一光照条件下所述前景对象的第四颜色值SFG,0
利用公式(1.2.4),可以得到SFG,0=SFG,1-(SBG,1-SBG,0)
或者,将第一,第二,第三以及第四颜色值分别记为S1,S2,S3,S4。则有S4=S3-(S2-S1)。
260、利用第四颜色值对待处理图像中的前景对象进行处理。
输入的计算结果—第四颜色值SFG,0,可用于后续的创建索引进行检索或查询等处理。例如,当前景对象为人时,希望从图像集中找出某个人的图像,则可以将图像集中各图像的前景对象的颜色值统一到参考光照水平下,然后利用参考光照水平下的颜色值进行人像检索或查询。请参考图3a,是未做上述图像处理的情况下以左上角第一幅图像作为查询对象得到的查询结果,如图中的线框所示,找出7张包含查询目标的图像,如图3a中第一行的前7张图像,但实际上,图片集合中共包括该查询对象的15张图像,因此,查询命中率为7/15=47%;请参考图3b,是先对所有图像进行上述图像处理,将所有图像都统一到同一个光照条件下之后,仍以左上角第一幅图像作为查询对象得到的查询结果,如图中的线框所示,找出15张包含查询目标的图像,如图3b中第一行的前15张图像,命中率为15/15=100%。
需要说明的是,一些实施例中可以根据第四颜色值对待处理图像中的前景对象进行颜色校正,将校正后的待处理图像显示出来;另一些实施例中,也可以仅仅将第四颜色值用来进行检索和查询,而不对前景对象进行颜色校正,且不显示校正后的待处理图像;是否显示可根据实际需要决定。
以上,如图2所示的实施例,对本发明实施例图像处理方法进行了进一步说明,其中,所处理的图像集中的多张图像可以是同一相机拍摄的,也可以是不同相机拍摄的,不同相机之间拍摄的图像可以有重叠区域;或者没有重叠区域,但具有同样的参考背景对象,比如同样材质的地面,如柏油马路。即,本发明实施例技术方案可以直接应用于跨摄像头的应用。
对于每一个相机拍摄的图像,可以选取光照较好的第一光照条件如L0的一张图像,设为参考图像,将每一相机拍摄的图像的前景对象都映射到L0下,也就是估算出在第一光照条件L0下的颜色值。为了下文描述方便,将这个过程,也就是上文中的步骤110~130描述的过程,或者,步骤210~250描述的过程,称作光照预处理。尽管不同相机选择了可能不同的参考光照水平,但由于都是相对较好的光照,对于很多应用,经过这样光照预处理后的图像可以基本符合查询或检索的需求。
但是,某些情况中相机之间的差异较大,对于多个相机拍摄的多张图像进行上述的光照预处理后,如果出现仍无法满足应用的情况,可以通过一些技术手段对不同相机拍摄的已经经过光照预处理的图像再次进行处理,将它们映射到近似相同的参考光照水平。以下实施例描述了一种技术方法以达到此目的。
请参考图4,一些实施例中,本发明实施例的图像处理方法可以包括:
410、相机间颜色校准。
可以在安装相机时,预先对多个相机的颜色进行校准。
420、相机间不同参考背景对象间对应的参考光照水平校准。
本步骤中,分别计算所述多个相机中除参考相机之外的每个相机与参考相机各自拍摄的图像中的参考背景对象的光照差异。在缺乏可公共参考的背景对象时,可以使用每一个相机对同一调色板的多个颜色进行拍照,同时对背景环境进行拍照。此时得到的调色板颜色的图像与背景对象的光照水平是一致的。可以使用每个相机拍摄得到的调色板颜色图像,来计算估计不同相机拍摄的参考背景对象之间的光照差异ΔL。为了避免大量的计算负担,可以选定某一相机作为比较标准,这里称作参考标准相机,计算所有其他相机拍摄的参考 背景对象与参考标准相机拍摄的参考背景对象之间的光照差异ΔSL。分别计算多个相机中的每个相机与参考相机各自拍摄的图像中的参考背景对象的光照差异ΔSL。
430、对每个相机拍摄的前景对象做光照预处理。
本步骤中对每一相机拍摄的图像,进行光照预处理操作。光照预处理的具体过程对应于上文中的步骤110~130描述的过程,或者,步骤210~250描述的过程,这里不再详细赘述。
440、对不同相机拍摄的光照预处理后前景对象做去除光照差异处理。
本步骤中,从每一张待处理图像的前景对象的第四颜色值中去除相应的光照差异,得到修正后的第四颜色值。也就是说,对得到的前景对象序列,去除光照差异ΔSL。注意,对于参考标准相机拍摄的图像序列,进行光照预处理步骤之后,不需要去除光照差异的步骤,因为自身之间不存在差异。去除光照差异后得到的图像序列可称作光照无差异估计图像序列。所得到的光照无差异估计图像序列即可用于应用中的查询检索。
450、利用前景对象的、经上述步骤处理后得到的颜色值进行检索或查询等处理。
本步骤中,利用上述步骤的输出结果图像进行图像查询检索,即,利用光照无差异估计图像序列的、修正后的第四颜色值进行检索或查询等处理。
需要说明的是,上述步骤440也可以在步骤430之前执行。
由上可见,在本发明的一些可行的实施方式中,提供了一种图像处理方法,根据参考背景对象在第一和第二光照条件下的颜色值,以及前景对象在第二光照条件下的颜色值,来计算前景对象在第一光照条件下的颜色值,从而将待处理图像中的前景对象统一到第一光照条件下,后续可统一使用第一光照条件下前景对象的颜色值进行检索或查询等处理,相对于现有技术,不必剥离图像的光照值,解决了现有技术中难以获得精确的光照估计值的问题,提高了图像处理的精确度。
为了更好的实施本发明实施例的上述方案,下面还提供用于配合实施上述方案的相关装置。
请参考图5,本发明实施例提供一种图像处理装置500,可包括:
获取模块510,用于获取第一光照条件下拍摄的参考图像中的参考背景对象的第一颜色值;获取第二光照条件下拍摄的待处理图像中的所述参考背景对象的第二颜色值和前景对象的第三颜色值;
颜色值计算模块520,用于根据所述第一颜色值,第二颜色值和第三颜色值,估算第一光照条件下拍摄所述前景对象的第四颜色值;
处理模块530,用于利用所述第四颜色值对所述前景对象进行处理。
其中,颜色值可简称为色值。
在一些实施例中,所述第一颜色值,第二颜色值和第三颜色值以及第四颜色值为RGB值或对数域上的RGB值。
在一些实施例中,所述颜色值计算模块520,具体用于采用以下公式计算所述第四颜色值:S4=S3-(S2-S1);其中,S1,S2,S3,S4分别为所述第一颜色值,第二颜色值和第三颜色值以及第四颜色值,且S1,S2,S3,S4为对数域上的RGB值。
请参考图6,在一些实施例中,所述获取模块510还用于:获取多张图像;获取所述多 张图像中的一张图像作为所述参考图像;获取所述多张图像中除所述参考图像以外的任一张图像作为所述待处理图像;所述参考图像包括所述参考背景对象,所述待处理图像包括所述参考背景对象和所述前景对象。
请参考图6,在一些实施例中,图像处理装置500还包括:设置模块540;
所述设置模块540,用于根据所述多张图像的亮度值和/或拍摄时间,从所述多张图像中选择一张图像作为所述参考图像。
请参考图6,在一些实施例中,图像处理装置500还包括:
校准模块550,用于预先对所述多个相机的颜色进行校准;
差异计算模块560,用于分别计算所述多个相机中除参考相机之外的每个相机与参考相机各自拍摄的图像中的所述参考背景对象的光照差异;
所述处理模块530,还用于从所述第四颜色值中去除相应的光照差异,利用去除光照差异后的第四颜色值对所述前景对象进行处理。
在一些实施例中,所述处理模块530,具体用于对所述前景对象进行检索或查询。
本发明实施例的图像处理装置例如可以是计算机设备。上述各个功能模块可以由计算机设备的处理器执行存储器中存储的程序来实现。
可以理解,本发明实施例的图像处理装置的各个功能模块的功能可根据上述方法实施例中的方法具体实现,其具体实现过程可参照上述方法实施例中的相关描述,此处不再赘述。
由上可见,在本发明的一些可行的实施方式中,提供了一种图像处理装置,根据参考背景对象在第一和第二光照条件下的颜色值,以及前景对象在第二光照条件下的颜色值,来计算前景对象在第一光照条件下的颜色值,从而将待处理图像中的前景对象统一到第一光照条件下,后续可统一使用第一光照条件下前景对象的颜色值进行检索或查询等处理,相对于现有技术,不必剥离图像的光照值,解决了现有技术中难以获得精确的光照估计值的问题,提高了图像处理的精确度。
请参考图7,本发明实施例还提供一种计算机设备700,可包括:
处理器710,存储器720,通信接口730,总线740;
所述处理器710,存储器720,通信接口730通过所述总线740连接并相互的通信;所述通信接口730,用于接收和发送数据;所述存储器720用于存储程序750;所述处理器710用于执行所述存储器中的所述程序750;当所述计算机设备700运行时,所述处理器710执行所述存储器720存储的所述程序750,以使所述计算机设备700执行如上文方法实施例所述的图像处理方法。
其中,处理器710可以执行以下步骤:获取第一光照条件下拍摄的参考图像中的参考背景对象的第一颜色值;获取第二光照条件下拍摄的待处理图像中的所述参考背景对象的第二颜色值和前景对象的第三颜色值;根据所述第一颜色值,第二颜色值和第三颜色值,估算第一光照条件下拍摄所述前景对象的第四颜色值;利用所述第四颜色值对所述前景对象进行处理。
所述总线740可以是工业标准体系结构(Industry Standard Architecture,简称为ISA) 总线或外部设备互连(Peripheral Component,简称为PCI)总线或扩展工业标准体系结构(Extended Industry Standard Architecture,简称为EISA)总线等。所述总线可以分为地址总线、数据总线、控制总线中的一种或多种。为便于表示,图中仅用一条粗线表示,但并不表示仅有一根总线或一种类型的总线。
所述存储器720可以包含高速RAM(Ramdom Access Memory)存储器。可选地,所述存储器720还可以还包括非易失性存储器(non-volatile memory)。例如所述存储器720可以包括磁盘存储器。
所述处理器710可以是一个中央处理器(Central Processing Unit,简称为CPU),或者所述处理器710可以是特定集成电路(Application Specific Integrated Circuit,简称为ASIC),或者所述处理器710可以是被配置成实施本发明实施例的一个或多个集成电路。
可以理解,本发明实施例的计算机设备的功能可根据上述方法实施例中的方法具体实现,其具体实现过程可参照上述方法实施例中的相关描述,此处不再赘述。该计算机设备通过实施上述方法实施例中的方法,可以取得上述方法实施例所能取得的技术效果。
(实施例三、)本发明实施例还提供一种存储一个或多个程序的计算机可读存储介质,所述一个或多个程序包括指令,所述指令当被包括一个或多个处理器的计算机设备执行时,使所述计算机设备执行如上文方法实施例所述的图像处理方法。
在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详细描述的部分,可以参见其它实施例的相关描述。
需要说明的是,对于前述的各方法实施例,为了简单描述,故将其都表述为一系列的动作组合,但是本领域技术人员应该知悉,本发明并不受所描述动作顺序的限制,因为依据本发明,某些步骤可以采用其它顺序或者同时进行。其次,本领域技术人员也应该知悉,说明书中所描述的实施例均属于优选实施例,所涉及的动作和模块并不一定是本发明所必须的。
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统,装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。
在本申请所提供的几个实施例中,应该理解到,所揭露的系统,装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。
作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。
另外,在本发明各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既 可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。
集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本发明各个实施例方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质。
以上对本发明实施例所提供的图像处理方法和装置进行了详细介绍,本文中应用了具体个例对本发明的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本发明的方法及其核心思想;同时,对于本领域的一般技术人员,依据本发明的思想,在具体实施方式及应用范围上均会有改变之处,综上所述,本说明书内容不应理解为对本发明的限制。

Claims (15)

  1. 一种图像处理方法,其特征在于,包括:
    获取第一光照条件下拍摄的参考图像中的参考背景对象的第一颜色值;
    获取第二光照条件下拍摄的待处理图像中的所述参考背景对象的第二颜色值和前景对象的第三颜色值;
    根据所述第一颜色值,第二颜色值和第三颜色值,估算第一光照条件下拍摄所述前景对象的第四颜色值;
    利用所述第四颜色值对所述前景对象进行处理。
  2. 根据权利要求1所述的方法,其特征在于,所述第一颜色值,第二颜色值和第三颜色值以及第四颜色值为RGB值或对数域上的RGB值。
  3. 根据权利要求2所述的方法,其特征在于,根据所述第一颜色值,第二颜色值和第三颜色值,估算第一光照条件下拍摄所述前景对象的第四颜色值包括:
    采用以下公式计算所述第四颜色值:
    S4=S3-(S2-S1);
    其中,S1,S2,S3,S4分别为所述第一颜色值,第二颜色值和第三颜色值以及第四颜色值,且S1,S2,S3,S4为对数域上的RGB值。
  4. 根据权利要求1所述的方法,其特征在于,所述获取第一光照条件下拍摄的参考图像中的参考背景对象的第一颜色值之前,还包括:
    获取多张图像;
    获取所述多张图像中的一张图像作为所述参考图像;
    获取所述多张图像中除所述参考图像以外的任一张图像作为所述待处理图像;
    所述参考图像包括所述参考背景对象,所述待处理图像包括所述参考背景对象和所述前景对象。
  5. 根据权利要求4所述的方法,其特征在于,所述获取所述多张图像中的一张图像作为所述参考图像包括:
    根据所述多张图像的亮度值和/或拍摄时间,从所述多张图像中选择一张图像作为所述参考图像。
  6. 根据权利要求4所述的方法,其特征在于,在所述多张图像来自于多个相机时,所述获取第一光照条件下拍摄的参考图像中的参考背景对象的第一颜色值之前,还包括:
    预先对所述多个相机的颜色进行校准;
    分别计算所述多个相机中除参考相机之外的每个相机与所述参考相机各自拍摄的图像中的所述参考背景对象的光照差异;
    所述利用所述第四颜色值对所述前景对象进行处理包括:
    从所述第四颜色值中去除相应的光照差异,利用去除光照差异后的第四颜色值对所述前景对象进行处理。
  7. 根据权利要求1-6任一所述的方法,其特征在于,所述对所述前景对象进行处理包括:
    对所述前景对象进行检索或查询。
  8. 一种图像处理装置,其特征在于,包括:
    获取模块,用于获取第一光照条件下拍摄的参考图像中的参考背景对象的第一颜色值;获取第二光照条件下拍摄的待处理图像中的所述参考背景对象的第二颜色值和前景对象的第三颜色值;
    颜色值计算模块,用于根据所述第一颜色值,第二颜色值和第三颜色值,估算第一光照条件下拍摄所述前景对象的第四颜色值;
    处理模块,用于利用所述第四颜色值对所述前景对象进行处理。
  9. 根据权利要求8所述的方法,其特征在于,所述第一颜色值,第二颜色值和第三颜色值以及第四颜色值为RGB值或对数域上的RGB值。
  10. 根据权利要求9所述的装置,其特征在于,
    所述颜色值计算模块,具体用于采用以下公式计算所述第四颜色值:
    S4=S3-(S2-S1);
    其中,S1,S2,S3,S4分别为所述第一颜色值,第二颜色值和第三颜色值以及第四颜色值,且S1,S2,S3,S4为对数域上的RGB值。
  11. 根据权利要求8所述的装置,其特征在于,
    所述获取模块还用于:获取多张图像;获取所述多张图像中的一张图像作为所述参考图像;获取所述多张图像中除所述参考图像以外的任一张图像作为所述待处理图像;所述参考图像包括所述参考背景对象,所述待处理图像包括所述参考背景对象和所述前景对象。
  12. 根据权利要求11所述的装置,其特征在于,还包括:
    设置模块,用于根据所述多张图像的亮度值和/或拍摄时间,从所述多张图像中选择一张图像作为所述参考图像。
  13. 根据权利要求11所述的装置,其特征在于,还包括:
    校准模块,用于预先对所述多个相机的颜色进行校准;
    差异计算模块,用于分别计算所述多个相机中除参考相机之外的每个相机与所述参考相机各自拍摄的图像中的所述参考背景对象的光照差异;
    所述处理模块,还用于从所述第四颜色值中去除相应的光照差异,利用去除光照差异后的第四颜色值对所述前景对象进行处理。
  14. 根据权利要求8-13任一所述的装置,其特征在于,
    所述处理模块,具体用于对所述前景对象进行检索或查询。
  15. 一种计算机设备,其特征在于,所述计算机设备包括处理器、存储器、总线和通信接口;
    所述存储器用于存储程序,所述处理器与所述存储器通过所述总线连接,当所述计算机设备运行时,所述处理器执行所述存储器存储的所述程序,以使所述计算机设备执行如权利要求1-7中任一项所述的图像处理方法。
PCT/CN2017/075781 2016-03-07 2017-03-06 图像处理方法和装置 WO2017152822A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201610128429.8 2016-03-07
CN201610128429.8A CN107169930A (zh) 2016-03-07 2016-03-07 图像处理方法和装置

Publications (1)

Publication Number Publication Date
WO2017152822A1 true WO2017152822A1 (zh) 2017-09-14

Family

ID=59788969

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/075781 WO2017152822A1 (zh) 2016-03-07 2017-03-06 图像处理方法和装置

Country Status (2)

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

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110610525A (zh) * 2018-06-15 2019-12-24 中兴通讯股份有限公司 一种图像处理的方法、装置及计算机可读存储介质
CN111861632A (zh) * 2020-06-05 2020-10-30 北京旷视科技有限公司 虚拟试妆方法、装置、电子设备及可读存储介质
CN113139953A (zh) * 2021-05-10 2021-07-20 宁波永新光学股份有限公司 检测识别图像中的颗粒污染物的方法及计算机可读存储介质
CN113436284A (zh) * 2021-07-30 2021-09-24 上海商汤智能科技有限公司 一种图像处理方法、装置、计算机设备和存储介质

Citations (4)

* 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
CN102542548A (zh) * 2011-12-30 2012-07-04 深圳市万兴软件有限公司 一种图像间颜色校正方法和装置
CN104200473A (zh) * 2014-09-02 2014-12-10 中航高科技发展有限公司 一种基于图像背景剪除的动态视觉测量方法
US20150371398A1 (en) * 2014-06-23 2015-12-24 Gang QIAO Method and system for updating background model based on depth

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2009153733A1 (en) * 2008-06-17 2009-12-23 Koninklijke Philips Electronics N.V. Color adjustment
US8824791B2 (en) * 2011-04-29 2014-09-02 International Business Machine Corporation Color correction for static cameras
US20150172513A1 (en) * 2013-12-18 2015-06-18 Nokia Corporation Methods And Apparatus For Color Balance Correction

Patent Citations (4)

* 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
CN102542548A (zh) * 2011-12-30 2012-07-04 深圳市万兴软件有限公司 一种图像间颜色校正方法和装置
US20150371398A1 (en) * 2014-06-23 2015-12-24 Gang QIAO Method and system for updating background model based on depth
CN104200473A (zh) * 2014-09-02 2014-12-10 中航高科技发展有限公司 一种基于图像背景剪除的动态视觉测量方法

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110610525A (zh) * 2018-06-15 2019-12-24 中兴通讯股份有限公司 一种图像处理的方法、装置及计算机可读存储介质
CN110610525B (zh) * 2018-06-15 2023-04-07 中兴通讯股份有限公司 一种图像处理的方法、装置及计算机可读存储介质
CN111861632A (zh) * 2020-06-05 2020-10-30 北京旷视科技有限公司 虚拟试妆方法、装置、电子设备及可读存储介质
CN111861632B (zh) * 2020-06-05 2023-06-30 北京旷视科技有限公司 虚拟试妆方法、装置、电子设备及可读存储介质
CN113139953A (zh) * 2021-05-10 2021-07-20 宁波永新光学股份有限公司 检测识别图像中的颗粒污染物的方法及计算机可读存储介质
CN113139953B (zh) * 2021-05-10 2022-11-04 宁波永新光学股份有限公司 检测识别图像中的颗粒污染物的方法及计算机可读存储介质
CN113436284A (zh) * 2021-07-30 2021-09-24 上海商汤智能科技有限公司 一种图像处理方法、装置、计算机设备和存储介质

Also Published As

Publication number Publication date
CN107169930A (zh) 2017-09-15

Similar Documents

Publication Publication Date Title
WO2017152822A1 (zh) 图像处理方法和装置
EP3542347B1 (en) Fast fourier color constancy
CN111182217B (zh) 一种图像白平衡的处理方法和装置
CN106611429B (zh) 检测皮肤区域的方法和检测皮肤区域的装置
US10165248B2 (en) Optimization method of image depth information and image processing apparatus
US9532036B2 (en) Stereo source image calibration method and apparatus
US7652717B2 (en) White balance correction in digital camera images
JP6579868B2 (ja) 画像処理装置、撮像装置、画像処理方法およびプログラム
CN107277479B (zh) 白平衡处理方法和装置
US11074742B2 (en) Image processing apparatus, image processing method, and storage medium
CN106960211B (zh) 关键帧获取方法及装置
WO2019011154A1 (zh) 白平衡处理方法和装置
JP2011070681A (ja) L1距離測度に基づいて局所画像相似性を測定する方法
EP1757083A1 (en) Identifying red eye in digital camera images
US9948913B2 (en) Image processing method and apparatus for processing an image pair
CN107909569B (zh) 一种花屏检测方法、花屏检测装置及电子设备
WO2022156129A1 (zh) 图像处理方法、图像处理装置及计算机设备
Faridul et al. Approximate cross channel color mapping from sparse color correspondences
CN110111341B (zh) 图像前景获取方法、装置及设备
CN115082350A (zh) 频闪图像处理方法、装置、电子设备和可读存储介质
US10630954B2 (en) Estimation of illumination chromaticity in automatic white balancing
CN107767350B (zh) 视频图像还原方法及装置
CN110827287B (zh) 确定背景色置信度和图像处理的方法、装置及设备
CN110266939B (zh) 显示方法及电子设备、存储介质
CN109543678B (zh) 敏感图像鉴别方法及装置

Legal Events

Date Code Title Description
NENP Non-entry into the national phase

Ref country code: DE

121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 17762508

Country of ref document: EP

Kind code of ref document: A1

122 Ep: pct application non-entry in european phase

Ref document number: 17762508

Country of ref document: EP

Kind code of ref document: A1