CN113542616B - Brightness adjusting method and device for face snapshot, computer equipment and storage medium - Google Patents

Brightness adjusting method and device for face snapshot, computer equipment and storage medium Download PDF

Info

Publication number
CN113542616B
CN113542616B CN202110777282.6A CN202110777282A CN113542616B CN 113542616 B CN113542616 B CN 113542616B CN 202110777282 A CN202110777282 A CN 202110777282A CN 113542616 B CN113542616 B CN 113542616B
Authority
CN
China
Prior art keywords
brightness
camera
modification step
face
human body
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.)
Active
Application number
CN202110777282.6A
Other languages
Chinese (zh)
Other versions
CN113542616A (en
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.)
Shenzhen Infinova Intelligent Technology Co Ltd
Original Assignee
Shenzhen Infinova Intelligent 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 Shenzhen Infinova Intelligent Technology Co Ltd filed Critical Shenzhen Infinova Intelligent Technology Co Ltd
Priority to CN202110777282.6A priority Critical patent/CN113542616B/en
Publication of CN113542616A publication Critical patent/CN113542616A/en
Application granted granted Critical
Publication of CN113542616B publication Critical patent/CN113542616B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/70Circuitry for compensating brightness variation in the scene
    • H04N23/73Circuitry for compensating brightness variation in the scene by influencing the exposure time
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules
    • H04N23/61Control of cameras or camera modules based on recognised objects
    • H04N23/611Control of cameras or camera modules based on recognised objects where the recognised objects include parts of the human body
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02BCLIMATE CHANGE MITIGATION TECHNOLOGIES RELATED TO BUILDINGS, e.g. HOUSING, HOUSE APPLIANCES OR RELATED END-USER APPLICATIONS
    • Y02B20/00Energy efficient lighting technologies, e.g. halogen lamps or gas discharge lamps
    • Y02B20/40Control techniques providing energy savings, e.g. smart controller or presence detection

Abstract

The invention discloses a brightness adjusting method and device for face snapshot, computer equipment and a storage medium. The method comprises the steps of obtaining a human body position and a human face position from a camera video, and calculating a weighted brightness average value of the human body position and the human face position; comparing the weighted brightness average value with a preset target brightness value to obtain a brightness value deviation; comparing the brightness value deviation with a preset deviation threshold value to obtain a comparison result, and selecting a modification step length of AE exposure and a modification step length of PWM duty ratio of the camera according to the comparison result; adjusting the AE exposure and the PWM duty ratio of the camera based on the modification step length of the AE exposure and the modification step length of the PWM duty ratio; therefore, the picture brightness in the video is adjusted until the brightness value deviation is lower than the preset deviation threshold value. The invention has the advantage of good face snapshot effect under the condition of low illumination at night by the brightness adjustment method.

Description

