Backlight detection method and system, electronic device and storage medium

By identifying and dividing the target imaging area and calculating the backlight confidence level, the problem of insufficient backlight detection accuracy in the existing technology is solved, and the accurate assessment of the backlight degree and the improvement of the imaging effect are achieved.

CN114760422BActive Publication Date: 2024-09-06SPREADTRUM SEMICON (NANJING) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210279531.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-21
Publication Date
2024-09-06
Estimated Expiration
2042-03-21

AI Technical Summary

Technical Problem

When the existing backlight detection technology has unreasonable threshold settings or incorrect brightness block judgments, the detection accuracy is insufficient and cannot accurately describe the degree of backlight. It can only determine the existence of a backlight scene.

Method used

By identifying the shooting scene of the target imaging, dividing it into several target areas, calculating the backlight confidence degree based on pixel values, characterizing the degree of backlight, and combining the depth of field parameters and light angles for division and weight setting to achieve accurate assessment of the degree of backlight.

Benefits of technology

It improves the accuracy and referenceability of backlight detection, can more accurately describe the degree of backlight, helps to correct backlight, and improves imaging effects.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114760422B
    Figure CN114760422B
Patent Text Reader

Abstract

The present invention discloses a backlight detection method and system, an electronic device and a storage medium, wherein the backlight detection method comprises: identifying a shooting scene of target imaging; dividing the target imaging into a plurality of target areas according to the recognition result of the shooting scene; obtaining a backlight confidence degree of the target imaging based on the pixel values ​​in the plurality of target areas; wherein the backlight confidence degree is used to characterize the backlight degree of the shooting scene. The backlight detection method and system, the electronic device and the storage medium of the present invention realize backlight detection based on the combination of two different dimensions of the shooting scene of target imaging and the image processing of target imaging, improve the accuracy and referenceability of backlight detection, help to correct the backlight of target imaging on this basis, obtain better imaging effect, and have industry promotion value.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of optical imaging, and in particular relates to a backlight detection method and system, electronic equipment and storage medium. Background Art

[0002] Mobile phones, industrial cameras, IoT terminals and other devices equipped with digital cameras or camcorders are easily affected by ambient light during the imaging process, resulting in backlit scenes. The imaging result of the subject, i.e. the main object of focus, is darker and cannot be clearly displayed in the image. Excessive brightness of the background also affects the visual experience and user experience. In severe cases, it may even affect the product function and prevent it from working properly.

[0003] Backlight detection technology can detect backlight scenes and perform special processing on backlight scenes, which can greatly reduce the generation of backlight images and optimize the image quality. The current existing backlight detection technology first divides the image into multiple image blocks, and then divides the image into brightness blocks or darkness blocks according to the set threshold, and then determines whether the scene is a backlight scene by judging whether the number of brightness blocks is greater than the set threshold. Another approach is to divide the image into multiple image blocks, and then determine whether the pixel block is a brightness block based on the relationship between the pixel values ​​of the image blocks, and then connect the brightness block and the darkness block into brightness areas and darkness areas, and determine whether it is a backlight scene based on the relationship between the brightness area and the darkness area.

[0004] The disadvantage of the above-mentioned prior art is that it is necessary to set a threshold or determine the degree of backlight based on the judgment results of adjacent brightness blocks. When the threshold setting is unreasonable and the brightness block judgment is wrong, the detection result will be greatly affected, resulting in insufficient detection accuracy. In addition, only the judgment result of whether there is a backlight scene or not can be given, but a specific description of the degree of backlight cannot be given. Summary of the invention

[0005] The technical problem to be solved by the present invention is to overcome the defects of backlight detection of imaging in the prior art and to provide a backlight detection method and system, an electronic device and a storage medium.

[0006] The present invention solves the above technical problems through the following technical solutions:

[0007] The present invention provides a backlight detection method, comprising:

[0008] Identify the shooting scene of the target imaging;

[0009] Dividing the target imaging into a plurality of target areas according to the recognition result of the shooting scene;

[0010] Based on the pixel values ​​in the plurality of target areas, a backlight confidence level of the target imaging is obtained; wherein the backlight confidence level is used to characterize the backlight level of the shooting scene.

[0011] Preferably, the step of obtaining the backlight confidence of the target imaging based on the pixel values ​​in the plurality of target areas comprises:

[0012] Calculating the average pixel value of each pixel in the target area respectively;

[0013] Calculating the average pixel value of the target imaging according to the backlight reference weight corresponding to each of the target areas and the average pixel value;

[0014] Determining the backlight confidence level corresponding to each target area according to the average pixel value of each target area and the average pixel value of the target imaging;

[0015] The backlight confidence of the target imaging is determined according to the backlight confidence of each target area.

[0016] Preferably, the step of respectively calculating the average pixel value of each pixel point in the target area comprises:

[0017] Divide the target imaging rule into a plurality of pixel units, wherein the number of pixel points in the pixel units is the same;

[0018] Calculating the sum of pixel values ​​of each pixel point in each pixel unit respectively;

[0019] According to the number of all pixel units in each target area and the sum of pixel values ​​corresponding to all pixel units, the average pixel value of the pixel points in each target area is calculated.

