CN114757845A - Light ray adjusting method and device based on face recognition, electronic equipment and medium - Google Patents

Light ray adjusting method and device based on face recognition, electronic equipment and medium Download PDF

Info

Publication number
CN114757845A
CN114757845A CN202210429773.6A CN202210429773A CN114757845A CN 114757845 A CN114757845 A CN 114757845A CN 202210429773 A CN202210429773 A CN 202210429773A CN 114757845 A CN114757845 A CN 114757845A
Authority
CN
China
Prior art keywords
color channel
color
value
target
face
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
CN202210429773.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 Wisdom Rongsheng Technology Co ltd
Original Assignee
Beijing Wisdom Rongsheng 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 Wisdom Rongsheng Technology Co ltd filed Critical Beijing Wisdom Rongsheng Technology Co ltd
Priority to CN202210429773.6A priority Critical patent/CN114757845A/en
Publication of CN114757845A publication Critical patent/CN114757845A/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/90Dynamic range modification of images or parts thereof
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/70Denoising; Smoothing
    • 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
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30196Human being; Person
    • G06T2207/30201Face

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 invention discloses a light ray adjusting method and device based on face recognition, electronic equipment and a medium. The method comprises the following steps: acquiring a face image; detecting the face image to obtain a face area and a background area; the background area is formed by surrounding areas except the face area; adjusting the color channel value of the face area according to the color channel value, the color channel mean value, the color channel standard deviation and a predetermined color channel standard value of the face area to determine a target face area; and performing smoothing processing on the background area, and determining a target background area so as to enable the light of the face image to be uniformly distributed. According to the technical scheme, the light of the face image is adjusted based on the mean value and the standard deviation of the color channel, so that the face image is better in parameters such as brightness, hue, saturation and contrast, and the best face recognition effect is achieved.

Description

