Backlight scene recognition method and image acquisition equipment

By calculating the matching of multiple features of the image and the backlight scene characteristics, the backlight scene is accurately judged, which solves the misjudgment problem caused by the single judgment conditions of the existing methods, and achieves more flexible and accurate image processing.

CN120164150APending Publication Date: 2025-06-17HEFEI JUNZHENG TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311717804.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-12-14
Publication Date
2025-06-17

AI Technical Summary

Technical Problem

The existing backlight scene recognition methods have single judgment conditions, which can easily lead to misjudgment, especially in lens movement or special scenes, and it is necessary to know the position of the target to make accurate judgments, which limits the flexibility of image processing.

Method used

By calculating the variance, mean, median, block brightness and other features of the image, matching it with the backlight scene characteristics, it is determined whether it is a backlight scene. The specific steps include calculating the image variance, the difference between the mean and the median, the high brightness and low brightness ratio of the pixel distribution, as well as the brightness of the brightest and darkest blocks, and combining multiple conditions to determine whether it is a backlight scene.

Benefits of technology

It realizes accurate judgment of backlight scenes, reduces misjudgment, and is suitable for a variety of scenes, especially in lens movement or special scenes, and can process images more flexibly, improving the accuracy and adaptability of image processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120164150A_ABST
    Figure CN120164150A_ABST
Patent Text Reader

Abstract

The invention provides a backlight scene identification method and image acquisition equipment, and the method comprises the steps: S1, calculating an image variance according to the histogram information of an image, and entering S2 if the image variance is greater than a set image variance threshold value; s2, calculating a mean value and a median value of the current image according to histogram information of the image so as to judge whether to enter S3 or not; s3, according to the pixel distribution of the image, calculating the ratio of the number of pixel points greater than a high bright point threshold to the total number of pixel points, and the ratio of the number of pixel points less than a low bright point threshold to the total number of pixel points, so as to judge whether to enter S4; and S4, calculating the brightness of the brightest block and the brightness of the darkest block in the picture blocks of the current image, and judging whether the scene is a backlight scene or not according to a threshold value. The method has the advantages that the capability of accurately judging the scene is realized, the current scene is judged according to the characteristics of the backlight scene, and the image can be adaptively exposed according to the scene judgment result.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of image processing, and particularly relates to a backlight scene recognition method and an image acquisition device. Background Art

[0002] The continuous progress of image processing technology has greatly improved the image quality of devices such as cameras and video cameras. Each manufacturer has also developed image processing technology in order to obtain a better market share through better image effects and attract consumers with higher requirements for image quality.

[0003] Currently, in image processing technology, the automatic exposure amount needs to be adjusted according to the light environment during the imaging process, and it is particularly necessary to recognize the backlight scene. The current mainstream backlight scene recognition algorithm is based on the histogram variance. Whether it is a backlight scene is judged by setting a threshold, or the image is divided into several blocks, and a fixed threshold is selected to judge the image according to the brightness of each block. For example, if the difference between the brightness of the block in the region of interest and the brightness of the block in the non-region of interest is greater than the threshold, the current scene is considered a backlight scene.

[0004] However, when the existing method judges the backlight scene, the judgment condition is single, and it is easy to misjudge the scene, especially in the case of camera movement or some special scenes (such as an image with half black and half white), or it is necessary for the processing device to know the position of the target object in the current image to make a judgment, which greatly limits the image processing.

[0005] In view of this, there is an urgent need for a method for judging the backlight scene in the current market to make the judgment of the backlight scene more accurate and convenient. Summary of the Invention

[0006] In order to solve the above problems, the purpose of the present application is to provide a backlight scene recognition method and an image acquisition device, which match the features of the image such as variance, mean, median, and block brightness with the backlight scene features, so as to accurately judge whether it is a backlight scene.

[0007] Specifically, the technical solution of the present invention provides a backlight scene recognition method, and the method includes:

[0008] S1. According to the histogram information of the image, calculate the image variance. If the image variance is greater than the set image variance threshold, step S2 needs to be performed, otherwise it is judged that the current scene is a non-backlight environment;

[0009] S2. According to the histogram information of the image, calculate the mean and median of the current image, and judge whether the absolute value of the difference between the mean and median of the image is greater than the difference threshold. If it is greater, step S3 is performed, otherwise it is judged that the current scene is a non-backlight environment;

