WO2018149253A1 - 图像处理的方法和设备 - Google Patents

图像处理的方法和设备 Download PDF

Info

Publication number
WO2018149253A1
WO2018149253A1 PCT/CN2018/071783 CN2018071783W WO2018149253A1 WO 2018149253 A1 WO2018149253 A1 WO 2018149253A1 CN 2018071783 W CN2018071783 W CN 2018071783W WO 2018149253 A1 WO2018149253 A1 WO 2018149253A1
Authority
WO
WIPO (PCT)
Prior art keywords
brightness
foreground
color system
sub
adjusted
Prior art date
Application number
PCT/CN2018/071783
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 WO2018149253A1 publication Critical patent/WO2018149253A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/90Dynamic range modification of images or parts thereof
    • G06T5/94Dynamic range modification of images or parts thereof based on local image properties, e.g. for local contrast enhancement
    • 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
    • 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
    • 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/20004Adaptive image processing
    • G06T2207/20012Locally adaptive

Definitions

  • the present application relates to the field of image processing and, more particularly, to methods and apparatus for image processing.
  • the image quality is affected by illumination.
  • image content analysis such as face recognition, iris recognition, image retrieval and video surveillance
  • external illumination tends to change the brightness of the image, which in turn changes the color of the image, which makes it difficult to obtain the target. , affecting the effectiveness of systems that rely on color for retrieval or identification.
  • the present application provides a method for processing an image, which can accurately acquire the brightness of the target object, reduce the difference in the color of the target object caused by the change in the brightness of the image, and further facilitate the retrieval or recognition of the target object.
  • a method of processing an image comprising: converting a target image from a red, green, and blue RGB space to a hue saturation luminance HSV space, wherein the target image includes a foreground portion and a background portion; Brightness and brightness of the foreground portion, determining a color system of the foreground portion; adjusting brightness of the foreground portion according to a color system of the foreground portion; converting the image from the HSV space to the adjusted brightness according to the foreground portion The RGB space.
  • the image processing apparatus determines the target image by converting the red, green, and blue RGB space to the hue saturation luminance HSV space, according to the brightness of the background portion of the target image and the brightness of the foreground portion of the target image. a color system of the foreground portion; adjusting the brightness of the foreground portion according to the color system of the foreground portion; and converting the target image for adjusting the brightness of the foreground portion from the HSV space to the RGB space.
  • Determining the color system of the foreground portion by combining the brightness of the background portion increases the condition for determining the color system of the foreground portion, improving the accuracy of determining the color system of the foreground portion, thereby adjusting the color system according to the color portion of the foreground portion
  • determining a color system of the foreground portion according to brightness of the background portion and brightness of the foreground portion including: determining, according to brightness of the background portion, the foreground portion a brightness correction coefficient; adjusting a brightness of the foreground portion according to the brightness correction coefficient of the foreground portion; determining a color system of the foreground portion according to the adjusted brightness of the foreground portion.
  • the foreground portion is mainly a target pedestrian image in the target image
  • the background portion is an image content of the target image other than the foreground portion.
  • the background portion may be divided into an entire background portion and a foot background portion.
  • the background portion of the foot can be proportionally selected as part of the background of the lower portion of the target image.
  • the illumination level of the background portion of the foot is closer to the foreground portion, which is advantageous for obtaining a more accurate brightness correction coefficient.
  • determining, according to brightness of the background portion, a brightness correction coefficient of the foreground portion comprising: determining the background portion according to a range of brightness of the background portion and a range of background brightness The range of the range of the background brightness to which the background brightness belongs is determined; the brightness correction coefficient corresponding to the range of the range of the background brightness to which the background portion belongs is the brightness correction coefficient of the foreground portion.
  • the brightness correction coefficient corresponding to the range of the background luminance to which the portion belongs is the brightness correction coefficient of the foreground portion.
  • the brightness correction coefficient corresponding to the range of the background luminance to which the portion belongs is the brightness correction coefficient of the foreground portion.
  • the brightness correction coefficient of the background portion is obtained by comparing the ratio of the background brightness under the illumination condition to the background brightness under the normal illumination condition, and the brightness coefficient reflects the brightness adjustment of the foreground image under the illumination condition. Adjusting the brightness of the foreground portion by the brightness correction coefficient corresponding to the background portion, so that the brightness of the foreground portion is closer to the brightness under normal illumination, and determining the color system of the foreground portion according to the adjusted brightness of the foreground portion, thereby improving The accuracy of determining the color system of the foreground portion is determined.
  • calculating a mean value of a brightness of the entire background portion and a brightness of the background portion of the foot determining an interval range of the background brightness to which the background portion belongs according to the average value; determining the entire background portion The range of the range of the background brightness to which the image is included; the brightness correction coefficient corresponding to the range of the range of the background brightness to which the entire background portion belongs is the brightness correction coefficient of the foreground portion.
  • determining the brightness correction coefficient of the foreground portion according to the brightness of the background portion comprising: calculating an average of brightness of a background portion of the plurality of images in the image storage database a value, the plurality of images being the same image as the image in the same captured scene; an average of the brightness of the background portion of the target image in which the foreground portion is located and the brightness of the background portion of the plurality of images in the image storage database The ratio is determined as the brightness correction factor for the foreground portion.
  • the brightness correction coefficient is a ratio of the brightness of the background portion to the brightness of the background portion of the plurality of images in the same captured scene, and the illumination is avoided by referring to the brightness of the background portion of the plurality of images in the same captured scene.
  • the brightness of the foreground portion is adjusted by the brightness correction coefficient corresponding to the background portion, so that the brightness of the foreground portion is closer to the brightness under normal illumination, and the brightness is adjusted according to the foreground portion.
  • the brightness determines the color system of the foreground portion, improving the accuracy of determining the color system of the foreground portion.
  • determining a color system of the foreground portion according to the adjusted brightness of the foreground portion comprising: comparing the adjusted brightness of the foreground portion with the brightness of the plurality of color systems Range, determines the color system of the foreground portion.
  • comparing the adjusted brightness of the foreground portion with the brightness range of the plurality of color systems determining a color system of the foreground portion, including: when the foreground portion is adjusted The brightness belongs to a brightness range of the first color system of the plurality of color systems, and when the absolute value of the difference from the threshold value of the brightness range of the first color system is less than the first threshold, according to the foreground portion in the HSV space Hue and saturation, determining a color system of the foreground portion; or when the adjusted brightness of the foreground portion belongs to a luminance range of a first color system of the plurality of color systems, and a brightness range of the first color system
  • the absolute value of the difference value of the threshold value is greater than or equal to the first threshold value
  • the first color system is determined as the color system of the foreground sub-portion.
  • the color system of the foreground portion is determined, thereby avoiding misjudging the color system of the foreground portion and causing image query failure.
  • comparing the adjusted brightness of the foreground portion with the brightness range of the plurality of color systems determining a color system of the foreground portion, including: when the foreground portion is adjusted The brightness belongs to the brightness range of the first color system of the plurality of color systems, and when the absolute value of the difference from the threshold value of the brightness range of the first color system is less than the first threshold, the foreground sub-section can be made two
  • the class processing processes the foreground sub-portion as a first color system and a second color system, respectively, wherein the second color system is adjacent to the first color system.
  • determining the color system of the foreground portion according to the brightness of the background portion and the brightness of the foreground portion comprises: dividing the foreground portion into a plurality of foreground sub-portions; Adjusting the brightness of each foreground sub-portion of the plurality of foreground sub-portions according to the brightness of the background portion; determining a color system of each foreground sub-portion according to the adjusted brightness of each foreground sub-portion; The adjusted brightness of the foreground portion, determining the color system of the foreground portion includes adjusting the brightness of each foreground sub-portion based on the color system of each foreground sub-portion.
  • each foreground sub-portion is adjusted by accurately determining the color system of each of the plurality of foreground sub-portions and the color system of each of the plurality of foreground sub-portions.
  • the multiple foreground sub-portions include a first foreground sub-portion and a second foreground sub-portion, the first foreground sub-portion adjusted brightness and the second foreground sub-portion
  • the partially adjusted brightness belongs to the brightness range of the first color system, and the absolute value of the difference between the adjusted brightness of the first foreground sub-portion and the threshold value of the brightness range of the first color system is greater than or equal to a second threshold.
  • the difference between the brightness of the adjusted foreground portion and the threshold of the brightness range of the first color system is less than the second threshold;
  • Determining the color system of each foreground sub-portion according to the adjusted brightness of each foreground sub-portion includes:
  • the absolute value of the difference between the adjusted brightness of the second foreground sub-portion and the adjusted brightness of the first foreground sub-portion is greater than or equal to a third threshold, according to the hue and saturation of the second foreground sub-portion in the HSV space Degree, determining a color system of the second foreground sub-portion; or, when the absolute value of the difference between the adjusted brightness of the second foreground sub-portion and the adjusted brightness of the first foreground sub-portion is greater than or equal to a third threshold, Determining a color system corresponding to a range adjacent to the brightness adjusted by the second foreground sub-section as a color system of the second foreground sub-section; or, when the second foreground sub-portion is adjusted in brightness and the second foreground sub-portion When the absolute value of the difference in luminance is less than the third threshold, the first color system is determined as the color system of the second foreground sub-portion.
  • the adjusted brightness of the first foreground sub-portion may be any one of the first foreground sub-parts.
  • determining a color system of the foreground portion according to brightness of the background portion and brightness of the foreground portion including: tone, saturation, and brightness of the foreground portion and The brightness of the background image is input to a parameter model, and a tag value output by the parameter model is obtained, wherein the parameter model is used to indicate a tag value of the plurality of color systems and a hue of the foreground portion in the captured scene of the target image.
  • the parameter model is used to indicate a tag value of the plurality of color systems and a hue of the foreground portion in the captured scene of the target image.
  • Correspondence between saturation and brightness and brightness of the background portion determining the color system of the foreground portion based on the tag value of the output of the parametric model.
  • the method before the color tone, saturation, and brightness of the foreground portion and the brightness of the background portion are input into the parameter model, the method further includes: according to the plurality of color systems Performing algorithmic training on the color value, saturation, and brightness of the label value set in each color system and the foreground portion of the plurality of images in the image storage database, and the brightness of the background portion in each image, determining the parameter model, The plurality of images are the same captured image as the target image.
  • the brightness of the foreground portion is adjusted to the brightness in the brightness set corresponding to the color system of the foreground portion.
  • the color system is one of a dark color system, a colored color system, and a white light color system, wherein the element in the brightness set corresponding to the dark color system is a; the brightness set corresponding to the colored color system is greater than a brightness range equal to b and less than or equal to c; the element in the brightness set corresponding to the white light color is d,
  • the a, b, c, and d are all constants.
  • a method for processing an image includes: converting a target image from a red, green, and blue RGB space to a hue saturation luminance HSV space; and when the brightness of the target image belongs to a first color system of the plurality of color systems a brightness range, and when the absolute value of the difference from the threshold value of the brightness range of the first color system is less than the first threshold, determining the color system of the foreground portion according to the hue and saturation of the target image in the HSV space; Adjusting the brightness of the target image according to the color system of the target image; converting the target image from the HSV space to the RGB space according to the adjusted brightness of the target image.
  • a third aspect provides a method for processing an avatar, comprising: converting a target image from a red, green, and blue RGB space to a hue saturation luminance HSV space, the target image including a first portion and a second portion;
  • the brightness of the first portion and the brightness of the second portion belong to a brightness range of the first color system, and the absolute value of the difference between the brightness of the first portion and the threshold value of the brightness range of the first color system is greater than or equal to a first threshold, an absolute value of a difference between a brightness of the second portion and a threshold value of a brightness range of the first color system is less than the first threshold, and determining a first color system as a color system of the first portion ;
  • the image is converted from the HSV space to the RGB space based on the adjusted brightness of the target image.
  • a fourth aspect provides an image processing apparatus, including a conversion module, a first processing module, and an adjustment module, which may perform the method in any of the foregoing first aspect or the first aspect of the first aspect.
  • the fifth aspect provides an image processing device, including a conversion module, a first processing module, and an adjustment module, which can perform the method in any of the foregoing possible implementation manners of the second aspect or the second aspect.
  • the sixth aspect provides an image processing device, including a conversion module, a first processing module, and an adjustment module, which can perform the method in any one of the foregoing third aspect or the third aspect.
  • an image processing apparatus comprising a memory, a transceiver and a processor having stored thereon program code for indicating execution of the first or any optional implementation thereof, the transceiver for The specific signal transceiving is performed under the driving of the processor, and when the code is executed, the processor can implement the method in which the terminal device performs various operations.
  • an image processing apparatus comprising a memory, a transceiver and a processor having stored thereon program code for indicating execution of the second or any optional implementation thereof, the transceiver for The specific signal transceiving is performed under the driving of the processor, and when the code is executed, the processor can implement the method in which the terminal device performs various operations.
  • an image processing apparatus comprising a memory, a transceiver and a processor having stored thereon program code for indicating execution of the third or any optional implementation thereof, the transceiver for The specific signal transceiving is performed under the driving of the processor, and when the code is executed, the processor can implement the method in which the terminal device performs various operations.
  • a tenth aspect a computer readable medium for storing a computer program, the computer program comprising any one of the possible implementations of the first aspect or the first aspect, the second aspect or the second aspect Any of the possible implementations of the third aspect or the method of the method of any of the possible implementations of the third aspect.
  • FIG. 1 is a schematic diagram of an image processing system using the present application.
  • FIG. 2 is a schematic flow chart of a method of image processing according to the present application.
  • FIG. 3 is a schematic diagram of a luminance mapping interval in accordance with the present application.
  • FIG. 4 is a schematic flow chart of a method of image processing according to the present application.
  • FIG. 5 is a schematic flow chart of a method of image processing according to the present application.
  • FIG. 6 is a schematic block diagram of an image processing apparatus according to the present application.
  • FIG. 7 is a schematic block diagram of an image processing apparatus according to the present application.
  • FIG. 8 is a schematic block diagram of an image processing apparatus according to the present application.
  • the image processing system 100 includes a server 110, a client 120, a transmission device 130, an image processing device 140, and a storage device 150.
  • the server 110 stores a picture that needs to be processed by an image
  • the client 120 is configured to send a retrieval request to the image processing device 140
  • the transmission device 130 is used by the client 120 and the image processing device 140, or the client 120.
  • the transmission device can be a switch.
  • the storage device 150 is for storing image processed images.
  • the image processing device 140 is mainly configured to process the brightness of the image, store the processed image in the storage device 140, and receive the retrieval request of the client 120 to retrieve the processed image in the storage device. The retrieved result is returned to the client 120.
  • the image processing device 140 may be a video content manager.
  • FIG. 2 is a schematic flow diagram of a method 200 of processing an image in accordance with the present application. As shown in FIG. 2, the method 200 includes the following.
  • the image processing device converts the target image from a red, green, and blue RGB space to a hue saturation luminance HSV space, wherein the target image includes a foreground portion and a background portion.
  • the color display of the computer color display adopts the principle of R, G, and B color mixing, and the red, green, and blue phosphor materials covered on the inner side of the screen are illuminated to emit colors by emitting electron beams of three different intensities.
  • RGB color space representation where R is red, G is green, and Blue is blue.
  • HSV Hue Saturation Value
  • the foreground portion is mainly a target pedestrian image in the target image
  • the background portion is image content other than the foreground portion of the target image, for example, a ground, a building, and the like in the target image.
  • the background portion may be all image content in the image except the foreground portion, and the background portion may also be part of the image content in the image except the foreground portion.
  • the background portion includes information on the brightness of the illumination in the target image capture scene. In some cases, the illumination level of the image of the portion of the background portion is closer to the foreground portion.
  • the background portion of the foot can be selected as a reference to adjust the brightness of the foreground portion.
  • the background portion of the foot can select a portion of the lower portion of the target image in proportion, for example, 15% to 20% of the lower portion of the target image is selected as the background portion of the foot of the target image.
  • a color system of the foreground portion is determined based on the brightness of the background portion and the brightness of the foreground portion.
  • the color can be divided into different colors according to the regular characteristics of hue, saturation and brightness of different colors, and the variations of hue, saturation and brightness of different colors in the same color are consistent, therefore, according to the color Adjust the brightness of the target object.
  • the color is divided into three color systems, which are dark, colored, and white.
  • the dark color refers to colors such as black, black ash, navy, and black, and their similar colors.
  • One of the main features of the image belonging to the dark color is that the image remains unchanged or has little change in H (or In the case where the light intensity is not excessive, the range of V variation is small, and the value of V is also small, for example, the value of V is from 0.02 to 0.18.
  • Colored colors refer to colors such as red, orange, yellow, green, cyan, blue, and purple, and their similar colors.
  • One of the main features of images belonging to colored systems is that the image remains unchanged or changes very much in H. In small cases, the V value varies widely, and the value of V can be smaller or larger, for example, V is from 0.2 to 0.8.
  • White bright color refers to white or similar color.
  • One of the main features of the image that belongs to white bright color is that the V component has a small variation range (relatively colored) when the H value remains unchanged or the change is small. For color systems, but the V value is large, for example, V is from 0.7 to 0.9.
  • determining a brightness correction coefficient of the foreground portion according to brightness of the background portion adjusting brightness of the foreground portion according to the brightness correction coefficient of the foreground portion; determining the foreground portion according to the adjusted brightness of the foreground portion Color system.
  • the brightness V of the background portion is divided into five ranges, which are dark, dark, normal, brighter, and brighter, each of the five ranges.
  • a brightness correction factor as shown in Table 1.
  • the brightness correction coefficient is used to adjust the brightness of the foreground portion of the target image to which the background portion belongs to be closer to the V value of the normal illumination condition. For example, if the current background portion V value is 0.4, the background portion brightness is judged to be dark according to Table 1, and the corresponding illumination coefficient is 1.4. If the brightness of the current foreground portion is V0, it is adjusted to 1.4*V0.
  • calculating an average value of brightness of a background portion of the plurality of images in the image storage database the plurality of images being the same image as the target image in the captured scene; according to the target in which the foreground portion is located
  • a brightness correction coefficient of the foreground portion is determined by an average of brightness of the background portion of the image and brightness of a background portion of the plurality of images in the image storage database.
  • the same captured scene is in a physical environment in which the target person is located.
  • the target person takes a plurality of photos under an intersection or the target person takes a plurality of photos at the entrance of the mall.
  • Calculating an average value of the background brightness of the plurality of images in the image storage database for example, an average value of the background brightness of the plurality of images is 0.491, and then calculating a ratio of the background brightness of the target image to an average value of the background brightness of 0.491, the calculation The result is the brightness correction factor of the target image.
  • comparing the adjusted brightness of the foreground portion with the brightness range of the plurality of color systems determining a color system of the foreground portion.
  • the adjusted brightness of the foreground portion belongs to a brightness range of the first color system of the plurality of color systems, and the absolute value of the difference from the threshold value of the brightness range of the first color system is smaller than the first a threshold value, determining a color system of the foreground portion according to a hue and saturation of the foreground portion in the HSV space; or
  • the adjusted brightness of the foreground portion belongs to a brightness range of a first color system of the plurality of color systems, and an absolute value of a difference value from a threshold value of the brightness range of the first color system is greater than or equal to the first At a threshold, the first color system is determined to be the color system of the foreground sub-portion.
  • the color system of the foreground portion is determined based on the V value of the adjusted foreground portion.
  • the V value In general, for dark shades, under normal illumination, the V value is no greater than 0.18. In dark or darker lighting, the V value is likely to be less than 0.10.
  • the V values mentioned here are all normalized values. For non-black systems, the V value is usually greater than 0.23 under normal illumination. However, under dark or darker illumination, the V value may also be less than 0.16, or even smaller, less than 0.10.
  • the determination of the two colors of blue (colored) and black (dark) will be described below as an example.
  • the target object is the foreground part
  • the HSV value and the background brightness of the target person are obtained, and the data listed in Table 2 is obtained.
  • R, G, B, H, S, and V respectively represent the R, G of the foreground part.
  • B, H, S, and V values, V1 and V2 are the brightness of the background portion corresponding to the foreground portion and the brightness of the background portion of the foot corresponding to the foreground portion, respectively.
  • the brightness correction coefficient of the foreground portion of each image is determined according to the relationship of Table 1 in accordance with the brightness of the background portion V1 of each image.
  • the brightness correction coefficient of the foreground portion of each image is determined according to the relationship of Table 1 in accordance with the brightness of the background portion V2 of each image.
  • the mean value V of the background portions V1 and V2 of each image is calculated, and according to V, the brightness correction coefficient of the foreground portion of each image is determined according to the relationship of Table 1.
  • the brightness correction coefficient of the foreground portion of each image is determined in accordance with the relationship of Table 1 according to the brightness of the background portion V1 of each image.
  • the brightness correction coefficient of the foreground portion of each image is determined, and the brightness correction coefficient of the foreground portion of each image is pre-adjusted according to the determined brightness correction coefficient of the foreground portion of each image.
  • the pre-adjusted brightness of the foreground portion of each image is shown in Table 3.
  • the adjusted brightness of the foreground portion belongs to a brightness range of the first color system of the plurality of color systems, and the absolute value of the difference from the threshold value of the brightness range of the first color system is smaller than the first a threshold value, determining a color system of the foreground portion according to a hue and saturation of the foreground portion in the HSV space; or
  • the adjusted brightness of the foreground portion belongs to a brightness range of a first color system of the plurality of color systems, and an absolute value of a difference value from a threshold value of the brightness range of the first color system is greater than or equal to the first At a threshold, the first color system is determined to be the color system of the foreground sub-portion.
  • the threshold value of the brightness of the dark color system is 0.18, and the first threshold value is 0.01.
  • the difference between the threshold values of the brightness of the images V1, V2, V4, V8, V9, and V10 and the dark color system is greater than 0.01, so the images V1, V2, V4, V8, V9 and V10 belong to the dark color system, and the difference between the threshold values of the brightness of the pictures V3, V5 and V7 and the dark color system is less than 0.01, which is required according to the foreground portion
  • the hue and saturation of the HSV space determines the color system of the foreground portion.
  • the adjusting the brightness of the foreground portion according to the color system of the foreground portion comprises: adjusting a brightness of each of the foreground sub-portions according to a color system of each of the foreground sub-portions.
  • the foreground portion may divide the foreground portion into a plurality of sub-foreground portions by a method such as automatic or artificially generated semi-structured data (Extensible Markup Language, XML).
  • a method such as automatic or artificially generated semi-structured data (Extensible Markup Language, XML).
  • the plurality of foreground sub-portions include a first foreground sub-portion and a second foreground sub-portion, wherein the adjusted brightness of the first foreground sub-portion and the adjusted brightness of the second foreground sub-portion belong to the first color system a brightness range, an absolute value of a difference between the adjusted brightness of the first foreground sub-portion and a threshold value of the brightness range of the first color system is greater than or equal to a second threshold, and the second foreground sub-portion adjusted brightness and the first The absolute value of the difference value of the threshold value of the brightness range of the one color system is smaller than the second threshold value;
  • Determining the color system of each foreground sub-portion according to the adjusted brightness of each foreground sub-portion includes:
  • the absolute value of the difference between the adjusted brightness of the second foreground sub-portion and the adjusted brightness of the first foreground sub-portion is greater than or equal to a third threshold, according to the hue and saturation of the second foreground sub-portion in the HSV space Degree, determining a color system of the second foreground sub-portion; or, when the absolute value of the difference between the adjusted brightness of the second foreground sub-portion and the adjusted brightness of the first foreground sub-portion is greater than or equal to a third threshold, Determining a color system corresponding to a range adjacent to the brightness adjusted by the second foreground sub-section as a color system of the second foreground sub-section; or, when the second foreground sub-portion is adjusted in brightness and the second foreground sub-portion When the absolute value of the difference in luminance is less than the third threshold, the first color system is determined as the color system of the second foreground sub-portion.
  • the brightness of the second foreground sub-portion is adjusted.
  • the color system corresponding to the range of the neighbor is determined as the color system of the second foreground sub-portion.
  • the first color system is adjacent to the second color system, and the absolute value of the difference between the adjusted brightness of the second foreground sub-portion and the threshold value of the brightness range of the first color system is less than the second threshold, and the second foreground When the absolute value of the difference between the adjusted brightness of the sub-portion and the adjusted brightness of the first foreground sub-portion is greater than or equal to the third threshold, the second foreground sub-portion is determined to be the second color system.
  • the first color system When the first color system is adjacent to the second color system and the third color system respectively, that is, the first color system is in the middle of the second color system and the third color system, wherein the brightness of the second color system is smaller than the The brightness of the first color system, the brightness of the first color system is less than the brightness of the third color system, the first color system has two critical values, respectively being a first critical value and a second critical value, the first critical The value is adjacent to the second color system, the second threshold being adjacent to the third color system.
  • the adjusted brightness of the first foreground sub-portion and the adjusted brightness of the second foreground sub-portion belong to the brightness range of the first color system
  • the adjusted brightness of the first foreground sub-section and the brightness range of the first color system The absolute value of the difference value of the first threshold value is greater than or equal to the second threshold value, and the absolute value of the difference between the adjusted brightness of the second foreground sub-portion and the threshold value of the brightness range of the first color system is less than the second threshold Determining a first color system as a color system of the first foreground sub-portion; and an absolute value of a difference between the adjusted brightness of the second foreground sub-portion and the adjusted brightness of the first foreground sub-portion is greater than or equal to a third a threshold, the color system corresponding to the range adjacent to the brightness adjusted by the second foreground sub-section, that is, the second color system is determined as the color system of the second foreground sub-section; or, when the second foreground sub-section is adjusted When the absolute value of
  • the adjusted brightness of the first foreground sub-portion and the adjusted brightness of the second foreground sub-portion belong to the brightness range of the first color system
  • the adjusted brightness of the first foreground sub-section and the brightness range of the first color system The absolute value of the difference value of the second threshold value is greater than or equal to the second threshold value, and the absolute value of the difference between the adjusted brightness of the second foreground sub-portion and the threshold value of the brightness range of the first color system is less than the second threshold Determining a first color system as a color system of the first foreground sub-portion; and an absolute value of a difference between the adjusted brightness of the second foreground sub-portion and the adjusted brightness of the first foreground sub-portion is greater than or equal to a third a threshold value, the color system corresponding to the range adjacent to the brightness adjusted by the second foreground sub-section, that is, the third color system is determined as the color system of the second foreground sub-section; or, when the second foreground sub-section is adjusted When the absolute value
  • the target person is a foreground part, and the target person is divided into an upper body and a lower body, and an upper body and a lower body HSV value and a background brightness value of the target person are obtained, and data listed in Table 4 is obtained, and R1, G1, B1 in Table 2 are obtained.
  • H1, S1, V1, R2, G2, B2, H2, S2, and V2 are the R, G, B, H, S, and V values of the upper and lower body of the foreground portion, respectively
  • V1 and V2 are the backgrounds corresponding to the foreground portion, respectively.
  • the brightness of the portion corresponds to the brightness of the background portion of the foot corresponding to the foreground portion.
  • the brightness correction coefficients of the upper body and the lower body of the foreground portion of each image are determined according to the relationship of Table 1 according to the brightness of the background portion V1 of each image.
  • the brightness correction coefficients of the upper and lower body portions of the foreground portion of each image are determined according to the relationship of Table 1 according to the brightness of the background portion V2 of each image.
  • the mean value V of the background portions V1 and V2 of each image is calculated, and according to V, the brightness correction coefficients of the upper body and the lower body of the foreground portion of each image are determined according to the relationship of Table 1.
  • the brightness correction coefficients of the upper body and the lower body of the foreground portion of each image are determined in accordance with the relationship of Table 1 according to the brightness of the background portion V1 of each image.
  • the brightness correction coefficients of the upper body and the lower body of the foreground portion of each image are determined, and the brightness correction coefficients of the upper body and the lower body of the foreground portion of each image are determined according to the determined , pre-adjusting the brightness of the upper body and the lower body of the foreground portion of each image.
  • the pre-adjusted brightness of the upper and lower body of the foreground portion of each image is shown in Table 5.
  • the pre-adjusted brightness values of the upper and lower body of the foreground portion of each image For example, comparing the pre-adjusted brightness values of the upper and lower body of the foreground portion of each image with 0.18, it can be judged that the lower body of the 10 images belongs to the dark color, and pictures 1, 2, 4, 5, 8, 9, and 10
  • the upper part of the foreground portion is colored, and the upper body brightness of the foreground portions of pictures 3, 6, and 7 is at a critical value, which requires further judgment.
  • the judgment can be made in conjunction with the corresponding lower body. Because the illumination environment of the upper and lower body is generally similar, and the brightness value of the lower body is judged as dark color and the adjusted brightness value is still small, under the same illumination, the brightness values of the target images of the same color system may not differ too much.
  • the upper body of the foreground portion may be classified into two, that is, it is determined to be both a dark color and a colored color, and then The two colors are processed separately to avoid misjudgment caused by processing errors, resulting in subsequent query or retrieval failure.
  • the absolute value of the difference between the adjusted brightness of the second foreground sub-portion and the threshold value of the brightness range of the first color system is smaller than the first threshold
  • the target image to which the second foreground sub-section belongs includes a first foreground sub-portion
  • the adjusted brightness of the plurality of first foreground sub-portions and the brightness adjusted by the second foreground sub-portion belong to a brightness range of the first color system
  • the plurality of first foreground sub-sections are adjusted
  • the absolute value of the difference between the brightness of the first color sub-portion and the brightness of the second foreground sub-portion may be greater than or equal to the first threshold.
  • a relationship with the second threshold determines a color system of the second foreground sub-portion.
  • determining, according to a relationship between a difference between the adjusted brightness of the foreground sub-portion and the brightness of the second foreground sub-portion and the second threshold determining the second foreground sub-portion a color system, when the absolute value of the difference between the adjusted brightness of the second foreground sub-portion and the brightness of the foreground sub-portion of the plurality of first foreground sub-portions is greater than or equal to a second threshold,
  • the color system corresponding to the range adjacent to the brightness adjusted by the second foreground sub-section is determined to be the color system of the second foreground sub-section; or, when the second foreground sub-portion is adjusted, the brightness and the plurality of first foreground
  • the first color system is determined as the color system of the second foreground sub-portion.
  • the plurality of first foreground sub-portions are respectively the first foreground sub-portion 1, the first foreground sub-portion 2, and the first foreground sub-portion 3, and the adjusted foreground brightness and the second foreground may be according to the first foreground sub-portion 1
  • the relationship between the difference in luminance of the sub-portions and the second threshold determines the color system of the second foreground sub-portion.
  • the range of brightness adjacent to the second foreground sub-portion is adjacent
  • Corresponding color system is determined as the color system of the second foreground sub-portion; or, the absolute value of the adjusted brightness of the second foreground sub-portion and the adjusted brightness difference of the first foreground sub-portion 1 is smaller than the second
  • the first color system is determined to be the color system of the second foreground sub-portion.
  • the color system of the second foreground sub-portion may also be determined according to the relationship between the difference between the adjusted brightness of the first foreground sub-section 2 or the first foreground sub-section 3 and the brightness of the second foreground sub-portion and the second threshold.
  • the second is determined according to a relationship between an average value of a difference between the adjusted brightness of each of the plurality of first foreground sub-portions and the brightness of the second foreground sub-portion and a second threshold.
  • a color system of the foreground sub-section wherein an absolute value of a difference between a brightness of the adjusted second foreground sub-portion and a brightness of each foreground sub-portion of the plurality of first foreground sub-portions is greater than or equal to a second threshold value, the color system corresponding to the range adjacent to the brightness adjusted by the second foreground sub-portion is determined as the color system of the second foreground sub-portion; or, when the second foreground sub-portion is adjusted, the brightness is The first color system is determined as the color system of the second foreground sub-portion when the average value of the brightness difference after the brightness adjustment of each of the plurality of first foreground sub-portions is less than the second threshold.
  • the plurality of first foreground subsections are a first foreground subsection 1, a first foreground subsection 2, and a first foreground subsection 3, respectively, the first foreground subsection 1, the first foreground subsection 2, and the first An average of the difference between the brightness of the foreground sub-portion 3 and the second foreground sub-portion, comparing the relationship between the absolute value of the difference and the second threshold, and determining the color system of the second foreground sub-portion.
  • determining a color system of the second foreground sub-portion according to a relationship between a difference between an average value of the adjusted brightness of the plurality of first foreground sub-portions and a brightness of the second foreground sub-portion and a second threshold value, Adjusting the brightness of the second foreground sub-portion when the absolute value of the difference between the adjusted brightness of the second foreground sub-portion and the average brightness of the plurality of first foreground sub-portions is greater than or equal to a second threshold
  • the color system corresponding to the range of the neighbor is determined as the color system of the second foreground sub-portion; or, the difference between the adjusted brightness of the second foreground sub-portion and the average brightness of the plurality of first foreground sub-portions
  • the first color system is determined to be the color system of the second foreground sub-portion.
  • the plurality of first foreground sub-portions are a first foreground sub-portion 1, a first foreground sub-portion 2, and a first foreground sub-portion 3, respectively, and the first foreground sub-portion is calculated as a first foreground sub-portion 1, respectively
  • a color system of the second foreground sub-portion is determined according to a relationship between a difference between the average luminance and a luminance of the second foreground sub-portion and a second threshold.
  • the foreground sub-portion may be divided into a plurality of sub-foreground portions, and dividing the foreground portion into the first foreground sub-portion and the second foreground sub-portion in the present application are merely examples and are not limiting.
  • the adjusted foreground sub-section may be determined according to the hue and saturation of the foreground sub-portion in the HSV space.
  • the brightness is in the color system of the foreground sub-portion near the critical value of the brightness of one color system.
  • the color system of the foreground portion is determined based on the hue H and the saturation S of the foreground portion.
  • the color system of the foreground portion can be determined based on the hue H and the saturation S of the foreground portion.
  • red is taken as an example for detailed description.
  • the parameters of the red target image in RGB space and HSV space under different illumination in the colored system are listed in Table 5.
  • the hue H and the saturation S of the red image have a specific law, that is, the value of V is different, but H is in the interval [0.9, 1], and correspondingly S is also in the interval [0.9, 1].
  • the foreground portions of the six target images all satisfy the combined relationship of H and S of the red color system, and therefore the foreground portions of the six target images in Table 6 are determined to belong to the colored color system.
  • calculating an average value of brightness of a background portion of the plurality of images in the image storage database the plurality of images being the same image as the image in the captured scene; the background portion of the target image in which the foreground portion is located.
  • the ratio of the brightness to the average of the brightness of the background portion of the plurality of images in the image storage database is determined as the brightness correction coefficient of the foreground portion.
  • parameter model is used to indicate the correspondence between the label values of the plurality of color systems, the hue, the saturation and the brightness of the foreground portion, and the brightness of the background portion in the captured scene of the target image.
  • the brightness of the foreground portion may be the brightness of the foreground portion adjusted according to the brightness correction coefficient or the original brightness of the foreground portion without adjustment.
  • a label value set according to each of the plurality of color systems and a hue, saturation, and brightness of a foreground portion of the plurality of images in the image storage database and a background portion in each of the images is trained to determine the parameter model, and the plurality of images and the target image are images in the same captured scene.
  • the brightness of the foreground portion is adjusted based on the color system of the foreground portion.
  • the brightness of the foreground portion is adjusted to the brightness in the brightness set corresponding to the color system of the foreground portion.
  • the color system is one of a dark color system, a colored color system, and a white light color system, wherein the element in the brightness set corresponding to the dark color system is a; the brightness set corresponding to the colored color system is greater than a brightness range equal to b and less than or equal to c; the element in the brightness set corresponding to the white light color is d,
  • the a, b, c, and d are all constants.
  • adjusting the brightness of the foreground portion does not necessarily require adjusting the brightness of the foreground portion, but based on the color system corresponding to the foreground portion and the brightness map corresponding to the foreground portion.
  • a collection that determines whether to adjust the brightness of the foreground portion If the brightness of the foreground portion is within the luminance mapping set interval of the color system corresponding to the foreground portion, the brightness of the foreground portion is not adjusted.
  • the brightness set may include an element, for example, the brightness set corresponding to the dark color system is ⁇ a ⁇ , and only the element a is included, and the brightness set corresponding to the white light color system is ⁇ d ⁇ , and only the element d is included, and the brightness set is further included.
  • a plurality of elements may be included, for example, the brightness set corresponding to the colored color system is ⁇ b ⁇ x ⁇ c ⁇ , and the set may be discrete, that is, the element of the set is an integer between b and less than or equal to c, the set It may also be continuous, that is, the elements of the set are real numbers between b and less than or equal to c.
  • V value VY is less than or greater than the predetermined set of V values [b, c], map it to the nearest value in the [b, c] interval, if the V value VY is at Between the set of V values [b, c], VY is not adjusted.
  • the selection of this parameter has a significant impact on the experimental results.
  • the following factors should be considered in the selection of parameters:
  • the parameters correspond to three different color systems. Therefore, the selection of the three parameters should be consistent with the corresponding V value sets of the three color systems.
  • the meaning of the * formula is that the parameter a cannot be the same as b. There should be some difference between the two.
  • a and b have physical meanings, a corresponds to the dark color system, and b corresponds to the colored color system.
  • the quality of the parameters is good or bad, based on empirical judgment. Therefore, it is necessary to carry out a certain number of tests.
  • the selection of parameters should be combined with the entire application system. For image retrieval or query, in order to improve the efficiency of retrieval and the space required for feature storage, it is common practice to quantify features. In the case of characterization of features, the choice of parameters should be considered in conjunction with the quantization step size, so that the eigenvalues of the same color system are in the same quantization interval as much as possible after quantization.
  • a luminance value interval is designed for the color system, and when the brightness value of the foreground portion is within a predefined interval, no illumination processing is required, and calculation and storage due to processing are reduced.
  • the cost rather, it provides a larger set of tolerances, avoiding excessive noise caused by the process leading to severe distortion.
  • the brightness value of the image is adjusted to a common smaller set by determining the color system of the image after the color system of the image, so that the color difference of different pictures of the same object (such as a pedestrian) caused by illumination is as much as possible. Small, thus effectively reducing the difference in target color values caused by different illuminations, thereby facilitating the retrieval or recognition of objects.
  • the image is converted from the HSV space to the RGB space based on the adjusted brightness of the foreground portion.
  • the target image is looked up in the storage device based on the processed image.
  • each image in the storage device is processed according to the method in the present application. If an image in the storage device is queried, the query may be directly performed in the database; if a non-storage device is queried In the image, since each image in the storage device is processed according to the method in the present application, the image in the storage device is first processed by the method in the present application, and then in the storage The device is queried for images that are not in the storage device. Because each image in the storage device and the image to be queried are processed according to the method in the present application, the brightness of the target image is adjusted according to different color systems, and the color difference of the target object caused by illumination is reduced. Improves the accuracy of retrieving target objects.
  • the image processing apparatus determines the target image by converting the red, green, and blue RGB space to the hue saturation luminance HSV space, according to the brightness of the background portion of the target image and the brightness of the foreground portion of the target image. a color system of the foreground portion; adjusting the brightness of the foreground portion according to the color system of the foreground portion; and converting the target image for adjusting the brightness of the foreground portion from the HSV space to the RGB space.
  • the difference in brightness of the target object caused by different illuminations is reduced, and determining the color system of the foreground portion according to the brightness of the adjusted foreground portion improves the determination of the foreground portion.
  • the accuracy of the color system adjusts the brightness of the foreground portion according to the color system of the foreground portion, and converts the target image for adjusting the brightness of the foreground portion from the HSV space to the RGB space, thereby reducing image brightness under different illuminations.
  • the difference in color of the target object caused by the difference thereby facilitating the retrieval or recognition of the target object.
  • FIG. 4 is a schematic flowchart of a method 300 of processing an image according to another embodiment of the present application. As shown in FIG. 4, the method 300 includes the following.
  • the target image is converted from a red, green, and blue RGB space to a hue saturation luminance HSV space.
  • the brightness of the target image is adjusted according to the color system of the target image.
  • the target image is converted from the HSV space to the RGB space according to the adjusted brightness of the target image.
  • the image processing apparatus converts the target image from the red, green and blue RGB space to the hue saturation luminance HSV space, and when the brightness of the target image belongs to the luminance range of the first color system of the plurality of color systems And when the absolute value of the difference from the threshold value of the brightness range of the first color system is less than the first threshold, determining the color system of the foreground portion according to the hue and saturation of the target image in the HSV space, and improving the basis Brightness only determines the accuracy of the color system of the target image, adjusts the brightness of the foreground portion according to the color system of the foreground portion, and converts the target image for adjusting the brightness of the foreground portion from the HSV space to the RGB space, reducing The difference in the color of the target object caused by the different brightness of the image under different illuminations, which is beneficial to the retrieval or recognition of the target object.
  • the foregoing method 200 may be combined with the method 300 to determine the color system of the foreground portion, that is, when the brightness of the foreground portion of the method 200 after the method 200 is adjusted to be a critical value of the first color system, according to the foreground portion.
  • the combination of H and S determines the color of the foreground portion. To avoid repetition, it will not be repeated here.
  • FIG. 5 is a schematic flowchart of a method 400 of processing an image according to another embodiment of the present application. As shown in FIG. 5, the method 400 includes the following.
  • the target image is converted from a red, green and blue RGB space to a hue saturation luminance HSV space, the target image comprising a first portion and a second portion, the brightness of the first portion and the brightness of the second portion being first a brightness range of a color system, an absolute value of a difference between a brightness of the first portion and a threshold value of a brightness range of the first color system is greater than or equal to a first threshold, and a brightness of the second portion and the first color
  • the absolute value of the difference value of the threshold value of the luminance range of the system is smaller than the first threshold.
  • a first color system is determined as a color system of the first portion; when an absolute value of a difference between a brightness of the second portion and a brightness of the first portion is greater than or equal to a second threshold, according to the The second portion determines the color system of the second portion in the hue and saturation of the HSV space, or when the absolute value of the difference between the brightness of the second portion and the brightness of the first portion is greater than or equal to the second a threshold value, determining a color system of the second portion according to a hue and saturation of the second portion in the HSV space; or an absolute difference between a brightness of the second portion and a brightness of the first portion When the value is greater than or equal to the second threshold, determining a color system corresponding to a range adjacent to the brightness of the second portion as a color system of the second portion; or, when the brightness of the second portion is different from the first portion When the absolute value of the difference in luminance of the two portions is smaller than the second threshold, the first color system is determined as the color system of the
  • the brightness of the first portion and the second portion is adjusted based on the color system of the first portion and the color system of the second portion.
  • the target image is converted from the HSV space to the RGB space based on the adjusted brightness of the target image.
  • the image processing apparatus determines the first part and the second part according to the first part and the second part of the target image by converting the target image from the red, green and blue RGB space to the hue saturation brightness HSV space.
  • Color system adjusting the brightness of the first part and the second part, so that the color difference of different pictures of the target object caused by illumination is as small as possible, effectively reducing the difference of the target color caused by different illuminations, thereby facilitating the target object Retrieve or identify.
  • FIG. 6 is a schematic block diagram of an image processing apparatus 500 in accordance with the present application. As shown in FIG. 6, the image processing apparatus 500 includes:
  • the conversion module 510 is configured to convert the target image from the red, green and blue RGB space to the hue saturation luminance HSV space, wherein the target image comprises a foreground portion and a background portion.
  • the first processing module 520 is configured to determine a color system of the foreground portion according to the brightness of the background portion and the brightness of the foreground portion.
  • the adjusting module 530 is configured to adjust the brightness of the foreground portion according to the color system of the foreground portion.
  • the conversion module 510 is further configured to:
  • the image is converted from the HSV space to the RGB space based on the adjusted brightness of the foreground portion.
  • the first processing module 520 is specifically configured to: determine, according to the brightness of the background portion, a brightness correction coefficient of the foreground portion; adjust a brightness of the foreground portion according to the brightness correction coefficient of the foreground portion; according to the foreground portion The adjusted brightness determines the color of the foreground portion.
  • the first processing module 520 is configured to: determine, according to the range of the brightness of the background portion and the range of the background brightness, a range of the background brightness to which the background portion belongs; and determine a range of the background brightness to which the background portion belongs
  • the corresponding brightness correction coefficient is the brightness correction coefficient of the foreground portion.
  • the first processing module 520 is specifically configured to: calculate an average value of brightness of a background portion of the plurality of images in the image storage database, where the plurality of images and the image are images in the same captured scene; according to the foreground The ratio of the brightness of the background portion of the target image in which the portion is located, and the average value of the brightness of the background portion of the plurality of images in the image storage database is determined as the brightness correction coefficient of the foreground portion.
  • the first processing module 520 is specifically configured to compare the adjusted brightness of the foreground portion with the brightness range of the plurality of color systems to determine a color system of the foreground portion.
  • the first processing module 520 is specifically configured to: when the adjusted brightness of the foreground portion belongs to a brightness range of the first color system of the plurality of color systems, and is critical to a brightness range of the first color system When the absolute value of the difference of the value is less than the first threshold, the color system of the foreground portion is determined according to the hue and saturation of the foreground portion in the HSV space.
  • the first processing module 520 is specifically configured to: divide the foreground portion into a plurality of foreground sub-portions; and adjust brightness of each foreground sub-portion of the plurality of foreground sub-portions according to brightness of the background portion Determining the color system of each foreground sub-portion according to the adjusted brightness of each foreground sub-section; the adjusting module 430 is specifically configured to: adjust each of the foreground sub-portions according to the color system of each foreground sub-portion Brightness.
  • the plurality of foreground sub-portions include a first foreground sub-portion and a second foreground sub-portion, wherein the adjusted brightness of the first foreground sub-portion and the adjusted brightness of the second foreground sub-portion belong to the first color system a brightness range, an absolute value of a difference between the adjusted brightness of the first foreground sub-portion and a threshold value of the brightness range of the first color system is greater than or equal to a first threshold, and the second foreground sub-portion adjusted brightness and the first The absolute value of the difference of the critical values of the brightness range of the one color system is less than the first threshold;
  • the first processing module 520 is configured to determine a first color system as a color system of the first foreground sub-portion; a difference between the adjusted brightness of the second foreground sub-portion and the adjusted brightness of the first foreground sub-portion When the absolute value is greater than or equal to the second threshold, determining the color system of the second foreground sub-portion according to the hue and saturation of the second foreground sub-portion in the HSV space; or, when the second foreground sub-portion is adjusted When the absolute value of the difference between the brightness and the adjusted brightness of the first foreground sub-portion is greater than or equal to the second threshold, determining a color system corresponding to the range adjacent to the brightness adjusted by the second foreground sub-portion as the second foreground sub- a portion of the color system; or, when the absolute value of the difference between the adjusted brightness of the second foreground sub-portion and the brightness of the second foreground sub-portion is less than the second threshold, determining the first color system as the second color The color of the foreground subsection
  • the first processing module 520 is further configured to input a tone, a saturation, and a brightness of the foreground portion and a brightness of the background image into a parameter model, and obtain a tag value output by the parameter model, where the parameter model is used by And indicating a correspondence relationship between a label value of the plurality of color systems, a hue, a saturation and a brightness of the foreground portion, and a brightness of the background portion in the captured scene of the target image; determining the label value according to the output of the parameter model The color of the foreground part.
  • the image processing device further includes a second processing module 540, as shown in FIG.
  • the second processing module 540 is configured to set a tag value according to each color system of the plurality of color systems. Performing algorithmic training on the hue, saturation, and brightness of the foreground portion of the plurality of images in the image storage database and the brightness of the background portion in each of the images, determining the parametric model, the plurality of images being identical to the target image Capture images from the scene.
  • the first processing module 520 is configured to determine, according to the color system of the foreground portion, a brightness set corresponding to the color system of the foreground portion; and adjust the brightness of the foreground portion according to the brightness set.
  • the adjusting module 530 is configured to adjust a brightness of the foreground sub-portion according to a color system of the foreground sub-portion, the color system being one of a dark color system, a colored color system, and a white light color system.
  • the element in the brightness set corresponding to the dark color is a; the brightness set corresponding to the colored color is a brightness range greater than or equal to b and less than or equal to c; the element in the brightness set corresponding to the white light color is d,
  • the a, b, c, and d are all constants.
  • the image processing device 500 can also be used to execute the method 300 described above.
  • the image processing apparatus 500 includes:
  • the conversion module 510 is configured to convert the target image from the red, green and blue RGB space to the hue saturation brightness HSV space.
  • the first processing module 520 is configured to: when the brightness of the target image belongs to a brightness range of the first color system of the plurality of color systems, and the absolute value of the difference from the threshold value of the brightness range of the first color system is smaller than the first At the threshold, the color system of the foreground portion is determined according to the hue and saturation of the target image in the HSV space.
  • the adjusting module 530 is configured to adjust the brightness of the target image according to the color system of the target image.
  • the conversion module 510 is further configured to:
  • the target image is converted from the HSV space to the RGB space according to the adjusted brightness of the target image.
  • the image processing device 500 can also be used to execute the method 300 described above.
  • the image processing apparatus 500 includes:
  • the conversion module 510 is configured to convert the target image from the red, green and blue RGB space to the hue saturation brightness HSV space, the target image comprising the first part and the second part, the brightness of the first part and the brightness of the second part belong to a brightness range of the first color system, an absolute value of a difference between a brightness of the first portion and a threshold value of a brightness range of the first color system is greater than or equal to a first threshold, and a brightness of the second portion is different from the first
  • the absolute value of the difference of the critical values of the luminance range of the one color system is smaller than the first threshold, and the first color system is determined as the color system of the first portion.
  • the first processing module 520 is configured to: when the absolute value of the difference between the brightness of the second portion and the brightness of the first portion is greater than or equal to a second threshold, according to the hue of the second portion in the HSV space Saturation, determining a color system of the second portion, or brightness of the second portion when an absolute value of a difference between a brightness of the second portion and a brightness of the first portion is greater than or equal to a second threshold
  • the color system corresponding to the adjacent range is determined to be the color system of the second portion; or, when the absolute value of the difference between the brightness of the second portion and the brightness of the second portion is less than the second threshold,
  • the first color system is determined to be the color system of the second portion.
  • the adjusting module 530 is configured to adjust the brightness of the first portion and the second portion respectively according to the color system of the first portion and the color system of the second portion.
  • the conversion module 510 is further configured to convert the target image from the HSV space to the RGB space according to the adjusted brightness of the target image.
  • FIG. 8 is a schematic block diagram of an image processing apparatus 600 provided by the present application, the image processing apparatus 600 including:
  • a memory 610 configured to store a program, where the program includes code
  • the transceiver 620 is configured to communicate with other devices;
  • the processor 630 is configured to execute program code in the memory 610.
  • the processor 630 can implement the image processing device in the method 200 or the method 300 to perform various operations, and the transceiver 620 is configured to perform specific signal transceiving under the driving of the processor 630. For the sake of brevity, it will not be repeated here.
  • the processor 630 may be a central processing unit (CPU), and the processor 630 may also be other general-purpose processors, digital signal processors, application specific integrated circuits, and ready-made Program gate arrays or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, and more.
  • the general purpose processor may be a microprocessor or the processor or any conventional processor or the like.
  • the memory 610 can include read only memory and random access memory and provides instructions and data to the processor 630. A portion of the memory 610 may also include a non-volatile random access memory. For example, the memory 610 can also store information of the device type.
  • the transceiver 620 can be used to implement signal transmission and reception functions.
  • the disclosed systems, devices, and methods may be implemented in other manners.
  • the device embodiments described above are merely illustrative.
  • the division of the unit is only a logical function division.
  • there may be another division manner for example, multiple units or components may be combined or Can be integrated into 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 separated, 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 application 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 functions may be stored in a computer readable storage medium if implemented in the form of a software functional unit and sold or used as a standalone product.
  • the technical solution of the present application which is essential or contributes to the prior art, or a part of the technical solution, may be embodied in the form of a software product, which is stored in a storage medium, including
  • the instructions are used 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 methods described in various embodiments of the present application.
  • 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, which can store program codes. .

Landscapes

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

Abstract

一种处理图像的方法和设备,能够准确获取目标对象的亮度,减小图像亮度改变而导致的该目标对象颜色的差异,进而有利于目标对象的检索或识别。该方法包括:将目标图像从红绿蓝RGB空间转换到色调饱和度亮度HSV空间,所述目标图像包括前景部分和背景部分(210);根据所述背景部分的亮度以及所述前景部分的亮度确定所述前景部分的色系(220);根据所述前景部分的色系,调整所述前景部分的亮度(230);根据所述前景部分的调整后的亮度,将所述图像从所述HSV空间转化到所述RGB空间(240)。

Description

图像处理的方法和设备
本申请要求于2017年2月16日提交中国专利局、申请号为201710082941.8、发明名称为“图像处理的方法和设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及图像处理领域,并且更具体地,涉及图像处理的方法和设备。
背景技术
在现有技术中,以光学为基础的成像设备,成像质量都受到光照的影响。在以图像内容分析为基础的很多应用中,例如人脸识别、虹膜识别、图像检索和视频监控等,外部光照往往会改变图像的亮度,进而改变图像的颜色,给目标获取带来很大困难,影响了依赖于颜色进行检索或者识别的系统的有效性。
因此,如何准确获取目标对象的亮度,减小图像亮度改变而导致的该目标对象颜色的差异,提高依赖于颜色进行检索或者识别的系统的有效性,是一个亟待解决的问题。
发明内容
本申请提供一种处理图像的方法,能够准确获取目标对象的亮度,减小图像亮度改变而导致的该目标对象颜色的差异,进而有利于目标对象的检索或识别。
第一方面,提供了一种处理图像的方法,包括:将目标图像从红绿蓝RGB空间转换到色调饱和度亮度HSV空间,其中,该目标图像包括前景部分和背景部分;根据该背景部分的亮度以及该前景部分的亮度,确定该前景部分的色系;根据该前景部分的色系,调整该前景部分的亮度;根据该前景部分的调整后的亮度,将该图像从该HSV空间转化到该RGB空间。
因此,在本申请中,图像处理设备通过将目标图像从红绿蓝RGB空间转换到色调饱和度亮度HSV空间,根据该目标图像的背景部分的亮度以及该目标图像的前景部分的亮度,确定该前景部分的色系;根据该前景部分的色系,调整该前景部分的亮度;将调整该前景部分亮度的该目标图像从该HSV空间转化到该RGB空间。通过结合该背景部分的亮度来确定该前景部分的色系,增加了确定前景部分的色系的条件,提高了确定该前景部分的色系的准确率,从而根据该前景部分的色系调整该前景部分的亮度,并将调整该前景部分亮度的该目标图像从该HSV空间转化到该RGB空间,减小了不同光照下的图像亮度不同而导致的该目标对象颜色的差异,进而有利于目标对象的检索或识别。
可选地,在第一方面的一种实现方式中,根据该背景部分的亮度以及该前景部分的亮度,确定该前景部分的色系,包括:根据该背景部分的亮度,确定该前景部分的亮度修正系数;根据该前景部分的亮度修正系数,调整该前景部分的亮度;根据该前景部分的调整后的亮度,确定该前景部分的色系。
可选地,在第一方面的一种实现方式中,该前景部分主要是目标图像中的目标行人图像,该背景部分是该目标图像中除该前景部分之外的图像内容。
可选地,在第一方面的一种实现方式中,该背景部分可以分为整个背景部分和脚下背景部分。该脚下背景部分可以按比例选取该目标图像下部所在背景的一部分。
此时,通过将背景部分进行划分为脚下背景部分,脚下背景部分的光照水平与前景部分更加接近,有利于获得更加精确地亮度修正系数。
可选地,在第一方面的一种实现方式中,根据该背景部分的亮度,确定该前景部分的亮度修正系数,包括:根据该背景部分的亮度和背景亮度的区间范围,确定该背景部分所属的背景亮度的区间范围;确定该背景部分所属的背景亮度的区间范围对应的亮度修正系数为该前景部分的亮度修正系数。
可选地,在第一方面的一种实现方式中,根据整个背景部分的亮度,确定该背景部分所属的背景亮度的区间范围;确定该整个背景部分所属的背景亮度的区间范围;确定整个背景部分所属的背景亮度的区间范围对应的亮度修正系数为该前景部分的亮度修正系数。
可选地,在第一方面的一种实现方式中,根据脚下背景部分的亮度,确定该背景部分所属的背景亮度的区间范围;确定该整个背景部分所属的背景亮度的区间范围;确定整个背景部分所属的背景亮度的区间范围对应的亮度修正系数为该前景部分的亮度修正系数。
此时,该背景部分的亮度修正系数通过多次比较该光照条件下的背景亮度与正常光照条件下的背景亮度的比值获得,该亮度系数反映了该光照条件下,应该对前景图像的亮度调整,通过该背景部分对应的该亮度修正系数来调整该前景部分的亮度,使得该前景部分的亮度更接近正常光照下的亮度,根据该前景部分调整后的亮度确定该前景部分的色系,提高了确定该前景部分的色系的准确率。
可选地,在第一方面的一种实现方式中,计算整个背景部分的亮度和脚下背景部分的亮度的均值,根据该均值确定该背景部分所属的背景亮度的区间范围;确定该整个背景部分所属的背景亮度的区间范围;确定整个背景部分所属的背景亮度的区间范围对应的亮度修正系数为该前景部分的亮度修正系数。
可选地,在第一方面的一种实现方式中,该根据该背景部分的亮度,确定该前景部分的亮度修正系数,包括:计算图像存储数据库中的多个图像的背景部分的亮度的平均值,该多个图像与该图像为同一捕获场景下的图像;将该前景部分所在的该目标图像的该背景部分的亮度与该图像存储数据库中的多个图像的背景部分的亮度的平均值的比值确定为该前景部分的亮度修正系数。
此时,该亮度修正系数为该背景部分的亮度与该同一捕获场景下的多个图像的背景部分的亮度的比值,通过参考该同一捕获场景下的多个图像的背景部分的亮度,避免光照对该目标图像的前景部分的亮度的影响,通过该背景部分对应的该亮度修正系数来调整该前景部分的亮度,使得该前景部分的亮度更接近正常光照下的亮度,根据该前景部分调整后的亮度确定该前景部分的色系,提高了确定该前景部分的色系的准确率。
可选地,在第一方面的一种实现方式中,根据该前景部分的调整后的亮度,确定该前景部分的色系,包括:比较该前景部分的调整的亮度与多个色系的亮度范围,确定该前景部分的色系。
可选地,在第一方面的一种实现方式中,该比较该前景部分的调整的亮度与多个色系的亮度范围,确定该前景部分的色系,包括:当该前景部分的调整后的亮度属于多个色系中的第一色系的亮度范围,且与该第一色系的亮度范围的临界值的差值绝对值小于第一阈值时, 根据该前景部分在该HSV空间的色调和饱和度,确定该前景部分的色系;或当所述前景部分的调整后的亮度属于多个色系中的第一色系的亮度范围,且与所述第一色系的亮度范围的临界值的差值绝对值大于或等于所述第一阈值时,将所述第一色系确定为所述前景子部分的色系。
此时,通过在调整后的该前景部分亮度属于多个色系中的第一色系的亮度范围,且与该第一色系的亮度范围的临界值的差值绝对值小于第一阈值时,根据该前景部分在该HSV空间的色调和饱和度,确定该前景部分的色系,避免了误判该前景部分的色系而导致图像查询失败。
可选地,在第一方面的一种实现方式中,该比较该前景部分的调整的亮度与多个色系的亮度范围,确定该前景部分的色系,包括:当该前景部分的调整后的亮度属于多个色系中的第一色系的亮度范围,且与该第一色系的亮度范围的临界值的差值绝对值小于第一阈值时,可以将该前景子部分做二归类处理,将该前景子部分分别作为第一色系和第二色系进行处理,其中,该第二色系和第一色系相邻。
可选地,在第一方面的一种实现方式中,该根据该背景部分的亮度以及该前景部分的亮度,确定该前景部分的色系包括:将该前景部分划分为多个前景子部分;根据该背景部分的亮度,对该多个前景子部分中每个前景子部分的亮度进行调整;根据该每个前景子部分调整后的亮度,确定该每个前景子部分的色系;该根据该前景部分的调整后的亮度,确定该前景部分的色系包括:根据该每个前景子部分的色系,调整该每个前景子部分的亮度。
此时,通过将该前景部分划分为多个前景子部分,并对该多个前景子部分中的每个前景子部分作不同的处理,避免了不同前景子部分之间的干扰,有利于更加精确地判断该多个前景子部分中的每个前景子部分的色系和根据该多个前景子部分中的每个前景子部分的色系,调整该每个前景子部分的亮度。
可选地,在第一方面的一种实现方式中,该多个前景子部分包括第一前景子部分和第二前景子部分,该第一前景子部分调整后的亮度和该第二前景子部分调整后的亮度属于第一色系的亮度范围,该第一前景子部分调整后的亮度与该第一色系的亮度范围的临界值的差值绝对值大于或等于第二阈值,该第二前景子部分调整后的亮度与该第一色系的亮度范围的临界值的差值绝对值小于该第二阈值;
该根据该每个前景子部分调整后的亮度,确定该每个前景子部分的色系,包括:
将第一色系确定为该第一前景子部分的色系;
当该第二前景子部分调整后的亮度与该第一前景子部分调整后的亮度的差值绝对值大于或等于第三阈值时,根据该第二前景子部分在该HSV空间的色调和饱和度,确定该第二前景子部分的色系;或,当该第二前景子部分调整后的亮度与该第一前景子部分调整后的亮度的差值绝对值大于或等于第三阈值时,将该第二前景子部分调整的亮度相邻的范围对应的色系确定为该第二前景子部分的色系;或,当该第二前景子部分调整后的亮度与该第二前景子部分的亮度的差值绝对值小于该第三阈值时,将该第一色系确定为该第二前景子部分的色系。
可选地,在第一方面的一种实现方式中,该第一前景子部分为多个第一前景子部分时,该第一前景子部分调整后的亮度可以为其中任意一个第一前景子部分调整后的亮度或多个第一前景子部分调整后的亮度的均值。
可选地,在第一方面的一种实现方式中,根据该背景部分的亮度以及该前景部分的亮度, 确定该前景部分的色系,包括:将该前景部分的色调、饱和度和亮度以及该背景图像的亮度输入参数模型,并获取该参数模型输出的标签值,其中,该参数模型用于指示在该目标图像的捕获场景下,多个色系的标签值,与前景部分的色调,饱和度和亮度以及背景部分的亮度的对应关系;根据该参数模型的输出的标签值,确定该前景部分的色系。
可选地,在第一方面的一种实现方式中,该将该前景部分的色调、饱和度和亮度以及该背景部分的亮度输入参数模型之前,该方法还包括:根据该多个色系中每个色系设定的标签值和该图像存储数据库中的多个图像中的前景部分的色调、饱和度和亮度以及该每个图像中的背景部分的亮度进行算法训练,确定该参数模型,该多个图像与该目标图像为同一捕获场景下的图像。
可选地,将该前景部分的亮度调整为该前景部分的色系对应的亮度集合中的亮度。
可选地,根据该前景部分的色系,确定该前景部分的色系对应的亮度集合;根据该亮度集合,调整该前景部分的亮度。
可选地,该色系为黑暗色系、有色色系和白亮色系中的一种色系,该黑暗色系对应的亮度集合中的元素为a;该有色色系对应的亮度集合为大于等于b且小于等于c的亮度范围;该白亮色系对应的亮度集合中的元素为d,
其中,该a、该b、该c和该d满足关系式:
0≤a<b≤c<d≤1
该a、b、c和d均为常数。
第二方面,提供了一种处理图像的方法,包括:将目标图像从红绿蓝RGB空间转换到色调饱和度亮度HSV空间;当该目标图像的亮度属于多个色系中的第一色系的亮度范围,且与该第一色系的亮度范围的临界值的差值绝对值小于第一阈值时,根据该目标图像在该HSV空间的色调和饱和度,确定该前景部分的色系;根据该目标图像的色系,调整该目标图像的亮度;根据该目标图像的调整后的亮度,将该目标图像从该HSV空间转化到该RGB空间。
第三方面,提供了一种处理头像的方法,包括:将目标图像从红绿蓝RGB空间转换到色调饱和度亮度HSV空间,该目标图像包括第一部分和第二部分;
所述第一部分的亮度和所述第二部分的亮度属于第一色系的亮度范围,所述第一部分的亮度与所述第一色系的亮度范围的临界值的差值绝对值大于或等于第一阈值,所述第二部分的亮度与所述第一色系的亮度范围的临界值的差值绝对值小于所述第一阈值,将第一色系确定为所述第一部分的色系;
当所述第二部分的亮度与所述第一部分的亮度的差值绝对值大于或等于第二阈值时,根据所述第二部分在所述HSV空间的色调和饱和度,确定所述第二部分的色系;或当所述第二部分的亮度与所述第一部分的亮度的差值绝对值大于或等于第二阈值时,将所述第二部分的亮度相邻的范围对应的色系确定为所述第二部分的色系;或,当所述第二部分的亮度与所述第二部分的亮度的差值绝对值小于所述第二阈值时,将所述第一色系确定为所述第二部分的色系;
根据该第一部分和该第二部分的色系,调整该第一部分和第二部分的亮度;
根据该目标图像的调整后的亮度,将该图像从该HSV空间转化到该RGB空间。
第四方面,提供了一种图像处理设备,包括转换模块、第一处理模块和调整模块,可以执行上述第一方面或第一方面的任一种可能的实现方式中的方法。
第五方面,提供了一种图像处理设备,包括转换模块、第一处理模块和调整模块,可以执行上述第二方面或第二方面的任一种可能的实现方式中的方法。
第六方面,提供了一种图像处理设备,包括转换模块、第一处理模块和调整模块,可以执行上述第三方面或第三方面的任一种可能的实现方式中的方法。
第七方面,提供了一种图像处理设备,包括存储器、收发器和处理器,所述存储器上存储有可以用于指示执行上述第一或其任意可选的实现方式的程序代码,收发器用于在处理器的驱动下执行具体的信号收发,当所述代码被执行时,所述处理器可以实现方法中终端设备执行各个操作。
第八方面,提供了一种图像处理设备,包括存储器、收发器和处理器,所述存储器上存储有可以用于指示执行上述第二或其任意可选的实现方式的程序代码,收发器用于在处理器的驱动下执行具体的信号收发,当所述代码被执行时,所述处理器可以实现方法中终端设备执行各个操作。
第九方面,提供了一种图像处理设备,包括存储器、收发器和处理器,所述存储器上存储有可以用于指示执行上述第三或其任意可选的实现方式的程序代码,收发器用于在处理器的驱动下执行具体的信号收发,当所述代码被执行时,所述处理器可以实现方法中终端设备执行各个操作。
第十方面,提供了一种计算机可读介质,用于存储计算机程序,该计算机程序包括用于执行上述第一方面或第一方面的任一种可能的实现方式,第二方面或第二方面的任一种可能的实现方式,第三方面或第三方面的任一种可能的实现方式中的方法的指令。
附图说明
图1是使用本申请的一种图像处理系统的示意图。
图2是根据本申请的一种图像处理的方法的示意性流程图。
图3是根据本申请的亮度映射区间的示意性图。
图4是根据本申请的一种图像处理的方法的示意性流程图。
图5是根据本申请的一种图像处理的方法的示意性流程图。
图6是根据本申请的图像处理设备的示意性框图。
图7是根据本申请的图像处理设备的示意性框图。
图8是根据本申请的图像处理设备的示意性框图。
具体实施方式
下面将结合附图,对本申请中的技术方案进行描述。
图1是本申请的一种处理图像的方法和设备的图像处理系统的示意图。如图1所示,该图像处理系统100包括服务器110、客户端120、传输设备130、图像处理设备140和存储设备150。该服务器110中存储需要经过图像处理的图片,该客户端120用于向该图像处理设备140发送检索请求,该传输设备130用于该客户端120与该图像处理设备140,或该客户端120与该服务器110之间的信息传递,该传输设备可以为交换机。该存储设备150用于存储经过图像处理的图片。该图像处理设备140主要用于对图像的亮度进行处理,并将处理后的图像存储到存储设备140中,以及接收该客户端120的检索请求,对存储设备中的处理后 的图像进行检索,并将检索的结果返回给该客户端120。
可选地,在本申请中,该图像处理设备140可以是视频内容管理器。
为了更好地理解本申请,以下将结合图2-图8,以与图1所示的系统相同或相似的系统为例对本申请进行说明。
图2是根据本申请的一种处理图像的方法200的示意性流程图。如图2所示,该方法200包括以下内容。
在210中,图像处理设备将目标图像从红绿蓝RGB空间转换到色调饱和度亮度HSV空间,其中,该目标图像包括前景部分和背景部分。
应理解,计算机色彩显示器显示色彩采用R、G、B相加混色的原理,通过发射出三种不同强度的电子束,使屏幕内侧覆盖的红、绿、蓝磷光材料发光而产生色彩。这种色彩的表示方法称为RGB色彩空间表示法,其中R表示红色,G表示绿色,Blue表示蓝色。色调饱和度亮度(Hue Saturation Value,HSV)颜色模型是面向用户的更加直观的颜色模型,其中H表示图像的色调,S表示图像的饱和度,而V表示图像的亮度。
可选地,该前景部分主要是目标图像中的目标行人图像,该背景部分是该目标图像中除该前景部分之外的图像内容,例如该目标图像中的地面、建筑物等设施。
可选地,该背景部分可以为该图像中除该前景部分之外的全部图像内容,该背景部分也可以为该图像中除该前景部分之外的部分图像内容。该背景部分包括该目标图像捕获场景下的光照亮度的信息,在一些情况下,部分背景部分的图像的光照水平和前景部分更接近,例如可以选择脚下背景部分作为参考调整该前景部分的亮度。该脚下背景部分可以按比例选取该目标图像下部的一部分,例如,选取该目标图像下部的15%~20%作为该目标图像的脚下背景部分。
在220中,根据该背景部分的亮度以及该前景部分的亮度,确定该前景部分的色系。
可选地,可以根据不同色彩的色调、饱和度和亮度的规律特性对不同的色彩划分色系,处于相同色系的不同色彩的色调、饱和度和亮度的变化规律一致,因此,可以根据色系对目标对象的亮度进行调整。例如,将颜色分为三个色系,分别为黑暗色系、有色色系和白亮色系。该黑暗色系是指黑、黑灰、藏青和藏黑等颜色及其相近的颜色,属于该黑暗色系的图像的主要特点之一是该图像在H值保持不变或者变化很小(或者在光照强度不过度)的情况下,V变化范围较小,并且V的取值也较小,例如V取值从0.02到0.18。有色色系指的是红、橙、黄、绿、青、蓝和紫等颜色及其相近的颜色,属于有色色系的图像的主要特点之一是该图像在H值保持不变或者变化很小的情况下,V值变化范围很大,并且V的取值可以较小也可以较大,例如V取值从0.2到0.8。白亮色系是指白色或者与其相近的颜色,属于白亮色系的图像的主要特点之一是该图像在H值保持不变或者变化很小的情况下,V分量的变化范围较小(相对有色色系而言),但V值较大,例如V取值从0.7到0.9。
可选地,根据背景部分的亮度,确定该前景部分的亮度修正系数;根据该前景部分的亮度修正系数,调整该前景部分的亮度;根据该前景部分的调整后的亮度,确定该前景部分的色系。
可选地,根据所述背景部分的亮度和背景亮度的区间范围,确定所述背景部分所属的背景亮度的区间范围;确定所述背景部分所属的背景亮度的区间范围对应的亮度修正系数为所述前景部分的亮度修正系数。
例如,基于图像存储计算库中的图像样本数据的观察,将背景部分的亮度V划分为5个范围,分别为暗、较暗、正常、较亮和亮,该5个范围中的每个范围对应一个亮度修正系数,如表1所示。
表1 背景V值确定范围及对应的亮度修正系数
背景V值 背景明暗判断结果 亮度修正系数
V≤0.3 2.0
0.3<V≤0.44 较暗 1.4
0.44<V≤0.54 正常 1.1
0.54<V≤0.65 较亮 0.9
V>0.65 0.8
该亮度修正系数用于调整该背景部分所属的目标图像的前景部分的亮度,使其更接近正常光照情况的V值。例如,如果当前背景部分V值为0.4,根据表1将背景部分亮度判断为较暗,其对应的光照系数为1.4。如果当前前景部分的亮度为V0,则将其调整为1.4*V0。
可选地,计算图像存储数据库中的多个图像的背景部分的亮度的平均值,所述多个图像与所述目标图像为同一捕获场景下的图像;根据所述前景部分所在的所述目标图像的所述背景部分的亮度,以及所述图像存储数据库中的多个图像的背景部分的亮度的平均值,确定所述前景部分的亮度修正系数。
具体而言,该同一捕获场景为该目标人所处的物理环境不变,例如,该目标人物在一个十字路口下拍摄了多张照片或该目标人物在商场门口拍摄了多张照片。计算图像存储数据库中的多个图像的背景亮度的平均值,例如该多个图像的背景亮度的平均值为0.491,然后计算该目标图像的背景亮度与背景亮度的平均值0.491的比值,该计算结果为该目标图像的亮度修正系数。
可选地,比较所述前景部分的调整的亮度与多个色系的亮度范围,确定所述前景部分的色系。
可选地,当所述前景部分的调整后的亮度属于多个色系中的第一色系的亮度范围,且与所述第一色系的亮度范围的临界值的差值绝对值小于第一阈值时,根据所述前景部分在所述HSV空间的色调和饱和度,确定所述前景部分的色系;或
当所述前景部分的调整后的亮度属于多个色系中的第一色系的亮度范围,且与所述第一色系的亮度范围的临界值的差值绝对值大于或等于所述第一阈值时,将所述第一色系确定为所述前景子部分的色系。
具体而言,根据调整后的前景部分的V值判断该前景部分的所属色系。一般而言,对于黑暗色系,在正常光照下,其V值不大于0.18。在暗或者较暗光照下,其V值很可能小于0.10。这里提到的V值都是归一化之后的值。而对于非黑色系,在正常光照下,其V值通常大于0.23。但是在暗或较暗光照下,其V值也可会小于0.16,甚至更小,小于0.10。下面以蓝色(有色色系)和黑色(黑暗色系)两种色系的判断为例进行说明。
在同一捕获场景下,对该目标对象的不同光照下的十张照片进行处理。该目标对象为前景部分,获取该目标人物的HSV值以及背景亮度,得到如表2所列的数据,表2中R、G、B、H、S、V分别表示前景部分的R、G、B、H、S和V值,V1和V2分别为该前景部分对应的背景 部分的亮度和该前景部分对应的脚下背景部分的亮度。
表2 图像的RGB和HSV参数
参数 R G B H S V V 1 V 2
1 6.61 10.3 40.9 0.64 0.83 0.16 0.31 0.44
2 5.44 8.76 35.6 0.64 0.84 0.14 0.32 0.43
3 6.60 9.96 34.7 0.64 0.81 0.13 0.33 0.42
4 11.4 14.0 37.6 0.65 0.69 0.14 0.35 0.44
5 5.07 7.38 31.4 0.65 0.83 0.13 0.35 0.43
6 4.81 7.60 32.6 0.65 0.85 0.13 0.33 0.42
7 8.02 10.8 32.3 0.64 0.75 0.13 0.31 0.38
8 5.40 7.87 32.2 0.65 0.83 0.12 0.29 0.35
9 3.31 5.67 27.6 0.65 0.88 0.10 0.29 0.36
10 3.80 5.46 25.1 0.65 0.84 0.09 0.26 0.29
可选地,根据每张图像背景部分V1的亮度,按照表1的关系,确定每张图像的前景部分的亮度修正系数。
可选地,根据每张图像背景部分V2的亮度,按照表1的关系,确定每张图像的前景部分的亮度修正系数。
可选地,计算每张图像背景部分V1和V2的均值V,根据V,按照表1的关系,确定每张图像的前景部分的亮度修正系数。
例如,在本申请中,以根据每张图像背景部分V1的亮度,按照表1的关系,确定每张图像的前景部分的亮度修正系数进行举例。根据每张图像背景部分V1的亮度,按照表1的关系,确定每张图像的前景部分的亮度修正系数,根据该确定的每张图像的前景部分的亮度修正系数,预调整该每张图像的前景部分的亮度。该每张图像的前景部分的预调整后的亮度如表3所示。
表3 图像预调整后的亮度值
序号 V1 V2 V3 V4 V5 V6 V7 V8 V9 V10
V 0.224 0.196 0.177 0.192 0.181 0.178 0.176 0.254 0.216 0.198
可选地,根据该背景部分的亮度,对该多个前景子部分中每个前景子部分的亮度进行调整;根据该每个前景子部分调整后的亮度,确定该每个前景子部分的色系。
可选地,当所述前景部分的调整后的亮度属于多个色系中的第一色系的亮度范围,且与所述第一色系的亮度范围的临界值的差值绝对值小于第一阈值时,根据所述前景部分在所述HSV空间的色调和饱和度,确定所述前景部分的色系;或
当所述前景部分的调整后的亮度属于多个色系中的第一色系的亮度范围,且与所述第一色系的亮度范围的临界值的差值绝对值大于或等于所述第一阈值时,将所述第一色系确定为所述前景子部分的色系。
具体而言,黑暗色系的亮度的临界值为0.18,第一阈值为0.01,在表3中,图像V1、V2、V4、V8、V9和V10与黑暗色系的亮度的临界值的差大于0.01,因此图像V1、V2、V4、V8、V9和V10属于黑暗色系,而图片V3、V5和V7与黑暗色系的亮度的临界值的差小于 0.01,需要根据所述前景部分在所述HSV空间的色调和饱和度,确定所述前景部分的色系。
可选地,将所述前景部分划分为多个前景子部分;根据所述背景部分的亮度,对所述多个前景子部分中每个前景子部分的亮度进行调整;根据所述每个前景子部分调整后的亮度,确定所述每个前景子部分的色系;
所述根据所述前景部分的色系,调整所述前景部分的亮度,包括:根据所述每个前景子部分的色系,调整所述每个前景子部分的亮度。
可选地,该前景部分可以通过自动或人工生成的半结构化数据(Extensible Markup Language,XML)等方法将该前景部分划分为多个子前景部分。
可选地,该多个前景子部分包括第一前景子部分和第二前景子部分,该第一前景子部分调整后的亮度和该第二前景子部分调整后的亮度属于第一色系的亮度范围,该第一前景子部分调整后的亮度与该第一色系的亮度范围的临界值的差值绝对值大于或等于第二阈值,该第二前景子部分调整后的亮度与该第一色系的亮度范围的临界值的差值绝对值小于该第二阈值;
该根据该每个前景子部分调整后的亮度,确定该每个前景子部分的色系,包括:
将第一色系确定为该第一前景子部分的色系;
当该第二前景子部分调整后的亮度与该第一前景子部分调整后的亮度的差值绝对值大于或等于第三阈值时,根据该第二前景子部分在该HSV空间的色调和饱和度,确定该第二前景子部分的色系;或,当该第二前景子部分调整后的亮度与该第一前景子部分调整后的亮度的差值绝对值大于或等于第三阈值时,将该第二前景子部分调整的亮度相邻的范围对应的色系确定为该第二前景子部分的色系;或,当该第二前景子部分调整后的亮度与该第二前景子部分的亮度的差值绝对值小于该第三阈值时,将该第一色系确定为该第二前景子部分的色系。
具体而言,当该第二前景子部分调整后的亮度与该第一前景子部分调整后的亮度的差值绝对值大于或等于第三阈值时,将该第二前景子部分调整的亮度相邻的范围对应的色系确定为该第二前景子部分的色系。第一色系与第二色系相邻,该第二前景子部分调整后的亮度与该第一色系的亮度范围的临界值的差值绝对值小于该第二阈值,且该第二前景子部分调整后的亮度与该第一前景子部分调整后的亮度的差值绝对值大于或等于第三阈值时,确定该第二前景子部分为第二色系。
当该第一色系分别于第二色系和第三色系相邻时,即第一色系处于第二色系与第三色系的中间,其中,该第二色系的亮度小于该第一色系的亮度,该第一色系的亮度小于该第三色系的亮度,该第一色系有两个临界值,分别为第一临界值和第二临界值,该第一临界值与第二色系相邻,该第二临界值与第三色系相邻。当该第一前景子部分调整后的亮度和该第二前景子部分调整后的亮度属于第一色系的亮度范围,该第一前景子部分调整后的亮度与该第一色系的亮度范围的第一临界值的差值绝对值大于或等于第二阈值,该第二前景子部分调整后的亮度与该第一色系的亮度范围的临界值的差值绝对值小于该第二阈值时,将第一色系确定为该第一前景子部分的色系;当该第二前景子部分调整后的亮度与该第一前景子部分调整后的亮度的差值绝对值大于或等于第三阈值时,将该第二前景子部分调整的亮度相邻的范围对应的色系,即第二色系确定为该第二前景子部分的色系;或,当该第二前景子部分调整后的亮度与该第二前景子部分的亮度的差值绝对值小于该第三阈值时,将该第一色系确定为该第二前景子部分的色系。
当该第一前景子部分调整后的亮度和该第二前景子部分调整后的亮度属于第一色系的亮 度范围,该第一前景子部分调整后的亮度与该第一色系的亮度范围的第二临界值的差值绝对值大于或等于第二阈值,该第二前景子部分调整后的亮度与该第一色系的亮度范围的临界值的差值绝对值小于该第二阈值时,将第一色系确定为该第一前景子部分的色系;当该第二前景子部分调整后的亮度与该第一前景子部分调整后的亮度的差值绝对值大于或等于第三阈值时,将该第二前景子部分调整的亮度相邻的范围对应的色系,即第三色系确定为该第二前景子部分的色系;或,当该第二前景子部分调整后的亮度与该第二前景子部分的亮度的差值绝对值小于该第三阈值时,将该第一色系确定为该第二前景子部分的色系。
例如,在同一捕获场景下,同一目标人物的不同光照下的十张照片进行处理。该目标人物为前景部分,将该目标人物划分为上半身和下半身,获取该目标人物的上半身和下半身HSV值以及背景亮度值,得到如表4所列的数据,表2中R1、G1、B1、H1、S1、V1、R2、G2、B2、H2、S2、V2分别为前景部分的上半身和下半身的R、G、B、H、S和V值,V1和V2分别为该前景部分对应的背景部分的亮度和该前景部分对应的脚下背景部分的亮度。
表4 图像的RGB和HSV参数
Figure PCTCN2018071783-appb-000001
可选地,根据每张图像背景部分V1的亮度,按照表1的关系,确定每张图像的前景部分的上半身和下半身的亮度修正系数。
可选地,根据每张图像背景部分V2的亮度,按照表1的关系,确定每张图像的前景部分的上半身和下半身的亮度修正系数。
可选地,计算每张图像背景部分V1和V2的均值V,根据V,按照表1的关系,确定每张图像的前景部分的上半身和下半身的亮度修正系数。
例如,在本申请中,以根据每张图像背景部分V1的亮度,按照表1的关系,确定每张图像的前景部分的上半身和下半身的亮度修正系数进行举例。根据每张图像背景部分V1的亮度,按照表1的关系,确定每张图像的前景部分的上半身和下半身的亮度修正系数,根据该确定的每张图像的前景部分的上半身和下半身的亮度修正系数,预调整该每张图像的前景部分的上半身和下半身的亮度。该每张图像的前景部分的上半身和下半身预调整后的亮度如表5所示。
表5 图像预调整后的亮度值
序号 V11 V12 V13 V14 V15 V16 V17 V18 V19 V110
V 0.224 0.196 0.177 0.192 0.181 0.178 0.176 0.254 0.216 0.198
序号 V21 V22 V23 V24 V25 V26 V27 V28 V29 V210
V 0.062 0.053 0.065 0.082 0.065 0.105 0.082 0.054 0.060 0.028
例如,将每张图像的前景部分的上半身和下半身预调整后的亮度值与0.18比较,可以判断出10张图像的下半身属于黑暗色系,图片1、2、4、5、8、9和10的前景部分的上半身为有色色系,而图片3、6和7的前景部分的上半身亮度处于临界值,需要进一步判断。此时,可以结合对应的下半身进行判断。因为上、下半身所处的光照环境大体相近,而下半身亮度值判断为黑暗色系并且调整后的亮度值仍然很小,在同一光照下,同一色系的目标图像的亮度值不可能相差太大,所以可以判断出图片3、6和7不是黑暗色系,因此属于有色色系。如果结合该前景部分的下半身仍然无法确定该前景部分的上半身所属色系,为了防止误判,可将该前景部分的上半身做二归类处理,即判断其既是黑暗色系也是有色色系,然后分别按两种色系进行处理,避免误判造成处理错误导致后续查询或检索失败。
可选地,该第二前景子部分调整后的亮度与该第一色系的亮度范围的临界值的差值绝对值小于该第一阈值,在该第二前景子部分所属的目标图像包括多个第一前景子部分,该多个第一前景子部分调整后的亮度和该属于第二前景子部分调整后的亮度属于第一色系的亮度范围,该多个第一前景子部分调整后的亮度与该第一色系的亮度范围的临界值的差值绝对值大于或等于第一阈值,可以根据该多个第一前景子部分的亮度与该第二前景子部分的亮度的差值与第二阈值的关系,确定该第二前景子部分的色系。
具体而言,根据该多个第一前景子部分中的任一前景子部分调整后的亮度与该第二前景子部分的亮度的差值与第二阈值的关系,确定该第二前景子部分的色系,当该第二前景子部分调整后的亮度与该多个第一前景子部分中的任一前景子部分亮度调整后的亮度的差值绝对值大于或等于第二阈值时,将该第二前景子部分调整的亮度相邻的范围对应的色系确定为该第二前景子部分的色系;或,当该第二前景子部分调整后的亮度与该该多个第一前景子部分中的任一前景子部分亮度调整后的亮度差的值绝对值小于该第二阈值时,将该第一色系确定为该第二前景子部分的色系。
例如,该多个第一前景子部分分别为第一前景子部分1、第一前景子部分2和第一前景子部分3,可以根据第一前景子部分1调整后的亮度与该第二前景子部分的亮度的差值与第二阈值的关系,确定该第二前景子部分的色系。当该第二前景子部分调整后的亮度与该第一前景子部分1调整后的亮度的差值绝对值大于或等于第二阈值时,将该第二前景子部分调整的亮度相邻的范围对应的色系确定为该第二前景子部分的色系;或,当该第二前景子部分调整后的亮度与该第一前景子部分1调整后的亮度差的值绝对值小于该第二阈值时,将该第一色系确定为该第二前景子部分的色系。还可以根据第一前景子部分2或第一前景子部分3调整后的亮度与该第二前景子部分的亮度的差值与第二阈值的关系,确定该第二前景子部分的色系。
具体而言,根据该多个第一前景子部分中的每个前景子部分调整后的亮度与该第二前景子部分的亮度的差值的平均值与第二阈值的关系,确定该第二前景子部分的色系,当该第二 前景子部分调整后的亮度与该多个第一前景子部分中的每个前景子部分亮度调整后的亮度的差值的平均值绝对值大于或等于第二阈值时,将该第二前景子部分调整的亮度相邻的范围对应的色系确定为该第二前景子部分的色系;或,当该第二前景子部分调整后的亮度与该多个第一前景子部分中的每个前景子部分亮度调整后的亮度差的平均值小于该第二阈值时,将该第一色系确定为该第二前景子部分的色系。
例如,该多个第一前景子部分分别为第一前景子部分1、第一前景子部分2和第一前景子部分3,将该第一前景子部分1、第一前景子部分2和第一前景子部分3与第二前景子部分的亮度的差的平均值,比较该差的绝对值与第二阈值的关系,确定该第二前景子部分的色系。当该第二前景子部分调整后的亮度与该差的平均值绝对值大于或等于第二阈值时,将该第二前景子部分调整的亮度相邻的范围对应的色系确定为该第二前景子部分的色系;或,当该第二前景子部分调整后的亮度与该差的平均值小于该第二阈值时,将该第一色系确定为该第二前景子部分的色系。
具体而言,根据该多个第一前景子部分调整后的亮度的平均值与该第二前景子部分的亮度的差值与第二阈值的关系,确定该第二前景子部分的色系,当该第二前景子部分调整后的亮度与该多个第一前景子部分亮度调整后的平均亮度的差值绝对值大于或等于第二阈值时,将该第二前景子部分调整的亮度相邻的范围对应的色系确定为该第二前景子部分的色系;或,当该第二前景子部分调整后的亮度与该多个第一前景子部分亮度调整后的平均亮度的差的值绝对值小于该第二阈值时,将该第一色系确定为该第二前景子部分的色系。
例如,该多个第一前景子部分分别为第一前景子部分1、第一前景子部分2和第一前景子部分3,计算该第一前景子部分分别为第一前景子部分1、第一前景子部分2和第一前景子部分3的平均亮度,根据该平均亮度与该第二前景子部分的亮度的差值与第二阈值的关系,确定该第二前景子部分的色系。
应理解,还可以根据该多个第一前景子部分中的调整后的亮度最小的第一前景子部分的亮度、该多个第一前景子部分中的任意几个第一前景子部分调整后的亮度的平均值与该第二前景子部分的亮度的差值与所述第二阈值的关系,确定该第二前景子部分的色系。
应理解,该前景子部分可以划分为多个子前景部分,在本申请中将前景部分划分为第一前景子部分和第二前景子部分仅作为示例,并非限定。
可选地,当该调整后的前景子部分的亮度处于一个色系的亮度的临界值附近时,可以根据该前景子部分在该HSV空间的色调和饱和度,确定该调整后的前景子部分的亮度处于一个色系的亮度的临界值附近的前景子部分的色系。
可选地,根据该前景部分的色调H和饱和度S确定该前景部分的色系。
应理解,在实际场景中,不同颜色的H和S有着特定规律的组合关系。因此,可以根据该前景部分的色调H和饱和度S确定该前景部分的色系。在本申请中以红色为例进行详细描述。
例如,在表5中列出了有色色系中在不同光照下红色目标图像在RGB空间和HSV空间的参数。红色图像的色调H和饱和度S有着特定的规律,即V值取值不同,但是H在[0.9,1]区间,而相应地S也在[0.9,1]区间。在表6中,6张目标图像的前景部分均满足该红色色系的H和S的组合关系,因此确定表6中的6张目标图像的前景部分属于有色色系。
表6 红色目标图像的RGB和HSV参数
参数 R1 G1 B1 H1 S1 V1 V 1 V 2
1 41.3 2.05 6.45 0.98 0.95 0.16 0.27 0.18
2 41.1 2.27 6.97 0.98 0.94 0.16 0.26 0.18
3 89.6 6.90 11.2 0.99 0.92 0.35 0.45 0.43
4 85.2 7.98 13.2 0.98 0.90 0.33 0.49 0.55
5 22.9 1.46 3.79 0.98 0.93 0.09 0.29 0.37
6 23.3 1.29 3.46 0.98 0.94 0.09 0.29 0.37
可选地,计算图像存储数据库中的多个图像的背景部分的亮度的平均值,该多个图像与该图像为同一捕获场景下的图像;将该前景部分所在的该目标图像的该背景部分的亮度与该图像存储数据库中的多个图像的背景部分的亮度的平均值的比值确定为该前景部分的亮度修正系数。
可选地,将该前景部分的色调、饱和度和亮度以及该背景图像的亮度输入参数模型,并获取该参数模型输出的标签值,根据该参数模型的输出的标签值,确定该前景部分的色系。
应理解,该参数模型用于指示在该目标图像的捕获场景下,多个色系的标签值,与前景部分的色调,饱和度和亮度以及背景部分的亮度的对应关系。
应理解,该前景部分的亮度可以为根据该亮度修正系数调整后的该前景部分的亮度也可以为没有调整的该前景部分的原始亮度。
可选地,根据该多个色系中每个色系设定的标签值和该图像存储数据库中的多个图像中的前景部分的色调、饱和度和亮度以及该每个图像中的背景部分的亮度进行算法训练,确定该参数模型,该多个图像与该目标图像为同一捕获场景下的图像。
在230中,根据该前景部分的色系,调整该前景部分的亮度。
可选地,将该前景部分的亮度调整为该前景部分的色系对应的亮度集合中的亮度。
可选地,根据该前景部分的色系,确定该前景部分的色系对应的亮度集合;根据该亮度集合,调整该前景部分的亮度。
可选地,该色系为黑暗色系、有色色系和白亮色系中的一种色系,该黑暗色系对应的亮度集合中的元素为a;该有色色系对应的亮度集合为大于等于b且小于等于c的亮度范围;该白亮色系对应的亮度集合中的元素为d,
其中,该a、该b、该c和该d满足关系式:
0≤a<b≤c<d≤1
该a、b、c和d均为常数。
应理解,根据该前景部分的色系,调整该前景部分的亮度并不是必须对该前景部分的亮度进行调整,而是根据该前景部分对应的色系和该前景部分对应的色系的亮度映射集合,确定是否调整该前景部分的亮度。如果该前景部分的亮度处于该前景部分对应的色系的亮度映射集合区间内,则不用对该前景部分的亮度进行调整。
应理解,该亮度集合可以包括一个元素,例如黑暗色系对应的亮度集合为{a},只包括元素a,白亮色系对应的亮度集合为{d},只包括元素d,该亮度集合还可以包括多个元素,例如有色色系对应的亮度集合为{b≤x≤c},该集合可以是离散的,即该集合的元素为大于等于 b和小于等于c之间的整数,该集合还可以是连续的,即该集合的元素为大于等于b和小于等于c之间的实数。
具体而言,如图3,图3示出了黑暗色系、有色色系和白亮色系的亮度集合的对应区间。对于判断为黑暗色系的前景目标图像或前景目标图像的一部分,将其V值VH映射为一个固定的较小V值a,即f(VH)=a;对于判断为有色色系的前景目标图像或前景目标图像的一部分,如果其V值VY小于或大于预定的V值集合[b,c],将其映射为[b,c]区间中与之最邻近的值,如果V值VY处于V值集合[b,c]之间,则VY不作调整。例如,若VY<=b,则f(VY)=b;若VY∈[b,c],则f(VY)=VY;若VY>=c,则f(VY)=c;对于判断为白亮色系的前景目标图像或前景目标图像的一部分,将其V值VW映射为一个固定的较大V值d,即f(VW)=d。
应理解,该参数的选取对于实验结果有着明显的影响。实际中,参数的选择要考虑以下一些因素:首先,参数分别对应了三种不同的色系,因此,三种参数的选取应符合三种色系分别对应的V值集合。例如,第一个参数即前面的参数a,它对应着黑暗色系,因此a的值应在应满足:0=<a<=0.18±δ,其中δ>=0,0.18+δ<b*,b是第二个参数,*式的含义是参数a不能和b相同,二者应该存在一定差异,这是因为a和b具有物理意义,a对应黑暗色系,而b对应有色色系。第二,参数选取的好坏或者优劣,基于经验的判断。因此,进行一定数量的试验是必要的。第三,参数的选取应该和整个应用系统结合起来。对于图像检索或者查询,为了提高检索效率以及特征存储所需要的空间,对特征做量化是通常的做法。在对特征做量化的情况下,参数的选择应结合量化步长进行考虑,使得相同色系的特征值在量化后尽可能处于同一量化区间。
本申请中,对于有色色系,为该色系设计了一个亮度值区间,当该前景部分的亮度值在预定义的区间内时,不需要做光照处理,降低由于处理而产生的计算和存储代价;而是提供较大的容忍集合,避免处理过程引入过多噪声导致严重的失真。
在本申请中,通过判断图像的色系后基于图像的色系调整图像的亮度值到一个共同的较小的集合,使得光照引起的同一对象(如行人)的不同图片的颜色差异尽可能地小,从而有效地降低了不同光照引起的目标颜色值的差异,进而有利于对象的检索或识别。
在240中,根据该前景部分的调整后的亮度,将该图像从该HSV空间转化到该RGB空间。根据处理后的该图像,在存储设备中查找该目标图像。
可选地,该存储设备中的每一图像都按照本申请中的方法进行了处理,如果查询一张该存储设备中的图像,可以直接在数据库中进行查询;如果查询一张非该存储设备中的图像,由于该存储设备中的每一张图像都根据本申请中的方法进行了处理,因此,先对该非该存储设备中的图像用本申请中的方法进行处理,然后在该存储设备中查询非该存储设备中的图像。因为该存储设备中的每张图像和该需要查询的图像都根据本申请中的方法进行了处理,根据不同的色系调整该目标图像的亮度,减小了光照引起的目标对象的颜色差异,提高了检索目标对象的准确率。
因此,在本申请中,图像处理设备通过将目标图像从红绿蓝RGB空间转换到色调饱和度亮度HSV空间,根据该目标图像的背景部分的亮度以及该目标图像的前景部分的亮度,确定该前景部分的色系;根据该前景部分的色系,调整该前景部分的亮度;将调整该前景部分亮度的该目标图像从该HSV空间转化到该RGB空间。通过根据该背景部分的亮度调整该前景部分的亮度,减小了不同光照引起的目标对象的亮度差异,根据该调整后的前景部分的亮度确 定该前景部分的色系提高了确定该前景部分的色系的准确率,根据该前景部分的色系调整该前景部分的亮度,并将调整该前景部分亮度的该目标图像从该HSV空间转化到该RGB空间,减小了不同光照下的图像亮度不同而导致的该目标对象颜色的差异,进而有利于目标对象的检索或识别。
图4是根据本申请另一实施例的一种处理图像的方法300的示意性流程图。如图4所示,该方法300包括以下内容。
在310中,将目标图像从红绿蓝RGB空间转换到色调饱和度亮度HSV空间。
在320中,当该目标图像的亮度属于多个色系中的第一色系的亮度范围,且与该第一色系的亮度范围的临界值的差值绝对值小于第一阈值时,根据该目标图像在该HSV空间的色调和饱和度,确定该前景部分的色系。
在330中,根据该目标图像的色系,调整该目标图像的亮度。
在340中,根据该目标图像的调整后的亮度,将该目标图像从该HSV空间转化到该RGB空间。
因此,在本申请中,图像处理设备通过将目标图像从红绿蓝RGB空间转换到色调饱和度亮度HSV空间,并且当该目标图像的亮度属于多个色系中的第一色系的亮度范围,且与该第一色系的亮度范围的临界值的差值绝对值小于第一阈值时,根据该目标图像在该HSV空间的色调和饱和度,确定该前景部分的色系,提高了根据仅亮度确定该目标图像的色系的准确性,根据该前景部分的色系调整该前景部分的亮度,并将调整该前景部分亮度的该目标图像从该HSV空间转化到该RGB空间,减小了不同光照下的图像亮度不同而导致的该目标对象颜色的差异,进而有利于目标对象的检索或识别。
应理解,上述方法200可以与该方法300结合判断该前景部分的色系,即当上述方法200经过调整后的该前景部分的亮度处于该第一色系的临界值时,可以根据该前景部分的H和S的组合关系确定该前景部分的色系,为了避免重复,此处不再赘述。
图5是根据本申请另一实施例的一种处理图像的方法400的示意性流程图。如图5所示,该方法400包括以下内容。
在410中,将目标图像从红绿蓝RGB空间转换到色调饱和度亮度HSV空间,该目标图像包括第一部分和第二部分,所述第一部分的亮度和所述第二部分的亮度属于第一色系的亮度范围,所述第一部分的亮度与所述第一色系的亮度范围的临界值的差值绝对值大于或等于第一阈值,所述第二部分的亮度与所述第一色系的亮度范围的临界值的差值绝对值小于所述第一阈值。
在420中,将第一色系确定为所述第一部分的色系;当所述第二部分的亮度与所述第一部分的亮度的差值绝对值大于或等于第二阈值时,根据所述第二部分在所述HSV空间的色调和饱和度,确定所述第二部分的色系,或当所述第二部分的亮度与所述第一部分的亮度的差值绝对值大于或等于第二阈值时,根据所述第二部分在所述HSV空间的色调和饱和度,确定所述第二部分的色系;或当所述第二部分的亮度与所述第一部分的亮度的差值绝对值大于或等于第二阈值时,将所述第二部分的亮度相邻的范围对应的色系确定为所述第二部分的色系;或,当所述第二部分的亮度与所述第二部分的亮度的差值绝对值小于所述第二阈值时,将所述第一色系确定为所述第二部分的色系。
在430中,根据该第一部分的色系和该第二部分的色系,调整该第一部分和第二部分的亮度。
在440中,根据该目标图像的调整后的亮度,将该目标图像从该HSV空间转化到该RGB空间。
因此,在本申请中,图像处理设备通过将目标图像从红绿蓝RGB空间转换到色调饱和度亮度HSV空间,根据该目标图像的第一部分和第二部分分别确定该第一部分和第二部分的色系,调整该第一部分和第二部分的亮度,使得光照引起的目标对象的不同图片的颜色差异尽可能地小,有效地降低了不同光照引起的目标颜色的差异,进而有利于目标对象的检索或识别。
图6是根据本申请的图像处理设备500的示意性框图。如图6所示,所述图像处理设备500包括:
转换模块510,用于将目标图像从红绿蓝RGB空间转换到色调饱和度亮度HSV空间,其中,该目标图像包括前景部分和背景部分。
第一处理模块520,用于根据该背景部分的亮度以及该前景部分的亮度,确定该前景部分的色系。
调整模块530,用于根据该前景部分的色系,调整该前景部分的亮度。
该转换模块510还用于:
根据该前景部分的调整后的亮度,将该图像从该HSV空间转化到该RGB空间。
可选地,该第一处理模块520具体用于:根据该背景部分的亮度,确定该前景部分的亮度修正系数;根据该前景部分的亮度修正系数,调整该前景部分的亮度;根据该前景部分的调整后的亮度,确定该前景部分的色系。
可选地,该第一处理模块520具体用于:根据该背景部分的亮度和背景亮度的区间范围,确定该背景部分所属的背景亮度的区间范围;确定该背景部分所属的背景亮度的区间范围对应的亮度修正系数为该前景部分的亮度修正系数。
可选地,该第一处理模块520具体用于:计算图像存储数据库中的多个图像的背景部分的亮度的平均值,该多个图像与该图像为同一捕获场景下的图像;根据该前景部分所在的该目标图像的该背景部分的亮度,以及该图像存储数据库中的多个图像的背景部分的亮度的平均值的比值确定为该前景部分的亮度修正系数。
可选地,该第一处理模块520具体用于:比较该前景部分的调整的亮度与多个色系的亮度范围,确定该前景部分的色系。
可选地,该第一处理模块520具体用于:当该前景部分的调整后的亮度属于多个色系中的第一色系的亮度范围,且与该第一色系的亮度范围的临界值的差值绝对值小于第一阈值时,根据该前景部分在该HSV空间的色调和饱和度,确定该前景部分的色系。
可选地,该第一处理模块520具体用于:将该前景部分划分为多个前景子部分;根据该背景部分的亮度,对该多个前景子部分中每个前景子部分的亮度进行调整;根据该每个前景子部分调整后的亮度,确定该每个前景子部分的色系;该调整模块430具体用于:根据该每个前景子部分的色系,调整该每个前景子部分的亮度。
可选地,该多个前景子部分包括第一前景子部分和第二前景子部分,该第一前景子部分调整后的亮度和该第二前景子部分调整后的亮度属于第一色系的亮度范围,该第一前景子部分调整后的亮度与该第一色系的亮度范围的临界值的差值绝对值大于或等于第一阈值,该第二前景子部分调整后的亮度与该第一色系的亮度范围的临界值的差值绝对值小于该第一阈值;
该第一处理模块520用于将第一色系确定为该第一前景子部分的色系;当该第二前景子部分调整后的亮度与该第一前景子部分调整后的亮度的差值绝对值大于或等于第二阈值时,根据该第二前景子部分在该HSV空间的色调和饱和度,确定该第二前景子部分的色系;或,当该第二前景子部分调整后的亮度与该第一前景子部分调整后的亮度的差值绝对值大于或等于第二阈值时,将该第二前景子部分调整的亮度相邻的范围对应的色系确定为该第二前景子部分的色系;或,当该第二前景子部分调整后的亮度与该第二前景子部分的亮度的差值绝对值小于该第二阈值时,将该第一色系确定为该第二前景子部分的色系。
可选地,该第一处理模块520还用于将该前景部分的色调、饱和度和亮度以及该背景图像的亮度输入参数模型,并获取该参数模型输出的标签值,其中,该参数模型用于指示在该目标图像的捕获场景下,多个色系的标签值,与前景部分的色调,饱和度和亮度以及背景部分的亮度的对应关系;根据该参数模型的输出的标签值,确定该前景部分的色系。
可选地,该图像处理设备还包括第二处理模块540,如图7所示。在该将该前景部分的色调、饱和度和亮度以及该背景部分的亮度输入参数模型之前,该第二处理模块540,用于根据该多个色系中每个色系设定的标签值和该图像存储数据库中的多个图像中的前景部分的色调、饱和度和亮度以及该每个图像中的背景部分的亮度进行算法训练,确定该参数模型,该多个图像与该目标图像为同一捕获场景下的图像。
可选地,该第一处理模块520用于根据该前景部分的色系,确定该前景部分的色系对应的亮度集合;根据该亮度集合,调整该前景部分的亮度。
可选地,该调整模块530用于根据该前景子部分的色系对该前景子部分的亮度进行调整,该色系为黑暗色系、有色色系和白亮色系中的一种色系,该黑暗色系对应的亮度集合中的元素为a;该有色色系对应的亮度集合为大于等于b且小于等于c的亮度范围;该白亮色系对应的亮度集合中的元素为d,
其中,该a、该b、该c和该d满足关系式:
0≤a<b≤c<d≤1
该a、b、c和d均为常数。
可选地,该图像处理备500还可以用于执行上述方法300。当该图像处理设备用于执行上述方法300时,该图像处理设备500包括:
转换模块510,用于将目标图像从红绿蓝RGB空间转换到色调饱和度亮度HSV空间。
第一处理模块520,用于当该目标图像的亮度属于多个色系中的第一色系的亮度范围,且与该第一色系的亮度范围的临界值的差值绝对值小于第一阈值时,根据该目标图像在该HSV空间的色调和饱和度,确定该前景部分的色系。
调整模块530,用于根据该目标图像的色系,调整该目标图像的亮度。
该转换模块510还用于:
根据该目标图像的调整后的亮度,将该目标图像从该HSV空间转化到该RGB空间。
可选地,该图像处理备500还可以用于执行上述方法300。当该图像处理设备用于执行上述方法300时,该图像处理设备500包括:
转换模块510,用于将目标图像从红绿蓝RGB空间转换到色调饱和度亮度HSV空间,该目标图像包括第一部分和第二部分,所述第一部分的亮度和所述第二部分的亮度属于第一色系的亮度范围,所述第一部分的亮度与所述第一色系的亮度范围的临界值的差值绝对值大于或等 于第一阈值,所述第二部分的亮度与所述第一色系的亮度范围的临界值的差值绝对值小于所述第一阈值,将第一色系确定为所述第一部分的色系。
第一处理模块520,用于当所述第二部分的亮度与所述第一部分的亮度的差值绝对值大于或等于第二阈值时,根据所述第二部分在所述HSV空间的色调和饱和度,确定所述第二部分的色系,或当所述第二部分的亮度与所述第一部分的亮度的差值绝对值大于或等于第二阈值时,将所述第二部分的亮度相邻的范围对应的色系确定为所述第二部分的色系;或,当所述第二部分的亮度与所述第二部分的亮度的差值绝对值小于所述第二阈值时,将所述第一色系确定为所述第二部分的色系。
调整模块530,用于根据该第一部分的色系和该第二部分的色系,分别调整该第一部分和第二部分的亮度。
该转换模块510还用于,根据该目标图像的调整后的亮度,将该目标图像从该HSV空间转化到该RGB空间。
图8示出了本申请提供的图像处理设备600的示意性框图,该图像处理设备600包括:
存储器610,用于存储程序,该程序包括代码;
收发器620,用于和其他设备进行通信;
处理器630,用于执行存储器610中的程序代码。
可选地,当该代码被执行时,该处理器630可以实现方法200或方法300中图像处理设备执行各个操作,收发器620用于在处理器630的驱动下执行具体的信号收发。为了简洁,在此不再赘述。
应理解,在本申请实施例中,该处理器630可以是中央处理单元(Central Processing Unit,CPU),该处理器630还可以是其他通用处理器、数字信号处理器、专用集成电路、现成可编程门阵列或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。
该存储器610可以包括只读存储器和随机存取存储器,并向处理器630提供指令和数据。存储器610的一部分还可以包括非易失性随机存取存储器。例如,存储器610还可以存储设备类型的信息。
收发器620可以是用于实现信号发送和接收功能。
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统、装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。
在本申请所提供的几个实施例中,应该理解到,所揭露的系统、装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信 连接,可以是电性,机械或其它的形式。
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。
所述功能如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(Read-Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。
以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以所述权利要求的保护范围为准。

Claims (30)

  1. 一种处理图像的方法,其特征在于,包括:
    将目标图像从红绿蓝RGB空间转换到色调饱和度亮度HSV空间,其中,所述目标图像包括前景部分和背景部分;
    根据所述背景部分的亮度以及所述前景部分的亮度,确定所述前景部分的色系;
    根据所述前景部分的色系,调整所述前景部分的亮度;
    根据所述前景部分的调整后的亮度,将所述目标图像从所述HSV空间转化到所述RGB空间。
  2. 根据权利要求1所述的方法,其特征在于,所述根据所述背景部分的亮度以及所述前景部分的亮度,确定所述前景部分的色系,包括:
    根据所述背景部分的亮度,确定所述前景部分的亮度修正系数;
    根据所述前景部分的亮度修正系数,调整所述前景部分的亮度;
    根据所述前景部分的调整后的亮度,确定所述前景部分的色系。
  3. 根据权利要求2所述的方法,其特征在于,所述根据所述背景部分的亮度,确定所述前景部分的亮度修正系数,包括:
    根据所述背景部分的亮度和背景亮度的范围,确定所述背景部分所属的背景亮度的范围;
    确定所述背景部分所属的背景亮度的范围对应的亮度修正系数为所述前景部分的亮度修正系数。
  4. 根据权利要求2所述的方法,其特征在于,所述根据所述背景部分的亮度,确定所述前景部分的亮度修正系数,包括:
    计算图像存储数据库中的多个图像的背景部分的亮度的平均值,所述多个图像与所述目标图像为同一捕获场景下的图像;
    根据所述前景部分所在的所述目标图像的所述背景部分的亮度,以及所述图像存储数据库中的多个图像的背景部分的亮度的平均值,确定所述前景部分的亮度修正系数。
  5. 根据权利要求2至4中任一项所述的方法,其特征在于,所述根据所述前景部分的调整后的亮度,确定所述前景部分的色系,包括:
    比较所述前景部分的调整的亮度与多个色系的亮度集合,确定所述前景部分的色系。
  6. 根据权利要求5所述的方法,其特征在于,所述比较所述前景部分的调整的亮度与多个色系的亮度范围,确定所述前景部分的色系,包括:
    当所述前景部分的调整后的亮度属于多个色系中的第一色系的亮度范围,且与所述第一色系的亮度范围的临界值的差值绝对值小于第一阈值时,根据所述前景部分在所述HSV空间的色调和饱和度,确定所述前景部分的色系;或
    当所述前景部分的调整后的亮度属于多个色系中的第一色系的亮度范围,且与所述第一色系的亮度范围的临界值的差值绝对值大于或等于所述第一阈值时,将所述第一色系确定为所述前景子部分的色系。
  7. 根据权利要求1至5中任一项所述的方法,其特征在于,所述根据所述背景部分的亮度以及所述前景部分的亮度,确定所述前景部分的色系包括:
    将所述前景部分划分为多个前景子部分;
    根据所述背景部分的亮度,对所述多个前景子部分中每个前景子部分的亮度进行调整;
    根据所述每个前景子部分调整后的亮度,确定所述每个前景子部分的色系;
    所述根据所述前景部分的色系,调整所述前景部分的亮度,包括:
    根据所述每个前景子部分的色系,调整所述每个前景子部分的亮度。
  8. 根据权利要求7所述的方法,其特征在于,所述多个前景子部分包括第一前景子部分和第二前景子部分,所述第一前景子部分调整后的亮度和所述第二前景子部分调整后的亮度属于第一色系的亮度范围,所述第一前景子部分调整后的亮度与所述第一色系的亮度范围的临界值的差值绝对值大于或等于第二阈值,所述第二前景子部分调整后的亮度与所述第一色系的亮度范围的临界值的差值绝对值小于所述第二阈值;
    所述根据所述每个前景子部分调整后的亮度,确定所述每个前景子部分的色系,包括:
    将第一色系确定为所述第一前景子部分的色系;
    当所述第二前景子部分调整后的亮度与所述第一前景子部分调整后的亮度的差值绝对值大于或等于第三阈值时,根据所述第二前景子部分在所述HSV空间的色调和饱和度,确定所述第二前景子部分的色系;或,当所述第二前景子部分调整后的亮度与所述第一前景子部分调整后的亮度的差值绝对值大于或等于所述第三阈值时,将所述第二前景子部分调整的亮度相邻的范围对应的色系确定为所述第二前景子部分的色系;或,当所述第二前景子部分调整后的亮度与所述第二前景子部分的亮度的差值绝对值小于所述第三阈值时,将所述第一色系确定为所述第二前景子部分的色系。
  9. 根据权利要求1至4中任一项所述的方法,其特征在于,根据所述背景部分的亮度以及所述前景部分的亮度,确定所述前景部分的色系,包括:
    将所述前景部分的色调、饱和度和亮度以及所述背景图像的亮度输入参数模型,并获取所述参数模型输出的标签值,
    其中,所述参数模型用于指示在所述目标图像的捕获场景下,多个色系的标签值,与前景部分的色调,饱和度和亮度以及背景部分的亮度的对应关系;
    根据所述参数模型的输出的标签值,确定所述前景部分的色系。
  10. 根据权利要求9所述的方法,其特征在于,所述将所述前景部分的色调、饱和度和亮度以及所述背景部分的亮度输入参数模型之前,所述方法还包括:
    根据所述多个色系中每个色系设定的标签值和所述图像存储数据库中的多个图像中的前景部分的色调、饱和度和亮度以及所述每个图像中的背景部分的亮度进行算法训练,确定所述参数模型,所述多个图像与所述目标图像为同一捕获场景下的图像。
  11. 根据权利要求1至10中任一项所述的方法,其特征在于,所述根据所述前景部分的色系,调整所述前景部分的亮度,包括:
    将所述前景部分的亮度调整为所述前景部分的色系对应的亮度集合中的亮度。
  12. 根据权利要求11所述的方法,其特征在于,所述将所述前景部分的亮度调整为所述前景部分的色系对应的亮度集合,包括:
    根据所述前景部分的色系,确定所述前景部分的色系对应的亮度集合;
    根据所述亮度集合,调整所述前景部分的亮度。
  13. 根据权利要求12所述的方法,其特征在于,所述色系为黑暗色系、有色色系和白亮色系中的一种色系,所述黑暗色系对应的亮度集合中的元素为a;所述有色色系对应的亮度集合为大于等于b且小于等于c的亮度范围;所述白亮色系对应的亮度集合中的元素为d,
    其中,所述a、所述b、所述c和所述d满足关系式:
    0≤a<b≤c<d≤1
    所述a、b、c和d均为常数。
  14. 一种处理图像的方法,其特征在于,包括:
    将目标图像从红绿蓝RGB空间转换到色调饱和度亮度HSV空间;
    当所述目标图像的亮度属于多个色系中的第一色系的亮度范围,且与所述第一色系的亮度范围的临界值的差值绝对值小于第一阈值时,根据所述目标图像在所述HSV空间的色调和饱和度,确定所述目标图像的色系;或,当所述目标图像的亮度属于多个色系中的第一色系的亮度范围,且与所述第一色系的亮度范围的临界值的差值绝对值大于等于所述第一阈值时,将所述第一色系确定为所述目标图像的色系;
    根据所述目标图像的色系,调整所述目标图像的亮度;根据所述目标图像的调整后的亮度,将所述图像从所述HSV空间转化到所述RGB空间。
  15. 一种处理图像的方法,其特征在于,包括:
    将目标图像从红绿蓝RGB空间转换到色调饱和度亮度HSV空间,所述目标图像包括第一部分和第二部分;
    所述第一部分的亮度和所述第二部分的亮度属于第一色系的亮度范围,所述第一部分的亮度与所述第一色系的亮度范围的临界值的差值绝对值大于或等于第一阈值,所述第二部分的亮度与所述第一色系的亮度范围的临界值的差值绝对值小于所述第一阈值,将第一色系确定为所述第一部分的色系;
    当所述第二部分的亮度与所述第一部分的亮度的差值的绝对值大于或等于第二阈值时,根据所述第二部分在所述HSV空间的色调和饱和度,确定所述第二部分的色系;或当所述第二部分的亮度与所述第一部分的亮度的差值绝对值大于或等于第二阈值时,将所述第二部分的亮度相邻的范围对应的色系确定为所述第二部分的色系;或,当所述第二部分的亮度与所述第二部分的亮度的差值绝对值小于所述第二阈值时,将所述第一色系确定为所述第二部分的色系;
    根据所述第一部分和所述第二部分的色系,调整所述第一部分和第二部分的亮度;
    根据目标图像的调整后的亮度,将所述目标图像从所述HSV空间转化到所述RGB空间。
  16. 一种处理图像的设备,其特征在于,包括:
    转换模块,用于将目标图像从红绿蓝RGB空间转换到色调饱和度亮度HSV空间,其中,所述目标图像包括前景部分和背景部分;
    第一处理模块,用于根据所述背景部分的亮度以及所述前景部分的亮度,确定所述前景部分的色系;
    调整模块,用于根据所述前景部分的色系,调整所述前景部分的亮度;
    所述转换模块用于:
    根据所述前景部分的调整后的亮度,将所述目标图像从所述HSV空间转化到所述RGB空间。
  17. 根据权利要求16所述的设备,其特征在于,所述第一处理模块具体用于:
    根据所述背景部分的亮度,确定所述前景部分的亮度修正系数;
    根据所述前景部分的亮度修正系数,调整所述前景部分的亮度;
    根据所述前景部分的调整后的亮度,确定所述前景部分的色系。
  18. 根据权利要求17所述的设备,其特征在于,所述第一处理模块具体用于:
    根据所述背景部分的亮度和背景亮度的区间范围,确定所述背景部分所属的背景亮度的区间范围;
    确定所述背景部分所属的背景亮度的区间范围对应的亮度修正系数为所述前景部分的亮度修正系数。
  19. 根据权利要求17所述的设备,其特征在于,所述第一处理模块具体用于:
    计算图像存储数据库中的多个图像的背景部分的亮度的平均值,所述多个图像与所述目标图像为同一捕获场景下的图像;
    根据所述前景部分所在的所述目标图像的所述背景部分的亮度,以及所述图像存储数据库中的多个图像的背景部分的亮度的平均值的比值确定为所述前景部分的亮度修正系数。
  20. 根据权利要求17至19中任一项所述的设备,其特征在于,所述第一处理模块还用于:
    比较所述前景部分的调整的亮度与多个色系的亮度范围,确定所述前景部分的色系。
  21. 根据权利要求20所述的设备,其特征在于,所述第一处理模块具体用于:
    当所述前景部分的调整后的亮度属于多个色系中的第一色系的亮度范围,且与所述第一色系的亮度范围的临界值的差值绝对值小于第一阈值时,根据所述前景部分在所述HSV空间的色调和饱和度,确定所述前景部分的色系;或
    当所述前景部分的调整后的亮度属于多个色系中的第一色系的亮度范围,且与所述第一色系的亮度范围的临界值的差值绝对值大于或等于所述第一阈值时,将所述第一色系确定为所述前景子部分的色系。
  22. 根据权利要求16至20中任一项所述的设备,其特征在于,所述第一处理模块具体用于:
    将所述前景部分划分为多个前景子部分;
    根据所述背景部分的亮度,对所述多个前景子部分中每个前景子部分的亮度进行调整;
    根据所述每个前景子部分调整后的亮度,确定所述每个前景子部分的色系;
    所述调整模块具体用于:
    根据所述每个前景子部分的色系,调整所述每个前景子部分的亮度。
  23. 根据权利要求22所述的设备,其特征在于,所述多个前景子部分包括第一前景子部分和第二前景子部分,所述第一前景子部分调整后的亮度和所述第二前景子部分调整后的亮度属于第一色系的亮度范围,所述第一前景子部分调整后的亮度与所述第一色系的亮度范围的临界值的差值绝对值大于或等于第二阈值,所述第二前景子部分调整后的亮度与所述第一色系的亮度范围的临界值的差值绝对值小于所述第二阈值;
    所述第一处理模块具体用于:
    将第一色系确定为所述第一前景子部分的色系;
    当所述第二前景子部分调整后的亮度与所述第一前景子部分调整后的亮度的差值绝对值大于或等于第三阈值时,根据所述第二前景子部分在所述HSV空间的色调和饱和度,确定所述第二前景子部分的色系;或,当所述第二前景子部分调整后的亮度与所述第一前景子部分调整后的亮度的差值绝对值大于或等于所述第三阈值时,将所述第二前景子部分调整的亮度相邻的范围对应的色系确定为所述第二前景子部分的色系;或,当所述第二前景子部分调整后的亮度与所述第二前景子部分的亮度的差值绝对值小于所述第三阈值时,将所述第一色系 确定为所述第二前景子部分的色系。
  24. 根据权利要求16至20中任一项所述的设备,其特征在于,所述第一处理模块具体用于:
    将所述前景部分的色调、饱和度和亮度以及所述背景图像的亮度输入参数模型,并获取所述参数模型输出的标签值,
    其中,所述参数模型用于指示在所述目标图像的捕获场景下,多个色系的标签值,与前景部分的色调,饱和度和亮度以及背景部分的亮度的对应关系;
    根据所述参数模型的输出的标签值,确定所述前景部分的色系。
  25. 根据权利要求24所述的设备,其特征在于,所述将所述前景部分的色调、饱和度和亮度以及所述背景部分的亮度输入参数模型之前,所述设备还包括:
    第二处理模块,用于根据所述多个色系中每个色系设定的标签值和所述图像存储数据库中的多个图像中的前景部分的色调、饱和度和亮度以及所述每个图像中的背景部分的亮度进行算法训练,确定所述参数模型,所述多个图像与所述目标图像为同一捕获场景下的图像。
  26. 根据权利要求16至25中任一项所述的设备,其特征在于,所述根据所述前景部分的色系,调整所述前景部分的亮度,包括:
    将所述前景部分的亮度调整为所述前景部分的色系对应的亮度集合中的亮度。
  27. 根据权利要求26所述的设备,其特征在于,所述将所述前景部分的亮度调整为所述前景部分的色系对应的亮度集合,包括:
    根据所述前景部分的色系,确定所述前景部分的色系对应的亮度集合;
    根据所述亮度集合,调整所述前景部分的亮度。
  28. 根据权利要求27所述的设备,其特征在于,所述色系为黑暗色系、有色色系和白亮色系中的一种色系,所述黑暗色系对应的亮度集合中的元素为a;所述有色色系对应的亮度集合为大于等于b且小于等于c的亮度范围;所述白亮色系对应的亮度集合中的元素为d,
    其中,所述a、所述b、所述c和所述d满足关系式:
    0≤a<b≤c<d≤1
    所述a、b、c和d均为常数。
  29. 一种处理图像的设备,其特征在于,包括:
    转换模块,用于将目标图像从红绿蓝RGB空间转换到色调饱和度亮度HSV空间;
    处理模块,用于当所述目标图像的亮度属于多个色系中的第一色系的亮度范围,且与所述第一色系的亮度范围的临界值的差值绝对值小于第一阈值时,根据所述目标图像在所述HSV空间的色调和饱和度,确定所述前景部分的色系;或,当所述目标图像的亮度属于多个色系中的第一色系的亮度范围,且与所述第一色系的亮度范围的临界值的差值绝对值大于等于所述第一阈值时,将所述第一色系确定为所述目标图像的色系;
    调整模块,用于根据所述目标图像的色系,调整所述目标图像的亮度;
    所述转换模块用于:
    根据所述目标图像的调整后的亮度,将所述图像从所述HSV空间转化到所述RGB空间。
  30. 一种处理图像的设备,其特征在于,包括:
    转换模块,用于将目标图像从红绿蓝RGB空间转换到色调饱和度亮度HSV空间,所述目标图像包括第一部分和第二部分;
    处理模块,用于当所述第一部分的亮度和所述第二部分的亮度属于第一色系的亮度范围, 所述第一部分的亮度与所述第一色系的亮度范围的临界值的差值绝对值大于或等于第一阈值,所述第二部分的亮度与所述第一色系的亮度范围的临界值的差值绝对值小于所述第一阈值,将第一色系确定为所述第一部分的色系;
    所述处理模块用于:当所述第二部分的亮度与所述第一部分的亮度的差值的绝对值大于或等于第二阈值时,根据所述第二部分在所述HSV空间的色调和饱和度,确定所述第二部分的色系;或当所述第二部分的亮度与所述第一部分的亮度的差值绝对值大于或等于第二阈值时,将所述第二部分的亮度相邻的范围对应的色系确定为所述第二部分的色系;或,当所述第二部分的亮度与所述第二部分的亮度的差值绝对值小于所述第二阈值时,将所述第一色系确定为所述第二部分的色系;
    调整模块,用于根据所述第一部分和所述第二部分的色系,调整所述第一部分和第二部分的亮度;
    所述转换模块用于根据目标图像的调整后的亮度,将所述目标图像从所述HSV空间转化到所述RGB空间。
PCT/CN2018/071783 2017-02-16 2018-01-08 图像处理的方法和设备 WO2018149253A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201710082941.8A CN108446705B (zh) 2017-02-16 2017-02-16 图像处理的方法和设备
CN201710082941.8 2017-02-16

Publications (1)

Publication Number Publication Date
WO2018149253A1 true WO2018149253A1 (zh) 2018-08-23

Family

ID=63170502

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/071783 WO2018149253A1 (zh) 2017-02-16 2018-01-08 图像处理的方法和设备

Country Status (2)

Country Link
CN (1) CN108446705B (zh)
WO (1) WO2018149253A1 (zh)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109853267A (zh) * 2018-12-29 2019-06-07 杭州智数创联科技有限公司 一种快速制作数码印花色卡的方法
CN113223016A (zh) * 2021-05-13 2021-08-06 上海西虹桥导航技术有限公司 一种植物秧苗的图像分割方法、装置、电子设备和介质
CN114828337A (zh) * 2022-07-01 2022-07-29 杭州罗莱迪思科技股份有限公司 户外led染色灯控制方法及其应用

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110865856B (zh) 2018-08-27 2022-04-22 华为技术有限公司 一种界面元素颜色显示方法及装置
CN109308687A (zh) * 2018-09-06 2019-02-05 百度在线网络技术(北京)有限公司 用于调节图像亮度的方法和装置
CN109509461B (zh) * 2018-12-19 2020-11-06 惠科股份有限公司 显示面板的亮度调节方法及装置
CN109871455B (zh) * 2019-01-28 2020-11-10 厦门理工学院 碳化竹片分色方法及系统
CN110726725A (zh) * 2019-10-23 2020-01-24 许昌许继软件技术有限公司 一种输电线路金具锈蚀检测方法及装置
CN111882493A (zh) * 2020-06-22 2020-11-03 浙江大华技术股份有限公司 图像的颜色调整方法、装置、设备和计算机可读存储介质
CN111966933A (zh) * 2020-07-10 2020-11-20 口碑(上海)信息技术有限公司 颜色数据推荐方法及装置
CN113487700A (zh) * 2021-06-22 2021-10-08 维沃移动通信有限公司 图像处理方法、装置和电子设备

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1849601A (zh) * 2003-09-08 2006-10-18 皇家飞利浦电子股份有限公司 索引和搜索图形元素的方法和设备
US20100322513A1 (en) * 2009-06-19 2010-12-23 Sharp Laboratories Of America, Inc. Skin and sky color detection and enhancement system
CN102096911A (zh) * 2011-01-31 2011-06-15 格科微电子(上海)有限公司 亮度提升的方法
CN106327437A (zh) * 2016-08-10 2017-01-11 大连海事大学 一种彩色文本图像校正方法及系统

Family Cites Families (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US4007487A (en) * 1975-09-25 1977-02-08 The Association Of Motion Picture And Television Producers Inc. Electronic composite photography with color control
US5194008A (en) * 1992-03-26 1993-03-16 Spartanics, Ltd. Subliminal image modulation projection and detection system and method
CN1224242C (zh) * 2003-04-14 2005-10-19 浙江大学 数字图像处理中以任意图像为背景的快速抠图方法
US7663689B2 (en) * 2004-01-16 2010-02-16 Sony Computer Entertainment Inc. Method and apparatus for optimizing capture device settings through depth information
US8290293B2 (en) * 2006-10-17 2012-10-16 Samsung Electronics Co., Ltd. Image compensation in regions of low image contrast
CN101304488B (zh) * 2008-06-20 2010-12-15 北京中星微电子有限公司 一种图象采集的方法和装置
CN101998063B (zh) * 2009-08-20 2012-08-29 财团法人工业技术研究院 前景图像分离方法
CN102013006B (zh) * 2009-09-07 2013-03-13 泉州市铁通电子设备有限公司 一种基于逆光环境的人脸自动检测识别的方法
CN102881260B (zh) * 2009-09-16 2015-01-28 致伸科技股份有限公司 图像处理方法及装置
CN102270427B (zh) * 2010-06-04 2014-10-29 英华达(上海)电子有限公司 增强电子书阅读效果的方法和装置、电子终端
CN102075780B (zh) * 2011-02-25 2014-02-26 福建华映显示科技有限公司 立体影像产生装置及其方法
CN103123725A (zh) * 2011-11-18 2013-05-29 鸿富锦精密工业(深圳)有限公司 图像分析装置及分析方法
JP5903927B2 (ja) * 2012-02-21 2016-04-13 セイコーエプソン株式会社 画像処理装置、画像処理方法、およびプログラム
CN103208126B (zh) * 2013-04-17 2016-04-06 同济大学 一种自然环境下运动物体监测方法
CN104899881B (zh) * 2015-05-28 2017-11-28 湖南大学 一种视频图像中运动车辆阴影检测方法
CN105354554A (zh) * 2015-11-12 2016-02-24 西安电子科技大学 基于颜色和奇异值特征的人脸活体检测方法
CN105488793B (zh) * 2015-11-26 2019-01-29 西安诺瓦电子科技有限公司 图像显示方法以及图像处理方法

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1849601A (zh) * 2003-09-08 2006-10-18 皇家飞利浦电子股份有限公司 索引和搜索图形元素的方法和设备
US20100322513A1 (en) * 2009-06-19 2010-12-23 Sharp Laboratories Of America, Inc. Skin and sky color detection and enhancement system
CN102096911A (zh) * 2011-01-31 2011-06-15 格科微电子(上海)有限公司 亮度提升的方法
CN106327437A (zh) * 2016-08-10 2017-01-11 大连海事大学 一种彩色文本图像校正方法及系统

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109853267A (zh) * 2018-12-29 2019-06-07 杭州智数创联科技有限公司 一种快速制作数码印花色卡的方法
CN109853267B (zh) * 2018-12-29 2021-08-20 杭州智数创联科技有限公司 一种快速制作数码印花色卡的方法
CN113223016A (zh) * 2021-05-13 2021-08-06 上海西虹桥导航技术有限公司 一种植物秧苗的图像分割方法、装置、电子设备和介质
CN114828337A (zh) * 2022-07-01 2022-07-29 杭州罗莱迪思科技股份有限公司 户外led染色灯控制方法及其应用
CN114828337B (zh) * 2022-07-01 2022-09-27 杭州罗莱迪思科技股份有限公司 户外led染色灯控制方法及其应用

Also Published As

Publication number Publication date
CN108446705B (zh) 2021-03-23
CN108446705A (zh) 2018-08-24

Similar Documents

Publication Publication Date Title
WO2018149253A1 (zh) 图像处理的方法和设备
US11323676B2 (en) Image white balance processing system and method
US20210006760A1 (en) Meta-learning for camera adaptive color constancy
WO2017215527A1 (zh) Hdr场景侦测方法、装置和计算机存储介质
US20150131902A1 (en) Digital Image Analysis
KR20070090224A (ko) 전자 색 이미지 채도 처리 방법
CN112218065B (zh) 图像白平衡方法、系统、终端设备及存储介质
CN115496668A (zh) 图像处理方法、装置、电子设备及存储介质
WO2020093653A1 (zh) 色彩调整方法、色彩调整装置、电子设备及计算机可读存储介质
CN111626967A (zh) 图像增强方法、装置、计算机装置及可读存储介质
US7885458B1 (en) Illuminant estimation using gamut mapping and scene classification
WO2020119454A1 (zh) 一种对图像进行颜色还原的方法和装置
US20220377297A1 (en) Data pre-processing for cross sensor automatic white balance
CN111079637B (zh) 田间图像中分割油菜花的方法、装置、设备及存储介质
Mazin et al. Estimation of illuminants from projections on the planckian locus
CN111523551A (zh) 蓝色目标的二值化方法、装置和设备
Sazzad et al. Establishment of an efficient color model from existing models for better gamma encoding in image processing
CN114187515A (zh) 图像分割方法和图像分割装置
WO2022120799A9 (zh) 图像处理方法、装置、电子设备及存储介质
CN112016621B (zh) 分类模型的训练方法、颜色的分类方法及电子设备
WO2022011975A1 (zh) 白平衡校正方法、装置、设备和存储介质
WO2023284528A1 (zh) 一种图像增强方法、装置、计算机设备和存储介质
Li et al. Contrast enhancement algorithm for outdoor infrared images based on local gradient-grayscale statistical feature
US20180091788A1 (en) Display apparatus and recording medium
CN113793291A (zh) 一种图像融合方法、装置、电子设备及存储介质

Legal Events

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

Ref document number: 18754658

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 18754658

Country of ref document: EP

Kind code of ref document: A1