CN111754425A - Image highlight removing processing method and device and electronic equipment - Google Patents

Image highlight removing processing method and device and electronic equipment Download PDF

Info

Publication number
CN111754425A
CN111754425A CN202010503327.6A CN202010503327A CN111754425A CN 111754425 A CN111754425 A CN 111754425A CN 202010503327 A CN202010503327 A CN 202010503327A CN 111754425 A CN111754425 A CN 111754425A
Authority
CN
China
Prior art keywords
image
value
initial image
color channel
diffuse reflection
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202010503327.6A
Other languages
Chinese (zh)
Inventor
黄佳斌
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Youzhuju Network Technology Co Ltd
Original Assignee
Beijing Youzhuju Network Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Youzhuju Network Technology Co Ltd filed Critical Beijing Youzhuju Network Technology Co Ltd
Priority to CN202010503327.6A priority Critical patent/CN111754425A/en
Publication of CN111754425A publication Critical patent/CN111754425A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/73Deblurring; Sharpening
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/90Determination of colour characteristics

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Image Processing (AREA)

Abstract

The embodiment of the disclosure provides an image highlight removing processing method, an image highlight removing processing device and electronic equipment, belonging to the technical field of images, wherein the method comprises the following steps: acquiring an initial image, wherein the initial image comprises a diffuse reflection component and a specular reflection component displaying high light; calculating a maximum chroma value of the initial image; obtaining the diffuse reflection image according to the maximum chromatic value of the initial image; and outputting the diffuse reflection image as a result image of the initial image after the highlight of the initial image is removed. According to the scheme disclosed by the invention, the imaging model of the combined image is obtained by linearly superposing the diffuse reflection component of the diffuse reflection model and the specular reflection component of the specular reflection model, and the diffuse reflection component corresponding to the diffuse reflection image in the image is extracted to be used as a result image after highlight removal processing of the initial image, so that the distortion problem possibly caused by directly removing the specular reflection component from the initial image is greatly reduced, and the highlight removal processing effect of the image is optimized.

Description