[0020] Preferably, the backlight detection method further comprises: performing rotation processing on the target imaging;

[0021] The step of identifying the shooting scene of the target imaging is specifically used to respectively identify the shooting scene of the target imaging after the rotation processing.

[0022] Preferably, the step of dividing the target imaging into a plurality of target areas according to the recognition result of the shooting scene comprises:

[0023] Determining a target object in the shooting scene according to a recognition result of the shooting scene;

[0024] According to the target object, the target imaging is divided into a number of target areas.

[0025] Preferably, the step of identifying the shooting scene of the target imaging comprises:

[0026] Identify the depth of field parameters of each undetermined object in the shooting scene of the target imaging; the depth of field parameters are used to characterize the spatial distance between the undetermined object and the shooting lens;

[0027] The step of determining the target object in the shooting scene according to the recognition result of the shooting scene comprises:

[0028] The target object in the shooting scene is determined according to the depth of field parameters of the objects to be determined.

[0029] Preferably, the backlight reference weight corresponding to the target area is determined according to the target object.

[0030] Preferably, the step of dividing the target imaging into a plurality of target areas according to the recognition result of the shooting scene comprises:

[0031] Determining the light angle in the shooting scene according to the recognition result of the shooting scene;

[0032] According to the light angle, the target imaging is divided into a number of target areas.

[0033] The present invention also provides a backlight detection system, comprising:

[0034] A scene recognition module, used to identify the shooting scene of the target imaging;

[0035] An imaging division module, used for dividing the target imaging into a plurality of target areas according to the recognition result of the shooting scene;

[0036] The backlight detection module is used to obtain the backlight confidence level of the target imaging based on the pixel values ​​in the plurality of target areas; wherein the backlight confidence level is used to characterize the backlight level of the shooting scene.

[0037] Preferably, the backlight detection module comprises:

[0038] A regional pixel value calculation unit, used to calculate the average pixel value of each pixel point in the target area;

[0039] An average pixel value technical unit, used for calculating the average pixel value of the target imaging according to the backlight reference weight corresponding to each of the target areas and the average pixel value;

[0040] A regional confidence calculation unit, used to determine the backlight confidence corresponding to each target area according to the average pixel value of each target area and the average pixel value of the target imaging;

[0041] The backlight confidence determination unit is used to determine the backlight confidence of the target imaging according to the backlight confidence of each target area.

[0042] Preferably, the regional pixel value calculation unit is specifically used for:

[0043] Divide the target imaging rule into a plurality of pixel units, wherein the number of pixel points in the pixel units is the same;

[0044] Calculating the sum of pixel values ​​of each pixel point in each pixel unit respectively;

[0045] According to the number of all pixel units in each target area and the sum of pixel values ​​corresponding to all pixel units, the average pixel value of the pixel points in each target area is calculated.

[0046] Preferably, the backlight detection system further comprises a rotation processing module for performing rotation processing on the target imaging;

[0047] The scene recognition module is used to respectively recognize the shooting scenes of the target images after the rotation processing.

[0048] Preferably, the imaging division module comprises:

[0049] a target object determining unit, configured to determine a target object in the shooting scene according to a recognition result of the shooting scene;

[0050] The first division unit is used to divide the target imaging into a plurality of target areas according to the target object.

[0051] Preferably, the scene recognition module is specifically used to: identify the depth of field parameters of each undetermined object in the shooting scene of the target imaging; the depth of field parameters are used to characterize the spatial distance between the undetermined object and the shooting lens;

[0052] The target object determination unit is specifically configured to determine the target object in the shooting scene according to the depth of field parameters of the objects to be determined.

[0053] Preferably, the backlight reference weight corresponding to the target area is determined according to the target object.

[0054] Preferably, the imaging division module comprises:

[0055] A light angle determination unit, used to determine the light angle in the shooting scene according to the recognition result of the shooting scene;

[0056] The second division unit is used to divide the target imaging into a plurality of target areas according to the light angle.

[0057] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the above-mentioned backlight detection method when executing the computer program.

[0058] The present invention also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the above-mentioned backlight detection method is implemented.

[0059] The positive progressive effect of the present invention is that by providing a backlight detection method and system, an electronic device and a storage medium, backlight detection based on the combination of two different dimensions, namely, the shooting scene of target imaging and the image processing of target imaging, is realized, the accuracy and referenceability of backlight detection are improved, and it is helpful to correct the backlight of target imaging on this basis to obtain better imaging effects, which has industry promotion value. BRIEF DESCRIPTION OF THE DRAWINGS

[0060] Figure 1 This is a flow chart of the backlight detection method according to Embodiment 1 of the present invention.

[0061] Figure 2 This is a flowchart of a specific example of the backlight detection method according to Embodiment 1 of the present invention.

[0062] Figure 3 It is a schematic diagram of target imaging of a specific example of the backlight detection method according to Embodiment 1 of the present invention.

[0063] Figure 4 It is a schematic diagram of a target area of ​​a specific example of the backlight detection method according to Embodiment 1 of the present invention.

