Light intensity detection method, light intensity intelligent adjustment method and related equipment
The camera detects indoor and outdoor light intensity, extracts video frame brightness information and converts it into light intensity value, and dynamic adjustments are made in combination with the aging model, solving the problem of high cost of traditional light intensity detection and achieving efficient and economical light intensity detection.
Patent Information
- Application Number
- CN202411314780.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-20
- Publication Date
- 2025-01-14
- Estimated Expiration
- 2044-09-20
AI Technical Summary
Traditional light intensity detection relies on photoelectric sensors, which are costly to implement and require special hardware installation, making it difficult to reduce costs while ensuring detection accuracy.
The camera takes the environmental video stream, extracts the brightness information of the video frame, converts it into the light intensity value based on the light intensity model, and dynamic adjustment is performed in combination with the aging model to realize light intensity detection and intelligent adjustment.
On the premise of ensuring the accuracy of light intensity detection, the implementation cost is reduced. The camera detects indoor and outdoor light intensity through the camera, eliminating the installation of photoelectric sensors, and achieving economical and efficient light intensity detection.
Smart Images

Figure CN118870195B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of intelligent building technology, and in particular to a light intensity detection method, light intensity intelligent regulation and related equipment. Background Art
[0002] Light intensity refers to the energy of visible light received per unit area, which is used to indicate the intensity of light and the degree of illumination of the surface area of an object. In lighting engineering, light intensity is usually used to measure the brightness of the illumination source. Light intensity detection has important applications in many fields such as architectural design, energy-saving control, agricultural production and environmental monitoring, such as brightness adjustment of lighting equipment. Traditional light intensity detection usually relies on photoelectric sensors. Although this method has high accuracy, it requires installation and maintenance, so the implementation cost is high and requires special hardware installation. Summary of the invention
[0003] The main purpose of the present invention is to provide a light intensity detection method, a light intensity intelligent adjustment method and related equipment, aiming to solve the technical problem of how to reduce the implementation cost of light intensity detection while ensuring the accuracy of light intensity detection.
[0004] A first aspect of the present invention provides a method for detecting light intensity, the method comprising:
[0005] Based on the video stream output by the camera shooting the target environment, multiple target video frames to be detected are generated;
[0006] Extracting brightness information of each target video frame respectively, and calculating average brightness values corresponding to each target video frame based on the brightness information of each target video frame respectively;
[0007] Based on the illumination intensity model corresponding to the camera, converting the average brightness value corresponding to each of the target video frames into a corresponding illumination intensity value;
[0008] The average value of the illumination intensity values corresponding to each of the target video frames is calculated to obtain the illumination intensity value corresponding to the target environment.
[0009] Optionally, in a first implementation of the first aspect of the present invention, generating a plurality of target video frames to be detected based on a video stream output by a camera shooting a target environment comprises:
[0010] Get the video stream output by the camera shooting the target environment;
[0011] Decoding the video stream to obtain corresponding first video frames, and storing each of the first video frames in a preset video frame queue;
[0012] Based on a preset frame extraction frequency, the video frame queue is subjected to frame extraction processing to obtain a plurality of second video frames;
[0013] Preprocessing is performed on each of the second video frames to obtain each preprocessed target video frame, wherein the preprocessing includes denoising and white balance adjustment.
[0014] Optionally, in a second implementation manner of the first aspect of the present invention, respectively extracting brightness information of each of the target video frames includes:
[0015] Based on a preset grayscale value calculation formula, each of the target video frames is converted into a grayscale image;
[0016] Traversing each pixel of each grayscale image respectively, reading the grayscale value corresponding to each pixel and using it as the brightness information of the corresponding target video frame;
[0017] The gray value calculation formula is as follows:
[0018] ;
[0019] Among them, R, G and B are the pixel values of the red, green and blue channels corresponding to each pixel in the target video frame, respectively, and Y is the grayscale value corresponding to each pixel in the target video frame.
[0020] Optionally, in a third implementation manner of the first aspect of the present invention, the calculating, based on the brightness information of each of the target video frames, respectively the average brightness value corresponding to each of the target video frames includes:
[0021] Respectively obtain the grayscale values of all pixels of each target video frame, and store each grayscale value in a corresponding preset array;
[0022] Reading the grayscale values of all pixels of the corresponding target video frame from the array respectively, and using a preset average brightness value calculation formula to calculate the average brightness value of the corresponding target video frame;
[0023] The average brightness value calculation formula is as follows:
[0024] ;
[0025] Among them, M and N represent the number of pixel rows and pixel columns of the video frame respectively. Represents the grayscale value of the pixel in the i-th row and j-th column of the video frame.
[0026] Optionally, in a fourth implementation manner of the first aspect of the present invention, the calibration method adopted by the illumination intensity model corresponding to the camera includes:
[0027] Select the camera model to be calibrated and determine the camera to be calibrated accordingly;
[0028] Use the same camera to conduct multiple shooting tests in different environments and lighting conditions, where the same environment and the same lighting condition correspond to a calibration point for the camera to calibrate the light intensity;
[0029] Record multiple groups of image brightness values and actually measured light intensity values corresponding to multiple video frames generated by the same camera at each calibration point;
[0030] The linear regression method is used to fit the average image brightness value and the actual light intensity value corresponding to all calibration points of the same camera, and the initial light intensity model of the corresponding camera is obtained;
[0031] Calculate a first correction factor corresponding to each calibration point of the same camera based on average illumination intensity values of multiple video frames corresponding to the same calibration point and the actually measured illumination intensity value;
[0032] Based on each of the first correction factors, calculating second correction factors corresponding to all calibration points of the same camera;
[0033] Correcting the initial light intensity model based on the second correction factor to obtain a final light intensity model as the calibrated light intensity model corresponding to the camera model;
[0034] The linear regression method is used to fit the average image brightness values and actual light intensity values corresponding to all calibration points of the same camera to obtain the initial light intensity model of the corresponding camera, including:
[0035] According to different environments and different lighting conditions, multiple video frames shot by the same camera are divided into multiple intervals, and multiple groups of image brightness values and actually measured light intensity values corresponding to multiple video frames in each interval are recorded respectively;
[0036] The linear regression method is used to fit the average image brightness value and the actual light intensity value corresponding to each interval, and the light intensity model corresponding to each interval is obtained;
[0037] The mathematical expressions of the illumination intensity model corresponding to each interval are combined respectively to obtain the initial illumination intensity model of the corresponding camera.
[0038] Optionally, in a fifth implementation of the first aspect of the present invention, the initial light intensity model is as follows:
[0039] ,in, represents the image brightness value, L represents the light intensity value, and a and b are constant values;
[0040] The calculation formula of the first correction factor is as follows:
[0041] , where K represents the first correction factor corresponding to any calibration point, Indicates the actual measured light intensity value corresponding to any calibration point, represents the average illumination intensity value of multiple video frames corresponding to the same calibration point calculated using the initial illumination intensity model;
[0042] The calculation formula of the second correction factor is as follows:
[0043] ,in, represents the second correction factor, M represents the number of calibration points, represents the first correction factor corresponding to the j-th calibration point;
[0044] The calibrated light intensity model is as follows:
[0045] ,in, Represents the calibrated light intensity model.
[0046] Optionally, in a sixth implementation of the first aspect of the present invention, after calculating the average of the illumination intensity values corresponding to the target video frames to obtain the illumination intensity value corresponding to the target environment, the method further includes:
[0047] Obtain the cumulative usage time of the current camera;
[0048] Based on a preset aging model corresponding to the camera, calculating a response value of the current camera corresponding to the accumulated usage time;
[0049] Based on the current response value of the camera corresponding to the accumulated usage time and a preset compensation formula, dynamically adjust the light intensity value corresponding to the target environment in real time;
[0050] Wherein, the aging model is: , Indicates the response value corresponding to the current cumulative usage time t of the camera. is the initial response value of the camera, is the aging coefficient of the camera;
[0051] Wherein, the compensation formula is: , Indicates the light intensity value after dynamic adjustment. Indicates the light intensity value calculated based on the light intensity model.
[0052] A second aspect of the present invention further provides a method for intelligently adjusting light intensity, which is applied to video intelligent analysis. The method for intelligently adjusting light intensity comprises:
[0053] Get the video stream output by the camera shooting the current environment;
[0054] Using any one of the above light intensity detection methods to detect the video stream, and output a first light intensity value corresponding to the environment;
[0055] Determine whether a first light intensity value corresponding to the current environment meets a second light intensity value required for performing video intelligent analysis;
[0056] If not, a deviation between the first illumination intensity value and the second illumination intensity value is calculated, and based on the deviation, the brightness of the fill light is adjusted in real time.
[0057] The third aspect of the present invention further provides a light intensity detection device, the light intensity detection device comprising:
[0058] A generation module, used for generating multiple target video frames to be detected based on the video stream output by the camera shooting the target environment;
[0059] A first calculation module, used to extract brightness information of each target video frame, and calculate average brightness values corresponding to each target video frame based on the brightness information of each target video frame;
[0060] A conversion module, used for converting the average brightness value corresponding to each of the target video frames into a corresponding light intensity value based on a light intensity model corresponding to the camera;
[0061] The second calculation module is used to calculate the average value of the illumination intensity values corresponding to each of the target video frames to obtain the illumination intensity value corresponding to the target environment.
[0062] Optionally, in a first implementation of the third aspect of the present invention, the generating module is specifically used to:
[0063] Get the video stream output by the camera shooting the target environment;
[0064] Decoding the video stream to obtain corresponding first video frames, and storing each of the first video frames in a preset video frame queue;
[0065] Based on a preset frame extraction frequency, the video frame queue is subjected to frame extraction processing to obtain a plurality of second video frames;
[0066] Preprocessing is performed on each of the second video frames to obtain each preprocessed target video frame, wherein the preprocessing includes denoising and white balance adjustment.
[0067] Optionally, in a second implementation of the third aspect of the present invention, the first calculation module is specifically used to:
[0068] Based on a preset grayscale value calculation formula, each of the target video frames is converted into a grayscale image;
[0069] Traversing each pixel of each grayscale image respectively, reading the grayscale value corresponding to each pixel and using it as the brightness information of the corresponding target video frame;
[0070] The gray value calculation formula is as follows:
[0071] ;
[0072] Among them, R, G and B are the pixel values of the red, green and blue channels corresponding to each pixel in the target video frame, respectively, and Y is the grayscale value corresponding to each pixel in the target video frame.
[0073] Optionally, in a third implementation of the third aspect of the present invention, the first calculation module is further configured to:
[0074] Respectively obtain the grayscale values of all pixels of each target video frame, and store each grayscale value in a corresponding preset array;
[0075] Reading the grayscale values of all pixels of the corresponding target video frame from the array respectively, and using a preset average brightness value calculation formula to calculate the average brightness value of the corresponding target video frame;
[0076] The average brightness value calculation formula is as follows:
[0077] ;
[0078] Among them, M and N represent the number of pixel rows and pixel columns of the video frame respectively. Represents the grayscale value of the pixel in the i-th row and j-th column of the video frame.
[0079] Optionally, in a fourth implementation of the third aspect of the present invention, the light intensity detection device further includes:
[0080] A calibration module is used to select a camera model to be calibrated and determine the camera to be calibrated accordingly; use the same camera to perform multiple shooting tests in different environments and different lighting conditions, wherein the same environment and the same lighting condition correspond to a calibration point for camera light intensity calibration; respectively record multiple groups of image brightness values and actually measured light intensity values corresponding to multiple video frames generated by the same camera at each calibration point; use a linear regression method to fit the average image brightness values and actual light intensity values corresponding to all calibration points of the same camera, and obtain an initial light intensity model for the corresponding camera; based on the average light intensity values of multiple video frames corresponding to the same calibration point and the actually measured light intensity values, calculate the first correction factor corresponding to each calibration point of the same camera; based on each of the first correction factors, calculate the second correction factor corresponding to all calibration points of the same camera; based on the second correction factor, correct the initial light intensity model to obtain a final light intensity model and use it as the calibrated light intensity model corresponding to the camera model;
[0081] Among them, the calibration module is also used to: divide multiple video frames taken by the same camera into multiple intervals according to different environments and different lighting conditions, and respectively record multiple groups of image brightness values and actually measured light intensity values corresponding to multiple video frames in each interval; use linear regression method to fit the average image brightness value and actual light intensity value corresponding to each interval, and obtain the light intensity model corresponding to each interval; combine the mathematical expressions of the light intensity model corresponding to each interval, and obtain the initial light intensity model of the corresponding camera.
[0082] Optionally, in a fifth implementation of the third aspect of the present invention, the initial light intensity model is as follows:
[0083] ,in, represents the image brightness value, L represents the light intensity value, and a and b are constant values;
[0084] The calculation formula of the first correction factor is as follows:
[0085] , where K represents the first correction factor corresponding to any calibration point, Indicates the actual measured light intensity value corresponding to any calibration point, represents the average illumination intensity value of multiple video frames corresponding to the same calibration point calculated using the initial illumination intensity model;
[0086] The calculation formula of the second correction factor is as follows:
[0087] ,in, represents the second correction factor, M represents the number of calibration points, represents the first correction factor corresponding to the j-th calibration point;
[0088] The calibrated light intensity model is as follows:
[0089] ,in, Represents the calibrated light intensity model.
[0090] Optionally, in a sixth implementation of the third aspect of the present invention, the light intensity detection device further includes:
[0091] A compensation module, used to obtain the accumulated usage time of the current camera; calculate the response value of the current camera corresponding to the accumulated usage time based on a preset aging model corresponding to the camera; and dynamically adjust the light intensity value corresponding to the target environment in real time based on the response value of the current camera corresponding to the accumulated usage time and a preset compensation formula;
[0092] Wherein, the aging model is: , Indicates the response value corresponding to the current cumulative usage time t of the camera. is the initial response value of the camera, is the aging coefficient of the camera;
[0093] Wherein, the compensation formula is: , Indicates the light intensity value after dynamic adjustment. Indicates the light intensity value calculated based on the light intensity model.
[0094] A fourth aspect of the present invention provides a computer device, comprising: a memory and at least one processor, wherein the memory stores instructions; the at least one processor calls the instructions in the memory so that the computer device executes any one of the above-mentioned light intensity detection methods and / or the above-mentioned light intensity intelligent adjustment methods.
[0095] The technical solution provided by the present invention proposes a method for detecting indoor and outdoor light intensity through a camera, wherein the camera collects ambient light information and forms a video stream, and then indirectly detects the light intensity in the environment by analyzing the brightness information of each video frame in the video stream. The present invention further introduces a light intensity model, and the light intensity module can convert the brightness value corresponding to the video frame into the corresponding light intensity value, while ensuring the detection accuracy of the light intensity, thereby realizing light intensity detection based on the camera. By detecting the indoor and outdoor light intensity through the camera, the installation of the photoelectric sensor is eliminated. Under the premise of ensuring the detection accuracy of the light intensity, the implementation cost of the light intensity detection is reduced. BRIEF DESCRIPTION OF THE DRAWINGS
[0096] Figure 1 Schematic diagram of Example 1 of the light intensity detection method in an embodiment of the present invention;
[0097] Figure 2 Schematic diagram of Example 1 of the intelligent light intensity adjustment method in an embodiment of the present invention;
[0098] Figure 3 Schematic diagram of embodiment 1 of the light intensity detection device in the embodiment of the present invention;
[0099] Figure 4 Schematic diagram of the structure of a computer device in an embodiment of the present invention. DETAILED DESCRIPTION
[0100] The terms "first", "second", "third", "fourth", etc. (if any) in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms "including" or "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0101] For ease of understanding, the specific process of the embodiment of the present invention is described below. Figure 1 , Embodiment 1 of the light intensity detection method in the embodiment of the present invention includes:
[0102] 101. Generate multiple target video frames to be detected based on the video stream output by the camera shooting the target environment;
[0103] In this embodiment, in order to detect the light intensity value corresponding to the target environment, it is necessary to first shoot the target environment through a camera and output a corresponding video stream. Among them, this embodiment is not limited to the target environment, which can be an indoor place or an outdoor place, depending on the actual application scenario, such as a hospital, a station, a park, etc.
[0104] In this embodiment, a video stream containing lighting information in a target environment is collected by a camera. To facilitate analysis, the video stream output by the camera needs to be further processed to generate multiple target video frames to be detected.
[0105] In Embodiment 2 of the light intensity detection method, the above step 101 further includes:
[0106] 1011. Obtain the video stream output by the camera shooting the target environment;
[0107] 1012. Decode the video stream to obtain corresponding first video frames, and store each of the first video frames into a preset video frame queue;
[0108] In this embodiment, after obtaining the video stream output by the camera shooting the target environment, the video stream is further decoded to obtain the first video frame, and the unprocessed first video frame is stored in a pre-set video frame queue for subsequent processing.
[0109] 1013. Perform frame extraction processing on the video frame queue based on a preset frame extraction frequency to obtain a plurality of second video frames;
[0110] In order to reduce the impact of errors in the shooting process, such as people walking and blocking the light and affecting the light intensity in the environment, this embodiment further performs frame extraction on the video frames. The frame extraction frequency can be configured. For example, 6 frames of the first video frames are extracted from the video frame queue in 1 second to obtain multiple frames of the second video frames to be processed.
[0111] 1014. Preprocess each of the second video frames to obtain each preprocessed target video frame, wherein the preprocessing includes denoising and white balance adjustment.
[0112] In this embodiment, in order to further improve the accuracy of light intensity detection, multiple frames of second video frames to be processed are subjected to various preprocessing before calculation, such as denoising and white balance adjustment of the second video frames, to obtain preprocessed target video frames.
[0113] 102. Extracting brightness information of each target video frame respectively, and calculating average brightness values corresponding to each target video frame respectively based on the brightness information of each target video frame;
[0114] In this embodiment, the illumination information in the target environment collected by the camera is included in the video frame, which can be specifically reflected from the brightness information of the target video frame. Therefore, it is necessary to first extract the brightness information of each target video frame.
[0115] In the third embodiment of the light intensity detection method, the brightness information of each target video frame is extracted in the above step 102 in the following manner, including:
[0116] (1) Based on a preset grayscale value calculation formula, convert each of the target video frames into a grayscale image;
[0117] (2) traversing each pixel of each grayscale image respectively, reading the grayscale value corresponding to each pixel and using it as the brightness information of the corresponding target video frame;
[0118] The gray value calculation formula is as follows:
[0119] ;
[0120] Among them, R, G and B are the pixel values of the red, green and blue channels corresponding to each pixel in the target video frame, respectively, and Y is the grayscale value corresponding to each pixel in the target video frame.
[0121] In this embodiment, the image captured by the camera is usually a color image. Therefore, in order to reduce the influence of color on light intensity detection, the collected color image needs to be converted into a grayscale image first. The grayscale image can better reflect the brightness information of the image. In this embodiment, the above formula is preferably used to convert the color image into a grayscale image before processing.
[0122] In the fourth embodiment of the light intensity detection method, the above step 102 specifically calculates the average brightness value corresponding to each target video frame in the following manner, including:
[0123] (1) respectively obtaining the grayscale values of all pixels of each target video frame, and storing each grayscale value in a corresponding preset array;
[0124] (2) reading the grayscale values of all pixels of the corresponding target video frame from the array respectively, and using a preset average brightness value calculation formula to calculate the average brightness value of the corresponding target video frame;
[0125] The average brightness value calculation formula is as follows:
[0126] ;
[0127] Among them, M and N represent the number of pixel rows and pixel columns of the video frame respectively. Represents the grayscale value of the pixel in the i-th row and j-th column of the video frame.
[0128] In this embodiment, after the grayscale values of all pixels of each target video frame are calculated by the grayscale value calculation formula, the grayscale values corresponding to each target video frame are stored in the corresponding preset array. For example, the grayscale values of all pixels of target video frame 1 are stored in array 1, and the grayscale values of all pixels of target video frame 2 are stored in array 2, and the same applies to other target video frames.
[0129] When calculating the average brightness value of the target video frame, the above average brightness value calculation formula is used to calculate, and then the average brightness value of each target video frame is obtained. The brightness value combines the brightness values of all pixels in the same video frame. Therefore, the average brightness value is closer to the true brightness value, thereby reducing the calculation error and improving the detection accuracy of the light intensity value.
[0130] 103. Based on the illumination intensity model corresponding to the camera, convert the average brightness value corresponding to each of the target video frames into a corresponding illumination intensity value;
[0131] In this embodiment, after obtaining the average brightness value corresponding to each target video frame through the above steps 101-102, it is necessary to further evaluate the light intensity value corresponding to the average brightness value corresponding to each target video frame, and specifically use the light intensity model corresponding to the camera shooting the video to convert the average brightness value to the corresponding light intensity value. The light intensity model is used to realize the conversion of brightness value to light intensity value.
[0132] In Embodiment 5 of the illumination intensity detection method, the calibration method used for the illumination intensity model corresponding to the camera includes:
[0133] (1) Select the camera model to be calibrated and determine the camera to be calibrated;
[0134] (2) Use the same camera to conduct multiple shooting tests in different environments and lighting conditions. The same environment and the same lighting condition correspond to a calibration point for the camera to calibrate the light intensity. Multiple video frames need to be shot at each calibration point.
[0135] (3) Recording multiple sets of image brightness values and actual measured light intensity values corresponding to multiple video frames generated by the same camera at each calibration point;
[0136] In this embodiment, several common camera models on the market can be selected for calibration, and each camera model is calibrated with a corresponding illumination intensity model.
[0137] Each camera is tested multiple times, and the image brightness value and actual light intensity value corresponding to each frame of image taken in different environments (such as various indoor and outdoor places) and different lighting conditions (such as sunny days, cloudy days, indoor light, dusk, etc.) are recorded to obtain a set of mapping data of image brightness value and light intensity value. Among them, the actual measured light intensity value can be measured using a light sensor.
[0138] (4) Use the linear regression method to fit the average image brightness value and the actual light intensity value corresponding to all calibration points of the same camera to obtain the initial light intensity model of the corresponding camera;
[0139] In Example 6 of the light intensity detection method, the initial light intensity model is as follows:
[0140] ,in, represents the image brightness value, L represents the light intensity value, and a and b are constant values.
[0141] In Example 7 of the light intensity detection method, the linear regression method is used to fit the average image brightness values and actual light intensity values corresponding to all calibration points of the same camera, and the initial light intensity model of the corresponding camera is obtained, including:
[0142] According to different environments and lighting conditions, multiple video frames shot by the same camera are divided into multiple intervals, and multiple groups of image brightness values and actually measured light intensity values corresponding to the multiple video frames in each interval are recorded respectively; the linear regression method is used to fit the average image brightness value and the actual light intensity value corresponding to each interval to obtain the light intensity model corresponding to each interval; the mathematical expressions of the light intensity model corresponding to each interval are combined to obtain the initial light intensity model of the corresponding camera.
[0143] In this embodiment, when processing the calibration of the light intensity model, due to the large differences in the environment (such as indoors, outdoors, hospitals, stations, etc.) and lighting conditions (such as sunny days, cloudy days, indoor light, dusk, etc.), simple linear fitting is not enough to accurately model the data. Therefore, it is preferred to use a piecewise linear regression method to divide the data into different intervals, and use linear regression to fit in each interval. Finally, the mathematical expressions of the light intensity models corresponding to each interval are combined (equivalent to accumulating each expression) to obtain the initial light intensity model corresponding to the final camera.
[0144] (5) calculating a first correction factor corresponding to each calibration point of the same camera based on the average light intensity value of multiple video frames corresponding to the same calibration point and the actually measured light intensity value;
[0145] In this embodiment, in order to further reduce the error and thus improve the detection accuracy, the light intensity value output by the initial light intensity model corresponding to each calibration point is further corrected. The calculation formula of the first correction factor used by the initial light intensity model is as follows:
[0146] , where K represents the first correction factor corresponding to any calibration point, Indicates the actual measured light intensity value corresponding to any calibration point, represents the average illumination intensity value of multiple video frames corresponding to the same calibration point calculated using the initial illumination intensity model;
[0147] For example, suppose 5 video frames are taken at calibration point A, and the actual measured light intensity value is , the illumination intensity value corresponding to each video frame is L1-L5, then The first correction factor corresponding to the calibration point A can be obtained by taking the average value of L1-L5 and then using the calculation formula of the first correction factor mentioned above.
[0148] (6) calculating second correction factors corresponding to all calibration points of the same camera based on the first correction factors;
[0149] In this embodiment, considering that the light intensity under different conditions in the same environment is different, it is necessary to calibrate multiple different conditions even in the same environment, so it is necessary to further calculate the second correction factor corresponding to all calibration points of the same camera (including different conditions in different environments). The calculation formula of the second correction factor is as follows:
[0150] ,in, represents the second correction factor, M represents the number of calibration points, Indicates the first correction factor corresponding to the j-th calibration point.
[0151] (7) Correcting the initial illumination intensity model based on the second correction factor to obtain a final illumination intensity model as the calibrated illumination intensity model corresponding to the camera model.
[0152] In this embodiment, after obtaining the second correction factors corresponding to all calibration points of the same camera through the above steps, the initial illumination intensity model corresponding to each camera can be calibrated to obtain the calibrated illumination intensity model as follows:
[0153] ,in, represents the calibrated light intensity model, Is a constant value.
[0154] 104. Calculate an average value of the illumination intensity values corresponding to the target video frames to obtain the illumination intensity value corresponding to the target environment.
[0155] In this embodiment, after the brightness value and the light intensity value are converted in step 103, the light intensity value corresponding to each target video frame is obtained, and then the average value of the light intensity value corresponding to each target video frame is further calculated, and the average value can be used as the light intensity value corresponding to the target environment.
[0156] In Embodiment 8 of the light intensity detection method, after the above step 104, the following steps are further included:
[0157] (1) Obtain the cumulative usage time of the current camera;
[0158] (2) calculating a response value of the current camera corresponding to the accumulated usage time based on a preset aging model corresponding to the camera;
[0159] (3) dynamically adjusting the light intensity value corresponding to the target environment in real time based on the current response value of the camera corresponding to the accumulated usage time and a preset compensation formula;
[0160] Wherein, the aging model is: , Indicates the response value corresponding to the current cumulative usage time t of the camera. is the initial response value of the camera, is the aging coefficient of the camera;
[0161] Wherein, the compensation formula is: , Indicates the light intensity value after dynamic adjustment. Indicates the light intensity value calculated based on the light intensity model.
[0162] In this embodiment, considering that the camera may age after long-term use, thereby affecting the accuracy of the light intensity detection result, it is necessary to compensate the light intensity value calculated based on the light intensity model.
[0163] In this embodiment, it is necessary to pre-establish a mathematical model of the aging of the camera's photosensitive element. Specifically, the aging curve, i.e., the aging model, can be constructed by long-term monitoring of the camera's response changes under standard lighting conditions and collecting relevant data. In the process of light intensity detection, an aging compensation mechanism is introduced to dynamically adjust the output value of the light intensity model according to the camera's usage time (cumulative usage time) and the pre-established aging model, thereby obtaining a more accurate light intensity value.
[0164] In addition, the camera can also be connected to the cloud server. After the camera enters normal operation, the light intensity model can be remotely upgraded to improve the accuracy of light intensity detection.
[0165] This embodiment collects ambient light information through a camera and forms a video stream, and then indirectly detects the light intensity in the environment by analyzing the brightness information of each video frame in the video stream. The present invention further introduces a light intensity model. The light intensity module can convert the brightness value corresponding to the video frame into the corresponding light intensity value, while ensuring the detection accuracy of the light intensity, thereby realizing light intensity detection based on the camera. By detecting the indoor and outdoor light intensity through the camera, the installation of the photoelectric sensor is eliminated. Under the premise of ensuring the accuracy of light intensity detection, the implementation cost of light intensity detection is reduced.
[0166] The light intensity detection method of the present invention can be specifically used for energy-saving control of lighting equipment. The specific energy-saving control process is as follows:
[0167] (1) Shooting a video stream outputted from the environment where the lighting device is located by a camera;
[0168] (2) Using the light intensity detection method described in the above embodiment to detect the video stream, and output the light intensity value corresponding to the environment;
[0169] (3) Based on the light intensity value, controlling the brightness of the lighting device during operation.
[0170] In this embodiment, it is necessary to first use a camera that has been calibrated with a light intensity model to capture the environment where the lighting device is located and output a corresponding video stream, and then use the light intensity detection method in the above embodiment to detect the video stream and output the light intensity value corresponding to the environment where the lighting device is located. In addition, in order to facilitate subsequent use of the light intensity value corresponding to the environment where the lighting device is located by other devices, the light intensity value is further stored in a preset database at a fixed frequency.
[0171] If an energy-saving control device is used to perform energy-saving control on lighting equipment and other equipment, the light intensity value of the environment where the controlled equipment (such as lighting equipment, such as energy-saving lamps and display screens) is located can be obtained from the preset database, and then the brightness of the energy-saving lamps and the brightness of the display screens can be controlled based on the light intensity value. The application scenarios of this embodiment are not limited, and can be indoor scenarios, such as hospitals, cafeterias, stations, etc., or outdoor scenarios, such as parks, squares, etc.
[0172] The energy-saving control method of this embodiment can realize energy-saving control of different lighting equipment by using only a camera. This method detects indoor and outdoor light intensity through a camera, eliminating the need to install a photoelectric sensor. Under the premise of ensuring the accuracy of light intensity detection, the implementation cost of light intensity detection is reduced.
[0173] See also Figure 2 , Figure 2 1 is a flow chart of Example 1 of the intelligent light intensity adjustment method in the embodiment of the present invention. This embodiment is specifically applied to video intelligent analysis. In this embodiment, Example 1 of the intelligent light intensity adjustment method includes:
[0174] 201. Obtain the video stream output by the camera shooting the current environment;
[0175] 202. Detect the video stream using a light intensity detection method, and output a first light intensity value corresponding to the environment;
[0176] 203. Determine whether the first illumination intensity value corresponding to the current environment meets the second illumination intensity value required for performing video intelligent analysis;
[0177] 204. If not, calculate a deviation between the first illumination intensity value and the second illumination intensity value, and adjust the brightness of the fill light in real time based on the deviation.
[0178] With the development of video intelligent analysis technology, the working effect of cameras in various environments is significantly affected by lighting conditions. Traditional fill light systems are usually statically configured and cannot be intelligently adjusted according to the actual light intensity, resulting in challenges in the accuracy and efficiency of video analysis under different lighting conditions. Based on this, this embodiment proposes a method for intelligently adjusting the fill light intensity based on light intensity detection to meet the lighting requirements of the algorithm for video intelligent analysis of camera images.
[0179] The fill light system receives the illumination data output by the illumination intensity detection device, and determines whether the current illumination intensity meets the requirements of the video intelligent analysis algorithm according to a preset threshold.
[0180] Assume that the light intensity value output by the light intensity detection device is , the light intensity value required by the video intelligent analysis algorithm is .like , it is considered that the current lighting conditions do not meet the requirements of the video intelligent analysis algorithm.
[0181] In this embodiment, when the light intensity measured by the light intensity detection device does not meet the light data requirements of the video intelligent analysis algorithm, the fill light system sends a command to the fill light to turn on the fill light, and according to the deviation value, that is, The value of the fill light is adjusted to adjust the brightness of the fill light, so that the light intensity finally meets the requirements of the video intelligent analysis algorithm.
[0182] The intelligent light intensity adjustment method proposed in this embodiment can intelligently adjust the light intensity of the fill light according to the light detection result output by the light intensity detection device to meet the lighting requirements of the algorithm for video intelligent analysis of camera images and improve the efficiency and accuracy of video analysis.
[0183] The above describes the light intensity detection method in the embodiment of the present invention. The following describes the light intensity detection device in the embodiment of the present invention. Figure 3 , the light intensity detection device embodiment 1 of the present invention comprises:
[0184] A generating module 301 is used to generate multiple target video frames to be detected based on the video stream output by the camera shooting the target environment;
[0185] The first calculation module 302 is used to extract the brightness information of each target video frame, and calculate the average brightness value corresponding to each target video frame based on the brightness information of each target video frame;
[0186] A conversion module 303, configured to convert the average brightness value corresponding to each of the target video frames into a corresponding light intensity value based on a light intensity model corresponding to the camera;
[0187] The second calculation module 304 is used to calculate the average value of the illumination intensity values corresponding to the target video frames to obtain the illumination intensity value corresponding to the target environment.
[0188] Optionally, in Embodiment 2 of the light intensity detection device, the generating module 301 is specifically used for:
[0189] Get the video stream output by the camera shooting the target environment;
[0190] Decoding the video stream to obtain corresponding first video frames, and storing each of the first video frames in a preset video frame queue;
[0191] Based on a preset frame extraction frequency, the video frame queue is subjected to frame extraction processing to obtain a plurality of second video frames;
[0192] Preprocessing is performed on each of the second video frames to obtain each preprocessed target video frame, wherein the preprocessing includes denoising and white balance adjustment.
[0193] Optionally, in Embodiment 3 of the light intensity detection device, the first calculation module 302 is specifically configured to:
[0194] Based on a preset grayscale value calculation formula, each of the target video frames is converted into a grayscale image;
[0195] Traversing each pixel of each grayscale image respectively, reading the grayscale value corresponding to each pixel and using it as the brightness information of the corresponding target video frame;
[0196] The gray value calculation formula is as follows:
[0197] ;
[0198] Among them, R, G and B are the pixel values of the red, green and blue channels corresponding to each pixel in the target video frame, respectively, and Y is the grayscale value corresponding to each pixel in the target video frame.
[0199] Optionally, in Embodiment 4 of the light intensity detection device, the first calculation module 302 is further configured to:
[0200] Respectively obtain the grayscale values of all pixels of each target video frame, and store each grayscale value in a corresponding preset array;
[0201] Reading the grayscale values of all pixels of the corresponding target video frame from the array respectively, and using a preset average brightness value calculation formula to calculate the average brightness value of the corresponding target video frame;
[0202] The average brightness value calculation formula is as follows:
[0203] ;
[0204] Among them, M and N represent the number of pixel rows and pixel columns of the video frame respectively. Represents the grayscale value of the pixel in the i-th row and j-th column of the video frame.
[0205] Optionally, in Embodiment 5 of the light intensity detection device, the light intensity detection device further includes:
[0206] A calibration module is used to select a camera model to be calibrated and determine the camera to be calibrated accordingly; use the same camera to perform multiple shooting tests in different environments and different lighting conditions, wherein the same environment and the same lighting condition correspond to a calibration point for camera light intensity calibration; respectively record multiple groups of image brightness values and actually measured light intensity values corresponding to multiple video frames generated by the same camera at each calibration point; use a linear regression method to fit the average image brightness values and actual light intensity values corresponding to all calibration points of the same camera, and obtain an initial light intensity model for the corresponding camera; based on the average light intensity values of multiple video frames corresponding to the same calibration point and the actually measured light intensity values, calculate the first correction factor corresponding to each calibration point of the same camera; based on each of the first correction factors, calculate the second correction factor corresponding to all calibration points of the same camera; based on the second correction factor, correct the initial light intensity model to obtain a final light intensity model and use it as the calibrated light intensity model corresponding to the camera model;
[0207] Among them, the calibration module is also used to: divide multiple video frames taken by the same camera into multiple intervals according to different environments and different lighting conditions, and respectively record multiple groups of image brightness values and actually measured light intensity values corresponding to multiple video frames in each interval; use linear regression method to fit the average image brightness value and actual light intensity value corresponding to each interval, and obtain the light intensity model corresponding to each interval; combine the mathematical expressions of the light intensity model corresponding to each interval, and obtain the initial light intensity model of the corresponding camera.
[0208] Optionally, in Embodiment 6 of the light intensity detection device, the initial light intensity model is as follows:
[0209] ,in, represents the image brightness value, L represents the light intensity value, and a and b are constant values;
[0210] The calculation formula of the first correction factor is as follows:
[0211] , where K represents the first correction factor corresponding to any calibration point, Indicates the actual measured light intensity value corresponding to any calibration point, represents the average illumination intensity value of multiple video frames corresponding to the same calibration point calculated using the initial illumination intensity model;
[0212] The calculation formula of the second correction factor is as follows:
[0213] ,in, represents the second correction factor, M represents the number of calibration points, represents the first correction factor corresponding to the j-th calibration point;
[0214] The calibrated light intensity model is as follows:
[0215] ,in, Represents the calibrated light intensity model.
[0216] Optionally, in Embodiment 7 of the light intensity detection device, the light intensity detection device further includes:
[0217] A compensation module, used to obtain the accumulated usage time of the current camera; calculate the response value of the current camera corresponding to the accumulated usage time based on a preset aging model corresponding to the camera; and dynamically adjust the light intensity value corresponding to the target environment in real time based on the response value of the current camera corresponding to the accumulated usage time and a preset compensation formula;
[0218] Wherein, the aging model is: , Indicates the response value corresponding to the current cumulative usage time t of the camera. is the initial response value of the camera, is the aging coefficient of the camera;
[0219] Wherein, the compensation formula is: , Indicates the light intensity value after dynamic adjustment. Indicates the light intensity value calculated based on the light intensity model.
[0220] In Example 8 of the light intensity detection device, when the number of images captured by the camera exceeds a preset number threshold, or exceeds the computing power of the current device, a light intensity detection model based on deep learning is introduced to perform light intensity detection, thereby improving the accuracy and robustness of light intensity detection. At the same time, through the deep learning model, multidimensional features in the image captured by the camera, such as color features, texture features, edge features, spatial features, etc., can be extracted, and the multidimensional features of the image are added to the deep learning model, which specifically includes the following steps:
[0221] Step 1: Data preprocessing and feature extraction: Use a deep learning framework (such as TensorFlow or PyTorch) to preprocess the image and extract features. You can use a pre-trained convolutional neural network (such as VGG16 or ResNet) to extract high-dimensional features.
[0222] Step 2: Build a deep learning model (CNN) and use the multi-dimensional features extracted by the convolutional neural network as the input of the CNN model;
[0223] Step 3: Construct a hybrid model (CNN-RNN). In some cases, the light intensity may have time series characteristics, so a hybrid model can be constructed to input the features extracted by CNN into RNN for processing;
[0224] Step 4: Based on the output of the hybrid model and the actual light intensity, construct a loss function and train the hybrid model to obtain a light intensity prediction model.
[0225] In this embodiment, a model for light intensity prediction can be pre-set, such as using a light intensity module or a light intensity prediction model, or the model can be adaptively configured according to the actual application usage. For example, based on the number of images required to be calculated in the current environment, when the number of collected images is less than a preset threshold number, the light intensity model is used, otherwise the light intensity prediction model is used.
[0226] Since the embodiments of the device part correspond to the embodiments of the above-mentioned method, please refer to the above-mentioned method embodiments for the introduction of the light intensity detection device provided by the present invention. The present invention will not be repeated here, and it has the same beneficial effects as the above-mentioned light intensity detection method.
[0227] above Figure 3 The light intensity detection device in the embodiment of the present invention is described in detail from the perspective of modular functional entities, and the computer device in the embodiment of the present invention is described in detail from the perspective of hardware processing.
[0228] Figure 4 : is a schematic diagram of the structure of a computer device provided by an embodiment of the present invention. The computer device 500 may have relatively large differences due to different configurations or performances, and may include one or more processors 510 (central processing units, CPU) and memory 520, and one or more storage media 530 (such as one or more mass storage devices) storing application programs 533 or data 532. Among them, the memory 520 and the storage medium 530 can be short-term storage or permanent storage. The program stored in the storage medium 530 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations in the computer device 500. Furthermore, the processor 510 may be configured to communicate with the storage medium 530 to execute a series of instruction operations in the storage medium 530 on the computer device 500.
[0229] The computer device 500 may also include one or more power supplies 540, one or more wired or wireless network interfaces 550, one or more input and output interfaces 560, and / or one or more operating systems 531, such as Windows Server, Mac OS X, Unix, Linux, FreeBSD, etc. It will be appreciated by those skilled in the art that Figure 4 The illustrated computer device structure does not constitute a limitation on the computer device, and may include more or fewer components than illustrated, or combine certain components, or arrange the components differently.
[0230] The present invention also provides a computer device, the computer device includes a memory and a processor, the memory stores computer-readable instructions, when the computer-readable instructions are executed by the processor, the processor executes the steps of the light intensity detection method and / or the steps of intelligently adjusting the light intensity in the above-mentioned embodiments. The present invention also provides a computer-readable storage medium, the computer-readable storage medium can be a non-volatile computer-readable storage medium, the computer-readable storage medium can also be a volatile computer-readable storage medium, the computer-readable storage medium stores instructions, when the instructions are executed on a computer, the computer executes the steps of the light intensity detection method and / or the steps of intelligently adjusting the light intensity.
[0231] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0232] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art or the whole or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program code.
[0233] As described above, the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features thereof may be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for detecting light intensity, characterized in that: The light intensity detection method comprises: Based on the video stream output by the camera shooting the target environment, multiple target video frames to be detected are generated; Extracting brightness information of each target video frame respectively, and calculating average brightness values corresponding to each target video frame based on the brightness information of each target video frame respectively; Based on the illumination intensity model corresponding to the camera, converting the average brightness value corresponding to each of the target video frames into a corresponding illumination intensity value; Calculate the average value of the illumination intensity values corresponding to each of the target video frames to obtain the illumination intensity value corresponding to the target environment; The calibration method used for the illumination intensity model corresponding to the camera includes: Select the camera model to be calibrated and determine the camera to be calibrated accordingly; Use the same camera to conduct multiple shooting tests in different environments and lighting conditions, where the same environment and the same lighting condition correspond to a calibration point for the camera to calibrate the light intensity; Record multiple groups of image brightness values and actually measured light intensity values corresponding to multiple video frames generated by the same camera at each calibration point; The linear regression method is used to fit the average image brightness value and the actual light intensity value corresponding to all calibration points of the same camera, and the initial light intensity model of the corresponding camera is obtained; Calculate a first correction factor corresponding to each calibration point of the same camera based on average illumination intensity values of multiple video frames corresponding to the same calibration point and the actually measured illumination intensity value; Based on each of the first correction factors, calculating second correction factors corresponding to all calibration points of the same camera; Correcting the initial light intensity model based on the second correction factor to obtain a final light intensity model as the calibrated light intensity model corresponding to the camera model; The linear regression method is used to fit the average image brightness values and actual light intensity values corresponding to all calibration points of the same camera to obtain the initial light intensity model of the corresponding camera, including: According to different environments and different lighting conditions, multiple video frames shot by the same camera are divided into multiple intervals, and multiple groups of image brightness values and actually measured light intensity values corresponding to multiple video frames in each interval are recorded respectively; The linear regression method is used to fit the average image brightness value and the actual light intensity value corresponding to each interval, and the light intensity model corresponding to each interval is obtained; The mathematical expressions of the illumination intensity model corresponding to each interval are combined respectively to obtain the initial illumination intensity model of the corresponding camera; Wherein, the initial light intensity model is as follows: ,in, represents the image brightness value, L represents the light intensity value, and a and b are constant values; The calculation formula of the first correction factor is as follows: , where K represents the first correction factor corresponding to any calibration point, Indicates the actual measured light intensity value corresponding to any calibration point, represents the average illumination intensity value of multiple video frames corresponding to the same calibration point calculated using the initial illumination intensity model; The calculation formula of the second correction factor is as follows: ,in, represents the second correction factor, M represents the number of calibration points, represents the first correction factor corresponding to the j-th calibration point; The calibrated light intensity model is as follows: ,in, Represents the calibrated light intensity model.
2. The method for detecting light intensity according to claim 1, characterized in that: The method of generating multiple target video frames to be detected based on the video stream output by the camera shooting the target environment includes: Get the video stream output by the camera shooting the target environment; Decoding the video stream to obtain corresponding first video frames, and storing each of the first video frames in a preset video frame queue; Based on a preset frame extraction frequency, the video frame queue is subjected to frame extraction processing to obtain a plurality of second video frames; Preprocessing is performed on each of the second video frames to obtain each preprocessed target video frame, wherein the preprocessing includes denoising and white balance adjustment.
3. The method for detecting light intensity according to claim 1, characterized in that: The step of respectively extracting brightness information of each target video frame comprises: Based on a preset grayscale value calculation formula, each of the target video frames is converted into a grayscale image; Traversing each pixel of each grayscale image respectively, reading the grayscale value corresponding to each pixel and using it as the brightness information of the corresponding target video frame; The gray value calculation formula is as follows: ; Among them, R, G and B are the pixel values of the red, green and blue channels corresponding to each pixel in the target video frame, respectively, and Y is the grayscale value corresponding to each pixel in the target video frame.
4. The method for detecting light intensity according to claim 3, characterized in that: The step of calculating the average brightness value corresponding to each of the target video frames based on the brightness information of each of the target video frames comprises: Respectively obtain the grayscale values of all pixels of each target video frame, and store each grayscale value in a corresponding preset array; Reading the grayscale values of all pixels of the corresponding target video frame from the array respectively, and using a preset average brightness value calculation formula to calculate the average brightness value of the corresponding target video frame; The average brightness value calculation formula is as follows: ; Among them, M and N represent the number of pixel rows and pixel columns of the video frame respectively. Represents the grayscale value of the pixel in the i-th row and j-th column of the video frame.
5. The method for detecting light intensity according to claim 1, characterized in that: After calculating the average of the illumination intensity values corresponding to the target video frames to obtain the illumination intensity value corresponding to the target environment, the method further includes: Obtain the cumulative usage time of the current camera; Based on a preset aging model corresponding to the camera, calculating a response value of the current camera corresponding to the accumulated usage time; Based on the current response value of the camera corresponding to the accumulated usage time and a preset compensation formula, dynamically adjust the light intensity value corresponding to the target environment in real time; Wherein, the aging model is: , Indicates the response value corresponding to the current cumulative usage time t of the camera. is the initial response value of the camera, is the aging coefficient of the camera; Wherein, the compensation formula is: , Indicates the light intensity value after dynamic adjustment. Indicates the light intensity value calculated based on the light intensity model.
6. A method for intelligently adjusting light intensity, applied to video intelligent analysis, characterized in that: The light intensity intelligent adjustment method comprises: Get the video stream output by the camera shooting the current environment; The video stream is detected using the light intensity detection method described in any one of claims 1 to 5, and a first light intensity value corresponding to the environment is output; Determine whether a first light intensity value corresponding to the current environment meets a second light intensity value required for performing video intelligent analysis; If not, a deviation between the first illumination intensity value and the second illumination intensity value is calculated, and based on the deviation, the brightness of the fill light is adjusted in real time.
7. A light intensity detection device, characterized in that: The light intensity detection device comprises: A generation module, used for generating multiple target video frames to be detected based on the video stream output by the camera shooting the target environment; A first calculation module, used to extract brightness information of each target video frame, and calculate average brightness values corresponding to each target video frame based on the brightness information of each target video frame; A conversion module, used for converting the average brightness value corresponding to each of the target video frames into a corresponding light intensity value based on a light intensity model corresponding to the camera; A second calculation module is used to calculate the average value of the illumination intensity values corresponding to each of the target video frames to obtain the illumination intensity value corresponding to the target environment; Wherein, the light intensity detection device further comprises: A calibration module is used to select a camera model to be calibrated and determine the camera to be calibrated accordingly; use the same camera to perform multiple shooting tests in different environments and different lighting conditions, wherein the same environment and the same lighting condition correspond to a calibration point for camera light intensity calibration; respectively record multiple groups of image brightness values and actually measured light intensity values corresponding to multiple video frames generated by the same camera at each calibration point; use a linear regression method to fit the average image brightness values and actual light intensity values corresponding to all calibration points of the same camera, and obtain an initial light intensity model for the corresponding camera; based on the average light intensity values of multiple video frames corresponding to the same calibration point and the actually measured light intensity values, calculate the first correction factor corresponding to each calibration point of the same camera; based on each of the first correction factors, calculate the second correction factor corresponding to all calibration points of the same camera; based on the second correction factor, correct the initial light intensity model to obtain a final light intensity model and use it as the calibrated light intensity model corresponding to the camera model; The calibration module is further used to: divide multiple video frames captured by the same camera into multiple intervals according to different environments and different lighting conditions, and respectively record multiple groups of image brightness values and actually measured light intensity values corresponding to multiple video frames in each interval; use a linear regression method to fit the average image brightness value and the actual light intensity value corresponding to each interval to obtain a light intensity model corresponding to each interval; combine the mathematical expressions of the light intensity model corresponding to each interval to obtain an initial light intensity model of the corresponding camera; Wherein, the initial light intensity model is as follows: ,in, represents the image brightness value, L represents the light intensity value, and a and b are constant values; The calculation formula of the first correction factor is as follows: , where K represents the first correction factor corresponding to any calibration point, Indicates the actual measured light intensity value corresponding to any calibration point, represents the average illumination intensity value of multiple video frames corresponding to the same calibration point calculated using the initial illumination intensity model; The calculation formula of the second correction factor is as follows: ,in, represents the second correction factor, M represents the number of calibration points, represents the first correction factor corresponding to the j-th calibration point; The calibrated light intensity model is as follows: ,in, Represents the calibrated light intensity model.
8. A computer device, characterized in that: The computer device comprises: a memory and at least one processor, wherein instructions are stored in the memory; The at least one processor calls the instructions in the memory so that the computer device executes the light intensity detection method according to any one of claims 1 to 5, and / or the light intensity intelligent adjustment method according to claim 6.
Citation Information
Patent Citations
Reality augmenting method with real environment estimation and reality augmenting system
CN101520904A
Ambient brightness determination method and device, medium, product and camera
CN113556477A
Cited By
Method for intelligently adjusting illumination intensity of anoectochilus formosanus plant factory
CN122614138A