Image highlight removing processing method and device and electronic equipment
Technical Field
The present disclosure relates to the field of image processing technologies, and in particular, to an image highlight removal processing method and apparatus, and an electronic device.
Background
With the development of image processing technology, the function of beautifying human body in pictures is increasingly popularized, and the requirement of image processing is higher and higher. The existing picture is usually obtained by direct shooting, and the highlight effect of areas such as a human face in the picture is too strong due to environmental factors during shooting, so that the normal display of the picture is influenced, and the display effect is relatively distorted.
Therefore, the technical problem that the image display effect is distorted due to the existing image highlight is solved.
Disclosure of Invention
In view of the above, embodiments of the present disclosure provide an image highlight removing method, which at least partially solves the problems in the prior art.
In a first aspect, an embodiment of the present disclosure provides an image highlight removing method, including:
acquiring an initial image, wherein the initial image comprises a diffuse reflection component and a specular reflection component displaying high light;
calculating a maximum chroma value of the initial image;
obtaining the diffuse reflection image according to the maximum chromatic value of the initial image;
and outputting the diffuse reflection image as a result image of the initial image after the highlight of the initial image is removed.
According to a specific implementation manner of the embodiment of the present disclosure, the step of obtaining the diffuse reflection image according to the maximum chromaticity value of the initial image includes:
calculating a color channel value of each color channel of each pixel in the diffuse reflection image according to the maximum chromatic value of the initial image;
determining attribute parameters of each pixel according to the color channel values of all color channels of each pixel;
and generating the diffuse reflection image according to the attribute parameters of each pixel in the diffuse reflection image.
According to a specific implementation manner of the embodiment of the present disclosure, the step of calculating a color channel value of each color channel of each pixel in the diffuse reflection image according to the maximum chroma value of the initial image includes:
calculating a minimum chroma value of the initial image;
calculating the maximum chromatic value of the diffuse reflection component according to the minimum chromatic value of the initial image;
and substituting the maximum chromatic value of the initial image and the maximum chromatic value of the diffuse reflection component into a first preset formula to obtain the color channel value of each pixel of the diffuse reflection image.
According to a specific implementation manner of the embodiment of the present disclosure, the step of calculating the maximum chroma value of the initial image includes:
extracting a color channel value of each pixel in the initial image;
calculating the chroma of each color channel according to the color channel values of all pixels;
and determining the maximum chroma value of the initial image according to the chroma of all the color channels.
According to a specific implementation manner of the embodiment of the present disclosure, the step of calculating the chromaticity of each color channel according to the color channel values of all the pixels includes:
determining a color channel value for a target color channel for each pixel;
calculating the sum of the color channel values of all the color channels of the pixel;
dividing the color channel value of the target color channel by the sum of the color channel values as the chromaticity of the target color channel.
According to a specific implementation manner of the embodiment of the present disclosure, the step of calculating the minimum chroma value of the initial image includes:
extracting a color channel value of each pixel in the initial image;
calculating the chroma of each color channel according to the color channel values of all pixels;
and determining the minimum chroma value of the initial image according to the chroma of all the color channels.
According to a specific implementation manner of the embodiment of the present disclosure, the step of calculating the maximum chromaticity value of the diffuse reflection component according to the minimum chromaticity value of the initial image includes:
substituting the minimum chromatic value of the initial image into a second preset formula, and calculating an anonymous function value corresponding to each color channel, wherein the anonymous function value is associated with the chromatic value of the diffuse reflection component;
substituting anonymous function values corresponding to all color channels into a third preset formula, and calculating the maximum value of the anonymous function;
and taking the maximum value of the anonymity function as the maximum chromatic value of the diffuse reflection component.
According to a specific implementation manner of the embodiment of the present disclosure, the first preset formula is:
Figure BDA0002525617340000031
wherein,
Figure BDA0002525617340000032
a color channel value, J, representing any color channel of the diffuse reflectance imageCRepresenting any color channel of the initial image, c being any one of r, g, b color channels, JuRepresenting the maximum chrominance value of the initial image, ΛmaxRepresenting the maximum chromaticity value of the diffuse reflection component.
According to a specific implementation manner of the embodiment of the present disclosure, the second preset formula is:
Figure BDA0002525617340000033
wherein,
c is any one of r, g and b color channels, lambdacValue of an anonymous function, σ, representing any color channelcRepresenting chrominance values, σ, of any one of the color channelsminIs the minimum chrominance value of the initial image.
According to a specific implementation manner of the embodiment of the present disclosure, the third preset formula is:
Figure BDA0002525617340000034
wherein
λmaxRepresenting the maximum chrominance value.
In a second aspect, an embodiment of the present disclosure provides an image highlight removing device, including:
the system comprises an acquisition module, a processing module and a display module, wherein the acquisition module is used for acquiring an initial image, and the initial image comprises a diffuse reflection component and a specular reflection component displaying high light;
the calculation module is used for calculating the maximum chromatic value of the initial image;
the processing module is used for obtaining the diffuse reflection image according to the maximum chromatic value of the initial image;
and the output module is used for outputting the diffuse reflection image as a result image of the initial image after highlight removal.
In a third aspect, an embodiment of the present disclosure further provides an electronic device, where the electronic device includes:
at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor; wherein,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the image de-highlighting method of the first aspect or any implementation manner of the first aspect.
In a fourth aspect, the disclosed embodiments also provide a non-transitory computer-readable storage medium storing computer instructions for causing a computer to execute the image highlight removal processing method in the foregoing first aspect or any implementation manner of the first aspect.
In a fifth aspect, the present disclosure also provides a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium, where the computer program includes program instructions, and when the program instructions are executed by a computer, the computer executes the image de-highlight processing method in the foregoing first aspect or any implementation manner of the first aspect.
The image highlight removing processing scheme in the embodiment of the disclosure comprises the following steps: acquiring an initial image, wherein the initial image comprises a diffuse reflection component and a specular reflection component displaying high light; calculating a maximum chroma value of the initial image; obtaining the diffuse reflection image according to the maximum chromatic value of the initial image; and outputting the diffuse reflection image as a result image of the initial image after the highlight of the initial image is removed. According to the scheme disclosed by the invention, the imaging model of the combined image is obtained by linearly superposing the diffuse reflection component of the diffuse reflection model and the specular reflection component of the specular reflection model, and the diffuse reflection component corresponding to the diffuse reflection image in the image is extracted to be used as a result image after highlight removal processing of the initial image, so that the distortion problem possibly caused by directly removing the specular reflection component from the initial image is greatly reduced, and the highlight removal processing effect of the image is optimized.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure, the drawings needed to be used in the embodiments will be briefly described below, and it is apparent that the drawings in the following description are only some embodiments of the present disclosure, and it is obvious for those skilled in the art that other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a schematic flowchart of an image highlight removal processing method according to an embodiment of the present disclosure;
FIG. 2 is a partial schematic flow chart of another image highlight removal method according to an embodiment of the present disclosure;
FIG. 3 is a partial flowchart of another method for highlight removal of an image according to an embodiment of the present disclosure;
FIG. 4 is a partial flowchart of another method for highlight removal of an image according to an embodiment of the present disclosure;
FIG. 5 is a schematic structural diagram of an image highlight removal processing apparatus according to an embodiment of the present disclosure;
fig. 6 is a schematic view of an electronic device provided in an embodiment of the present disclosure.
Detailed Description
The embodiments of the present disclosure are described in detail below with reference to the accompanying drawings.
The embodiments of the present disclosure are described below with specific examples, and other advantages and effects of the present disclosure will be readily apparent to those skilled in the art from the disclosure in the specification. It is to be understood that the described embodiments are merely illustrative of some, and not restrictive, of the embodiments of the disclosure. The disclosure may be embodied or carried out in various other specific embodiments, and various modifications and changes may be made in the details within the description without departing from the spirit of the disclosure. It is to be noted that the features in the following embodiments and examples may be combined with each other without conflict. All other embodiments, which can be derived by a person skilled in the art from the embodiments disclosed herein without making any creative effort, shall fall within the protection scope of the present disclosure.
It is noted that various aspects of the embodiments are described below within the scope of the appended claims. It should be apparent that the aspects described herein may be embodied in a wide variety of forms and that any specific structure and/or function described herein is merely illustrative. Based on the disclosure, one skilled in the art should appreciate that one aspect described herein may be implemented independently of any other aspects and that two or more of these aspects may be combined in various ways. For example, an apparatus may be implemented and/or a method practiced using any number of the aspects set forth herein. Additionally, such an apparatus may be implemented and/or such a method may be practiced using other structure and/or functionality in addition to one or more of the aspects set forth herein.
It should be noted that the drawings provided in the following embodiments are only for illustrating the basic idea of the present disclosure, and the drawings only show the components related to the present disclosure rather than the number, shape and size of the components in actual implementation, and the type, amount and ratio of the components in actual implementation may be changed arbitrarily, and the layout of the components may be more complicated.
In addition, in the following description, specific details are provided to facilitate a thorough understanding of the examples. However, it will be understood by those skilled in the art that the aspects may be practiced without these specific details.
The embodiment of the disclosure provides an image highlight removing processing method. The image highlight removing processing method provided by the embodiment can be executed by a computing device, the computing device can be implemented as software, or implemented as a combination of software and hardware, and the computing device can be integrally arranged in a server, a terminal device and the like.
Referring to fig. 1, an image highlight removing processing method provided by the embodiment of the present disclosure includes:
s101, acquiring an initial image, wherein the initial image comprises a diffuse reflection component and a specular reflection component displaying high light;
the image highlight removing method provided by the embodiment is applied to electronic equipment such as a terminal and is used for removing image components which show highlight effect in an image. According to an imaging model of an image in electronic equipment, the imaging model is usually constructed by a Diffuse Reflection model Diffuse and a Specular Reflection model Specular Reflection, and accordingly, the image comprises a Diffuse Reflection component obtained by the Diffuse Reflection model and a Specular Reflection component obtained by the Specular Reflection model which are linearly superposed, and the Specular Reflection component enables the image to display a highlight effect.
Defining the image output by the imaging model as an initial image, i.e. J ═ JD+JsWherein J denotes the initial image, JDRepresents the corresponding diffuse reflection component, JsRepresenting the corresponding specular component. And obtaining a diffuse reflection image corresponding to the diffuse reflection component according to the initial image, namely removing specular reflection components causing highlight from the initial image to obtain a result image of the initial image after the highlight is removed.
S102, calculating the maximum chromatic value of the initial image;
the image comprises a plurality of pixels, each pixel comprises three RGB color channels, each color channel has a color channel value, and a corresponding chromatic value can be obtained according to the color channel value of each pixel.
Optionally, as shown in fig. 2, the step of calculating the maximum chroma value of the initial image may include:
s201, extracting a color channel value of each pixel in the initial image;
in image processing, the color channel value of each pixel can be directly obtained, and the colors mainly include Red (Red, R or R), Green (Green, G or G) and Blue (Blue, B or B), that is, rgb values.
For example, an rgb value of (10, 20, 30) for one pixel corresponds to a red channel r value of 10, a green channel g value of 20, and a blue channel b value of 30.
S202, calculating the chromaticity of each color channel according to the color channel values of all pixels;
the specific calculation process may include:
determining a color channel value for a target color channel for each pixel;
calculating the sum of the color channel values of all the color channels of the pixel;
dividing the color channel value of the target color channel by the sum of the color channel values as the chromaticity of the target color channel.
In connection with the above example, the red chroma value is 10/(10+20+30), the green chroma value is 20/(10+20+30), and the red chroma value is 30/(10+20+ 30). It can be derived that the chrominance addition of the three rgb colors is equal to 1.
S203, determining the maximum chroma value of the initial image according to the chroma of all the color channels.
After the chromatic value of each color channel is obtained according to the steps, the maximum chromatic value can be determined.
For example, in the above example, the maximum chrominance value sigma _ max, i.e., σ, of the initial imagemax=max(σrgb)。
Similarly, the rgb chromaticity of the diffuse reflection image corresponding to the diffuse reflection component can be defined as:
Figure BDA0002525617340000071
and maximum chromaticity value Λ of the diffuse reflection imagemax=max(Λrgb)。
S103, obtaining the diffuse reflection image according to the maximum chromatic value of the initial image;
after the maximum chromatic value of the initial image is obtained according to the steps, the diffuse reflection image can be further obtained. Optionally, the step of obtaining the diffuse reflection image according to the maximum chromatic value of the initial image may include:
calculating a color channel value of each color channel of each pixel in the diffuse reflection image according to the maximum chromatic value of the initial image;
determining attribute parameters of each pixel according to the color channel values of all color channels of each pixel;
and generating the diffuse reflection image according to the attribute parameters of each pixel in the diffuse reflection image.
And S104, outputting the diffuse reflection image as a result image of the initial image after the highlight is removed.
And according to the calculation process, obtaining a diffuse reflection image in the initial image, namely a result image without specular reflection components and highlight, and outputting the result image.
According to a specific implementation manner of the embodiment of the present disclosure, as shown in fig. 3, the step of calculating a color channel value of each color channel of each pixel in the diffuse reflection image according to the maximum chroma value of the initial image may include:
s301, calculating the minimum chromatic value of the initial image;
according to the existing conclusion, the diffuse reflection image is related to the maximum chroma value of the diffuse reflection component, and considering that the value of the maximum chroma value A _ max of the diffuse reflection component cannot be directly extracted, the color of the image depends on the geometric shape and the material of the surface of the object, but the chroma A is unrelated to the geometric shape, so that the maximum chroma value A _ max of the diffuse reflection component is calculated by using another anonymous function parameter, namely lambda _ max, which is unrelated to the geometric shape and the material of the surface, and the minimum chroma value of the initial image is obtained firstly. The specific calculation process of the initial image may include:
extracting a color channel value of each pixel in the initial image;
calculating the chroma of each color channel according to the color channel values of all pixels;
and determining the minimum chroma value of the initial image according to the chroma of all the color channels.
S302, calculating the maximum chromatic value of the diffuse reflection component according to the minimum chromatic value of the initial image;
the specific calculation process of calculating the maximum chromaticity value of the diffuse reflection component from the minimum chromaticity value of the initial image may include:
s401, substituting the minimum chromatic value of the initial image into a second preset formula, and calculating an anonymous function value corresponding to each color channel, wherein the anonymous function value is associated with the chromatic value of the diffuse reflection component;
optionally, the second preset formula is as follows:
Figure BDA0002525617340000081
wherein,
c is any one of r, g and b color channels, lambdacValue of an anonymous function, σ, representing any color channelcRepresenting chrominance values, σ, of any one of the color channelsminIs the minimum chrominance value of the initial image.
S402, substituting anonymous function values corresponding to all color channels into a third preset formula, and calculating the maximum value of the anonymous function;
according to a specific embodiment of the present disclosure, the third preset formula is:
Figure BDA0002525617340000091
wherein
λmaxRepresenting the maximum chrominance value.
And S403, taking the maximum value of the anonymity function as the maximum chromatic value of the diffuse reflection component.
The maximum value of the anonymity function lambda _ max approaches the maximum chromaticity value of the diffuse reflection component, and the maximum value of the anonymity function can be directly taken as the maximum chromaticity value of the diffuse reflection component.
And S303, substituting the maximum chromatic value of the initial image and the maximum chromatic value of the diffuse reflection component into a first preset formula to obtain the color channel value of each pixel of the diffuse reflection image.
According to a specific implementation manner of the embodiment of the present disclosure, the first preset formula is:
Figure BDA0002525617340000092
wherein,
Figure BDA0002525617340000093
a color channel value, J, representing any color channel of the diffuse reflectance imageCRepresenting any color channel of the initial image, c being any one of r, g, b color channels, JuRepresenting the maximum chrominance value of the initial image, ΛmaxRepresenting the maximum chromaticity value of the diffuse reflection component.
And lambda _ max is substituted into the first preset formula to obtain the diffuse reflection image, namely the highlight result image is removed from the initial image.
According to the scheme, the image combination model is obtained by linearly superposing the diffuse reflection component of the diffuse reflection model and the specular reflection component of the specular reflection model, the diffuse reflection component corresponding to the diffuse reflection image in the image is extracted to be used as a result image after highlight removal processing of the initial image, the distortion problem possibly caused by directly removing the specular reflection component from the initial image is greatly reduced, and the highlight removal processing effect of the image is optimized.
Corresponding to the above method embodiment, referring to fig. 5, the disclosed embodiment further provides an image highlight removing processing device 50, including:
an obtaining module 501, configured to obtain an initial image, where the initial image includes a diffuse reflection component and a specular reflection component displaying high light;
a calculating module 502, configured to calculate a maximum chroma value of the initial image;
the processing module 503 is configured to obtain the diffuse reflection image according to the maximum chromatic value of the initial image;
an output module 504, configured to output the diffuse reflection image as a result image of the initial image after the highlight is removed.
The apparatus shown in fig. 5 may correspondingly execute the content in the above method embodiment, and details of the part not described in detail in this embodiment refer to the content described in the above method embodiment, which is not described again here.
Referring to fig. 6, an embodiment of the present disclosure also provides an electronic device 60, including:
at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor; wherein,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the image de-highlighting method of the method embodiments described above.
The disclosed embodiments also provide a non-transitory computer-readable storage medium storing computer instructions for causing the computer to perform the image highlight removal processing method in the aforementioned method embodiments.
The disclosed embodiments also provide a computer program product comprising a computer program stored on a non-transitory computer readable storage medium, the computer program comprising program instructions which, when executed by a computer, cause the computer to perform the image highlight removal processing method in the aforementioned method embodiments.
Referring now to FIG. 6, a schematic diagram of an electronic device 60 suitable for use in implementing embodiments of the present disclosure is shown. The electronic devices in the embodiments of the present disclosure may include, but are not limited to, mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., car navigation terminals), and the like, and fixed terminals such as digital TVs, desktop computers, and the like. The electronic device shown in fig. 6 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present disclosure.
As shown in fig. 6, the electronic device 60 may include a processing means (e.g., a central processing unit, a graphics processor, etc.) 601 that may perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)602 or a program loaded from a storage means 608 into a Random Access Memory (RAM) 603. In the RAM 603, various programs and data necessary for the operation of the electronic apparatus 60 are also stored. The processing device 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input/output (I/O) interface 605 is also connected to bus 604.
Generally, the following devices may be connected to the I/O interface 605: input devices 606 including, for example, a touch screen, touch pad, keyboard, mouse, image sensor, microphone, accelerometer, gyroscope, etc.; output devices 607 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage 608 including, for example, tape, hard disk, etc.; and a communication device 609. The communication means 609 may allow the electronic device 60 to communicate with other devices wirelessly or by wire to exchange data. While the figures illustrate an electronic device 60 having various means, it is to be understood that not all illustrated means are required to be implemented or provided. More or fewer devices may alternatively be implemented or provided.
In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network via the communication means 609, or may be installed from the storage means 608, or may be installed from the ROM 602. The computer program, when executed by the processing device 601, performs the above-described functions defined in the methods of the embodiments of the present disclosure.
It should be noted that the computer readable medium in the present disclosure can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In contrast, in the present disclosure, a computer readable signal medium may comprise a propagated data signal with computer readable program code embodied therein, either in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, optical cables, RF (radio frequency), etc., or any suitable combination of the foregoing.
The computer readable medium may be embodied in the electronic device; or may exist separately without being assembled into the electronic device.
The computer readable medium carries one or more programs which, when executed by the electronic device, enable the electronic device to implement the schemes provided by the method embodiments.
Alternatively, the computer readable medium carries one or more programs, which when executed by the electronic device, enable the electronic device to implement the schemes provided by the method embodiments.
Computer program code for carrying out operations for aspects of the present disclosure may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + +, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
According to one or more embodiments of the present disclosure, the step of obtaining the diffuse reflection image according to the maximum chroma value of the initial image comprises:
calculating a color channel value of each color channel of each pixel in the diffuse reflection image according to the maximum chromatic value of the initial image;
determining attribute parameters of each pixel according to the color channel values of all color channels of each pixel;
and generating the diffuse reflection image according to the attribute parameters of each pixel in the diffuse reflection image.
According to one or more embodiments of the present disclosure, the step of calculating a color channel value of each color channel of each pixel in the diffuse reflection image according to the maximum chroma value of the initial image includes:
calculating a minimum chroma value of the initial image;
calculating the maximum chromatic value of the diffuse reflection component according to the minimum chromatic value of the initial image;
and substituting the maximum chromatic value of the initial image and the maximum chromatic value of the diffuse reflection component into a first preset formula to obtain the color channel value of each pixel of the diffuse reflection image.
According to one or more embodiments of the present disclosure, the step of calculating the maximum chroma value of the initial image comprises:
extracting a color channel value of each pixel in the initial image;
calculating the chroma of each color channel according to the color channel values of all pixels;
and determining the maximum chroma value of the initial image according to the chroma of all the color channels.
According to one or more embodiments of the present disclosure, the calculating the chromaticity of each color channel according to the color channel values of all pixels includes:
determining a color channel value for a target color channel for each pixel;
calculating the sum of the color channel values of all the color channels of the pixel;
dividing the color channel value of the target color channel by the sum of the color channel values as the chromaticity of the target color channel.
According to one or more embodiments of the present disclosure, the step of calculating the minimum chrominance value of the initial image includes:
extracting a color channel value of each pixel in the initial image;
calculating the chroma of each color channel according to the color channel values of all pixels;
and determining the minimum chroma value of the initial image according to the chroma of all the color channels.
According to one or more embodiments of the present disclosure, the method further comprises calculating a minimum chroma value of the initial image according to the minimum chroma value of the initial image
The step of calculating the maximum chromaticity value of the diffuse reflection component includes:
substituting the minimum chromatic value of the initial image into a second preset formula, and calculating an anonymous function value corresponding to each color channel, wherein the anonymous function value is associated with the chromatic value of the diffuse reflection component;
substituting anonymous function values corresponding to all color channels into a third preset formula, and calculating the maximum value of the anonymous function;
and taking the maximum value of the anonymity function as the maximum chromatic value of the diffuse reflection component.
According to one or more embodiments of the present disclosure, the first preset formula is:
Figure BDA0002525617340000141
wherein,
Figure BDA0002525617340000142
a color channel value, J, representing any color channel of the diffuse reflectance imageCRepresenting any color channel of the initial image, c being any one of r, g, b color channels, JuRepresenting the maximum chrominance value of the initial image, ΛmaxRepresenting the maximum chromaticity value of the diffuse reflection component.
According to one or more embodiments of the present disclosure, the second preset formula is:
Figure BDA0002525617340000143
wherein,
c is any one of r, g and b color channels, lambdacValue of an anonymous function, σ, representing any color channelcRepresenting chrominance values, σ, of any one of the color channelsminIs the minimum chrominance value of the initial image.
According to one or more embodiments of the present disclosure, the third preset formula is:
Figure BDA0002525617340000144
wherein
λmaxRepresenting the maximum chrominance value.
According to one or more embodiments of the present disclosure, the image de-highlighting apparatus is further configured to:
calculating a color channel value of each color channel of each pixel in the diffuse reflection image according to the maximum chromatic value of the initial image;
determining attribute parameters of each pixel according to the color channel values of all color channels of each pixel;
and generating the diffuse reflection image according to the attribute parameters of each pixel in the diffuse reflection image.
According to one or more embodiments of the present disclosure, the image de-highlighting apparatus is further configured to:
calculating a minimum chroma value of the initial image;
calculating the maximum chromatic value of the diffuse reflection component according to the minimum chromatic value of the initial image;
and substituting the maximum chromatic value of the initial image and the maximum chromatic value of the diffuse reflection component into a first preset formula to obtain the color channel value of each pixel of the diffuse reflection image.
According to one or more embodiments of the present disclosure, the image de-highlighting apparatus is further configured to:
extracting a color channel value of each pixel in the initial image;
calculating the chroma of each color channel according to the color channel values of all pixels;
and determining the maximum chroma value of the initial image according to the chroma of all the color channels.
According to one or more embodiments of the present disclosure, the image de-highlighting apparatus is further configured to:
determining a color channel value for a target color channel for each pixel;
calculating the sum of the color channel values of all the color channels of the pixel;
dividing the color channel value of the target color channel by the sum of the color channel values as the chromaticity of the target color channel.
According to one or more embodiments of the present disclosure, the image de-highlighting apparatus is further configured to:
extracting a color channel value of each pixel in the initial image;
calculating the chroma of each color channel according to the color channel values of all pixels;
and determining the minimum chroma value of the initial image according to the chroma of all the color channels.
According to one or more embodiments of the present disclosure, the image de-highlighting apparatus is further configured to:
substituting the minimum chromatic value of the initial image into a second preset formula, and calculating an anonymous function value corresponding to each color channel, wherein the anonymous function value is associated with the chromatic value of the diffuse reflection component;
substituting anonymous function values corresponding to all color channels into a third preset formula, and calculating the maximum value of the anonymous function;
and taking the maximum value of the anonymity function as the maximum chromatic value of the diffuse reflection component.
According to one or more embodiments of the present disclosure, the first preset formula is:
Figure BDA0002525617340000161
wherein,
Figure BDA0002525617340000162
a color channel value, J, representing any color channel of the diffuse reflectance imageCRepresenting any color channel of the initial image, c being any one of r, g, b color channels, JuRepresenting the maximum chrominance value of the initial image, ΛmaxRepresenting the maximum chromaticity value of the diffuse reflection component.
According to one or more embodiments of the present disclosure, the second preset formula is:
Figure BDA0002525617340000163
wherein,
c is any one of r, g and b color channels, lambdacValue of an anonymous function, σ, representing any color channelcRepresenting chrominance values, σ, of any one of the color channelsminIs the minimum chrominance value of the initial image.
According to one or more embodiments of the present disclosure, the third preset formula is:
Figure BDA0002525617340000164
wherein
λmaxRepresenting the maximum chrominance value.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present disclosure may be implemented by software or hardware. Where the name of a unit does not in some cases constitute a limitation of the unit itself, for example, the first retrieving unit may also be described as a "unit for retrieving at least two internet protocol addresses".
It should be understood that portions of the present disclosure may be implemented in hardware, software, firmware, or a combination thereof.
The above description is only for the specific embodiments of the present disclosure, but the scope of the present disclosure is not limited thereto, and any changes or substitutions that can be easily conceived by those skilled in the art within the technical scope of the present disclosure should be covered within the scope of the present disclosure. Therefore, the protection scope of the present disclosure shall be subject to the protection scope of the claims.

