CN111263074A - Method, system and equipment for automatically adjusting brightness of camera and storage medium thereof - Google Patents

Method, system and equipment for automatically adjusting brightness of camera and storage medium thereof Download PDF

Info

Publication number
CN111263074A
CN111263074A CN202010175732.XA CN202010175732A CN111263074A CN 111263074 A CN111263074 A CN 111263074A CN 202010175732 A CN202010175732 A CN 202010175732A CN 111263074 A CN111263074 A CN 111263074A
Authority
CN
China
Prior art keywords
skin color
camera
brightness value
image
brightness
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
CN202010175732.XA
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.)
Shenzhen Emperor Technology Co Ltd
Original Assignee
Shenzhen Emperor 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 Emperor Technology Co Ltd filed Critical Shenzhen Emperor Technology Co Ltd
Priority to CN202010175732.XA priority Critical patent/CN111263074A/en
Publication of CN111263074A publication Critical patent/CN111263074A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • 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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/40Extraction of image or video features
    • G06V10/56Extraction of image or video features relating to colour
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/10Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
    • G06V40/16Human faces, e.g. facial parts, sketches or expressions
    • G06V40/161Detection; Localisation; Normalisation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/10Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
    • G06V40/16Human faces, e.g. facial parts, sketches or expressions
    • G06V40/168Feature extraction; Face representation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/70Circuitry for compensating brightness variation in the scene
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/80Camera processing pipelines; Components thereof

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • General Physics & Mathematics (AREA)
  • Health & Medical Sciences (AREA)
  • Oral & Maxillofacial Surgery (AREA)
  • Physics & Mathematics (AREA)
  • Signal Processing (AREA)
  • Theoretical Computer Science (AREA)
  • General Health & Medical Sciences (AREA)
  • Human Computer Interaction (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Studio Devices (AREA)
  • Image Processing (AREA)

Abstract

The invention relates to the technical field of image processing, in particular to a method, a system, equipment and a storage medium for automatically adjusting the brightness of a camera, wherein the method comprises the following steps: driving a camera to obtain a face image, and determining a plurality of face characteristic points on the face image; connecting adjacent human face characteristic points in a clockwise or anticlockwise direction to obtain a closed-loop face contour figure, and then determining a human face region in the obtained image by using the closed-loop face contour figure to obtain a skin color image; converting the skin color image from an RGB model to an LAB model, and calculating components in the region image under the LAB model to obtain a skin color real-time brightness value; and comparing the real-time skin color brightness value with a preset expected skin color brightness value, and if the real-time skin color brightness value is not within a preset range, adjusting the current brightness value of the camera. The invention can adjust the brightness parameter of the camera in real time, so that the exposure of the generated certificate photo is proper, and the certificate photo yield of the self-service photographing equipment is effectively improved.

Description

Method, system and equipment for automatically adjusting brightness of camera and storage medium thereof
Technical Field
The invention relates to the technical field of image processing, in particular to a method for automatically adjusting the brightness of a camera, a system for automatically adjusting the brightness of the camera, equipment of the system and a storage medium storing the method.
Background
With the rapid development of society, the types of certificates used by the majority of citizens are more and more, and part of the certificates are required to be attached with certificates, so the shooting requirement of the certificates is gradually improved; in order to facilitate the citizen to shoot the certificate photo, some self-service photographing devices appear on the market nowadays, and the application of the self-service photographing devices brings very convenient experience to people needing to shoot the certificate photo. But the relative state departments have certain requirements on the brightness and the exposure of the certificate photo.
In the existing self-service photographing equipment, because the exposure and the brightness parameter of the camera do not have a standard value, the final brightness and exposure of the certificate photo have a certain relation with the skin color of the user and other face states, when the camera works, the brightness parameter is adjusted to be suitable and does not have a theoretical basis, so that the imaging brightness of generated photos of some users is unsatisfactory, and the shot certificate photo is either over-exposed on the face of a person or under-exposed on the face of the person. The certificate photo shot by the camera cannot meet the requirement of the certificate photo, and the popularization of the self-service photographing equipment is influenced to a certain extent.
Disclosure of Invention
In order to overcome the above drawbacks, the present invention provides a method, a system, a device, and a storage medium storing the method for adjusting the working brightness of a camera of a self-service photographing device.
The purpose of the invention is realized by the following technical scheme:
the invention relates to a method for automatically adjusting the brightness of a camera, which comprises the following steps:
driving a camera to obtain a face image, and determining a plurality of face characteristic points at a preset position of the face image;
connecting adjacent human face characteristic points along a clockwise direction or a counterclockwise direction to obtain a closed-loop facial contour graph, then determining a human face region in the obtained image by using the closed-loop facial contour graph, and extracting the human face region to obtain a skin color image;
converting the skin color image from an RGB model to an LAB model, and calculating brightness components in the domain image under the LAB model to obtain a skin color real-time brightness value;
and comparing the real-time skin color brightness value with a preset expected skin color brightness value, judging whether the difference value between the real-time skin color brightness value and the preset expected skin color brightness value is within a preset range, and if not, adjusting the current brightness value of the camera.
In the present invention, the driving camera includes:
and carrying out primary driving on the camera according to a preset camera brightness value.
In the present invention, before adjusting the current brightness value of the camera, the method includes:
and calculating the current camera brightness value according to the skin color real-time brightness value.
In the present invention, the adjusting the current brightness value of the camera further includes:
and adjusting the current camera brightness value through proportional-integral-derivative control adjustment.
In the present invention, after adjusting the current brightness value of the camera, the method includes:
and driving the camera according to the adjusted brightness value of the camera.
In the present invention, the determining whether the difference between the real-time skin color brightness value and the preset desired skin color brightness value is within a predetermined range further includes:
and if the face image is within the preset range, generating a certificate photo according to the current face image.
In the present invention, after extracting the face region, the extracting includes:
and converting the face region from an RGB model to a YCrCb model, comparing the preset skin model with all pixel points in the face region after model conversion, judging whether the pixel points meet the conditions of the preset skin model, and if so, acquiring the pixel points of all conditions to obtain a skin color image.
The invention relates to an automatic regulating system of camera brightness, which comprises:
the camera driving module is used for driving the camera and acquiring a face image through the camera;
the characteristic point positioning module is connected with the camera and used for determining a plurality of personal face characteristic points at preset positions of the face image acquired by the camera;
the skin color image acquisition module is connected with the characteristic point positioning module, connects adjacent human face characteristic points along a clockwise direction or an anticlockwise direction to obtain a closed-loop face contour figure, then determines a human face area in the obtained image by using the closed-loop face contour figure, and extracts the human face area to obtain a skin color image;
the skin color brightness calculation module is connected with the skin color image acquisition module and used for converting the skin color image from an RGB (red, green and blue) model to an LAB (laboratory) model and calculating the brightness component in the region image under the LAB model to obtain a real-time skin color brightness value;
the skin color brightness comparison module is connected with the skin color brightness calculation module and is used for comparing the skin color real-time brightness value with a preset skin color expected brightness value and judging whether the difference value between the skin color real-time brightness value and the preset skin color expected brightness value is within a preset range or not;
and the brightness value adjusting module is respectively connected with the skin color brightness comparing module and the camera driving module and is used for adjusting the current camera brightness value when the difference value between the real-time skin color brightness value and the preset desired skin color brightness value is not within a preset range.
The invention relates to a self-service photographing device, which comprises: the automatic adjusting system, the camera and the certificate photo generator are adopted;
the camera is respectively connected with the camera driving module and the characteristic point positioning module and is used for acquiring a face image according to the driving parameters sent by the camera driving module;
the identification photo generator is respectively connected with the skin color brightness comparison module and the camera and is used for generating an identification photo from the current face image when the difference value between the real-time brightness value of the middle skin color and the preset expected brightness value of the skin color is within a preset range.
The present invention is a computer readable program storage medium storing computer program instructions which, when executed by a computer, cause the computer to perform the method as described above.
The invention can acquire the brightness parameter of the image in real time, compare the preset brightness parameter with the brightness parameter of the image, and adjust the brightness parameter of the camera according to the comparison result, so that the exposure of the generated certificate photo is proper, the certificate photo yield of the self-service photo taking equipment can be effectively improved, and the further popularization of the self-service photo taking equipment in the market is facilitated.
Drawings
For the purpose of easy explanation, the present invention will be described in detail with reference to the following preferred embodiments and the accompanying drawings.
FIG. 1 is a schematic view of a working flow of an embodiment of a method for automatically adjusting the brightness of a camera according to the present invention;
FIG. 2 is a schematic view of a workflow of another embodiment of a method for automatically adjusting the brightness of a camera according to the present invention;
FIG. 3 is a schematic view of a workflow of another embodiment of a method for automatically adjusting the brightness of a camera according to the present invention;
fig. 4 is a schematic diagram of a logic structure of the self-service photographing device of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
In the description of the present invention, it is to be understood that the terms "center", "longitudinal", "lateral", "length", "width", "thickness", "upper", "lower", "front", "rear", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer", "clockwise", "counterclockwise", and the like, indicate orientations and positional relationships based on those shown in the drawings, and are used only for convenience of description and simplicity of description, and do not indicate or imply that the device or element being referred to must have a particular orientation, be constructed and operated in a particular orientation, and thus, should not be considered as limiting the present invention. Furthermore, the terms "first", "second" and "first" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, features defined as "first", "second", may explicitly or implicitly include one or more of the described features. In the description of the present invention, "a plurality" means two or more unless specifically defined otherwise.
In the description of the present invention, it should be noted that the terms "mounted," "connected," and "connected" are to be construed broadly and may be, for example, fixedly connected, detachably connected, or integrally connected unless otherwise explicitly stated or limited. Either mechanically or electrically. Either directly or indirectly through intervening media, either internally or in any other relationship. The specific meanings of the above terms in the present invention can be understood by those skilled in the art according to specific situations.
The following describes a method for automatically adjusting the brightness of a camera according to an embodiment of the present invention, with reference to fig. 1, which includes:
s101, obtaining a face image to determine face characteristic points
The method comprises the steps of driving a camera to obtain a face image, primarily positioning a face region according to the existing face detection technology, and then obtaining a plurality of face characteristic points related to a face contour at a preset position in the primarily positioned face region, wherein in the embodiment, the number of the face characteristic points is 16, and at this time, a coordinate queue of points 1 to 16 is generated.
S102, obtaining a skin color image
Connecting adjacent human face characteristic points along a clockwise direction or a counterclockwise direction to obtain a closed-loop facial contour graph, then determining a human face region in the obtained image by using the closed-loop facial contour graph, and extracting the human face region to obtain a skin color image; the method comprises the following steps: connecting two adjacent points by using a straight line determined by a straight line two-point method from the points 1 to 16 in sequence to form an irregular closed loop outline for describing the approximate region of the face; and (3) randomly selecting a point outside the outline, setting the area outside the filled outline to be zero by using a flooding filling method, reserving the image inside the selected outline, and setting the area outside the area to be zero to obtain a skin color image.
S103, calculating to obtain a real-time skin color brightness value
The skin color image is converted from an RGB model to an LAB model, where the LAB color model consists of three elements, one element being luminance (L), and a and b being two color channels. a comprises colors from dark green to gray to bright pink; b is from bright blue to gray to yellow; calculating the L component in the region image under the LAB model to obtain a skin color real-time brightness value; the method comprises the following steps: converting the divided skin color image from RGB to LAB color space, counting pixels with non-0 point on L component, adding the above pixels, averaging, and obtaining skin color brightness value Lt: finding an image I of an L component in the LAB color spaceLThe formula is as follows;
Y=0.212671·R+0.715160·G+0.072169·B
L*=116·f(Y/Yn)-16
Figure BDA0002410757910000061
s104, judging whether the brightness difference value is within a preset range
Comparing the skin color real-time brightness value with a preset skin color expected brightness value, and judging whether the difference value between the skin color real-time brightness value and the preset skin color expected brightness value is within a preset range;
s105, adjusting the current brightness value of the camera
If the brightness value is not within the preset range, adjusting the current brightness value of the camera; if the real-time skin color brightness value is not within the preset range and is lower than the preset expected skin color brightness value, indicating that the exposure of the current face image is insufficient and the brightness value of the camera needs to be increased; if the real-time skin color brightness value is not within the preset range and is higher than the preset expected skin color brightness value, indicating that the current face image is overexposed and the brightness value of the camera needs to be reduced; and S101. driving the camera to obtain the face image by the adjusted brightness value of the camera.
The method well utilizes the scene characteristics of the skin color of the person in the shooting scene, takes the skin color of the person as reference, reduces the complexity of brightness adjustment in the shooting scene, and is suitable for the service requirement of the self-service shooting equipment.
In another embodiment, a method for automatically adjusting the brightness of a camera according to the present invention is described in detail below with reference to fig. 2, which includes:
s201, obtaining a face image to determine face characteristic points
The method comprises the steps of driving a camera to obtain a face image, primarily positioning a face region according to the existing face detection technology, and then obtaining a plurality of face characteristic points related to a face contour at a preset position in the primarily positioned face region, wherein in the embodiment, the number of the face characteristic points is 16, and at this time, a coordinate queue of points 1 to 16 is generated.
S202, extracting a face area
Connecting adjacent human face characteristic points along a clockwise direction or a counterclockwise direction to obtain a closed-loop facial contour graph, then determining a human face area in the obtained image by using the closed-loop facial contour graph, and extracting the human face area; the method comprises the following steps: connecting two adjacent points by using a straight line determined by a straight line two-point method from the points 1 to 16 in sequence to form an irregular closed loop outline for describing the approximate region of the face; randomly selecting a point outside the outline, filling the area outside the outline by using a flood filling method and setting the area to be zero, reserving the image inside the selected outline, and setting the area outside the outline to be zero to obtain a face area image Ic
S203, obtaining a skin color image
The face region image IcConverting the RGB model into a YCrCb model, wherein YCrCb is YUV, and Y represents brightness, namely gray value; the "U" and "V" represent the chromaticity, which is used to describe the color and saturation of the image for specifying the color of the pixel. "luminance" is established through the RGB input signals by superimposing specific parts of the RGB signals together. "chroma" defines two aspects of color-hue and saturation, represented by Cr and Cb, respectively. Where Cr reflects the difference between the red part of the RGB input signal and the luminance value of the RGB signal. And Cb reflects the difference between the blue part of the RGB input signal and the luminance value of the RGB signal; comparing all pixel points in the face region after the preset skin model is converted with the model, judging whether the pixel points meet the conditions of the preset skin model, and if so, acquiring the pixel points of all conditions to obtain a skin color image; in the present embodiment, a face region image I is extractedcConversion from RGB to YCrCb image IYDetecting the image I by using a preset elliptical skin color empirical modelYAnd each point (Cr, Cb) is judged whether the point is in the ellipse, if so, the point belongs to the skin, otherwise, the point is a non-skin pixel point. Traversing face region image IcIf the corresponding pixel point value belongs to the skin, the original value is kept unchangedIf the calculation result does not belong to the skin, the image IcThe point is set as 0, and the skin color image I is obtained after the traversal is finishedm. Wherein, the numerical value of a non-skin three channel in the image is strictly calibrated to be 0; the face area image IcConversion from RGB to YCrCb image IYThe formula of (1) is as follows:
Figure BDA0002410757910000081
s204, calculating to obtain a real-time skin color brightness value
The skin color image is converted from an RGB model to an LAB model, where the LAB color model consists of three elements, one element being luminance (L), and a and b being two color channels. a comprises colors from dark green to gray to bright pink; b is from bright blue to gray to yellow; calculating the L component in the region image under the LAB model to obtain a skin color real-time brightness value; the method comprises the following steps: converting the divided skin color image from RGB to LAB color space, counting pixels with non-0 point on L component, adding the above pixels, averaging, and obtaining skin color brightness value Lt: finding an image I of an L component in the LAB color spaceLThe formula is as follows;
Y=0.212671·R+0.715160·G+0.072169·B
L*=116·f(Y/Yn)-16
Figure BDA0002410757910000082
s205, judging whether the brightness difference value is within a preset range
Comparing the skin color real-time brightness value with a preset skin color expected brightness value, and judging whether the difference value between the skin color real-time brightness value and the preset skin color expected brightness value is within a preset range; if the difference is not within the predetermined range, step S206 is performed to calculate the current brightness value of the camera; if the difference value is within the predetermined range, step S208 is performed to generate a certificate photo according to the current face image.
S206, calculating the current brightness value of the camera
And calculating the current camera brightness value according to the skin color real-time brightness value. In the embodiment, the human face brightness exposure is adjusted by using position type PID control (proportional-integral-derivative control), so as to obtain the brightness setting parameter suitable for the current photo-taker. The PID control is to form a control deviation according to a given value and an actual output value, and the deviation is combined in proportion, integral and differential to form a control quantity through linearity to control a controlled object. The method specifically comprises the following steps: setting proportion parameter of PID control as KpAn integral parameter of KiDifferential parameter is KdThe initial brightness parameter of the camera is CoThe real-time brightness parameter of the camera is CtThe expected human face brightness expected value is LstdReal-time face luminance value of Lt(ii) a Empirically obtained CtAnd LtA linear proportional relationship exists between the two, and the value of the linear proportional relationship is k; calculating the real-time brightness parameter of the camera according to a formula, wherein the calculation formula of the real-time brightness parameter of the camera is as follows:
ΔLt=Lt(t)-Lstd
ΔCt=ΔLt·k
Figure BDA0002410757910000091
s207, adjusting the brightness value of the current camera
Adjusting the current brightness value of the camera through position type PID control adjustment; if the real-time skin color brightness value is not within the preset range and is lower than the preset expected skin color brightness value, indicating that the exposure of the current face image is insufficient and the brightness value of the camera needs to be increased; in order to quickly complete the brightness adjustment of skin color, a threshold value is introduced, namely the expected value of the brightness of the human face is allowed to be LstdThe range of the threshold value can be floated up and down, the adjusted face skin color value is not required to be completely equal to the expected value, and the adjusted initial brightness parameter C of the camera is usedoDriving the camera for the first time, and repeating the step S201 to obtain the adjusted brightness parameter C of the cameratDrive the cameraAnd (6) moving. And then comparing the difference value between the current brightness and the expected brightness, circularly adjusting until the adjusting times meet a set value or the brightness difference value is smaller than a set threshold, and quitting the circular adjustment, wherein the brightness parameter at the moment is regarded as the proper brightness parameter of the current photographer.
S208, generating a certificate photo according to the current face image
If the face image is within the preset range, generating a certificate photo according to the current face image; therefore, the generated identification photo meets the exposure and brightness standards.
In another embodiment, a method for automatically adjusting the brightness of a camera according to the present invention is described in detail below with reference to fig. 3, which includes:
s301, driving the camera by using a preset camera brightness value
Carrying out primary driving on the camera according to a preset camera brightness value; according to empirical analysis, the brightness parameter adjusting range of the camera is within a range (C)min,Cmax) If the brightness parameter is 1-7, the average value in the range can be used as the initial adjustment point, i.e. the camera is driven for the first time by the camera brightness parameter 4.
S302, obtaining a face image to determine face characteristic points
The method comprises the steps of driving a camera to obtain a face image, primarily positioning a face region according to the existing face detection technology, and then obtaining a plurality of face characteristic points related to a face contour at a preset position in the primarily positioned face region, wherein in the embodiment, the number of the face characteristic points is 16, and at this time, a coordinate queue of points 1 to 16 is generated.
S303, extracting a face region
Connecting adjacent human face characteristic points clockwise or anticlockwise to obtain a closed-loop facial contour graph, determining a human face area in the obtained image by using the closed-loop graph, and extracting the human face area; the method comprises the following steps: connecting two adjacent points by using a straight line determined by a straight line two-point method from the points 1 to 16 in sequence to form an irregular closed loop outline for describing the approximate region of the face; a point is arbitrarily chosen outside the contour,filling the area outside the outline by using a flooding filling method, setting the area outside the outline as zero, reserving the image inside the selected outline, and setting the area outside the outline as zero to obtain a face area image Ic
S304, obtaining a skin color image
The face region image IcConverting the RGB model into a YCrCb model, wherein YCrCb is YUV, and Y represents brightness, namely gray value; the "U" and "V" represent the chromaticity, which is used to describe the color and saturation of the image for specifying the color of the pixel. "luminance" is established through the RGB input signals by superimposing specific parts of the RGB signals together. "chroma" defines two aspects of color-hue and saturation, represented by Cr and Cb, respectively. Where Cr reflects the difference between the red part of the RGB input signal and the luminance value of the RGB signal. And Cb reflects the difference between the blue part of the RGB input signal and the luminance value of the RGB signal; comparing all pixel points in the face region after the preset skin model is converted with the model, judging whether the pixel points meet the conditions of the preset skin model, and if so, acquiring the pixel points of all conditions to obtain a skin color image; in the present embodiment, a face region image I is extractedcConversion from RGB to YCrCb image IYDetecting the image I by using a preset elliptical skin color empirical modelYAnd each point (Cr, Cb) is judged whether the point is in the ellipse, if so, the point belongs to the skin, otherwise, the point is a non-skin pixel point. Traversing face region image IcIf the corresponding pixel point value belongs to the skin, the original value is kept unchanged, and if the calculation result does not belong to the skin, the image IcThe point is set as 0, and the skin color image I is obtained after the traversal is finishedm. Wherein, the numerical value of a non-skin three channel in the image is strictly calibrated to be 0; the face area image IcConversion from RGB to YCrCb image IYThe formula of (1) is as follows:
Figure BDA0002410757910000111
s305, calculating to obtain real-time skin color brightness values
The skin color image is converted from an RGB model to an LAB model, where the LAB color model consists of three elements, one element being luminance (L), and a and b being two color channels. a comprises colors from dark green to gray to bright pink; b is from bright blue to gray to yellow; calculating the L component in the region image under the LAB model to obtain a skin color real-time brightness value; the method comprises the following steps: converting the divided skin color image from RGB to LAB color space, counting pixels with non-0 point on L component, adding the above pixels, averaging, and obtaining skin color brightness value Lt: finding an image I of an L component in the LAB color spaceLThe formula is as follows;
Y=0.212671·R+0.715160·G+0.072169·B
L*=116·f(Y/Yn)-16
Figure BDA0002410757910000112
s306, judging whether the brightness difference value is within a preset range
Comparing the skin color real-time brightness value with a preset skin color expected brightness value, and judging whether the difference value between the skin color real-time brightness value and the preset skin color expected brightness value is within a preset range; if the difference is not within the predetermined range, performing step S307 to calculate the current brightness value of the camera; if the difference value is within the predetermined range, step S308 is performed to generate a certificate photo according to the current face image.
S307, adjusting the current brightness value of the camera
Adjusting the current brightness value of the camera through position type PID control adjustment; if the real-time skin color brightness value is not within the preset range and is lower than the preset expected skin color brightness value, indicating that the exposure of the current face image is insufficient and the brightness value of the camera needs to be increased; in order to quickly complete the brightness adjustment of skin color, a threshold value is introduced, namely the expected value of the brightness of the human face is allowed to be LstdThe range of the threshold value can be floated up and down, the adjusted face skin color value is not required to be completely equal to the expected value,and the adjusted initial brightness parameter C of the cameraoDriving the camera for the first time, and repeating the step S301 to adjust the brightness parameter C of the cameratThe camera is driven. And then comparing the difference value between the current brightness and the expected brightness, circularly adjusting until the adjusting times meet a set value or the brightness difference value is smaller than a set threshold, and quitting the circular adjustment, wherein the brightness parameter at the moment is regarded as the proper brightness parameter of the current photographer.
S308, generating a certificate photo according to the current face image
If the face image is within the preset range, generating a certificate photo according to the current face image; therefore, the generated identification photo meets the exposure and brightness standards.
Referring to fig. 4, the present invention is a self-help photographing apparatus, including:
the automatic adjusting system 100 for the brightness of the camera, the camera 200 and the certificate photo generator 300;
the system 100 for automatically adjusting the brightness of the camera includes:
the camera driving module 101 is used for driving the camera and acquiring a face image through the camera, and the camera driving module 101 is used for driving the camera;
the characteristic point positioning module 102 is connected with the camera, and is used for determining a plurality of human face characteristic points at preset positions of the human face image acquired by the camera; the method specifically comprises the steps of carrying out primary positioning on a face area according to the existing face detection technology, and then obtaining 16 face characteristic points related to a face contour at a preset position in the primarily positioned face area;
the skin color image acquisition module 103 is connected with the characteristic point positioning module 102, connects adjacent human face characteristic points clockwise or counterclockwise to obtain a closed-loop facial contour graph, determines a human face region in an image by using the closed-loop facial contour graph, and extracts the human face region to obtain a skin color image; the method comprises the following steps: converting the divided skin color image into an LAB color space from RGB, counting pixels which are not 0 point on an L component, adding the pixels, and averaging to obtain a skin color brightness value;
a skin color brightness calculation module 104, wherein the skin color brightness calculation module 104 is connected to the skin color image acquisition module 103, and is configured to convert the skin color image from an RGB model to an LAB model, where the LAB model is composed of three elements, one element is brightness (L), and a and b are two color channels. a comprises colors from dark green to gray to bright pink; b is from bright blue to gray to yellow; calculating a component in the region image under the LAB model to obtain a skin color real-time brightness value;
a skin color brightness comparison module 105, where the skin color brightness comparison module 105 is connected to the skin color brightness calculation module 104, and is configured to compare the skin color real-time brightness value with a preset skin color expected brightness value, and determine whether a difference between the skin color real-time brightness value and the preset skin color expected brightness value is within a predetermined range;
the brightness value adjusting module 106 is connected to the skin color brightness comparing module 105 and the camera driving module 101, respectively, and is configured to adjust a current camera brightness value when a difference between a real-time skin color brightness value and a preset desired skin color brightness value is not within a predetermined range; the method comprises the following steps: if the real-time skin color brightness value is not within the preset range and is lower than the preset expected skin color brightness value, indicating that the exposure of the current face image is insufficient and the brightness value of the camera needs to be increased; if the real-time skin color brightness value is not within the preset range and is higher than the preset expected skin color brightness value, indicating that the current face image is overexposed and the brightness value of the camera needs to be reduced;
the camera 200 is respectively connected to the camera driving module 101 and the feature point positioning module 102, and is configured to obtain a face image according to the driving parameters sent by the camera driving module 101;
the identification photo generator 300 is respectively connected with the skin color brightness comparison module 105 and the camera 200, and is used for generating an identification photo from the current face image when the difference value between the real-time skin color brightness value and the preset expected skin color brightness value is within a preset range.
The present invention includes a computer readable storage medium having stored thereon a program product capable of implementing the above-described method of the present specification. In some possible embodiments, aspects of the invention may also be implemented in the form of a program product comprising program code means for causing a terminal device to carry out the steps according to various exemplary embodiments of the invention described in the above section "exemplary methods" of the present description, when said program product is run on the terminal device.
The program product may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the readable storage medium include: an electrical connection having one or more wires, a portable disk, 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.
A computer readable signal medium may include a propagated data signal with readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A readable signal medium may also be any readable medium that is not a readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on the above readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
In the description of the present specification, reference to the description of the terms "one embodiment", "some embodiments", "an illustrative embodiment", "an example", "a specific example", or "some examples", etc., means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the present invention. In this specification, schematic representations of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents and improvements made within the spirit and principle of the present invention are intended to be included within the scope of the present invention.