[0064] Figure 5 Schematic diagram of the modules of the backlight detection system according to the second embodiment of the present invention.

[0065] Figure 6 This is a module diagram of a specific implementation of the backlight detection system of Example 2 of the present invention.

[0066] Figure 7 It is a module schematic diagram of another implementation of the backlight detection system of Example 2 of the present invention.

[0067] Figure 8 This is an electronic block diagram of an electronic device according to embodiment 3 of the present invention. DETAILED DESCRIPTION

[0068] The present invention is further described below by way of examples, but the present invention is not limited to the scope of the examples.

[0069] Example 1

[0070] See also Figure 1 As shown, this embodiment specifically provides a backlight detection method, including:

[0071] S1. Identify the shooting scene of the target imaging;

[0072] S2. Divide the target image into several target areas according to the recognition result of the shooting scene;

[0073] S3. Based on the pixel values ​​in the plurality of target areas, obtain the backlight confidence level of the target imaging; wherein the backlight confidence level is used to characterize the backlight degree of the shooting scene.

[0074] The target imaging in this embodiment includes but is not limited to the pixel dot matrix image obtained by processing the output signal of the image sensor by the image signal processor (ISP, Image Signal Processing), or the image to be output during the processing. Step S1 identifies the shooting scene of the target imaging, that is, models the target imaging based on the scene. Specifically, the modeling can be based on the deep neural network training of the convolutional network model based on the previously labeled scene data set, and then the above-mentioned target imaging is recognized and processed by the convolutional network model. The data selection of the scene data set can include various pre-collected simulation scenes, taking into account variables such as contrast, brightness, sharpness, resolution, etc.; so that the scene recognition model is suitable for most possible application environments. For example, a spindle-shaped full convolutional network including a deconvolution operation is used to train the scene recognition model, and different simulation scenes such as portraits, landscapes, and macros are refined and set; so that the scene in the target imaging can be more accurately recognized for subsequent processing, and the recognition results include but are not limited to mask maps. It can be understood that scene recognition for target imaging can also be achieved through other models and algorithms and is not limited to convolutional network models.

[0075] In an optional implementation, step S1 specifically includes: identifying the depth of field parameters of each undetermined object in the shooting scene of the target imaging, and the depth of field parameters are used to characterize the spatial distance between the undetermined object and the shooting lens. Specifically, this implementation realizes scene recognition by distinguishing the close view and the background in the target imaging, and the depth of field data is the actual spatial distance between each undetermined object in the target imaging and the shooting lens; it can be obtained by using, but not limited to, binocular measurement technology, that is, using dual cameras to obtain the three-dimensional coordinate information of the target space according to the principle of stereo vision, and obtaining the parallax of each target point in the dual camera imaging through image matching, and then calculating the depth of field parameters.

[0076] Step S2 divides the target image into several target areas according to the recognition result of the shooting scene. Those skilled in the art can understand that based on the different recognition methods of step S1, the same target image may be divided into different combinations of target areas, and on this basis, the backlight detection result obtained in step S3, i.e., the backlight confidence, is also different.

[0077] For example, for the above-mentioned target scene recognition method based on depth of field parameters, an optional implementation of step S2 specifically includes: determining the target object in the shooting scene according to the recognition result of the shooting scene; dividing the target imaging into a number of target areas according to the target object. The target object in the shooting scene is determined, that is, it is achieved according to the depth of field parameters of each object to be determined. Assuming that the target imaging includes a person standing in front of the window, the person, the window and other areas of the room can all be identified as target objects with different depth of field parameters.

[0078] For example, in another optional implementation, step S2 specifically includes:

[0079] Determine the light angle in the shooting scene according to the recognition result of the shooting scene;

[0080] According to the light angle, the target imaging is divided into several target areas.

[0081] In this embodiment, the direction and angle of the incident light can be determined by including but not limited to judging the local shadows and concave-convex surfaces in the target imaging scene. Specifically, assuming that the scene recognition result of the target imaging includes a person standing in front of a window, the incident direction and angle of the light can be determined by analyzing the shadows and concave-convex surfaces of the face and other parts of the body. Then, the division models corresponding to different backlighting scenes are distinguished by analyzing the light, and the target imaging is divided based on different backlighting scenes. If the light enters from the upper part of the image, the upper part of the division model corresponding to the backlighting scene is set as an area, the upper middle part is set as an area, the center part is set as an area, and the bottom is set as another area. When calculating the backlight confidence, different weights are set for different areas.

[0082] Step S3 performs backlight detection and analysis on the target area based on the pixel values. Combined with the spatial scene attributes in the target area, the backlight detection and analysis is essentially a comprehensive judgment of the above two dimensions.

[0083] As an optional implementation, step S3 includes:

[0084] S31. Calculate the average pixel value of each pixel in the target area respectively;

[0085] S32. Calculate the average pixel value of the target imaging according to the backlight reference weight and the average pixel value corresponding to each target area;

[0086] S33. Determine the backlight confidence level corresponding to each target area according to the average pixel value of each target area and the average pixel value of the target imaging;

[0087] S34. Determine the backlight confidence of the target imaging according to the backlight confidence of each target area.