Claims (13)

1. An image de-highlight processing method, comprising:
acquiring an initial image, wherein the initial image comprises a diffuse reflection component and a specular reflection component displaying high light;
calculating a maximum chroma value of the initial image;
obtaining the diffuse reflection image according to the maximum chromatic value of the initial image;
and outputting the diffuse reflection image as a result image of the initial image after the highlight of the initial image is removed.
2. The method of claim 1, wherein the step of obtaining the diffuse reflection image according to the maximum chroma value of the initial image comprises:
calculating a color channel value of each color channel of each pixel in the diffuse reflection image according to the maximum chromatic value of the initial image;
determining attribute parameters of each pixel according to the color channel values of all color channels of each pixel;
and generating the diffuse reflection image according to the attribute parameters of each pixel in the diffuse reflection image.
3. The method of claim 2, wherein the step of calculating a color channel value for each color channel for each pixel in the diffuse reflectance image based on the maximum chroma value of the initial image comprises:
calculating a minimum chroma value of the initial image;
calculating the maximum chromatic value of the diffuse reflection component according to the minimum chromatic value of the initial image;
and substituting the maximum chromatic value of the initial image and the maximum chromatic value of the diffuse reflection component into a first preset formula to obtain the color channel value of each pixel of the diffuse reflection image.
4. The method of claim 1, wherein the step of calculating the maximum chroma value of the initial image comprises:
extracting a color channel value of each pixel in the initial image;
calculating the chroma of each color channel according to the color channel values of all pixels;
and determining the maximum chroma value of the initial image according to the chroma of all the color channels.
5. The method of claim 4, wherein the step of calculating the chroma of each color channel based on the color channel values of all pixels comprises:
determining a color channel value for a target color channel for each pixel;
calculating the sum of the color channel values of all the color channels of the pixel;
dividing the color channel value of the target color channel by the sum of the color channel values as the chromaticity of the target color channel.
6. The method of claim 3, wherein the step of calculating the minimum chroma value of the initial image comprises:
extracting a color channel value of each pixel in the initial image;
calculating the chroma of each color channel according to the color channel values of all pixels;
and determining the minimum chroma value of the initial image according to the chroma of all the color channels.
7. The method of claim 3, wherein the step of calculating the maximum chromaticity value of the diffuse reflection component from the minimum chromaticity value of the initial image comprises:
substituting the minimum chromatic value of the initial image into a second preset formula, and calculating an anonymous function value corresponding to each color channel, wherein the anonymous function value is associated with the chromatic value of the diffuse reflection component;
substituting anonymous function values corresponding to all color channels into a third preset formula, and calculating the maximum value of the anonymous function;
and taking the maximum value of the anonymity function as the maximum chromatic value of the diffuse reflection component.
8. The method of claim 6, wherein the first predetermined formula is:
Figure FDA0002525617330000021
wherein,
Figure FDA0002525617330000022
a color channel value, J, representing any color channel of the diffuse reflectance imageCRepresenting any color channel of the initial image, c being any one of r, g, b color channels, JuRepresenting the maximum chrominance value of the initial image, ΛmaxRepresenting the maximum chromaticity value of the diffuse reflection component.
9. The method of claim 7, wherein the second predetermined formula is:
Figure FDA0002525617330000023
wherein,
c is any one of r, g and b color channels, lambdacRepresenting the anonymous function-value of any color channel,
σcrepresenting chrominance values, σ, of any one of the color channelsminIs the minimum chrominance value of the initial image.
10. The method according to claim 9, wherein the third predetermined formula is:
Figure FDA0002525617330000031
wherein
λmaxRepresenting the maximum chrominance value.
11. An image de-highlight processing apparatus, comprising:
the system comprises an acquisition module, a processing module and a display module, wherein the acquisition module is used for acquiring an initial image, and the initial image comprises a diffuse reflection component and a specular reflection component displaying high light;
the calculation module is used for calculating the maximum chromatic value of the initial image;
the processing module is used for obtaining the diffuse reflection image according to the maximum chromatic value of the initial image;
and the output module is used for outputting the diffuse reflection image as a result image of the initial image after highlight removal.
12. An electronic device, characterized in that the electronic device comprises:
at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor; wherein,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the image de-highlighting method of any of the preceding claims 1-10.
13. A non-transitory computer-readable storage medium storing computer instructions for causing a computer to perform the image de-highlight processing method of any one of the preceding claims 1-10.
CN202010503327.6A 2020-06-05 2020-06-05 Image highlight removing processing method and device and electronic equipment Pending CN111754425A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010503327.6A CN111754425A (en) 2020-06-05 2020-06-05 Image highlight removing processing method and device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010503327.6A CN111754425A (en) 2020-06-05 2020-06-05 Image highlight removing processing method and device and electronic equipment

