Live light control method, system and terminal
By using an automated lighting adjustment method based on live image analysis and brightness difference adjustment, the problem of complex manual lighting adjustment in live streaming scenarios has been solved, achieving efficient and convenient lighting effect optimization.
Patent Information
- Application Number
- CN202511242039.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-02
- Publication Date
- 2025-11-25
- Estimated Expiration
- 2045-09-02
AI Technical Summary
In existing technologies, lighting adjustments in live streaming scenarios require manual adjustments, which are complex, cumbersome, inefficient, and highly dependent on the experience of the staff, making it difficult to guarantee the best lighting effect.
By capturing live images, the images are divided into face areas, background areas, and other adjustment areas. The brightness values of each area are calculated, and the light intensity is automatically adjusted according to the brightness differences to achieve the preset brightness requirements. This process includes using face recognition and image segmentation technology to divide the areas, combining Gaussian weights to calculate the brightness values, and using a cyclical light control process for automatic adjustment.
It enables efficient and convenient adjustment of live streaming lights, reduces manual operation time, ensures optimal lighting effects, and improves live streaming quality.
Smart Images

Figure CN120751540B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application belongs to the field of live broadcast, and relates to a light adjustment technology, in particular to a live broadcast light control method, system and terminal. BACKGROUND
[0002] For a live broadcast scene, the brightness and distribution of light have a great influence on the live broadcast effect. Generally, light needs to be concentrated on the faces of the main live broadcast personnel, and in order to ensure the atmosphere and effect of live broadcast, the face needs to have certain light and dark changes.
[0003] In the prior art, the adjustment method of live broadcast light is usually manual adjustment of the brightness of light by staff, which is complex and time-consuming, has low efficiency, is greatly affected by the experience of staff, and it is difficult to ensure whether the final light effect is in the best state.
[0004] Therefore, how to realize efficient and convenient adjustment of live broadcast light is a technical problem to be solved by those skilled in the art. SUMMARY
[0005] The purpose of the present application is to provide a live broadcast light control method, system and terminal, which solves the problem that in the prior art, the adjustment of live broadcast scene light needs manual adjustment by staff, which is complex and time-consuming, and has low efficiency.
[0006] In a first aspect, the present application provides a live broadcast light control method, which is a cycle light regulation process, and when the light regulation process is executed once, the method comprises:
[0007] acquiring a current live broadcast image;
[0008] dividing the live broadcast image into each adjustment region and calculating the current brightness value of each adjustment region;
[0009] based on the target brightness value corresponding to each adjustment region, combining the current brightness value of each adjustment region, calculating the brightness difference corresponding to each adjustment region respectively, if each brightness difference meets the preset brightness requirement, stopping the light regulation; otherwise, based on the preset light adjustment strategy, adjusting the light intensity of the corresponding light group, and re-executing the light regulation process;
[0010] wherein each adjustment region includes a first region and a second region, and the acquisition method of the first region and the second region comprises: performing face recognition on the live broadcast image, acquiring at least one face region, and dividing each face region into a first sub-region and a second sub-region; wherein the first region is a collection of each first sub-region, and the second region is a collection of each second sub-region.
[0011] In an embodiment of the present application, for any of the face regions, the manner of obtaining the first sub-region and the second sub-region comprises:
[0012] Obtaining the total number of pixels of the face region, and calculating a corresponding total number of pixel half value;
[0013] Based on the total number of pixel half value, calculating the number of half columns to obtain, so that the columns of the first side of the face region with the number of half columns are taken as the first sub-region, and the remaining columns are taken as the second sub-region, or, so that the columns of the second side of the face region with the number of half columns are taken as the second sub-region, and the remaining columns are taken as the first sub-region;
[0014] Wherein, the number of half columns is the minimum value of the number of continuous columns of the first side or the second side of the face region corresponding to the total number of pixels not less than the total number of pixel half value.
[0015] In an embodiment of the present application, each of the adjustment regions further comprises a background region, and the manner of obtaining the background region comprises: performing face recognition on the live image to obtain each of the face regions; based on each of the face regions, taking the remaining region of the live image as the background region.
[0016] In an embodiment of the present application, the manner of obtaining each of the face regions and the background region comprises:
[0017] Performing face detection on the live image to obtain at least one face frame range;
[0018] Performing image segmentation on each of the face frame ranges to obtain each of the corresponding foreground images;
[0019] For any of the foreground images, extracting all the pixels corresponding thereto to form the corresponding face region; after traversing each of the foreground images, extracting all the pixels remaining in the live image to form the corresponding background region.
[0020] In an embodiment of the present application, the current corresponding brightness value of the first region is a first weighted brightness value; the current corresponding brightness value of the second region is a second weighted brightness value; the calculation manner of the second weighted brightness value is the same as that of the first weighted brightness value, and the calculation manner of the first weighted brightness value comprises:
[0021] Obtaining the brightness value of each pixel in each of the first sub-regions, and calculating the brightness mean value of each of the first sub-regions;
[0022] Based on the weight of each of the first sub-regions, calculating the weighted average value of each of the brightness mean values, so that the weighted average value is taken as the first weighted brightness value;
[0023] The current luminance value corresponding to the background region is a background luminance value; and a calculation manner of the background luminance value comprises:
[0024] The luminance values of the pixels in the background region are acquired, and a luminance average of the background region is calculated, so as to take the luminance average as the background luminance value.
[0025] In an embodiment of the present application, the weight of each first sub-region and the weight of each second sub-region are weights corresponding to each face region; and a calculation manner of the weight corresponding to each face region comprises:
[0026] The width and height of each face frame range are acquired, so as to calculate the area of each face frame range;
[0027] Based on a preset Gaussian weight calculation formula, the weight corresponding to each face region is acquired in combination with the area of each face frame range.
[0028] In an embodiment of the present application, the target luminance value corresponding to the first region is a first target luminance value, the absolute value of the difference between the first target luminance value and the first weighted luminance value is a first luminance difference; the target luminance value corresponding to the second region is a second target luminance value, the absolute value of the difference between the second target luminance value and the second weighted luminance value is a second luminance difference; the target luminance value corresponding to the background region is a background target luminance value, the absolute value of the difference between the background target luminance value and the background luminance value is a background luminance difference; and the light adjustment strategy comprises:
[0029] When the first luminance difference does not satisfy the luminance requirement, if the first luminance difference is greater than a first step length saturation threshold, the light luminance of a first lamp group is adjusted based on a preset first aggressive step length; otherwise, a first conservative step length is calculated based on a preset first minimum step length in combination with the first luminance difference, and the light luminance of the first lamp group is adjusted based on the first conservative step length;
[0030] When the second luminance difference does not satisfy the luminance requirement, if the second luminance difference is greater than a second step length saturation threshold, the light luminance of a second lamp group is adjusted based on a preset second aggressive step length; otherwise, a second conservative step length is calculated based on a preset second minimum step length in combination with the second luminance difference, and the light luminance of the second lamp group is adjusted based on the second conservative step length;
[0031] When the background luminance difference does not satisfy the luminance requirement, if the background luminance difference is greater than a background step length saturation threshold, the light luminance of a background lamp group is adjusted based on a preset background aggressive step length; otherwise, a background conservative step length is calculated based on a preset background minimum step length in combination with the background luminance difference, and the light luminance of the background lamp group is adjusted based on the background conservative step length.
[0032] In a second aspect, the present application provides a live light control system, comprising an image acquisition module, a brightness analysis module and a light adjustment module;
[0033] The image acquisition module is configured to acquire a current live image.
[0034] The brightness analysis module is configured to divide the live image into multiple adjustment regions and calculate current brightness values of the multiple adjustment regions.
[0035] The light adjustment module is connected to multiple light groups and is configured to calculate, based on target brightness values corresponding to the multiple adjustment regions, brightness differences corresponding to the multiple adjustment regions respectively in combination with the current brightness values of the multiple adjustment regions, stop light adjustment and control if the multiple brightness differences all meet a preset brightness requirement, and adjust light intensities of corresponding light groups based on a preset light adjustment strategy and re-execute the light adjustment and control process otherwise.
[0036] In the present application, each of the multiple adjustment regions includes a first region and a second region, the brightness analysis module includes a face recognition sub-module, the face recognition sub-module is configured to perform face recognition on the live image, obtain at least one face region, and divide each of the face regions into a first sub-region and a second sub-region, wherein the first region is a collection of the first sub-regions and the second region is a collection of the second sub-regions.
[0037] In an embodiment of the present application, each of the multiple adjustment regions further includes a background region, and the face recognition sub-module includes a face detection unit, an image segmentation unit and an extraction unit.
[0038] The face detection unit is configured to perform face detection on the live image and obtain at least one face frame range.
[0039] The image segmentation unit is configured to perform image segmentation on each of the face frame ranges and obtain corresponding foreground images.
[0040] The extraction unit is configured to extract all pixels corresponding to any foreground image to form a corresponding face region, and extract all pixels remaining in the live image after traversing all the foreground images to form a corresponding background region.
[0041] In a third aspect, the present application provides a terminal, comprising a processor and a memory in communication connection with the processor.
[0042] The memory is configured to store a computer program, and the processor is configured to execute the computer program stored in the memory to enable the terminal to perform the live light control method as described above.
[0043] As described above, this application provides a live streaming lighting control method, system, and terminal. By extracting the current brightness of each adjustment area in the live streaming image and comparing the current brightness with its corresponding preset brightness to obtain the brightness difference between the two, the light intensity of the corresponding light group is adjusted according to the preset lighting adjustment strategy based on the brightness difference, so that each area ultimately meets the preset brightness requirements, thereby achieving the lighting requirements required for live streaming. This not only achieves good lighting effects but is also convenient and quick to operate, eliminating the need for manual adjustment by staff, saving a lot of time and costs, and has high industrial application value. Attached Figure Description
[0044] Figure 1 The image shown is a schematic diagram of a live streaming scene for adjusting lighting as described in this application.
[0045] Figure 2 The diagram shown is a flowchart illustrating a live streaming lighting control method according to an embodiment of this application.
[0046] Figure 3 The diagram shown is a schematic diagram of a first sub-region and a second sub-region in a face region as described in an embodiment of this application.
[0047] Figure 4 The diagram shows a flowchart illustrating a method for obtaining a first sub-region and a second sub-region as described in an embodiment of this application.
[0048] Figure 5 This is a schematic diagram illustrating another live streaming scene for adjusting lighting as described in this application.
[0049] Figure 6 The diagram shows a flowchart illustrating the method for obtaining a background area and various face areas as described in an embodiment of this application.
[0050] Figure 7 The diagram shown is a schematic representation of the extraction and recognition results of a face region and a background region as described in an embodiment of this application.
[0051] Figure 8 The diagram shown is a flowchart illustrating a method for obtaining a first weighted brightness value as described in an embodiment of this application.
[0052] Figure 9 The diagram shows a flowchart illustrating a method for obtaining the weights corresponding to each face region as described in an embodiment of this application.
[0053] Figure 10 The diagram shown is a flowchart illustrating a process for adjusting lighting effects based on a preset lighting adjustment strategy, as described in an embodiment of this application.
[0054] Figure 11 The image shown is a schematic diagram of the live streaming screen effect before and after adjustment based on the live streaming lighting control method described in this application.
[0055] Figure 12 The diagram shown is a structural schematic of a live streaming lighting control system according to an embodiment of this application.
[0056] Figure 13 The diagram shown is a structural schematic of a face recognition submodule as described in an embodiment of this application.
[0057] Figure 14 The diagram shown is a structural schematic of a terminal as described in an embodiment of this application.
[0058] Explanation of reference numerals in the attached figures
[0059] 11: First light group; 12: Second light group; 13: Background light group; 51: Image acquisition module; 52: Brightness analysis module; 521: Face recognition submodule; 5211: Face detection unit; 5212: Image segmentation unit; 5213: Extraction unit; 53: Lighting adjustment module; 60: Terminal; 61: Processor; 62: Memory; 621: Operating system; 622: Application program; 63: User interface; 64: Network interface; 65: Bus system. Detailed Implementation
[0060] The following specific examples illustrate the implementation of this application. Those skilled in the art can easily understand other advantages and effects of this application from the content disclosed in this specification. This application can also be implemented or applied through other different specific embodiments, and various details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of this application. It should be noted that, unless otherwise specified, the following embodiments and features in the embodiments can be combined with each other.
[0061] It should be noted that the illustrations provided in the following embodiments are only schematic representations of the basic concept of this application. Therefore, the drawings only show the components related to this application and are not drawn according to the actual number, shape and size of the components in the actual implementation. In the actual implementation, the form, quantity and proportion of each component can be arbitrarily changed, and the layout of the components may also be more complex.
[0062] The control of live streaming lighting has a significant impact on the live streaming effect. In the current technology, the lighting is often adjusted manually by staff to achieve the desired effect. This is not only complicated and time-consuming, but also highly dependent on the experience of the staff, which may result in the final lighting effect not being optimal, thus affecting the live streaming effect.
[0063] To address the technical problems existing in the prior art, the following embodiments of this application provide a live streaming lighting control method, system, and terminal. By dividing the live streaming image into various adjustment areas and calculating the current brightness value of each adjustment area, brightness modulation is performed based on the difference between the value and the corresponding preset brightness, so that each area ultimately meets the preset brightness requirements, thereby enabling each adjustment area to form a preset brightness and darkness effect to achieve a good lighting effect.
[0064] The following embodiments of this application provide a live streaming lighting control method, system, and terminal, including but not limited to lighting effect adjustment applied to live streaming by multiple people or a single person. The following description will take lighting effect adjustment during live streaming by at least one person as an example.
[0065] In live streaming scenarios, multiple lights are typically placed in different directions. This is generally suitable for lighting setups in live streaming studios. Light groups can be placed on both sides of the streamer to create main and fill lights, thus achieving the desired live streaming effect. To facilitate understanding of the lighting control scenario described in this application by those skilled in the art, an example is provided, such as... Figure 1 As shown, the system includes a first light group 11 and a second light group 12. The first light group 11 provides light to the live streamer from a first side; the second light group 12 provides light to the live streamer from a second side. By providing light from different directions to the live streamer using the first light group 11 and the second light group 12, a live stream scene with desired brightness variations can be created, thereby achieving a better live stream effect. For example, the first side is the left side, meaning the first light group 11 is located to the left of the live streamer, and the second side is the right side, meaning the second light group 12 is located to the right of the live streamer. Furthermore, both the first light group 11 and the second light group 12 include at least one light source, and their brightness is adjustable.
[0066] Therefore, in order to conveniently and efficiently adjust the live broadcast lights and achieve good lighting effects, this embodiment provides a live broadcast light control method to control the lights to achieve preset effects.
[0067] The technical solutions in the embodiments of this application will be described in detail below with reference to the accompanying drawings.
[0068] like Figure 2 As shown, this embodiment provides a live streaming lighting control method for adjusting the brightness of each light group in a live streaming scene, thereby adjusting the overall lighting effect of the live streaming scene. This live streaming lighting control method is a cyclic lighting adjustment process, obtaining the lighting effect after each adjustment, determining whether it meets the lighting requirements for live streaming, and adjusting the lighting based on the current lighting effect when the lighting requirements are not met, thereby ultimately achieving the preset lighting effect.
[0069] Specifically, during a single execution of a lighting control process, the following are included:
[0070] S100 captures the current live image.
[0071] The current live image is either the initial live image captured in the live room or a live image re-acquired after the previous lighting adjustment process was completed, so as to obtain the current live lighting conditions through the current live image.
[0072] For example, live streaming images can be captured using a live streaming camera, live streaming camera, or the like.
[0073] S200, the live image is divided into adjustment regions, and the current brightness value of each adjustment region is calculated and obtained.
[0074] Each adjustment zone is a region divided based on a preset division strategy. The lights corresponding to each adjustment zone are adjusted to the required brightness to create changes in brightness in the live broadcast image.
[0075] For example, each adjustment region includes regions segmented based on faces. Since the live streamers are responsible for the main content of the broadcast, and their faces are typically considered the primary focus area, facial regions of each live streamer are extracted for subsequent brightness adjustment. Specifically, all faces are extracted using facial recognition technology as facial regions, and then divided into adjustment regions based on a preset segmentation strategy.
[0076] It should be noted that, to achieve better live streaming results, the brightness on the streamer's face is not uniformly distributed; a certain degree of variation in light and shadow is usually required to ensure a better live streaming atmosphere. Based on this, each facial area is divided to ensure that each area meets preset brightness requirements, thereby creating the necessary light and shadow variations for live streaming and improving the overall effect.
[0077] Based on this, in some optional embodiments, each adjustment region includes a first region and a second region. The first region is a set of first sub-regions in the live stream image, and the second region is a set of second sub-regions in the live stream image. The first and second sub-regions correspond one-to-one, each being two sub-regions divided based on the same face region in the live stream image. Each face region is a region formed by a single face; that is, for any face region in the live stream image, it is divided into a first sub-region and a second sub-region to form the first and second regions.
[0078] The first sub-region is the sub-region of the face region on the first side, and the second sub-region is the sub-region of the face region on the second side.
[0079] Generally, the brightness changes during live streaming typically occur from left to right. Based on this, the face region is divided into two sub-regions, designated as the first and second sub-regions, with the brightness change occurring between them. Furthermore, the first and second sub-regions corresponding to the same face region are two parts of equal area. For example,... Figure 3 As shown, the face region is divided into two sub-regions: the left half of the face and the right half of the face, which are designated as the first and second sub-regions, respectively. The left half of the face is the first sub-region, and the right half of the face is the second sub-region.
[0080] In some alternative implementations, such as Figure 4 As shown, for any face region, the methods for obtaining the first sub-region and the second sub-region include:
[0081] S211, obtain the total number of pixels in the face region and calculate the corresponding half value of the total number of pixels.
[0082] The total number of pixels is half of the total number of pixels in the face region.
[0083] S212, based on half the total number of pixels, calculate and obtain the number of columns of half the frame, so that each column of the consecutive half-frame columns on the first side of the face region is taken as the first sub-region and the remaining columns are taken as the second sub-region, or, each column of the consecutive half-frame columns on the second side of the face region is taken as the second sub-region and the remaining columns are taken as the first sub-region.
[0084] Among them, the total number of pixels in each column of the consecutive half-frame columns on the first or second side of the face region is the minimum value that is not less than half the total number of pixels. That is, calculate the total number of pixels accumulated in each column starting from the first column on the first or second side of the face region, and take the minimum value of the column number when the total number of pixels exceeds half the total number of pixels as the half-frame column number.
[0085] Specifically, taking the first side of the face region as an example, the total number of pixels in the first column of the face region on the first side is obtained. If it exceeds half the total number of pixels, the number of columns in half is 1. Otherwise, one column of pixels is added. That is, the sum of the number of pixels in the first and second columns of the face region on the first side is obtained as the total number of pixels. If it exceeds half the total number of pixels, the number of columns in half is 2. Otherwise, one column of pixels is added. That is, the sum of the number of pixels in the first to third columns of the face region on the first side is obtained as the total number of pixels. If it exceeds half the total number of pixels, the number of columns in half is 3. And so on, to obtain the number of columns in half.
[0086] Each column of the first half of the face region is taken as the first sub-region. That is, if the number of columns of the half is n, each column of the face region from the first column to the nth column on the first side is taken as the first sub-region, and the remaining columns are taken as the second sub-region. That is, each column of the face region from the (n+1)th column to the last column on the first side is taken as the second sub-region.
[0087] Based on this, each face region can be quickly and easily divided to extract each adjustment region, and then the lighting can be adjusted based on these regions to achieve the desired brightness and darkness effect in the live broadcast.
[0088] Alternatively, based on half the total number of pixels, starting from the first column on the second side of each face region, the number of columns in half the frame can be calculated. Each column of a consecutive half-frame on the second side of the face region can be considered the second sub-region, and the remaining columns can be considered the first sub-region. The total number of pixels corresponding to each column of a consecutive half-frame on the second side of the face region is not less than the minimum value of half the total number of pixels. For details, please refer to the aforementioned division method; this embodiment will not elaborate further.
[0089] Based on this, a first region is formed based on each set of first sub-regions, and a second region is formed based on each set of second sub-regions. By obtaining the current brightness values of the first and second regions, it is tested whether they meet the preset brightness requirements, and the corresponding lighting is adjusted accordingly.
[0090] In some alternative implementations, such as Figure 5 As shown, in order to adjust the background in the live broadcast, a background light group 13 can also be set in the live broadcast scene. The background light group 13 is located behind the live broadcast personnel and is used to provide lighting for the live broadcast background, so as to further adjust the lighting in the live broadcast and achieve a better live broadcast effect.
[0091] Based on this, each of the adjustment regions also includes a background region, wherein the background region is the region remaining in the live image excluding each face region.
[0092] For example, this embodiment uses a face detection model trained based on a pre-trained neural network model framework to detect the faces of each live streamer, forming face regions, and using the remaining regions in the live stream image as background regions. The pre-trained neural network models include, but are not limited to, YOLO series neural network models, MTCNN neural network models, and SSD series neural network models.
[0093] It should be noted that the face detection model detects a region that includes the face. Since this region is usually square, the face region obtained by the face detection module alone will include some background content, affecting the accuracy of subsequent brightness calculations for the background region and each face region. Therefore, in some optional implementations, such as... Figure 6 As shown, the methods for obtaining the background area and each face region include:
[0094] S221, Perform face detection on the live image and obtain at least one face bounding box.
[0095] Specifically, a face detection model trained based on a neural network model framework is used to detect the faces of each person in the live stream, and the detected square areas are used as the bounding boxes for the faces. For example, the neural network model is a YOLOv8 neural network model, a general-purpose object detection model used to locate faces in live stream images and extract facial features.
[0096] S222, Perform image segmentation on the bounding box of each face to obtain the corresponding foreground images.
[0097] Each foreground image is used to represent a face image that does not include background content. Foreground images are obtained through image segmentation, thereby excluding the background that is extracted simultaneously with the face after detection by the face detection model, thus enhancing the accuracy of face recognition and improving the accuracy of background region and face region segmentation.
[0098] For example, this embodiment uses a pre-trained neural network model to segment the bounding boxes of each face to obtain the corresponding foreground images. The pre-trained neural network model includes, but is not limited to, PSPNet, BiSeNet, ICNet, and UNet neural network models.
[0099] Optionally, this embodiment uses the UET neural network model for image segmentation to obtain each foreground image. The UET neural network model is a convolutional neural network with an encoder-decoder structure. It achieves high-precision pixel-level segmentation by skip connections and fusing shallow details and deep semantic information.
[0100] It should be noted that the foreground images output by the UET neural network model after segmentation are ARGB images. The non-face content within the bounding box of each face, i.e., the part belonging to the background area, has an opacity set to 1.
[0101] S223, for any foreground image, extract all its corresponding pixels to form the corresponding face region; after traversing each foreground image, extract all remaining pixels of the live image to form the corresponding background region.
[0102] Specifically, all pixels covered by each foreground image are taken as pixels of each face region, and all pixels not covered in the live image are taken as pixels of the background region.
[0103] In one specific implementation, the method for extracting all corresponding pixels for each foreground image is as follows: For the current foreground image, extract all pixels with transparency not greater than a preset transparency threshold, and use them as all pixels within the corresponding face region. For example, the transparency threshold is 0.2.
[0104] In one specific implementation, the method for extracting all pixels of the background region is as follows: extract each pixel in the live image that does not overlap with any face region, and use it as the pixel point of the background region. The method is to determine whether the pixel point overlaps with the face region by using the coordinates of the pixel point. If the coordinates of the pixel point do not overlap with the coordinates of any pixel in any face region, then it does not overlap with any face region.
[0105] Based on this, the extracted background area actually includes all areas in the live image except for the face areas.
[0106] Based on this, image segmentation is used to exclude pixels belonging to the background region within the bounding box of each face, thereby ensuring that no background pixels are present in any face region, thus improving the accuracy of subsequent brightness adjustment. For example, please refer to... Figure 7 The left side represents the background region extracted based on live image recognition, and the right side represents the face region extracted based on live image recognition. Further, each extracted face region is divided into a first sub-region and a second sub-region, which are then combined to form the first and second regions, respectively. Based on the divided background region, the first region, and the second region, the corresponding brightness values are calculated to test whether they meet the preset brightness requirements, and appropriate lighting adjustments are made. The specific execution method for dividing the first and second sub-regions and forming the first and second regions is described above and will not be repeated here.
[0107] The brightness value of the first region is a first weighted brightness value, and the brightness value of the second region is a second weighted brightness value. Specifically, since the influence of each face region on the live broadcast effect is different, the first weighted brightness value is obtained by weighting the average brightness value of each first sub-region, and the second weighted brightness value is obtained by weighting the average brightness value of each second sub-region.
[0108] For example, the calculation method for the second weighted brightness value is the same as that for the first weighted brightness value. Taking the first weighted brightness value as an example, the specific calculation method for the weighted brightness value is explained below. Specifically, as follows... Figure 8As shown, the calculation method for the first weighted brightness value includes:
[0109] S231, obtain the brightness value of each pixel in each first sub-region, and calculate the average brightness value of each first sub-region.
[0110] Specifically, the live image is converted into a grayscale image, and the brightness value of each pixel is the grayscale value of each pixel.
[0111] The average brightness of each first sub-region is the average of the brightness values of all pixels it covers. For example, the formula for calculating the average brightness of each first sub-region is:
[0112]
[0113] in, For the first The average brightness of the first sub-region For the first sub-region The brightness value of each pixel. For the first The total number of pixels in the first sub-region.
[0114] S232, based on the weight of each first sub-region, calculate the weighted average of each brightness mean, and use the weighted average as the first weighted brightness value.
[0115] Specifically, the first weighted brightness value is calculated as follows:
[0116]
[0117] in, The first weighted brightness value, For the first The weights corresponding to the first sub-regions For the first The average brightness of the first sub-region This represents the number of the first sub-regions in the live image.
[0118] It's important to note that when multiple people are involved in a live stream, the main streamer is usually closer to the camera. In other words, the closer a face is to the camera in the live stream image, the greater its impact on the streaming quality. Since faces closer to the camera have larger bounding boxes, to achieve better streaming results, the weight of lighting adjustments increases with the size of each face bounding box. This enhances the influence of faces closer to the camera on the lighting adjustment results. Specifically, the weight of each face region is determined based on the area of its bounding box, and this weight is used as the weight of its corresponding first sub-region.
[0119] Specifically, based on the area of each face bounding box, the weight of each corresponding face region is calculated and used as the weight of the corresponding first sub-region. For example, as shown... Figure 9 As shown, the calculation method for the weights corresponding to each face region includes:
[0120] S2321, obtain the width and height of each face frame range to calculate the area of each face frame range.
[0121] Specifically, since each face frame is a square area, the product of the width and height of each face frame is used as the area of the corresponding face frame. Specifically, the number of pixels in each row of each face frame is used as the width of the face frame, and the number of pixels in each column of each face frame is used as the height of the face frame.
[0122] S2322, based on a preset Gaussian weight calculation formula, combines the area of each face bounding box to obtain the weight of each corresponding face region.
[0123] Specifically, based on preset standard deviation and center position parameters, the weights corresponding to each face region are calculated using a Gaussian distribution. The center position parameter is the maximum area of each face frame, ensuring that the face region with the largest area receives the highest weight. The standard deviation parameter characterizes the degree to which the weight changes with area, thereby altering the influence of face regions with different frame sizes on lighting adjustment. Those skilled in the art can set the standard deviation parameter according to actual needs; this embodiment does not impose specific limitations. For example, if it is necessary to enhance the influence of face regions with larger frame areas on the lighting adjustment result, a smaller standard deviation parameter is set; if it is necessary to reduce the influence of face regions with larger frame areas on the lighting adjustment result, a larger standard deviation parameter is set.
[0124] For example, the formula for calculating the weight of each face region is as follows:
[0125]
[0126] in, For the first The weights corresponding to individual facial regions For the first The area corresponding to the individual's face frame. For the center position parameter, specifically, This represents the maximum area of the bounding box for each face. This is the standard deviation parameter, which can be set by those skilled in the art based on actual needs.
[0127] In some alternative implementations, the weights corresponding to each face region can be calculated as follows: obtain the number of pixels in each face region to represent the area of each face region, and obtain the weights corresponding to each face region based on the number of pixels in each face region and a preset Gaussian weight calculation formula. For the specific settings of the Gaussian weight calculation formula, please refer to the foregoing content, which will not be repeated here.
[0128] Based on this, the weight of each first sub-region is obtained based on the area of each face bounding box, and the first weighted brightness value is calculated to characterize the brightness of the first region under the current lighting effect.
[0129] Furthermore, the weighted average of the brightness mean of each second sub-region is obtained as the second weighted brightness value. The weight of each second sub-region is the same as the weight of the first sub-region of the same face region. That is, the weight of each face region is determined based on the area of each face frame, so that the weight of each face region is used as the weight of the corresponding first sub-region. The method for obtaining the second weighted brightness value is the same as the method for obtaining the first weighted brightness value. This embodiment will not be described in detail here.
[0130] In some optional implementations, the current brightness value corresponding to the background area is the background brightness value. The calculation method of the background brightness value includes: obtaining the brightness value of each pixel in the background area, and calculating the average brightness value of the background area, so as to use the average brightness value as the background brightness value, that is, the background brightness value is the average value obtained by dividing the sum of the brightness values of each pixel in the background area by the total number of pixels in the background area.
[0131] Based on this, the brightness of the first region, the second region, and the background region can be obtained by using the first weighted brightness value, the second weighted brightness value, and the background brightness value, thereby analyzing whether the current lighting effect meets the lighting requirements and making corresponding adjustments.
[0132] S300: Based on the target brightness value corresponding to each adjustment area and the current brightness value of each adjustment area, calculate the brightness difference corresponding to each adjustment area. If each brightness difference meets the preset brightness requirement, stop the light control; otherwise, based on the preset light control strategy, adjust the light intensity of the corresponding light group and re-execute the light control process.
[0133] Specifically, based on the preset first target brightness value, second target brightness value, and background target brightness value, and combined with the first weighted brightness value, second weighted brightness value, and background brightness value, the first brightness difference, second brightness difference, and background brightness difference are calculated respectively. If the first brightness difference, second brightness difference, and background brightness difference all meet the preset brightness requirements, the light control is stopped; otherwise, based on the preset light adjustment strategy, the light intensity of the corresponding light group is adjusted, and the light control process is re-executed.
[0134] The first target brightness value is used to characterize the ideal value of the first weighted brightness value when the lighting requirements for live streaming are met; the second target brightness value is used to characterize the ideal value of the second weighted brightness value when the lighting requirements for live streaming are met; and the background target brightness value is used to characterize the ideal value of the background brightness value when the lighting requirements for live streaming are met.
[0135] The first brightness difference is the absolute value of the difference between the first target brightness value and the first weighted brightness value; the second brightness difference is the absolute value of the difference between the second target brightness value and the second weighted brightness value; and the background brightness difference is the absolute value of the difference between the background target brightness value and the background brightness value.
[0136] The brightness requirement is that each brightness difference does not exceed a preset brightness difference threshold. Specifically, the first brightness difference does not exceed a preset first brightness difference threshold, the second brightness difference does not exceed a preset second brightness difference threshold, and the background brightness difference does not exceed a preset background brightness difference threshold. The first brightness difference threshold is the maximum value of the first brightness difference when meeting the lighting requirements for live streaming; the second brightness difference threshold is the maximum value of the second brightness difference when meeting the lighting requirements for live streaming; and the background brightness difference threshold is the maximum value of the background brightness difference when meeting the lighting requirements for live streaming. Specifically, those skilled in the art can set the specific values of the first brightness difference threshold, the second brightness difference threshold, and the background brightness difference threshold according to actual needs; this embodiment does not impose specific limitations. For example, the first brightness difference threshold, the second brightness difference threshold, and the background brightness difference threshold are all 0.
[0137] Based on this, when the first brightness difference, the second brightness difference, and the background brightness difference all meet the brightness requirements, the current live broadcast effect meets the lighting requirements for live broadcasting. At this point, the lighting adjustment process is stopped, and the current lighting effect is used as the lighting effect for live broadcasting.
[0138] Otherwise, if any of the first brightness difference, the second brightness difference, and the background brightness difference does not meet the brightness requirements, the light intensity of the corresponding light group will be adjusted based on the preset lighting adjustment strategy to adjust the lighting effect so that it ultimately meets the required lighting requirements.
[0139] In some optional implementations, for any adjustment area, the lighting adjustment strategy includes: when the brightness difference does not meet the brightness requirement, if the brightness difference is greater than the step size saturation threshold, then the brightness of the corresponding light group is adjusted based on a preset aggressive step size; otherwise, based on a preset minimum step size, combined with the brightness difference, a conservative step size is calculated, and the brightness of the corresponding light group is adjusted based on the conservative step size.
[0140] Specifically, such as Figure 10 As shown, the implementation method of adjusting lighting effects based on preset lighting adjustment strategies includes:
[0141] S301, when the first brightness difference does not meet the brightness requirement, if the first brightness difference is greater than the first step length saturation threshold, the brightness of the first lamp group 11 is adjusted based on the preset first step length; otherwise, based on the preset first minimum step length, combined with the first brightness difference, the first conservative step length is calculated, and the brightness of the first lamp group 11 is adjusted based on the first conservative step length.
[0142] The first excitation step length and the first conservative step length are both used to characterize the degree of light intensity adjustment of the first lamp group 11, and the first excitation step length is greater than the first conservative step length.
[0143] For example, the brightness range of the first lamp group 11 is obtained, and the brightness is represented by a value between [0, 100], where 0 represents the minimum brightness of the first lamp group 11, i.e., the light intensity is 0, and 100 represents the maximum brightness of the first lamp group 11. The light brightness of the first lamp group 11 is adjusted based on a first trigger step size or a first conservative step size, i.e., based on the current light brightness of the first lamp group 11, the brightness of the first lamp group 11 is changed by a first trigger step size or a first conservative step size. For example, if the first trigger step size is 15, the current light brightness of the first lamp group 11 is 1, and the current light adjustment needs to increase the brightness of the first lamp group 11, then the brightness of the first lamp group 11 after adjustment is 16.
[0144] It should be noted that the first step size and the first conservative step size are only used to characterize the degree of change in light intensity. The increase or decrease in light intensity should be determined based on the numerical relationship between the first target brightness value and the first weighted brightness value. Specifically, when the first target brightness value is greater than the first weighted brightness value, the light intensity of the first lamp group 11 increases, and when the first target brightness value is less than the first weighted brightness value, the light intensity of the first lamp group 11 decreases.
[0145] Furthermore, the light intensity of the first light group 11 located on the first side of the live streamer is changed to alter the brightness of the first area. When the first brightness difference is greater than the first step saturation threshold, the current lighting effect differs significantly from the lighting requirements for the live stream. The first step increment is used as the light intensity change amount of the first light group 11 to significantly alter the lighting effect and improve the efficiency of lighting adjustment. When the first brightness difference is less than or equal to the first step saturation threshold, the current lighting effect differs less from the lighting requirements for the live stream. The first conservative step size is used as the light intensity change amount of the first light group 11 to slightly alter the lighting effect, thereby improving the precision of lighting adjustment and achieving a better lighting adjustment effect. The first step saturation threshold is used to classify the degree of difference between the current lighting effect and the lighting requirements for the live stream. Those skilled in the art can set the specific value of the first step saturation threshold according to actual needs; this embodiment does not impose specific limitations. For example, the first step saturation threshold is 50.
[0146] Furthermore, when the first brightness difference is less than or equal to the first step saturation threshold, in order to improve the efficiency of light adjustment while ensuring the accuracy of light adjustment, a first conservative step size is calculated based on the first minimum step size and the first brightness difference. The first minimum step size is used to characterize the minimum value of the light intensity adjustment of the first light group 11. Specifically, while light adjustment using only the first minimum step size has high accuracy, it is inefficient. Therefore, the degree of difference between the current lighting effect and the lighting requirements for live streaming is obtained through the first brightness difference, and combined with the first minimum step size, the change in light intensity during the current light adjustment is obtained, i.e., the first conservative step size. This ensures both the accuracy of light adjustment and high adjustment efficiency.
[0147] To facilitate understanding by those skilled in the art, the following exemplarily provides an expression for adjusting the first lamp group 11 based on a lighting adjustment strategy:
[0148]
[0149] in, This represents the change in brightness of the first lamp group 11. For example, the first minimum step size is... ; For the first step towards progress, exemplarily, ; For example, the sensitivity coefficient. ; As an acceleration factor, exemplarily, ; For example, as the first step long saturation threshold, .
[0150] Based on this, when the first brightness difference does not meet the brightness requirement, if the first brightness difference is greater than 50, the brightness of the first lamp group 11 will be increased or decreased by 15. Specifically, the brightness of the first lamp group 11 will be increased or decreased based on the numerical relationship between the first target brightness value and the first weighted brightness value; if the first brightness difference is less than or equal to 50, then based on... Calculate the change in brightness of the first lamp group 11, and determine whether the brightness of the first lamp group 11 increases or decreases based on the numerical relationship between the first target brightness value and the first weighted brightness value.
[0151] S302, when the second brightness difference does not meet the brightness requirement, if the second brightness difference is greater than the second step size saturation threshold, the brightness of the second lamp group 12 is adjusted based on the preset second step size; otherwise, based on the preset second minimum step size and combined with the second brightness difference, the second conservative step size is calculated, and the brightness of the second lamp group 12 is adjusted based on the second conservative step size.
[0152] The second excitation step length and the second conservative step length are both used to characterize the degree of intensity adjustment of the second lamp group 12, and the second excitation step length is greater than the second conservative step length.
[0153] The light intensity of the second light group 12 located on the second side of the live streamer is changed to alter the brightness of the second area. When the second brightness difference is greater than the second step-length saturation threshold, the current lighting effect differs significantly from the lighting requirements for the live stream. The second trigger step length is used as the light intensity change amount of the second light group 12 to significantly alter the lighting effect and improve the efficiency of lighting adjustment. When the second brightness difference is less than or equal to the second step-length saturation threshold, the current lighting effect differs less from the lighting requirements for the live stream. The second conservative step length is used as the light intensity change amount of the second light group 12 to slightly alter the lighting effect, thereby improving the precision of lighting adjustment and achieving a better lighting adjustment effect. Specifically, please refer to the aforementioned implementation method of adjusting the first light group 11 based on the lighting adjustment strategy; this embodiment will not elaborate further.
[0154] S303, when the background brightness difference does not meet the brightness requirements, if the background brightness difference is greater than the background step length saturation threshold, the brightness of the background light group 13 is adjusted based on the preset background step length; otherwise, based on the preset minimum background step length and combined with the background brightness difference, the conservative background step length is calculated, and the brightness of the background light group 13 is adjusted based on the conservative background step length.
[0155] Among them, the background excitation step size and the background conservative step size are both used to characterize the degree of light intensity adjustment of the background light group 13, and the background excitation step size is greater than the background conservative step size.
[0156] The light intensity of the background light group 13 located in the background of the live streamer is changed to alter the brightness of the background area. When the background brightness difference is greater than the background step saturation threshold, the current lighting effect differs significantly from the lighting requirements for the live stream. The background step size is used as the light intensity change amount of the background light group 13 to significantly alter the lighting effect and improve the efficiency of lighting adjustment. When the background brightness difference is less than or equal to the background step saturation threshold, the current lighting effect differs less from the lighting requirements for the live stream. The background conservative step size is used as the light intensity change amount of the background light group 13 to slightly alter the lighting effect and improve the precision of lighting adjustment, achieving a better lighting adjustment effect. Specifically, please refer to the aforementioned implementation method of adjusting the first light group 11 based on the lighting adjustment strategy; this embodiment will not elaborate further.
[0157] Based on this, a lighting adjustment strategy is used to adjust each light group in the live streaming scene to change the lighting effect. Live images are then captured based on the adjusted scene, and steps S100-S300 are repeated to test whether the adjusted scene meets the required lighting conditions, ultimately achieving a good lighting effect. This method is simple to operate and highly efficient. For an example, please refer to...Figure 11 The left side shows the live stream before lighting adjustments, and the right side shows the live stream after adjustments based on the aforementioned live stream lighting control method. Based on this, by dividing the live stream into a first region and a second region and adjusting them separately, this application achieves a preset brightness variation in the live stream image, resulting in a better lighting adjustment effect. Furthermore, this application also divides the background region to distinguish between the background and the live streamer's face in the live stream image, and, in conjunction with the lighting adjustment strategy, separately controls the lighting in the face region and the background region, achieving independent intelligent control of the anchor's face and background lighting. This balances the aesthetics of the face region and the atmosphere enhancement of the background region, resulting in a better live stream lighting effect.
[0158] like Figure 12 As shown, this embodiment provides a live streaming lighting control system, including an image acquisition module 51, a brightness analysis module 52, and a lighting adjustment module 53.
[0159] The image acquisition module 51 is used to acquire the current live image.
[0160] The brightness analysis module 52 is used to divide the live image into various adjustment regions and calculate the current brightness value of each adjustment region.
[0161] The lighting adjustment module 53 is connected to each light group and is used to calculate the first brightness difference, the second brightness difference, and the background brightness difference based on the preset first target brightness value, the second target brightness value, and the background target brightness value, combined with the first weighted brightness value, the second weighted brightness value, and the background brightness value. If the first brightness difference, the second brightness difference, and the background brightness difference all meet the preset brightness requirements, the lighting adjustment is stopped; otherwise, based on the preset lighting adjustment strategy, the light intensity of the corresponding light group is adjusted, and the lighting adjustment process is re-executed.
[0162] It should be noted that each adjustment area includes a first area and a second area; the brightness analysis module 52 includes a face recognition submodule 521; the face recognition submodule 521 is used to perform face recognition on the live image, obtain at least one face region, and divide each face region into a first subregion and a second subregion; wherein, the first area is a set of all first subregions, and the second area is a set of all second subregions. The brightness of the first area and the second area are adjusted respectively to achieve the preset lighting requirements. Specifically, the lighting adjustment module 53 is connected to the first light group 11 and the second light group 12 respectively, wherein the first light group 11 is used to control the brightness of the first area, and the second light group 12 is used to control the brightness of the second area. The lighting adjustment module 53 controls the brightness change of each light group based on the lighting adjustment strategy to change the brightness of the first area and the second area.
[0163] In some optional implementations, the live streaming scene also includes a background light group 13 for adjusting the lighting of the live streaming background. Based on this, each adjustment area also includes a background area. The lighting adjustment module 53 is connected to the background light group 13 and controls the brightness change of the background light group based on the lighting adjustment strategy to change the brightness of the background area.
[0164] Furthermore, in order to divide the live stream into different areas, such as Figure 13 As shown, the face recognition submodule 521 includes a face detection unit 5211, an image segmentation unit 5212, and an extraction unit 5213.
[0165] The face detection unit 5211 is used to perform face detection on the live image and obtain at least one face bounding box.
[0166] The image segmentation unit 5212 is used to segment the image of each face bounding box and obtain the corresponding foreground images.
[0167] The extraction unit 5213 is used to extract all the corresponding pixels of any foreground image to form the corresponding face region; after traversing each foreground image, it extracts all the remaining pixels of the live image to form the corresponding background region.
[0168] The foreground image is obtained by the image segmentation unit 5212, thereby excluding the background extracted by the face detection unit 5211 at the same time as the face, so as to enhance the accuracy of face recognition and improve the accuracy of background area and face area division.
[0169] Based on the same technical concept, the live streaming lighting control method provided in this embodiment of the invention can be implemented on the terminal side or the server side.
[0170] like Figure 14 The diagram illustrates an optional hardware structure of a terminal according to an embodiment of the present invention. The terminal 60 can be an intelligent live streaming all-in-one device, a computer device, a tablet device, a smartphone, a personal digital processing device, a factory back-end processing device, etc. The terminal 60 includes at least one processor 61, a memory 62, at least one network interface 64, and a user interface 63. The various components in the device are coupled together via a bus system 65. It is understood that the bus system 65 is used to realize the connection and communication between these components. In addition to a data bus, the bus system 65 also includes a power bus, a control bus, and a status signal bus.
[0171] The user interface 63 may include control buttons for each light group, a camera interface, a monitor, a keyboard, a mouse, a microphone, a microphone, a trackball, a clicker, buttons, a touchpad, or a touchscreen. Operators can use the user interface 63 to set parameters and preset first target brightness, second target brightness, and background target brightness, and finely optimize the lighting as needed. This eliminates the need for manual intervention, greatly reducing the complexity of professional lighting adjustments in live streaming rooms, saving time and costs associated with lighting setup, and significantly improving the efficiency and accuracy of lighting control. It enables one-click intelligent adjustment of live streaming lights, resulting in softer, more natural lighting transitions on the faces of live streamers, more delicate and aesthetically pleasing image quality, and enhanced atmosphere in the live streaming room.
[0172] It is understood that memory 62 can be volatile memory or non-volatile memory, or both. Non-volatile memory can be read-only memory (ROM) or programmable read-only memory (PROM), used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as static random access memory (SRAM) and synchronous static random access memory (SSRAM). The memory characterized in the embodiments of the present invention is intended to include, but is not limited to, these and any other suitable categories of memory.
[0173] In this embodiment of the invention, the memory 62 is used to store various types of data to support the operation of the terminal. Examples of this data include: any executable program for operation on the terminal 60, such as the operating system 621 and application programs 622; the operating system 621 contains various system programs, such as the framework layer, core library layer, driver layer, etc., for implementing various basic services and handling hardware-based tasks. Application programs 622 may contain various applications, such as media players, browsers, etc., for implementing various application services. The live lighting control method provided in this embodiment of the invention can be included in application program 622.
[0174] The methods disclosed in the above embodiments of the present invention can be applied to processor 61, or implemented by processor 61. Processor 61 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the integrated logic circuit of the hardware in processor 61 or by instructions in the form of software. The processor mentioned above may be a general-purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Processor 61 can implement or execute the methods, steps and logic block diagrams disclosed in the embodiments of the present invention. Processor 61 may be a microprocessor or any conventional processor, etc. The steps of the accessory optimization method provided in the embodiments of the present invention can be directly reflected as being executed by a hardware decoding processor, or being executed by a combination of hardware and software modules in the decoding processor. The software module may be located in a storage medium, which is located in memory. The processor reads the information in the memory and combines it with its hardware to complete the steps of the aforementioned method.
[0175] In an exemplary embodiment, terminal 60 may be used by one or more application-specific integrated circuits (ASICs), DSPs, programmable logic devices (PLDs), or complex programmable logic devices (CPLDs) to execute the aforementioned method.
[0176] This invention also provides a computer-readable storage medium storing a computer program that, when invoked by a processor, implements the live streaming lighting control method provided by this invention.
[0177] Computer-readable storage media can be tangible devices capable of holding and storing instructions used by an instruction execution device. Computer-readable storage media can be, for example, (but not limited to) electrical storage devices, magnetic storage devices, optical storage devices, electromagnetic storage devices, semiconductor storage devices, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of computer-readable storage media include: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), static random access memory (SRAM), portable compact disc read-only memory (CD-ROM), digital multifunction disc (DVD), memory sticks, floppy disks, and mechanical encoding devices.
[0178] The computer-readable program represented herein can be downloaded from a computer-readable storage medium to various computing / processing devices, or downloaded via a network, such as the Internet, a local area network, a wide area network, and / or a wireless network, to an external computer or external storage device. A network adapter card or network interface in each computing / processing device receives computer-readable program instructions from the network and forwards these instructions to the computer-readable storage medium in the respective computing / processing device.
[0179] In summary, this application extracts each adjustment area from the live broadcast image to obtain the brightness of each adjustment area, and then adjusts the light intensity of the corresponding light group based on its brightness, so that each adjustment area forms a preset brightness and darkness effect, ultimately achieving the lighting requirements for live broadcasting, improving the live broadcast effect, and is easy to operate and is not affected by the experience of the staff.
[0180] The descriptions of the processes or structures corresponding to the above figures each have their own emphasis. For parts of a process or structure that are not described in detail, please refer to the relevant descriptions of other processes or structures.
[0181] The above embodiments are merely illustrative of the principles and effects of this application and are not intended to limit this application. Any person skilled in the art can modify or alter the above embodiments without departing from the spirit and scope of this application. Therefore, all equivalent modifications or alterations made by those skilled in the art without departing from the spirit and technical concept disclosed in this application should still be covered by the claims of this application.
Claims
1. A live streaming lighting control method, comprising a cyclic lighting control process, wherein each execution of the lighting control process includes: Capture the current live stream image; The live image is divided into adjustment regions, and the current brightness value of each adjustment region is calculated and obtained. Based on the target brightness value corresponding to each of the adjustment areas, and combined with the current brightness value of each of the adjustment areas, the brightness difference corresponding to each of the adjustment areas is calculated respectively. If each of the brightness differences meets the preset brightness requirement, the light control is stopped. Otherwise, based on the preset lighting adjustment strategy, the light intensity of the corresponding light group is adjusted, and the lighting control process is re-executed; Each of the adjustment regions includes a first region and a second region. The acquisition method of the first region and the second region includes: performing face recognition on the live image to acquire at least one face region, and dividing each face region into a first sub-region and a second sub-region; for any face region, the acquisition method of the first sub-region and the second sub-region includes: acquiring the total number of pixels in the face region and calculating the corresponding half-value of the total number of pixels; based on the half-value of the total number of pixels, calculating and acquiring the number of half-columns, so that each column of the number of consecutive half-columns on the first side of the face region is taken as the first sub-region, and the remaining columns are taken as the second sub-region, or, taking each column of the number of consecutive half-columns on the second side of the face region as the second sub-region, and the remaining columns are taken as the first sub-region; wherein, the number of half-columns is the minimum value of the number of consecutive columns on the first or second side of the face region whose corresponding total number of pixels is not less than the half-value of the total number of pixels; wherein, the first region is a set of each first sub-region, and the second region is a set of each second sub-region.
2. The method according to claim 1, characterized in that, Each of the adjustment regions further includes a background region, and the background region is obtained by: performing face recognition on the live image to obtain each of the face regions; and using the remaining area of the live image as the background region based on each of the face regions.
3. The method according to claim 2, characterized in that, The methods for obtaining the face region and background region include: Perform face detection on the live stream image to obtain at least one face bounding box. Image segmentation is performed on the range of each face bounding box to obtain the corresponding foreground images; For any of the foreground images, extract all corresponding pixels to form the corresponding face region; after traversing each of the foreground images, extract all remaining pixels of the live stream image to form the corresponding background region.
4. The method according to claim 3, characterized in that, The current brightness value corresponding to the first region is a first weighted brightness value; the current brightness value corresponding to the second region is a second weighted brightness value; the calculation method of the second weighted brightness value is the same as the calculation method of the first weighted brightness value, and the calculation method of the first weighted brightness value includes: Obtain the brightness value of each pixel within each of the first sub-regions, and calculate the average brightness value of each of the first sub-regions; Based on the weight of each of the first sub-regions, a weighted average of the brightness averages is calculated, and the weighted average is used as the first weighted brightness value. The current brightness value corresponding to the background area is the background brightness value; the calculation method of the background brightness value includes: The brightness values of each pixel within the background area are obtained, and the average brightness value of the background area is calculated, so as to use the average brightness value as the background brightness value.
5. The method according to claim 4, characterized in that, The weights of each first sub-region and each second sub-region are the weights corresponding to the respective face regions; the methods for obtaining the weights corresponding to each face region include: Obtain the width and height of each face bounding box to calculate the area of each face bounding box. Based on a preset Gaussian weighting formula, the weights of each face region are obtained by combining the area of each face bounding box.
6. The method according to claim 1, characterized in that, For any of the aforementioned adjustment zones, the lighting adjustment strategy includes: When the brightness difference does not meet the brightness requirement, if the brightness difference is greater than the step size saturation threshold, the brightness of the corresponding light group is adjusted based on the preset step size; otherwise, based on the preset minimum step size and the brightness difference, a conservative step size is calculated, and the brightness of the corresponding light group is adjusted based on the conservative step size.
7. A live streaming lighting control system, characterized in that, It includes an image acquisition module, a brightness analysis module, and a lighting adjustment module; The image acquisition module is used to acquire the current live image; The brightness analysis module is used to divide the live image into adjustment regions and calculate the current brightness value of each adjustment region. The lighting adjustment module is connected to each light group and is used to calculate the brightness difference of each adjustment area based on the target brightness value corresponding to each adjustment area and the current brightness value of each adjustment area. If each brightness difference meets the preset brightness requirement, the lighting adjustment is stopped. Otherwise, based on the preset lighting adjustment strategy, the light intensity of the corresponding light group is adjusted, and the lighting control process is executed again; Each of the aforementioned adjustment regions includes a first region and a second region; the brightness analysis module includes a face recognition submodule; the face recognition submodule is used to perform face recognition on the live image, obtain at least one face region, and divide each face region into a first sub-region and a second sub-region; for any face region, the method for obtaining the first sub-region and the second sub-region includes: obtaining the total number of pixels in the face region and calculating the corresponding half-value of the total number of pixels; based on the half-value of the total number of pixels, calculating and obtaining the number of half-columns, so that each column of the number of consecutive half-columns on the first side of the face region is taken as the first sub-region, and the remaining columns are taken as the second sub-region, or, taking each column of the number of consecutive half-columns on the second side of the face region as the second sub-region, and the remaining columns are taken as the first sub-region; wherein, the number of half-columns is the minimum value of the number of consecutive columns on the first or second side of the face region whose corresponding total number of pixels is not less than the half-value of the total number of pixels; wherein, the first region is a set of each first sub-region, and the second region is a set of each second sub-region.
8. The system according to claim 7, characterized in that, Each of the aforementioned adjustment areas also includes a background area, and the face recognition submodule includes a face detection unit, an image segmentation unit, and an extraction unit; The face detection unit is used to perform face detection on the live image and obtain at least one face bounding box. The image segmentation unit is used to segment the area of each face box to obtain the corresponding foreground images; The extraction unit is used to extract all the corresponding pixels of any foreground image to form the corresponding face region; after traversing each foreground image, it extracts all the remaining pixels of the live image to form the corresponding background region.
9. A terminal, characterized in that, include: A processor and a memory, wherein the memory and the processor are communicatively connected; The memory is used to store computer programs, and the processor is used to execute the computer programs stored in the memory to cause the terminal to perform the live lighting control method as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Brightness adjustment method and device, electronic equipment and storage medium
CN118843226A