WO2019000409A1 - 一种颜色检测的方法及终端 - Google Patents

一种颜色检测的方法及终端 Download PDF

Info

Publication number
WO2019000409A1
WO2019000409A1 PCT/CN2017/091172 CN2017091172W WO2019000409A1 WO 2019000409 A1 WO2019000409 A1 WO 2019000409A1 CN 2017091172 W CN2017091172 W CN 2017091172W WO 2019000409 A1 WO2019000409 A1 WO 2019000409A1
Authority
WO
WIPO (PCT)
Prior art keywords
image
color
color card
brightness
tested
Prior art date
Application number
PCT/CN2017/091172
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 华为技术有限公司
Priority to EP17915519.7A priority Critical patent/EP3637763B1/en
Priority to CN201780029922.7A priority patent/CN109155071B/zh
Priority to PCT/CN2017/091172 priority patent/WO2019000409A1/zh
Priority to US16/627,636 priority patent/US11284013B2/en
Publication of WO2019000409A1 publication Critical patent/WO2019000409A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/70Circuitry for compensating brightness variation in the scene
    • H04N23/74Circuitry for compensating brightness variation in the scene by influencing the scene brightness using illuminating means
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/90Determination of colour characteristics
    • 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/92Dynamic range modification of images or parts thereof based on global image properties
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • G06T7/0012Biomedical image inspection
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M1/00Substation equipment, e.g. for use by subscribers
    • H04M1/72Mobile telephones; Cordless telephones, i.e. devices for establishing wireless links to base stations without route selection
    • H04M1/724User interfaces specially adapted for cordless or mobile telephones
    • H04M1/72448User interfaces specially adapted for cordless or mobile telephones with means for adapting the functionality of the device according to specific conditions
    • H04M1/72454User interfaces specially adapted for cordless or mobile telephones with means for adapting the functionality of the device according to specific conditions according to context-related or environment-related conditions
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N1/00Scanning, transmission or reproduction of documents or the like, e.g. facsimile transmission; Details thereof
    • H04N1/46Colour picture communication systems
    • H04N1/56Processing of colour picture signals
    • H04N1/60Colour correction or control
    • H04N1/603Colour correction or control controlled by characteristics of the picture signal generator or the picture reproducer
    • H04N1/6033Colour correction or control controlled by characteristics of the picture signal generator or the picture reproducer using test pattern analysis
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N1/00Scanning, transmission or reproduction of documents or the like, e.g. facsimile transmission; Details thereof
    • H04N1/46Colour picture communication systems
    • H04N1/56Processing of colour picture signals
    • H04N1/60Colour correction or control
    • H04N1/6083Colour correction or control controlled by factors external to the apparatus
    • H04N1/6086Colour correction or control controlled by factors external to the apparatus by scene illuminant, i.e. conditions at the time of picture capture, e.g. flash, optical filter used, evening, cloud, daylight, artificial lighting, white point measurement, colour temperature
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N17/00Diagnosis, testing or measuring for television systems or their details
    • H04N17/002Diagnosis, testing or measuring for television systems or their details for television cameras
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/10Cameras or camera modules comprising electronic image sensors; Control thereof for generating image signals from different wavelengths
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/56Cameras or camera modules comprising electronic image sensors; Control thereof provided with illuminating means
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/70Circuitry for compensating brightness variation in the scene
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/70Circuitry for compensating brightness variation in the scene
    • H04N23/71Circuitry for evaluating the brightness variation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/80Camera processing pipelines; Components thereof
    • H04N23/84Camera processing pipelines; Components thereof for processing colour signals
    • H04N23/88Camera processing pipelines; Components thereof for processing colour signals for colour balance, e.g. white-balance circuits or colour temperature control
    • 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/30Subject of image; Context of image processing
    • G06T2207/30004Biomedical image processing
    • G06T2207/30088Skin; Dermal