Publications (1)

Publication Number Publication Date
CN111754425A true CN111754425A (en) 2020-10-09

Family

ID=72674697

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010503327.6A Pending CN111754425A (en) 2020-06-05 2020-06-05 Image highlight removing processing method and device and electronic equipment

Country Status (1)

Country Link
CN (1) CN111754425A (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108090950A (en) * 2016-11-18 2018-05-29 南京大学 A kind of method for optimizing the high light pollution of go image
US20180158174A1 (en) * 2016-12-05 2018-06-07 Samsung Electronics Co., Ltd. Image processing method and apparatus
CN110070495A (en) * 2019-02-20 2019-07-30 北京字节跳动网络技术有限公司 Processing method, device and the electronic equipment of image
CN110069974A (en) * 2018-12-21 2019-07-30 北京字节跳动网络技术有限公司 Bloom image processing method, device and electronic equipment
CN110390648A (en) * 2019-06-24 2019-10-29 浙江大学 A kind of image high-intensity region method distinguished based on unsaturation and saturation bloom
CN110533732A (en) * 2019-09-04 2019-12-03 厦门美图之家科技有限公司 The recognition methods of the colour of skin, device, electronic equipment and storage medium in image
CN111080686A (en) * 2019-12-16 2020-04-28 中国科学技术大学 Method for highlight removal of image in natural scene

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108090950A (en) * 2016-11-18 2018-05-29 南京大学 A kind of method for optimizing the high light pollution of go image
US20180158174A1 (en) * 2016-12-05 2018-06-07 Samsung Electronics Co., Ltd. Image processing method and apparatus
CN110069974A (en) * 2018-12-21 2019-07-30 北京字节跳动网络技术有限公司 Bloom image processing method, device and electronic equipment
CN110070495A (en) * 2019-02-20 2019-07-30 北京字节跳动网络技术有限公司 Processing method, device and the electronic equipment of image
CN110390648A (en) * 2019-06-24 2019-10-29 浙江大学 A kind of image high-intensity region method distinguished based on unsaturation and saturation bloom
CN110533732A (en) * 2019-09-04 2019-12-03 厦门美图之家科技有限公司 The recognition methods of the colour of skin, device, electronic equipment and storage medium in image
CN111080686A (en) * 2019-12-16 2020-04-28 中国科学技术大学 Method for highlight removal of image in natural scene

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
QINGXIONG YANG ET.AL: "Efficient and Robust Specular Highlight Removal", IEEE TRANSACTIONS ON PATTERN ANALYSIS AND MACHINE INTELLIGENCE, vol. 37, no. 6, pages 1304 - 1311, XP011580251, DOI: 10.1109/TPAMI.2014.2360402 *

Similar Documents

Publication Publication Date Title
CN110210532B (en) Background color generation method and device and electronic equipment
CN110070495B (en) Image processing method and device and electronic equipment
US12020482B2 (en) Live streaming sampling method and apparatus, and electronic device
CN110865862A (en) Page background setting method and device and electronic equipment
CN110070515B (en) Image synthesis method, apparatus and computer-readable storage medium
CN113742025B (en) Page generation method, device, equipment and storage medium
CN111626921A (en) Picture processing method and device and electronic equipment
CN111325668B (en) Training method and device for image processing deep learning model and electronic equipment
CN110211030A (en) Image generating method and device
CN111383329A (en) Three-dimensional image display method and device based on browser and electronic equipment
CN110908752A (en) Control setting method and device, electronic equipment and interaction system
CN111738950B (en) Image processing method and device
CN111258582B (en) Window rendering method and device, computer equipment and storage medium
CN110070586B (en) Color card generation method and device and electronic equipment
CN111754425A (en) Image highlight removing processing method and device and electronic equipment
CN111221444A (en) Split screen special effect processing method and device, electronic equipment and storage medium
CN111415393B (en) Method and device for adjusting display of multimedia blackboard, medium and electronic equipment
CN111696041B (en) Image processing method and device and electronic equipment
CN111223105B (en) Image processing method and device
CN111200705B (en) Image processing method and device
CN111199519B (en) Method and device for generating special effect package
CN111292245A (en) Image processing method and device
WO2021031846A1 (en) Water ripple effect implementing method and apparatus, electronic device, and computer readable storage medium
US20220292733A1 (en) Method and apparatus for text effect processing
CN117234650A (en) Image display method and device, storage medium and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination