Method and system for dynamically adjusting camera parameters based on light environment, terminal and medium
By establishing a mapping table between brightness levels and camera parameters and acquiring real-time light intensity, combined with image quality assessment and multi-sensor data fusion, the problem of camera image quality flexibility in different lighting environments is solved, more accurate and faster parameter adjustment is achieved, parameter flicker is avoided, and the adaptability and lightweightness of the system are improved.
Patent Information
- Application Number
- CN202510872063.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-26
- Publication Date
- 2025-10-03
Smart Images

Figure CN120751266A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer vision, and in particular to a method, system, terminal and medium for dynamically adjusting camera parameters based on light environment. Background Art
[0002] As a front-end device for data collection, the image quality of a camera directly impacts the recognition accuracy of back-end algorithms. In numerous scenarios, such as smart surveillance and facial recognition, cameras must function in diverse lighting environments. Camera image quality is highly dependent on its configuration parameters. Common adjustable parameters include camera hardware parameters such as exposure, white balance, gain, brightness, and contrast, as well as SDK application-level algorithm configuration parameters (such as liveness detection threshold, blur level, and occlusion level). These configuration parameters are typically set manually or preset based on the usage scenario. These fixed values lack flexibility and adaptability.
[0003] Currently, some cameras offer automatic exposure and white balance adjustment features, but these automatic adjustments are generally based on image analysis algorithms, such as statistical analysis of image histograms. These algorithms suffer from slow response, low accuracy, and are prone to misjudgment. In recent years, some solutions have integrated external environmental sensors into the camera system to adjust the camera's operating mode based on brightness. However, these solutions often have fragmented functionality and lack direct control over camera SDK parameters, making them incapable of achieving true "on-demand adaptive adjustment." Therefore, a more precise and real-time system is still needed to dynamically adjust camera parameters as ambient light changes. Summary of the Invention
[0004] To solve the above problems, the present invention provides a method, system, terminal and medium for dynamically adjusting camera parameters based on the light environment, thereby improving the accuracy and response speed of parameter adjustment.
[0005] In a first aspect, the technical solution of the present invention provides a method for dynamically adjusting camera parameters based on the light environment, comprising the following steps: Maintain a mapping table between brightness levels and camera parameters, including hardware parameters and SDK configuration parameters; Real-time acquisition of ambient light intensity collected by the light sensor; According to the predefined intensity level classification rules, the current ambient light intensity is divided into corresponding brightness levels; Check whether the current brightness level is the same as the previous brightness level. If they are the same, no processing is performed. If they are different, the mapping table is searched to obtain the parameter combination corresponding to the current brightness level, and the camera parameters are adjusted and updated with the current parameter combination found.
[0006] In an optional embodiment, the method further comprises the following steps: The collected images at each brightness level are stored separately; For each brightness level, obtain several recent acquired images and preprocess each acquired image; The image edge clarity of each collected image is calculated by gradient energy, and the image edge clarity of all collected images is averaged as the clarity score; By counting the histograms of each collected image, the brightness balance score is obtained; The noise of each collected image is evaluated by local variance to obtain the noise evaluation value of each collected image, and the average of all noise evaluation values is taken as the noise score; The clarity score, brightness balance score, and noise score are weighted and summed to obtain the hardware parameter quality score; Check whether the hardware parameter quality score is lower than the first threshold. If not, no processing is performed. If so, adjust the hardware parameters corresponding to the current brightness level in the mapping table according to the clarity score, brightness balance score, and noise score.
[0007] In an optional embodiment, the brightness balance score is obtained by statistically analyzing the histograms of each collected image, specifically including: Calculate the image grayscale histogram ,in ; Statistical effective brightness range ; The standard deviation of the brightness distribution is calculated by the following formula and peak ratio ,
[0008]
[0009] The brightness balance evaluation value of the captured image is calculated using the following formula:
[0010] Where, is the weight coefficient; The average of the brightness balance evaluation values of each collected image is taken as the brightness balance score.
[0011] In an optional embodiment, noise evaluation is performed on each collected image using local variance to obtain a noise evaluation value for each collected image, and the average of all noise evaluation values is taken as a noise score, specifically including: Divide the collected image into blocks and calculate the grayscale value variance of each image block ; Take the median of the gray value variance of all image blocks as the noise estimate ; The noise evaluation value of the acquired image is calculated by the following formula:
[0012] Where, is the scaling factor; The noise evaluation values of each collected image are averaged as the noise score.
[0013] In an optional embodiment, the method further comprises the following steps: Get feedback on subsequent algorithms, including pass rates and false positive rate ; The SDK configuration parameter quality score is calculated using the following formula:
[0014] Where, is the weight coefficient; Check whether the SDK configuration parameter quality score is lower than the second threshold. If not, no processing is performed. If so, adjust the SDK configuration parameters in the mapping table.
[0015] In an optional embodiment, obtaining the ambient light intensity collected by the light sensor in real time specifically includes: Multiple cameras are set up in the same light environment area, and each camera is equipped with a light sensor; Select one camera as the master camera and the rest as slave cameras. The master camera and the slave cameras communicate with each other through the local area network. Each slave camera sends the ambient light intensity collected by its light sensor to the master camera; The main camera uses the ambient light intensity received through the local area network and the ambient light intensity collected by its own sensor as observation values, and obtains the optimal estimated ambient light intensity based on the observation values through Kalman gain weighted fusion; The master camera broadcasts the best estimated ambient light intensity to each slave camera.
[0016] In an optional embodiment, the current ambient light intensity is divided into corresponding brightness levels, specifically including: Divide the optimal estimated ambient light intensity into corresponding brightness levels.
[0017] In a second aspect, the technical solution of the present invention provides a system for dynamically adjusting camera parameters based on the light environment, comprising: A mapping table maintenance module, configured to maintain a mapping table between brightness levels and camera parameters, wherein the camera parameters include hardware parameters and SDK configuration parameters; Light intensity acquisition module, used to obtain the ambient light intensity collected by the light sensor in real time; The camera parameter adjustment module is used to divide the current ambient light intensity into corresponding brightness levels according to pre-defined intensity level division rules; detect whether the current brightness level is the same as the previous brightness level. If the same, no processing is performed; if different, the mapping table is searched to obtain the parameter combination corresponding to the current brightness level, and the camera parameters are adjusted and updated with the current parameter combination found.
[0018] In a third aspect, the technical solution of the present invention provides a terminal, including: A memory for storing a program for dynamically adjusting camera parameters based on the light environment; A processor is configured to implement the steps of any of the above-mentioned methods for dynamically adjusting camera parameters based on a light environment when executing the program for dynamically adjusting camera parameters based on a light environment.
[0019] In a fourth aspect, the technical solution of the present invention provides a computer-readable storage medium, on which is stored a program for dynamically adjusting camera parameters based on the light environment. When the program for dynamically adjusting camera parameters based on the light environment is executed by a processor, the steps of the method for dynamically adjusting camera parameters based on the light environment as described in any one of the above items are implemented.
[0020] It can be seen from the above technical solutions that the present application has the following advantages: pre-maintaining a mapping table of brightness levels and camera parameters, obtaining ambient light intensity in real time, dividing the ambient light intensity into brightness levels, and then finding the optimal parameter combination corresponding to the light intensity according to the mapping table, including hardware parameters and SDK configuration parameters. The present invention obtains ambient light intensity information through a light sensor, combines the camera hardware parameters and SDK parameter configuration information, establishes a parameter adjustment model, maps light intensity to various camera-related parameters, and constructs a multi-dimensional adjustment capability. The ambient brightness is obtained in real time through an external light sensor, does not rely on image calculation, has a shorter response time, and is more sensitive to dynamic environmental changes. The brightness-parameter mapping table and multi-parameter linkage adjustment method are used. Compared with the single parameter adjustment method, it can more comprehensively optimize image quality. In addition, the light intensity is divided into brightness levels to prevent the parameter "flickering" problem caused by frequent light fluctuations; further parameter calculation can be completed on a low-power MCU, avoiding the use of complex image processing algorithms, which helps to make the system lightweight and low-cost. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] In order to more clearly illustrate the technical solution of the present application, the following is a brief introduction to the drawings required for the description. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0022] Figure 1 A flowchart of a method for dynamically adjusting camera parameters based on the lighting environment is provided in an embodiment of the present invention.
[0023] Figure 2 A schematic block diagram of the system structure for dynamically adjusting camera parameters based on the light environment provided by an embodiment of the present invention.
[0024] Figure 3 A schematic diagram of the structure of a terminal provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0025] In order to make the application objectives, features, and advantages of this application more obvious and easy to understand, the technical solutions protected by this application will be clearly and completely described below using specific embodiments and drawings. Obviously, the embodiments described below are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0026] Unless otherwise defined, all technical and scientific terms used in this application have the same meaning as those commonly understood by those skilled in the art to which the present invention pertains. The terms used in this application and in the specification of the present invention are for the purpose of describing specific embodiments only and are not intended to limit the present invention.
[0027] Figure 1 A flow chart of a method for dynamically adjusting camera parameters based on light environment provided by an embodiment of the present invention. Figure 1 The execution entity may be a system for dynamically adjusting camera parameters based on the lighting environment. The method for dynamically adjusting camera parameters based on the lighting environment provided in the embodiments of the present invention is executed by a computer device. Accordingly, the system for dynamically adjusting camera parameters based on the lighting environment runs on the computer device. The order of the steps in this flowchart may be changed, and some steps may be omitted, depending on different needs.
[0028] like Figure 1 As shown, the method includes the following steps.
[0029] S1, maintain a mapping table between brightness levels and camera parameters, wherein the camera parameters include hardware parameters and SDK configuration parameters.
[0030] S2, real-time acquisition of ambient light intensity collected by the light sensor.
[0031] S3: Classify the current ambient light intensity into corresponding brightness levels according to a predefined intensity level classification rule.
[0032] S4, detect whether the current brightness level is the same as the previous brightness level. If the same, no processing is performed. If different, search the mapping table to obtain the parameter combination corresponding to the current brightness level, and adjust and update the camera parameters with the current parameter combination found.
[0033] Table 1 below is a schematic mapping table of brightness levels and camera parameters. Camera parameters include hardware parameters and SDK configuration parameters. Hardware parameters include exposure value, white balance mode, gain value, brightness, contrast, etc. SDK configuration parameters include biopsy threshold, blur level, and occlusion level.
[0034] Table 1: Brightness level and camera parameter mapping table
[0035] In some optional implementations, the hardware parameters corresponding to each brightness level in the mapping table are adjusted through image quality feedback to improve adjustment accuracy, which specifically includes the following steps.
[0036] S5, storing the collected images at each brightness level respectively.
[0037] The captured images at each brightness level are stored separately, so that the camera parameters corresponding to each brightness level in the mapping table can be adjusted and updated separately.
[0038] S6, for each brightness level, obtain several recent collected images, and pre-process each collected image.
[0039] This step performs standardized preprocessing on the collected images, such as denoising and normalization, to ensure the accuracy of the evaluation.
[0040] S7, calculating the image edge clarity of each collected image by using gradient energy, and calculating an average value of the image edge clarity of all collected images as a clarity score.
[0041] The clarity is measured by the image gradient energy, and the edge strength can be calculated using the Laplacian operator. The formula is as follows:
[0042] Where, To collect images at pixel points Grayscale value (0~255), is the width and height of the acquired image, is the total number of pixels.
[0043] is the Laplacian operator result (second-order derivative approximation), calculated as follows:
[0044] Refer to the maximum theoretical value Will Map to the range of [0,100] for subsequent unified operations.
[0045] The edge strength is recorded as the image edge clarity, and the average of all image edge clarity of the most recent several collected images is taken as the clarity score. .
[0046] S8, obtaining a brightness balance score by statistically analyzing the histograms of each collected image.
[0047] Brightness balance evaluates the uniformity of image brightness distribution to avoid overexposure or underexposure. It includes the following steps.
[0048] S8.1, calculate the image grayscale histogram ,in .
[0049] S8.2, statistics of effective brightness range , for example, removing the top 5% and bottom 5% of extreme pixels.
[0050] S8.3, calculate the standard deviation of the brightness distribution using the following formula and peak ratio ,
[0051]
[0052] S8.4, calculate the brightness balance evaluation value of the collected image using the following formula:
[0053] Where, is the weight coefficient.
[0054] S8.5, take the average of the brightness balance evaluation values of each collected image as the brightness balance score .
[0055] S9, performing noise evaluation on each collected image by using local variance to obtain a noise evaluation value of each collected image, and taking an average of all noise evaluation values as a noise score.
[0056] This step evaluates noise through local variance, which specifically includes the following steps.
[0057] S9.1, divide the collected image into blocks and calculate the grayscale value variance of each image block .
[0058] Grayscale value variance is a statistic that measures the degree of data dispersion. For each block in an image (e.g., 16×16 pixels), the variance is calculated as the degree of fluctuation of the grayscale values of the pixels within that block:
[0059] Where, For the first The gray value of a pixel, is the mean gray value of all pixels in the block, that is, , is the sum of the pixels in the block.
[0060] S9.2, take the median of the gray value variance of all image blocks as the noise estimate .
[0061] S9.3, calculate the noise evaluation value of the collected image using the following formula,
[0062] Where, is the scaling factor.
[0063] S9.4, take the average of the noise evaluation values of each collected image as the noise score .
[0064] S10, performing weighted summation of the clarity score, the brightness balance score, and the noise score to obtain a hardware parameter quality score.
[0065] Hardware parameter quality score Expressed as,
[0066] Where, is the weight coefficient.
[0067] S11, detecting whether the hardware parameter quality score is lower than a first threshold, if not, no processing is performed, if so, adjusting the hardware parameters corresponding to the current brightness level in the mapping table according to the clarity score, brightness balance score, and noise score.
[0068] Specifically, according to To adjust the corresponding parameters based on the shortcomings of the indicators, such as insufficient clarity, increase exposure or reduce gain, you can use reinforcement learning or gradient descent to fine-tune the parameters within the current lighting range in the mapping table to generate new parameter combinations.
[0069] In some optional implementations, the SDK configuration parameters in the mapping table are adjusted through feedback from subsequent algorithms to improve adjustment accuracy, which specifically includes the following steps.
[0070] S12, obtain feedback results of subsequent algorithms, including pass rate and false positive rate .
[0071] S13, calculate the SDK configuration parameter quality score using the following formula:
[0072] Where, is the weight coefficient.
[0073] S14, detecting whether the SDK configuration parameter quality score is lower than a second threshold, if not, no processing is performed, and if so, adjusting the SDK configuration parameters in the mapping table.
[0074] In some optional implementations, Kalman filtering is used to fuse multi-sensor data to improve the robustness of illumination assessment, avoid misjudgments by a single sensor, and address the limitations of single illumination sensors in complex scenarios (e.g., backlighting and mixed light sources). Accordingly, step S2 acquires the ambient light intensity collected by the illumination sensor in real time, specifically including the following steps.
[0075] S2.1, multiple cameras are set up in the same light environment area, and each camera is equipped with a light sensor.
[0076] When multiple cameras are deployed in the same lighting environment (such as the same room or the same monitoring area), they can collaboratively adjust the parameters (exposure, gain, etc.) of all cameras by sharing a unified light intensity estimate, which can reduce repeated calculations and ensure imaging consistency among multiple cameras.
[0077] S2.2, select one camera as the master camera and the rest as slave cameras, and the master camera and the slave cameras communicate through the local area network.
[0078] The main camera is responsible for running the Kalman filter, fusing its own sensor data and other slave camera sensor data to output a unified light estimate .
[0079] S2.3, each slave camera sends the ambient light intensity collected by its light sensor to the master camera.
[0080] The slave camera sends the local light sensor data to the main camera, and the main camera then broadcasts For all slave cameras, each camera adjusts its parameters independently according to this value.
[0081] S2.4, the main camera uses the ambient light intensity received through the local area network and the ambient light intensity collected by its own sensor as observation values, and obtains the optimal estimated ambient light intensity based on the observation values through Kalman gain weighted fusion.
[0082] The Kalman filter is used to fuse the multi-sensor data to obtain the optimal estimated ambient light intensity. The process includes the prediction stage (prior estimation) and the update stage (posterior estimation).
[0083] The first stage is the prediction stage (a priori estimation).
[0084] Assuming that the light intensity changes slowly over time and directly inherits the estimated value of the previous moment when there is no control input, the state prediction is expressed as,
[0085] in, For the time steps.
[0086] The error covariance prediction is expressed as,
[0087] in, is the error covariance matrix of state estimation, and the initial value can be set to the unit matrix; is the process noise covariance, which needs to be adjusted to reflect the unpredictability of state changes.
[0088] The second stage is the update stage (posterior estimation).
[0089] Kalman gain The calculation formula is,
[0090] in, is the observation matrix, which maps the state to the observation space. If the illumination is directly observed, ; To observe the noise covariance, it needs to be set according to the sensor accuracy, such as .
[0091] The state update is expressed as,
[0092] in, is the observation residual, that is, the difference between the actual observation value and the predicted observation value. Kalman gain Dynamically weighted residuals,correct prior estimates.
[0093] The error covariance update is expressed as,
[0094] The final output It is the estimated value of light intensity after fusing multi-sensor data with the minimum mean square error.
[0095] In step S2.5, the master camera broadcasts the optimal estimated ambient light intensity to each slave camera.
[0096] Main camera broadcast For all slave cameras, each camera adjusts its parameters independently according to this value.
[0097] Furthermore, in step S3, the current ambient light intensity is divided into corresponding brightness levels, specifically, the optimal estimated ambient light intensity is divided into Divide into corresponding brightness levels, such as performing brightness level division according to the division rules represented by the first two columns in Table 1.
[0098] The above describes in detail an embodiment of a method for dynamically adjusting camera parameters based on the light environment. Based on the method for dynamically adjusting camera parameters based on the light environment described in the above embodiment, an embodiment of the present invention also provides a system for dynamically adjusting camera parameters based on the light environment corresponding to this method.
[0099] Figure 2 This is a schematic block diagram of the structure of a system for dynamically adjusting camera parameters based on the lighting environment, provided in an embodiment of the present invention. In this embodiment, system 200 for dynamically adjusting camera parameters based on the lighting environment can be divided into multiple functional modules based on the functions they perform. A module, as used herein, refers to a series of computer program segments that can be executed by at least one processor and perform a fixed function, and is stored in a memory.
[0100] The mapping table maintenance module 210 is used to maintain a mapping table between brightness levels and camera parameters, where the camera parameters include hardware parameters and SDK configuration parameters.
[0101] The light intensity acquisition module 220 is used to obtain the ambient light intensity collected by the light sensor in real time.
[0102] The camera parameter adjustment module 230 is used to divide the current ambient light intensity into corresponding brightness levels according to predefined intensity level division rules; detect whether the current brightness level is the same as the previous brightness level. If the same, no processing is performed; if different, the mapping table is searched to obtain the parameter combination corresponding to the current brightness level, and the camera parameters are adjusted and updated with the current parameter combination found.
[0103] The system of this embodiment for dynamically adjusting camera parameters based on the light environment is used to implement the aforementioned method for dynamically adjusting camera parameters based on the light environment. Therefore, the specific implementation method of this system can be seen in the embodiment part of the method for dynamically adjusting camera parameters based on the light environment in the previous text. Therefore, its specific implementation method can refer to the description of the corresponding embodiments of each part and will not be elaborated here.
[0104] In addition, since the system for dynamically adjusting camera parameters based on the light environment of this embodiment is used to implement the aforementioned method for dynamically adjusting camera parameters based on the light environment, its function corresponds to that of the aforementioned method and will not be repeated here.
[0105] Figure 3 The present invention provides a schematic diagram of a terminal 300, including a processor 310, a memory 320, and a communication unit 330. The processor 310 is configured to implement the following steps when executing a program stored in the memory 320 to dynamically adjust camera parameters based on the light environment: Maintain a mapping table between brightness levels and camera parameters, including hardware parameters and SDK configuration parameters; Real-time acquisition of ambient light intensity collected by the light sensor; According to the predefined intensity level classification rules, the current ambient light intensity is divided into corresponding brightness levels; Check whether the current brightness level is the same as the previous brightness level. If they are the same, no processing is performed. If they are different, the mapping table is searched to obtain the parameter combination corresponding to the current brightness level, and the camera parameters are adjusted and updated with the current parameter combination found.
[0106] The terminal 300 includes a processor 310, a memory 320, and a communication unit 330. These components communicate via one or more buses. Those skilled in the art will appreciate that the server structure shown in the figure does not limit the present invention; it may be a bus structure or a star structure, and may include more or fewer components than shown, or combine certain components, or arrange the components differently.
[0107] Memory 320 can be used to store execution instructions of processor 310. Memory 320 can be implemented by any type of volatile or non-volatile storage device, or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk, or optical disk. When the execution instructions in memory 320 are executed by processor 310, terminal 300 can perform some or all of the steps in the above-described method embodiments.
[0108] The processor 310 is the control center of the storage terminal. It uses various interfaces and lines to connect various parts of the entire electronic terminal. It executes various functions of the electronic terminal and / or processes data by running or executing software programs and / or modules stored in the memory 320, and calling data stored in the memory. The processor can be composed of an integrated circuit (IC), for example, it can be composed of a single packaged IC, or it can be composed of multiple packaged ICs with the same or different functions. For example, the processor 310 can only include a central processing unit (CPU). In the embodiment of the present invention, the CPU can be a single computing core or multiple computing cores.
[0109] The communication unit 330 is configured to establish a communication channel so that the storage terminal can communicate with other terminals, receive user data sent by other terminals, or send user data to other terminals.
[0110] The present invention also provides a computer storage medium, wherein the storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM).
[0111] The present invention also provides a computer storage medium, wherein the storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM).
[0112] The computer storage medium stores a program for dynamically adjusting camera parameters based on the light environment. When the program for dynamically adjusting camera parameters based on the light environment is executed by the processor, the following steps are implemented: Maintain a mapping table between brightness levels and camera parameters, including hardware parameters and SDK configuration parameters; Real-time acquisition of ambient light intensity collected by the light sensor; According to the predefined intensity level classification rules, the current ambient light intensity is divided into corresponding brightness levels; Check whether the current brightness level is the same as the previous brightness level. If they are the same, no processing is performed. If they are different, the mapping table is searched to obtain the parameter combination corresponding to the current brightness level, and the camera parameters are adjusted and updated with the current parameter combination found.
[0113] Those skilled in the art will clearly understand that the techniques in the embodiments of the present invention can be implemented using software plus a necessary general-purpose hardware platform. Based on this understanding, the technical solutions in the embodiments of the present invention, or the portion that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium such as a USB flash drive, a mobile hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, among other media capable of storing program code, and includes instructions for causing a computer terminal (which can be a personal computer, a server, or a second terminal, a network terminal, etc.) to execute all or part of the steps of the methods described in various embodiments of the present invention.
[0114] In the several embodiments provided by the present invention, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the units is merely a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0115] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.
[0116] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0117] The above description of the disclosed embodiments is intended to enable one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention is not limited to the embodiments shown herein, but is intended to be construed in the widest manner consistent with the principles and novel features disclosed herein.
Claims
1. A method for dynamically adjusting camera parameters based on light environment, characterized in that: The following steps are involved: Maintain a mapping table between brightness levels and camera parameters, including hardware parameters and SDK configuration parameters; Real-time acquisition of ambient light intensity collected by the light sensor; According to the predefined intensity level classification rules, the current ambient light intensity is divided into corresponding brightness levels; Check whether the current brightness level is the same as the previous brightness level. If they are the same, no processing is performed. If they are different, the mapping table is searched to obtain the parameter combination corresponding to the current brightness level, and the camera parameters are adjusted and updated with the current parameter combination found.
2. The method for dynamically adjusting camera parameters based on light environment according to claim 1, characterized in that: The method further comprises the following steps: The collected images at each brightness level are stored separately; For each brightness level, obtain several recent acquired images and preprocess each acquired image; The image edge clarity of each collected image is calculated by gradient energy, and the image edge clarity of all collected images is averaged as the clarity score; By counting the histograms of each collected image, the brightness balance score is obtained; The noise of each collected image is evaluated by local variance to obtain the noise evaluation value of each collected image, and the average of all noise evaluation values is taken as the noise score; The clarity score, brightness balance score, and noise score are weighted and summed to obtain the hardware parameter quality score; Check whether the hardware parameter quality score is lower than the first threshold. If not, no processing is performed. If so, adjust the hardware parameters corresponding to the current brightness level in the mapping table according to the clarity score, brightness balance score, and noise score.
3. The method for dynamically adjusting camera parameters based on light environment according to claim 2, characterized in that: By counting the histograms of each collected image, the brightness balance score is obtained, including: Calculate the image grayscale histogram ,in ; Statistical effective brightness range ; The standard deviation of the brightness distribution is calculated by the following formula and peak ratio , The brightness balance evaluation value of the captured image is calculated using the following formula: Where, is the weight coefficient; The average of the brightness balance evaluation values of each collected image is taken as the brightness balance score.
4. The method for dynamically adjusting camera parameters based on light environment according to claim 2, characterized in that: The noise of each collected image is evaluated by local variance to obtain the noise evaluation value of each collected image. The average of all noise evaluation values is taken as the noise score, which specifically includes: Divide the collected image into blocks and calculate the grayscale value variance of each image block ; Take the median of the gray value variance of all image blocks as the noise estimate ; The noise evaluation value of the acquired image is calculated by the following formula: Where, is the scaling factor; The noise evaluation values of each collected image are averaged as the noise score.
5. The method for dynamically adjusting camera parameters based on light environment according to claim 1, characterized in that: The method further comprises the following steps: Get feedback on subsequent algorithms, including pass rates and false positive rate ; The SDK configuration parameter quality score is calculated using the following formula: Where, is the weight coefficient; Check whether the SDK configuration parameter quality score is lower than the second threshold. If not, no processing is performed. If so, adjust the SDK configuration parameters in the mapping table.
6. The method for dynamically adjusting camera parameters based on light environment according to claim 1, characterized in that: Real-time acquisition of ambient light intensity collected by the light sensor, including: Multiple cameras are set up in the same light environment area, and each camera is equipped with a light sensor; Select one camera as the master camera and the rest as slave cameras. The master camera and the slave cameras communicate with each other through the local area network. Each slave camera sends the ambient light intensity collected by its light sensor to the master camera; The main camera uses the ambient light intensity received through the local area network and the ambient light intensity collected by its own sensor as observation values, and obtains the optimal estimated ambient light intensity based on the observation values through Kalman gain weighted fusion; The master camera broadcasts the best estimated ambient light intensity to each slave camera.
7. The method for dynamically adjusting camera parameters based on light environment according to claim 6, characterized in that: Divide the current ambient light intensity into corresponding brightness levels, including: Divide the optimal estimated ambient light intensity into corresponding brightness levels.
8. A system for dynamically adjusting camera parameters based on light environment, characterized in that: include: A mapping table maintenance module, configured to maintain a mapping table between brightness levels and camera parameters, wherein the camera parameters include hardware parameters and SDK configuration parameters; Light intensity acquisition module, used to obtain the ambient light intensity collected by the light sensor in real time; The camera parameter adjustment module is used to divide the current ambient light intensity into corresponding brightness levels according to pre-defined intensity level division rules; detect whether the current brightness level is the same as the previous brightness level. If the same, no processing is performed; if different, the mapping table is searched to obtain the parameter combination corresponding to the current brightness level, and the camera parameters are adjusted and updated with the current parameter combination found.
9. A terminal, characterized in that: include: A memory for storing a program for dynamically adjusting camera parameters based on the light environment; A processor, configured to implement the steps of the method for dynamically adjusting camera parameters based on a light environment as described in any one of claims 1 to 7 when executing the program for dynamically adjusting camera parameters based on a light environment.
10. A computer-readable storage medium, characterized in that The readable storage medium stores a program for dynamically adjusting camera parameters based on the light environment. When the program for dynamically adjusting camera parameters based on the light environment is executed by the processor, the steps of the method for dynamically adjusting camera parameters based on the light environment as described in any one of claims 1 to 7 are implemented.
Citation Information
Cited By
Image acquisition method and device, electronic equipment and storage medium
CN121397370A