[0088] In the process of calculating the pixel value, for the pixel point containing color information, the pixel value of the pixel point can be determined by first converting the color value corresponding to the RGB (Red-Green-Blue three primary color channels) channel. Step S31 calculates the average pixel value of the pixels in each target area according to the division result, and step S32 calculates the average pixel value of the entire target imaging based on the backlight reference weight corresponding to the preset target area, for example, by weighted summation, to obtain the sum of the product of the average pixel value of each target area and the backlight reference weight. It can be understood that the backlight reference weight can be set based on, including but not limited to, the requirements for imaging processing. Preferably, for the above-mentioned scene recognition method based on the target object, when setting the backlight reference weight, it can be determined according to the target object corresponding to each target area. For example, when the final image is a portrait, the backlight reference weight for the target area corresponding to the human body, face, etc. is set higher. Or when the final image is a macro photo, the backlight reference weight of the target object determined as the focused shooting object based on the depth of field parameter can be set to a higher value.

[0089] Step S33 determines the backlight confidence level corresponding to each target area by comparing the average pixel value of each target area with the average pixel value of the target imaging; Step S34 selects the maximum value (generally set to the maximum value) from the backlight confidence level of each target area as the backlight confidence level of the target imaging. Preferably, different backlight confidence levels of target imaging may be obtained based on different scene recognition methods, so for the same target imaging, the maximum value can be taken again from all possible backlight confidence levels as the final backlight detection result.

[0090] Similarly, in addition to the recognition methods based on different target scenes, in order to ensure that the lens may be flipped or reversed during the shooting process, in a preferred embodiment, the backlight detection method also includes: rotating the target imaging; so that when step S1 identifies the shooting scene of the target imaging, the shooting scene of the target imaging after the rotation processing is specifically identified. Specifically, for example, by rotating the target imaging by 90°, 180°, and 270°, the processing is performed based on the rotated target imaging, which helps to cover most application scenarios. Preferably, when the target imaging undergoes at least two scene recognition methods at the same time and is also rotated, the backlight confidence levels obtained under all combinations should be compared to determine the final backlight detection result.

[0091] In order to facilitate actual modeling and calculation, the target imaging can be preprocessed, that is, for step S31, the target imaging rule can be equally divided into a number of pixel units, so that the number of pixels in each pixel unit is the same; then the sum of the pixel values ​​of the pixels in each pixel unit is calculated respectively. And according to the number of all pixel units in each target area and the sum of the pixel values ​​corresponding to all pixel units, the average pixel value of the pixels in each target area is calculated.

[0092] See also Figure 2 The backlight detection method of this embodiment is described below through a specific example, which does not limit the present invention.

[0093] S61. Convert the RGB value of the color information in the target image output by a device such as a digital camera or a video camera into brightness information.

[0094] The specific conversion formula is as follows: Y = 0.299*R + 0.587*G + 0.114*B. Among them, Y represents the calculated brightness information, R, G, and B represent the pixel values ​​of the red, green, and blue channels of the pixel points respectively, and the conversion coefficient adopts the industry's general settings. All pixels in the image are subjected to the above operation to obtain the brightness values ​​of the pixels, and the color image is converted into a brightness image. If the camera output image is a grayscale image that does not contain color information, this step can be ignored.

[0095] S62. Divide the image into m*n image blocks, i.e., pixel units, and add all brightness values ​​Y in each pixel unit as brightness value information of each pixel unit to obtain an m*n image.

[0096] S63. Modeling is performed according to an actual backlighting scene, and the image is divided into different target areas.

[0097] The purpose of modeling is to combine the brightness information of the target imaging pixel with the location information of the pixel, instead of detecting the backlit scene based solely on the brightness information of the pixel. The modeling process can be based on the actual backlit scene, see Figure 3 For example, if a person takes a photo in front of a window, the backlit scene is characterized by a darker area at the center of the target image and a brighter area around it. Figure 4 , the target imaging can be divided into five areas, the white area is not considered, and the brightness information of the remaining areas is as follows: the first target area (T1)> the second target area (T2)> the third target area (T3)> the fourth target area (T4). Of course, the actual number of target areas can be flexibly set according to the scene. In this example, the above target areas correspond to different backlight reference weights.

[0098] S64. Calculate the sum of the pixel values ​​in each target area.

[0099] Specifically, the target areas are as follows: sum_b (indicating the first target area), sum_o (indicating the second target area), sum_br (indicating the third target area), sum_blk (indicating the fourth target area), and the number of pixels in each target area is: num_b (corresponding to the first target area), num_o (corresponding to the second target area), num_br (corresponding to the third target area), num_blk (corresponding to the fourth target area).

[0100] S65. Calculate the average value of the pixel values ​​of each pixel in the target area:

[0101] avg_b = sum_b / num_b,

[0102] avg_o=sum_o / num_o,

[0103] avg_br=sum_br / num_br,

[0104] avg_blk=sum_blk / num_blk.

[0105] S66. Calculate the average pixel value avg_img of the entire target imaging according to the backlight reference weight of each target area:

[0106] avg_img=(avg_b*weight_b+avg_o*weight_o+avg_br*weight_br+avg_blk*weight_blk) / (weight_b+weight_o+weight_br+weight_blk),

[0107] Wherein: weight_b, weight_o, weight_br, and weight_blk represent the backlight reference weights corresponding to the above target areas respectively.

[0108] S67. Calculate the backlight confidence value for each region:

[0109] cfd_b=(avg_b-avg_img) / avg_img,

[0110] cfd_o=(avg_o-avg_img) / avg_img,

[0111] cfd_br=(avg_br-avg_img) / avg_img,

[0112] cfd_blk=(avg_blk-avg_img) / avg_img.

[0113] S68. Get the backlight confidence of target imaging cfd_mode1:

[0114] cfd_mode1=max(cfd_b, cfd_o, cfd_br, cfd_blk).

[0115] Specifically, the backlight confidence value can be normalized to a certain range, and different values ​​represent different backlight degrees. For example, it can be normalized to a value of 0 to 1, that is, when the confidence value is 0, it means that the current scene is not backlighted, and when the confidence value is 1, it means that the current scene is backlighted. The larger the value, the greater the backlight degree. At this time, the maximum value of the backlight confidence corresponding to the target area is obtained as the final backlight confidence. Further, after the backlight confidence value is calculated, it can be combined with the brightness of the actual scene to determine whether the current scene is a backlight scene.

[0116] The backlight detection method of this embodiment realizes backlight detection based on the combination of two different dimensions: the shooting scene based on target imaging and the image processing of target imaging, thereby improving the accuracy and referenceability of backlight detection, and helping to perform backlight correction on the target imaging on this basis to obtain better imaging effects, which has industry promotion value.

[0117] Example 2

[0118] See also Figure 5-Figure 7 As shown, this embodiment specifically provides a backlight detection system, including:

[0119] A scene recognition module 51 is used to recognize the shooting scene of the target imaging;

[0120] An imaging division module 52 is used to divide the target imaging into a plurality of target areas according to the recognition result of the shooting scene;

[0121] The backlight detection module 53 is used to obtain the backlight confidence level of the target imaging based on the pixel values ​​in the target areas; wherein the backlight confidence level is used to characterize the backlight level of the shooting scene.

[0122] The target imaging in this embodiment includes but is not limited to the pixel dot matrix image obtained by the image signal processor processing the output signal of the image sensor, or the image to be output during the processing. The scene recognition module 51 identifies the shooting scene of the target imaging, that is, the target imaging is modeled based on the scene. Specifically, the modeling can be based on the pre-annotated scene data set to perform deep neural network training on the convolution network model, and then the convolution network model is used to recognize and process the above-mentioned target imaging. The data selection of the scene data set can include various pre-collected simulated scenes, taking into account variables such as contrast, brightness, sharpness, and resolution; so that the scene recognition model is suitable for most possible application environments. For example, a spindle-shaped full convolution network containing a deconvolution operation is used to train the scene recognition model, and different simulated scenes such as portraits, landscapes, and macros are refined and set; so that the scene in the target imaging can be more accurately recognized for subsequent processing, and the recognition results include but are not limited to mask maps. It can be understood that scene recognition for target imaging can also be achieved through other models and algorithms and is not limited to convolution network models.

[0123] In an optional embodiment, the scene recognition module 51 is specifically used to identify the depth of field parameters of each undetermined object in the shooting scene of the target imaging, and the depth of field parameters are used to characterize the spatial distance between the undetermined object and the shooting lens. Specifically, this embodiment realizes scene recognition by distinguishing the close view and the background in the target imaging, and the depth of field data is the actual spatial distance between each undetermined object in the target imaging and the shooting lens; it can be obtained by using, but not limited to, binocular measurement technology, that is, using dual cameras to obtain the three-dimensional coordinate information of the target space according to the principle of stereo vision, and obtaining the parallax of each target point in the dual camera imaging through image matching, and then calculating the depth of field parameters.

[0124] The imaging division module 52 divides the target imaging into a plurality of target areas according to the recognition result of the shooting scene. Those skilled in the art can understand that based on the different recognition methods of the scene recognition module 51, the same target imaging may be divided into different combinations of target areas, and on this basis, the backlight detection result obtained by the backlight detection module 53, i.e., the backlight confidence level, is also different.

[0125] For example, for the above-mentioned target scene recognition method based on depth of field parameters, optionally, the imaging division module 52 includes a target object determination unit 521, which is used to determine the target object in the shooting scene according to the recognition result of the shooting scene; and a first division unit 522, which is used to divide the target imaging into a plurality of target areas according to the target object. The target object in the shooting scene is determined, that is, it is achieved according to the depth of field parameters of each object to be determined. Assuming that the target imaging includes a person standing in front of the window, the person, the window and other areas of the room can all be identified as target objects with different depth of field parameters.

[0126] For example, in another optional implementation, the imaging division module 52 specifically includes:

[0127] A light angle determination unit 523, used to determine the light angle in the shooting scene according to the recognition result of the shooting scene;

[0128] The second division unit 524 is used to divide the target imaging into a plurality of target areas according to the light angle.

[0129] In this embodiment, the direction and angle of the incident light can be determined by including but not limited to judging the local shadows and concave-convex surfaces in the target imaging scene. Specifically, assuming that the scene recognition result of the target imaging includes a person standing in front of a window, the incident direction and angle of the light can be determined by analyzing the shadows and concave-convex surfaces of the face and other parts of the body. Then, the division models corresponding to different backlighting scenes are distinguished by analyzing the light, and the target imaging is divided based on different backlighting scenes. If the light enters from the upper part of the image, the upper part of the division model corresponding to the backlighting scene is set as an area, the upper middle part is set as an area, the center part is set as an area, and the bottom is set as another area. When calculating the backlight confidence, different weights are set for different areas.

[0130] The backlight detection module 53 performs backlight detection analysis on the target area based on the pixel value, and combined with the spatial scene attributes in the target area, the backlight detection analysis is essentially a comprehensive judgment of the above two dimensions.

[0131] As an optional implementation, the backlight detection module 53 includes:

[0132] The regional pixel value calculation unit 531 is used to calculate the average pixel value of the pixels in each target region respectively;

[0133] The average pixel value technical unit 532 is used to calculate the average pixel value of the target imaging according to the backlight reference weight and the average pixel value corresponding to each target area;

[0134] A region confidence calculation unit 533, used to determine the backlight confidence corresponding to each target region according to the average pixel value of each target region and the average pixel value of the target imaging;

[0135] The backlight confidence determination unit 534 is used to determine the backlight confidence of the target imaging according to the backlight confidence of each target area.

[0136] In the process of calculating the pixel value, for the pixel point containing color information, the pixel value of the pixel point can be determined by converting the color value corresponding to the RGB channel in advance. The regional pixel value calculation unit 531 calculates the average pixel value of the pixels in each target area according to the division result, and the average pixel value technical unit 532 calculates the average pixel value of the entire target imaging based on the backlight reference weight corresponding to the preset target area, for example, by weighted summation, to obtain the sum of the product of the average pixel value of each target area and the backlight reference weight. It can be understood that the backlight reference weight can be set based on, including but not limited to, the requirements for imaging processing. Preferably, for the above-mentioned scene recognition method based on the target object, when setting the backlight reference weight, it can be determined according to the target object corresponding to each target area. For example, when the final image is a portrait, the backlight reference weight for the target area corresponding to the human body, face, etc. is set higher. Or when the final image is a macro photo, the backlight reference weight of the target object determined as the focused shooting object based on the depth of field parameter can be set to a higher value.

[0137] The regional confidence calculation unit 533 determines the backlight confidence corresponding to each target region by comparing the average pixel value of each target region with the average pixel value of the target imaging; the backlight confidence determination unit 534 selects the maximum value (generally set to the maximum value) from the backlight confidence of each target region as the backlight confidence of the target imaging. Preferably, different backlight confidences of target imaging may be obtained based on different scene recognition methods, so for the same target imaging, the maximum value can be taken again from all possible backlight confidences as the final backlight detection result.

[0138] Similarly, in addition to the recognition methods based on different target scenes, in order to ensure that the lens may be flipped or reversed during the shooting process, in a preferred embodiment, the backlight detection system also includes a rotation processing module 54, which is used to rotate the target imaging; so that when the scene recognition module 51 recognizes the shooting scene of the target imaging, it specifically recognizes the shooting scene of the target imaging after the rotation processing. Specifically, for example, by rotating the target imaging by 90°, 180°, and 270°, processing is performed based on the rotated target imaging, which helps to cover most application scenarios. Preferably, when the target imaging undergoes at least two scene recognition methods at the same time and is also rotated, the backlight confidence levels obtained under all combinations should be compared to determine the final backlight detection result.

[0139] In order to facilitate actual modeling and calculation, the target imaging can be preprocessed, that is, the target imaging rule can be equally divided into a number of pixel units for the regional pixel value calculation unit 531, so that the number of pixels in each pixel unit is the same; then the sum of the pixel values ​​of the pixels in each pixel unit is calculated respectively. And according to the number of all pixel units in each target area and the sum of the pixel values ​​corresponding to all pixel units, the average pixel value of the pixels in each target area is calculated.

[0140] The backlight detection system of this embodiment realizes backlight detection based on the combination of two different dimensions: the shooting scene of target imaging and the image processing of target imaging, which improves the accuracy and referenceability of backlight detection, helps to correct the backlight of target imaging on this basis, and obtains better imaging effects, which has industry promotion value.

[0141] Example 3

[0142] This embodiment provides an electronic device, including at least one processor and a memory connected to the at least one processor in communication, wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the processing device can execute the backlight detection method in Embodiment 1.

