WO2019232834A1 - Face brightness adjustment method and apparatus, computer device and storage medium - Google Patents

Face brightness adjustment method and apparatus, computer device and storage medium Download PDF

Info

Publication number
WO2019232834A1
WO2019232834A1 PCT/CN2018/092652 CN2018092652W WO2019232834A1 WO 2019232834 A1 WO2019232834 A1 WO 2019232834A1 CN 2018092652 W CN2018092652 W CN 2018092652W WO 2019232834 A1 WO2019232834 A1 WO 2019232834A1
Authority
WO
WIPO (PCT)
Prior art keywords
brightness
detection area
target detection
brightness value
curve
Prior art date
Application number
PCT/CN2018/092652
Other languages
French (fr)
Chinese (zh)
Inventor
戴磊
Original Assignee
平安科技(深圳)有限公司
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 平安科技(深圳)有限公司 filed Critical 平安科技(深圳)有限公司
Publication of WO2019232834A1 publication Critical patent/WO2019232834A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/90Dynamic range modification of images or parts thereof
    • G06T5/92Dynamic range modification of images or parts thereof based on global image properties
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/90Determination of colour characteristics
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30196Human being; Person
    • G06T2207/30201Face

Definitions

  • the present application relates to the field of image processing technology, and in particular, to a method, a device, a computer device, and a storage medium for adjusting human face brightness.
  • Image brightness adjustment is a part of image processing, which refers to adjusting the brightness of pixel values in an image.
  • the brightness of an image is essentially the brightness of each pixel in the image.
  • the brightness of each pixel can be expressed by the size of the RGB value, where R represents the red channel component, G represents the green channel component, and B represents the blue channel component.
  • R represents the red channel component
  • G represents the green channel component
  • B represents the blue channel component.
  • the simple addition and subtraction adjustment of pixels on the RGB channel after calculating the arithmetic mean of the pixels are mostly performed.
  • the adjusted image brightness has severe distortion, especially for extremely bright or dark pixels.
  • the brightness distortion is serious, and the layered sense of the image cannot be guaranteed.
  • Embodiments of the present application provide a method, a device, a computer device, and a storage medium for adjusting the brightness of a face, so as to solve the problem of serious distortion in the current brightness adjustment process of a face image.
  • a method for adjusting face brightness including:
  • a brightness adjustment curve is constructed based on the average natural brightness value, and the brightness adjustment curve is used to perform brightness adjustment on the face image to obtain a target image.
  • a face brightness adjusting device includes:
  • a target detection area acquisition module configured to obtain a face image, and obtain a target detection area based on the face image
  • a pixel brightness obtaining module configured to obtain a brightness value of each pixel in the target detection area
  • An area average brightness acquisition module configured to process the brightness value by using an image natural brightness algorithm to obtain an average natural brightness value of the target detection area
  • a brightness adjustment module configured to construct a brightness adjustment curve based on the average natural brightness value if the average natural brightness value is not within a preset natural brightness range, and use the brightness adjustment curve to perform brightness adjustment on the face image To get the target image.
  • a computer device includes a memory, a processor, and computer-readable instructions stored in the memory and executable on the processor.
  • the processor executes the computer-readable instructions, the following steps are implemented:
  • a brightness adjustment curve is constructed based on the average natural brightness value, and the brightness adjustment curve is used to perform brightness adjustment on the face image to obtain a target image.
  • One or more non-volatile readable storage media storing computer-readable instructions, which when executed by one or more processors, cause the one or more processors to perform the following steps:
  • a brightness adjustment curve is constructed based on the average natural brightness value, and the brightness adjustment curve is used to perform brightness adjustment on the face image to obtain a target image.
  • FIG. 1 is an application environment diagram of a face brightness adjustment method according to an embodiment of the present application
  • FIG. 2 is a flowchart of a method for adjusting face brightness in an embodiment of the present application
  • FIG. 3 is a flowchart of step S10 in FIG. 2;
  • step S13 in FIG. 3 is a flowchart of step S13 in FIG. 3;
  • FIG. 5 is a flowchart of step S40 in FIG. 2;
  • FIG. 6 is a schematic diagram of a face brightness adjusting device according to an embodiment of the present application.
  • FIG. 7 is a schematic diagram of a computer device in an embodiment of the present application.
  • the face brightness adjustment method provided in the embodiment of the present application may be applied in the application environment shown in FIG. 1, that is, the face brightness adjustment method is applied in the brightness adjustment system shown in FIG. 1.
  • the brightness adjustment system includes a server and a server. Clients connected to the server via the network.
  • the client can communicate with the server through any of wireless networks such as WiFi, 3G, 4G, and 5G or wired networks.
  • Client (Client), or client refers to the program that provides local services to clients corresponding to the server.
  • the client can be installed on, but not limited to, various personal computers, laptops, smartphones, tablets, and portable wearable devices.
  • the server can be implemented by an independent server or a server cluster composed of multiple servers.
  • the face brightness adjustment method is applied to the server in FIG. 1 as an example for description.
  • the face brightness adjustment method includes the following steps:
  • S10 Acquire a face image, and obtain a target detection area based on the face image.
  • a face image refers to an image containing a person's face. It is an unprocessed image. Specifically, it can be an image that the client sends to the server in real time for image processing, or it can be sent to the server in advance by the client and stored by the server. Called image.
  • the image can be an image stored locally by the client or an image captured by the client through a camera.
  • the target detection area refers to the detection area in the face image. The detection area may be an area where only the face is retained after removing the image background and other interference factors.
  • the server may use a face detection algorithm to identify a face image, and use the detected face area as a target detection area.
  • the target detection area refers to the area that remains after removing the background and other factors that do not belong to the face of the person in the face image.
  • an edge detection algorithm may be used to process a face image, obtain a human face contour, and determine a target detection area containing the human face contour.
  • a pixel is the smallest unit in an image.
  • the brightness value of a pixel represents the brightness of the image corresponding to that pixel.
  • the computer uses the position, color, and brightness of each pixel to display the brightness of the entire image.
  • the brightness value of a pixel is composed of three pixel units, R, G, and B.
  • the brightness value represents the brightness of the image color.
  • the brightness of an image can be represented by the brightness values of all the pixel values that make up the image.
  • the brightness value of each pixel is between 0 and 255, where 0 is completely black and 255 is completely white.
  • the server calculates the brightness value of the target detection area to obtain the brightness value of each pixel.
  • the server can use the grayscale conversion formula to perform grayscale calculation to obtain the converted brightness value.
  • the grayscale conversion formula used can achieve fast and high-precision calculations, so that the brightness value of each pixel in the target detection area can be quickly obtained for subsequent subsequent grayscale image-based processing. Brightness adjustment helps to increase the rate of brightness adjustment.
  • S30 Use the image natural brightness algorithm to process the brightness value to obtain the average natural brightness value of the target detection area.
  • the image natural brightness algorithm refers to an algorithm that calculates the average brightness of an image based on the brightness value of each pixel in the image.
  • the average natural brightness value is an average value indicating how bright the image is.
  • the image natural brightness algorithm is used to calculate the average natural brightness value.
  • the formula of the image natural brightness algorithm is as follows : Among them, N is the number of pixels in the target detection area, Lum ave is the average natural brightness value of the target detection area, Lum (x, y) is the brightness value corresponding to the pixel points (x, y) of the target detection area, and ⁇ is a constant .
  • is a small constant used to prevent the calculation result of the logarithm from going to negative infinity. For example, ⁇ can be 0.0001.
  • the average natural brightness value obtained by the image natural brightness algorithm is more in line with the human eye's judgment of the brightness than the average brightness of the average value directly calculated, which can effectively reduce the distortion of subsequent brightness adjustments and help improve the level of brightness of the face image after adjustment sense.
  • the preset natural brightness range refers to a range of brightness values set in advance to determine whether the average natural brightness value of the image meets the processing requirements.
  • the brightness value range of the image is between [0, 255].
  • the preset natural brightness range can be based on Demand adjustment. For example, to perform face training on a face image, a suitable natural brightness range (90-190) is set in advance during model training, and 90-190 is a preset natural brightness range.
  • the brightness adjustment curve refers to a brightness curve obtained by curve fitting an image using a smooth curve, and the brightness curve can be used to adjust the brightness of the image.
  • Brightness adjustment refers to the adjustment of the brightness value of each pixel in the face image according to the brightness adjustment curve.
  • the target image refers to a face image whose brightness value is adjusted at each pixel according to the brightness adjustment curve.
  • constructing the brightness adjustment curve based on the average natural brightness value can be implemented by a smooth curve fitting method, and performing curve fitting with three coordinate points to obtain a smooth curve, that is, a brightness adjustment curve.
  • curve fitting may be performed using a uniform B-spline, a quasi-uniform B-spline, a segmented Bezier, or a non-uniform B-spline curve.
  • the target brightness value of each pixel in the face image is obtained, and the brightness value of each pixel in the face image is adjusted, that is, the brightness value of each pixel is adjusted to the corresponding target brightness Value, get the target image after completion.
  • the server may use a non-linear adjustment method to construct a brightness adjustment curve based on the average natural brightness value, which specifically includes: setting the abscissa and ordinate in the plane coordinate system to each specific brightness value in the range of 0-255.
  • the abscissa and ordinate divide 0-255 into multiple brightness intervals, and use the abscissa as the brightness value of each pixel in the face image before adjustment, and the ordinate as the brightness value of the corresponding pixel in the face image after adjustment.
  • the fitting process is performed based on the average natural brightness value.
  • the curve type may select a non-uniform B-spline curve, and the coordinate points of the fitting process may be preset, based on the non-uniform B-spline curve and the coordinates of the fitting process Point to obtain the brightness adjustment curve, and fit the face image based on the brightness adjustment curve, which is helpful for the subsequent use of the brightness adjustment curve to quickly adjust the brightness of the face image, and the entire adjustment process is simple.
  • the server obtains a face image, obtains a target detection area based on the face image, and provides a basis for subsequently adjusting the brightness of the entire face image based on the brightness value of the target detection area.
  • the brightness adjustment speed is increased.
  • the server obtains the brightness value of each pixel in the target detection area and uses the image natural brightness algorithm to calculate the average natural brightness value of the target detection area. The calculation process is simple and fast, which helps to improve the brightness adjustment speed.
  • the server can construct a brightness adjustment curve based on the average natural brightness value when the average natural brightness value is not within the preset natural brightness range, and use the brightness adjustment curve to adjust the brightness of the face image to obtain the target. image.
  • the preset natural brightness range is used as the basis for judging whether to adjust the brightness, and the brightness adjustment curve is constructed based on the average natural brightness value, so that when the brightness adjustment curve is used to obtain the target image, the brightness adjustment is more balanced, and the brightness during the image adjustment is reduced. Distortion, to improve the layered sense of the brightness of the adjusted image.
  • acquiring the target detection area based on the face image in step S10 specifically includes the following steps:
  • a facial feature point detection algorithm is used to detect facial feature point data of a face image.
  • the facial feature point data includes coordinate data and local feature values.
  • Face feature point detection algorithm refers to an algorithm that automatically locates key feature points of the face (such as eyes, nose tip, mouth corners, eyebrows, and contour points of various parts of the face) based on the input face image.
  • the facial feature point data refers to data of all feature points on a person's face.
  • the feature points in this embodiment mainly include eyes, nose tips, mouth corners, eyebrows, and the like.
  • the facial feature point data includes coordinate data and local feature values.
  • the coordinate data refers to data indicating the position information of the facial feature points, and the local feature value is data indicating the feature information of the facial feature points.
  • an Adaboost (iterative algorithm) facial feature point detection algorithm based on Harr features can be used, and a Harr feature-based V-Jdetector (detector) that comes with OpenCV (Computer Vision Library) is used to Detect facial feature points of a face image, and obtain facial feature point data.
  • the detection process is as follows: first load the Harr feature detection classifier, load the face image to be detected, call internal functions for identification and labeling, and generate a detection window when a person is detected. Then, each facial feature point in the detection window is detected according to a cascade classifier (i.e., an Adaboost-based classifier) to obtain facial feature point data.
  • the facial feature point data includes coordinate data and local feature values.
  • the center position of the detection window of the facial feature point is used as the coordinate data of the facial feature point, and the Harr feature value extracted according to the detection window is used as a part of the facial feature point.
  • Eigenvalues Eigenvalues.
  • the facial features area refers to the area containing human facial features (eyebrows, eyes, nose, mouth, and ears), that is, to determine which facial feature points belong to the facial features based on the coordinate data and local feature values of the facial feature points.
  • the facial feature point data can be obtained based on the Harr feature-based V-Jdetector that comes with OpenCV, and according to the coordinate data and local feature value data of any facial feature point, which one of the facial feature points is identified Officer characteristics.
  • the process of extracting the facial features area is as follows: load Harr feature facial features detection classifier, load the face image to be detected, call internal functions for identification and labeling, and when the corresponding facial features are detected, generate a detection window to determine the facial features points, Thereby, the facial features region in the face image is determined.
  • Nasal tip refers to the facial features that are located in the center of the human face and are composed of the inner feet of both sides of the wing cartilage and the soft tissues at the tip of the nose.
  • the outer corners of the eyes are the tails of the eyes of a person near the temples.
  • the facial features area extracted from facial feature point data obtained by the Harr feature-based V-Jdetector that comes with OpenCV can be used to obtain the target detection area based on the coordinate data of the nose tip and the corners of the eyes outside the eyes.
  • the specific process is as follows: first extract the coordinate data of the tip of the nose and the outer corners of the eyes, and use these three coordinate data to determine the target detection area. There can be multiple methods for determining the first. According to the coordinate data of the three points, each Points are connected with each other to build a triangle area, and this triangle area is used as the target detection area.
  • the second type is to select the coordinate data of any point to make a horizontal straight line based on the coordinate data of the three points, and then make the other two points
  • This horizontal straight line is a vertical line that connects the other two points to build a rectangular area, and this rectangular area is used as the target detection area.
  • the Adaboost (iterative algorithm) facial feature point detection algorithm based on Harr features is used, and the Harr feature-based V-Jdetector (detector) that comes with OpenCV (Computer Vision Library) is used.
  • Detect facial feature point data of a face image extract facial features from facial feature point data, and determine target detection areas based on the coordinates of the nose clip and the corners of the eyes outside the eyes in the facial features area, which can quickly perform facial feature detection to determine target detection Area in order to use the brightness value of the target detection area to perform brightness adjustment, which helps to improve the speed of face brightness adjustment.
  • step S13 obtaining the target detection area according to the coordinate data of the nose tip and the outer corners of the eyes in the facial features region, specifically includes the following steps:
  • the horizontal straight line refers to a line parallel to the horizontal plane.
  • a rectangular coordinate system can be constructed in the face image, with the X-axis direction of the rectangular coordinate system as the horizontal direction and the y-axis direction as the vertical direction.
  • the nose coordinate data is used to obtain the x and y coordinates of the nose tip, and a horizontal straight line is made using the y coordinate of the nose tip.
  • S132 Construct a rectangular area based on the coordinate data of the outer corners of the eyes and the horizontal straight line, and determine the rectangular area as the target detection area.
  • a rectangular region refers to a rectangular region.
  • a horizontal straight line parallel to the X-axis direction is made with the y coordinate of the nose tip, and then according to the coordinates of the corners of the eyes outside the eyes.
  • two points of the outer corners of the two eyes are respectively made vertical lines perpendicular to the horizontal straight line, and the two points of the outer corners of the two eyes are connected to construct a rectangular area, and the rectangular area is used as the target detection area.
  • steps S131 and S132 the rectangular area constructed by the tip of the nose and the outer corners of both eyes is used as the target detection area, which reduces the area and calculation amount of the detection area, and helps to improve the rate of face brightness adjustment.
  • the brightness adjustment curve is constructed based on the average natural brightness value in step S40, and the brightness adjustment curve is used to adjust the brightness of the face image to obtain the target image, which specifically includes the following steps:
  • the optimal brightness value refers to a brightness value that is most suitable as a reference basis for brightness adjustment.
  • a preset natural brightness range is 90-190, and an intermediate value 140 can be taken as an optimal brightness value.
  • the brightness adjustment value drtb refers to an adjustment value for determining an intermediate point of curve fitting, and is a value obtained by subtracting an average natural brightness value from an optimal brightness value.
  • the preset natural brightness range is 90-190.
  • drtb is a positive value.
  • Smooth curve fitting refers to selecting an appropriate curve type to fit the brightness value of a pixel, and using a fitting function formula to determine the relationship between the brightness value of the pixel before adjustment and the brightness value of the pixel after adjustment.
  • the brightness adjustment curve refers to a curve used to adjust the brightness of an image obtained by smooth curve fitting.
  • the brightness adjustment curve can reflect the relationship between the brightness value of the pixel point before adjustment and the brightness value of the pixel value after adjustment.
  • the server may use a uniform B-spline, a quasi-uniform B-spline, a segmented Bezier, or a non-uniform B-spline curve to perform smooth curve fitting.
  • a plane coordinate system is established in a face image.
  • the abscissa and ordinate values are 0-255
  • the preset natural brightness range is 90-190
  • the average natural brightness value is 80.
  • the brightness value is not within the preset natural brightness range, so brightness adjustment is required.
  • the calculated brightness adjustment value drtb is 60, that is, the three coordinate points determined are (0, 0), (127, 187), and (255, 255), select a curve type, such as fitting the three coordinate points (0, 0), (127, 187), and (255, 255) after a uniform B-spline curve to obtain a smooth curve.
  • the smooth curve is the brightness adjustment curve.
  • S43 Adjust the brightness value of each pixel in the face image according to the brightness adjustment curve to obtain a target image.
  • Adjusting the brightness value of each pixel point in the face image according to the brightness adjustment curve specifically includes: finding the adjusted target brightness value corresponding to each pixel point in the face image on the brightness adjustment curve, and judging the brightness value of the pixel point and the target Whether the brightness value is the same. If the brightness value of the pixel is different from the target brightness value, adjust the brightness value of the pixel to the same brightness value as the target brightness value.
  • step S41 to step S43 based on the average natural brightness value and the preset optimal brightness value, a brightness adjustment value drtb is obtained, and three (0, 0), (127, 127 + drtb), and (255, 255) are obtained.
  • the coordinate points are subjected to smooth curve fitting to obtain a brightness adjustment curve; the brightness value of each pixel in the face image is adjusted according to the brightness adjustment curve to obtain a target image, and the brightness of the face brightness can be quickly adjusted to reduce the adjusted brightness.
  • the distortion of the brightness of the target image ensures the layered sense of the brightness of the target image.
  • step S42 performing smooth curve fitting on the three coordinate points (0, 0), (127, 127 + drtb), and (255, 255) to obtain a brightness adjustment curve, which specifically includes:
  • a non-uniform B-spline curve is used to fit the three coordinate points (0, 0), (127, 127 + drtb), and (255, 255) to a smooth curve fitting to obtain the brightness adjustment curve;
  • Non-uniform B-spline (NURBS, Non Uniform, Rational B-spline) is a versatile spline curve that can be used not only to describe free curves and surfaces, but also to provide a precise representation of conic curves and surfaces.
  • NURBS Non Uniform, Rational B-spline
  • the unified expression of various geometries, the mathematical expression is:
  • P (K) is a position vector on the curve
  • N i is the m-th spline base function
  • R i is a weighting factor
  • P i of the control points K is knot vector.
  • the m-th spline basis function is defined by a recursive formula:
  • the interval interval can be any value, so different mixed function shapes can be obtained in different intervals, which provides greater freedom for freely controlling the shape of the curve.
  • the main difference between uniform and non-uniform is the value of the node vector. If the node vector is set appropriately, an open uniform spline can be generated, which is the intersection of uniform and non-uniform. The node values of the open uniform spline at both ends are repeated d times, and the node spacing is uniform.
  • the position vector is a vector with the origin as the starting point and the point as the end. For example, at any point C (127, 127 + drtb) in the coordinate plane, the vector OC is called the position vector of point C.
  • a non-uniform B-spline curve can be used to fit the three coordinate points (0, 0), (127, 127 + drtb), and (255, 255) to obtain a smooth curve as a brightness adjustment curve.
  • the brightness of the adjusted image is more balanced, and the adjusted target image has serious brightness distortion, and the brightness of the adjusted target image is guaranteed.
  • the sense of gradation, and the brightness adjustment curve enables fast brightness adjustment of the face image.
  • FIG. 6 shows a principle block diagram of a face brightness adjustment device corresponding to the face brightness adjustment method in the above embodiment.
  • the face brightness adjustment device includes a target detection area acquisition module 10, a pixel brightness acquisition module 20, an area average brightness acquisition module 30, and a brightness adjustment module 40.
  • Each functional module is described in detail below:
  • the target detection area obtaining module 10 is configured to obtain a face image, and obtain a target detection area based on the face image.
  • the pixel brightness obtaining module 20 is configured to obtain a brightness value of each pixel in the target detection area.
  • the area average brightness obtaining module 30 is configured to process the brightness value by using an image natural brightness algorithm to obtain an average natural brightness value of the target detection area.
  • a brightness adjustment module 40 configured to construct a brightness adjustment curve based on the average natural brightness value if the average natural brightness value is not within a preset natural brightness range, and use the brightness adjustment curve to brightness the face image Adjust to get the target image.
  • the target detection area acquisition module 10 includes a facial feature point data acquisition unit 11, a facial features area extraction unit 12, and a target detection area determination unit 13.
  • the facial feature point data acquisition unit 11 is configured to detect facial feature point data of the face image by using a facial feature point detection algorithm, where the facial feature point data includes coordinate data and local feature values.
  • the facial features region extraction unit 12 is configured to extract facial features in the face image according to the coordinate data and the local feature value.
  • the target detection area determining unit 13 is configured to obtain the target detection area according to the coordinate data of the nose tip and the outer corners of the eyes in the facial features area.
  • the target detection area determination unit 13 includes a horizontal straight line determination sub-unit 131 and a rectangular area determination sub-unit 132.
  • the horizontal straight line determining subunit 131 is configured to make a horizontal straight line based on the coordinate data of the nose tip.
  • the rectangular region determining sub-unit 132 is configured to construct a rectangular region based on the coordinate data of the outer corners of the eyes and the horizontal straight line, and determine the rectangular region as the target detection region.
  • the formula of the image natural brightness algorithm is: Among them, N is the number of pixels in the target detection area, Lum ave is the average natural brightness value of the target detection area, Lum (x, y) is the brightness value corresponding to the pixel points (x, y) of the target detection area, and ⁇ is a constant .
  • the brightness adjustment module 40 includes a brightness adjustment value acquisition unit 41, a brightness adjustment curve acquisition unit 42, and a target image acquisition unit 43.
  • the brightness adjustment value obtaining unit 41 is configured to obtain a brightness adjustment value drtb based on the average natural brightness value and a preset optimal brightness value.
  • the brightness adjustment curve obtaining unit 42 is configured to perform smooth curve fitting on three coordinate points (0, 0), (127, 127 + drtb), and (255, 255) to obtain a brightness adjustment curve.
  • a target image obtaining unit 43 is configured to adjust the brightness value of each pixel point in the face image according to the brightness adjustment curve to obtain a target image.
  • the brightness adjustment curve obtaining unit 42 is configured to use a non-uniform B-spline curve to perform smooth curve fitting on the three coordinate points (0, 0), (127, 127 + drtb), and (255, 255). Get the brightness adjustment curve;
  • Each module in the above-mentioned face brightness adjustment device may be implemented in whole or in part by software, hardware, and a combination thereof.
  • the above-mentioned modules may be embedded in the hardware in or independent of the processor in the computer device, or may be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
  • a computer device is provided.
  • the computer device may be a server, and its internal structure diagram may be as shown in FIG. 7.
  • the computer device includes a processor, a memory, a network interface, and a database connected through a system bus.
  • the processor of the computer device is used to provide computing and control capabilities.
  • the memory of the computer device includes a non-volatile storage medium and an internal memory.
  • the non-volatile storage medium stores an operating system, computer-readable instructions, and a database.
  • the internal memory provides an environment for the operation of the operating system and computer-readable instructions in a non-volatile storage medium.
  • the network interface of the computer device is used to communicate with an external terminal through a network connection.
  • the computer-readable instructions are executed by a processor to implement a method for adjusting human face brightness.
  • a computer device including a memory, a processor, and computer-readable instructions stored on the memory and executable on the processor.
  • the processor executes the computer-readable instructions, the processor implements the following steps: obtaining a person A face image, obtaining a target detection area based on the face image; obtaining a brightness value of each pixel in the target detection area; processing the brightness value using an image natural brightness algorithm to obtain an average of the target detection area Natural brightness value; if the average natural brightness value is not within a preset natural brightness range, a brightness adjustment curve is constructed based on the average natural brightness value, and the brightness adjustment curve is used to adjust the brightness of the face image to obtain The target image.
  • the processor executes the computer-readable instructions
  • the following steps are further implemented: using a facial feature point detection algorithm to detect facial feature point data of the face image, the facial feature point data including coordinate data and local features Value; extracting the facial features region in the face image according to the coordinate data and the local feature value; obtaining the target detection region according to the coordinate data of the nose tip and the corners of the eyes outside the eyes in the facial feature region.
  • the processor when the processor executes the computer-readable instructions, the processor further implements the following steps: making a horizontal straight line based on the coordinate data of the tip of the nose; and constructing a rectangular area based on the coordinate data of the outer corners of the eyes and the horizontal straight line, Determining the rectangular area as the target detection area.
  • the formula of the image natural brightness algorithm is:
  • N is the number of pixels in the target detection area
  • Lum ave is the average natural brightness value of the target detection area
  • Lum (x, y) is the brightness value corresponding to the pixel points (x, y) of the target detection area
  • is a constant .
  • the processor when the processor executes the computer-readable instructions, the following steps are further implemented: obtaining a brightness adjustment value drtb based on the average natural brightness value and a preset optimal brightness value; for (0,0), (127 (127 + drtb) and (255, 255) coordinate smooth curve fitting to obtain a brightness adjustment curve; adjust the brightness value of each pixel in the face image according to the brightness adjustment curve to obtain a target image .
  • the processor executes the computer-readable instructions, the following steps are further implemented: using non-uniform B-spline curve pairs (0, 0), (127, 127 + drtb), and (255, 255) three coordinate points
  • the smoothing curve fitting is adopted to obtain the brightness adjustment curve.
  • the mathematical expression of the non-uniform B-spline curve is Wherein, P (K) is a position vector on the curve, N i, m (K) is the m-th spline base function, R i is a weighting factor, P i of the control points, K is knot vector.
  • one or more non-volatile readable storage media storing computer-readable instructions are provided, and when the computer-readable instructions are executed by one or more processors, the one or more The processors execute the following steps: acquiring a face image, obtaining a target detection area based on the face image; obtaining a brightness value of each pixel in the target detection area; and processing the brightness value using an image natural brightness algorithm Obtaining an average natural brightness value of the target detection area; if the average natural brightness value is not within a preset natural brightness range, constructing a brightness adjustment curve based on the average natural brightness value, and using the brightness adjustment curve The face image is adjusted for brightness to obtain a target image.
  • the one or more processors when the computer-readable instructions are executed by one or more processors, the one or more processors are caused to perform the following steps: using a facial feature point detection algorithm to detect a face of the facial image Feature point data, the facial feature point data including coordinate data and local feature values; extracting facial features in the face image according to the coordinate data and the local feature values; and according to the nose tip and The coordinate data of the corners of the eyes outside the eyes to obtain the target detection area.
  • the one or more processors when the computer-readable instructions are executed by one or more processors, the one or more processors are caused to perform the following steps: making a horizontal straight line based on the coordinate data of the nose tip; based on the The coordinate data of the outer corners of the eyes and the horizontal straight line construct a rectangular area, and the rectangular area is determined as the target detection area.
  • the formula of the image natural brightness algorithm is:
  • N is the number of pixels in the target detection area
  • Lum ave is the average natural brightness value of the target detection area
  • Lum (x, y) is the brightness value corresponding to the pixel points (x, y) of the target detection area
  • is a constant .
  • the one or more processors when the computer-readable instructions are executed by one or more processors, the one or more processors are caused to perform the following steps: based on the average natural brightness value and a preset optimal brightness value To obtain a brightness adjustment value drtb; perform smooth curve fitting on the three coordinate points (0, 0), (127, 127 + drtb), and (255, 255) to obtain a brightness adjustment curve; The brightness value of each pixel in the face image is described to obtain a target image.
  • the one or more processors when the computer-readable instructions are executed by one or more processors, the one or more processors are caused to perform the following steps: using a non-uniform B-spline curve pair (0, 0), ( 127, 127 + drtb) and (255, 255) are used to perform smooth curve fitting to obtain the brightness adjustment curve; where the mathematical expression of the non-uniform B-spline curve is Wherein, P (K) is a position vector on the curve, N i, m (K) is the m-th spline base function, R i is a weighting factor, P i of the control points, K is knot vector.
  • Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory.
  • Volatile memory can include random access memory (RAM) or external cache memory.
  • RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous chain Synchlink DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
  • SRAM static RAM
  • DRAM dynamic RAM
  • SDRAM synchronous DRAM
  • DDRSDRAM dual data rate SDRAM
  • ESDRAM enhanced SDRAM
  • SLDRAM synchronous chain Synchlink DRAM
  • Rambus direct RAM
  • DRAM direct memory bus dynamic RAM
  • RDRAM memory bus dynamic RAM

Landscapes

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

Abstract

A face brightness adjustment method and apparatus, a computer device and a storage medium. The face brightness adjustment method comprises: obtaining a face image, and obtaining a target detection area on the basis of the face image (S10); obtaining a brightness value of each pixel in the target detection area (S20); using an image natural brightness algorithm to perform processing on the brightness value so as to obtain an average natural brightness value of the target detection area (S30); if the average natural brightness value is not within a preset natural brightness range, constructing a brightness adjustment curve on the basis of the average natural brightness value, and using the brightness adjustment curve to adjust the brightness of the face image so as to obtain a target image (S40). The described face brightness adjustment method obtains an average natural brightness value according to a target detection area of a face image, constructs a brightness adjustment curve on the basis of the average natural brightness value and then adjusts the brightness, thereby improving the adjustment speed and reducing distortion.

Description

人脸亮度调整方法、装置、计算机设备及存储介质Face brightness adjustment method and device, computer equipment and storage medium
本申请以2018年6月6日提交的申请号为201810573812.3,名称为“人脸亮度调整方法、装置、计算机设备及存储介质”的中国专利申请为基础,并要求其优先权。This application is based on a Chinese patent application filed on June 6, 2018 with the application number 201810573812.3 and entitled "Face Brightness Adjustment Method, Apparatus, Computer Equipment, and Storage Medium" and claims its priority.
技术领域Technical field
本申请涉及图像处理技术领域,尤其涉及一种人脸亮度调整方法、装置、计算机设备及存储介质。The present application relates to the field of image processing technology, and in particular, to a method, a device, a computer device, and a storage medium for adjusting human face brightness.
背景技术Background technique
图像亮度调整是图像处理的一部分,是指对图像中像素值的亮度进行调整。图像亮度本质上图像中每个像素的亮度,每个像素的亮度可用RGB值的大小表述,其中,R代表的是红通道分量,G代表的是绿通道分量,B代表的是蓝通道分量。若R、G和B的值均为0时,像素点为黑色,亮度最暗;若R、G和B的值均为255时,像素点为白色,亮度最亮。Image brightness adjustment is a part of image processing, which refers to adjusting the brightness of pixel values in an image. The brightness of an image is essentially the brightness of each pixel in the image. The brightness of each pixel can be expressed by the size of the RGB value, where R represents the red channel component, G represents the green channel component, and B represents the blue channel component. When the values of R, G, and B are all 0, the pixels are black and the brightness is the darkest; when the values of R, G, and B are all 255, the pixels are white and the brightness is the brightest.
现有图像亮度调整算法中,多为计算像素算术平均值后的像素在RGB通道上的简单加减调整,调整后的图像亮度有较严重的失真,尤其是极亮或极暗的像素点的亮度失真严重,不能保证图像的层次感。In the existing image brightness adjustment algorithms, the simple addition and subtraction adjustment of pixels on the RGB channel after calculating the arithmetic mean of the pixels are mostly performed. The adjusted image brightness has severe distortion, especially for extremely bright or dark pixels. The brightness distortion is serious, and the layered sense of the image cannot be guaranteed.
发明内容Summary of the Invention
本申请实施例提供一种人脸亮度调整方法、装置、计算机设备及存储介质,以解决当前人脸图像亮度调整过程出现失真严重的问题。Embodiments of the present application provide a method, a device, a computer device, and a storage medium for adjusting the brightness of a face, so as to solve the problem of serious distortion in the current brightness adjustment process of a face image.
一种人脸亮度调整方法,包括:A method for adjusting face brightness, including:
获取人脸图像,基于所述人脸图像获取目标检测区域;Acquiring a face image, and acquiring a target detection area based on the face image;
获取所述目标检测区域中每一像素点的亮度值;Obtaining a brightness value of each pixel in the target detection area;
采用图像自然亮度算法对所述亮度值进行处理,获取所述目标检测区域的平均自然亮度值;Processing the brightness value by using an image natural brightness algorithm to obtain an average natural brightness value of the target detection area;
若所述平均自然亮度值不在预设自然亮度范围内,则基于所述平均自然亮度值构建亮度调整曲线,并采用所述亮度调整曲线对所述人脸图像进行亮度调整,获取目标图像。If the average natural brightness value is not within a preset natural brightness range, a brightness adjustment curve is constructed based on the average natural brightness value, and the brightness adjustment curve is used to perform brightness adjustment on the face image to obtain a target image.
一种人脸亮度调整装置,包括:A face brightness adjusting device includes:
目标检测区域获取模块,用于获取人脸图像,基于所述人脸图像获取目标检测区域;A target detection area acquisition module, configured to obtain a face image, and obtain a target detection area based on the face image;
像素点亮度获取模块,用于获取所述目标检测区域中每一像素点的亮度值;A pixel brightness obtaining module, configured to obtain a brightness value of each pixel in the target detection area;
区域平均亮度获取模块,用于采用图像自然亮度算法对所述亮度值进行处理,获取所述目标检测区域的平均自然亮度值;An area average brightness acquisition module, configured to process the brightness value by using an image natural brightness algorithm to obtain an average natural brightness value of the target detection area;
亮度调整模块,用于若所述平均自然亮度值不在预设自然亮度范围内,则基于所述平 均自然亮度值构建亮度调整曲线,并采用所述亮度调整曲线对所述人脸图像进行亮度调整,获取目标图像。A brightness adjustment module configured to construct a brightness adjustment curve based on the average natural brightness value if the average natural brightness value is not within a preset natural brightness range, and use the brightness adjustment curve to perform brightness adjustment on the face image To get the target image.
一种计算机设备,包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机可读指令,所述处理器执行所述计算机可读指令时实现如下步骤:A computer device includes a memory, a processor, and computer-readable instructions stored in the memory and executable on the processor. When the processor executes the computer-readable instructions, the following steps are implemented:
获取人脸图像,基于所述人脸图像获取目标检测区域;Acquiring a face image, and acquiring a target detection area based on the face image;
获取所述目标检测区域中每一像素点的亮度值;Obtaining a brightness value of each pixel in the target detection area;
采用图像自然亮度算法对所述亮度值进行处理,获取所述目标检测区域的平均自然亮度值;Processing the brightness value by using an image natural brightness algorithm to obtain an average natural brightness value of the target detection area;
若所述平均自然亮度值不在预设自然亮度范围内,则基于所述平均自然亮度值构建亮度调整曲线,并采用所述亮度调整曲线对所述人脸图像进行亮度调整,获取目标图像。If the average natural brightness value is not within a preset natural brightness range, a brightness adjustment curve is constructed based on the average natural brightness value, and the brightness adjustment curve is used to perform brightness adjustment on the face image to obtain a target image.
一个或多个存储有计算机可读指令的非易失性可读存储介质,所述计算机可读指令被一个或多个处理器执行时,使得所述一个或多个处理器执行如下步骤:One or more non-volatile readable storage media storing computer-readable instructions, which when executed by one or more processors, cause the one or more processors to perform the following steps:
获取人脸图像,基于所述人脸图像获取目标检测区域;Acquiring a face image, and acquiring a target detection area based on the face image;
获取所述目标检测区域中每一像素点的亮度值;Obtaining a brightness value of each pixel in the target detection area;
采用图像自然亮度算法对所述亮度值进行处理,获取所述目标检测区域的平均自然亮度值;Processing the brightness value by using an image natural brightness algorithm to obtain an average natural brightness value of the target detection area;
若所述平均自然亮度值不在预设自然亮度范围内,则基于所述平均自然亮度值构建亮度调整曲线,并采用所述亮度调整曲线对所述人脸图像进行亮度调整,获取目标图像。If the average natural brightness value is not within a preset natural brightness range, a brightness adjustment curve is constructed based on the average natural brightness value, and the brightness adjustment curve is used to perform brightness adjustment on the face image to obtain a target image.
本申请的一个或多个实施例的细节在下面的附图和描述中提出,本申请的其他特征和优点将从说明书、附图以及权利要求变得明显。Details of one or more embodiments of the present application are set forth in the accompanying drawings and description below, and other features and advantages of the present application will become apparent from the description, the drawings, and the claims.
附图说明BRIEF DESCRIPTION OF THE DRAWINGS
为了更清楚地说明本申请实施例的技术方案,下面将对本申请实施例的描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。In order to explain the technical solutions of the embodiments of the present application more clearly, the drawings used in the description of the embodiments of the application will be briefly introduced below. Obviously, the drawings in the following description are just some embodiments of the application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without paying creative labor.
图1是本申请一实施例中人脸亮度调整方法的一应用环境图;FIG. 1 is an application environment diagram of a face brightness adjustment method according to an embodiment of the present application; FIG.
图2是本申请一实施例中人脸亮度调整方法的一流程图;FIG. 2 is a flowchart of a method for adjusting face brightness in an embodiment of the present application; FIG.
图3是图2中步骤S10的一流程图;FIG. 3 is a flowchart of step S10 in FIG. 2;
图4是图3中步骤S13的一流程图;4 is a flowchart of step S13 in FIG. 3;
图5是图2中步骤S40的一流程图;FIG. 5 is a flowchart of step S40 in FIG. 2;
图6是本申请一实施例中人脸亮度调整装置的一示意图;6 is a schematic diagram of a face brightness adjusting device according to an embodiment of the present application;
图7是本申请一实施例中计算机设备的一示意图。FIG. 7 is a schematic diagram of a computer device in an embodiment of the present application.
具体实施方式Detailed ways
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。In the following, the technical solutions in the embodiments of the present application will be clearly and completely described with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, but not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by a person of ordinary skill in the art without creative efforts shall fall within the protection scope of this application.
本申请实施例提供的人脸亮度调整方法,可应用在如图1的应用环境中,即该人脸亮度调整方法应用在图1所示的亮度调整系统中,该亮度调整系统包括服务器和与服务器通过网络相连的客户端。客户端可通过WiFi、3G、4G和5G等无线网络或者有线网络中的任一种与服务器进行通信。客户端(Client)或称为用户端,是指与服务器相对应,为客户提供本地服务的程序。该客户端可安装在但不限于各种个人计算机、笔记本电脑、智能手机、平板电脑和便携式可穿戴设备上。服务器可以用独立的服务器或者是多个服务器组成的服务器集群来实现。The face brightness adjustment method provided in the embodiment of the present application may be applied in the application environment shown in FIG. 1, that is, the face brightness adjustment method is applied in the brightness adjustment system shown in FIG. 1. The brightness adjustment system includes a server and a server. Clients connected to the server via the network. The client can communicate with the server through any of wireless networks such as WiFi, 3G, 4G, and 5G or wired networks. Client (Client), or client, refers to the program that provides local services to clients corresponding to the server. The client can be installed on, but not limited to, various personal computers, laptops, smartphones, tablets, and portable wearable devices. The server can be implemented by an independent server or a server cluster composed of multiple servers.
在一实施例中,如图2所示,以该人脸亮度调整方法应用在图1中的服务器为例进行说明,如图2所示,该人脸亮度调整方法包括如下步骤:In an embodiment, as shown in FIG. 2, the face brightness adjustment method is applied to the server in FIG. 1 as an example for description. As shown in FIG. 2, the face brightness adjustment method includes the following steps:
S10:获取人脸图像,基于人脸图像获取目标检测区域。S10: Acquire a face image, and obtain a target detection area based on the face image.
人脸图像是指包含人物脸部的图像,是未经处理的图像,具体可以是客户端实时发送至服务器需要进行图像处理的图像,也可以是客户端预先发送给服务器,并由服务器存储并调用的图像。图像可以是客户端本地存储的图像,也可以是客户端通过摄像头拍摄获取的图像。目标检测区域是指在人脸图像中的检测区域,检测区域可以是去除图像背景及其它干扰因素后,仅保留人脸的区域。A face image refers to an image containing a person's face. It is an unprocessed image. Specifically, it can be an image that the client sends to the server in real time for image processing, or it can be sent to the server in advance by the client and stored by the server. Called image. The image can be an image stored locally by the client or an image captured by the client through a camera. The target detection area refers to the detection area in the face image. The detection area may be an area where only the face is retained after removing the image background and other interference factors.
服务器可以采用人脸检测算法识别人脸图像,将检测到的人脸区域作为目标检测区域。目标检测区域是指人脸图像中去除掉背景以及其它不属于人物脸部的因素后保留下来的区域。例如可以利用边缘检测算法对人脸图像进行处理,获取到人物脸部轮廓,确定出包含该人物脸部轮廓的目标检测区域。The server may use a face detection algorithm to identify a face image, and use the detected face area as a target detection area. The target detection area refers to the area that remains after removing the background and other factors that do not belong to the face of the person in the face image. For example, an edge detection algorithm may be used to process a face image, obtain a human face contour, and determine a target detection area containing the human face contour.
S20:获取目标检测区域中每一像素点的亮度值。S20: Obtain the brightness value of each pixel in the target detection area.
像素点是指图像上的最小单元,像素点的亮度值表示该像素点对应的图像的亮度,计算机通过每一像素点的位置、颜色和亮度等信息,从而表示出整幅图像的亮度。一个像素点的亮度值由R、G和B三个像素单元构成,亮度值表示图像色彩的明暗程度。图像的亮度可通过组成该图像的所有像素值的亮度值表示,每一像素点的亮度值位于0-255之间,0代表全黑,255代表全白。A pixel is the smallest unit in an image. The brightness value of a pixel represents the brightness of the image corresponding to that pixel. The computer uses the position, color, and brightness of each pixel to display the brightness of the entire image. The brightness value of a pixel is composed of three pixel units, R, G, and B. The brightness value represents the brightness of the image color. The brightness of an image can be represented by the brightness values of all the pixel values that make up the image. The brightness value of each pixel is between 0 and 255, where 0 is completely black and 255 is completely white.
在本实施例中,服务器根据人脸图像获取到目标检测区域后,对目标检测区域进行亮度值计算,以获取每一像素点的亮度值。服务器在获取目标检测区域中每一像素点的亮度值之后,可以采用灰度转换公式进行灰度计算,以获取转换处理后的亮度值,灰度转换公式如下:Gray=R*0.299+G*0.587+B*0.114,其中,Gray是图像的灰度值,也就是转化后图像的亮度值,R代表的是红通道分量,G代表的是绿通道分量,B代表的是蓝通道 分量。将RGB图像转化成灰度图像过程中,采用的灰度转换公式能够实现快速且精度高的运算,从而可快速获得目标检测区域中每一像素点的亮度值,以便于后续基于灰度图像进行亮度调整,有助于提高亮度调整的速率。In this embodiment, after the server obtains the target detection area according to the face image, the server calculates the brightness value of the target detection area to obtain the brightness value of each pixel. After the server obtains the brightness value of each pixel in the target detection area, it can use the grayscale conversion formula to perform grayscale calculation to obtain the converted brightness value. The grayscale conversion formula is as follows: Gray = R * 0.299 + G * 0.587 + B * 0.114, where Gray is the gray value of the image, that is, the brightness value of the converted image, R represents the red channel component, G represents the green channel component, and B represents the blue channel component. In the process of converting an RGB image into a grayscale image, the grayscale conversion formula used can achieve fast and high-precision calculations, so that the brightness value of each pixel in the target detection area can be quickly obtained for subsequent subsequent grayscale image-based processing. Brightness adjustment helps to increase the rate of brightness adjustment.
S30:采用图像自然亮度算法对亮度值进行处理,获取目标检测区域的平均自然亮度值。S30: Use the image natural brightness algorithm to process the brightness value to obtain the average natural brightness value of the target detection area.
图像自然亮度算法是指根据图像中每一像素点的亮度值计算图像平均亮度的算法。平均自然亮度值是表示图像的明亮程度的平均值,The image natural brightness algorithm refers to an algorithm that calculates the average brightness of an image based on the brightness value of each pixel in the image. The average natural brightness value is an average value indicating how bright the image is.
在本实施例中,服务器获取到目标检测区域中每一像素点的亮度值后,基于每一像素点的亮度值,采用图像自然亮度算法进行平均自然亮度值的计算,图像自然亮度算法公式如下:
Figure PCTCN2018092652-appb-000001
其中,N为目标检测区域的像素点数量,Lum ave为目标检测区域的平均自然亮度值,Lum(x,y)为目标检测区域的像素点(x,y)对应的亮度值,δ为常数。δ是一个较小的常数,用于防止求对数的计算结果趋于负无穷的情况,如δ可取0.0001。对于目标检测区域的每个像素点,计算出该像素点的亮度值Lum(x,y),然后求出该亮度值Lum(x,y)与一常数δ的和值的自然对数;接着对所有像素点的亮度值Lum(x,y)对应的自然对数求平均值;再求该平均值的自然指数值,即可获取该平均自然亮度值。通过图像自然亮度算法获取的平均自然亮度值比直接计算平均值的平均亮度更符合人眼对亮度的判断,可有效减少后续进行亮度调整的失真,有助于提高调整后人脸图像亮度的层次感。
In this embodiment, after the server obtains the brightness value of each pixel in the target detection area, based on the brightness value of each pixel, the image natural brightness algorithm is used to calculate the average natural brightness value. The formula of the image natural brightness algorithm is as follows :
Figure PCTCN2018092652-appb-000001
Among them, N is the number of pixels in the target detection area, Lum ave is the average natural brightness value of the target detection area, Lum (x, y) is the brightness value corresponding to the pixel points (x, y) of the target detection area, and δ is a constant . δ is a small constant used to prevent the calculation result of the logarithm from going to negative infinity. For example, δ can be 0.0001. For each pixel in the target detection area, calculate the luminance value Lum (x, y) of the pixel, and then find the natural logarithm of the sum of the luminance value Lum (x, y) and a constant δ; then The natural logarithm corresponding to the luminance value Lum (x, y) of all pixels is averaged; then the natural index value of the average is obtained to obtain the average natural luminance value. The average natural brightness value obtained by the image natural brightness algorithm is more in line with the human eye's judgment of the brightness than the average brightness of the average value directly calculated, which can effectively reduce the distortion of subsequent brightness adjustments and help improve the level of brightness of the face image after adjustment sense.
S40:若平均自然亮度值不在预设自然亮度范围内,则基于平均自然亮度值构建亮度调整曲线,并采用亮度调整曲线对人脸图像进行亮度调整,获取目标图像。S40: If the average natural brightness value is not within the preset natural brightness range, a brightness adjustment curve is constructed based on the average natural brightness value, and the brightness adjustment curve is used to adjust the brightness of the face image to obtain the target image.
预设自然亮度范围是指预先设置的用来判断图像的平均自然亮度值是否满足处理要求的一个亮度值范围,图像的亮度值范围在[0,255]之间,预设自然亮度范围可以根据需求调整。例如,要将人脸图像进行模型训练,在模型训练时预先设置了合适的自然亮度范围(90-190),则90-190为预设自然亮度范围。亮度调整曲线是指采用平滑曲线对图像进行曲线拟合得出的一条亮度曲线,可利用该亮度曲线对图像的亮度调整。亮度调整是指在人脸图像中根据亮度调整曲线进行每一像素点亮度值的调整。目标图像是指依照亮度调整曲线完成每一像素点亮度值调整的人脸图像。The preset natural brightness range refers to a range of brightness values set in advance to determine whether the average natural brightness value of the image meets the processing requirements. The brightness value range of the image is between [0, 255]. The preset natural brightness range can be based on Demand adjustment. For example, to perform face training on a face image, a suitable natural brightness range (90-190) is set in advance during model training, and 90-190 is a preset natural brightness range. The brightness adjustment curve refers to a brightness curve obtained by curve fitting an image using a smooth curve, and the brightness curve can be used to adjust the brightness of the image. Brightness adjustment refers to the adjustment of the brightness value of each pixel in the face image according to the brightness adjustment curve. The target image refers to a face image whose brightness value is adjusted at each pixel according to the brightness adjustment curve.
在本实施例中,基于平均自然亮度值构建亮度调整曲线可以通过平滑曲线拟合的方法来实现,以三个坐标点进行曲线拟合,得到平滑曲线,即亮度调整曲线。具体地,可以采用均匀B样条、准均匀B样条、分段Bezier或者非均匀B样条曲线进行曲线拟合。基于该亮度调整曲线,获取人脸图像的每一像素点的目标亮度值,将人脸图像中每一像素点的 亮度值进行调整处理,即将每一像素点的亮度值调整为对应的目标亮度值,完成后得到目标图像。In this embodiment, constructing the brightness adjustment curve based on the average natural brightness value can be implemented by a smooth curve fitting method, and performing curve fitting with three coordinate points to obtain a smooth curve, that is, a brightness adjustment curve. Specifically, curve fitting may be performed using a uniform B-spline, a quasi-uniform B-spline, a segmented Bezier, or a non-uniform B-spline curve. Based on the brightness adjustment curve, the target brightness value of each pixel in the face image is obtained, and the brightness value of each pixel in the face image is adjusted, that is, the brightness value of each pixel is adjusted to the corresponding target brightness Value, get the target image after completion.
例如,服务器可以采用非线性调整方式,基于平均自然亮度值构建亮度调整曲线,具体包括:在平面坐标系中,设定横坐标和纵坐标为0-255中每一具体亮度值,也可在横坐标和纵坐标将0-255划分为多个亮度区间,将横坐标作为调整前人脸图像中每一像素点的亮度值,纵坐标作为调整后人脸图像中相应像素点的亮度值,通过确定曲线类型和拟合处理的坐标点,基于该平均自然亮度值进行拟合处理。进一步地,对人脸图像进行拟合处理时,曲线类型可选择非均匀B样条曲线,拟合处理的坐标点可以是预先设定的,基于非均匀B样条曲线和拟合处理的坐标点获得亮度调整曲线,基于该亮度调整曲线对人脸图像进行拟合处理,有助于后续利用该亮度调整曲线快捷地对人脸图像进行亮度调整,整个调整过程简单。For example, the server may use a non-linear adjustment method to construct a brightness adjustment curve based on the average natural brightness value, which specifically includes: setting the abscissa and ordinate in the plane coordinate system to each specific brightness value in the range of 0-255. The abscissa and ordinate divide 0-255 into multiple brightness intervals, and use the abscissa as the brightness value of each pixel in the face image before adjustment, and the ordinate as the brightness value of the corresponding pixel in the face image after adjustment. By determining the curve type and the coordinate points of the fitting process, the fitting process is performed based on the average natural brightness value. Further, when performing a fitting process on a face image, the curve type may select a non-uniform B-spline curve, and the coordinate points of the fitting process may be preset, based on the non-uniform B-spline curve and the coordinates of the fitting process Point to obtain the brightness adjustment curve, and fit the face image based on the brightness adjustment curve, which is helpful for the subsequent use of the brightness adjustment curve to quickly adjust the brightness of the face image, and the entire adjustment process is simple.
在本实施例所提供的人脸亮度调整方法中,服务器获取人脸图像,基于人脸图像获取目标检测区域,为后续依据目标检测区域的亮度值对整个人脸图像的亮度进行调整提供基础,以便减少计算数据量,从而提高亮度调整速度。服务器在获取目标检测区域中每一像素点的亮度值,采用图像自然亮度算法计算获取目标检测区域的平均自然亮度值,计算过程简单快速,有助于提高亮度调整速度。服务器通过预设自然亮度范围的设置,可在平均自然亮度值不在预设自然亮度范围内时,基于平均自然亮度值构建亮度调整曲线,并采用亮度调整曲线对人脸图像进行亮度调整,获取目标图像。采用预设自然亮度范围作为判断是否进行亮度调整的依据,并基于平均自然亮度值构建亮度调整曲线,使得基于亮度调整曲线进行亮度调整获取目标图像时,亮度调整更均衡,减少图像调整过程中亮度的失真,提高调整后图像亮度的层次感。In the face brightness adjustment method provided in this embodiment, the server obtains a face image, obtains a target detection area based on the face image, and provides a basis for subsequently adjusting the brightness of the entire face image based on the brightness value of the target detection area. In order to reduce the amount of calculation data, the brightness adjustment speed is increased. The server obtains the brightness value of each pixel in the target detection area and uses the image natural brightness algorithm to calculate the average natural brightness value of the target detection area. The calculation process is simple and fast, which helps to improve the brightness adjustment speed. By setting the preset natural brightness range, the server can construct a brightness adjustment curve based on the average natural brightness value when the average natural brightness value is not within the preset natural brightness range, and use the brightness adjustment curve to adjust the brightness of the face image to obtain the target. image. The preset natural brightness range is used as the basis for judging whether to adjust the brightness, and the brightness adjustment curve is constructed based on the average natural brightness value, so that when the brightness adjustment curve is used to obtain the target image, the brightness adjustment is more balanced, and the brightness during the image adjustment is reduced. Distortion, to improve the layered sense of the brightness of the adjusted image.
在一实施例中,如图3所示,步骤S10中基于人脸图像获取目标检测区域,具体包括如下步骤:In an embodiment, as shown in FIG. 3, acquiring the target detection area based on the face image in step S10 specifically includes the following steps:
S11:采用人脸特征点检测算法检测人脸图像的面部特征点数据,面部特征点数据包括坐标数据和局部特征值。S11: A facial feature point detection algorithm is used to detect facial feature point data of a face image. The facial feature point data includes coordinate data and local feature values.
人脸特征点检测算法是指根据输入的人脸图像,自动定位出面部关键特征点(如眼睛、鼻尖、嘴角、眉毛以及人脸各部位轮廓点等)的算法。面部特征点数据是指人物面部所有特征点的数据,本实施例中的特征点主要包括眼睛、鼻尖、嘴角及眉毛等。面部特征点数据包括坐标数据和局部特征值。坐标数据是指表示面部特征点的位置信息的数据,局部特征值是表示面部特征点的特征信息的数据。Face feature point detection algorithm refers to an algorithm that automatically locates key feature points of the face (such as eyes, nose tip, mouth corners, eyebrows, and contour points of various parts of the face) based on the input face image. The facial feature point data refers to data of all feature points on a person's face. The feature points in this embodiment mainly include eyes, nose tips, mouth corners, eyebrows, and the like. The facial feature point data includes coordinate data and local feature values. The coordinate data refers to data indicating the position information of the facial feature points, and the local feature value is data indicating the feature information of the facial feature points.
在本实施例中,可以采用基于Harr(哈尔)特征的Adaboost(迭代算法)人脸特征点检测算法,利用OpenCV(计算机视觉库)自带的基于Harr特征的V-Jdetector(探测器)来进行检测人脸图像的面部特征点,获取面部特征点数据。检测过程如下:先加载Harr特征检测分类器,载入待检测的人脸图像,调用内部函数进行识别和标记,当检测到人物时,生成检测窗口。再根据级联分类器(即基于Adaboost的分类器)检测检测窗口中的 各面部特征点,获取面部特征点数据。面部特征点数据包括坐标数据和局部特征值,其中,将面部特征点的检测窗口的中心位置作为该面部特征点的坐标数据,将根据检测窗口提取到的Harr特征值作为该面部特征点的局部特征值。In this embodiment, an Adaboost (iterative algorithm) facial feature point detection algorithm based on Harr features can be used, and a Harr feature-based V-Jdetector (detector) that comes with OpenCV (Computer Vision Library) is used to Detect facial feature points of a face image, and obtain facial feature point data. The detection process is as follows: first load the Harr feature detection classifier, load the face image to be detected, call internal functions for identification and labeling, and generate a detection window when a person is detected. Then, each facial feature point in the detection window is detected according to a cascade classifier (i.e., an Adaboost-based classifier) to obtain facial feature point data. The facial feature point data includes coordinate data and local feature values. The center position of the detection window of the facial feature point is used as the coordinate data of the facial feature point, and the Harr feature value extracted according to the detection window is used as a part of the facial feature point. Eigenvalues.
S12:根据坐标数据和局部特征值,提取人脸图像中的五官区域。S12: Extract facial features in a face image according to the coordinate data and local feature values.
五官区域是指包含人的五官(眉毛、眼睛、鼻子、嘴巴和耳朵)的区域,即根据面部特征点的坐标数据和局部特征值判断出该面部特征点属于五官中的哪一特征点。The facial features area refers to the area containing human facial features (eyebrows, eyes, nose, mouth, and ears), that is, to determine which facial feature points belong to the facial features based on the coordinate data and local feature values of the facial feature points.
在本实施例中,可以基于OpenCV自带的基于Harr特征的V-Jdetector来获取面部特征点数据,根据任一面部特征点的坐标数据和局部特征值数据来识别该面部特征点为哪一五官特征。提取五官区域的过程如下:加载Harr特征五官检测分类器,载入待检测的人脸图像,调用内部函数进行识别和标记,当检测到对应的五官特征时,生成检测窗口,确定五官特征点,从而确定人脸图像中的五官区域。In this embodiment, the facial feature point data can be obtained based on the Harr feature-based V-Jdetector that comes with OpenCV, and according to the coordinate data and local feature value data of any facial feature point, which one of the facial feature points is identified Officer characteristics. The process of extracting the facial features area is as follows: load Harr feature facial features detection classifier, load the face image to be detected, call internal functions for identification and labeling, and when the corresponding facial features are detected, generate a detection window to determine the facial features points, Thereby, the facial features region in the face image is determined.
S13:根据五官区域中的鼻尖和双眼外眼角的坐标数据,获取目标检测区域。S13: Obtain the target detection area according to the coordinate data of the tip of the nose and the outer corners of the eyes in the facial features area.
鼻尖是指位于人脸的中央,由两侧鼻翼软骨内脚及鼻尖部软组织组成的人脸特征。双眼外眼角是指人的双眼靠近太阳穴的眼睛的尾部。Nasal tip refers to the facial features that are located in the center of the human face and are composed of the inner feet of both sides of the wing cartilage and the soft tissues at the tip of the nose. The outer corners of the eyes are the tails of the eyes of a person near the temples.
在本实施例中,可以基于OpenCV自带的基于Harr特征的V-Jdetector获取的面部特征点数据后提取的五官区域,根据五官区域中的鼻尖和双眼外眼角的坐标数据,获取目标检测区域,具体过程如下:先提取出鼻尖和双眼外眼角的坐标数据,以这三个坐标数据来确定目标检测区域,确定的方法可以有多种,第一种为根据三个点的坐标数据,每个点之间互相连接构建一个三角形区域,将该三角形区域作为目标检测区域;第二种为根据三个点的坐标数据,选择任一点的坐标数据做一水平直线,再由其它两点分别做与该水平直线垂直的垂直线,将其它两点连接起来构建一个矩形区域,将该矩形区域作为目标检测区域。In this embodiment, the facial features area extracted from facial feature point data obtained by the Harr feature-based V-Jdetector that comes with OpenCV can be used to obtain the target detection area based on the coordinate data of the nose tip and the corners of the eyes outside the eyes. The specific process is as follows: first extract the coordinate data of the tip of the nose and the outer corners of the eyes, and use these three coordinate data to determine the target detection area. There can be multiple methods for determining the first. According to the coordinate data of the three points, each Points are connected with each other to build a triangle area, and this triangle area is used as the target detection area. The second type is to select the coordinate data of any point to make a horizontal straight line based on the coordinate data of the three points, and then make the other two points This horizontal straight line is a vertical line that connects the other two points to build a rectangular area, and this rectangular area is used as the target detection area.
在步骤S11-步骤S13中,采用基于Harr(哈尔)特征的Adaboost(迭代算法)人脸特征点检测算法,利用OpenCV(计算机视觉库)自带的基于Harr特征的V-Jdetector(探测器)检测人脸图像的面部特征点数据,从面部特征点数据中提取出五官区域,并根据五官区域中的鼻夹和双眼外眼角的坐标确定目标检测区域,能够快速进行面部特征检测以确定目标检测区域,以便利用该目标检测区域的亮度值中进行亮度调整,有助于提高人脸亮度调整的速度。In steps S11-S13, the Adaboost (iterative algorithm) facial feature point detection algorithm based on Harr features is used, and the Harr feature-based V-Jdetector (detector) that comes with OpenCV (Computer Vision Library) is used Detect facial feature point data of a face image, extract facial features from facial feature point data, and determine target detection areas based on the coordinates of the nose clip and the corners of the eyes outside the eyes in the facial features area, which can quickly perform facial feature detection to determine target detection Area in order to use the brightness value of the target detection area to perform brightness adjustment, which helps to improve the speed of face brightness adjustment.
在一实施例中,如图4所示,步骤S13,根据五官区域中的鼻尖和双眼外眼角的坐标数据,获取目标检测区域,具体包括如下步骤:In an embodiment, as shown in FIG. 4, step S13, obtaining the target detection area according to the coordinate data of the nose tip and the outer corners of the eyes in the facial features region, specifically includes the following steps:
S131:基于鼻尖的坐标数据作一水平直线。S131: Make a horizontal straight line based on the coordinate data of the nose tip.
水平直线是指与水平面平行的线,在本实施例中,可以在人脸图像中构建构建一直角坐标系,以直角坐标系的X轴方向为水平方向,y轴方向为竖直方向,根据鼻尖的坐标数据获取鼻尖的x坐标和y坐标,以鼻尖的y坐标作一水平直线。The horizontal straight line refers to a line parallel to the horizontal plane. In this embodiment, a rectangular coordinate system can be constructed in the face image, with the X-axis direction of the rectangular coordinate system as the horizontal direction and the y-axis direction as the vertical direction. The nose coordinate data is used to obtain the x and y coordinates of the nose tip, and a horizontal straight line is made using the y coordinate of the nose tip.
S132:基于双眼外眼角的坐标数据和水平直线构建一矩形区域,将矩形区域确定为目标检测区域。S132: Construct a rectangular area based on the coordinate data of the outer corners of the eyes and the horizontal straight line, and determine the rectangular area as the target detection area.
矩形区域是指一形状为矩形的区域,在本实施例中,在人脸图像的直角坐标系中,以鼻尖的y坐标作一条平行于X轴方向的水平直线,再根据双眼外眼角的坐标数据,由双眼外眼角两点分别作与该水平直线垂直的垂直线,将双眼外眼角两点连接起来构建一个矩形区域,将该矩形区域作为目标检测区域。A rectangular region refers to a rectangular region. In this embodiment, in the rectangular coordinate system of a face image, a horizontal straight line parallel to the X-axis direction is made with the y coordinate of the nose tip, and then according to the coordinates of the corners of the eyes outside the eyes. In the data, two points of the outer corners of the two eyes are respectively made vertical lines perpendicular to the horizontal straight line, and the two points of the outer corners of the two eyes are connected to construct a rectangular area, and the rectangular area is used as the target detection area.
步骤S131和步骤S132中,以鼻尖和双眼外眼角构建的矩形区域作为目标检测区域,减少了检测区域的面积和计算量,有助于提高人脸亮度调整的速率。In steps S131 and S132, the rectangular area constructed by the tip of the nose and the outer corners of both eyes is used as the target detection area, which reduces the area and calculation amount of the detection area, and helps to improve the rate of face brightness adjustment.
在一实施例中,如图5所示,步骤S40中的基于平均自然亮度值构建亮度调整曲线,并采用亮度调整曲线对人脸图像进行亮度调整,获取目标图像,具体包括如下步骤:In an embodiment, as shown in FIG. 5, the brightness adjustment curve is constructed based on the average natural brightness value in step S40, and the brightness adjustment curve is used to adjust the brightness of the face image to obtain the target image, which specifically includes the following steps:
S41:基于平均自然亮度值和预设的最佳亮度值,获取亮度调整值drtb。S41: Obtain a brightness adjustment value drtb based on the average natural brightness value and a preset optimal brightness value.
最佳亮度值是指最适合作为亮度调整的参考依据的亮度值,例如,预设自然亮度范围为90-190,可以取中间值140作为一个亮度最佳值。亮度调整值drtb是指用于确定曲线拟合的中间点的调整值,是由亮度最佳值减去平均自然亮度值得到的值。例如,预设自然亮度范围为90-190,当平均自然亮度值小于90时,drtb是一个正值,如当平均亮度值为80,则drtb=140-80=60;当平均自然亮度值大于190时,drtb是一个负值,如当平均自然亮度值为200时,则drtb=140-200=-60。The optimal brightness value refers to a brightness value that is most suitable as a reference basis for brightness adjustment. For example, a preset natural brightness range is 90-190, and an intermediate value 140 can be taken as an optimal brightness value. The brightness adjustment value drtb refers to an adjustment value for determining an intermediate point of curve fitting, and is a value obtained by subtracting an average natural brightness value from an optimal brightness value. For example, the preset natural brightness range is 90-190. When the average natural brightness value is less than 90, drtb is a positive value. For example, when the average brightness value is 80, drtb = 140-80 = 60; when the average natural brightness value is greater than At 190, drtb is a negative value. For example, when the average natural brightness value is 200, drtb = 140-200 = -60.
S42:对(0,0)、(127,127+drtb)和(255,255)三个坐标点进行平滑曲线拟合,得到亮度调整曲线。S42: Perform smooth curve fitting on the three coordinate points (0, 0), (127, 127 + drtb), and (255, 255) to obtain a brightness adjustment curve.
平滑曲线拟合是指选择适当的曲线类型来拟合像素点的亮度值,并用拟合的函数公式确定调整前像素点的亮度值和调整后像素点的亮度值的关系。亮度调整曲线是指由平滑曲线拟合得出的用于调整图像亮度的曲线,亮度调整曲线可体现调整前像素点的亮度值与调整后像素值的亮度值的关系。Smooth curve fitting refers to selecting an appropriate curve type to fit the brightness value of a pixel, and using a fitting function formula to determine the relationship between the brightness value of the pixel before adjustment and the brightness value of the pixel after adjustment. The brightness adjustment curve refers to a curve used to adjust the brightness of an image obtained by smooth curve fitting. The brightness adjustment curve can reflect the relationship between the brightness value of the pixel point before adjustment and the brightness value of the pixel value after adjustment.
在本实施例中,服务器可以采用均匀B样条、准均匀B样条、分段Bezier或者非均匀B样条曲线来进行平滑曲线拟合。例如,在人脸图像中建立一平面坐标系,在平面坐标系中横坐标和纵坐标的值为0-255,预设自然亮度范围为90-190,平均自然亮度值为80,由于平均自然亮度值不在预设自然亮度范围内,因此需要进行亮度调整。由于平均自然亮度值为80,亮度最佳值为140,则计算获得的亮度调整值drtb为60,即确定的三个坐标点分别为(0,0)、(127,187)和(255,255),选定一种曲线类型,如均匀B样条曲线后对(0,0)、(127,187)和(255,255)三个坐标点进行拟合处理,获得一条平滑曲线,该平滑曲线就是亮度调整曲线。In this embodiment, the server may use a uniform B-spline, a quasi-uniform B-spline, a segmented Bezier, or a non-uniform B-spline curve to perform smooth curve fitting. For example, a plane coordinate system is established in a face image. In the plane coordinate system, the abscissa and ordinate values are 0-255, the preset natural brightness range is 90-190, and the average natural brightness value is 80. The brightness value is not within the preset natural brightness range, so brightness adjustment is required. Since the average natural brightness value is 80 and the optimal brightness value is 140, the calculated brightness adjustment value drtb is 60, that is, the three coordinate points determined are (0, 0), (127, 187), and (255, 255), select a curve type, such as fitting the three coordinate points (0, 0), (127, 187), and (255, 255) after a uniform B-spline curve to obtain a smooth curve. The smooth curve is the brightness adjustment curve.
S43:根据亮度调整曲线调整人脸图像中每一像素点的亮度值,获取目标图像。S43: Adjust the brightness value of each pixel in the face image according to the brightness adjustment curve to obtain a target image.
根据亮度调整曲线调整人脸图像中每一像素点的亮度值具体包括:在亮度调整曲线上找到人脸图像中每一像素点对应的调整后的目标亮度值,判断像素点的亮度值与目标亮度值是否相同,若像素点的亮度值与目标亮度值不相同时,将像素点的亮度值调整为与目标亮度值相同的亮度值。Adjusting the brightness value of each pixel point in the face image according to the brightness adjustment curve specifically includes: finding the adjusted target brightness value corresponding to each pixel point in the face image on the brightness adjustment curve, and judging the brightness value of the pixel point and the target Whether the brightness value is the same. If the brightness value of the pixel is different from the target brightness value, adjust the brightness value of the pixel to the same brightness value as the target brightness value.
在步骤S41-步骤S43中,基于平均自然亮度值和预设的最佳亮度值,获取亮度调整值 drtb,对(0,0)、(127,127+drtb)和(255,255)三个坐标点进行平滑曲线拟合,得到亮度调整曲线;再根据亮度调整曲线调整人脸图像中每一像素点的亮度值,获取目标图像,实现对人脸亮度的亮度进行快速调整,减少调整后的目标图像亮度的失真,保证目标图像亮度的层次感。In step S41 to step S43, based on the average natural brightness value and the preset optimal brightness value, a brightness adjustment value drtb is obtained, and three (0, 0), (127, 127 + drtb), and (255, 255) are obtained. The coordinate points are subjected to smooth curve fitting to obtain a brightness adjustment curve; the brightness value of each pixel in the face image is adjusted according to the brightness adjustment curve to obtain a target image, and the brightness of the face brightness can be quickly adjusted to reduce the adjusted brightness. The distortion of the brightness of the target image ensures the layered sense of the brightness of the target image.
在一实施例中,步骤S42,对(0,0)、(127,127+drtb)和(255,255)三个坐标点进行平滑曲线拟合,得到亮度调整曲线,具体包括:In an embodiment, step S42, performing smooth curve fitting on the three coordinate points (0, 0), (127, 127 + drtb), and (255, 255) to obtain a brightness adjustment curve, which specifically includes:
采用非均匀B样条曲线对(0,0)、(127,127+drtb)和(255,255)三个坐标点采用进行平滑曲线拟合,得到亮度调整曲线;A non-uniform B-spline curve is used to fit the three coordinate points (0, 0), (127, 127 + drtb), and (255, 255) to a smooth curve fitting to obtain the brightness adjustment curve;
其中,非均匀B样条曲线的数学表达式为
Figure PCTCN2018092652-appb-000002
其中,P(K)为曲线上的位置向量,N i,m(K)为m次样条基函数,R i为权因子,P i为控制点,K为节点矢量。
Among them, the mathematical expression of non-uniform B-spline curve is
Figure PCTCN2018092652-appb-000002
Wherein, P (K) is a position vector on the curve, N i, m (K) is the m-th spline base function, R i is a weighting factor, P i of the control points, K is knot vector.
非均匀B样条曲线(NURBS,Non Uniform Rational B-spline),是一种用途广泛的样条曲线,它不仅能够用于描述自由曲线和曲面,而且还提供包括能精确表达圆锥曲线曲面在内各种几何体的统一表达式,其数学表达式为:Non-uniform B-spline (NURBS, Non Uniform, Rational B-spline) is a versatile spline curve that can be used not only to describe free curves and surfaces, but also to provide a precise representation of conic curves and surfaces. The unified expression of various geometries, the mathematical expression is:
Figure PCTCN2018092652-appb-000003
Figure PCTCN2018092652-appb-000003
式中,P(K)为曲线上的位置向量,N i,m(K)为m次样条基函数,R i为权因子,P i为控制点,K为节点矢量。 In the formula, P (K) is a position vector on the curve, N i, m (K) is the m-th spline base function, R i is a weighting factor, P i of the control points, K is knot vector.
m次样条基函数由递推公式定义:The m-th spline basis function is defined by a recursive formula:
Figure PCTCN2018092652-appb-000004
Figure PCTCN2018092652-appb-000004
区间的间距可以为任意值,因此可以在不同区间上得到不同的混合函数形状,为自由控制曲线形状提供了更大自由。均匀与非均匀的主要区别在于节点向量的值。如果适当设定节点向量,可以生成一种开放均匀样条,它是均匀与非均匀的交叉部分。开放均匀样条在两端的节点值会重复d次,其节点间距是均匀的。位置向量是指以原点为起始点,以该点为终点的向量。例如,坐标平面内的任意一点C(127,127+drtb),把向量OC叫做点C的位置向量。The interval interval can be any value, so different mixed function shapes can be obtained in different intervals, which provides greater freedom for freely controlling the shape of the curve. The main difference between uniform and non-uniform is the value of the node vector. If the node vector is set appropriately, an open uniform spline can be generated, which is the intersection of uniform and non-uniform. The node values of the open uniform spline at both ends are repeated d times, and the node spacing is uniform. The position vector is a vector with the origin as the starting point and the point as the end. For example, at any point C (127, 127 + drtb) in the coordinate plane, the vector OC is called the position vector of point C.
本实施例中,可以采用非均匀B样条曲线对(0,0)、(127,127+drtb)和(255,255)三个坐标点进行曲线拟合,得到一条平滑曲线作为亮度调整曲线,以便后续通过该亮度调整曲线对每一像素点的亮度值进行调整,使得亮度调整后的图像亮度更均衡,避免调整后的目标图像存在严重的亮度失真,保证调整后目标图像在亮度上的层次感,并且,通过该亮度调整曲线能够对人脸图像进行快速亮度调整。In this embodiment, a non-uniform B-spline curve can be used to fit the three coordinate points (0, 0), (127, 127 + drtb), and (255, 255) to obtain a smooth curve as a brightness adjustment curve. In order to adjust the brightness value of each pixel through the brightness adjustment curve, the brightness of the adjusted image is more balanced, and the adjusted target image has serious brightness distortion, and the brightness of the adjusted target image is guaranteed. The sense of gradation, and the brightness adjustment curve enables fast brightness adjustment of the face image.
应理解,上述实施例中各步骤的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本申请实施例的实施过程构成任何限定。It should be understood that the size of the sequence numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.
在一实施例中,图6示出与上述实施例中人脸亮度调整方法一一对应的人脸亮度调整装置的原理框图。如图6所示,该人脸亮度调整装置包括目标检测区域获取模块10、像素点亮度获取模块20、区域平均亮度获取模块30和亮度调整模块40,各功能模块详细说明如下:In an embodiment, FIG. 6 shows a principle block diagram of a face brightness adjustment device corresponding to the face brightness adjustment method in the above embodiment. As shown in FIG. 6, the face brightness adjustment device includes a target detection area acquisition module 10, a pixel brightness acquisition module 20, an area average brightness acquisition module 30, and a brightness adjustment module 40. Each functional module is described in detail below:
目标检测区域获取模块10,用于获取人脸图像,基于所述人脸图像获取目标检测区域。The target detection area obtaining module 10 is configured to obtain a face image, and obtain a target detection area based on the face image.
像素点亮度获取模块20,用于获取所述目标检测区域中每一像素点的亮度值。The pixel brightness obtaining module 20 is configured to obtain a brightness value of each pixel in the target detection area.
区域平均亮度获取模块30,用于采用图像自然亮度算法对所述亮度值进行处理,获取所述目标检测区域的平均自然亮度值。The area average brightness obtaining module 30 is configured to process the brightness value by using an image natural brightness algorithm to obtain an average natural brightness value of the target detection area.
亮度调整模块40,用于若所述平均自然亮度值不在预设自然亮度范围内,则基于所述平均自然亮度值构建亮度调整曲线,并采用所述亮度调整曲线对所述人脸图像进行亮度调整,获取目标图像。A brightness adjustment module 40 configured to construct a brightness adjustment curve based on the average natural brightness value if the average natural brightness value is not within a preset natural brightness range, and use the brightness adjustment curve to brightness the face image Adjust to get the target image.
具体地,目标检测区域获取模块10包括面部特征点数据获取单元11、五官区域提取单元12和目标检测区域确定单元13。Specifically, the target detection area acquisition module 10 includes a facial feature point data acquisition unit 11, a facial features area extraction unit 12, and a target detection area determination unit 13.
面部特征点数据获取单元11,用于采用人脸特征点检测算法检测所述人脸图像的面部特征点数据,所述面部特征点数据包括坐标数据和局部特征值。The facial feature point data acquisition unit 11 is configured to detect facial feature point data of the face image by using a facial feature point detection algorithm, where the facial feature point data includes coordinate data and local feature values.
五官区域提取单元12,用于根据所述坐标数据和所述局部特征值,提取所述人脸图像中的五官区域。The facial features region extraction unit 12 is configured to extract facial features in the face image according to the coordinate data and the local feature value.
目标检测区域确定单元13,用于根据所述五官区域中的鼻尖和双眼外眼角的坐标数据,获取所述目标检测区域。The target detection area determining unit 13 is configured to obtain the target detection area according to the coordinate data of the nose tip and the outer corners of the eyes in the facial features area.
具体地,目标检测区域确定单元13包括水平直线确定子单元131和矩形区域确定子单元132。Specifically, the target detection area determination unit 13 includes a horizontal straight line determination sub-unit 131 and a rectangular area determination sub-unit 132.
水平直线确定子单元131,用于基于所述鼻尖的坐标数据作一水平直线。The horizontal straight line determining subunit 131 is configured to make a horizontal straight line based on the coordinate data of the nose tip.
矩形区域确定子单元132,用于基于所述双眼外眼角的坐标数据和所述水平直线构建一矩形区域,将所述矩形区域确定为所述目标检测区域。The rectangular region determining sub-unit 132 is configured to construct a rectangular region based on the coordinate data of the outer corners of the eyes and the horizontal straight line, and determine the rectangular region as the target detection region.
具体地,图像自然亮度算法的公式为:
Figure PCTCN2018092652-appb-000005
其中,N为目标检测区域的像素点数量,Lum ave为目标检测区域的平均自然亮度值,Lum(x,y)为目 标检测区域的像素点(x,y)对应的亮度值,δ为常数。
Specifically, the formula of the image natural brightness algorithm is:
Figure PCTCN2018092652-appb-000005
Among them, N is the number of pixels in the target detection area, Lum ave is the average natural brightness value of the target detection area, Lum (x, y) is the brightness value corresponding to the pixel points (x, y) of the target detection area, and δ is a constant .
具体地,亮度调整模块40包括亮度调整值获取单元41、亮度调整曲线获取单元42和目标图像获取单元43。Specifically, the brightness adjustment module 40 includes a brightness adjustment value acquisition unit 41, a brightness adjustment curve acquisition unit 42, and a target image acquisition unit 43.
亮度调整值获取单元41,用于基于所述平均自然亮度值和预设的最佳亮度值,获取亮度调整值drtb。The brightness adjustment value obtaining unit 41 is configured to obtain a brightness adjustment value drtb based on the average natural brightness value and a preset optimal brightness value.
亮度调整曲线获取单元42,用于对(0,0)、(127,127+drtb)和(255,255)三个坐标点进行平滑曲线拟合,得到亮度调整曲线。The brightness adjustment curve obtaining unit 42 is configured to perform smooth curve fitting on three coordinate points (0, 0), (127, 127 + drtb), and (255, 255) to obtain a brightness adjustment curve.
目标图像获取单元43,用于根据所述亮度调整曲线调整所述人脸图像中每一像素点的亮度值,获取目标图像。A target image obtaining unit 43 is configured to adjust the brightness value of each pixel point in the face image according to the brightness adjustment curve to obtain a target image.
具体地,亮度调整曲线获取单元42,用于采用非均匀B样条曲线对(0,0)、(127,127+drtb)和(255,255)三个坐标点采用进行平滑曲线拟合,得到亮度调整曲线;Specifically, the brightness adjustment curve obtaining unit 42 is configured to use a non-uniform B-spline curve to perform smooth curve fitting on the three coordinate points (0, 0), (127, 127 + drtb), and (255, 255). Get the brightness adjustment curve;
其中,非均匀B样条曲线的数学表达式为
Figure PCTCN2018092652-appb-000006
其中,P(K)为曲线上的位置向量,N i,m(K)为m次样条基函数,R i为权因子,P i为控制点,K为节点矢量。
Among them, the mathematical expression of non-uniform B-spline curve is
Figure PCTCN2018092652-appb-000006
Wherein, P (K) is a position vector on the curve, N i, m (K) is the m-th spline base function, R i is a weighting factor, P i of the control points, K is knot vector.
关于人脸亮度调整装置的具体限定可以参见上文中对于人脸亮度调整方法的限定,在此不再赘述。上述人脸亮度调整装置中的各个模块可全部或部分通过软件、硬件及其组合来实现。上述各模块可以硬件形式内嵌于或独立于计算机设备中的处理器中,也可以以软件形式存储于计算机设备中的存储器中,以便于处理器调用执行以上各个模块对应的操作。For specific limitations on the face brightness adjustment device, refer to the foregoing limitation on the face brightness adjustment method, and details are not described herein again. Each module in the above-mentioned face brightness adjustment device may be implemented in whole or in part by software, hardware, and a combination thereof. The above-mentioned modules may be embedded in the hardware in or independent of the processor in the computer device, or may be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
在一个实施例中,提供了一种计算机设备,该计算机设备可以是服务器,其内部结构图可以如图7所示。该计算机设备包括通过系统总线连接的处理器、存储器、网络接口和数据库。其中,该计算机设备的处理器用于提供计算和控制能力。该计算机设备的存储器包括非易失性存储介质、内存储器。该非易失性存储介质存储有操作系统、计算机可读指令和数据库。该内存储器为非易失性存储介质中的操作系统和计算机可读指令的运行提供环境。该计算机设备的网络接口用于与外部的终端通过网络连接通信。该计算机可读指令被处理器执行时以实现一种人脸亮度调整方法。In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as shown in FIG. 7. The computer device includes a processor, a memory, a network interface, and a database connected through a system bus. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, computer-readable instructions, and a database. The internal memory provides an environment for the operation of the operating system and computer-readable instructions in a non-volatile storage medium. The network interface of the computer device is used to communicate with an external terminal through a network connection. The computer-readable instructions are executed by a processor to implement a method for adjusting human face brightness.
在一个实施例中,提供了一种计算机设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机可读指令,处理器执行计算机可读指令时实现以下步骤:获取人脸图像,基于所述人脸图像获取目标检测区域;获取所述目标检测区域中每一像素点的亮度值;采用图像自然亮度算法对所述亮度值进行处理,获取所述目标检测区域的平均自然亮度值;若所述平均自然亮度值不在预设自然亮度范围内,则基于所述平均自然亮度值构建亮度调整曲线,并采用所述亮度调整曲线对所述人脸图像进行亮度调整,获取目标图 像。In one embodiment, a computer device is provided, including a memory, a processor, and computer-readable instructions stored on the memory and executable on the processor. When the processor executes the computer-readable instructions, the processor implements the following steps: obtaining a person A face image, obtaining a target detection area based on the face image; obtaining a brightness value of each pixel in the target detection area; processing the brightness value using an image natural brightness algorithm to obtain an average of the target detection area Natural brightness value; if the average natural brightness value is not within a preset natural brightness range, a brightness adjustment curve is constructed based on the average natural brightness value, and the brightness adjustment curve is used to adjust the brightness of the face image to obtain The target image.
在一个实施例中,处理器执行计算机可读指令时还实现以下步骤:采用人脸特征点检测算法检测所述人脸图像的面部特征点数据,所述面部特征点数据包括坐标数据和局部特征值;根据所述坐标数据和所述局部特征值,提取所述人脸图像中的五官区域;根据所述五官区域中的鼻尖和双眼外眼角的坐标数据,获取所述目标检测区域。In an embodiment, when the processor executes the computer-readable instructions, the following steps are further implemented: using a facial feature point detection algorithm to detect facial feature point data of the face image, the facial feature point data including coordinate data and local features Value; extracting the facial features region in the face image according to the coordinate data and the local feature value; obtaining the target detection region according to the coordinate data of the nose tip and the corners of the eyes outside the eyes in the facial feature region.
在一个实施例中,处理器执行计算机可读指令时还实现以下步骤:基于所述鼻尖的坐标数据作一水平直线;基于所述双眼外眼角的坐标数据和所述水平直线构建一矩形区域,将所述矩形区域确定为所述目标检测区域。In an embodiment, when the processor executes the computer-readable instructions, the processor further implements the following steps: making a horizontal straight line based on the coordinate data of the tip of the nose; and constructing a rectangular area based on the coordinate data of the outer corners of the eyes and the horizontal straight line, Determining the rectangular area as the target detection area.
在一个实施例中,所述图像自然亮度算法的公式为:In one embodiment, the formula of the image natural brightness algorithm is:
Figure PCTCN2018092652-appb-000007
其中,N为目标检测区域的像素点数量,Lum ave为目标检测区域的平均自然亮度值,Lum(x,y)为目标检测区域的像素点(x,y)对应的亮度值,δ为常数。
Figure PCTCN2018092652-appb-000007
Among them, N is the number of pixels in the target detection area, Lum ave is the average natural brightness value of the target detection area, Lum (x, y) is the brightness value corresponding to the pixel points (x, y) of the target detection area, and δ is a constant .
在一个实施例中,处理器执行计算机可读指令时还实现以下步骤:基于所述平均自然亮度值和预设的最佳亮度值,获取亮度调整值drtb;对(0,0)、(127,127+drtb)和(255,255)三个坐标点进行平滑曲线拟合,得到亮度调整曲线;根据所述亮度调整曲线调整所述人脸图像中每一像素点的亮度值,获取目标图像。In one embodiment, when the processor executes the computer-readable instructions, the following steps are further implemented: obtaining a brightness adjustment value drtb based on the average natural brightness value and a preset optimal brightness value; for (0,0), (127 (127 + drtb) and (255, 255) coordinate smooth curve fitting to obtain a brightness adjustment curve; adjust the brightness value of each pixel in the face image according to the brightness adjustment curve to obtain a target image .
在一个实施例中,处理器执行计算机可读指令时还实现以下步骤:采用非均匀B样条曲线对(0,0)、(127,127+drtb)和(255,255)三个坐标点采用进行平滑曲线拟合,得到亮度调整曲线;其中,非均匀B样条曲线的数学表达式为
Figure PCTCN2018092652-appb-000008
其中,P(K)为曲线上的位置向量,N i,m(K)为m次样条基函数,R i为权因子,P i为控制点,K为节点矢量。
In one embodiment, when the processor executes the computer-readable instructions, the following steps are further implemented: using non-uniform B-spline curve pairs (0, 0), (127, 127 + drtb), and (255, 255) three coordinate points The smoothing curve fitting is adopted to obtain the brightness adjustment curve. Among them, the mathematical expression of the non-uniform B-spline curve is
Figure PCTCN2018092652-appb-000008
Wherein, P (K) is a position vector on the curve, N i, m (K) is the m-th spline base function, R i is a weighting factor, P i of the control points, K is knot vector.
在一个实施例中,提供了一个或多个存储有计算机可读指令的非易失性可读存储介质,所述计算机可读指令被一个或多个处理器执行时,使得所述一个或多个处理器执行如下步骤:获取人脸图像,基于所述人脸图像获取目标检测区域;获取所述目标检测区域中每一像素点的亮度值;采用图像自然亮度算法对所述亮度值进行处理,获取所述目标检测区域的平均自然亮度值;若所述平均自然亮度值不在预设自然亮度范围内,则基于所述平均自然亮度值构建亮度调整曲线,并采用所述亮度调整曲线对所述人脸图像进行亮度调整,获取目标图像。In one embodiment, one or more non-volatile readable storage media storing computer-readable instructions are provided, and when the computer-readable instructions are executed by one or more processors, the one or more The processors execute the following steps: acquiring a face image, obtaining a target detection area based on the face image; obtaining a brightness value of each pixel in the target detection area; and processing the brightness value using an image natural brightness algorithm Obtaining an average natural brightness value of the target detection area; if the average natural brightness value is not within a preset natural brightness range, constructing a brightness adjustment curve based on the average natural brightness value, and using the brightness adjustment curve The face image is adjusted for brightness to obtain a target image.
在一个实施例中,所述计算机可读指令被一个或多个处理器执行时,使得所述一个或多个处理器执行如下步骤:采用人脸特征点检测算法检测所述人脸图像的面部特征点数 据,所述面部特征点数据包括坐标数据和局部特征值;根据所述坐标数据和所述局部特征值,提取所述人脸图像中的五官区域;根据所述五官区域中的鼻尖和双眼外眼角的坐标数据,获取所述目标检测区域。In one embodiment, when the computer-readable instructions are executed by one or more processors, the one or more processors are caused to perform the following steps: using a facial feature point detection algorithm to detect a face of the facial image Feature point data, the facial feature point data including coordinate data and local feature values; extracting facial features in the face image according to the coordinate data and the local feature values; and according to the nose tip and The coordinate data of the corners of the eyes outside the eyes to obtain the target detection area.
在一个实施例中,所述计算机可读指令被一个或多个处理器执行时,使得所述一个或多个处理器执行如下步骤:基于所述鼻尖的坐标数据作一水平直线;基于所述双眼外眼角的坐标数据和所述水平直线构建一矩形区域,将所述矩形区域确定为所述目标检测区域。In one embodiment, when the computer-readable instructions are executed by one or more processors, the one or more processors are caused to perform the following steps: making a horizontal straight line based on the coordinate data of the nose tip; based on the The coordinate data of the outer corners of the eyes and the horizontal straight line construct a rectangular area, and the rectangular area is determined as the target detection area.
在一个实施例中,所述图像自然亮度算法的公式为:In one embodiment, the formula of the image natural brightness algorithm is:
Figure PCTCN2018092652-appb-000009
其中,N为目标检测区域的像素点数量,Lum ave为目标检测区域的平均自然亮度值,Lum(x,y)为目标检测区域的像素点(x,y)对应的亮度值,δ为常数。
Figure PCTCN2018092652-appb-000009
Among them, N is the number of pixels in the target detection area, Lum ave is the average natural brightness value of the target detection area, Lum (x, y) is the brightness value corresponding to the pixel points (x, y) of the target detection area, and δ is a constant .
在一个实施例中,所述计算机可读指令被一个或多个处理器执行时,使得所述一个或多个处理器执行如下步骤:基于所述平均自然亮度值和预设的最佳亮度值,获取亮度调整值drtb;对(0,0)、(127,127+drtb)和(255,255)三个坐标点进行平滑曲线拟合,得到亮度调整曲线;根据所述亮度调整曲线调整所述人脸图像中每一像素点的亮度值,获取目标图像。In one embodiment, when the computer-readable instructions are executed by one or more processors, the one or more processors are caused to perform the following steps: based on the average natural brightness value and a preset optimal brightness value To obtain a brightness adjustment value drtb; perform smooth curve fitting on the three coordinate points (0, 0), (127, 127 + drtb), and (255, 255) to obtain a brightness adjustment curve; The brightness value of each pixel in the face image is described to obtain a target image.
在一个实施例中,所述计算机可读指令被一个或多个处理器执行时,使得所述一个或多个处理器执行如下步骤:采用非均匀B样条曲线对(0,0)、(127,127+drtb)和(255,255)三个坐标点采用进行平滑曲线拟合,得到亮度调整曲线;其中,非均匀B样条曲线的数学表达式为
Figure PCTCN2018092652-appb-000010
其中,P(K)为曲线上的位置向量,N i,m(K)为m次样条基函数,R i为权因子,P i为控制点,K为节点矢量。
In one embodiment, when the computer-readable instructions are executed by one or more processors, the one or more processors are caused to perform the following steps: using a non-uniform B-spline curve pair (0, 0), ( 127, 127 + drtb) and (255, 255) are used to perform smooth curve fitting to obtain the brightness adjustment curve; where the mathematical expression of the non-uniform B-spline curve is
Figure PCTCN2018092652-appb-000010
Wherein, P (K) is a position vector on the curve, N i, m (K) is the m-th spline base function, R i is a weighting factor, P i of the control points, K is knot vector.
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机可读指令来指令相关的硬件来完成,所述的计算机可读指令可存储于一非易失性计算机可读取存储介质中,该计算机可读指令在执行时,可包括如上述各方法的实施例的流程。其中,本申请所提供的各实施例中所使用的对存储器、存储、数据库或其它介质的任何引用,均可包括非易失性和/或易失性存储器。非易失性存储器可包括只读存储器(ROM)、可编程ROM(PROM)、电可编程ROM(EPROM)、电可擦除可编程ROM(EEPROM)或闪存。易失性存储器可包括随机存取存储器(RAM)或者外部高速缓冲存储器。作为说明而非局限,RAM以多种形式可得,诸如静态RAM(SRAM)、动态RAM(DRAM)、同步DRAM(SDRAM)、双数据率SDRAM(DDRSDRAM)、增强型SDRAM(ESDRAM)、同步链路(Synchlink)DRAM(SLDRAM)、存储器总线(Rambus)直接RAM(RDRAM)、直接存储器总线动态RAM(DRDRAM)、 以及存储器总线动态RAM(RDRAM)等。A person of ordinary skill in the art can understand that all or part of the processes in the methods of the foregoing embodiments can be implemented by using computer-readable instructions to instruct related hardware. The computer-readable instructions can be stored in a non-volatile computer. In the readable storage medium, the computer-readable instructions, when executed, may include the processes of the embodiments of the methods described above. Wherein, any reference to the storage, storage, database, or other media used in the embodiments provided in this application may include non-volatile and / or volatile storage. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous chain Synchlink DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
所属领域的技术人员可以清楚地了解到,为了描述的方便和简洁,仅以上述各功能单元、模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能单元、模块完成,即将所述装置的内部结构划分成不同的功能单元或模块,以完成以上描述的全部或者部分功能。Those skilled in the art can clearly understand that, for the convenience and brevity of the description, only the above-mentioned division of functional units and modules is used as an example. In practical applications, the above functions can be assigned by different functional units, Module completion, that is, dividing the internal structure of the device into different functional units or modules to complete all or part of the functions described above.
以上所述实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的精神和范围,均应包含在本申请的保护范围之内。The above-mentioned embodiments are only used to describe the technical solution of the present application, but not limited thereto. Although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that they can still implement the foregoing implementations. The technical solutions described in the examples are modified, or some of the technical features are equivalently replaced; and these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the application, and should be included in Within the scope of this application.

Claims (20)

  1. 一种人脸亮度调整方法,其特征在于,包括:A method for adjusting the brightness of a human face, comprising:
    获取人脸图像,基于所述人脸图像获取目标检测区域;Acquiring a face image, and acquiring a target detection area based on the face image;
    获取所述目标检测区域中每一像素点的亮度值;Obtaining a brightness value of each pixel in the target detection area;
    采用图像自然亮度算法对所述亮度值进行处理,获取所述目标检测区域的平均自然亮度值;Processing the brightness value by using an image natural brightness algorithm to obtain an average natural brightness value of the target detection area;
    若所述平均自然亮度值不在预设自然亮度范围内,则基于所述平均自然亮度值构建亮度调整曲线,并采用所述亮度调整曲线对所述人脸图像进行亮度调整,获取目标图像。If the average natural brightness value is not within a preset natural brightness range, a brightness adjustment curve is constructed based on the average natural brightness value, and the brightness adjustment curve is used to perform brightness adjustment on the face image to obtain a target image.
  2. 如权利要求1所述的人脸亮度调整方法,其特征在于,所述基于所述人脸图像获取目标检测区域,包括:The method for adjusting the brightness of a face according to claim 1, wherein the acquiring a target detection area based on the face image comprises:
    采用人脸特征点检测算法检测所述人脸图像的面部特征点数据,所述面部特征点数据包括坐标数据和局部特征值;Using a facial feature point detection algorithm to detect facial feature point data of the face image, where the facial feature point data includes coordinate data and local feature values;
    根据所述坐标数据和所述局部特征值,提取所述人脸图像中的五官区域;Extracting facial features in the face image according to the coordinate data and the local feature value;
    根据所述五官区域中的鼻尖和双眼外眼角的坐标数据,获取所述目标检测区域。The target detection area is acquired according to the coordinate data of the tip of the nose and the corners of the eyes outside the eyes in the facial features area.
  3. 如权利要求2所述的人脸亮度调整方法,其特征在于,所述根据所述五官区域中的鼻尖和双眼外眼角的坐标数据,获取所述目标检测区域,包括:The method for adjusting the brightness of a face according to claim 2, wherein the acquiring the target detection area according to the coordinate data of the nose tip and the outer corners of the eyes in the facial features area comprises:
    基于所述鼻尖的坐标数据作一水平直线;Making a horizontal straight line based on the coordinate data of the nose tip;
    基于所述双眼外眼角的坐标数据和所述水平直线构建一矩形区域,将所述矩形区域确定为所述目标检测区域。A rectangular area is constructed based on the coordinate data of the outer corners of the eyes and the horizontal straight line, and the rectangular area is determined as the target detection area.
  4. 如权利要求1所述的人脸亮度调整方法,其特征在于,所述图像自然亮度算法的公式为:
    Figure PCTCN2018092652-appb-100001
    其中,N为目标检测区域的像素点数量,Lum ave为目标检测区域的平均自然亮度值,Lum(x,y)为目标检测区域的像素点(x,y)对应的亮度值,δ为常数。
    The method for adjusting the brightness of a face according to claim 1, wherein a formula of the natural brightness algorithm of the image is:
    Figure PCTCN2018092652-appb-100001
    Among them, N is the number of pixels in the target detection area, Lum ave is the average natural brightness value of the target detection area, Lum (x, y) is the brightness value corresponding to the pixel points (x, y) of the target detection area, and δ is a constant .
  5. 如权利要求1所述的人脸亮度调整方法,其特征在于,所述基于所述平均自然亮度值构建亮度调整曲线,并采用所述亮度调整曲线对所述人脸图像进行亮度调整,获取目标图像,包括:The method for adjusting the brightness of a face according to claim 1, wherein the brightness adjustment curve is constructed based on the average natural brightness value, and the brightness adjustment curve is used to adjust the brightness of the face image to obtain a target Images, including:
    基于所述平均自然亮度值和预设的最佳亮度值,获取亮度调整值drtb;Obtaining a brightness adjustment value drtb based on the average natural brightness value and a preset optimal brightness value;
    对(0,0)、(127,127+drtb)和(255,255)三个坐标点进行平滑曲线拟合,得到亮度调整曲线;Perform smooth curve fitting on the three coordinate points (0,0), (127,127 + drtb) and (255,255) to obtain the brightness adjustment curve;
    根据所述亮度调整曲线调整所述人脸图像中每一像素点的亮度值,获取目标图像。Adjusting the brightness value of each pixel point in the face image according to the brightness adjustment curve to obtain a target image.
  6. 如权利要求5所述的人脸亮度调整方法,其特征在于,所述对(0,0)、(127,127+drtb)和(255,255)三个坐标点进行平滑曲线拟合,得到亮度调整曲线,包括:The method for adjusting the brightness of a face according to claim 5, wherein the smoothing curve fitting is performed on three coordinate points (0,0), (127,127 + drtb), and (255,255) to obtain Brightness adjustment curve, including:
    采用非均匀B样条曲线对(0,0)、(127,127+drtb)和(255,255)三个坐标点采用进行平滑曲线拟合,得到亮度调整曲线;A non-uniform B-spline curve is used to fit the three coordinate points (0, 0), (127, 127 + drtb), and (255, 255) to a smooth curve fitting to obtain the brightness adjustment curve;
    其中,非均匀B样条曲线的数学表达式为
    Figure PCTCN2018092652-appb-100002
    其中,P(K)为曲线上的位置向量,N i,m(K)为m次样条基函数,R i为权因子,P i为控制点,K为节点矢量。
    Among them, the mathematical expression of non-uniform B-spline curve is
    Figure PCTCN2018092652-appb-100002
    Wherein, P (K) is a position vector on the curve, N i, m (K) is the m-th spline base function, R i is a weighting factor, P i of the control points, K is knot vector.
  7. 一种人脸亮度调整装置,其特征在于,包括:A human face brightness adjustment device, comprising:
    目标检测区域获取模块,用于获取人脸图像,基于所述人脸图像获取目标检测区域;A target detection area acquisition module, configured to obtain a face image, and obtain a target detection area based on the face image;
    像素点亮度获取模块,用于获取所述目标检测区域中每一像素点的亮度值;A pixel brightness obtaining module, configured to obtain a brightness value of each pixel in the target detection area;
    区域平均亮度获取模块,用于采用图像自然亮度算法对所述亮度值进行处理,获取所述目标检测区域的平均自然亮度值;An area average brightness acquisition module, configured to process the brightness value by using an image natural brightness algorithm to obtain an average natural brightness value of the target detection area;
    亮度调整模块,用于若所述平均自然亮度值不在预设自然亮度范围内,则基于所述平均自然亮度值构建亮度调整曲线,并采用所述亮度调整曲线对所述人脸图像进行亮度调整,获取目标图像。A brightness adjustment module configured to construct a brightness adjustment curve based on the average natural brightness value if the average natural brightness value is not within a preset natural brightness range, and use the brightness adjustment curve to perform brightness adjustment on the face image To get the target image.
  8. 如权利要求7所述的人脸亮度调整装置,其特征在于,所述目标检测区域获取模块包括:The device for adjusting the brightness of a face according to claim 7, wherein the target detection area acquisition module comprises:
    面部特征点数据获取单元,用于采用人脸特征点检测算法检测所述人脸图像的面部特征点数据,所述面部特征点数据包括坐标数据和局部特征值;A facial feature point data acquisition unit, configured to detect facial feature point data of the face image by using a facial feature point detection algorithm, where the facial feature point data includes coordinate data and local feature values;
    五官区域提取单元,用于根据所述坐标数据和所述局部特征值,提取所述人脸图像中的五官区域;Facial features region extracting unit, configured to extract facial features in the face image according to the coordinate data and the local feature value;
    目标检测区域确定单元,用于根据所述五官区域中的鼻尖和双眼外眼角的坐标数据,获取所述目标检测区域。The target detection area determining unit is configured to acquire the target detection area according to the coordinate data of the nose tip and the outer corners of the eyes in the facial features area.
  9. 一种计算机设备,包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机可读指令,其特征在于,所述处理器执行所述计算机可读指令时实现如下步骤:A computer device includes a memory, a processor, and computer-readable instructions stored in the memory and executable on the processor, and is characterized in that the processor implements the computer-readable instructions as follows step:
    获取人脸图像,基于所述人脸图像获取目标检测区域;Acquiring a face image, and acquiring a target detection area based on the face image;
    获取所述目标检测区域中每一像素点的亮度值;Obtaining a brightness value of each pixel in the target detection area;
    采用图像自然亮度算法对所述亮度值进行处理,获取所述目标检测区域的平均自然亮度值;Processing the brightness value by using an image natural brightness algorithm to obtain an average natural brightness value of the target detection area;
    若所述平均自然亮度值不在预设自然亮度范围内,则基于所述平均自然亮度值构建亮度调整曲线,并采用所述亮度调整曲线对所述人脸图像进行亮度调整,获取目标图像。If the average natural brightness value is not within a preset natural brightness range, a brightness adjustment curve is constructed based on the average natural brightness value, and the brightness adjustment curve is used to perform brightness adjustment on the face image to obtain a target image.
  10. 如权利要求9所述的计算机设备,其特征在于,所述基于所述人脸图像获取目标检测区域,包括:The computer device according to claim 9, wherein the acquiring a target detection area based on the face image comprises:
    采用人脸特征点检测算法检测所述人脸图像的面部特征点数据,所述面部特征点数据包括坐标数据和局部特征值;Using a facial feature point detection algorithm to detect facial feature point data of the face image, where the facial feature point data includes coordinate data and local feature values;
    根据所述坐标数据和所述局部特征值,提取所述人脸图像中的五官区域;Extracting facial features in the face image according to the coordinate data and the local feature value;
    根据所述五官区域中的鼻尖和双眼外眼角的坐标数据,获取所述目标检测区域。The target detection area is acquired according to the coordinate data of the tip of the nose and the corners of the eyes outside the eyes in the facial features area.
  11. 如权利要求10所述的计算机设备,其特征在于,所述根据所述五官区域中的鼻尖和双眼外眼角的坐标数据,获取所述目标检测区域,包括:The computer device according to claim 10, wherein the acquiring the target detection area according to the coordinate data of the nose tip and the outer corners of the eyes in the facial features area comprises:
    基于所述鼻尖的坐标数据作一水平直线;Making a horizontal straight line based on the coordinate data of the nose tip;
    基于所述双眼外眼角的坐标数据和所述水平直线构建一矩形区域,将所述矩形区域确定为所述目标检测区域。A rectangular area is constructed based on the coordinate data of the outer corners of the eyes and the horizontal straight line, and the rectangular area is determined as the target detection area.
  12. 如权利要求9所述的计算机设备,其特征在于,所述图像自然亮度算法的公式为:
    Figure PCTCN2018092652-appb-100003
    其中,N为目标检测区域的像素点数量,Lum ave为目标检测区域的平均自然亮度值,Lum(x,y)为目标检测区域的像素点(x,y)对应的亮度值,δ为常数。
    The computer device according to claim 9, wherein the formula of the image natural brightness algorithm is:
    Figure PCTCN2018092652-appb-100003
    Among them, N is the number of pixels in the target detection area, Lum ave is the average natural brightness value of the target detection area, Lum (x, y) is the brightness value corresponding to the pixel points (x, y) of the target detection area, and δ is a constant .
  13. 如权利要求9所述的计算机设备,其特征在于,所述基于所述平均自然亮度值构建亮度调整曲线,并采用所述亮度调整曲线对所述人脸图像进行亮度调整,获取目标图像,包括:The computer device according to claim 9, wherein the constructing a brightness adjustment curve based on the average natural brightness value, and using the brightness adjustment curve to perform brightness adjustment on the face image to obtain a target image, comprises: :
    基于所述平均自然亮度值和预设的最佳亮度值,获取亮度调整值drtb;Obtaining a brightness adjustment value drtb based on the average natural brightness value and a preset optimal brightness value;
    对(0,0)、(127,127+drtb)和(255,255)三个坐标点进行平滑曲线拟合,得到亮度调整曲线;Perform smooth curve fitting on the three coordinate points (0,0), (127,127 + drtb) and (255,255) to obtain the brightness adjustment curve;
    根据所述亮度调整曲线调整所述人脸图像中每一像素点的亮度值,获取目标图像。Adjusting the brightness value of each pixel point in the face image according to the brightness adjustment curve to obtain a target image.
  14. 如权利要求13所述的计算机设备,其特征在于,所述对(0,0)、(127,127+drtb)和(255,255)三个坐标点进行平滑曲线拟合,得到亮度调整曲线,包括:The computer device according to claim 13, wherein the smoothing curve fitting is performed on three coordinate points (0, 0), (127, 127 + drtb), and (255, 255) to obtain a brightness adjustment curve ,include:
    采用非均匀B样条曲线对(0,0)、(127,127+drtb)和(255,255)三个坐标点采用进行平滑曲线拟合,得到亮度调整曲线;A non-uniform B-spline curve is used to fit the three coordinate points (0, 0), (127, 127 + drtb), and (255, 255) to a smooth curve fitting to obtain the brightness adjustment curve;
    其中,非均匀B样条曲线的数学表达式为
    Figure PCTCN2018092652-appb-100004
    其中,P(K)为曲线上的位置向量,N i,m(K)为m次样条基函数,R i为权因子,P i为控制点,K为节点矢量。
    Among them, the mathematical expression of non-uniform B-spline curve is
    Figure PCTCN2018092652-appb-100004
    Wherein, P (K) is a position vector on the curve, N i, m (K) is the m-th spline base function, R i is a weighting factor, P i of the control points, K is knot vector.
  15. 一个或多个存储有计算机可读指令的非易失性可读存储介质,其特征在于,所述计算机可读指令被一个或多个处理器执行时,使得所述一个或多个处理器执行如下步骤:One or more non-volatile readable storage media storing computer readable instructions, characterized in that when the computer readable instructions are executed by one or more processors, the one or more processors are caused to execute The following steps:
    获取人脸图像,基于所述人脸图像获取目标检测区域;Acquiring a face image, and acquiring a target detection area based on the face image;
    获取所述目标检测区域中每一像素点的亮度值;Obtaining a brightness value of each pixel in the target detection area;
    采用图像自然亮度算法对所述亮度值进行处理,获取所述目标检测区域的平均自然亮度值;Processing the brightness value by using an image natural brightness algorithm to obtain an average natural brightness value of the target detection area;
    若所述平均自然亮度值不在预设自然亮度范围内,则基于所述平均自然亮度值构建亮度调整曲线,并采用所述亮度调整曲线对所述人脸图像进行亮度调整,获取目标图像。If the average natural brightness value is not within a preset natural brightness range, a brightness adjustment curve is constructed based on the average natural brightness value, and the brightness adjustment curve is used to perform brightness adjustment on the face image to obtain a target image.
  16. 如权利要求15所述的非易失性可读存储介质,其特征在于,所述基于所述人脸图像获取目标检测区域,包括:The non-volatile readable storage medium according to claim 15, wherein the acquiring a target detection area based on the face image comprises:
    采用人脸特征点检测算法检测所述人脸图像的面部特征点数据,所述面部特征点数据包括坐标数据和局部特征值;Using a facial feature point detection algorithm to detect facial feature point data of the face image, where the facial feature point data includes coordinate data and local feature values;
    根据所述坐标数据和所述局部特征值,提取所述人脸图像中的五官区域;Extracting facial features in the face image according to the coordinate data and the local feature value;
    根据所述五官区域中的鼻尖和双眼外眼角的坐标数据,获取所述目标检测区域。The target detection area is acquired according to the coordinate data of the tip of the nose and the corners of the eyes outside the eyes in the facial features area.
  17. 如权利要求16所述的非易失性可读存储介质,其特征在于,所述根据所述五官区域中的鼻尖和双眼外眼角的坐标数据,获取所述目标检测区域,包括:The non-volatile readable storage medium according to claim 16, wherein the obtaining the target detection area according to the coordinate data of the nose tip and the outer corners of the eyes in the facial features area comprises:
    基于所述鼻尖的坐标数据作一水平直线;Making a horizontal straight line based on the coordinate data of the nose tip;
    基于所述双眼外眼角的坐标数据和所述水平直线构建一矩形区域,将所述矩形区域确定为所述目标检测区域。A rectangular area is constructed based on the coordinate data of the outer corners of the eyes and the horizontal straight line, and the rectangular area is determined as the target detection area.
  18. 如权利要求15所述的非易失性可读存储介质,其特征在于,所述图像自然亮度算法的公式为:
    Figure PCTCN2018092652-appb-100005
    其中,N为目标检测区域的像素点数量,Lum ave为目标检测区域的平均自然亮度值,Lum(x,y)为目标检测区域的像素点(x,y)对应的亮度值,δ为常数。
    The non-volatile readable storage medium according to claim 15, wherein a formula of the image natural brightness algorithm is:
    Figure PCTCN2018092652-appb-100005
    Among them, N is the number of pixels in the target detection area, Lum ave is the average natural brightness value of the target detection area, Lum (x, y) is the brightness value corresponding to the pixel points (x, y) of the target detection area, and δ is a constant .
  19. 如权利要求15所述的非易失性可读存储介质,其特征在于,所述基于所述平均自然亮度值构建亮度调整曲线,并采用所述亮度调整曲线对所述人脸图像进行亮度调整,获取目标图像,包括:The non-volatile readable storage medium according to claim 15, wherein the brightness adjustment curve is constructed based on the average natural brightness value, and the brightness adjustment curve is used to perform brightness adjustment on the face image To obtain the target image, including:
    基于所述平均自然亮度值和预设的最佳亮度值,获取亮度调整值drtb;Obtaining a brightness adjustment value drtb based on the average natural brightness value and a preset optimal brightness value;
    对(0,0)、(127,127+drtb)和(255,255)三个坐标点进行平滑曲线拟合,得到亮度调整曲线;Perform smooth curve fitting on the three coordinate points (0,0), (127,127 + drtb) and (255,255) to obtain the brightness adjustment curve;
    根据所述亮度调整曲线调整所述人脸图像中每一像素点的亮度值,获取目标图像。Adjusting the brightness value of each pixel point in the face image according to the brightness adjustment curve to obtain a target image.
  20. 如权利要求19所述的非易失性可读存储介质,其特征在于,所述对(0,0)、(127,127+drtb)和(255,255)三个坐标点进行平滑曲线拟合,得到亮度调整曲线,包括:The non-volatile readable storage medium according to claim 19, wherein the smoothing curve fitting is performed on three coordinate points (0, 0), (127, 127 + drtb), and (255, 255) Combine to get the brightness adjustment curve, including:
    采用非均匀B样条曲线对(0,0)、(127,127+drtb)和(255,255)三个坐标点采用进行平滑曲线拟合,得到亮度调整曲线;A non-uniform B-spline curve is used to fit the three coordinate points (0, 0), (127, 127 + drtb), and (255, 255) to a smooth curve fitting to obtain the brightness adjustment curve;
    其中,非均匀B样条曲线的数学表达式为
    Figure PCTCN2018092652-appb-100006
    其中,P(K)为曲线上的位置向量,N i,m(K)为m次样条基函数,R i为权因子,P i为控制点,K为节点矢量。
    Among them, the mathematical expression of non-uniform B-spline curve is
    Figure PCTCN2018092652-appb-100006
    Wherein, P (K) is a position vector on the curve, N i, m (K) is the m-th spline base function, R i is a weighting factor, P i of the control points, K is knot vector.
PCT/CN2018/092652 2018-06-06 2018-06-25 Face brightness adjustment method and apparatus, computer device and storage medium WO2019232834A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201810573812.3 2018-06-06
CN201810573812.3A CN108961175B (en) 2018-06-06 2018-06-06 Face brightness adjusting method and device, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
WO2019232834A1 true WO2019232834A1 (en) 2019-12-12

Family

ID=64492990

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/092652 WO2019232834A1 (en) 2018-06-06 2018-06-25 Face brightness adjustment method and apparatus, computer device and storage medium

Country Status (2)

Country Link
CN (1) CN108961175B (en)
WO (1) WO2019232834A1 (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113221618A (en) * 2021-01-28 2021-08-06 深圳市雄帝科技股份有限公司 Method, system and storage medium for removing highlight of face image
CN114612320A (en) * 2022-03-04 2022-06-10 业成科技(成都)有限公司 Image brightness optimization method and device, computer equipment and storage medium
CN115086632A (en) * 2022-05-23 2022-09-20 奥比中光科技集团股份有限公司 Three-dimensional image system, gain adjustment method for image sensor, and storage medium
CN115086632B (en) * 2022-05-23 2024-05-31 奥比中光科技集团股份有限公司 Three-dimensional image system, gain adjustment method for image sensor, and storage medium

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109859142B (en) * 2019-02-19 2021-06-22 广州视源电子科技股份有限公司 Image brightness adjusting method and device, computer equipment and storage medium
CN110689488B (en) * 2019-08-22 2022-03-04 稿定(厦门)科技有限公司 Image toning method, medium, device and apparatus
CN110706161B (en) * 2019-08-22 2022-07-19 稿定(厦门)科技有限公司 Image brightness adjusting method, medium, device and apparatus
CN111047533B (en) * 2019-12-10 2023-09-08 成都品果科技有限公司 Beautifying method and device for face image
CN112991469A (en) * 2019-12-17 2021-06-18 上海光启智城网络科技有限公司 Face brightness compensation method and device and computer readable storage medium
CN112969022B (en) * 2021-01-29 2023-09-01 新东方教育科技集团有限公司 Camera adjustment method, system, storage medium and electronic equipment
CN113034382B (en) * 2021-02-23 2024-04-30 深圳市创想三维科技股份有限公司 Brightness uniformity adjustment method, brightness uniformity adjustment device, computer device, and readable storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1671187A (en) * 2004-03-15 2005-09-21 德鑫科技股份有限公司 Method of exposure correction for digital image
US20050213814A1 (en) * 2004-03-23 2005-09-29 Albert Lin Method for adjusting image contrast

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1671187A (en) * 2004-03-15 2005-09-21 德鑫科技股份有限公司 Method of exposure correction for digital image
US20050213814A1 (en) * 2004-03-23 2005-09-29 Albert Lin Method for adjusting image contrast

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
HOU, JUNYAN: "Application Research about Finite Element Method on 3d Facial Modeling", CHINESE MASTER'S THESES FULL-TEXT DATABASE, INFORMATION SCIENCE AND TECHNOLOGY, vol. 2011, no. 5, 15 May 2011 (2011-05-15), pages 30 - 48, ISSN: 1674-0246 *
REINHARD, ERIK: "Photographic Tone Reproduction for Digital Images", ACM TRANSACTIONS ON GRAPHICS, 1 July 2002 (2002-07-01), pages 267 - 276, XP058188577, ISSN: 0730-0301, DOI: 10.1145/566570.566575 *

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113221618A (en) * 2021-01-28 2021-08-06 深圳市雄帝科技股份有限公司 Method, system and storage medium for removing highlight of face image
CN113221618B (en) * 2021-01-28 2023-10-17 深圳市雄帝科技股份有限公司 Face image highlight removing method, system and storage medium thereof
CN114612320A (en) * 2022-03-04 2022-06-10 业成科技(成都)有限公司 Image brightness optimization method and device, computer equipment and storage medium
CN114612320B (en) * 2022-03-04 2023-09-29 业成科技(成都)有限公司 Image brightness optimization method, device, computer equipment and storage medium
CN115086632A (en) * 2022-05-23 2022-09-20 奥比中光科技集团股份有限公司 Three-dimensional image system, gain adjustment method for image sensor, and storage medium
CN115086632B (en) * 2022-05-23 2024-05-31 奥比中光科技集团股份有限公司 Three-dimensional image system, gain adjustment method for image sensor, and storage medium

Also Published As

Publication number Publication date
CN108961175B (en) 2023-04-07
CN108961175A (en) 2018-12-07

Similar Documents

Publication Publication Date Title
WO2019232834A1 (en) Face brightness adjustment method and apparatus, computer device and storage medium
WO2019232860A1 (en) Image brightness adjustment method, apparatus, computer device and storage medium
WO2018036462A1 (en) Image segmentation method, computer apparatus, and computer storage medium
CN109829930B (en) Face image processing method and device, computer equipment and readable storage medium
KR102417043B1 (en) Background modification in video conferencing
US10540749B2 (en) System and method for learning-based image super-resolution
WO2022199583A1 (en) Image processing method and apparatus, computer device, and storage medium
US8983152B2 (en) Image masks for face-related selection and processing in images
WO2019137038A1 (en) Method for determining point of gaze, contrast adjustment method and device, virtual reality apparatus, and storage medium
WO2021175180A1 (en) Line of sight determination method and apparatus, and electronic device and computer-readable storage medium
WO2019223068A1 (en) Iris image local enhancement method, device, equipment and storage medium
US10929982B2 (en) Face pose correction based on depth information
WO2019232871A1 (en) Glasses virtual wearing method and apparatus, and computer device and storage medium
US10892166B2 (en) System and method for light field correction of colored surfaces in an image
WO2021218603A1 (en) Image processing method and projection system
WO2020135234A1 (en) Image processing method and apparatus
WO2022135574A1 (en) Skin color detection method and apparatus, and mobile terminal and storage medium
WO2017092593A1 (en) Method, apparatus and device for adjusting fusion material
WO2021189770A1 (en) Image enhancement processing method and apparatus based on artificial intelligence, and device and medium
CN110580693A (en) Image processing method, image processing device, computer equipment and storage medium
CN111369478B (en) Face image enhancement method and device, computer equipment and storage medium
WO2020168807A1 (en) Image brightness adjusting method and apparatus, computer device, and storage medium
WO2023273247A1 (en) Face image processing method and device, computer readable storage medium, terminal
WO2019223066A1 (en) Global enhancement method, device and equipment for iris image, and storage medium
WO2023103813A1 (en) Image processing method and apparatus, device, storage medium, and program product

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 18921375

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 12.03.2021)

122 Ep: pct application non-entry in european phase

Ref document number: 18921375

Country of ref document: EP

Kind code of ref document: A1