[0010] S3. Calculate the ratio of the number of pixels greater than the highlight threshold to the total number of pixels and the ratio of the number of pixels less than the low - light threshold to the total number of pixels according to the pixel distribution of the image, and determine whether the following conditions are met: the sum of the product of the highlight ratio and the low - light ratio and the highlight ratio is greater than a set first threshold, and the sum of the highlight ratio and the low - light ratio is less than a set second threshold; if the above conditions are met, proceed to step S4, otherwise, determine that the current scene is a non - backlight environment;

[0011] S4. Calculate the brightness of the brightest block and the darkest block in the current image block division, and determine whether the following conditions are met: the brightness of the brightest block in the image is greater than the lower threshold of the brightest block set, and the brightness of the darkest block in the image is less than the upper threshold of the darkest block set; if the conditions are met, confirm it as a backlight scene, otherwise, determine it as a non - backlight scene.

[0012] According to a preferred embodiment, the backlight scene recognition method further includes: setting the image variance threshold to 10.

[0013] According to a preferred embodiment, the backlight scene recognition method further includes: setting the difference threshold to 20.

[0014] According to a preferred embodiment, the backlight scene recognition method further includes: setting the first threshold to 0.15 and the second threshold to 0.8.

[0015] According to a preferred embodiment, the backlight scene recognition method further includes: setting the lower threshold of the brightest block to 180 and the upper threshold of the darkest block to 10.

[0016] According to a preferred embodiment, the backlight scene recognition method further includes the following steps for exposure compensation: S5. When the current environment is determined to be a backlight scene, according to the selection of bright - level priority or dark - level priority, restore the brightness of the over - bright area or over - dark area to normal brightness.

[0017] According to a preferred embodiment, the backlight scene recognition method further includes the following steps: S501. Select the current exposure compensation mode as bright - level priority or dark - level priority; S502. Set the intensity of strong light suppression and backlight compensation; S503. If the current scene is a backlight scene and the exposure compensation mode is bright - level priority, reduce the exposure according to the set intensity of strong light suppression to reduce the brightness of the over - bright area and restore it to normal brightness; if the current scene is a backlight scene and the exposure compensation mode is dark - level priority, increase the exposure according to the set intensity of backlight compensation to increase the brightness of the over - dark area and restore it to normal brightness; if the current scene is a normal scene, perform normal exposure on the image.

[0018] According to a preferred embodiment, the backlight scene recognition method further includes the following steps for aborting exposure compensation: S6. During the exposure compensation phase, if the current environment changes from a backlight environment to a non-backlight environment, abort the exposure compensation; otherwise, continue to maintain the exposure compensation.

[0019] According to a preferred embodiment, the backlight scene recognition method further includes the determination of the conversion of the backlight environment to a non-backlight environment, including the determination of the following conditions:

[0020] Condition 1: The image variance is less than the set image variance threshold;

[0021] Condition 2: The absolute value of the difference between the mean and median of the image is less than the difference threshold;

[0022] Condition 3: The sum of the product of the high-brightness point ratio and the low-brightness point ratio and the high-brightness point ratio is less than the set first threshold, or the sum of the high-brightness point ratio and the low-brightness point ratio is greater than the set second threshold;

[0023] Condition 4: The brightness of the brightest block in the image is less than the lower threshold of the brightest block set, or the brightness of the darkest block in the image is greater than the upper threshold of the darkest block set;

[0024] If one of the above four conditions is met, the current environment is determined to be a non-backlight environment and the exposure compensation is aborted; otherwise, the exposure compensation is continued until the current environment is determined to be a non-backlight scene.

[0025] Specifically, the technical solution of the present invention provides an image acquisition device, which uses the backlight scene recognition method described in the present invention.

[0026] Therefore, the advantages of this application are as follows: The backlight scene recognition method and the image acquisition device of the present invention have the ability to accurately judge the scene, judge the current scene according to the characteristics of the backlight scene, and can perform adaptive exposure on the image according to the result of the scene judgment. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] The drawings described herein are used to provide a further understanding of the present invention, form a part of this application, and do not limit the present invention.

[0028] Figure 1 It is a flowchart of a backlight scene recognition method of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0029] In order to more clearly understand the technical content and advantages of the present invention, the present invention will be further described in detail below with reference to the accompanying drawings.

[0030] As Figure 1As shown, a backlight scene recognition method provided by the present invention determines whether the current scene is backlit through judgment conditions and corresponding thresholds. The following uses specific embodiments for disclosure and is not intended for limitation. The above backlight scene recognition method includes the following steps:

[0031] S1. According to the histogram information of the image, calculate the image variance var. If the image variance var is greater than the set image variance threshold var_th_s, that is, var > var_th_s, then step S2 needs to be performed; otherwise, it is determined that the current scene is a non-backlit environment.

[0032] In the above S1, var_th_s is the set image variance threshold, which is generally set to 10.

[0033] S2. According to the histogram information of the image, calculate the mean mean_luma and median mid_luma of the current image, and determine whether the absolute value of the difference between the mean mean_luma and the median mid_luma of the image is greater than the difference threshold Th_mean_mid_diff_s, that is

[0034] abs(mean_luma - mid_luma) > Th_mean_mid_diff_s,

[0035] If the condition is satisfied, then step S3 is performed; otherwise, it is determined that the current scene is a non-backlit environment.

[0036] In the above S2, Th_mean_mid_diff_s is the set difference threshold, which is generally set to 20.

[0037] S3. According to the pixel distribution of the image, calculate the ratio sat_ratio of the number of pixel points greater than the high-brightness threshold to the total number of pixel points and the ratio dark_ratio of the number of pixel points less than the low-brightness threshold to the total number of pixel points, that is

[0038] Sat_ratio = sat_sum / pix_sum

[0039] Dark_ratio = dark_sum / pix_sum

[0040] Where sat_sum is the number of pixel points greater than the high-brightness threshold, dark_sum is the number of pixel points less than the low-brightness threshold, and pix_sum is the total number of pixel points.

[0041] According to the calculated sat_ratio and dark_ratio, determine whether the following is satisfied:

[0042] The product of the high highlight ratio and the low highlight ratio plus the high highlight ratio is greater than a set first threshold, and the sum of the high highlight ratio and the low highlight ratio is less than a set second threshold;

[0043] That is, the following formula:

[0044] Sat_ratio * (1 + dark_ratio) > Th_sat_dark_mult_s and

[0045] Sat_ratio + dark_ratio < Th_sat_dak_add_s.

[0046] If satisfied, perform step S4; if not satisfied, determine that the current scene is a non-backlight environment.

[0047] In the above S3, the first threshold Th_sat_dark_mult_s and the second threshold Th_sat_dark_add_s are set thresholds, which can be set to 0.15 and 0.8 respectively.

[0048] S4. Calculate the brightness y_max of the brightest block and the brightness y_min of the darkest block in the current image frame partition. Among them, the brightness of the darkest block is the brightness of the block with the smallest average brightness among all partitions of the image.

[0049] Based on the obtained y_max and y_min, perform the following judgment: the brightness of the brightest block in the image is greater than the set lower threshold of the brightest block, and the brightness of the darkest block in the image is less than the set upper threshold of the darkest block; that is, the following formula:

[0050] Y_max > Th_y_max_s;

[0051] Y_min < Th_y_min_s.

[0052] Among them, Th_y_max_s and Th_y_min_s are the lower threshold of the brightest block and the upper threshold of the darkest block respectively, and are generally set to 180 and 10 respectively. For a backlight scene, there must be bright and dark areas, so the brightest block in the image will be greater than a certain threshold, and correspondingly, the darkest block in the image will be less than a certain threshold to conform to the characteristics of the backlight scene. Therefore, Y_max > Th_y_max_s and Y_min < Th_y_min_s are used as the detection conditions for the backlight scene.

[0053] If the conditions are satisfied, it is confirmed as a backlight scene; otherwise, it is determined as a non-backlight scene.

[0054] The above S1 to S4 are the steps to identify whether the current image is a backlight scene.

[0055] The present invention also proposes an exposure compensation method, that is, in the exposure compensation stage, the brightness of the image is adjusted by exposure compensation according to whether it is a backlit scene. Exposure compensation refers to adjusting the brightness of the image so that the image adapts to the movement of the human eye. Specifically, the following steps are included:

[0056] S5. When the current environment is judged as a backlit scene, the brightness of the overly bright area or overly dark area is restored to normal brightness according to the selection of light level priority or dark level priority. Among them, light level priority is a setting for suppressing strong light and reducing exposure of the image. Light level priority can make the image obtain details in the bright area, but the details in the dark area of ​​the image may be lost. Dark level priority is a setting for backlight compensation and increasing exposure of the image. Dark level priority can make the image obtain details in the dark area, but the details in the bright area of ​​the image may be lost.

[0057] Step S5 includes the following steps:

[0058] S501. Select the current exposure compensation mode as light level priority or dark level priority;

[0059] In this step, the user makes settings according to his or her own needs. If the user pays attention to the details of the bright area and wants to obtain the details of the bright area, select Bright Level Priority; if the user pays attention to the details of the dark area and wants to obtain the details of the dark area, select Dark Level Priority.

[0060] S502. Set the intensity of strong light suppression and backlight compensation;

[0061] S503. If the current scene is a backlit scene and the exposure compensation mode is bright level priority, then according to the set strong light suppression intensity, the exposure is reduced to reduce the brightness of the over-bright area and restore it to normal brightness; if the current scene is a backlit scene and the exposure compensation mode is dark level priority, then according to the set backlight compensation intensity, the exposure is increased to increase the brightness of the over-dark area and restore it to normal brightness; if the scene is a normal scene at this time, the image is exposed normally.

[0062] The present invention further proposes a method for terminating exposure compensation, comprising the following steps:

[0063] S6. In the exposure compensation stage, according to a backlight scene recognition method of the present invention, if the current environment is converted from a backlight environment to a non-backlight environment, the exposure compensation is terminated, otherwise the exposure compensation is continued.

[0064] Specifically, the conversion from the backlight environment to the normal environment is determined by the following exposure termination conditions:

[0065] Condition 1: The image variance is less than the set image variance threshold; that is, determine whether the image variance var is less than the set image variance threshold var_th_o, the formula is var <var_th_o;

[0066] Condition 2: The absolute value of the difference between the mean and the median of the image is less than the difference threshold; that is, it is judged whether the absolute value of the difference between the mean mean_luma and the median mid_luma of the image is less than the difference threshold Th_mean_mid_diff_o, and the formula is abs(mean_luma - mid_luma) < Th_mean_mid_diff_o;

[0067] Condition 3: The sum of the product of the highlight ratio and the low highlight ratio and the highlight ratio is less than the set first threshold, or the sum of the highlight ratio and the low highlight ratio is greater than the set second threshold; the formula is Sat_ratio * (1 + dark_ratio) < Th_sat_dark_mult_o or Sat_ratio + dark_ratio > Th_sat_dak_add_o.

[0068] Condition 4: The brightness of the brightest block in the image is less than the lower threshold of the brightest block set, or the brightness of the darkest block in the image is greater than the upper threshold of the darkest block set; the formula is Y_max < Th_y_max_o or Y_min > Th_y_min_o.

[0069] If one of the above four conditions is met, the current environment is recognized as a non-backlight environment, and the exposure compensation is aborted; otherwise, the exposure compensation is continued until the current environment is determined to be a non-backlight scene.

[0070] The above image variance threshold var_th_o, difference threshold Th_mean_mid_diff_o, first threshold Th_sat_dark_mult_o, second threshold Th_sat_dak_add_o, lower threshold Th_y_max_o of the brightest block, and upper threshold Th_y_min_o of the darkest block are all parameters for judging whether the current environment needs to abort backlight compensation. And the aforementioned image variance threshold var_th_s, difference threshold Th_mean_mid_diff_s, first threshold Th_sat_dark_mult_s, second threshold Th_sat_dak_add_s, lower threshold Th_y_max_s of the brightest block, and upper threshold Th_y_min_s of the darkest block are judgment threshold parameters for judging whether the current environment is a backlight scene. Therefore, although the concepts are the same, the values are not universal and are distinguished by ending with s and o.

[0071] The present invention also provides an image acquisition device that uses the above-mentioned backlight scene recognition method, exposure compensation method, and exposure compensation abort method.