[0143] It should be noted that the electronic device in this embodiment can be a separate chip, chip module or network device, or a chip or chip module integrated into a network device; the various modules / units included in the communication data processing device can be software modules / units, hardware modules / units, or partly software modules / units and partly hardware modules / units. For example, for various devices and products applied to or integrated into a chip, the various modules / units included therein can all be implemented in the form of hardware such as circuits, or at least some of the modules / units can be implemented in the form of software programs, which run on a processor integrated inside the chip, and the remaining (if any) modules / units can be implemented in the form of hardware such as circuits; for various devices and products applied to or integrated into a chip module, the various modules / units included therein can all be implemented in the form of hardware such as circuits, and different modules / units can be located in the same component (such as a chip, circuit module, etc.) or different components of the chip module, or at least some of the modules / units can be implemented in the form of software programs, which run on a processor integrated inside the chip, and the remaining (if any) modules / units can be implemented in the form of hardware such as circuits. The element can be implemented in the form of a software program, which runs on a processor integrated inside the chip module, and the remaining (if any) modules / units can be implemented in the form of hardware such as circuits; for various devices and products applied to or integrated in the terminal, the various modules / units contained therein can be implemented in the form of hardware such as circuits, and different modules / units can be located in the same component (for example, chip, circuit module, etc.) or in different components in the terminal, or, at least some modules / units can be implemented in the form of a software program, which runs on a processor integrated inside the terminal, and the remaining (if any) modules / units can be implemented in the form of hardware such as circuits.

[0144] See also Figure 8 As shown, as a preferred implementation, this embodiment specifically provides an electronic device 30, including a processor 31, a memory 32, and a computer program stored in the memory 32 and executable on the processor 31. When the processor 31 executes the program, the backlight detection method in Example 1 is implemented. Figure 8 The electronic device 30 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.

[0145] The electronic device 30 may be in the form of a general-purpose computing device, for example, it may be a server device. The components of the electronic device 30 may include, but are not limited to: at least one processor 31, at least one memory 32, and a bus 33 connecting different system components (including the memory 32 and the processor 31).

[0146] The bus 33 includes a data bus, an address bus, and a control bus.

[0147] The memory 32 may include a volatile memory, such as a random access memory (RAM) 321 and / or a cache memory 322 , and may further include a read-only memory (ROM) 323 .

[0148] The memory 32 may also include a program / utility 325 having a set (at least one) of program modules 324, such program modules 324 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.

[0149] The processor 31 executes various functional applications and data processing by running the computer programs stored in the memory 32, such as the backlight detection method in the first embodiment of the present invention.

[0150] The electronic device 30 may also communicate with one or more external devices 34 (e.g., keyboards, pointing devices, etc.). Such communication may be performed via an input / output (I / O) interface 35. Furthermore, the model-generated electronic device 30 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) via a network adapter 36. The network adapter 36 communicates with other modules of the model-generated electronic device 30 via a bus 33. Other hardware and / or software modules may be used in conjunction with the model-generated electronic device 30, including but not limited to: microcode, device drivers, redundant processors, external disk drive arrays, RAID (disk array) systems, tape drives, and data backup storage systems.

[0151] It should be noted that although several units / modules or sub-units / modules of the electronic device are mentioned in the above detailed description, this division is merely exemplary and not mandatory. In fact, according to an embodiment of the present invention, the features and functions of two or more units / modules described above can be embodied in one unit / module. Conversely, the features and functions of one unit / module described above can be further divided into multiple units / modules to be embodied.

[0152] Example 4

[0153] This embodiment provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the backlight detection method in Embodiment 1 is implemented.

[0154] The readable storage medium may include but is not limited to: a portable disk, a hard disk, a random access memory, a read-only memory, an erasable programmable read-only memory, an optical storage device, a magnetic storage device or any suitable combination of the above.

[0155] In a possible implementation manner, the present invention may also be implemented in the form of a program product, which includes a program code. When the program product is run on a terminal device, the program code is used to enable the terminal device to execute the backlight detection method in Embodiment 1.

[0156] Among them, the program code for executing the present invention can be written in any combination of one or more programming languages, and the program code can be executed completely on the user device, partially on the user device, as an independent software package, partially on the user device and partially on a remote device, or completely on the remote device.

[0157] Although the specific embodiments of the present invention are described above, it should be understood by those skilled in the art that this is only for illustration and the protection scope of the present invention is defined by the appended claims. Those skilled in the art may make various changes or modifications to these embodiments without departing from the principles and essence of the present invention, but these changes and modifications all fall within the protection scope of the present invention.

Claims

1. A backlight detection method, It is characterized in that include: Identify the shooting scene of the target imaging; Dividing the target imaging into a plurality of target areas according to the recognition result of the shooting scene; Calculating the average pixel value of each pixel in the target area respectively; Calculating the average pixel value of the target imaging according to the backlight reference weight corresponding to each of the target areas and the average pixel value; Determine the backlight confidence level corresponding to each target area by comparing the average pixel value of each target area with the average pixel value of the target imaging; Select the maximum value from the backlight confidence of each target area as the backlight confidence of the target imaging; The backlight confidence value of each target area is calculated according to the following formula: cfd_i = (avg_i-avg_img) / avg_img, avg_img is the average pixel value of the entire target imaging, and avg_i is the average pixel value of the pixel points in target area i; The target areas correspond to different backlight reference weights; The backlight confidence level is used to characterize the backlight level of the shooting scene.

2. The backlight detection method according to claim 1, It is characterized in that The step of respectively calculating the average pixel value of each pixel point in the target area comprises: Divide the target imaging rule into a plurality of pixel units, wherein the number of pixel points in the pixel units is the same; Calculating the sum of pixel values ​​of each pixel point in each pixel unit respectively; According to the number of all pixel units in each target area and the sum of pixel values ​​corresponding to all pixel units, the average pixel value of the pixel points in each target area is calculated.

3. The backlight detection method according to claim 1, It is characterized in that The backlight detection method further comprises: performing rotation processing on the target imaging; The step of identifying the shooting scene of the target imaging is specifically used to respectively identify the shooting scene of the target imaging after the rotation processing.

4. The backlight detection method according to claim 1, It is characterized in that The step of dividing the target imaging into a plurality of target areas according to the recognition result of the shooting scene comprises: Determining a target object in the shooting scene according to a recognition result of the shooting scene; According to the target object, the target imaging is divided into a number of target areas.

5. The backlight detection method according to claim 4, It is characterized in that The step of identifying the shooting scene of the target imaging comprises: Identify the depth of field parameters of each undetermined object in the shooting scene of the target imaging; the depth of field parameters are used to characterize the spatial distance between the undetermined object and the shooting lens; The step of determining the target object in the shooting scene according to the recognition result of the shooting scene comprises: The target object in the shooting scene is determined according to the depth of field parameters of the objects to be determined.

6. The backlight detection method according to claim 4, It is characterized in that The backlight reference weight corresponding to the target area is determined according to the target object.

7. The backlight detection method according to claim 1, It is characterized in that The step of dividing the target imaging into a plurality of target areas according to the recognition result of the shooting scene comprises: Determining the light angle in the shooting scene according to the recognition result of the shooting scene; According to the light angle, the target imaging is divided into a number of target areas.

8. A backlight detection system, It is characterized in that include: A scene recognition module, used to identify the shooting scene of the target imaging; An imaging division module, used for dividing the target imaging into a plurality of target areas according to the recognition result of the shooting scene; The backlight detection module includes a regional pixel value calculation unit, an average pixel value technical unit, a regional confidence calculation unit, and a backlight confidence determination unit; The regional pixel value calculation unit is used to calculate the average pixel value of each pixel point in the target area respectively; The average pixel value technical unit is used to calculate the average pixel value of the target imaging according to the backlight reference weight corresponding to each of the target areas and the average pixel value; The regional confidence calculation unit is used to determine the backlight confidence corresponding to each target area by comparing the average pixel value of each target area with the average pixel value of the target imaging; The backlight confidence determination unit is used to select a maximum value from the backlight confidence of each target area as the backlight confidence of the target imaging; The backlight confidence value of each target area is calculated according to the following formula: cfd_i = (avg_i-avg_img) / avg_img, avg_img is the average pixel value of the entire target imaging, and avg_i is the average pixel value of the pixel points in target area i; The target areas correspond to different backlight reference weights; The backlight confidence level is used to characterize the backlight level of the shooting scene; The regional confidence calculation unit is used to determine the backlight confidence corresponding to each target region according to the average pixel value of each target region and the average pixel value of the target imaging.

9. The backlight detection system as claimed in claim 8, It is characterized in that The regional pixel value calculation unit is specifically used for: Divide the target imaging rule into a plurality of pixel units, wherein the number of pixel points in the pixel units is the same; Calculating the sum of pixel values ​​of each pixel point in each pixel unit respectively; According to the number of all pixel units in each target area and the sum of pixel values ​​corresponding to all pixel units, the average pixel value of the pixel points in each target area is calculated.

10. The backlight detection system according to claim 8, It is characterized in that The backlight detection system further includes a rotation processing module, which is used to perform rotation processing on the target imaging; The scene recognition module is used to respectively recognize the shooting scenes of the target images after the rotation processing.

11. The backlight detection system according to claim 8, It is characterized in that The imaging division module comprises: a target object determining unit, configured to determine a target object in the shooting scene according to a recognition result of the shooting scene; The first division unit is used to divide the target imaging into a plurality of target areas according to the target object.

12. The backlight detection system according to claim 11, It is characterized in that The scene recognition module is specifically used to: identify the depth of field parameters of each undetermined object in the shooting scene of the target imaging; the depth of field parameters are used to characterize the spatial distance between the undetermined object and the shooting lens; The target object determination unit is specifically configured to determine the target object in the shooting scene according to the depth of field parameters of the objects to be determined.

13. The backlight detection system according to claim 11, It is characterized in that The backlight reference weight corresponding to the target area is determined according to the target object.

14. The backlight detection system according to claim 8, It is characterized in that The imaging division module comprises: A light angle determination unit, configured to determine a light angle in the shooting scene according to a recognition result of the shooting scene; The second division unit is used to divide the target imaging into a plurality of target areas according to the light angle.

15. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, It is characterized in that When the processor executes the computer program, the backlight detection method according to any one of claims 1 to 7 is implemented.

16. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the backlight detection method according to any one of claims 1 to 7 is implemented.