Claims (10)

1. A method for automatically adjusting the brightness of a camera is characterized by comprising the following steps:
driving a camera to obtain a face image, and determining a plurality of face characteristic points at a preset position of the face image;
connecting adjacent human face characteristic points along a clockwise direction or a counterclockwise direction to obtain a closed-loop facial contour graph, then determining a human face region in the obtained image by using the closed-loop facial contour graph, and extracting the human face region to obtain a skin color image;
converting the skin color image from an RGB model to an LAB model, and calculating brightness components in the domain image under the LAB model to obtain a skin color real-time brightness value;
and comparing the real-time skin color brightness value with a preset expected skin color brightness value, judging whether the difference value between the real-time skin color brightness value and the preset expected skin color brightness value is within a preset range, and if not, adjusting the current brightness value of the camera.
2. The method of claim 1, wherein the driving the camera comprises:
and carrying out primary driving on the camera according to a preset camera brightness value.
3. The method according to claim 1, wherein the adjusting the current camera brightness value comprises:
and calculating the current camera brightness value according to the skin color real-time brightness value.
4. The method according to claim 2 or 3, wherein the adjusting the current camera brightness value further comprises:
and adjusting the current camera brightness value through proportional-integral-derivative control adjustment.
5. The method according to claim 4, wherein the adjusting the current camera brightness value comprises:
and driving the camera according to the adjusted brightness value of the camera.
6. The method of claim 5, wherein the determining whether the difference between the real-time skin color brightness value and the preset desired skin color brightness value is within a predetermined range further comprises:
and if the face image is within the preset range, generating a certificate photo according to the current face image.
7. The method for automatically adjusting the brightness of a camera according to claim 6, wherein after the extracting the face region, the method comprises:
and converting the face region from an RGB model to a YCrCb model, comparing the preset skin model with all pixel points in the face region after model conversion, judging whether the pixel points meet the conditions of the preset skin model, and if so, acquiring the pixel points of all conditions to obtain a skin color image.
8. An automatic camera brightness adjustment system, comprising:
the camera driving module is used for driving the camera and acquiring a face image through the camera;
the characteristic point positioning module is connected with the camera and used for determining a plurality of personal face characteristic points at preset positions of the face image acquired by the camera;
the skin color image acquisition module is connected with the characteristic point positioning module, connects adjacent human face characteristic points along a clockwise direction or an anticlockwise direction to obtain a closed-loop face contour figure, then determines a human face area in the obtained image by using the closed-loop face contour figure, and extracts the human face area to obtain a skin color image;
the skin color brightness calculation module is connected with the skin color image acquisition module and used for converting the skin color image from an RGB (red, green and blue) model to an LAB (laboratory) model and calculating the brightness component in the region image under the LAB model to obtain a real-time skin color brightness value;
the skin color brightness comparison module is connected with the skin color brightness calculation module and is used for comparing the skin color real-time brightness value with a preset skin color expected brightness value and judging whether the difference value between the skin color real-time brightness value and the preset skin color expected brightness value is within a preset range or not;
and the brightness value adjusting module is respectively connected with the skin color brightness comparing module and the camera driving module and is used for adjusting the current camera brightness value when the difference value between the real-time skin color brightness value and the preset desired skin color brightness value is not within a preset range.
9. A self-service photographing device, comprising: the automatic adjustment system of claim 8, and a camera and a certificate photo generator;
the camera is respectively connected with the camera driving module and the characteristic point positioning module and is used for acquiring a face image according to the driving parameters sent by the camera driving module;
the identification photo generator is respectively connected with the skin color brightness comparison module and the camera and is used for generating an identification photo from the current face image when the difference value between the real-time brightness value of the middle skin color and the preset expected brightness value of the skin color is within a preset range.
10. A computer-readable program storage medium storing computer program instructions which, when executed by a computer, cause the computer to perform the method according to any one of claims 1 to 7.
CN202010175732.XA 2020-03-13 2020-03-13 Method, system and equipment for automatically adjusting brightness of camera and storage medium thereof Pending CN111263074A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010175732.XA CN111263074A (en) 2020-03-13 2020-03-13 Method, system and equipment for automatically adjusting brightness of camera and storage medium thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010175732.XA CN111263074A (en) 2020-03-13 2020-03-13 Method, system and equipment for automatically adjusting brightness of camera and storage medium thereof