Light ray adjusting method and device based on face recognition, electronic equipment and medium
Technical Field
The present invention relates to the field of image technologies, and in particular, to a light adjustment method and apparatus based on face recognition, an electronic device, and a storage medium.
Background
With the development of artificial intelligence, in recent years, technologies based on mass data are widely used in various fields. Trains, subway channels, face channels and the like are special applications of face recognition technology. At present, when a terminal device is used for shooting a human face, overexposure or exposure complementation is easily generated in a face area due to the external complex light condition.
At present, the common technical means in the field of face recognition is to automatically adjust the brightness of a face image, so that the image display achieves the effect of the optimal brightness contrast of the face.
The whole brightness of the image is automatically adjusted, and the situation that the face cannot be seen clearly can occur under the condition that the face is bright in background or the face is bright and the background is dark.
Disclosure of Invention
The invention provides a light ray adjusting method, a device, electronic equipment and a medium based on face recognition, which adjust the light ray of a face image by using the mean value and the standard deviation of a color channel, so that the face image has better parameters such as brightness, hue, saturation, contrast and the like, and the best face recognition effect is achieved.
According to an aspect of the present invention, there is provided a light adjusting method based on face recognition, the method including:
Acquiring a face image;
detecting the face image to obtain a face area and a background area; the background area is formed by surrounding areas except the face area;
adjusting the color channel value of the face area according to the color channel value, the color channel mean value, the color channel standard deviation and a predetermined color channel standard value of the face area to determine a target face area;
and performing smoothing processing on the background area, and determining a target background area so as to enable the light of the face image to be uniformly distributed.
According to another aspect of the present invention, there is provided a light adjusting apparatus based on face recognition, the apparatus comprising:
the face image acquisition module is used for acquiring a face image;
the region obtaining module is used for detecting the face image to obtain a face region and a background region; wherein the background area is formed by the surrounding area except the face area;
the target face area determining module is used for adjusting the color channel value of the face area according to the color channel value, the color channel mean value, the color channel standard deviation and a predetermined color channel standard value of the face area to determine a target face area;
And the target background area determining module is used for performing smoothing processing on the background area and determining a target background area so as to enable the light of the face image to be uniformly distributed.
According to another aspect of the present invention, there is provided an electronic apparatus including:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein, the first and the second end of the pipe are connected with each other,
the memory stores a computer program executable by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the method for adjusting light based on face recognition according to any of the embodiments of the present invention.
According to another aspect of the present invention, there is provided a computer-readable storage medium storing computer instructions for causing a processor to implement the method for adjusting light based on face recognition according to any one of the embodiments of the present invention when executed.
According to the technical scheme of the embodiment of the invention, the face image is obtained and detected to obtain the face area and the background area, then the color channel value of the face area is adjusted according to the color channel value, the color channel mean value, the color channel standard deviation and the predetermined color channel standard value of the face area to determine the target face area, and the background area is smoothed to determine the target background area, so that the light of the face image is uniformly distributed. According to the technical scheme, the light of the face image is adjusted based on the mean value and the standard deviation of the color channel, so that the face image is better in parameters such as brightness, hue, saturation and contrast, and the best face recognition effect is achieved.
It should be understood that the statements in this section do not necessarily identify key or critical features of the embodiments of the present invention, nor do they necessarily limit the scope of the invention. Other features of the present invention will become apparent from the following description.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
FIG. 1 is a flowchart of a method for adjusting light based on face recognition according to an embodiment of the present invention;
fig. 2 is a structural diagram of an SSD network model according to an embodiment of the present application;
FIG. 3 is a flowchart of a face recognition-based light adjustment process according to a second embodiment of the present invention;
fig. 4 is a schematic structural diagram of a light adjustment device based on face recognition according to a third embodiment of the present invention;
fig. 5 is a schematic structural diagram of an electronic device implementing the light adjustment method based on face recognition according to the embodiment of the present invention.
Detailed Description
In order to make those skilled in the art better understand the technical solutions of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be obtained by a person skilled in the art without making any creative effort based on the embodiments in the present invention, shall fall within the protection scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are capable of operation in other sequences than those illustrated or described herein. Moreover, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
Example one
Fig. 1 is a flowchart of a light adjustment method based on face recognition according to an embodiment of the present invention, where this embodiment is applicable to a case of adjusting light of a face image, and the method may be implemented by a light adjustment apparatus based on face recognition, where the light adjustment apparatus based on face recognition may be implemented in a form of hardware and/or software, and the light adjustment apparatus based on face recognition may be configured in an intelligent terminal for light adjustment. As shown in fig. 1, the method includes:
and S110, acquiring a face image.
The face image can be shot based on intelligent terminal equipment such as a camera and a camera.
S120, detecting the face image to obtain a face area and a background area; wherein the background region is composed of a peripheral region except the face region.
In this embodiment, the face image includes not only the face region but also a surrounding region other than the face region, and the face image may be detected by using the target detection model to obtain the face region and the background region.
In this technical solution, optionally, the detecting the face image to obtain a face region and a background region includes:
And detecting the face image by using a predetermined target detection model to obtain a face region and a background region.
In this embodiment, the target detection model may be trained in advance to obtain a trained target detection model, and the face image may be detected based on the target detection model to obtain the face region and the background region.
The target detection model is used for detecting the face area, so that the accuracy of face area detection is improved.
In this technical solution, optionally, the detecting the face image by using a predetermined target detection model to obtain a face region includes:
taking the face image as input, training the face image based on a predetermined single-stage target detection model, and outputting a face region and a confidence coefficient; and the confidence coefficient is used for representing the reliability degree of the output face region.
The single-stage target detection model may be an ssd (single Shot multi box detector) network model, and may be used to predict a face region in a face image.
For example, fig. 2 is a structural diagram of an SSD network model provided in an embodiment of the present application, and as shown in fig. 2, the SSD network model uses different convolutional layers to detect different scale targets.
In this embodiment, the output layer of the SSD network model has 5 dimensions, which are the confidence level and the face positions of up, down, left, and right, respectively. Wherein, the upper, lower, left and right human face positions are used for forming a human face area; the confidence coefficient is used for representing the reliability degree of the output face region.
In the scheme, the SSD network model is used for face detection, and the loss function comprises two parts, namely positioning loss and confidence coefficient loss, namely, the upper, lower, left and right positions of the prediction frame are found, and meanwhile, whether the face is recognized in the prediction frame is ensured to be accurate as much as possible. Total loss function
Figure BDA0003609615690000051
Figure BDA0003609615690000052
Where c represents confidence, l represents the prediction box, and g represents the prediction boxReal box, the overall penalty function is a weighted sum of the errors of classification and regression. α represents the weight of both, and N represents the number of matches to the default box. If the kind of the target is only one kind of face, the confidence loss function L can be setconf(x, c) are:
Figure BDA0003609615690000061
Figure BDA0003609615690000062
wherein, ciIndicating the probability that the prediction box has a face,
Figure BDA0003609615690000063
representing the probability of prediction as background (no face), Pos representing the set of prediction boxes with actual faces, Neg representing the set with no faces. The position loss function is provided because it makes sense only for the case and does not affect how the frame position without the face is detected
Figure BDA0003609615690000064
Figure BDA0003609615690000065
Wherein
Figure BDA0003609615690000066
The target detection model is used for detecting the face area, so that the accuracy of face area detection is improved.
S130, adjusting the color channel value of the face area according to the color channel value, the color channel mean value, the color channel standard deviation and a predetermined color channel standard value of the face area, and determining a target face area.
Wherein, the color channel may refer to an RGB color channel.
In the scheme, the image processing algorithm can be used for processing the face area to obtain the color channel value, the color channel mean value and the color channel standard deviation of the face area.
The color channel standard value can be used for representing a standard value of a good result of hue, saturation, brightness and contrast of the face area. A large number of face images can be used for calculation in advance to obtain the standard values of the RGB three-channel color channels in the face area. For example, the three channels may be set to have the average values of { R:138.5, G:107.6, B:95.2 }; the standard deviation of the color channels of the three channels is { R:54.4, G:50.2, B:47.3 }.
In this embodiment, the color channel value, the color channel mean value, the color channel standard deviation, and the predetermined color channel standard value may be combined to obtain a combination result, and the color channel value of the face area is replaced based on the combination result, so as to achieve the purpose of adjusting the light of the face area.
And S140, smoothing the background area, and determining a target background area so as to enable the light of the face image to be uniformly distributed.
In the scheme, after the light of the face area is adjusted, the background area is subjected to smoothing processing by using a predetermined image processing algorithm so as to ensure that the light of the face image is more uniformly distributed.
In this technical solution, optionally, the smoothing processing is performed on the background area to determine a target background area, and the method includes:
and performing smoothing processing on the background area by using a preset image processing algorithm to determine a target background area.
The image processing algorithm may be mean filtering, block filtering, gaussian filtering, median filtering, bilateral filtering, or the like.
By smoothing the background area, the naturalness of the light adjustment of the face image can be improved.
According to the technical scheme of the embodiment of the invention, the face image is obtained and detected to obtain the face area and the background area, then the color channel value of the face area is adjusted according to the color channel value, the color channel mean value, the color channel standard deviation and the predetermined color channel standard value of the face area to determine the target face area, the background area is smoothened to determine the target background area, and the light of the face image is uniformly distributed. By executing the technical scheme, the light of the face image is adjusted based on the mean value and the standard deviation of the color channel, so that the face image is better in brightness, hue, saturation, contrast and other parameters, and the best face recognition effect is achieved.
Example two
Fig. 3 is a flowchart of a light adjustment process based on face recognition according to a second embodiment of the present invention, and the relationship between this embodiment and the foregoing embodiments is further detailed description of adjusting color channel values of a face area. As shown in fig. 3, the method includes:
s310, extracting the channel value of the face area by using a predetermined image processing algorithm to obtain a color channel value.
The color channel values include an R channel value, a G channel value, and a B channel value, i.e., a first color channel value, a second color channel value, and a third color channel value.
And S320, calculating the color channel value to obtain a color channel mean value and a color channel standard deviation.
In this embodiment, the extracted color channel values of the three channels may be calculated to obtain a color channel mean value and a color channel standard deviation of each channel, respectively. The color channel average value comprises a first color actual average value, a second color actual average value and a third color actual average value; the color channel standard deviations include a first color actual standard deviation, a second color actual standard deviation, and a third color actual standard deviation.
S330, calculating the color channel value, the color channel mean value, the color channel standard deviation and a predetermined color channel standard value to obtain a target color channel value, adjusting the color channel value of the face area according to the target color channel value, and determining the target face area.
In this solution, the color channel value, the color channel mean value, the color channel standard deviation, and the predetermined color channel standard value may be subjected to combined calculation to obtain the target color channel value. And adjusting the color channel value of the face image according to the target color channel value to achieve the purpose of adjusting the light of the face region.
In this technical solution, optionally, the calculating the color channel value, the color channel mean value, the color channel standard deviation, and the predetermined color channel standard value to obtain the target color channel value includes:
and combining the color channel value, the color channel mean value, the color channel standard deviation and a predetermined color channel standard value by using a predetermined calculation formula to obtain a target color channel value.
In this embodiment, the color channel value, the color channel mean value, the color channel standard deviation, and the predetermined color channel standard value may be combined according to a calculation formula to calculate the target color channel value.
The light of the face image is adjusted based on the mean value and the standard deviation of the color channels, so that the face image is better in brightness, hue, saturation, contrast and other parameters, and the best face recognition effect is achieved.
In this technical solution, optionally, the color channel values include a first color channel value, a second color channel value, and a third color channel value; the color channel average value comprises a first color actual average value, a second color actual average value and a third color actual average value; the color channel standard deviations comprise a first color actual standard deviation, a second color actual standard deviation and a third color actual standard deviation; the color channel standard values comprise a first color target standard deviation, a second color target standard deviation, a third color target standard deviation, a first color target mean value, a second color target mean value, and a third color target mean value; the target color channel values include a first target color channel value, a second target color channel value, and a third target color channel value;
correspondingly, the combining the color channel value, the color channel mean value, the color channel standard deviation and the predetermined color channel standard value by using a predetermined calculation formula to obtain a target color channel value includes:
calculating the target color channel value by adopting the following formula;
Figure BDA0003609615690000091
wherein, VR-newRepresenting a first target color channel value, VRRepresenting the actual channel value, mean, of the first color RDenotes the actual mean, std, of the first colorRRepresenting the actual standard deviation, R, of the first color1Represents a first color target standard deviation, R2Representing the mean value, V, of the first color targetG-newRepresenting a second target color channel value, VGRepresenting the actual channel value, mean, of the second colorGRepresenting the actual mean value of the second color, stdGRepresenting the actual standard deviation of the second color, G1Representing a second color target standard deviation, G2Representing the mean value, V, of the second color targetB-newRepresenting a third target color channel value, VBRepresenting a third color channel value, meanBRepresenting the actual mean value of the third color, stdBRepresents the actual standard deviation of the third color, B1Represents the target standard deviation of the third color, B2Representing the third color target mean.
By adjusting the light of the face area, the face image can be better in parameters such as brightness, hue, saturation and contrast, and the best face recognition effect is achieved.
According to the technical scheme of the embodiment of the invention, the channel value of the face area is extracted by utilizing a predetermined image processing algorithm to obtain the color channel value, then the color channel value is calculated to obtain the color channel mean value and the color channel standard deviation, the color channel value, the color channel mean value, the color channel standard deviation and the predetermined color channel standard value are calculated to obtain the target color channel value, and the color channel value of the face area is adjusted according to the target color channel value to determine the target face area. By executing the technical scheme, the light of the face image is adjusted based on the mean value and the standard deviation of the color channel, so that the face image is better in parameters such as brightness, hue, saturation and contrast, and the best face recognition effect is achieved.
EXAMPLE III
Fig. 4 is a schematic structural diagram of a light adjustment apparatus based on face recognition according to a third embodiment of the present invention. As shown in fig. 4, the apparatus includes:
a face image acquisition module 410, configured to acquire a face image;
a region obtaining module 420, configured to detect the face image to obtain a face region and a background region; the background area is formed by surrounding areas except the face area;
a target face region determining module 430, configured to adjust a color channel value of the face region according to the color channel value, the color channel mean value, the color channel standard deviation, and a predetermined color channel standard value of the face region, and determine a target face region;
and a target background region determining module 440, configured to perform smoothing on the background region, and determine a target background region, so that light of the face image is uniformly distributed.
In this technical solution, optionally, the target face region determining module 430 includes:
a color channel value obtaining unit, configured to extract a channel value of the face region by using a predetermined image processing algorithm to obtain a color channel value;
The mean value and standard deviation obtaining unit is used for calculating the color channel values to obtain a color channel mean value and a color channel standard deviation;
and the target face area determining unit is used for calculating the color channel value, the color channel mean value, the color channel standard deviation and a predetermined color channel standard value to obtain a target color channel value, adjusting the color channel value of the face area according to the target color channel value and determining a target face area.
In this technical solution, optionally, the target face region determining unit includes:
and the target color channel value obtaining subunit is used for combining the color channel value, the color channel mean value, the color channel standard deviation and a predetermined color channel standard value by using a predetermined calculation formula to obtain a target color channel value.
In this technical solution, optionally, the color channel values include a first color channel value, a second color channel value, and a third color channel value; the color channel mean value comprises a first color actual mean value, a second color actual mean value and a third color actual mean value; the color channel standard deviations comprise a first color actual standard deviation, a second color actual standard deviation and a third color actual standard deviation; the color channel standard values comprise a first color target standard deviation, a second color target standard deviation, a third color target standard deviation, a first color target mean value, a second color target mean value and a third color target mean value; the target color channel values include a first target color channel value, a second target color channel value, and a third target color channel value;
Correspondingly, the target color channel value obtaining subunit is specifically configured to:
calculating the target color channel value by adopting the following formula;
Figure BDA0003609615690000111
wherein, VR-newRepresenting a first target color channel value, VRRepresenting a first color channel value, meanRDenotes the actual mean, std, of the first colorRRepresenting the actual standard deviation, R, of the first color1Represents a first color target standard deviation, R2Representing the mean value, V, of the first color targetG-newRepresenting a second target color channel value, VGRepresenting a second color channel value, meanGRepresenting the actual mean value of the second color, stdGRepresenting the actual standard deviation of the second color, G1Representing a second color target standard deviation, G2Represents the secondColor target mean, VB-newRepresenting a third target color channel value, VBRepresenting a third color channel value, meanBRepresenting the actual mean value of the third color, stdBRepresents the actual standard deviation of the third color, B1Represents the target standard deviation of the third color, B2Representing the third color target mean.
In this embodiment, optionally, the region obtaining module 420 includes:
and the region obtaining unit is used for detecting the face image by using a predetermined target detection model to obtain a face region and a background region.
In this technical solution, optionally, the region obtaining unit is specifically configured to:
Taking the face image as input, training the face image based on a predetermined single-stage target detection model, and outputting a face region and a confidence coefficient; and the confidence coefficient is used for representing the reliability degree of the output face region.
In this technical solution, optionally, the target background area determining module 440 is specifically configured to: and performing smoothing processing on the background area by using a preset image processing algorithm to determine a target background area.
The light ray adjusting device based on the face recognition provided by the embodiment of the invention can execute the light ray adjusting method based on the face recognition provided by any embodiment of the invention, and has corresponding functional modules and beneficial effects of the execution method.
Example four
FIG. 5 illustrates a block diagram of an electronic device 10 that may be used to implement an embodiment of the invention. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smart phones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the inventions described and/or claimed herein.
As shown in fig. 5, the electronic device 10 includes at least one processor 11, and a memory communicatively connected to the at least one processor 11, such as a Read Only Memory (ROM)12, a Random Access Memory (RAM)13, and the like, wherein the memory stores a computer program executable by the at least one processor, and the processor 11 can perform various suitable actions and processes according to the computer program stored in the Read Only Memory (ROM)12 or the computer program loaded from a storage unit 18 into the Random Access Memory (RAM) 13. In the RAM 13, various programs and data necessary for the operation of the electronic apparatus 10 may also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other via a bus 14. An input/output (I/O) interface 15 is also connected to the bus 14.
A number of components in the electronic device 10 are connected to the I/O interface 15, including: an input unit 16 such as a keyboard, a mouse, or the like; an output unit 17 such as various types of displays, speakers, and the like; a storage unit 18 such as a magnetic disk, optical disk, or the like; and a communication unit 19 such as a network card, modem, wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information/data with other devices via a computer network such as the internet and/or various telecommunication networks.
Processor 11 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various dedicated Artificial Intelligence (AI) computing chips, various processors running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, and so forth. The processor 11 performs the various methods and processes described above, such as a light adjustment method based on face recognition.
In some embodiments, the face recognition based ray adjustment method may be implemented as a computer program tangibly embodied on a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and/or installed onto the electronic device 10 via the ROM 12 and/or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the above described face recognition based light adjustment method may be performed. Alternatively, in other embodiments, the processor 11 may be configured to perform the light adjustment method based on face recognition by any other suitable means (e.g., by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuitry, Field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), system on a chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, receiving data and instructions from, and transmitting data and instructions to, a storage system, at least one input device, and at least one output device.
Computer programs for implementing the methods of the present invention can be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the computer programs, when executed by the processor, cause the functions/acts specified in the flowchart and/or block diagram block or blocks to be performed. A computer program can execute entirely on a machine, partly on the machine, as a stand-alone software package, partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of the present invention, a computer-readable storage medium may be a tangible medium that can contain, or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. A computer readable storage 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. Alternatively, the computer readable storage medium may be a machine readable signal medium. 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.
To provide for interaction with a user, the systems and techniques described here can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which a user can provide input to the electronic device. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic, speech, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a back-end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back-end, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), Wide Area Networks (WANs), blockchain networks, and the Internet.
The computing system may include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server can be a cloud server, also called a cloud computing server or a cloud host, and is a host product in a cloud computing service system, so that the defects of high management difficulty and weak service expansibility in the traditional physical host and VPS service are overcome.
It should be understood that various forms of the flows shown above, reordering, adding or deleting steps, may be used. For example, the steps described in the present invention may be executed in parallel, sequentially, or in different orders, and are not limited herein as long as the desired result of the technical solution of the present invention can be achieved.
The above-described embodiments should not be construed as limiting the scope of the invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may be made, depending on design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (10)