Brightness adjusting method and device for face snapshot, computer equipment and storage medium
Technical Field
The invention relates to the field of image data processing, in particular to a brightness adjusting method and device for face snapshot, computer equipment and a storage medium.
Background
With the application of the deep learning method, the recognition rate of the face snapshot recognition technology is improved qualitatively. However, the detection rate of the face is still low at low illumination at night in the existing face snapshot technology, and the effect of the snapshot face picture is poor.
Disclosure of Invention
The invention aims to provide a brightness adjusting method and device for face snapshot, computer equipment and a storage medium, and aims to solve the problem that the existing face snapshot technology has poor face snapshot effect under the condition of night bottom illumination.
In order to solve the technical problems, the invention aims to realize the following technical scheme: a brightness adjustment method for face snapshot includes:
detecting the human body position in the camera shooting video of the camera, and calculating and obtaining the human face position according to the human body position;
calculating the weighted brightness average value of the human body position and the human face position;
comparing the weighted brightness average value with a preset target brightness value of a corresponding scene to obtain a brightness value deviation;
comparing the brightness value deviation with a preset deviation threshold value to obtain a comparison result, and selecting a modification step length of AE exposure and a modification step length of PWM duty ratio of the camera according to the comparison result;
adjusting the AE exposure of the camera according to the modification step length of the AE exposure of the camera to adjust the picture brightness in the camera video; and adjusting the PWM duty ratio according to the modification step length of the PWM duty ratio of the camera and the zoom magnification of the camera so as to adjust the power of an infrared lamp of the camera, thereby adjusting the image brightness in the camera video until the brightness value deviation is lower than a preset deviation threshold value.
In addition, another object of the present invention is to provide a brightness adjusting apparatus for face snapshot, which includes:
the detection unit is used for detecting the human body position in the camera shooting video of the camera, and calculating and obtaining the human face position according to the human body position;
the computing unit is used for computing the weighted brightness average value of the human body position and the human face position;
the first comparison unit is used for comparing the weighted brightness average value with a preset target brightness value of a corresponding scene to obtain a brightness value deviation;
the second comparison unit is used for comparing the brightness value deviation with a preset deviation threshold value to obtain a comparison result, and selecting the modification step length of the AE exposure and the modification step length of the PWM duty ratio of the camera according to the comparison result;
the adjusting unit is used for adjusting the AE exposure of the camera according to the modification step length of the AE exposure of the camera so as to adjust the picture brightness in the camera video; and adjusting the PWM duty ratio according to the modification step length of the PWM duty ratio of the camera and the zoom magnification of the camera so as to adjust the power of an infrared lamp of the camera, thereby adjusting the image brightness in the camera video until the brightness value deviation is lower than a preset deviation threshold value.
In addition, an embodiment of the present invention further provides a computer device, which includes a memory, a processor, and a computer program stored on the memory and executable on the processor, where the processor implements the brightness adjustment method for face capture according to the first aspect when executing the computer program.
In addition, an embodiment of the present invention further provides a computer-readable storage medium, where the computer-readable storage medium stores a computer program, and the computer program, when executed by a processor, causes the processor to execute the brightness adjustment method for face snapshot according to the first aspect.
The embodiment of the invention discloses a brightness adjusting method and device for face snapshot, computer equipment and a storage medium. The method comprises the steps of obtaining a human body position and a human face position from a camera video, and calculating a weighted brightness average value of the human body position and the human face position; comparing the weighted brightness average value with a preset target brightness value to obtain a brightness value deviation; comparing the brightness value deviation with a preset deviation threshold value to obtain a comparison result, and selecting a modification step length of AE exposure and a modification step length of PWM duty ratio of the camera according to the comparison result; adjusting the AE exposure and the PWM duty ratio of the camera based on the modification step length of the AE exposure and the modification step length of the PWM duty ratio; therefore, the picture brightness in the video is adjusted until the brightness value deviation is lower than the preset deviation threshold value. The embodiment of the invention has the advantage of good face snapshot effect under the condition of low illumination at night by using the brightness adjustment method.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are 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 schematic flow chart of a brightness adjustment method for face snapshot according to an embodiment of the present invention;
fig. 2 is a schematic sub-flow diagram of a brightness adjustment method for face snapshot according to an embodiment of the present invention;
fig. 3 is a schematic view of another sub-flow of a brightness adjustment method for face snapshot according to an embodiment of the present invention;
fig. 4 is a schematic view of another sub-flow of a brightness adjustment method for face snapshot according to an embodiment of the present invention;
fig. 5 is a schematic view of another sub-flow of a brightness adjustment method for face snapshot according to an embodiment of the present invention;
fig. 6 is a schematic block diagram of a brightness adjustment apparatus for face snapshot according to an embodiment of the present invention;
FIG. 7 is a schematic block diagram of a computer device provided by an embodiment of the present invention.
Detailed Description
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 some, not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It will be understood that the terms "comprises" and/or "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
It is also to be understood that the terminology used in the description of the invention herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used in the specification of the present invention and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
It should be further understood that the term "and/or" as used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
Referring to fig. 1, fig. 1 is a schematic flow chart of a brightness adjustment method for face snapshot according to an embodiment of the present invention;
as shown in fig. 1, the method includes steps S101 to S105.
S101, detecting the position of a human body in a camera shooting video of the camera, and calculating and obtaining the position of the human face according to the position of the human body.
Specifically, as shown in fig. 2, the step S101 includes:
s201, detecting a camera video by adopting a deep learning human body detection algorithm and framing a human body position to obtain a human body position frame;
s202, selecting a position with a preset proportion on the human body position frame as a human face detection frame;
s203, detecting key points of the human face on the human face detection frame, and if the position information of the key points of the human face is detected, confirming the position of the human face detection frame as the position of the human face, wherein the position information of the key points comprises eyes, a nose and a mouth.
In the embodiment, considering that the human face is difficult to be detected in a full screen mode at night and the human body is easy to detect, a deep learning human body detection algorithm is adopted to detect the camera video and frame out the position of the human body to obtain a human body position frame; then framing one fifth of the position on the human body position frame as a human face detection frame, carrying out human face detection on the human face detection frame by adopting a training deep learning human face detection algorithm aiming at a night human face picture, obtaining the real position of the human face, deducting video data of the real human face position, carrying out human face key point detection through a human face key point detection algorithm and a model, and if the position information of 5 key points of the human face, namely 2 eyes, 1 nose and 2 sides of a mouth, determining the position of the human face detection frame as the position of the human face.
And S102, calculating a weighted brightness average value of the human body position and the human face position.
Specifically, as shown in fig. 3, the step S102 includes:
s301, acquiring brightness values of all human body positions and human face positions;
s302, multiplying the brightness values of all human body positions by human body weight coefficients respectively, and multiplying the brightness values of all human face positions by human face weight coefficients respectively;
s303, multiplying the brightness values of all the human body positions and the human face positions by position weight coefficients respectively, wherein the position weight coefficients are larger as the positions are closer to the center of the picture;
s304, multiplying the brightness values of all the face positions by corresponding area weight coefficients respectively, wherein the larger the face position area is, the larger the area weight coefficient is;
s305, calculating the average value of the brightness values of all the human body positions and the human face positions after weighting, and taking the average value as a weighted brightness average value.
In this embodiment, various weights are configured for the luminance values of the human body position and the face position by using a weighted average algorithm, so as to maximize the weight of the face luminance value that is the largest near the center position in the captured video.
Specifically, a target type weight coefficient can be configured; the target type weight coefficients comprise human body weight coefficients and human face weight coefficients, and the brightness of the human face positions is important, so that the human face weight coefficients are larger than the human body weight coefficients, the brightness values of all the human body positions are multiplied by the human body weight coefficients respectively, and the brightness values of all the human face positions are multiplied by the human face weight coefficients respectively; and obtaining the brightness values of the human body position and the human face position after the target type weighting.
Specifically, a position weight coefficient can be configured, and according to the position of the picture in the video, the closer to the center of the picture, the larger the position weight coefficient is, the brightness values of all human body positions and human face positions are multiplied by the position weight coefficient respectively, so that the brightness values of the human body positions and the human face positions after position weighting can be obtained;
specifically, the area weight may be configured, and according to the area of the face position, the larger the area, the larger the corresponding area weight coefficient is, and the luminance values of all the face positions are multiplied by the corresponding area weight coefficients, respectively, so as to obtain the position-weighted luminance values of the human body position and the face position.
And finally, calculating the average value of the brightness values of all the human body positions and the human face positions after weighting, and taking the average value as a weighted brightness average value.
S103, comparing the weighted brightness average value with a preset target brightness value of a corresponding scene to obtain a brightness value deviation.
In this embodiment, the target brightness value is a brightness value that can better snap a face in a corresponding scene, and the target brightness values in different scenes are different and may be specifically configured according to different scenes, for example: selecting an indoor target brightness value by a camera deployed in an indoor scene; the outdoor target brightness value is selected by a camera deployed in an outdoor scene; a camera deployed in a backlight scene selects a backlight target brightness value; a camera deployed in a highlight scene selects a highlight target brightness value; the target brightness value under various scenes is configured, so that the effect of brightness adjustment is better.
And after selecting the corresponding target brightness value based on the current scene, calculating the difference between the weighted brightness average value and the target brightness value of the current scene to obtain the brightness value deviation.
And S104, comparing the brightness value deviation with a preset deviation threshold value to obtain a comparison result, and selecting the modification step length of the AE exposure and the modification step length of the PWM duty ratio of the camera according to the comparison result.
Specifically, as shown in fig. 4, the step S104 includes:
s401, comparing the brightness value deviation with a preset deviation threshold value, wherein the preset deviation threshold value comprises a plurality of deviation threshold values in different levels, and each deviation threshold value in the levels corresponds to a modification step length of AE exposure of the camera and a modification step length of PWM duty ratio;
s402, if the brightness value deviation is larger than one or more deviation threshold values, selecting a deviation threshold value larger than and the largest deviation threshold value, and selecting the modification step length of the AE exposure and the modification step length of the PWM duty ratio corresponding to the deviation threshold value.
In this embodiment, a plurality of deviation thresholds of different levels are configured, specifically, deviation thresholds of 5 levels are configured, and setting a plurality of levels can implement more diversified adjustment.
For the AE exposure adjustment of the camera, the deviation threshold of each level corresponds to a modification step length of the AE exposure, that is, when the deviation of the brightness value exceeds the deviation threshold of the corresponding level, the modification step length of the AE exposure corresponding to the deviation threshold of the corresponding level is selected, and the modification step length is the modification step length used in the subsequent AE exposure adjustment, where the higher the level is, the larger the corresponding modification step length is, that is, when the deviation of the brightness value is larger, the larger the modification step length of the used AE exposure is.
For the adjustment of the PWM duty of the camera, the deviation threshold of each level corresponds to a modification step size of the PWM duty, that is, when the deviation of the brightness value exceeds the deviation threshold of the corresponding level, the modification step size of the PWM duty corresponding to the deviation threshold of the corresponding level is selected, where the modification step size is used in the subsequent adjustment of the PWM duty, where the higher the level is, the larger the modification step size is, that is, the larger the deviation of the brightness value is, the larger the modification step size of the PWM duty is.
Based on the brightness value deviation and the plurality of deviation thresholds, the modification step length of the AE exposure and the modification step length of the PWM duty ratio of the camera can be obtained through comparison.
In an embodiment, the step S104 further includes:
and when human body positions and human face positions are continuously detected in pictures with preset frame numbers in the video camera, and the brightness value deviation of each frame is greater than a preset deviation threshold, selecting the modification step length of the AE exposure and the modification step length of the PWM duty ratio of the camera according to the comparison result.
The present embodiment proposes a limiting condition for selecting a modification step size of AE exposure and a modification step size of PWM duty ratio of the camera, which can also be said to be a condition for adjusting the AE exposure and the PWM duty ratio of the camera, and the specific condition is as follows: human body positions and human face positions are detected in pictures of a preset number of frames in the continuously detected video, and the brightness value deviation of each frame is larger than a preset deviation threshold value; when the condition is met, the modification step length of the AE exposure and the modification step of the PWM duty ratio are selected, or the AE exposure and the PWM duty ratio can be adjusted; the purpose is to avoid the occurrence of a situation where a change is suddenly made and flicker occurs at the time of adjustment, such as the occurrence of a human body or a human face in several frames at short intervals, in which case the change is suddenly made and flicker occurs at the time of adjustment, and therefore the limitation condition is set.
Meanwhile, the configuration of the modification step of the AE exposure and the modification step of the PWM duty is not too large, which also causes a situation of sudden change in the variation and flicker. And finally, when a plurality of frames are continuously detected without human bodies or human faces, restoring the default AE exposure value and the PWM duty ratio.
S105, adjusting the AE exposure of the camera according to the modification step length of the AE exposure of the camera to adjust the picture brightness in the camera video; and adjusting the PWM duty ratio according to the modification step length of the PWM duty ratio of the camera and the zoom magnification of the camera so as to adjust the power of an infrared lamp of the camera, thereby adjusting the image brightness in the camera video until the brightness value deviation is lower than a preset deviation threshold value.
In this embodiment, in a specific scenario, the adjustment of the AE exposure for the camera:
suppose that: the deviation threshold of 5 grades is 10, 20, 30, 40 and 50; the modification step size of the AE exposure corresponding to each grade is 1, 2, 3, 4 and 5; the weighted luminance average is 30; the target luminance value for the corresponding scene is 60.
It follows that the brightness value deviation is 30, and the corresponding modification step size of the AE exposure is 3; therefore, the current AE exposure value can be increased according to the modification step length 3, so that the current picture brightness is gradually increased, and the weighted brightness average value is calculated in real time until the difference value between the weighted brightness average value and the target brightness value of the corresponding scene is smaller than the deviation threshold value of all levels.
Adjustment of PWM duty cycle for camera: and adjusting the PWM duty ratio according to the modification step length of the PWM duty ratio of the camera and the zoom magnification of the camera so as to adjust the power of an infrared lamp of the camera, thereby adjusting the image brightness in the camera video until the brightness value deviation is lower than a preset deviation threshold value.
The embodiment adjusts the brightness of the picture through the two adjustment modes in a coordinated mode, so that the face snapshot effect is effectively improved under the condition of low illumination at night.
In an embodiment, as shown in fig. 5, the adjusting, according to the modification step of the PWM duty cycle of the camera and the zoom magnification of the camera, the adjusting the PWM duty cycle to adjust the power of the infrared lamp of the camera, so as to adjust the brightness of the picture in the captured video until the brightness value deviation is lower than a preset deviation threshold includes:
s501, when the zoom magnification of the camera is a large multiple, selecting a far infrared lamp of the camera, and adjusting the PWM duty ratio of the camera according to the corresponding modification step length to adjust the power of the far infrared lamp, so that the brightness of a picture in a video is adjusted until the deviation of the brightness value is lower than a preset deviation threshold value; the zoom magnification of the camera is larger when the face position in the camera video is farther, and the power of the infrared lamp is larger when the PWM duty ratio is larger;
s502, when the zoom magnification of the camera is a small multiple, selecting a near-infrared lamp of the camera, and adjusting the PWM duty ratio of the camera according to the corresponding modification step length to adjust the power of the near-infrared lamp, so that the brightness of the picture in the video is adjusted until the deviation of the brightness value is lower than a preset deviation threshold value.
The camera used in this embodiment is an electric zoom camera, the zoom magnification of the camera is determined by the face position in the captured video, if the face position in the captured video is farther away, the zoom magnification of the camera may be magnified by the control software, and if the face position in the captured video is closer, the zoom magnification of the camera may be reduced.
The camera used in the embodiment is provided with 2 groups of infrared lamps, and 1 group of infrared lamps is a far infrared lamp, the angle of the adopted lamp cup is small, and the aim is to supplement light for a remote human face; in addition, 1 group is the near infrared lamp, and the lamp cup angle that adopts is bigger, and the purpose is for the people's face light filling near.
The PWM duty ratio range of the camera in the embodiment is 0-100, if the PWM duty ratio is increased, the power of the infrared lamp is increased, and the brightness of a picture in a video is increased; and if the PWM duty ratio is adjusted to be small, the power of the infrared lamp is reduced, and the brightness of the picture in the video is reduced.
Based on this, for the adjustment of the PWM duty ratio of the camera, the light supplement for the face at a distance is taken as an example:
suppose that: the deviation threshold of 5 grades is 10, 20, 30, 40 and 50; the modification step length of the duty ratio corresponding to each grade is 1, 2, 3, 4 and 5 respectively; the weighted luminance average is 50; the target luminance value for the corresponding scene is 70.
Therefore, the brightness value deviation is 20, the corresponding modification step length of the PWM duty ratio is 2, the current brightness value is smaller than the target brightness value, so that the PWM duty ratio needs to be increased by using the modification step length 2, the power of the far-infrared lamp is increased along with the gradual increase of the PWM duty ratio, the current image brightness is also increased, and the weighted brightness average value of the current image is calculated in real time until the difference value between the weighted brightness average value and the target brightness value of the corresponding scene is smaller than the deviation threshold value of all grades; and finishing the adjustment of the PWM duty ratio to finish the brightness adjustment of the face snapshot.
Similarly, for supplementing light to a near human face, the adjustment can be completed by only replacing the far infrared lamp with the near infrared lamp and adopting the same adjustment method.
Further, it should be noted that when the maximum power of the far-infrared lamp or the near-infrared lamp has been adjusted and the brightness adjustment has not been completed, the far-infrared lamp and the near-infrared lamp may be turned on simultaneously for adjustment.
The embodiment of the invention also provides a brightness adjusting device for face snapshot, which is used for executing any embodiment of the brightness adjusting method for face snapshot. Specifically, referring to fig. 6, fig. 6 is a schematic block diagram of a brightness adjustment apparatus for face snapshot according to an embodiment of the present invention.
As shown in fig. 6, the brightness adjusting apparatus 600 for face snapshot includes: detection section 601, calculation section 602, first comparison section 603, second comparison section 604, and adjustment section 605.
The detection unit 601 is used for detecting the human body position in the camera shooting video of the camera, and calculating and obtaining the human face position according to the human body position;
a calculating unit 602, configured to calculate a weighted brightness average of the human body position and the human face position;
a first comparing unit 603, configured to compare the weighted average luminance value with a preset target luminance value of a corresponding scene, so as to obtain a luminance value deviation;
a second comparing unit 604, configured to compare the brightness deviation with a preset deviation threshold value to obtain a comparison result, and select a modification step size of AE exposure and a modification step size of PWM duty ratio of the camera according to the comparison result;
an adjusting unit 605, configured to adjust the AE exposure of the camera according to the modification step size of the AE exposure of the camera to adjust the picture brightness in the captured video; and adjusting the PWM duty ratio according to the modification step length of the PWM duty ratio of the camera and the zoom magnification of the camera so as to adjust the power of an infrared lamp of the camera, thereby adjusting the image brightness in the video to be shot until the deviation of the brightness value is lower than a preset deviation threshold value
The device adjusts the brightness of the picture by adjusting the AE exposure of the camera and the duty ratio of PWM, so that the face picture with the optimal effect can be captured at low illumination at night.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
The brightness adjustment means for face capture described above may be implemented in the form of a computer program that can be run on a computer device as shown in fig. 7.
Referring to fig. 7, fig. 7 is a schematic block diagram of a computer device according to an embodiment of the present invention. The computer device 700 is a server, which may be an independent server or a server cluster composed of a plurality of servers.
Referring to fig. 7, the computer device 700 includes a processor 702, memory, and a network interface 705 coupled via a system bus 701, where the memory may include a non-volatile storage medium 703 and an internal memory 704.
The non-volatile storage medium 703 may store an operating system 7031 and a computer program 7032. The computer program 7032, when executed, may cause the processor 702 to perform a brightness adjustment method for face capture.
The processor 702 is configured to provide computing and control capabilities to support the operation of the overall computing device 700.
The internal memory 704 provides an environment for running a computer program 7032 in the non-volatile storage medium 703, and the computer program 7032, when executed by the processor 702, causes the processor 702 to execute a brightness adjustment method for face capture.
The network interface 705 is used for network communication, such as providing transmission of data information. Those skilled in the art will appreciate that the configuration shown in fig. 7 is a block diagram of only a portion of the configuration associated with aspects of the present invention and is not intended to limit the computing device 700 to which aspects of the present invention may be applied, and that a particular computing device 700 may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
Those skilled in the art will appreciate that the embodiment of a computer device illustrated in fig. 7 does not constitute a limitation on the specific construction of the computer device, and that in other embodiments a computer device may include more or fewer components than those illustrated, or some components may be combined, or a different arrangement of components. For example, in some embodiments, the computer device may only include a memory and a processor, and in such embodiments, the structures and functions of the memory and the processor are consistent with those of the embodiment shown in fig. 7, and are not described herein again.
It should be appreciated that, in embodiments of the present invention, the Processor 702 may be a Central Processing Unit (CPU), and the Processor 702 may also be other general purpose processors, Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Wherein a general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
In another embodiment of the invention, a computer-readable storage medium is provided. The computer readable storage medium may be a non-volatile computer readable storage medium. The computer-readable storage medium stores a computer program, wherein the computer program, when executed by a processor, implements the brightness adjustment method for face capture according to an embodiment of the present invention.
The storage medium is an entity and non-transitory storage medium, and may be various entity storage media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-only memory (ROM), a magnetic disk, or an optical disk.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described apparatuses, devices and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
While the invention has been described with reference to specific embodiments, the invention is not limited thereto, and various equivalent modifications and substitutions can be easily made by those skilled in the art within the technical scope of the invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (9)

1. A brightness adjustment method for face snapshot is characterized by comprising the following steps:
detecting the human body position in the camera shooting video of the camera, and calculating and obtaining the human face position according to the human body position;
calculating the weighted brightness average value of the human body position and the human face position;
comparing the weighted brightness average value with a preset target brightness value of a corresponding scene to obtain a brightness value deviation;
comparing the brightness value deviation with a preset deviation threshold value to obtain a comparison result, and selecting a modification step length of AE exposure and a modification step length of PWM duty ratio of the camera according to the comparison result;
adjusting the AE exposure of the camera according to the modification step length of the AE exposure of the camera to adjust the picture brightness in the camera video; according to the modification step length of the PWM duty ratio of the camera and the zoom magnification factor of the camera, the size of the PWM duty ratio is adjusted to adjust the power of an infrared lamp of the camera, and therefore the image brightness in the camera video is adjusted until the brightness value deviation is lower than a preset deviation threshold value;
wherein, the calculating the weighted brightness average value of the human body position and the human face position comprises:
acquiring brightness values of all human body positions and human face positions; respectively multiplying the brightness values of all human face positions by human body weight coefficients, and respectively multiplying the brightness values of all human face positions by human face weight coefficients; multiplying the brightness values of all human body positions and human face positions by position weight coefficients respectively, wherein the position weight coefficients are larger the closer the position is to the center of the picture; multiplying the brightness values of all the face positions by corresponding area weight coefficients respectively, wherein the area of the face position is larger, and the area weight coefficient is larger; and calculating the average value of the brightness values of all the weighted human body positions and the human face positions, and taking the average value as a weighted brightness average value.
2. The brightness adjustment method for face snapshot according to claim 1, wherein the detecting a human body position in a camera video of a camera, and calculating and obtaining a face position according to the human body position comprises:
detecting the camera video by adopting a deep learning human body detection algorithm and framing the human body position to obtain a human body position frame;
selecting a position with a preset proportion on the human body position frame as a human face detection frame;
and detecting key points of the human face by the human face detection frame, and if the position information of the key points of the human face is detected, confirming the position of the human face detection frame as the position of the human face, wherein the position information of the key points comprises eyes, a nose and a mouth.
3. The method for adjusting brightness of face snapshot according to claim 1, wherein the preset target brightness value of the corresponding scene comprises:
indoor target brightness values selected by a camera deployed in an indoor scene;
an outdoor target brightness value selected by a camera deployed in an outdoor scene;
a backlight target brightness value selected by a camera deployed in a backlight scene;
and the brightness value of the highlight target is selected by a camera deployed in a highlight scene.
4. The brightness adjustment method for face snapshot according to claim 1, wherein the comparing the brightness value deviation with a preset deviation threshold value to obtain a comparison result, and selecting a modification step size of AE exposure and a modification step size of PWM duty ratio of the camera according to the comparison result comprises:
comparing the brightness value deviation with a preset deviation threshold value, wherein the preset deviation threshold value comprises a plurality of deviation threshold values of different levels, and each deviation threshold value of the levels corresponds to one modification step length of AE exposure of the camera and one modification step length of PWM duty ratio;
and if the brightness value deviation is larger than one or more deviation threshold values, selecting a deviation threshold value larger than and the largest deviation threshold value, and selecting the modification step length of the AE exposure and the modification step length of the PWM duty ratio corresponding to the deviation threshold value.
5. The brightness adjustment method for face snapshot according to claim 1, wherein the comparing the brightness deviation with a preset deviation threshold value to obtain a comparison result, and selecting a modification step size of AE exposure and a modification step size of PWM duty ratio of the camera according to the comparison result, further comprises:
and when human body positions and human face positions are continuously detected in pictures with preset frame numbers in the video camera, and the brightness value deviation of each frame is greater than a preset deviation threshold, selecting the modification step length of the AE exposure and the modification step length of the PWM duty ratio of the camera according to the comparison result.
6. The brightness adjustment method for face snapshot according to claim 1, wherein the adjusting the PWM duty cycle according to the modification step length of the PWM duty cycle of the camera and the zoom magnification of the camera to adjust the power of the infrared lamp of the camera, so as to adjust the brightness of the picture in the captured video until the brightness value deviation is lower than a preset deviation threshold value, comprises:
when the zoom magnification of the camera is a large multiple, selecting a far infrared lamp of the camera, and adjusting the PWM duty ratio of the camera according to the corresponding modification step length to adjust the power of the far infrared lamp, so as to adjust the image brightness in the camera video until the brightness value deviation is lower than a preset deviation threshold value; the zoom magnification of the camera is larger when the face position in the camera video is farther, and the power of the infrared lamp is larger when the PWM duty ratio is larger;
and when the zoom magnification of the camera is a small multiple, selecting a near-infrared lamp of the camera, and adjusting the PWM duty ratio of the camera according to the corresponding modification step length to adjust the power of the near-infrared lamp, so as to adjust the image brightness in the video to be shot until the brightness value deviation is lower than a preset deviation threshold value.
7. A brightness adjusting device for face snapshot is characterized by comprising:
the detection unit is used for detecting the human body position in the camera shooting video of the camera, and calculating and obtaining the human face position according to the human body position;
the computing unit is used for computing the weighted brightness average value of the human body position and the human face position;
the first comparison unit is used for comparing the weighted brightness average value with a preset target brightness value of a corresponding scene to obtain a brightness value deviation;
the second comparison unit is used for comparing the brightness value deviation with a preset deviation threshold value to obtain a comparison result, and selecting the modification step length of the AE exposure and the modification step length of the PWM duty ratio of the camera according to the comparison result;
the adjusting unit is used for adjusting the AE exposure of the camera according to the modification step length of the AE exposure of the camera so as to adjust the picture brightness in the camera video; adjusting the PWM duty ratio according to the modification step length of the PWM duty ratio of the camera and the zoom magnification of the camera to adjust the power of an infrared lamp of the camera, so as to adjust the image brightness in the camera video until the brightness value deviation is lower than a preset deviation threshold value;
wherein the calculation unit includes:
acquiring brightness values of all human body positions and human face positions; respectively multiplying the brightness values of all human face positions by human body weight coefficients, and respectively multiplying the brightness values of all human face positions by human face weight coefficients; multiplying the brightness values of all human body positions and human face positions by position weight coefficients respectively, wherein the position weight coefficients are larger the closer the position is to the center of the picture; multiplying the brightness values of all the face positions by corresponding area weight coefficients respectively, wherein the area of the face position is larger, and the area weight coefficient is larger; and calculating the average value of the brightness values of all the weighted human body positions and the human face positions, and taking the average value as a weighted brightness average value.
8. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor, when executing the computer program, implements the method of brightness adjustment of a face snapshot according to any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that it stores a computer program which, when executed by a processor, causes the processor to carry out the method of luminance adjustment of a face snapshot according to any one of claims 1 to 6.
CN202110777282.6A 2021-07-09 2021-07-09 Brightness adjusting method and device for face snapshot, computer equipment and storage medium Active CN113542616B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110777282.6A CN113542616B (en) 2021-07-09 2021-07-09 Brightness adjusting method and device for face snapshot, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110777282.6A CN113542616B (en) 2021-07-09 2021-07-09 Brightness adjusting method and device for face snapshot, computer equipment and storage medium