[0072] The above are only the preferred embodiments of the present invention and are not intended to limit the present invention. For those skilled in the art, various modifications and variations can be made to the embodiments of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included within the protection scope of the present invention.

Claims

1. A backlight scene recognition method, characterized in that, It includes the following steps: S1. Calculate the image variance according to the histogram information of the image. If the image variance is greater than the set image variance threshold, step S2 is required; otherwise, it is determined that the current scene is a non-backlight environment; S2. Calculate the mean and median of the current image according to the histogram information of the image, and determine whether the absolute value of the difference between the mean and median of the image is greater than the difference threshold. If it is greater, step S3 is performed; otherwise, it is determined that the current scene is a non-backlight environment; S3. According to the pixel distribution of the image, calculate the ratio of the number of pixels greater than the highlight threshold to the total number of pixels, and the ratio of the number of pixels less than the low-light threshold to the total number of pixels, and determine whether the following conditions are met: the sum of the product of the highlight ratio and the low-light ratio and the highlight ratio is greater than the set first threshold, and the sum of the highlight ratio and the low-light ratio is less than the set second threshold; if the above conditions are met, step S4 is performed; if not, it is determined that the current scene is a non-backlight environment; S4. Calculate the brightness of the brightest block and the darkest block in the current image block division, and determine whether the following conditions are met: the brightness of the brightest block in the image is greater than the lower limit threshold of the brightest block set, and the brightness of the darkest block in the image is less than the upper limit threshold of the darkest block set; if the conditions are met, it is confirmed as a backlight scene; otherwise, it is determined as a non-backlight scene.

2. The backlight scene recognition method according to claim 1, characterized in that, The image variance threshold is set to 10.

3. The backlight scene recognition method according to claim 1, characterized in that, The difference threshold is set to 20.

4. The backlight scene recognition method according to claim 1, characterized in that, The first threshold is set to 0.15, and the second threshold is set to 0.

8.

5. The backlight scene recognition method according to claim 1, characterized in that, The lower limit threshold of the brightest block is set to 180, and the upper limit threshold of the darkest block is set to 10.

6. The backlight scene recognition method according to claim 1, characterized in that, It also includes the following steps for exposure compensation: S5. When the current environment is determined to be a backlight scene, according to the selection of bright-level priority or dark-level priority, restore the brightness of the over-bright area or the over-dark area to normal brightness.

7. The backlight scene recognition method according to claim 6, characterized in that, It includes the following steps: S501. Select the current exposure compensation mode as bright-level priority or dark-level priority; S502. Set the intensity of strong light suppression and backlight compensation; S503. If the current scene is a backlight scene and the exposure compensation mode is bright-level priority, reduce the exposure according to the set intensity of strong light suppression to reduce the brightness of the over-bright area and restore it to normal brightness; if the current scene is a backlight scene and the exposure compensation mode is dark-level priority, increase the exposure according to the set intensity of backlight compensation to increase the brightness of the over-dark area and restore it to normal brightness; If the scene is a normal scene at this time, perform normal exposure on the image.

8. The backlight scene recognition method according to claim 1, characterized in that, It also includes the following steps for terminating exposure compensation: S6. During the exposure compensation stage, if the current environment changes from a backlight environment to a non-backlight environment, terminate the exposure compensation; otherwise, continue to maintain the exposure compensation.

9. The backlight scene recognition method according to claim 8, characterized in that, The determination of the conversion of the backlight environment to a non-backlight environment includes judging the following conditions: Condition 1: The image variance is less than the set image variance threshold; Condition 2: The absolute value of the difference between the mean and median of the image is less than the difference threshold; Condition 3: The sum of the product of the highlight ratio and the low-light ratio and the highlight ratio is less than the set first threshold, or the sum of the highlight ratio and the low-light ratio is greater than the set second threshold; Condition 4: The brightness of the brightest block in the image is less than the lower threshold of the set brightest block, or the brightness of the darkest block in the image is greater than the upper threshold of the set darkest block; If one of the above four conditions is met, the current environment is identified as a non-backlit environment and the exposure compensation is aborted; otherwise, the exposure compensation is continued until the current environment is determined to be a non-backlit scene.

10. An image acquisition device, characterized in that, It uses the backlit scene recognition method described in claims 1-8.