1. The light regulation method based on the face recognition is characterized by comprising the following steps:
acquiring a face image;
detecting the face image to obtain a face area and a background area; wherein the background area is formed by the surrounding area except the face area;
adjusting the color channel value of the face area according to the color channel value, the color channel mean value, the color channel standard deviation and a predetermined color channel standard value of the face area to determine a target face area;
And performing smoothing processing on the background area, and determining a target background area so as to enable the light of the face image to be uniformly distributed.
2. The method according to claim 1, wherein adjusting the color channel value of the face region according to the color channel value, the color channel mean value, the color channel standard deviation, and the predetermined color channel standard value of the face region, and determining the target face region comprises:
extracting the channel value of the face region by using a predetermined image processing algorithm to obtain a color channel value;
calculating the color channel value to obtain a color channel mean value and a color channel standard deviation;
and calculating the color channel value, the color channel mean value, the color channel standard deviation and a predetermined color channel standard value to obtain a target color channel value, and adjusting the color channel value of the face area according to the target color channel value to determine a target face area.
3. The method of claim 2, wherein computing the color channel value, the color channel mean, the color channel standard deviation, and the predetermined color channel standard value to obtain a target color channel value comprises:
And combining the color channel value, the color channel mean value, the color channel standard deviation and a predetermined color channel standard value by using a predetermined calculation formula to obtain a target color channel value.
4. The method of claim 3, wherein the color channel values comprise a first color actual channel value, a second color actual channel value, and a third color actual channel value; the color channel average value comprises a first color actual average value, a second color actual average value and a third color actual average value; the color channel standard deviations comprise a first color actual standard deviation, a second color actual standard deviation and a third color actual standard deviation; the color channel standard values comprise a first color target standard deviation, a second color target standard deviation, a third color target standard deviation, a first color target mean value, a second color target mean value, and a third color target mean value; the target color channel values include a first target color channel value, a second target color channel value, and a third target color channel value;
correspondingly, the combining the color channel value, the color channel mean value, the color channel standard deviation and the predetermined color channel standard value by using a predetermined calculation formula to obtain a target color channel value includes:
Calculating the target color channel value by adopting the following formula;
Figure FDA0003609615680000021
wherein, VR-newRepresenting a first target color channel value, VRRepresenting the actual channel value, mean, of the first colorRDenotes the actual mean, std, of the first colorRDenotes the actual standard deviation, R, of the first color1Represents a first color target standard deviation, R2Representing the mean of the first color object, VG-newRepresenting a second target color channel value, VGRepresenting the actual channel value, mean, of the second colorGRepresenting the actual mean value of the second color, stdGRepresenting the actual standard deviation of the second color, G1Representing a second color target standard deviation, G2Representing the mean value, V, of the second color targetB-newRepresenting a third target color channel value, VBRepresenting the actual channel value, mean, of the third colorBRepresenting the actual mean value of the third color, stdBRepresents the actual standard deviation of the third color, B1Represents the target standard deviation of the third color, B2Representing the third color target mean.
5. The method of claim 1, wherein detecting the face image to obtain a face region and a background region comprises:
and detecting the face image by using a predetermined target detection model to obtain a face region and a background region.
6. The method of claim 5, wherein detecting the face image by using a predetermined target detection model to obtain a face region comprises:
Taking the face image as input, training the face image based on a predetermined single-stage target detection model, and outputting a face region and a confidence coefficient; and the confidence coefficient is used for representing the reliability degree of the output face region.
7. The method of claim 1, wherein smoothing the background region to determine a target background region comprises:
and performing smoothing processing on the background area by using a preset image processing algorithm to determine a target background area.
8. Light adjusting device based on face identification, its characterized in that includes:
the face image acquisition module is used for acquiring a face image;
the region obtaining module is used for detecting the face image to obtain a face region and a background region; wherein the background area is formed by the surrounding area except the face area;
the target face area determining module is used for adjusting the color channel value of the face area according to the color channel value, the color channel mean value, the color channel standard deviation and a predetermined color channel standard value of the face area to determine a target face area;
and the target background area determining module is used for performing smoothing processing on the background area and determining a target background area so as to enable the light of the face image to be uniformly distributed.
9. An electronic device, characterized in that the electronic device comprises:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein, the first and the second end of the pipe are connected with each other,
the memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the method of face recognition based ray adjustment of any one of claims 1-7.
10. A computer-readable medium storing computer instructions for causing a processor to perform the method for adjusting light based on face recognition according to any one of claims 1-7.
CN202210429773.6A 2022-04-22 2022-04-22 Light ray adjusting method and device based on face recognition, electronic equipment and medium Pending CN114757845A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210429773.6A CN114757845A (en) 2022-04-22 2022-04-22 Light ray adjusting method and device based on face recognition, electronic equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210429773.6A CN114757845A (en) 2022-04-22 2022-04-22 Light ray adjusting method and device based on face recognition, electronic equipment and medium