Publications (2)

Publication Number Publication Date
CN113542616A CN113542616A (en) 2021-10-22
CN113542616B true CN113542616B (en) 2022-08-09

Family

ID=78127228

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110777282.6A Active CN113542616B (en) 2021-07-09 2021-07-09 Brightness adjusting method and device for face snapshot, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113542616B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106446873A (en) * 2016-11-03 2017-02-22 北京旷视科技有限公司 Face detection method and device
CN108537165A (en) * 2018-04-08 2018-09-14 百度在线网络技术(北京)有限公司 Method and apparatus for determining information
CN112819722A (en) * 2021-02-03 2021-05-18 东莞埃科思科技有限公司 Infrared image face exposure method, device, equipment and storage medium

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4867365B2 (en) * 2006-01-30 2012-02-01 ソニー株式会社 Imaging control apparatus, imaging apparatus, and imaging control method
CN100435562C (en) * 2006-12-28 2008-11-19 上海交通大学 Automatic explosion method based on multi-area partition and fuzzy logic

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106446873A (en) * 2016-11-03 2017-02-22 北京旷视科技有限公司 Face detection method and device
CN108537165A (en) * 2018-04-08 2018-09-14 百度在线网络技术(北京)有限公司 Method and apparatus for determining information
CN112819722A (en) * 2021-02-03 2021-05-18 东莞埃科思科技有限公司 Infrared image face exposure method, device, equipment and storage medium

