Detailed Description
Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While certain embodiments of the present disclosure are shown in the drawings, it is to be understood that the present disclosure may be embodied in various forms and should not be construed as limited to the embodiments set forth herein, but rather are provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the disclosure are for illustration purposes only and are not intended to limit the scope of the disclosure.
It should be understood that the various steps recited in the method embodiments of the present disclosure may be performed in a different order, and/or performed in parallel. Moreover, method embodiments may include additional steps and/or omit performing the illustrated steps. The scope of the present disclosure is not limited in this respect.
The term "include" and variations thereof as used herein are open-ended, i.e., "including but not limited to". The term "based on" is "based, at least in part, on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Relevant definitions for other terms will be given in the following description.
It should be noted that the terms "first", "second", and the like in the present disclosure are only used for distinguishing different devices, modules or units, and are not used for limiting the order or interdependence relationship of the functions performed by the devices, modules or units.
It is noted that references to "a", "an", and "the" modifications in this disclosure are intended to be illustrative rather than limiting, and that those skilled in the art will recognize that "one or more" may be used unless the context clearly dictates otherwise.
The names of messages or information exchanged between devices in the embodiments of the present disclosure are for illustrative purposes only, and are not intended to limit the scope of the messages or information.
Alternative embodiments of the present disclosure are described in detail below with reference to the accompanying drawings.
A first embodiment provided for the present disclosure, namely, an embodiment of a method of processing eye brightness of a face image.
The following describes an embodiment of the present disclosure in detail with reference to fig. 1, where fig. 1 is a flowchart of a method for processing eye brightness of a face image according to an embodiment of the present disclosure.
Step S101, obtaining an eye area of the face image and an original RGB value of each first pixel point in the eye area.
The eyes are the windows of the soul, in the process of shooting the character, the eyes are often the most important parts in the picture, if the character has a pair of bright eyes, the eyes can attract the eyes of the viewer, and the purpose of soul communication between the character and the viewer in the picture is achieved. This particular "directivity" if utilized properly, can be particularly effective. Therefore, increasing the brightness of the eyes is also an important function in image beautification.
The original RGB value refers to the RGB value of a pixel point in an original image.
The RGB color scheme is a color standard in the industry, and various colors are obtained by changing three color channels of red (R), green (G) and blue (B) and superimposing the three color channels on each other, where RGB represents colors of the three channels of red, green and blue, and the color standard almost includes all colors that can be perceived by human vision, and is one of the most widely used color systems at present.
Among the RGB values of the pixel points of the computer image, the value of black is zero, and the value of white is # FFFFFF. The larger the RGB value, the more white. The brightness of the eyes of the face image is improved, namely, the RGB values of pixel points in the eye area of the face image are more towards white.
Optionally, the acquiring an eye region of the facial image includes:
and S100-1, carrying out eye recognition on the face image according to the eye analysis model, and acquiring an eye area of the face image.
The eye analysis model is obtained based on previous historical eye image data, for example, the eye analysis model is trained by using the historical eye image data as a training sample. The embodiment of the present disclosure does not describe in detail the process of analyzing the network number tunneling face image to obtain the eye region according to the eye analysis model, and may be implemented by referring to various implementation manners in the prior art.
Step S102, traversing each first pixel point in the eye area, and respectively obtaining the difference processing value of the corresponding first pixel point according to the first convolution kernel and the difference processing rule of each first pixel point.
Traversing each first pixel point in the eye region means that each pixel point in the eye region is sequentially visited once and only once along the arrangement sequence of each pixel point in the eye region.
When the convolution kernel is image processing, given an input image, each pixel in the output image is a weighted average of RGB values of pixel points in a size region in the input image, where a weight is defined by a function, which is called a convolution kernel.
The size of the convolution kernel is typically rectangular, e.g., 2 × 2, 5 × 5. For higher resolution images, the disclosed embodiments employ larger convolution kernel sizes; the lower the resolution of the image, the smaller the size of the convolution kernel is employed by the disclosed embodiments.
The size region of the convolution kernel of the pixel point is a region formed by taking the pixel point of the designated image as the center. For example, if the size of the convolution kernel is 5 × 5, a square area with a length of 5 pixels and a width of 5 pixels is formed by taking the pixels of the designated image as the center, and this square area is the size area of the convolution kernel.
Optionally, the difference processing rule is mainly used for performing blurring processing and noise reduction processing on an image in an eye region, and includes: fuzzy and noise reduction processing rules.
Further, the obtaining the difference processing values of the corresponding first pixel points according to the first convolution kernel of each first pixel point and the difference processing rule respectively includes:
step S102-1, performing weighted calculation on all second pixel points in the size area of the first convolution kernel of each first pixel point respectively to obtain the weighted value of each second pixel point.
And the weighted calculation is to calculate the product of the value of the second pixel point and a preset weight.
In the embodiment of the present disclosure, the preset weight is a fixed value. In the embodiment of the present disclosure, all the weighted weights of the weighted calculation all use the preset weight.
Step S102-2, calculating the average value of the weighted values of all second pixel points in the size area of the first convolution kernel of each first pixel point, and acquiring the difference processing value of the corresponding first pixel point.
Step S103, respectively determining whether the relationship between the difference processing value of each first pixel and the corresponding original RGB value satisfies a preset brightening threshold.
The purpose of this step is to find a value that is more towards the white area from between the difference processed value and the corresponding raw RGB value.
Optionally, the determining whether a relationship between the difference processing value of the first pixel point and the corresponding original RGB value satisfies a preset brightening threshold includes:
step S103-1, judging whether the difference between the difference processing value of the first pixel point and the corresponding original RGB value meets a preset brightening threshold value.
The preset brightening threshold ranges to be greater than zero. Since among RGB values of pixel points of a computer image, a value of black is zero and a value of white is # FFFFFF. The larger the RGB value, the more white. For example, if the difference between the difference processed value and the corresponding original RGB value is greater than zero, it indicates that the difference processed value is more towards white.
And step S104, if so, setting the RGB value of the corresponding first pixel point as a difference processing value.
The embodiment of the disclosure achieves the purpose of beautifying through a method for improving the eye brightness of the face image.
Corresponding to the first embodiment provided by the present disclosure, the present disclosure also provides a second embodiment, namely, an apparatus for processing eye brightness of a face image. Since the second embodiment is basically similar to the first embodiment, the description is simple, and the relevant portions should be referred to the corresponding description of the first embodiment. The device embodiments described below are merely illustrative.
Fig. 2 illustrates an embodiment of an apparatus for processing eye brightness of a facial image provided by the present disclosure. Fig. 2 is a block diagram of units of an apparatus for processing eye brightness of a facial image according to an embodiment of the present disclosure.
Referring to fig. 2, the present disclosure provides an apparatus for processing eye brightness of a facial image, including: an acquisition unit 201, a difference processing unit 202, a judgment unit 203, and a setting unit 204.
An obtaining unit 201, configured to obtain an eye region of a face image and an original RGB value of each first pixel point in the eye region;
the difference processing unit 202 is configured to traverse each first pixel point in the eye region, and obtain a difference processing value of the corresponding first pixel point according to a first convolution kernel and a difference processing rule of each first pixel point;
the determining unit 203 is configured to determine whether a relationship between the difference processing value of each first pixel and the corresponding original RGB value meets a preset brightening threshold;
a setting unit 204, configured to set, if an output result of the determining unit is "yes," the RGB value of the corresponding first pixel point as a difference processing value.
Optionally, the difference processing rule includes: fuzzy and noise reduction processing rules.
Optionally, the difference processing unit 202 includes:
the weighted value acquiring subunit is used for respectively performing weighted calculation on all second pixel points in the size area of the first convolution kernel of each first pixel point to acquire the weighted value of each second pixel point;
and the difference processing value acquiring subunit is used for calculating the average value of the weighted values of all the second pixel points in the size area of the first convolution kernel of each first pixel point and acquiring the difference processing value of the corresponding first pixel point.
Optionally, the determining unit 203 includes:
and the judging subunit is used for judging whether the difference between the difference processing value of the first pixel point and the corresponding original RGB value meets a preset brightening threshold value.
Optionally, the obtaining unit 201 further includes:
and the identification subunit is used for carrying out eye identification on the face image according to the eye analysis model to acquire an eye area of the face image.
The embodiment of the disclosure achieves the purpose of beautifying through the device for improving the eye brightness of the face image.
The present disclosure provides a third embodiment, which is an electronic device, configured to implement a method for processing eye brightness of a face image, the electronic device including: at least one processor; and a memory communicatively coupled to the at least one processor; wherein,
the memory stores instructions executable by the one processor to cause the at least one processor to perform the method of processing eye brightness of a facial image as described in the first embodiment.
The disclosed embodiments provide a fourth embodiment, namely a computer storage medium for processing the eye brightness of a facial image, the computer storage medium storing computer executable instructions that can execute the method for processing the eye brightness of a facial image as described in the first embodiment.
Referring now to FIG. 3, shown is a schematic diagram of an electronic device suitable for use in implementing embodiments of the present disclosure. The terminal device in the embodiments of the present disclosure may include, but is not limited to, a mobile terminal such as a mobile phone, a notebook computer, a digital broadcast receiver, a PDA (personal digital assistant), a PAD (tablet computer), a PMP (portable multimedia player), a vehicle terminal (e.g., a car navigation terminal), and the like, and a stationary terminal such as a digital TV, a desktop computer, and the like. The electronic device shown in fig. 3 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. 3, the electronic device may include a processing device (e.g., a central processing unit, a graphics processor, etc.) 301 that may perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM)302 or a program loaded from a storage device 308 into a Random Access Memory (RAM) 303. In the RAM 303, various programs and data necessary for the operation of the electronic apparatus are also stored. The processing device 301, the ROM 302, and the RAM 303 are connected to each other via a bus 304. An input/output (I/O) interface 305 is also connected to bus 304.
Generally, the following devices may be connected to the I/O interface 305: input devices 306 including, for example, a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; an output device 307 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage devices 308 including, for example, magnetic tape, hard disk, etc.; and a communication device 309. The communication means 309 may allow the electronic device to communicate wirelessly or by wire with other devices to exchange data. While fig. 3 illustrates an electronic device 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 carried on a non-transitory computer readable medium, the computer program containing program code for performing the method illustrated by the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication means 309, or installed from the storage means 308, or installed from the ROM 302. The computer program, when executed by the processing device 301, 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.
In some embodiments, the clients, servers may communicate using any currently known or future developed network Protocol, such as HTTP (HyperText Transfer Protocol), and may interconnect with any form or medium of digital data communication (e.g., a communications network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), the Internet (e.g., the Internet), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future developed network.
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, cause the electronic device to: acquiring at least two internet protocol addresses; sending a node evaluation request comprising the at least two internet protocol addresses to node evaluation equipment, wherein the node evaluation equipment selects the internet protocol addresses from the at least two internet protocol addresses and returns the internet protocol addresses; receiving an internet protocol address returned by the node evaluation equipment; wherein the obtained internet protocol address indicates an edge node in the content distribution network.
Alternatively, the computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: receiving a node evaluation request comprising at least two internet protocol addresses; selecting an internet protocol address from the at least two internet protocol addresses; returning the selected internet protocol address; wherein the received internet protocol address indicates an edge node in the content distribution network.
Computer program code for carrying out operations for the present disclosure may be written in any combination of one or more programming languages, including but not limited to 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).
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".
The functions described herein above may be performed, at least in part, by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), systems on a chip (SOCs), Complex Programmable Logic Devices (CPLDs), and the like.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on 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.
The foregoing description is only exemplary of the preferred embodiments of the disclosure and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the disclosure herein is not limited to the particular combination of features described above, but also encompasses other embodiments in which any combination of the features described above or their equivalents does not depart from the spirit of the disclosure. For example, the above features and (but not limited to) the features disclosed in this disclosure having similar functions are replaced with each other to form the technical solution.
Further, while operations are depicted in a particular order, this should not be understood as requiring that such operations be performed in the particular order shown or in sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Likewise, while several specific implementation details are included in the above discussion, these should not be construed as limitations on the scope of the disclosure. Certain features that are described in the context of separate embodiments can also be implemented in combination in a single embodiment. Conversely, various features that are described in the context of a single embodiment can also be implemented in multiple embodiments separately or in any suitable subcombination.
Although the subject matter has been described in language specific to structural features and/or methodological acts, it is to be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are disclosed as example forms of implementing the claims.