Publications (1)

Publication Number Publication Date
CN114757845A true CN114757845A (en) 2022-07-15

Family

ID=82330388

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210429773.6A Pending CN114757845A (en) 2022-04-22 2022-04-22 Light ray adjusting method and device based on face recognition, electronic equipment and medium

Country Status (1)

Country Link
CN (1) CN114757845A (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2019011110A1 (en) * 2017-07-10 2019-01-17 Oppo广东移动通信有限公司 Human face region processing method and apparatus in backlight scene
CN112887582A (en) * 2019-11-29 2021-06-01 深圳市海思半导体有限公司 Image color processing method and device and related equipment
US20210166399A1 (en) * 2019-10-14 2021-06-03 EyeQ Imaging Inc. Background Balancing in a Collection of Digital Images
CN113409220A (en) * 2021-06-28 2021-09-17 展讯通信(天津)有限公司 Face image processing method, device, medium and equipment

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2019011110A1 (en) * 2017-07-10 2019-01-17 Oppo广东移动通信有限公司 Human face region processing method and apparatus in backlight scene
US20210166399A1 (en) * 2019-10-14 2021-06-03 EyeQ Imaging Inc. Background Balancing in a Collection of Digital Images
CN112887582A (en) * 2019-11-29 2021-06-01 深圳市海思半导体有限公司 Image color processing method and device and related equipment
CN113409220A (en) * 2021-06-28 2021-09-17 展讯通信(天津)有限公司 Face image processing method, device, medium and equipment

Similar Documents

Publication Publication Date Title
CN113065614B (en) Training method of classification model and method for classifying target object
CN113971751A (en) Training feature extraction model, and method and device for detecting similar images
CN113379813A (en) Training method and device of depth estimation model, electronic equipment and storage medium
CN113177469A (en) Training method and device for human body attribute detection model, electronic equipment and medium
CN113362314B (en) Medical image recognition method, recognition model training method and device
CN113344862B (en) Defect detection method, device, electronic equipment and storage medium
CN114360074A (en) Training method of detection model, living body detection method, apparatus, device and medium
CN113643260A (en) Method, apparatus, device, medium and product for detecting image quality
CN113705362A (en) Training method and device of image detection model, electronic equipment and storage medium
CN116596854A (en) Equipment defect identification method, device, equipment and medium
CN115471476A (en) Method, device, equipment and medium for detecting component defects
CN113627361B (en) Training method and device for face recognition model and computer program product
CN113869253A (en) Living body detection method, living body training device, electronic apparatus, and medium
CN113569707A (en) Living body detection method, living body detection device, electronic apparatus, and storage medium
CN116758280A (en) Target detection method, device, equipment and storage medium
CN114415997B (en) Display parameter setting method and device, electronic equipment and storage medium
CN115359322A (en) Target detection model training method, device, equipment and storage medium
CN115311624A (en) Slope displacement monitoring method and device, electronic equipment and storage medium
CN112749978B (en) Detection method, apparatus, device, storage medium, and program product
CN114757845A (en) Light ray adjusting method and device based on face recognition, electronic equipment and medium
CN115035481A (en) Image object distance fusion method, device, equipment and storage medium
CN115249281A (en) Image occlusion and model training method, device, equipment and storage medium
CN115205939B (en) Training method and device for human face living body detection model, electronic equipment and storage medium
CN114494818B (en) Image processing method, model training method, related device and electronic equipment
CN114844889B (en) Video processing model updating method and device, electronic equipment and storage medium

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