Definitions

  • the present application relates to the field of image processing technologies, and in particular, to a method and a terminal for color detection.
  • Color detection appears in every aspect of life.
  • the typical color detection is skin color detection.
  • skin color detection can be widely used in various industries. For example, skin color detection is used in the clothing industry, and skin color detection is used to obtain the user's skin condition.
  • the user's skin color provides accurate clothing color matching suggestions; skin color detection is used in the cosmetics industry, according to the user's skin color, the user selects the correct foundation color number, eye shadow color, lipstick color number, etc.
  • skin color detection can also be used in the health industry, according to The user's skin color determines the current user's skin condition can provide some skin care advice, and can also provide some feasibility recommendations for disease prevention.
  • skin color detection is based on a graphic image processing technique, first obtaining an image of a skin to be tested, and then detecting a skin area to be tested in the image to calculate a skin color value.
  • the skin image to be tested due to the influence of the illumination conditions during imaging, the skin image to be tested usually has a certain color difference with the real skin. Therefore, the color of the skin image to be tested is used as the skin color detection result, which inevitably leads to errors in the results.
  • common skin color detection methods include image statistics based methods and color card based methods, as follows:
  • the basic principle is to use the mathematical statistics algorithm to estimate the color of the illumination source during imaging, and then remove the influence of the light source to restore the true color of the image to a greater extent.
  • This method is widely used, but separating the illumination component and the intrinsic component from a single input image is a morbid problem from a mathematical point of view, and the solution is difficult.
  • this method can only be applied to a relatively simple coarse-grained scene. The skin color detection still cannot achieve a good detection effect for a scene that requires accurate restoration of the true color.
  • a standard color card is placed near the skin to be tested, and an image of the skin to be tested and the standard color card is taken at the same time, and the entire image is color-calibrated according to the relationship between the color of the color card in the image and the true color of the color card, and then the calibration image is detected.
  • Skin area calculate skin tone value.
  • the detection result has high accuracy, but the color card is required every time the skin color is measured, and the user is required to carry the color card to take the image at any time, which is inconvenient to use.
  • the embodiment of the present application provides a method and a terminal for color detection, which are used to solve the problem that the color detection method existing in the prior art cannot ensure accuracy and convenience at the same time.
  • the embodiment of the present application provides a method for color detection, the method includes: acquiring, by a terminal, a color temperature of a light source and a brightness of a scene when the image to be tested is imaged; and determining a color temperature and a reference of the light source when the terminal is imaged based on the reference color card image Corresponding relationship of the color card images, according to the acquired color temperature of the light source, selecting a reference color card image from the reference color card data set preset in the terminal; the terminal is based on the scene brightness when the image to be tested is imaged, Determining a target image brightness of the image to be tested according to a preset image brightness as a function of scene brightness; the terminal adjusting a brightness of the selected reference color card image to the target image brightness, and adjusting the adjusted reference
  • the color card image is used as a calibration color card image; the terminal calibrates the image to be tested according to the relationship between the color of the pre-stored standard color card image and the color of the calibration color card image, and
  • the image to be tested needs to be calibrated, and the color between the calibration color card image and the standard color card image related to the color temperature of the light source and the brightness of the scene when the image to be tested is imaged needs to be used in the calibration process.
  • the relationship is used to determine the color calibration information, which can ensure that the image to be tested after calibration is less affected by the imaging environment, and is the image to be tested that is close to the real color, so that the final determined color value is closer to the real value; and the entire color is detected.
  • the parameters required by the terminal are the color temperature of the light source and the brightness of the scene when the image to be tested is imaged, and the user does not need to perform additional operations, thereby further improving the convenience of color detection.
  • the manner in which the terminal selects from the reference color card data set may be various, and may be selected according to the brightness of the scene when the image to be tested is imaged, or may be selected according to the color temperature when the image to be tested is imaged;
  • the terminal selects, from the preset reference color card data set, a reference color card image whose light source color temperature is the closest to the acquired light source color temperature when the reference color card image is imaged;
  • the terminal selects, from the preset reference color card data set, at least one reference color card whose difference between the color temperature of the light source and the color temperature of the acquired light source is within a set threshold range when the reference color card image is imaged. And selecting a reference color card image from the at least one reference color card image.
  • the color temperature of the light source is a main factor affecting the color of the image.
  • the terminal prefers to select the reference color card image from the reference color card data set according to the acquired color temperature, and the selection is based on the color temperature obtained when the acquired color temperature and the reference color card image are imaged.
  • the color temperature is determined by satisfying a certain preset relationship, so that the selected reference color card image is related to the color temperature when the image to be tested is imaged.
  • the preset image brightness as a function of scene brightness may be a general image brightness as a function of scene brightness, or may be image brightness and scene brightness for a certain type of image. a functional relationship; a preferred image brightness as a function of scene brightness may be an image of the scene brightness and each reference color card image when imaging each reference color card image in the predetermined reference color card data set The correspondence between the brightness is analyzed.
  • the terminal analyzes the correspondence between the brightness of the scene when each reference color card image is imaged and the image brightness of each reference color card image to determine the relationship between the brightness of the image and the brightness of the scene, and the obtained function relationship is more applicable.
  • the brightness adjustment of the reference color card image can improve the accuracy of the target brightness of the image to be tested.
  • the terminal determines color calibration information according to a pre-stored standard color card image and color values of color blocks of the same position on the calibration color card image;
  • the color calibration information represents a standard color card image The mapping relationship between the color value and the color value of the calibration color card image;
  • the terminal performs color calibration on the image to be tested according to the color calibration information.
  • the color value of the color patch at the same position on the calibration color card image can be used to determine the calibration of the image to be tested.
  • Time The required color calibration information by using this calibration method, can restore the true color of the image to be tested to a large extent, so as to remove the influence of the color temperature of the light source and the brightness of the scene to be measured as much as possible.
  • the terminal determines the color value of the calibrated image to be tested according to the color value of each pixel in the calibrated image to be tested.
  • the terminal determines the color value by using the calibrated image to be tested, and the determined color value is closer to the real value.
  • the embodiment of the present application further provides a terminal, where the terminal has a function of implementing terminal behavior in the foregoing method instance.
  • the functions may be implemented by hardware or by corresponding software implemented by hardware.
  • the hardware or software includes one or more modules corresponding to the functions described above.
  • the structure of the terminal includes an obtaining unit and a processing unit, and the units may perform corresponding functions in the foregoing method examples.
  • the units may perform corresponding functions in the foregoing method examples.
  • the detailed description in the method example which is not described herein.
  • the structure of the terminal includes a processor and a memory, and the processor is configured to support the terminal to perform a corresponding function in the above method.
  • the memory is coupled to the processor, which stores program instructions and data necessary for the terminal.
  • the embodiment of the present application further provides a computer storage medium, where the software program stores a software program, where the software program can implement the first aspect or the first step when being read and executed by one or more processors Any of the aspects provided by the design.
  • the embodiment of the present application further provides a computer program product comprising instructions, when executed on a computer, causing the computer to perform the method provided by any one of the above first aspect or the first aspect.
  • the terminal when processing the image to be tested, determines the calibration color card image according to the color temperature of the light source and the brightness of the scene when the image to be tested is imaged, and tests the color relationship according to the color relationship between the standard color card image and the calibration color card image.
  • the image is calibrated to restore the true color of the image to be tested, so that the final color value is closer to the real value, which can effectively improve the accuracy of color detection.
  • the terminal only needs to determine the image to be tested.
  • the color temperature of the light source and the brightness of the scene can complete the calibration of the image to be tested, and the user can prepare the color card, which can improve the convenience of color detection.
  • FIG. 1 is a schematic structural diagram of a terminal according to an embodiment of the present application.
  • FIG. 3 is a schematic structural diagram of a reference color card data set according to an embodiment of the present disclosure
  • FIG. 4 is a flowchart of an example of color detection according to an embodiment of the present application.
  • FIG. 5 is a schematic structural diagram of a color detecting terminal according to an embodiment of the present application.
  • FIG. 6 is a schematic structural diagram of a color detecting terminal according to an embodiment of the present application.
  • the present application provides a color detection method and terminal for the terminal to perform calibration based on the obtained color temperature and scene brightness of the light source when shooting the image to be tested, and the pre-stored reference color card image set to be restored as much as possible. By measuring the true color of the image, the color value of the image to be tested can be obtained more accurately.
  • a terminal which may also be referred to as a device, is a terminal that can communicate with other devices or has an image that can detect the brightness of the scene and the color temperature of the light source.
  • the color temperature of the light source is the physical quantity describing the color of the main light source during image imaging, which is related to the type of light source in the imaging scene.
  • Scene brightness is to describe the brightness of the overall environment during imaging.
  • the brightness of the scene is related to the illumination intensity of each light source or the illumination intensity such as the light intensity and the amount of light passing through the imaging.
  • the illumination parameters such as the light intensity of the light source can be used to determine the scene. brightness.
  • a reference color card data set which stores a plurality of reference color card images and related parameter information when each reference color card image is imaged; and the reference color card image may be a color obtained by shooting a standard color card in different environments; Card image, when shooting a standard color card, it is necessary to determine relevant parameter information when the color card image is imaged, for example, light source intensity, light source color temperature, scene brightness, etc.; different environments may affect related parameters during image imaging, so that shooting The color card images are different.
  • the standard color card image is a uniform color card image used for color selection and comparison.
  • the color in the standard color card image refers to the color removed from the imaging environment.
  • Color calibration information which is information determined by the standard color card image and the calibration color card image, which is determined according to the color relationship between the image blocks at the same position on the two color card images.
  • color value can use LAB (color model) value, can also use RGB (red green blue color mode) value to represent, but not limited to the above two color values, any color space that can be used to characterize color is applicable
  • LAB color model
  • RGB red green blue color mode
  • Image brightness which is used to describe the physical quantity of the brightness of the image.
  • the brightness of the image can be averaged by the brightness value of each pixel in the image, and the average value is taken as the image brightness, and the brightness value of the image in the main area of the image can also be used.
  • image brightness any value that can characterize the degree of image shading can be used as the image brightness of the embodiment of the present invention.
  • multiple means two or more.
  • the color detection scheme of the embodiment of the present application can be applied to various terminals, including but not limited to personal computers, server computers, handheld or laptop devices, mobile devices (such as mobile phones, mobile phones, tablets, personal digital assistants). , media players, etc.), consumer electronics, small computers, mainframe computers, and more.
  • mobile devices such as mobile phones, mobile phones, tablets, personal digital assistants).
  • media players, etc. consumer electronics, small computers, mainframe computers, and more.
  • the mobile phone 100 includes a display device 110, a processor 120, and a memory 130.
  • the memory 130 can be used to store software programs and data, and the processor 120 executes various functional applications and data processing of the mobile phone 100 by running software programs and data stored in the memory 130.
  • the memory 130 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application required for at least one function (such as an image collection function, etc.), and the like; and the storage data area may be stored according to the use of the mobile phone 100.
  • memory 130 can include high speed random access memory, and can also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device.
  • the processor 120 is a control center of the mobile phone 100, and connects various parts of the entire mobile phone using various interfaces and lines, and performs various functions and processing data of the mobile phone 100 by running or executing software programs and/or data stored in the memory 130. In order to monitor the mobile phone as a whole.
  • Processor 120 may include one or more general processing
  • the device may further include one or more DSP (digital signal processor), and may also include one or more ISP (image signal processor) for performing related operations to implement the present application.
  • DSP digital signal processor
  • ISP image signal processor
  • the camera 160 can be a normal camera or a focus camera.
  • the mobile phone 100 may also include an input device 140 for receiving input digital information, character information or contact touch/contactless gestures, and generating signal inputs related to user settings and function control of the handset 100, and the like.
  • the input device 140 may include a touch panel 141.
  • the touch panel 141 also referred to as a touch screen, can collect touch operations on or near the user (such as the user's operation on the touch panel 141 or on the touch panel 141 using any suitable object or accessory such as a finger, a stylus, or the like. ), and drive the corresponding connection device according to a preset program.
  • the touch panel 141 may include two parts: a touch detection device and a touch controller.
  • the touch detection device detects the touch orientation of the user, and detects a signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts the touch information into contact coordinates, and sends the touch information.
  • the processor 120 is provided and can receive commands from the processor 120 and execute them. For example, the user clicks on the touch panel 141 with a finger to open an icon or legend for color detection, and the like, the touch detection device detects the signal brought by the click, and then transmits the signal to the touch controller. The touch controller then converts this signal into coordinates for transmission to the processor 120, which determines the operation (on) for the icon or legend based on the coordinates and the type of the signal (click or double click).
  • the touch panel 141 can be implemented in various types such as resistive, capacitive, infrared, and surface acoustic waves.
  • the input device 140 may further include other input devices 142, which may include, but are not limited to, physical keyboards, function keys (such as volume control buttons, switch buttons, etc.), trackballs, mice, joysticks, and the like. One or more of them.
  • the display device 110 includes a display panel 111 for displaying information input by the user or information provided to the user, and various menu interfaces of the mobile phone 100, etc., which are mainly used to display the camera or the sensor in the mobile phone 100 in the embodiment of the present application.
  • the display panel can be configured in the form of a liquid crystal display (LCD) or an OLED (organic light-emitting diode).
  • the touch panel 141 can cover the display panel 111 to form a touch display screen.
  • the handset 100 can also include a power source 150 for powering other modules.
  • the handset 100 may also include one or more sensors 170, such as image sensors, brightness sensors, color temperature sensors, light sensors, GPS sensors, infrared sensors, laser sensors, position sensors or lens pointing angle sensors, and the like.
  • the mobile phone 100 may further include a radio frequency (RF) circuit 180 for performing network communication with the wireless network device, and may further include a WiFi module 190 for performing WiFi communication with other devices to acquire images or data transmitted by other devices. Wait.
  • RF radio frequency
  • the embodiment of the present application provides a color detection method, which is applicable to the mobile phone 100 shown in FIG. 1 . Therefore, in the embodiment of the present application, only the mobile phone 100 is taken as an example, but the present invention is not limited thereto. Embodiments of the invention are applied to other types of terminals. Referring to Figure 2, the specific process of the method includes:
  • Step 201 The mobile phone 100 acquires the color temperature of the light source and the brightness of the scene when the image to be tested is imaged.
  • the mobile phone 100 may acquire the image to be tested before acquiring the color temperature of the light source and the brightness of the scene when the image to be tested is imaged; or obtain the image to be tested while acquiring the color temperature of the light source and the brightness of the scene when the image to be tested is imaged.
  • the mobile phone 100 may save the image to be tested in the memory in advance, and may be acquired from the memory in the mobile phone 100 when the image to be tested is processed, or may be captured by the camera in the mobile phone 100, or may be acquired through the mobile phone 100.
  • the image sensor is acquired, and may also be acquired after being processed by an ISP after receiving an image signal sent by another device.
  • the manner in which the mobile phone 100 obtains the scene brightness and the color temperature of the light source when the image to be tested is imaged may be acquired by a sensor having a detecting function in the mobile phone 100, such as a light sensor, a color temperature sensor, etc., or other devices having a detecting function may detect
  • a sensor having a detecting function in the mobile phone 100 such as a light sensor, a color temperature sensor, etc., or other devices having a detecting function may detect
  • the scene brightness and the color temperature of the light source when the image to be tested is imaged are transmitted as data to the mobile phone 100.
  • the acquired color temperature of the light source and the brightness of the scene need to be the color temperature of the light source and the brightness of the scene when the image to be tested is imaged, so as to ensure the calibration of the image to be measured by the color temperature of the light source and the brightness of the scene. , can restore the true color of the image to be tested as much as possible.
  • Step 202 The mobile phone 100 selects a reference color card image from the preset reference color card data set according to the acquired color temperature of the light source based on the corresponding relationship between the light source color temperature and the reference color card image when the reference color card image is imaged.
  • the mobile phone 100 can pre-store the correspondence between the color temperature of the light source and the reference color card image when the reference color card image is imaged, and select the corresponding relationship between the color temperature of the light source and the reference color card image when imaging the stored reference color card image when performing color detection. Refer to the color card image.
  • the mobile phone 100 can also obtain the corresponding relationship between the color temperature of the light source and the reference color card image when the reference color card image is imaged, and the corresponding relationship between the color temperature of the light source and the reference color card image when the image is imaged by using the acquired reference color card. Select a reference color card image.
  • the reference color card data set can store the reference color card image in various environments and the corresponding parameter information in the corresponding imaging; as shown in FIG. 3, it is a structural schematic diagram of the reference color card data set, and the reference color card data.
  • the collection records the light source type, the light source color temperature, the scene brightness, and the reference color card image data in the environment in which each reference color card image is imaged. For example, when the light source is candle light, the color temperature is 1000K (Kelvin temperature), and the scene brightness is brightness 1 At the same time, the corresponding reference color card image is image 1, and so on.
  • the reference color card data set may be a table type data set, or may be a database with a mapping relationship, and any data set that can save the reference color card image and related parameter information when the image is imaged is applicable to the present invention.
  • the reference color card data set may be stored in a storage medium local to the mobile phone 100, so that the mobile phone 100 may directly obtain the reference color card data set from the local; the reference color card data set may also be stored in the storage medium of the cloud or other device. In this way, the mobile phone 100 can obtain a reference color card data set by communicating with the cloud or other devices.
  • the reference color card data set may include a color temperature of the light source when each of the reference color card images is imaged, such that there is a one-to-one correspondence between the light source color temperature and the reference color card image when the reference color card image is imaged.
  • the mobile phone 100 selects a reference color card image from the reference color card data set according to the corresponding relationship between the color temperature of the light source and the reference color card image when the reference color card image is imaged, which may be, but is not limited to, the following two types. Way to achieve:
  • the mobile phone 100 selects a reference color card image whose light source color temperature is the closest to the acquired light source color temperature when the reference color card image is imaged from the preset reference color card data set; specifically, the mobile phone 100 firstly refers to the reference color card.
  • the color temperature of the light source closest to the color temperature of the obtained light source is selected, and then the reference color card image corresponding to the color temperature of the light source is selected; taking the reference color card data set shown in FIG. 3 as an example, when the color temperature of the obtained light source is 2600K, Select the color temperature of the light source closest to 2600K 2500K, and then select the reference color card image corresponding to the color temperature of the light source 2500K, that is, image 3;
  • Manner 2 the mobile phone 100 selects at least one reference color card image whose difference between the color temperature of the light source and the color temperature of the obtained light source when the reference color card image is imaged is within a set threshold range from the preset reference color card data set, and A reference color card image is selected from the at least one reference color card image.
  • the mobile phone 100 may first set a threshold value, and determine at least one reference color card image whose difference between the acquired light source color temperature and the color temperature of the light source in the reference color card data set is within the threshold range, if the reference is determined. If the number of color card images is one, the one reference color card image is directly selected; for example, taking the reference color card data set shown in FIG.
  • the acquired color temperature of the light source is 3000K
  • the threshold value set by the mobile phone 100 is 200K
  • the acquired color temperature of the light source is 5700K
  • the threshold set by the mobile phone 100 is 500K
  • the difference is selected from 5700K.
  • the color temperature of the light source in the range of 500K, including 5000K, 5500K, 5600K, 6000K, respectively corresponding reference color card images are image 10, image 11, image 12 and image 13; Image 11, image 12 and image 13 can be random or in accordance with certain rules to select a reference color card image.
  • a reference color card image whose light source color temperature is greater than the acquired light source color temperature when the reference color card image is imaged may be selected; or the reference color card image may also be selected.
  • the color temperature of the light source during imaging is less than a reference color card image of the color temperature of the acquired light source; the manner of selection is not limited to the above-mentioned selection mode, and a specific selection manner may be determined according to a specific scene.
  • Step 203 The mobile phone 100 determines the target image brightness of the image to be tested according to a preset brightness of the image and a brightness of the scene based on the brightness of the scene when the image to be tested is imaged.
  • the brightness of the scene affects the brightness of the image, that is, the brightness of the image and the brightness of the scene are directly related.
  • the brightness of the image can be obtained by statistically analyzing the relationship between the brightness of the image and the brightness of the scene in advance. A function of the brightness of the scene.
  • the relationship between the brightness of the image and the brightness of the scene may be saved in the mobile phone 100 in advance, or may be stored in other devices or in the cloud.
  • the function relationship may be obtained by communicating with other devices or the cloud;
  • the mobile phone 100 can save the scene brightness of each reference color card image and the image brightness of each reference color card image in the reference color card data set shown in FIG. 3, and then analyze the reference color. Corresponding relationship between scene brightness and image brightness when each reference color card image in the card data set is imaged to obtain a function relationship between image brightness and scene brightness.
  • the image brightness of the image, and X is the brightness of the scene when the reference color card image is imaged.
  • the mobile phone 100 may substitute the scene brightness when the image to be tested is imaged into a function relationship between the brightness of the image and the brightness of the scene, and acquire the image brightness corresponding to the brightness of the scene when the image to be tested is imaged, as the target of the image to be tested. Image brightness.
  • Step 204 The mobile phone 100 adjusts the brightness of the selected reference color card image to the determined target image brightness, and uses the adjusted reference color card image as the calibration color card image.
  • Step 205 The mobile phone 100 calibrates the image to be tested according to the relationship between the color of the pre-stored standard color card image and the color of the calibration color card image, and determines the color value of the image to be tested after calibration.
  • the mobile phone 100 may, but is not limited to, determine color calibration information according to pre-stored standard color card images and color values of color blocks of the same position on the calibration color card image; the color calibration information is used to represent the standard color card. The mapping relationship between the image color value and the calibration color image color value; the mobile phone 100 performs color calibration on the image to be tested according to the color calibration information.
  • the calibration color card image obtained in step 204 is a color card image related to the color temperature of the light source and the imaging brightness when the image to be tested is imaged, and the color of the color patch in the color image of the color chart and the color of the color patch in the standard color card image. There is a difference between them.
  • the mobile phone 100 can determine color calibration information based on the color values of the standard color card image and the color patches of the same position on the calibration color card image.
  • the mobile phone 100 may represent the color of the color card image in a matrix, wherein the value of each element in the matrix may represent the color value of each color block in the color card image, and may also represent the color value of each pixel in the color card image. Then using matrix operations to determine color calibration information;
  • the element in the matrix used to represent the color of the color card image may be the LAB value of each pixel in the color card image, or may be the RGB value of each pixel in the color card image; similarly, the same method may be utilized.
  • the matrix represents the color of the image to be tested.
  • the color calibration information can be obtained as follows:
  • the matrix for indicating the color of the calibration color card image is P
  • the matrix for indicating the color of the standard color card image is O
  • the matrix for indicating the color of the image to be tested is C
  • the color calibration information T can pass the following formula Solve to get:
  • the image to be measured can be calibrated by using the formula C*T, and the color of the image to be tested after calibration is closer to the true color.
  • the mobile phone 100 determines the color value of the calibrated image to be tested according to the color value of each pixel in the calibrated image to be tested.
  • the mobile phone 100 may first determine an area in the image to be tested that needs to determine a color value; the color of each pixel in the determined area of the mobile phone 100 The value is processed to determine the color value of the area of the image to be tested after calibration.
  • the color value of each pixel in the area of the mobile phone 100 may be averaged, and the average value is used as the color value; the mobile phone 100 may also discard the color value of each pixel in the area that is smaller than the threshold value, for the remaining The color values of the respective pixels are averaged, and the average value is taken as the color value.
  • the manner of processing the color values of the respective pixels in the area is not limited to the above two types, and any manner in which the color values can be obtained is applicable to the embodiment of the present invention.
  • the mobile phone 100 needs to perform an operation of selecting an area on the image to be tested, for example, the method that the mobile phone 100 can select through the face recognition and the skin color region.
  • the selection area may also be selected according to the operation of the user on the touch panel, and the operation of selecting the area may be performed after the calibration of the image to be tested, or before the calibration of the image to be tested;
  • the operation of the selected area is performed before the calibration of the image to be tested, when the image of the image to be measured is calibrated by the mobile phone 100, only the image in the selected area can be calibrated to reduce unnecessary calibration operations, thereby further improving the efficiency of color detection.
  • the terminal when processing the image to be tested, determines the calibration color card image according to the color temperature of the light source and the brightness of the scene when the image to be tested is imaged, and according to the image between the standard color card image and the calibration color card image.
  • the color relationship is calibrated to measure the image to restore the true color of the image to be tested, so that the final color value is closer to the real value, which can effectively improve the accuracy of color detection; while in the whole color detection process, the terminal only needs Determining the color temperature of the light source and the brightness of the scene when the image to be tested is imaged can complete the calibration of the image to be tested, and the user can prepare the color card, which can improve the convenience of color detection.
  • the embodiment of the present application provides a method for color detection, and the method includes:
  • Step 401 The terminal acquires a color temperature of the light source and a brightness of the scene when the image to be tested is imaged.
  • Step 402 The terminal selects, from the preset reference color card data set, a reference color card image whose light source color temperature is the closest to the acquired light source color temperature when the reference color card image is imaged;
  • Step 403 The terminal determines, according to a brightness of the scene when the image to be tested is imaged, a target image brightness of the image to be tested according to a function relationship between a preset image brightness and a scene brightness.
  • Step 404 The terminal adjusts the brightness of the selected reference color card image to the target image brightness, and uses the adjusted reference color card image as the calibration color card image;
  • Step 405 The terminal determines color calibration information according to the pre-stored standard color card image and color values of the color blocks of the same position on the calibration color card image.
  • Step 406 The terminal performs color calibration on the image to be tested according to the color calibration information.
  • Step 407 The terminal selects an area in the image to be tested after calibration that needs to determine a color value.
  • Step 408 The terminal determines the color value according to the color value of each pixel in the region where the color value is determined according to the calibrated image to be tested.
  • the embodiment of the present application further provides a terminal, where the terminal is used to implement a color detection method of the terminal as shown in FIG. 2 .
  • the terminal 500 includes: an obtaining unit 501, and a processing unit 502.
  • the acquiring unit 501 is configured to acquire a color temperature of the light source and a brightness of the scene when the image to be tested is imaged;
  • the processing unit 502 is configured to select a reference color from the reference color card data set preset in the terminal according to the acquired color temperature of the light source according to the corresponding relationship between the color temperature of the light source and the reference color card image when the reference color card image is imaged.
  • Card image
  • the image to be tested is calibrated according to the relationship between the color of the pre-stored standard color card image and the color of the calibration color card image, and the color value of the calibrated image to be tested is determined.
  • processing unit 502 is specifically configured to:
  • the preset image brightness is a function of scene brightness as an image of the scene brightness and each reference color card image when imaging each reference color card image in the preset reference color card data set. Correspondence between brightness It is obtained by analysis.
  • processing unit 502 is specifically configured to:
  • Color calibration is performed on the image to be tested according to the color calibration information.
  • processing unit 502 is specifically configured to:
  • the color value of the calibrated image to be tested is determined according to the color value of each pixel in the calibrated image to be tested.
  • the division of the unit in the embodiment of the present application is schematic, and is only a logical function division. In actual implementation, there may be another division manner.
  • the functional units in the embodiments 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 above integrated unit can be implemented in the form of hardware or in the form of a software functional unit.
  • the integrated unit if implemented in the form of a software functional unit and sold or used as a standalone product, may be stored in a computer readable storage medium.
  • a computer readable storage medium A number of instructions are included to cause a computer device (which may be a personal computer, server, or network device, etc.) or a processor 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 code. .
  • the embodiment of the present application further provides a terminal, where the terminal is used to implement a method for color detection of the terminal as shown in FIG. 2 .
  • the terminal 600 includes a processor 601 and a memory 602;
  • a memory 602 configured to store a reference color card data set
  • the terminal may further include a camera 603 and a sensor 604.
  • a camera 603 configured to capture an image to be tested
  • the sensor 604 is configured to detect a color temperature of the light source and a brightness of the scene when the image to be tested is imaged.
  • the memory 602 may also store the image to be tested, the color temperature of the light source when the image to be tested is imaged, and the brightness of the scene, so that the processor 601 obtains the required data from the memory 602;
  • the terminal may further include a transceiver 605.
  • the transceiver 605 is configured to receive data, and store the received data in the memory 602, where the received data includes some or all of the following data: the image to be tested, the reference A color card data set, a color temperature of the light source and a brightness of the scene when the image to be tested is imaged.
  • the processor 601 is configured to implement the color detection of the terminal as shown in FIG. 2, including:
  • the image to be tested is calibrated according to the relationship between the color of the pre-stored standard color card image and the color of the calibration color card image, and the color value of the calibrated image to be tested is determined.
  • the processor 601 is specifically configured to:
  • the preset image brightness is a function of scene brightness as an image of the scene brightness and each reference color card image when imaging each reference color card image in the preset reference color card data set. The correspondence between the brightness is analyzed.
  • the processor 601 is specifically configured to:
  • Color calibration is performed on the image to be tested according to the color calibration information.
  • the processor 601 determines a color value of the calibrated image to be tested according to the color value of each pixel in the calibrated image to be tested.
  • the memory 602 is also used to store programs and the like.
  • the program can include program code, the program code including computer operating instructions.
  • the memory 602 may include RAM, and may also include non-volatile memory, such as at least one disk storage.
  • the processor 601 executes an application stored in the memory 602 to implement the above functions, thereby implementing a color detection method of the terminal as shown in FIG. 2.
  • the processor 601 and the memory 602 are connected to each other.
  • the processor 601 and the memory 602 may be connected to each other through a bus 606 as shown in FIG. 6; the bus 606 may be a peripheral component interconnect (PCI) bus or an extended industry. Extended industry standard architecture (EISA) bus, etc.
  • PCI peripheral component interconnect
  • EISA Extended industry standard architecture
  • the bus can be divided into an address bus, a data bus, a control bus, and the like. For ease of representation, only one thick line is shown in Figure 6, but it does not mean that there is only one bus or one type of bus.
  • the terminal 600 may further include a camera 603 and a sensor 604, and are interconnected with the processor 601 and the memory 602.
  • the terminal 600 may further include a transceiver 605, which is interconnected with the processor 601 and the memory 602.
  • the embodiment of the present application provides a method and a terminal for color detection, in which a terminal acquires a color temperature of a light source and a brightness of a scene when an image to be tested is imaged; and when the terminal is imaged based on a reference color card image Corresponding relationship between the color temperature of the light source and the reference color card image, and selecting a reference color card image from the reference color card data set preset in the terminal according to the acquired color temperature of the light source; and when the terminal is imaging based on the image to be tested Scene brightness, determining a target image brightness of the image to be tested according to a preset image brightness as a function of scene brightness; the terminal adjusting brightness of the selected reference color card image to the target image brightness, and The adjusted reference color card image is used as a calibration color card image, so that the selected calibration color card is related to the imaging environment of the image to be tested, and then the terminal according to the color of the pre-stored standard color card image and the color of the calibration color card image Relationship between the images to
  • embodiments of the present application can be provided as a method, system, or computer program product.
  • the present application can take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment in combination of software and hardware.
  • the application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) including computer usable program code.
  • the computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing device to operate in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture comprising the instruction device.
  • the apparatus implements the functions specified in one or more blocks of a flow or a flow and/or block diagram of the flowchart.
  • These computer program instructions can also be loaded onto a computer or other programmable data processing device such that a series of operational steps are performed on a computer or other programmable device to produce computer-implemented processing for execution on a computer or other programmable device.
  • the instructions provide steps for implementing the functions specified in one or more of the flow or in a block or blocks of a flow diagram.

Landscapes

  • Engineering & Computer Science (AREA)
  • Signal Processing (AREA)
  • Multimedia (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • General Health & Medical Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Human Computer Interaction (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Biomedical Technology (AREA)
  • Environmental & Geological Engineering (AREA)
  • Medical Informatics (AREA)
  • Nuclear Medicine, Radiotherapy & Molecular Imaging (AREA)
  • Radiology & Medical Imaging (AREA)
  • Quality & Reliability (AREA)
  • Image Processing (AREA)

Abstract

一种颜色检测的方法及终端,用于解决现有技术中存在的颜色检测方法不能同时保证准确性和便捷性的问题。本发明实施例中终端设备基于获取的在拍摄待测图像时的光源色温和场景亮度、以及预设的参考色卡图像集合对待测图像进行校准,以尽量还原待测图像的真实颜色,可以更为准确地获得待测图像的颜色值。

Description

一种颜色检测的方法及终端 技术领域
本申请涉及图像处理技术领域,尤其涉及一种颜色检测的方法及终端。
背景技术
颜色检测出现在生活中的方方面面,其中较为典型的颜色检测为肤色检测,在日常生活中肤色检测可广泛应用于各个行业,例如肤色检测用于服装行业,通过肤色检测获取用户的肤色状况,根据用户的肤色提供准确的服装配色建议;肤色检测用于化妆品行业,根据用户的肤色为用户选择正确的粉底色号、眼影色系、唇膏色号等等,肤色检测也可以用于健康行业,根据用户的肤色确定当前用户的皮肤状态可以提供一些护肤保养建议,也可以提供一些疾病预防的可行性建议。
下面以肤色检测为例说明常见的几种颜色检测的实现方法:
通常,肤色检测基于图形图像处理技术,首先获取待测皮肤的图像,而后检测图像中待测皮肤区域,计算肤色值。然而,由于受成像时照明条件的影响,待测皮肤图像与真实皮肤通常会存在一定的色差,因此以待测皮肤图像的颜色作为肤色检测结果,必然导致结果存在误差。
当前,为了解决成像时照明条件导致的图像肤色与真实肤色间的色差问题,常见的肤色检测方法有基于图像统计学的方法以及基于色卡的方法,具体如下:
1、基于图像统计学的方法;
基本原理是利用数理统计算法估计成像时照明光源的颜色,之后去除光源影响,以较大程度的还原图像的真实色彩。
此种方法应用广泛,但从单一的输入图像中分离照明分量和固有分量从数学角度上看属于一种病态问题,求解较为困难,当前这种方式一般只能应用于较为简单的粗粒度场景下的肤色检测,对于要求精确还原真实色彩的场景还是无法达到较好的检测效果。
2、基于色卡的方法;
在待测皮肤附近放置标准色卡,同时拍摄待测皮肤和标准色卡的图像,根据图像中的色卡颜色和色卡真实颜色间的关系对整个图像做颜色校准,而后检测校准图像中的皮肤区域,计算肤色值。
基于色卡的肤色检测方法,检测结果准确度较高,但每次测量肤色时都需要使用色卡,也就要求用户随时携带色卡来拍摄图像,使用较为不便。
综上,无论是基于图像统计学的方式还是基于色卡的方式,现有的颜色检测方法均不能同时保证准确性和便捷性。
发明内容
本申请实施例提供了一种颜色检测的方法及终端,用于解决现有技术中存在的颜色检测方法不能同时保证准确性和便捷性的问题。
本申请提供的具体技术方案如下:
第一方面,本申请实施例提供了一种颜色检测的方法,该方法包括:终端获取待测图像成像时的光源色温和场景亮度;所述终端基于参考色卡图像成像时的光源色温与参考色卡图像的对应关系,根据所述获取的光源色温,从所述终端中预设的参考色卡数据集合中选择参考色卡图像;所述终端基于所述待测图像成像时的场景亮度,根据预设的图像亮度与场景亮度的函数关系,确定所述待测图像的目标图像亮度;所述终端将选择的参考色卡图像的亮度调整至所述目标图像亮度,并将调整后的参考色卡图像作为校准色卡图像;所述终端根据预存的标准色卡图像的颜色和所述校准色卡图像的颜色之间的关系,对所述待测图像进行校准,并确定校准后的待测图像的颜色值。
通过上述方法,终端进行颜色检测时,需要对待测图像进行校准,而校准过程中需要利用与待测图像成像时的光源色温和场景亮度相关的校准色卡图像和标准色卡图像之间的颜色关系来确定颜色校准信息,能够保证校准后的待测图像所受成像环境影响较小,是接近真实颜色的待测图像,从而使得最终确定的颜色值更加接近于真实数值;而在整个颜色检测的过程中,终端需要的参数是待测图像成像时的光源色温和场景亮度,不需要用户做额外的操作,进一步改善了颜色检测的便捷性。
在一个可能的设计中,终端从参考色卡数据集合选择的方式可以有许多种,可以依据待测图像成像时的场景亮度选择,也可以依据待测图像成像时的色温选择;
下面提供两种依据待测图像成像时的色温选择参考色卡图像的方式:
方式一、所述终端从所述预设的参考色卡数据集合中选择参考色卡图像成像时的光源色温与所述获取的光源色温最接近的参考色卡图像;
方式二、所述终端从所述预设的参考色卡数据集合中选择参考色卡图像成像时的光源色温与所述获取的光源色温的差值处于设定阈值范围内的至少一个参考色卡图像,并从所述至少一个参考色卡图像中选择一个参考色卡图像。
通过上述方法,光源色温是影响图像颜色的一个主要因素,终端首选根据获取的色温从参考色卡数据集合中选择参考色卡图像,选择依据是以获取的色温和参考色卡图像成像时的光源色温满足一定的预设关系来确定的,使得选择出来的参考色卡图像与待测图像成像时的色温相关。
在一个可能的设计中,所述预设的图像亮度与场景亮度的函数关系可以是一种普遍的图像亮度与场景亮度的函数关系,也可以是针对某一类图像的图像亮度与场景亮度的函数关系;一种较佳的图像亮度与场景亮度的函数关系可以是对所述预设的参考色卡数据集合中每个参考色卡图像成像时的场景亮度与每个参考色卡图像的图像亮度之间的对应关系进行分析得到的。
通过上述方法,终端分析每个参考色卡图像成像时的场景亮度与每个参考色卡图像的图像亮度之间的对应关系来确定的图像亮度与场景亮度的函数关系,获取的函数关系更加适用于对参考色卡图像的亮度调节,可提高待测图像目标亮度的准确性。
在一个可能的设计中,所述终端根据预存的标准色卡图像和所述校准色卡图像上各相同位置的色块的颜色值,确定颜色校准信息;所述颜色校准信息表征标准色卡图像颜色值与校准色卡图像颜色值的映射关系;
所述终端根据所述颜色校准信息,对所述待测图像进行颜色校准。
通过上述方法,由于所述校准色卡图像与待测图像成像时的环境有关,利用标准色卡图像和所述校准色卡图像上各相同位置的色块的颜色值可以确定出对待测图像校准时所 需要的颜色校准信息,采用此种校准方式,可以较大限度的还原出待测图像的真实颜色,以尽可能去除拍摄场景下光源色温和场景亮度对待测图像颜色的影响。
在一个可能的设计中,所述终端根据校准后的待测图像中的各个像素的颜色值,确定校准后的待测图像的颜色值。
通过上述方法,终端利用校准后的待测图像确定颜色值,所确定的颜色值较为接近真实数值。
第二方面,本申请实施例还提供了一种终端,该终端具有实现上述方法实例中终端行为的功能。所述功能可以通过硬件实现,也可以通过硬件执行相应的软件实现。所述硬件或软件包括一个或多个与上述功能相对应的模块。
在一个可能的设计中,所述终端的结构中包括获取单元和处理单元,这些单元可以执行上述方法示例中的相应功能,具体参见方法示例中的详细描述,此处不做赘述。
在一种可能的设计中,所述终端的结构中包括处理器和存储器,所述处理器被配置为支持所述终端执行上述方法中相应的功能。所述存储器与所述处理器耦合,其保存所述终端必要的程序指令和数据。
第三方面,本申请实施例中还提供一种计算机存储介质,该存储介质中存储软件程序,该软件程序在被一个或多个处理器读取并执行时可实现第一方面或上述第一方面的任意一种设计提供的方法。
第四方面,本申请实施例中还提供一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机执行上述第一方面或上述第一方面的任意一种设计提供的方法。
本申请实施例中,终端在处理待测图像时,根据待测图像成像时的光源色温和场景亮度确定校准色卡图像,并根据标准色卡图像和校准色卡图像之间的颜色关系对待测图像进行校准,以还原待测图像的真实颜色,使得最后的颜色值更加接近于真实数值,可以有效提高颜色检测的准确性;而在整个颜色检测的过程中,终端只需确定待测图像成像时的光源色温和场景亮度就能完成对待测图像的校准,无需用户准备色卡,可以改善颜色检测的便捷性。
附图说明
图1为本申请实施例提供的一种终端的结构示意图;
图2为本申请实施例提供的一种颜色检测的方法流程图;
图3为本申请实施例提供的一种参考色卡数据集合的结构示意图;
图4为本申请实施例提供的一种颜色检测示例流程图;
图5为本申请实施例提供的一种颜色检测终端的结构示意图;
图6为本申请实施例提供的一种颜色检测终端的结构示意图。
具体实施方式
本申请提供了一种颜色检测的方法及终端,用以终端基于获取的在拍摄待测图像时的光源色温和场景亮度、以及预存的参考色卡图像集合对待测图像进行校准,以尽量还原待测图像的真实颜色,可以更为准确地获得待测图像的颜色值。
首先,对本申请中的部分用语进行解释说明,以便使本领域技术人员理解。
1)、终端,又可以称为设备,为可以与其他设备进行通信,或具有检测场景亮度和光源色温,能够获取图像的终端。例如,带有摄像头的智能手机、平板电脑、各类可穿戴设备、车载设备、计算机、数码相机等。
2)、光源色温,是描述在图像成像时主要光源的颜色的物理量,与成像场景下光源的类型有关。
3)、场景亮度,是描述成像时整体环境的明暗程度,场景亮度与成像时各光源的发光强度或光强、通光量等光照参数有关,可以通过检测光源的光强等光照参数来确定场景亮度。
4)、参考色卡数据集合,保存有多个参考色卡图像和每个参考色卡图像成像时的相关参数信息;而参考色卡图像可以是在不同环境下拍摄标准色卡所获取的色卡图像,在拍摄标准色卡时,需要确定色卡图像成像时的相关参数信息,例如,光源光强、光源色温、场景亮度等等;不同的环境会影响图像成像时的相关参数,使得拍摄的色卡图像不同。
5)、标准色卡图像,是用于色彩选择、比对时采用的统一标准的色卡图像,标准色卡图像中的颜色是指去除了成像环境影响的颜色。
6)、颜色校准信息,为由标准色卡图像和校准色卡图像确定的信息,它是根据两个色卡图像上各个相同位置上的图像块之间的颜色关系来确定的。
7)、颜色值,可以采用LAB(色彩模型)值,也可以采用RGB(红绿蓝颜色模式)值来表示,但并不局限于上述两种颜色值,凡是可以表征颜色的色彩空间均适用于表示本发明实施例中的颜色值。
8)、图像亮度,用于描述图像的明暗程度的物理量,图像亮度可以将图像中各个像素的亮度值进行均值处理,将平均值作为图像亮度,也可以用图像中主要区域内图像的亮度值来表示图像亮度,凡是可以表征图像明暗程度的数值均可以作为本发明实施例的图像亮度。
9)、多个,是指两个或两个以上。
本申请实施例的颜色检测方案可应用于各种终端,该终端包括但不限于个人计算机、服务器计算机、手持式或膝上型设备、移动设备(比如手机、移动电话、平板电脑、个人数字助理、媒体播放器等等)、消费型电子设备、小型计算机、大型计算机,等等。下面以手机为例对本申请实施例提供的方案进行具体描述,下述先简单介绍手机的具体结构组成。
参考图1所示,为本申请实施例应用的手机的硬件结构示意图。如图1所示,手机100包括显示设备110、处理器120以及存储器130。存储器130可用于存储软件程序以及数据,处理器120通过运行存储在存储器130的软件程序以及数据,从而执行手机100的各种功能应用以及数据处理。存储器130可主要包括存储程序区和存储数据区,其中,存储程序区可存储操作***、至少一个功能所需的应用程序(比如图像采集功能等)等;存储数据区可存储根据手机100的使用所创建的数据(比如音频数据、电话本、可交换图像文件EXI F、参考色卡数据集合等)等。此外,存储器130可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件、闪存器件、或其他易失性固态存储器件。处理器120是手机100的控制中心,利用各种接口和线路连接整个手机的各个部分,通过运行或执行存储在存储器130内的软件程序和/或数据,执行手机100的各种功能和处理数据,从而对手机进行整体监控。处理器120可以包括一个或多个通用处理 器,还可包括一个或多个DSP(digital signal processor,数字信号处理器),也可以包括一个或者多个ISP(image signal processor,图像信号处理器),用于执行相关操作,以实现本申请实施例所提供的技术方案。
手机100中还包括用于拍摄图像或视频的摄像头160。摄像头160可以是普通摄像头,也可以是对焦摄像头。
手机100还可以包括输入设备140,用于接收输入的数字信息、字符信息或接触式触摸操作/非接触式手势,以及产生与手机100的用户设置以及功能控制有关的信号输入等。具体地,本申请实施例中,该输入设备140可以包括触控面板141。触控面板141,也称为触摸屏,可收集用户在其上或附近的触摸操作(比如用户使用手指、触笔等任何适合的物体或附件在触控面板141上或在触控面板141的操作),并根据预先设定的程式驱动相应的连接装置。可选的,触控面板141可包括触摸检测装置和触摸控制器两个部分。其中,触摸检测装置检测用户的触摸方位,并检测触摸操作带来的信号,将信号传送给触摸控制器;触摸控制器从触摸检测装置上接收触摸信息,并将它转换成触点坐标,再送给处理器120,并能接收处理器120发来的命令并加以执行。例如,用户在触控面板141上用手指单击用于开启颜色检测的图标或者图例等等,触摸检测装置检测到此次单击带来的这个信号,然后将该信号传送给触摸控制器,触摸控制器再将这个信号转换成坐标发送给处理器120,处理器120根据该坐标和该信号的类型(单击或双击)确定对该图标或者图例所执行的操作(开启)。
触控面板141可以采用电阻式、电容式、红外线以及表面声波等多种类型实现。除了触控面板141,输入设备140还可以包括其他输入设备142,其他输入设备142可以包括但不限于物理键盘、功能键(比如音量控制按键、开关按键等)、轨迹球、鼠标、操作杆等中的一种或多种。
显示设备110,包括的显示面板111,用于显示由用户输入的信息或提供给用户的信息以及手机100的各种菜单界面等,在本申请实施例中主要用于显示手机100中摄像头或者传感器获取的待测图像。可选的,显示面板可以采用液晶显示器(liquid crystal display,LCD)或OLED(organic light-emitting diode,有机发光二极管)等形式来配置显示面板111。在其他一些实施例中,触控面板141可覆盖显示面板111上,形成触摸显示屏。
除以上之外,手机100还可以包括用于给其他模块供电的电源150。手机100还可以包括一个或多个传感器170,例如图像传感器、亮度传感器、色温传感器、光线传感器、GPS传感器、红外传感器、激光传感器、位置传感器或镜头指向角度传感器等。手机100还可以包括无线射频(radio frequency,RF)电路180,用于与无线网络设备进行网络通信,还可以包括WiFi模块190,用于与其他设备进行WiFi通信,获取其他设备传输的图像或者数据等。
本申请实施例提供了一种颜色检测方法,该方法适用于上述图1所示的手机100,因此,在本申请实施例中,仅以所述手机100为例进行描述,但是并不限制本发明实施例应用到其他类型的终端中。参阅图2所示,该方法的具体流程包括:
步骤201:手机100获取待测图像成像时的光源色温和场景亮度。
手机100可以在获取待测图像成像时的光源色温和场景亮度之前先获取待测图像;也可以在获取待测图像成像时的光源色温和场景亮度的同时获取待测图像。
手机100可以预先将待测图像保存在存储器中,在需要对待测图像进行处理时从手机100中的存储器中获取,也可以是通过手机100中的摄像头进行拍摄获取,也可以是通过手机100中的图像传感器获取,也可以是接收到其他设备发送的图像信号后利用ISP处理后获取。
手机100获取待测图像成像时的场景亮度和光源色温的方式可以是通过手机100中具有检测功能的传感器获取,例如光线传感器、色温传感器等等,也可以是其他具有检测功能的设备将检测到的待测图像成像时的场景亮度和光源色温作为数据传输给手机100。
需要说明的是,为了提高颜色检测的准确度,获取的光源色温和场景亮度需要是待测图像成像时的光源色温和场景亮度,这样才能保证在后续利用光源色温和场景亮度对待测图像校准时,能够尽可能的还原待测图像的真实颜色。
步骤202:手机100基于参考色卡图像成像时的光源色温与参考色卡图像的对应关系,根据获取的光源色温,从预设的参考色卡数据集合中选择参考色卡图像。
手机100可以预先存储参考色卡图像成像时的光源色温与参考色卡图像的对应关系,在进行颜色检测时,利用存储的参考色卡图像成像时的光源色温与参考色卡图像的对应关系选择参考色卡图像。
手机100也可以在进行颜色检测时,即时获取参考色卡图像成像时的光源色温与参考色卡图像的对应关系,利用获取的参考色卡图像成像时的光源色温与参考色卡图像的对应关系选择参考色卡图像。
参考色卡数据集合中可以保存有多种环境下的参考色卡图像和对应的成像时的相关参数信息;如图3所示,为参考色卡数据集合的一种结构示意图,参考色卡数据集合中记录了各个参考色卡图像成像时的环境中的光源类型、光源色温、场景亮度及参考色卡图像数据,例如,光源为烛光时,色温为1000K(开尔文温度),场景亮度为亮度1时,对应的参考色卡图像为图像1,后续以此类推。
需要说明的是,参考色卡数据集合可以为表格类型的数据集合,也可以是有映射关系的数据库,凡是可以保存参考色卡图像及图像成像时的相关参数信息的数据集合均适用于本发明实施例。
具体地,参考色卡数据集合可以存储在手机100本地的存储介质中,这样手机100可以直接从本地获取到参考色卡数据集合;参考色卡数据集合还可以存储在云端或其他设备的存储介质中,这样手机100可以通过与云端或其他设备进行通信从而获得参考色卡数据集合。
所述参考色卡数据集合可以包含有每个参考色卡图像成像时的光源色温,如此参考色卡图像成像时的光源色温和参考色卡图像之间就存在一一对应关系。
手机100基于参考色卡图像成像时的光源色温与参考色卡图像的对应关系,进而根据获取的光源色温,从参考色卡数据集合中来选择参考色卡图像,可以但不限于通过如下两种方式实现:
方式一:所述手机100从预设的参考色卡数据集合中选择参考色卡图像成像时的光源色温与获取的光源色温最接近的参考色卡图像;具体地,手机100首先从参考色卡数据集合中选择与获取的光源色温最接近的光源色温,然后选择该光源色温对应的参考色卡图像;以图3所示的参考色卡数据集合为例,当获取的光源色温为2600K,可以选择与2600K最接近的光源色温2500K,进而选择光源色温2500K对应的参考色卡图像,即图像3;
方式二:所述手机100从预设的参考色卡数据集合中选择参考色卡图像成像时的光源色温与获取的光源色温的差值处于设定阈值范围内的至少一个参考色卡图像,并从所述至少一个参考色卡图像中选择一个参考色卡图像。
手机100在选择参考色卡图像时,可以先设置一个阈值,在确定获取的光源色温与参考色卡数据集合中的光源色温的差值处于该阈值范围的至少一个参考色卡图像,若确定参考色卡图像的个数为一个,则直接选取该一个参考色卡图像;例如:以图3所示的参考色卡数据集合为例,当获取的光源色温为3000K,若手机100设定的阈值为200K,则选择与3000K差值在200K范围内的光源色温3200K,则对应选择的参考色卡图像即为图像4;若确定参考色卡图像的个数大于一个,则从确定的多个参考色卡图像中选择一个参考色卡图像;还以图3所示的参考色卡数据集合为例,当获取的光源色温为5700K,若手机100设定的阈值为500K,则选择与5700K差值在500K范围内的光源色温,包括5000K、5500K、5600K、6000K,分别对应的参考色卡图像分别为图像10、图像11、图像12和图像13;则从图像10、图像11、图像12和图像13中可以随机或依照一定的规则选择一个参考色卡图像。
在从确定的多个参考色卡图像依照一定规则选择参考色卡图像时,可以选择参考色卡图像成像时的光源色温大于获取的光源色温的一个参考色卡图像;也可以选择参考色卡图像成像时的光源色温小于获取的光源色温的一个参考色卡图像;选择的方式并不局限于上述所列举的选择方式,可以根据具体场景确定具体的选择方式。
步骤203;手机100基于所述待测图像成像时的场景亮度,根据预设的图像亮度与场景亮度的函数关系,确定所述待测图像的目标图像亮度。
在图像处理领域,场景亮度会影响图像亮度,也就是说图像亮度和场景亮度有直接的关系;这里可以通过预先对大量的图像亮度和场景亮度的关系进行统计分析,来先获取到图像亮度与场景亮度的函数关系。
所述图像亮度与场景亮度的函数关系可以预先保存在手机100中,也可以保存在其他设备中或云端,手机100需要利用该函数关系时可以通过与其他设备或云端进行通信获得该函数关系;
一种可选的实现方式中,手机100可以在图3所示的参考色卡数据集合中保存各个参考色卡图像成像时的场景亮度以及各个参考色卡图像的图像亮度,进而通过分析参考色卡数据集合中的各个参考色卡图像成像时的场景亮度和图像亮度之间的对应关系,以获取图像亮度与场景亮度之间的函数关系。
例如,分析各参考色卡图像的图像亮度及其对应的成像时的场景亮度,通过线性回归算法,计算得到图像亮度与场景亮度的函数关系为Y=0.5X+2,其中Y为参考色卡图像的图像亮度,X为参考色卡图像成像时的场景亮度。
手机100可以将所述待测图像成像时的场景亮度代入到图像亮度与场景亮度的函数关系中,获取所述待测图像成像时的场景亮度对应的图像亮度,作为所述待测图像的目标图像亮度。
步骤204,手机100将选择的参考色卡图像的亮度调整至上述确定的目标图像亮度,并将调整后的参考色卡图像作为校准色卡图像。
以图像亮度与场景亮度的函数关系为Y=0.5X+2为例,在步骤201获取的待测图像成像时的场景亮度为100Lux(勒克斯)时,在步骤203选择的参考色卡图像为图像3为例, 可以将100Lux代入到Y=0.5X+2中,得到的目标图像亮度为52,此时将图像3的亮度调节至52,将调节亮度后的图像3作为校准色卡图像。
步骤205;手机100根据预存的标准色卡图像的颜色和所述校准色卡图像的颜色之间的关系,对所述待测图像进行校准,并确定校准后的待测图像的颜色值。
具体地,手机100可以但不限于根据预存的标准色卡图像和所述校准色卡图像上各相同位置的色块的颜色值,确定颜色校准信息;所述颜色校准信息用于表征标准色卡图像颜色值与校准色卡图像颜色值的映射关系;手机100根据所述颜色校准信息,对所述待测图像进行颜色校准。
在步骤204中获得的校准色卡图像是与待测图像成像时的光源色温和成像亮度相关的色卡图像,校准色卡图像中的色块的颜色与标准色卡图像中的色块的颜色之间存在差异。手机100可以根据标准色卡图像和所述校准色卡图像上各相同位置的色块的颜色值确定颜色校准信息。
在具体实施中手机100可以将色卡图像的颜色用矩阵表示,其中矩阵中各个元素的值可以表示色卡图像中各个色块的颜色值,也可以表示色卡图像中各个像素的颜色值,之后利用矩阵运算确定颜色校准信息;
用于表示色卡图像的颜色的矩阵中的元素可以是色卡图像中每个像素的LAB值,也可以是色卡图像中每个像素的RGB值;同样的,也可以采用相同的方式利用矩阵表示待测图像的颜色。
具体的,可以采取如下方式来获取颜色校准信息:
假设用于表示校准色卡图像的颜色的矩阵为P,用于表示标准色卡图像的颜色的矩阵为O,用于表示待测图像的颜色的矩阵为C,颜色校准信息T可以通过以下公式求解得到:
P*T=O
而在确定颜色校准信息T后,可以利用公式C*T对待测图像进行校准,校准后的待测图像的颜色更加接近真实颜色。
可选的,在对待测图像进行校准后,所述手机100根据校准后的待测图像中的各个像素的颜色值,确定校准后的待测图像的颜色值。
若所述手机100仅需要确定待测图像中部分区域的颜色值,则所述手机100可以先确定待测图像中需要确定颜色值的区域;所述手机100对确定的区域内各个像素的颜色值进行处理,确定校准后的待测图像的区域的颜色值。
其中,所述手机100对区域内各个像素的颜色值可以采用均值的处理方式,将均值作为颜色值;所述手机100也可以舍弃区域内各个像素的颜色值中小于阈值的颜色值,对剩余的各个像素的颜色值求平均值,将均值作为颜色值。
对区域内各个像素的颜色值的处理方式并不局限于上述两种,凡是可以获取颜色值的方式均适用于本发明实施例。
需要说明的是,若手机100只需要确定待测图像中部分区域的颜色值,则手机100需要进行在待测图像上选取区域的操作,例如手机100可以通过人脸识别、肤色区域选取的方式选取区域,也可以根据用户在触控面板上的操作选取区域等,而选取区域的操作可以在对待测图像校准后进行,也可以在对待测图像校准前进行;
若选取区域的操作是在对待测图像校准之前进行,则当手机100对待测图像校准时,可以只校准选取的区域内的图像,以减少不必要的校准操作,进一步提高颜色检测的效率。
本申请实施例提供的颜色检测方法,终端在处理待测图像时,根据待测图像成像时的光源色温和场景亮度确定校准色卡图像,并根据标准色卡图像和校准色卡图像之间的颜色关系对待测图像进行校准,以尽量还原待测图像的真实颜色,使得最后的颜色值更加接近于真实数值,可以有效提高颜色检测的准确性;而在整个颜色检测的过程中,终端只需确定待测图像成像时的光源色温和场景亮度就能完成对待测图像的校准,无需用户准备色卡,可以改善颜色检测的便捷性。
基于上述实施例,如图4所示,本申请实施例提供了一种颜色检测的方法,该方法包括:
步骤401:终端获取待测图像成像时的光源色温和场景亮度;
步骤402:终端从所述预设的参考色卡数据集合中选择参考色卡图像成像时的光源色温与所述获取的光源色温最接近的参考色卡图像;
步骤403:终端基于所述待测图像成像时的场景亮度,根据预设的图像亮度与场景亮度的函数关系,确定所述待测图像的目标图像亮度;
步骤404:终端将选择的参考色卡图像的亮度调整至所述目标图像亮度,并将调整后的参考色卡图像作为校准色卡图像;
步骤405:终端根据预存的标准色卡图像和所述校准色卡图像上各相同位置的色块的颜色值,确定颜色校准信息;
步骤406:终端根据所述颜色校准信息,对所述待测图像进行颜色校准;
步骤407:终端选取校准后的待测图像中需要确定颜色值的区域;
步骤408:终端根据校准后的待测图像需要确定颜色值的区域中的各个像素的颜色值,确定颜色值。
基于以上实施例,本申请实施例还提供了一种终端,该终端用于实现如图2所示的终端的颜色检测方法。参阅图5所示,该终端500包括:获取单元501、处理单元502,
获取单元501,用于获取待测图像成像时的光源色温和场景亮度;
处理单元502,用于基于参考色卡图像成像时的光源色温与参考色卡图像的对应关系,根据所述获取的光源色温,从所述终端中预设的参考色卡数据集合中选择参考色卡图像;
基于所述待测图像成像时的场景亮度,根据预设的图像亮度与场景亮度的函数关系,确定所述待测图像的目标图像亮度;
将选择的参考色卡图像的亮度调整至所述目标图像亮度,并将调整后的参考色卡图像作为校准色卡图像;
根据预存的标准色卡图像的颜色和所述校准色卡图像的颜色之间的关系,对所述待测图像进行校准,并确定校准后的待测图像的颜色值。
可选的,所述处理单元502,具体用于:
从所述预设的参考色卡数据集合中选择参考色卡图像成像时的光源色温与所述获取的光源色温最接近的参考色卡图像;或
从所述预设的参考色卡数据集合中选择参考色卡图像成像时的光源色温与所述获取的光源色温的差值处于设定阈值范围内的至少一个参考色卡图像,并从所述至少一个参考色卡图像中选择一个参考色卡图像。
可选的,所述预设的图像亮度与场景亮度的函数关系为对所述预设的参考色卡数据集合中每个参考色卡图像成像时的场景亮度与每个参考色卡图像的图像亮度之间的对应关 系进行分析得到的。
可选的,所述处理单元502,具体用于:
根据预存的标准色卡图像和所述校准色卡图像上各相同位置的色块的颜色值,确定颜色校准信息;所述颜色校准信息表征标准色卡图像颜色值与校准色卡图像颜色值的映射关系;
根据所述颜色校准信息,对所述待测图像进行颜色校准。
可选的,所述处理单元502,具体用于:
根据校准后的待测图像中的各个像素的颜色值,确定校准后的待测图像的颜色值。
需要说明的是,本申请实施例中对单元的划分是示意性的,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。在本申请的实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)或处理器(processor)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(read-only memory,ROM)、随机存取存储器(random access memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。
基于以上实施例,本申请实施例还提供了一种终端,所述终端用于实现如图2所示的终端的颜色检测的方法。参阅图6所示,所述终端600包括处理器601和存储器602;
存储器602,用于存储参考色卡数据集合;
可选的,所述终端还可以包括摄像头603和传感器604。
摄像头603,用于拍摄待测图像;
传感器604,用于检测所述待测图像成像时的光源色温和场景亮度。
其中,所述存储器602也可以存储待测图像、所述待测图像成像时的光源色温和场景亮度,以使处理器601从存储器602中获取所需的数据;
可选的,所述终端还可以包括收发器605。
收发器605,用于接收数据,将所述接收到的数据存储于所述存储器602中,其中,所述接收到的数据包括下列数据中的部分或全部:所述待测图像,所述参考色卡数据集合,所述待测图像成像时的光源色温和场景亮度。
所述处理器601,用于实现如图2所示的终端的颜色检测的方法,包括:
获取待测图像成像时的光源色温和场景亮度;
基于参考色卡图像成像时的光源色温与参考色卡图像的对应关系,根据所述获取的光源色温,从所述终端中预设的参考色卡数据集合中选择参考色卡图像;
基于所述待测图像成像时的场景亮度,根据预设的图像亮度与场景亮度的函数关系,确定所述待测图像的目标图像亮度;
将选择的参考色卡图像的亮度调整至所述目标图像亮度,并将调整后的参考色卡图像作为校准色卡图像;
根据预存的标准色卡图像的颜色和所述校准色卡图像的颜色之间的关系,对所述待测图像进行校准,并确定校准后的待测图像的颜色值。
可选的,所述处理器601,具体用于:
从所述预设的参考色卡数据集合中选择参考色卡图像成像时的光源色温与所述获取的光源色温最接近的参考色卡图像;或
从所述预设的参考色卡数据集合中选择参考色卡图像成像时的光源色温与所述获取的光源色温的差值处于设定阈值范围内的至少一个参考色卡图像,并从所述至少一个参考色卡图像中选择一个参考色卡图像。
可选的,所述预设的图像亮度与场景亮度的函数关系为对所述预设的参考色卡数据集合中每个参考色卡图像成像时的场景亮度与每个参考色卡图像的图像亮度之间的对应关系进行分析得到的。
可选的,所述处理器601,具体用于:
根据预存的标准色卡图像和所述校准色卡图像上各相同位置的色块的颜色值,确定颜色校准信息;所述颜色校准信息表征标准色卡图像颜色值与校准色卡图像颜色值的映射关系;
根据所述颜色校准信息,对所述待测图像进行颜色校准。
可选的,所述处理器601根据校准后的待测图像中的各个像素的颜色值,确定校准后的待测图像的颜色值。
所述存储器602,还用于存放程序等。具体地,程序可以包括程序代码,该程序代码包括计算机操作指令。所述存储器602可能包含RAM,也可能还包括非易失性存储器(non-volatile memory),例如至少一个磁盘存储器。所述处理器601执行所述存储器602所存放的应用程序,实现上述功能,从而实现如图2所示的终端的颜色检测方法。
所述处理器601和所述存储器602相互连接。可选的,所述处理器601和所述存储器602可以通过图6中所示的总线606相互连接;所述总线606可以是外设部件互连标准(peripheral component interconnect,PCI)总线或扩展工业标准结构(extended industry standard architecture,EISA)总线等。所述总线可以分为地址总线、数据总线、控制总线等。为便于表示,图6中仅用一条粗线表示,但并不表示仅有一根总线或一种类型的总线。
可选的,所述终端600还可以包括摄像头603和传感器604,与所述处理器601以及所述存储器602相互连接。
可选的,所述终端600还可以包括收发器605,与所述处理器601以及所述存储器602相互连接。
综上所述,本申请实施例提供了一种颜色检测的方法及终端,在该方法中,终端获取待测图像成像时的光源色温和场景亮度;所述终端基于参考色卡图像成像时的光源色温与参考色卡图像的对应关系,根据所述获取的光源色温,从所述终端中预设的参考色卡数据集合中选择参考色卡图像;所述终端基于所述待测图像成像时的场景亮度,根据预设的图像亮度与场景亮度的函数关系,确定所述待测图像的目标图像亮度;所述终端将选择的参考色卡图像的亮度调整至所述目标图像亮度,并将调整后的参考色卡图像作为校准色卡图像,使得选择的校准色卡与待测图像的成像环境有关,之后所述终端根据预存的标准色卡图像的颜色和所述校准色卡图像的颜色之间的关系;对所述待测图像进行校准,以还原待 测图像的真实颜色,并确定校准后的待测图像的颜色值,最终确定的颜色值也更加接近于真实数值,在整个颜色检测的过程中,无需用户执行准备色卡等额外操作,可以改善颜色检测的便捷性。
本领域内的技术人员应明白,本申请的实施例可提供为方法、***、或计算机程序产品。因此,本申请可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本申请可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。
本申请是参照根据本申请实施例的方法、设备(***)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。
显然,本领域的技术人员可以对本申请实施例进行各种改动和变型而不脱离本申请实施例的精神和范围。这样,倘若本申请实施例的这些修改和变型属于本申请权利要求及其等同技术的范围之内,则本申请也意图包含这些改动和变型在内。

Claims (13)

  1. 一种颜色检测的方法,其特征在于,该方法包括:
    终端获取待测图像成像时的光源色温和场景亮度;
    所述终端基于参考色卡图像成像时的光源色温与参考色卡图像的对应关系,根据所述获取的光源色温,从预设的参考色卡数据集合中选择参考色卡图像,所述参考色卡数据集合保存有多个参考色卡图像和每个参考色卡图像成像时的相关参数信息;
    所述终端基于所述待测图像成像时的场景亮度,根据预设的图像亮度与场景亮度的函数关系,确定所述待测图像的目标图像亮度;
    所述终端将选择的参考色卡图像的亮度调整至所述目标图像亮度,并将调整后的参考色卡图像作为校准色卡图像;
    所述终端根据预存的标准色卡图像的颜色和所述校准色卡图像的颜色之间的关系,对所述待测图像进行校准,并确定校准后的待测图像的颜色值。
  2. 如权利要求1所述的方法,其特征在于,所述终端根据所述获取的光源色温,从预设的参考色卡数据集合中选择参考色卡图像,包括:
    所述终端从预设的参考色卡数据集合中选择参考色卡图像成像时的光源色温与所述获取的光源色温最接近的参考色卡图像;或
    所述终端从预设的参考色卡数据集合中选择参考色卡图像成像时的光源色温与所述获取的光源色温的差值处于设定阈值范围内的至少一个参考色卡图像,并从所述至少一个参考色卡图像中选择一个参考色卡图像。
  3. 如权利要求1或2所述的方法,其特征在于,所述预设的图像亮度与场景亮度的函数关系为对所述预设的参考色卡数据集合中每个参考色卡图像成像时的场景亮度与每个参考色卡图像的图像亮度之间的对应关系进行分析得到的。
  4. 如权利要求1-3中任一项所述的方法,其特征在于,所述终端根据预存的标准色卡图像的颜色和所述校准色卡图像的颜色之间的关系,对所述待测图像进行校准,包括:
    所述终端根据预存的标准色卡图像和所述校准色卡图像上各相同位置的色块的颜色值,确定颜色校准信息;所述颜色校准信息表征标准色卡图像颜色值与校准色卡图像中颜色值的映射关系;
    所述终端根据所述颜色校准信息,对所述待测图像进行颜色校准。
  5. 如权利要求1-4中任一项所述的方法,其特征在于,所述终端确定校准后的待测图像的颜色值,包括:
    所述终端根据校准后的待测图像中的各个像素的颜色值,确定校准后的待测图像的颜色值。
  6. 一种颜色检测的终端,其特征在于,该终端包括:
    存储器,用于存储参考色卡数据集合;
    处理器,用于获取待测图像成像时的光源色温和场景亮度;
    所述处理器,还用于:
    基于参考色卡图像成像时的光源色温与参考色卡图像的对应关系,根据获取的光源色温,从预设的参考色卡数据集合中选择参考色卡图像,所述参考色卡数据集合保存有多个参考色卡图像和每个参考色卡图像成像时的相关参数信息;
    基于所述待测图像成像时的场景亮度,根据预设的图像亮度与场景亮度的函数关系,确定所述待测图像的目标图像亮度;
    将选择的参考色卡图像的亮度调整至所述目标图像亮度,并将调整后的参考色卡图像作为校准色卡图像;
    根据预存的标准色卡图像的颜色和所述校准色卡图像的颜色之间的关系,对所述待测图像进行校准,并确定校准后的待测图像的颜色值。
  7. 如权利要求6所述的终端,其特征在于,所述终端还包括:
    摄像头,用于拍摄所述待测图像;
    传感器,用于检测所述待测图像成像时的光源色温和场景亮度。
  8. 如权利要求6所述的终端,其特征在于,所述处理器,具体用于:
    从预设的参考色卡数据集合中选择参考色卡图像成像时的光源色温与获取的光源色温最接近的参考色卡图像;或
    从预设的参考色卡数据集合中选择参考色卡图像成像时的光源色温与获取的光源色温的差值处于设定阈值范围内的至少一个参考色卡图像,并从所述至少一个参考色卡图像中选择一个参考色卡图像。
  9. 如权利要求6-8中任一项所述的终端,其特征在于,所述预设的图像亮度与场景亮度的函数关系为对预设的参考色卡数据集合中每个参考色卡图像成像时的场景亮度与每个参考色卡图像的图像亮度之间的对应关系进行分析得到的。
  10. 如权利要求6-9中任一项所述的终端,其特征在于,所述处理器,具体用于:
    根据预存的标准色卡图像和所述校准色卡图像上各相同位置的色块的颜色值,确定颜色校准信息;所述颜色校准信息表征标准色卡图像中颜色值与校准色卡图像中颜色值的映射关系;
    根据所述颜色校准信息,对所述待测图像进行颜色校准。
  11. 如权利要求6-10中任一项所述的终端,其特征在于,所述处理器,具体用于:
    根据校准后的待测图像中的各个像素的颜色值,确定校准后的待测图像的颜色值。
  12. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质中存储软件程序,所述软件程序在被一个或多个处理器读取并执行时可实现权利要求1~5任一项所述的方法。
  13. 一种包含指令的计算机程序产品,其特征在于,当其在计算机上运行时,使得计算机执行如权利要求1~5任一项所述的方法。
PCT/CN2017/091172 2017-06-30 2017-06-30 一种颜色检测的方法及终端 WO2019000409A1 (zh)

Priority Applications (4)

Application Number Priority Date Filing Date Title
EP17915519.7A EP3637763B1 (en) 2017-06-30 2017-06-30 Colour detection method and terminal
CN201780029922.7A CN109155071B (zh) 2017-06-30 2017-06-30 一种颜色检测的方法及终端
PCT/CN2017/091172 WO2019000409A1 (zh) 2017-06-30 2017-06-30 一种颜色检测的方法及终端
US16/627,636 US11284013B2 (en) 2017-06-30 2017-06-30 Color detection method and terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2017/091172 WO2019000409A1 (zh) 2017-06-30 2017-06-30 一种颜色检测的方法及终端

Publications (1)

Publication Number Publication Date
WO2019000409A1 true WO2019000409A1 (zh) 2019-01-03

Family

ID=64740808

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/091172 WO2019000409A1 (zh) 2017-06-30 2017-06-30 一种颜色检测的方法及终端

Country Status (4)

Country Link
US (1) US11284013B2 (zh)
EP (1) EP3637763B1 (zh)
CN (1) CN109155071B (zh)
WO (1) WO2019000409A1 (zh)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115116404A (zh) * 2021-03-22 2022-09-27 广州视源电子科技股份有限公司 色温亮度校准方法、装置、介质以及交互平板
EP4094424A4 (en) * 2020-01-22 2024-02-28 Colby, Lydia A. COLOR RENDERING

Families Citing this family (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109978848B (zh) * 2019-03-19 2022-11-04 电子科技大学 基于多光源颜色恒常模型检测眼底图像中硬性渗出的方法
CN110784696B (zh) * 2019-09-30 2021-04-30 深圳市火乐科技发展有限公司 一种白平衡校正方法和相关装置
CN113129222A (zh) * 2020-01-13 2021-07-16 华为技术有限公司 颜色阴影校正方法、终端设备及计算机可读存储介质
US11620765B2 (en) * 2020-07-02 2023-04-04 Unity Technologies Sf Automatic detection of a calibration object for modifying image parameters
US12028601B2 (en) * 2021-03-30 2024-07-02 Snap Inc. Inclusive camera
US11924590B2 (en) 2021-04-13 2024-03-05 Teledyne Flir Commercial Systems, Inc. Image color correction systems and methods
CN114295561B (zh) * 2022-03-03 2022-09-20 北京中科慧眼科技有限公司 基于设备无关颜色空间的色差测量方法和***
CN114840704B (zh) * 2022-04-13 2022-10-18 云南省农业科学院质量标准与检测技术研究所 植物颜色比对方法、装置、设备及存储介质
CN114739918B (zh) * 2022-04-13 2022-11-01 云南省农业科学院质量标准与检测技术研究所 植物颜色测定方法、装置、***及存储介质
CN115460391B (zh) * 2022-09-13 2024-04-16 浙江大华技术股份有限公司 图像的模拟方法、装置、存储介质及电子装置
CN116668838B (zh) * 2022-11-22 2023-12-05 荣耀终端有限公司 图像处理方法与电子设备
CN118177962A (zh) * 2024-05-15 2024-06-14 深圳市美莱雅智能科技有限公司 基于肤色识别的输出能量控制方法、装置、介质及脱毛仪

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US4146394A (en) * 1975-03-04 1979-03-27 The United States Of America As Represented By The Secretary Of The Army Filter pack correction method in color photography
CN103686111A (zh) * 2013-12-31 2014-03-26 上海富瀚微电子有限公司 一种基于rgbir图像传感器的颜色校正方法以及装置
CN103796003A (zh) * 2014-01-21 2014-05-14 深圳市掌网立体时代视讯技术有限公司 一种立体摄像的图像修正方法及***
CN106162136A (zh) * 2016-08-12 2016-11-23 惠州Tcl移动通信有限公司 一种用于红外拍摄的白平衡校准方法、***及移动终端

Family Cites Families (18)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6636260B2 (en) * 1997-06-24 2003-10-21 Canon Kabushiki Kaisha Image processing using a profile selection based on photographing condition
JP2002135789A (ja) * 2000-10-19 2002-05-10 Canon Inc 撮像装置及びその信号処理方法及びその信号処理を実行するモジュールを有する記憶媒体
US7636473B2 (en) * 2004-03-12 2009-12-22 Seiko Epson Corporation Image color adjustment
US20080101693A1 (en) 2006-10-26 2008-05-01 Intelligence Frontier Media Laboratory Ltd Video image based tracking system for identifying and tracking encoded color surface
JP2011059658A (ja) 2009-08-11 2011-03-24 Sony Corp 表示装置、表示方法およびコンピュータプログラム
CN101635053B (zh) 2009-09-02 2011-10-26 北京航空航天大学 多光源颜色强度一致性标定方法
CN102137272B (zh) 2011-03-21 2012-11-28 西安理工大学 一种开放环境下的多相机间的颜色校准方法
CN102184527B (zh) 2011-05-10 2013-06-19 格科微电子(上海)有限公司 图像处理方式及图像处理装置
CN102509318A (zh) 2011-09-20 2012-06-20 哈尔滨工业大学 人体数字舌图像专用颜色校正色卡及其制作方法
CN102867295B (zh) 2012-08-06 2015-10-21 电子科技大学 一种彩色图像颜色校正方法
CN103152476B (zh) 2013-01-31 2015-01-28 广东欧珀移动通信有限公司 检测皮肤状态的手机及其使用方法
CN104320641B (zh) * 2013-03-13 2017-04-12 豪威科技股份有限公司 电子照相机的自动白平衡的自动化自我训练的装置及方法
CN103139591B (zh) 2013-03-24 2016-03-30 成都索贝数码科技股份有限公司 一种基于图形处理器的3d视频颜色自动校正方法
CN103268618B (zh) 2013-05-10 2016-08-10 中国科学院光电研究院 一种多光谱遥感数据真彩色定标方法
TWI517702B (zh) * 2013-08-16 2016-01-11 華碩電腦股份有限公司 攝影裝置的影像色偏消除方法
CN103630240B (zh) 2013-11-14 2015-07-29 中国科学院上海光学精密机械研究所 物体表面颜色测量装置与方法
WO2017190092A1 (en) * 2016-04-29 2017-11-02 Faraday&Future Inc. System for providing color balance in automotive display
CN106683140B (zh) 2016-12-16 2019-12-17 深圳市中达瑞和科技有限公司 一种颜色识别方法及***

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US4146394A (en) * 1975-03-04 1979-03-27 The United States Of America As Represented By The Secretary Of The Army Filter pack correction method in color photography
CN103686111A (zh) * 2013-12-31 2014-03-26 上海富瀚微电子有限公司 一种基于rgbir图像传感器的颜色校正方法以及装置
CN103796003A (zh) * 2014-01-21 2014-05-14 深圳市掌网立体时代视讯技术有限公司 一种立体摄像的图像修正方法及***
CN106162136A (zh) * 2016-08-12 2016-11-23 惠州Tcl移动通信有限公司 一种用于红外拍摄的白平衡校准方法、***及移动终端

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See also references of EP3637763A4 *

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP4094424A4 (en) * 2020-01-22 2024-02-28 Colby, Lydia A. COLOR RENDERING
US12008636B2 (en) 2020-01-22 2024-06-11 Lydia Ann Colby Color rendering
CN115116404A (zh) * 2021-03-22 2022-09-27 广州视源电子科技股份有限公司 色温亮度校准方法、装置、介质以及交互平板
CN115116404B (zh) * 2021-03-22 2023-08-01 广州视源电子科技股份有限公司 色温亮度校准方法、装置、介质以及交互平板

Also Published As

Publication number Publication date
EP3637763A4 (en) 2020-06-17
CN109155071A (zh) 2019-01-04
US11284013B2 (en) 2022-03-22
EP3637763B1 (en) 2021-06-02
US20200374447A1 (en) 2020-11-26
CN109155071B (zh) 2021-01-29
EP3637763A1 (en) 2020-04-15

Similar Documents

Publication Publication Date Title
WO2019000409A1 (zh) 一种颜色检测的方法及终端
CN110113534B (zh) 一种图像处理方法、图像处理装置及移动终端
CN107613202B (zh) 一种拍摄方法及移动终端
US10847073B2 (en) Image display optimization method and apparatus
CN107124543B (zh) 一种拍摄方法及移动终端
CN108091288B (zh) 显示屏均匀性的测试方法、终端及计算机可读存储介质
US20120313962A1 (en) Electronic device and method for generating graphical user interface thereof
TW201126298A (en) Data processing device and method for regulating the lighting power of a display
CN110146161B (zh) 环境光照强度的检测方法、装置和终端
CN113192470B (zh) 屏幕调节方法、装置、存储介质及电子设备
CN110100251A (zh) 用于处理文档的设备、方法和图形用户界面
US10517523B2 (en) Skin aging state assessment method and electronic device
CN109327691B (zh) 图像拍摄方法、装置、存储介质及移动终端
US11537215B2 (en) Ambient light sensing device and method, and interactive device using same
WO2019041147A1 (zh) 光点识别方法、装置以及***
TW201719146A (zh) 作物之生理表徵檢測方法、可攜式檢測裝置與檢測系統
CN109040729B (zh) 图像白平衡校正方法、装置、存储介质及终端
CN113177886A (zh) 图像处理方法、装置、计算机设备及可读存储介质
CN110955580B (zh) 壳体温度的获取方法、装置、存储介质和电子设备
CN108848265B (zh) 局部区域的屏幕亮度调节方法、装置、终端及存储介质
TW201911285A (zh) 電子設備、顯示螢幕調節方法
JP2015184906A (ja) 肌色検出条件決定装置、肌色検出条件決定方法及び肌色検出条件決定用コンピュータプログラム
WO2019201223A1 (zh) 屏幕显示的切换方法以及装置及存储介质
CN110136233B (zh) 一种生成美甲效果图的方法、终端以及存储介质
KR101957773B1 (ko) 영상을 이용한 피부 상태 평가 방법 및 영상을 이용한 피부 상태 평가 장치

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: 17915519

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

ENP Entry into the national phase

Ref document number: 2017915519

Country of ref document: EP

Effective date: 20200106