Also Published As

Publication number Publication date
CN113542616A (en) 2021-10-22

Similar Documents

Publication Publication Date Title
CN111028189B (en) Image processing method, device, storage medium and electronic equipment
CN108174118B (en) Image processing method and device and electronic equipment
US9407831B2 (en) Intelligent auto-exposure bracketing
CN106165391B (en) Enhanced image capture
CN106464803B (en) Enhanced image capture
CN111028190A (en) Image processing method, image processing device, storage medium and electronic equipment
EP3103254B1 (en) Using inertial sensors to provide smoothed exposure and white balance adjustments for video and photographic applications
CN110769158B (en) Enhanced image capture
CN108702452B (en) Image shooting method and device
US8494267B2 (en) Image processing device, image processing method, and program for normalizing a histogram
EP3487162B1 (en) Method, device and camera for blending a first and a second image having overlapping fields of view
US20070253693A1 (en) Exposure compensation method for digital image
CN108335272B (en) Method and device for shooting picture
CN106791451B (en) Photographing method of intelligent terminal
CN105096267A (en) Method and device for adjusting brightness of eye portion based on shooting identification
CN111880640B (en) Screen control method and device, electronic equipment and storage medium
CN109286758A (en) A kind of generation method of high dynamic range images, mobile terminal and storage medium
CN111447372B (en) Control method, device, equipment and medium for brightness parameter adjustment
CN110570370B (en) Image information processing method and device, storage medium and electronic equipment
CN110175967B (en) Image defogging processing method, system, computer device and storage medium
US10235745B2 (en) Image processing method, computer storage medium, apparatus and terminal
CN104994280A (en) Method for processing preview image and user terminal
CN113542616B (en) Brightness adjusting method and device for face snapshot, computer equipment and storage medium
US20130286245A1 (en) System and method for minimizing flicker
JPWO2019021412A1 (en) Position estimating device, position estimating method, and program recording 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
GR01 Patent grant
GR01 Patent grant