Publications (1)

Publication Number Publication Date
CN111263074A true CN111263074A (en) 2020-06-09

Family

ID=70951409

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010175732.XA Pending CN111263074A (en) 2020-03-13 2020-03-13 Method, system and equipment for automatically adjusting brightness of camera and storage medium thereof

Country Status (1)

Country Link
CN (1) CN111263074A (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111654643A (en) * 2020-07-22 2020-09-11 苏州臻迪智能科技有限公司 Exposure parameter determination method and device, unmanned aerial vehicle and computer readable storage medium
CN112235483A (en) * 2020-08-24 2021-01-15 深圳市雄帝科技股份有限公司 Automatic photographing light adjusting method and system and self-service photographing equipment thereof
CN112819722A (en) * 2021-02-03 2021-05-18 东莞埃科思科技有限公司 Infrared image face exposure method, device, equipment and storage medium
CN113411507A (en) * 2021-05-10 2021-09-17 深圳数联天下智能科技有限公司 Skin measurement image acquisition method, device, equipment and storage medium
CN117152819A (en) * 2023-09-04 2023-12-01 广州市鹏驰信息科技有限公司 Face recognition method and device

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090196475A1 (en) * 2008-02-01 2009-08-06 Canfield Scientific, Incorporated Automatic mask design and registration and feature detection for computer-aided skin analysis
CN103985098A (en) * 2014-05-27 2014-08-13 广州商景网络科技有限公司 Method and system for removing highlight of certificate image
CN104735362A (en) * 2015-03-11 2015-06-24 广东欧珀移动通信有限公司 Picture taking method and device
CN107911625A (en) * 2017-11-30 2018-04-13 广东欧珀移动通信有限公司 Light measuring method, device, readable storage medium storing program for executing and computer equipment
CN109714543A (en) * 2019-01-10 2019-05-03 成都品果科技有限公司 A method of it obtaining skin brightness in camera data stream and adjusts exposure
CN110610176A (en) * 2019-08-08 2019-12-24 宁波中国科学院信息技术应用研究院 Exposure self-adaptive adjusting method based on face brightness

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090196475A1 (en) * 2008-02-01 2009-08-06 Canfield Scientific, Incorporated Automatic mask design and registration and feature detection for computer-aided skin analysis
CN103985098A (en) * 2014-05-27 2014-08-13 广州商景网络科技有限公司 Method and system for removing highlight of certificate image
CN104735362A (en) * 2015-03-11 2015-06-24 广东欧珀移动通信有限公司 Picture taking method and device
CN107911625A (en) * 2017-11-30 2018-04-13 广东欧珀移动通信有限公司 Light measuring method, device, readable storage medium storing program for executing and computer equipment
CN109714543A (en) * 2019-01-10 2019-05-03 成都品果科技有限公司 A method of it obtaining skin brightness in camera data stream and adjusts exposure
CN110610176A (en) * 2019-08-08 2019-12-24 宁波中国科学院信息技术应用研究院 Exposure self-adaptive adjusting method based on face brightness

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
何英英: "基于视觉显著特征的人脸图像分割与跟踪方法的研究", 《内蒙古民族大学学报(自然科学版)》 *

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111654643A (en) * 2020-07-22 2020-09-11 苏州臻迪智能科技有限公司 Exposure parameter determination method and device, unmanned aerial vehicle and computer readable storage medium
CN111654643B (en) * 2020-07-22 2021-08-31 苏州臻迪智能科技有限公司 Exposure parameter determination method and device, unmanned aerial vehicle and computer readable storage medium
CN112235483A (en) * 2020-08-24 2021-01-15 深圳市雄帝科技股份有限公司 Automatic photographing light adjusting method and system and self-service photographing equipment thereof
CN112235483B (en) * 2020-08-24 2023-04-07 深圳市雄帝科技股份有限公司 Automatic photographing light adjusting method and system and self-service photographing equipment thereof
CN112819722A (en) * 2021-02-03 2021-05-18 东莞埃科思科技有限公司 Infrared image face exposure method, device, equipment and storage medium
CN113411507A (en) * 2021-05-10 2021-09-17 深圳数联天下智能科技有限公司 Skin measurement image acquisition method, device, equipment and storage medium
CN117152819A (en) * 2023-09-04 2023-12-01 广州市鹏驰信息科技有限公司 Face recognition method and device
CN117152819B (en) * 2023-09-04 2024-04-19 广州市鹏驰信息科技有限公司 Face recognition method and device

Similar Documents

Publication Publication Date Title
CN111263074A (en) Method, system and equipment for automatically adjusting brightness of camera and storage medium thereof
CN103826066B (en) Automatic exposure adjusting method and system
US7428021B2 (en) Image processing method, recording medium and apparatus for performing color adjustment to image data using a brightness component, a low-frequency brightness component, and first and second parameters
US20220103740A1 (en) Systems and methods for automatic exposure control
CN102946513B (en) A kind of method, device and terminal starting filming apparatus high dynamic range function
CN103716547A (en) Smart mode photographing method
EP1814082A2 (en) Face importance level determining apparatus and method, and image pickup apparatus
US20060203298A1 (en) Image processing apparatus, image processing method, image processing program recording medium, color adjustment method, color adjustment device, and color adjustment control program recording medium
JP6006543B2 (en) Image processing apparatus and image processing method
US20050243347A1 (en) Conversion of color image to monochrome image
JP6685188B2 (en) Imaging device, image processing device, control method thereof, and program
CN110930341A (en) Low-illumination image enhancement method based on image fusion
CN106570838A (en) Image brightness optimization method and device
CN109862389A (en) A kind of method for processing video frequency, device, server and storage medium
US8810681B2 (en) Image processing apparatus and image processing method
CN111739110A (en) Method and device for detecting image over-darkness or over-exposure
US11223744B2 (en) Local color range selection
CN111429536B (en) Method, system and storage medium for toning skin color in image
JP2004040462A (en) Image pickup equipment
CN104966280A (en) Photo processing method and apparatus thereof
US20210352253A1 (en) Image processing method and apparatus, terminal and storage medium
KR101349968B1 (en) Image processing apparatus and method for automatically adjustment of image
EP4009631A1 (en) White balance abnormality determination method and apparatus, storage medium, and electronic device
JP2017073605A (en) Image processing device, image processing method, and program
CN112200747A (en) Image processing method and device and computer readable 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
RJ01 Rejection of invention patent application after publication

Application publication date: 20200609

RJ01 Rejection of invention patent application after publication