Video equipment environment illumination detection method and device, and electronic equipment
By acquiring the exposure factors and pixel features of video devices, and using neural network models and bias mapping models for data correction, the problem of large differences in detection results between different video devices under the same environment is solved, thereby improving the accuracy of illumination detection results.
Patent Information
- Application Number
- CN202411094253.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-09
- Publication Date
- 2026-02-10
AI Technical Summary
When different video devices perform illuminance testing under the same environment, the test results vary greatly, and the accuracy of existing detection solutions is relatively low.
By acquiring multiple target parameters of the video device, including exposure factors and pixel features of the target area in the image, normalization and mapping correction are performed using a target neural network model and a bias mapping model to obtain the ambient illuminance value.
This improves the accuracy of illuminance detection results and ensures that the detection results of different video devices in the same environment are nearly consistent.
Smart Images

Figure CN121509641A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of illumination detection, in particular to a video device environment illumination detection method and device and an electronic device. BACKGROUND
[0002] At present, when a video device detects the illumination of the surrounding environment, the components (such as System on Chip (SOC), sensors, lenses, etc.) in different video devices differ in manufacturing process and structure, etc., resulting in a large difference in the detection results of the illumination of the surrounding environment by different video devices. Moreover, most of the existing video device environment illumination detection schemes are linear or nonlinear calculation of exposure factors and part of the region features in the video image by experience, which also leads to the detection results that are usually difficult to fully conform to the objective reality and have low accuracy. SUMMARY
[0003] The present application provides a video device environment illumination detection method and device and an electronic device to solve the defect of large deviation of the illumination detection results of different video devices in the same environment in the prior art, and achieve the purpose of improving the accuracy of the illumination detection results.
[0004] The present application provides a video device environment illumination detection method, comprising the following steps.
[0005] Obtaining parameter values of a plurality of target parameters of a video device; the plurality of target parameters include a plurality of exposure factors and a plurality of pixel features of a target region in an image taken in the current environment; performing normalization processing on each target parameter in the plurality of target parameters according to at least one normalized parameter value corresponding to the target parameter to obtain a standard parameter value of each target parameter; the at least one normalized parameter value is obtained based on sample data used in the process of obtaining a target neural network model; the target neural network model is used to output a corresponding illumination value according to the input parameter values of the plurality of target parameters; inputting the standard parameter value of any first target parameter in the plurality of target parameters into a target deviation mapping model to obtain a mapping parameter value of the first target parameter output by the target deviation mapping model; the target deviation mapping model is obtained based on a first function relationship and parameter values of each parameter in a plurality of second function relationships corresponding one-to-one to the plurality of target parameters; the first function relationship is a function relationship between the plurality of target parameters and the illumination value obtained based on the target neural network model, and the second function relationship corresponding to any second target parameter in the plurality of target parameters is a function relationship between the second target parameter and the illumination value obtained based on the sample data; inputting the mapping parameter values of all target parameters into the target neural network model; and obtaining an illumination value of the environment where the video device is located according to the output result of the target neural network model.
[0006] According to the illuminance detection method for a video device environment provided by the present invention, before acquiring the parameter values of multiple target parameters of the video device, the method further includes: acquiring sample data; the sample data includes multiple sample illuminance values, and sample parameter values of each target parameter in each frame of sample images acquired under the target sample illuminance value; the multiple frame sample images are consecutive frame images, and the target sample illuminance value is any one of the multiple sample illuminance values; normalizing the sample parameter values of each target parameter in each frame sample image; and completing the training of the neural network model based on the normalization result of the sample parameter values of each target parameter in each frame sample image, the sample illuminance value corresponding to the sample parameter values of each target parameter in each frame sample image, and the deviation mapping model to be updated. The training of a liter involves the following steps: The input data of the neural network model to be trained is obtained based on the normalization processing results of the sample parameter values of each target parameter in each frame of sample images and the deviation mapping model to be updated. When the neural network model to be trained completes 1 liter of training, the first model parameters of the neural network model to be trained are updated. When the neural network model to be trained completes 1 epoch of training, the neural network function relationship of the neural network model to be trained is obtained as the first function relationship. Based on the first function relationship and multiple second function relationships obtained based on the sample data, the second model parameters of the deviation mapping model to be updated are updated. When the number of training iterations for the neural network model to complete 1 liter of training is less than a set number, the neural network model to be trained is trained again for 1 liter based on the normalization processing results of the sample parameter values of each target parameter in each frame of sample images, the sample illumination values corresponding to the sample parameter values of each target parameter in each frame of sample images, and the deviation mapping model to be updated. When the number of training iterations for the neural network model to complete 1 liter of training is greater than or equal to a set number, the deviation mapping model to be updated is used as the target deviation mapping model, and the neural network model to be trained is used as the target neural network model.
[0007] According to the present invention, an illumination detection method for a video device environment updates the second model parameters of a deviation mapping model to be updated based on a first functional relationship and multiple second functional relationships obtained based on sample data. The method includes: sequentially obtaining target mapping values from a plurality of preset mapping values; substituting the target mapping values as independent variables of the second functional relationships into the second functional relationships to perform calculations, obtaining a first calculation result; substituting the first calculation result as the dependent variable of the first functional relationships into the first functional relationships to obtain a second calculation result; and updating the second model parameters of the deviation mapping model to be updated based on the target mapping values and the second calculation results.
[0008] According to the illumination detection method of the video device environment provided by the application, after the sample data is collected, the method further comprises: obtaining the fluctuation amplitude of the sample parameter value of the second target parameter in the Eth frame sample image to the Fth frame sample image; the second target parameter is any one of the multiple target parameters; in the case that the fluctuation amplitude is less than the set threshold, determining that the sample images of all frames between the Eth frame sample image and the Fth frame sample image are valid; in the case that the fluctuation amplitude is greater than or equal to the set threshold, determining that the sample images of all frames between the Eth frame sample image and the Fth frame sample image are invalid.
[0009] According to the illumination detection method of the video device environment provided by the application, one of the multiple pixel features is brightness; after the sample data is collected, the method further comprises: determining the valid environment brightness interval according to the parameter values of the multiple exposure factors; determining the valid parameter value in the parameter value of the brightness of the target region in the image shot by the video device according to the valid environment brightness interval; wherein, in the case that the parameter value of each exposure factor in the multiple exposure factors of the video device is adjusted to the target parameter value, the parameter value of the brightness of the target region in the image shot by the video device is located in the valid brightness interval; the target parameter value of the target exposure factor is located in the value interval of the target exposure factor, and the target exposure factor is any one of the multiple exposure factors.
[0010] According to the illumination detection method of the video device environment provided by the application, the sample parameter values of each target parameter of each frame sample image are normalized, comprising: obtaining the sample parameter values of the second target parameter of multiple frame sample images; the second target parameter is any one of the multiple target parameters; obtaining the average value and the standard deviation of the sample parameter values of the second target parameter of the multiple frame sample images, and taking the average value and the standard deviation as at least one normalized parameter value corresponding to the second target parameter; and obtaining the processing result of the normalization processing of the sample parameter values of the second target parameter of each frame sample image according to the average value and the standard deviation.
[0011] The application further provides a device for detecting the illumination of the environment of a video device, comprising the following modules: an obtaining module, a preprocessing module, a mapping module, an input module and a processing module.
[0012] The obtaining module is used for obtaining the parameter values of multiple target parameters of a video device; the multiple target parameters comprise multiple exposure factors and multiple pixel features of a target region in an image shot under a current environment.
[0013] The preprocessing module is used to normalize the corresponding target parameters based on at least one normalized parameter value for each target parameter among multiple target parameters, so as to obtain the standard parameter value of each target parameter; at least one normalized parameter value is obtained based on the sample data used in the process of obtaining the target neural network model; the target neural network model is used to output the corresponding illuminance value based on the parameter values of the multiple input target parameters.
[0014] The mapping module is used to input the standard parameter value of any first target parameter among multiple target parameters into the target deviation mapping model to obtain the mapped parameter value of the first target parameter output by the target deviation mapping model. The target deviation mapping model is obtained based on the parameter values of each parameter in the first functional relationship and multiple second functional relationships that correspond one-to-one with the multiple target parameters. The first functional relationship is the functional relationship between multiple target parameters and illuminance value obtained based on the target neural network model, and the second functional relationship corresponding to any second target parameter among the multiple target parameters is the functional relationship between the second target parameter and illuminance value obtained based on sample data.
[0015] The input module is used to input the mapping parameter values of all target parameters into the target neural network model.
[0016] The processing module is used to obtain the illuminance value of the environment where the video device is located based on the output of the target neural network model.
[0017] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement an illumination detection method for any of the video device environments described above.
[0018] The present invention also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements an illumination detection method for any of the video device environments described above.
[0019] The present invention also provides a computer program product, including a computer program that, when executed by a processor, implements an illumination detection method for any of the video device environments described above.
[0020] The present invention provides a method, apparatus, and electronic device for detecting illuminance in a video device environment. This method acquires parameter values of multiple target parameters of the video device. These target parameters include multiple exposure factors and multiple pixel features of a target region in an image captured under the current environment. Based on at least one normalized parameter value corresponding to each target parameter, the method normalizes the corresponding target parameters to obtain standard parameter values for each target parameter. At least one normalized parameter value is obtained based on sample data used in obtaining the target neural network model. The target neural network model is used to output corresponding illuminance values based on the input parameter values of the multiple target parameters. The method further involves standardizing the standard parameter value of any first target parameter among the multiple target parameters. The quasi-parameter values are input into the target deviation mapping model to obtain the mapping parameter values of the first target parameter output by the target deviation mapping model. The target deviation mapping model is obtained based on the parameter values of each parameter in the first functional relationship and multiple second functional relationships corresponding to multiple target parameters. The first functional relationship is the functional relationship between multiple target parameters and illuminance values obtained based on the target neural network model. The second functional relationship corresponding to any second target parameter among the multiple target parameters is the functional relationship between the second target parameter and illuminance values obtained based on sample data. The mapping parameter values of all target parameters are input into the target neural network model. Based on the output of the target neural network model, the illuminance value of the environment where the video device is located is obtained. This invention can obtain the current illuminance value of the video environment by using multiple current exposure factors of the video device and pixel features in the target area of the captured image as input data, and using the target deviation mapping model and target neural network model trained based on real sampled data, as well as the normalized input data. This invention goes beyond simple linear or nonlinear calculations of exposure factors and pixel features in the target area of the captured image. Instead, before inputting the input data into the target neural network model, it maps the input data based on a target deviation mapping model. This corrects data that the target neural network model cannot correct, and then inputs the mapped data into the target neural network model, ensuring the accuracy of the model's output. This invention can detect illumination based on a target deviation mapping model and a target neural network model derived from a neural network, solving the problem of large deviations in illumination detection results from different video devices under the same environment in existing technologies, and thus improving the accuracy of illumination detection results. Attached Figure Description
[0021] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0022] Figure 1 This is one of the flowcharts illustrating the illumination detection method for the video device environment provided in this embodiment of the invention.
[0023] Figure 2 This is one of the process diagrams in a specific implementation of the video device environment illumination detection method provided in the embodiments of the present invention.
[0024] Figure 3 This is one of the process diagrams in a specific implementation of the video device environment illumination detection method provided in the embodiments of the present invention.
[0025] Figure 4 This is the second flowchart illustrating the illumination detection method for the video device environment provided in this embodiment of the invention.
[0026] Figure 5 This is a schematic diagram of the target area in the illumination detection method for the video device environment provided in the embodiments of the present invention.
[0027] Figure 6 This is a schematic diagram illustrating the division of the target area into n×m sub-regions in the illuminance detection method for the video device environment provided in this embodiment of the invention.
[0028] Figure 7 This is the third flowchart illustrating the illumination detection method for the video device environment provided in this embodiment of the invention.
[0029] Figure 8 This is a schematic diagram of the effective ambient brightness range in the illuminance detection method for video device environment provided in the embodiments of the present invention.
[0030] Figure 9 This is a schematic diagram of the model training process in the video device environment illumination detection method provided in the embodiments of the present invention.
[0031] Figure 10 This is a schematic diagram illustrating the fitting problem that occurs during neural network computation.
[0032] Figure 11 This is a schematic diagram illustrating the fitting problem in the functional relationship curves between various target parameters and illuminance values during neural network calculation.
[0033] Figure 12 It is a functional relationship curve between each target parameter and the illuminance value obtained by using the illuminance detection method for video equipment environment provided in the embodiments of the present invention.
[0034] Figure 13 This is a schematic diagram of the structure of the video equipment environment illumination detection device provided in an embodiment of the present invention.
[0035] Figure 14 This is a schematic diagram of the structure of the electronic device provided in an embodiment of the present invention. Detailed Implementation
[0036] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.
[0037] The following is combined with Figures 1-12 The present invention describes an illumination detection method for the environment of a video device.
[0038] In this embodiment of the invention, the video device refers to a device with video recording capabilities.
[0039] Figure 1 This is one of the flowcharts illustrating the illuminance detection method for the video device environment provided by the present invention, such as... Figure 1 As shown, the method includes the following steps S110~S150.
[0040] S110: Obtain the parameter values of multiple target parameters of the video device; the multiple target parameters include multiple exposure factors and multiple pixel features of the target area in the image captured in the current environment.
[0041] Multiple exposure factors may include: shutter speed (i.e., the time required for the shutter to open and close once), gain, aperture, and the intensity of the fill light.
[0042] Multiple pixel features can be, for example, multiple brightness features, which may include: average brightness, brightness range (the difference between the maximum and minimum brightness), brightness distribution, etc.
[0043] Multiple pixel features can also be multiple grayscale features, which may include, for example, the average grayscale value, the grayscale range (the difference between the maximum and minimum grayscale values), and the grayscale distribution.
[0044] For one of the multiple target parameters, the target parameter can be any of the above-mentioned exposure factors or any of the above-mentioned pixel features.
[0045] The target area varies depending on the video equipment. In practice, the position and size of the target area can be set according to the video equipment's shooting parameters (such as the lens's focal length and the resolution of the captured image).
[0046] S120: Based on at least one normalized parameter value corresponding to each of the multiple target parameters, normalize the corresponding target parameters to obtain the standard parameter values of each target parameter.
[0047] At least one normalization parameter value can be obtained based on the sample data used in the process of obtaining the target neural network model.
[0048] In some embodiments, at least one normalized parameter value may be the mean and standard deviation of each target parameter in the sample data obtained based on the above-described sample data. The process of obtaining at least one normalized parameter value can be found in the following description of the sample data normalization process (corresponding to subsequent step S420), and will not be described in detail here.
[0049] Correspondingly, the normalization process for the corresponding target parameter is the same as the normalization process for the sample data described later, based on at least one normalized parameter value for each target parameter among the multiple target parameters. For details, please refer to the description of the normalization process for the sample data (corresponding to subsequent step S420) in the later section. This will not be explained in detail here.
[0050] The target neural network model is used to output the corresponding illuminance value based on the parameter values of multiple target parameters input. The process of obtaining the target neural network model can be found in the descriptions of S410~S490 later in this text, and will not be explained in detail here.
[0051] S130: Input the standard parameter value of any first target parameter among multiple target parameters into the target deviation mapping model to obtain the mapping parameter value of the first target parameter output by the target deviation mapping model.
[0052] The target deviation mapping model is obtained based on the first functional relationship and the parameter values of each parameter in multiple second functional relationships that correspond one-to-one with multiple target parameters.
[0053] The first functional relationship is the functional relationship between multiple target parameters and illuminance values obtained based on the target neural network model. This functional relationship is the neural network functional relationship of the target neural network model.
[0054] The second functional relationship corresponding to any second target parameter among multiple target parameters is the functional relationship between the second target parameter and the illuminance value obtained based on the above sample data. The process of obtaining the second functional relationship can be found in the corresponding description below (step S450), and will not be explained in detail here.
[0055] For example, multiple target parameters include: pixel features of the target area (e.g., average brightness and brightness range of the target area), shutter speed, gain, aperture, and fill light intensity. The first functional relationship is the functional relationship between all items of the pixel features of the target area, shutter speed, gain, aperture, and fill light intensity obtained based on the target neural network model and the illuminance value.
[0056] For example, the first functional relationship can be as follows:
[0057] in, , This refers to the weight of the corresponding exposure factor, which is also the weight of each exposure factor in the target neural network model.
[0058] It is understandable that the above example is only for ease of understanding by using a linear function to approximate the first functional relationship. In reality, the first functional relationship may be a quadratic function, a power function, a logarithmic function, or other functional forms.
[0059] For example, several target parameters include: (For example, the average brightness and brightness range of the target area), shutter speed, gain, aperture, and fill light intensity. The second functional relationship corresponding to the target parameters is the functional relationship between the target parameter and the illuminance value. For example, if the target parameter is the average brightness of the target area, the second functional relationship corresponding to the average brightness of the target area is the relationship between the average brightness and the illuminance value of the target area, obtained based on the average brightness and illuminance value of the target area in the sample data; or, if the target parameter is the shutter speed, the second functional relationship corresponding to the shutter speed is the relationship between the shutter speed and the illuminance value, obtained based on the shutter speed and illuminance value in the sample data, and so on.
[0060] For details on obtaining the target deviation mapping model, please refer to the sections on obtaining the target deviation mapping model in S410~S490 below. It will not be explained in detail here.
[0061] S140: Input the mapping parameter values of all target parameters into the target neural network model.
[0062] The mapping parameter values of all target parameters are input into the target neural network model. The target neural network model performs neural network calculations on the mapping parameter values of all target parameters and outputs the calculation results (i.e., the output results of the target neural network model).
[0063] S150: Obtain the illuminance value of the environment where the video device is located based on the output of the target neural network model.
[0064] The output of the target neural network model is denormalized (the inverse operation of normalization in S120), and the result of the denormalization is used as the illuminance value of the environment where the video device is located.
[0065] The entire process of obtaining the illuminance value of the environment where the video device is located in steps S110~S150 can be found in [reference needed]. Figure 2 As shown, Figure 2 The exposure factor data refers to the parameter values of multiple exposure factors obtained in S110. Figure 2 The image region features are the parameter values of multiple pixel features of the target region obtained in S110. Figure 2 The data normalization in S120 refers to the normalization process for multiple target parameters. After completing the normalization process in S120, the process of mapping the obtained standard parameter values is performed. Figure 2 The data mapping process is performed by the target bias mapping model. After the data mapping is completed, the obtained data is processed by a neural network. The resulting data includes, for example, the mapping parameter values of multiple pixel features of the target region (corresponding to...). Figure 2 (Regional features in the image), shutter speed mapping parameter values (corresponding to) Figure 2 The shutter speed), aperture mapping parameter value (corresponding to) Figure 2 (Aperture in the image), the mapping parameter value of the gain (corresponding to) Figure 2 The gain in the image), the mapping parameter value of the fill light intensity (corresponding to) Figure 2 The calculation process (of the supplementary light intensity) is performed by the target neural network model. Finally, the output of the target neural network model is denormalized. Figure 3 The inverse normalization is used to obtain the ambient illuminance value (corresponding to the illuminance value of the environment where the video device is located in S150).
[0066] In some embodiments, at least one normalized parameter value of each target parameter in the normalization process of S120 is the mean and standard deviation of that target parameter in the sample data used in obtaining the target neural network model. In this case, the entire process of obtaining the illuminance value of the environment where the video device is located in S110~S150 can be referred to Figure 3 As shown. Figure 3 The exposure factor data refers to the parameter values of multiple exposure factors obtained in S110. Figure 3 The image region features are the parameter values of multiple pixel features of the target region obtained in S110. Figure 2 The process involves obtaining the mean and standard deviation of each target parameter from the sample data, and then standardizing the target parameter based on the mean and standard deviation. Figure 3 Data normalization in Figure 2 Mapping standardized data in ChinaFigure 3 Data mapping within the network. During neural network computation, through... Figure 4 It can be seen that the weights of each neuron in the neural network computation are... The bias is b. b is obtained through the model training process of the target neural network model described later.
[0067] Through steps S110~S150, the illuminance value of the environment in which the video device is located can be obtained after obtaining the parameter values of multiple target parameters. The entire process is efficient and objective. For different video devices in the same environment, after obtaining the parameter values of multiple target parameters for each video device, the illuminance value of each video device is calculated based on the parameter values of multiple target parameters for each video device, and the obtained illuminance values are close to consistent.
[0068] The calculation of the entire process described above is mainly based on the target deviation mapping model and the target neural network model. The following section will introduce in detail the process of obtaining the target deviation mapping model and the target neural network model.
[0069] like Figure 5 As shown, before executing S110, this embodiment of the invention may execute S410~S490 to obtain the target deviation mapping model and the target neural network model.
[0070] S410: Collect sample data.
[0071] The sample data may include multiple sample illuminance values, as well as sample parameter values of each target parameter in each frame of the multi-frame sample images acquired under the target sample illuminance value. The aforementioned multi-frame sample images are consecutive frame images, and the target sample illuminance value is any one of the multiple sample illuminance values.
[0072] The corresponding descriptions of each target parameter can be found in step S110, and will not be repeated here.
[0073] The following describes the process of collecting sample data.
[0074] Specifically, multiple types of video equipment can be placed in the same physical environment to film the same subject, thereby obtaining multiple frames of sample images. The aforementioned physical environment includes both natural environments and artificially created indoor environments.
[0075] In natural environments, multiple sample images are collected with a minimum collection duration of 24 hours to obtain images under all illumination values from day to night.
[0076] In an artificially designed indoor environment, the illuminance can be controlled by adjusting the luminous intensity of the light source. Multiple sample images can be collected under different illuminance levels. The adjustment range of the light source's luminous intensity is [0, A], where A is the maximum value of the light source's luminous intensity.
[0077] It should be noted that the multiple sample images collected in the artificially set indoor environment are used to obtain the multiple second function relationships mentioned in S130.
[0078] When different video devices capture the same subject, the resulting images will not be identical due to differences in their shooting parameters (such as lens focal length and image resolution). In this case, it is necessary to redefine the target area based on the content of all captured images. The target area must satisfy the condition that the image within the target area of all images is identical.
[0079] like Figure 5 As shown, the same subject was photographed using three video devices (each with a different focal length and image resolution), resulting in image 1 (photographed by video device 1), image 2 (photographed by video device 2), and image 3 (photographed by video device 3). Clearly, the images in images 1, 2, and 3 are not identical. Therefore, the target area in each image (image 1, image 2, and image 3) is delineated. Figure 5 The area within the red box (image 1, image 2, and image 3) contains the same image.
[0080] After obtaining multiple frames of sample images, the sample parameter values of each target parameter in each frame of sample images can be obtained.
[0081] Taking the case where the target parameter is brightness as an example, the sample parameter values of brightness for each frame of the sample image can be obtained through the following process.
[0082] Specifically, after determining the target region of each frame of sample image (e.g.) Figure 6 (The areas within the red boxes in Images 1, 2, and 3) For each frame of sample image, the average brightness of the target area of that frame of sample image is obtained as the sample parameter value of the brightness of that sample image.
[0083] The process of obtaining the average brightness of the target area can be as follows. For example... Figure 7 As shown, the target region B in the Nth frame sample image can be divided into n×m sub-regions, where N, m, and n are positive integers. The brightness Luma of the sub-region is obtained based on the Raw data in the i-th row and j-th column sub-region. [i][j] Let i and j be positive integers, 1≤i≤m, 1≤j≤n. Then, based on the brightness of each sub-region and the weight value W of each sub-region... [i][j]The average brightness Luma of the target region in the Nth frame image is calculated using the following formula. Avg : .
[0084] The weight value W of each sub-region [n][m] Users can configure it according to their actual needs.
[0085] For cases where the target parameters are brightness range or brightness distribution, a similar calculation method can be used to obtain the sample parameter values of the brightness range and brightness distribution of each frame of sample images.
[0086] For multiple exposure factors among multiple target parameters, multiple exposure factors (such as shutter speed, gain, aperture, and fill light intensity) can be obtained when capturing each frame of sample image, thereby obtaining the sample parameter values of each exposure factor in each frame of sample image.
[0087] After collecting sample data, to eliminate the influence of indoor lighting flicker and environmental interference (such as vehicle headlights or moving objects intruding into the area of interest) on the data collection results, the collected sample data can be cleaned to remove abnormal data caused by external interference. Therefore, in some embodiments, after executing S410, such as Figure 8 As shown, S710~S740 can also be executed.
[0088] S710: Obtain the fluctuation range of the sample parameter value of the second target parameter from the E-frame sample image to the F-frame sample image; the second target parameter is any one of multiple target parameters.
[0089] Fluctuation amplitude can be represented in several ways. For example, it can be represented by the first difference between the maximum and minimum sample parameter values of the second target parameter in the sample images from frame E to frame F. The larger the first difference, the larger the fluctuation amplitude, and vice versa. Alternatively, fluctuation can be represented by the maximum value among the second differences of the sample parameter values of the second target parameter in adjacent frame sample images from frame E to frame F. The larger the maximum value among the second differences, the larger the fluctuation amplitude, and vice versa.
[0090] E and F are positive integers.
[0091] S720: Determine whether the fluctuation amplitude is less than the set threshold.
[0092] The threshold can be set by those skilled in the art according to the actual situation, and the embodiments of the present invention do not limit this.
[0093] If the judgment result is yes, that is, the fluctuation amplitude is less than the set threshold, execute S730; if the judgment result is no, that is, the fluctuation amplitude is greater than or equal to the set threshold, execute S740.
[0094] S730: Determine that the sample images of all frames between the sample image of frame E and the sample image of frame F are valid.
[0095] S740: Determine that all sample images of all frames between the sample image of frame E and the sample image of frame F are invalid.
[0096] S710~S740 can be used to clean up abnormal data in the initial sample data collected, ensuring the accuracy of subsequent data processing results.
[0097] One of the multiple pixel features is brightness. When the ambient light is too dark or too bright, no matter how the brightness of the target area in the image captured by the video device is adjusted (this brightness can be the average brightness of the target area), the exposure factor value on the device cannot be restored to the value before the adjustment (the adjustment process can be seen in the corresponding description in S440 later), and it also exceeds the tolerance range of the target area's brightness adjustment (e.g., Figure 8 (Target brightness +2 and target brightness -2). In this case, it indicates that the current ambient illuminance exceeds the adjustment range of the video device. Therefore, the brightness data under this ambient illuminance (e.g., target brightness +2 and target brightness -2) should be discarded. Figure 9 (Data corresponding to the red lines in the middle).
[0098] Based on this, in some embodiments, after executing S410, an effective ambient brightness range can be determined based on the parameter values of multiple exposure factors; then, based on the effective ambient brightness range, an effective parameter value can be determined from the parameter values of the brightness of the target area in the image captured by the video device.
[0099] When the parameter values of each of the multiple exposure factors of a video device are adjusted to the target parameter value, the brightness parameter value of the target area in the image captured by the video device is within the effective brightness range; the target parameter value of the target exposure factor is within the value range of the target exposure factor, which can be any one of the multiple exposure factors. If the target parameter value of the target exposure factor is outside the value range of the target exposure factor, the brightness parameter value of the target area in the image captured by the video device is not within the effective brightness range.
[0100] S420: Normalize the sample parameter values of each target parameter in each frame of the sample image.
[0101] First, sample parameter values of the second target parameter from multiple sample images can be obtained. The second target parameter can be any one of multiple target parameters. Next, the mean and standard deviation of the sample parameter values of the second target parameter from the multiple sample images are obtained. Then, based on the mean and standard deviation, the normalized processing result of the sample parameter values of the second target parameter for each frame is obtained.
[0102] The normalization result of the sample parameter values of the second target in each frame of the sample image can be calculated using the following normalization formula: ; in, The result of normalizing the sample parameter values for the second objective parameter. The sample parameter values are the second objective parameters. The average value of the sample parameter values of the second target parameter in multiple sample images. is the standard deviation of the sample parameter values of the second target parameter in multiple sample images.
[0103] This normalization method is also applied to the normalization process of each target parameter in S120. At least one normalized parameter value in S120 is the mean and standard deviation of the sample parameter values of each target parameter obtained in S420. When normalizing each target parameter in S120, the standard parameter value of each target parameter in S120 can be calculated using the above normalization formula based on the mean and standard deviation of the sample parameter values of each target parameter obtained in S420. In this case, the normalization formula... The standard parameter values for the target parameter to be calculated. This is the parameter value for the target parameter. This is the average value of the target parameter across multiple sample images. This represents the standard deviation of the sample parameter values of the target parameter across multiple frames of sample images.
[0104] S430: Based on the normalization processing results of the sample parameter values of each target parameter in each frame of sample images, the sample illumination values corresponding to the sample parameter values of each target parameter in each frame of sample images, and the deviation mapping model to be updated, complete the training of the neural network model to be trained for 1 liter.
[0105] The input data for the neural network model to be trained is obtained from the normalization processing results of the sample parameter values of each target parameter in each frame of sample images and the bias mapping model to be updated.
[0106] See Figure 9 , Figure 9The exposure factor data refers to the sample parameter values of multiple exposure factors. Figure 9 The image region features are the sample parameter values of multiple pixel features. After normalizing the sample parameter values of multiple exposure factors and multiple pixel features of each frame of sample images, the sample parameter values of each target parameter of each frame of sample images are input into the deviation mapping model to be updated for data mapping. The output of the deviation mapping model to be updated is used as the input data of the neural network model to be trained. Based on the sample illumination value corresponding to each target parameter of each frame of sample images (corresponding to...) Figure 9 Using the actual illuminance value and the output data of the neural network model to be trained, calculate the loss function of the neural network model to be trained, update the model parameters in the neural network model to be trained according to the loss function, and train the neural network model (corresponding to...). Figure 9 Training of the target neural network model.
[0107] 1 epoch refers to training the model once using all the sample data. `iter` refers to the number of iterations required to complete 1 epoch of training. The number of samples input to `1iter` for the model to be trained is the number of samples in one iteration. See also... Figure 9 After training on the number of samples corresponding to each iter, the model parameters in the neural network model to be trained are updated.
[0108] Before the first 1iter training of the neural network model to be trained, the bias mapping model to be updated is the initial bias mapping model, and the neural network model to be trained is the initial neural network model. In this case, after inputting the sample parameter values of each target parameter from each frame of sample images into the initial bias mapping model, the sample parameter values of each target parameter do not change. That is, before the first 1iter training, the input data to the initial neural network model is the result of normalizing the sample parameter values of each target parameter from each frame of sample images.
[0109] S440: After completing 1 liter of training on the neural network model to be trained based on the sample data and the bias mapping model to be updated, update the first model parameters of the neural network model to be trained.
[0110] S450: Determine whether the number of training iterations for the neural network model to be trained to complete 1 liter of training is less than the set number of iterations.
[0111] For each liter of training completed by the neural network model, the training count is incremented by 1. In this case, if the determination result is yes (i.e., the number of training iterations for 1 liter of training for the neural network model is less than the set number), proceed to step S460. If the determination result is no (i.e., the number of training iterations for 1 liter of training for the neural network model is greater than or equal to the set number), proceed to step S490.
[0112] The number of attempts can be set by those skilled in the art according to the actual situation. In a specific implementation, the number of attempts could be, for example, 10. 6 Second-rate.
[0113] S460: Update the first model parameters of the neural network model to be trained.
[0114] After updating the first model parameters of the neural network model to be trained, execute S470.
[0115] S470: Determine whether the neural network model to be trained has completed 1 epoch of training.
[0116] If yes, that is, the neural network model to be trained has completed 1 epoch of training, proceed to S480. If no, that is, the neural network model to be trained has not completed 1 epoch of training, proceed to S430 again to complete 1 epoch of training based on the normalization processing results of the sample parameter values of each target parameter of each frame sample image, the sample illumination value corresponding to the sample parameter values of each target parameter of each frame sample image, and the deviation mapping model to be updated.
[0117] S480: Obtain the neural network function relationship of the first neural network model as the first function relationship, and update the second model parameters of the deviation mapping model to be updated based on the first function relationship and multiple second function relationships obtained based on sample data.
[0118] After executing S480, re-execute S430.
[0119] S490: Use the deviation mapping model to be updated as the target deviation mapping model, and use the neural network model to be trained as the target neural network model.
[0120] The process of obtaining multiple second function relationships based on sample data is as follows.
[0121] First, after setting the parameter values of each of the multiple exposure factors, keep the current parameter values of each exposure factor unchanged, and adjust the luminous intensity of the light source to adjust the illuminance value of the current environment. The adjustment range of the current environment's illuminance value is within the effective ambient brightness range (see the introduction to the effective ambient brightness range after S740). Each time the current environment's illuminance value is adjusted to a target illuminance value, the parameter values of multiple pixel features of the target area in the image captured by the video device are recorded. Using an illuminance meter with different sampling methods (e.g., five-point sampling), the true illuminance value of the environmental area corresponding to the target area is obtained. From this, the functional relationship between each pixel feature and the illuminance value can be obtained. For any pixel feature, the functional relationship between that pixel feature and the illuminance value is the second functional relationship corresponding to that pixel feature.
[0122] Following this, based on the functional relationship between each pixel feature and the illuminance value, for any one of the multiple exposure factors, the parameter value of that exposure factor is increased (or decreased) to obtain the parameter value of the pixel feature of the target area in the captured image. Then, keeping the parameter value of the pixel feature unchanged, the illuminance value of the current environment is changed so that the parameter value of the exposure factor is restored to the parameter value before the increase (or decrease). Based on the changed illuminance value of the current environment, the restored parameter value of the exposure factor, and the parameter value of the pixel feature of the target area in the captured image, a second functional relationship between each exposure factor and the illuminance value is obtained.
[0123] The function curve of the second functional relationship is The neural network relation function curve of the neural network model to be trained is: The deviation mapping model needs to be updated. and The result deviation and derivative deviation are considered. If the result deviation exceeds the set first tolerance threshold, the subsequent mapping is corrected; otherwise, the current mapping result is maintained and the iteration continues. If the derivative deviation exceeds the set second tolerance threshold, the subsequent mapping is corrected; otherwise, the current mapping result is maintained and the iteration continues.
[0124] Based on the first functional relationship and multiple second functional relationships obtained from sample data, the deviation mapping model to be updated is updated (corresponding to...). Figure 10The process involves updating the exposure mapping function to obtain a first deviation mapping model. Specifically, this process includes: sequentially obtaining target mapping values from a set of preset mapping values; using the target mapping values as the independent variables of a second functional relationship and substituting them into the second functional relationship to obtain a first calculation result; using the first calculation result as the dependent variable of the first functional relationship and substituting it into the first functional relationship to obtain a second calculation result; and updating the model parameters of the deviation mapping model to be updated based on the target mapping values and the second calculation result to obtain the first deviation mapping model.
[0125] For example, based on the neural network function curve Following the principle of differentiability everywhere, there are no discontinuities. As a baseline, when x = 1, 2, 3...k, where k is a positive integer, the values of x correspond to the target mapping values mentioned above. The corresponding true illuminance value can be obtained. , The first calculation result obtained by substituting the target mapping value into the second functional relationship is... Substitution The first calculation result is used as the dependent variable of the first functional relationship, and substituted into the first functional relationship to obtain the second calculation result. ,according to and A new mapping function can be obtained. Construct the corresponding weights of the current neuron With actual input Mapping relationship:
[0126] After establishing the mapping relationship, the mapping relationship is adjusted and the model learning rate is reduced so that it continues to update the neuron parameters within the newly established mapping relationship, that is, to update the model parameters of the bias mapping model to be updated, thus obtaining the first bias mapping model.
[0127] For the target area of each frame of sample image, when adjusting the exposure factors of the video devices subsequently, the illuminance referenced in the adjustment process of the exposure factors of all video devices is the illuminance of the target area in the sample image captured by that video device.
[0128] After several rounds of iteration, the model parameters (neuron weights) of the deviation mapping model to be updated and the model parameters (neuron weights) of the neural network model to be trained reach stable values, thus obtaining the target deviation mapping model and the target neural network model.
[0129] The purpose of obtaining the target deviation mapping model in this embodiment of the invention is to solve the fitting problem existing in neural network calculation. For example... Figure 11As shown, the blue line represents the true illuminance curve including noise fluctuations. Overfitting models learn these fluctuations and noise as effective features, leading to unrealistic overfitting results. As shown by the red line, the model only fits well to the training data and cannot map data not present in the training set according to reasonable patterns. In this case, relying solely on neural network calculations to obtain the ambient illuminance of the video device will result in some target parameters showing unrealistic trends in the curves after several iterations, because effective data cannot cover all application scenarios. Figure 11 The curve in the red box highlights the abnormal portion. Possible reasons why effective data may not cover all application scenarios include: aperture size is closely related to camera depth of field; when the depth of field is too small, focusing is difficult, making it hard to obtain image samples of aperture in certain ranges of the actual scene; when the ambient light is too low, adjusting the camera gain will not change the image brightness, only increase random noise, making it impossible to obtain the mapping relationship between gain and image brightness. Based on the above problems, this embodiment of the invention sets up a target deviation mapping model to correct the neural network calculation process using multiple second function relationships that are closer to the actual situation, obtained based on sample data. Simultaneously, it continuously adjusts its own (i.e., the target deviation mapping model) model parameters according to the neural network calculation results, ensuring that the regression curve is consistent with the trend of the real physical curve in a semi-supervised manner, thus solving the overfitting problem in neural network calculation. Compared to... Figure 12 The function curves shown represent the illuminance value curves calculated for each target parameter, under the conditions of setting the target deviation mapping model and the target neural network model. Figure 13 As shown, this is more consistent with the actual physical mapping relationship, thus obtaining accurate illuminance values.
[0130] The present invention provides an illumination detection method for a video device environment, which acquires parameter values of multiple target parameters of the video device; the multiple target parameters include multiple exposure factors and multiple pixel features of the target region in the image captured in the current environment; based on at least one normalized parameter value corresponding to each target parameter, the corresponding target parameter is normalized to obtain a standard parameter value for each target parameter; at least one normalized parameter value is obtained based on sample data used in the process of obtaining the target neural network model; the target neural network model is used to output the corresponding illumination value based on the parameter values of the multiple input target parameters; and the standard parameter value of any first target parameter among the multiple target parameters is used to... The target deviation mapping model is input to obtain the mapping parameter values of the first target parameter output by the target deviation mapping model. The target deviation mapping model is obtained based on the parameter values of each parameter in the first functional relationship and multiple second functional relationships corresponding to multiple target parameters. The first functional relationship is the functional relationship between multiple target parameters and illuminance values obtained based on the target neural network model. The second functional relationship corresponding to any second target parameter among the multiple target parameters is the functional relationship between the second target parameter and illuminance values obtained based on sample data. The mapping parameter values of all target parameters are input to the target neural network model. Based on the output of the target neural network model, the illuminance value of the environment where the video device is located is obtained. This invention can obtain the current illuminance value of the video environment by using multiple current exposure factors of the video device and pixel features in the target area of the captured image as input data, and using the target deviation mapping model and target neural network model trained based on real sampled data, as well as the normalized input data. This invention goes beyond simple linear or nonlinear calculations of exposure factors and pixel features in the target area of the captured image. Instead, before inputting the input data into the target neural network model, it maps the input data based on a target deviation mapping model. This corrects data that the target neural network model cannot correct, and then inputs the mapped data into the target neural network model, ensuring the accuracy of the model's output. This invention can detect illumination based on a target deviation mapping model and a target neural network model derived from a neural network, solving the problem of large deviations in illumination detection results from different video devices under the same environment in existing technologies, and thus improving the accuracy of illumination detection results.
[0131] The illuminance detection device for video equipment environment provided by the present invention will be described below. The illuminance detection device for video equipment environment described below can be referred to in correspondence with the illuminance detection method for video equipment environment described above.
[0132] Figure 13 This is a schematic diagram of the illuminance detection device for the video equipment environment provided by the present invention. Figure 14As shown, the illuminance detection device 1300 for the video equipment environment includes: The acquisition module 1301 is used to acquire the parameter values of multiple target parameters of the video device; the multiple target parameters include multiple exposure factors and multiple pixel features of the target area in the image captured in the current environment.
[0133] The preprocessing module 1302 is used to normalize the corresponding target parameters according to at least one normalized parameter value of each target parameter among multiple target parameters, so as to obtain the standard parameter value of each target parameter; at least one normalized parameter value is obtained based on the sample data used in the process of obtaining the target neural network model; the target neural network model is used to output the corresponding illuminance value according to the parameter values of the multiple input target parameters.
[0134] The mapping module 1303 is used to input the standard parameter value of any first target parameter among multiple target parameters into the target deviation mapping model to obtain the mapping parameter value of the first target parameter output by the target deviation mapping model. The target deviation mapping model is obtained based on the parameter values of each parameter in the multiple second functional relationships that correspond one-to-one with the multiple target parameters. The first functional relationship is the functional relationship between multiple target parameters and illuminance value obtained based on the target neural network model. The second functional relationship corresponding to any second target parameter among the multiple target parameters is the functional relationship between the second target parameter and illuminance value obtained based on sample data.
[0135] Input module 1304 is used to input the mapping parameter values of all target parameters into the target neural network model.
[0136] The processing module 1305 is used to obtain the illuminance value of the environment where the video device is located based on the output of the target neural network model.
[0137] The illuminance detection device for a video device environment provided by this invention acquires parameter values of multiple target parameters of the video device; the multiple target parameters include multiple exposure factors and multiple pixel features of the target region in an image captured under the current environment; based on at least one normalized parameter value corresponding to each target parameter, the corresponding target parameter is normalized to obtain a standard parameter value for each target parameter; at least one normalized parameter value is obtained based on sample data used in obtaining the target neural network model; the target neural network model is used to output a corresponding illuminance value based on the parameter values of the multiple input target parameters; the standard parameter value of any first target parameter among the multiple target parameters is... The target deviation mapping model is input to obtain the mapping parameter values of the first target parameter output by the target deviation mapping model. The target deviation mapping model is obtained based on the parameter values of each parameter in the first functional relationship and multiple second functional relationships corresponding to multiple target parameters. The first functional relationship is the functional relationship between multiple target parameters and illuminance values obtained based on the target neural network model. The second functional relationship corresponding to any second target parameter among the multiple target parameters is the functional relationship between the second target parameter and illuminance values obtained based on sample data. The mapping parameter values of all target parameters are input to the target neural network model. Based on the output of the target neural network model, the illuminance value of the environment where the video device is located is obtained. This invention can obtain the current illuminance value of the video environment by using multiple current exposure factors of the video device and pixel features in the target area of the captured image as input data, and using the target deviation mapping model and target neural network model trained based on real sampled data, as well as the normalized input data. This invention goes beyond simple linear or nonlinear calculations of exposure factors and pixel features in the target area of the captured image. Instead, before inputting the input data into the target neural network model, it maps the input data based on a target deviation mapping model. This corrects data that the target neural network model cannot correct, and then inputs the mapped data into the target neural network model, ensuring the accuracy of the model's output. This invention can detect illumination based on a target deviation mapping model and a target neural network model derived from a neural network, solving the problem of large deviations in illumination detection results from different video devices under the same environment in existing technologies, and thus improving the accuracy of illumination detection results.
[0138] Figure 14 An example is a schematic diagram of the physical structure of an electronic device, such as... As shown, the electronic device may include: a processor 1410, a communications interface 1420, a memory 1430, and a communication bus 1440, wherein the processor 1410, the communications interface 1420, and the memory 1430 communicate with each other through the communication bus 1440. The processor 1410 can call logical instructions in the memory 1430 to execute a video device environment illumination detection method. This method includes: acquiring parameter values of multiple target parameters of the video device; the multiple target parameters include multiple exposure factors and multiple pixel features of the target region in the image captured under the current environment; normalizing the corresponding target parameters according to at least one normalized parameter value corresponding to each target parameter to obtain a standard parameter value for each target parameter; at least one normalized parameter value is obtained based on sample data used in obtaining the target neural network model; the target neural network model is used to output a corresponding illumination value based on the parameter values of the multiple input target parameters; and converting any one of the multiple target parameters... The standard parameter value of the first target parameter is input into the target deviation mapping model to obtain the mapping parameter value of the first target parameter output by the target deviation mapping model. The target deviation mapping model is obtained based on the parameter values of each parameter in the first functional relationship and the multiple second functional relationships corresponding to multiple target parameters. The first functional relationship is the functional relationship between multiple target parameters and illuminance value obtained based on the target neural network model. The second functional relationship corresponding to any second target parameter among the multiple target parameters is the functional relationship between the second target parameter and illuminance value obtained based on sample data. The mapping parameter values of all target parameters are input into the target neural network model. The illuminance value of the environment where the video device is located is obtained according to the output result of the target neural network model.
[0139] Furthermore, the logical instructions in the aforementioned memory 1430 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0140] On the other hand, the present invention also provides a computer program product, which includes a computer program that can be stored on a computer-readable storage medium. When the computer program is executed by a processor, the computer is able to execute the illumination detection method for the video device environment provided by the above methods. The method includes: acquiring parameter values of multiple target parameters of the video device; the multiple target parameters include multiple exposure factors and multiple pixel features of the target region in the image captured in the current environment; normalizing the corresponding target parameters according to at least one normalized parameter value corresponding to each target parameter to obtain a standard parameter value for each target parameter; the at least one normalized parameter value is obtained based on sample data used in the process of obtaining the target neural network model; the target neural network model is used to perform illumination detection based on the input multiple... The target parameters are used to output the corresponding illuminance value; the standard parameter value of any first target parameter among the multiple target parameters is input into the target deviation mapping model to obtain the mapping parameter value of the first target parameter output by the target deviation mapping model; the target deviation mapping model is obtained based on the parameter values of each parameter in the first functional relationship and the multiple second functional relationships that correspond one-to-one with the multiple target parameters; the first functional relationship is the functional relationship between the multiple target parameters and the illuminance value obtained based on the target neural network model, and the second functional relationship corresponding to any second target parameter among the multiple target parameters is the functional relationship between the second target parameter and the illuminance value obtained based on the sample data; the mapping parameter values of all target parameters are input into the target neural network model; the illuminance value of the environment where the video device is located is obtained according to the output result of the target neural network model.
[0141] In another aspect, the present invention also provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements an illumination detection method for a video device environment provided by the methods described above. The method includes: acquiring parameter values of multiple target parameters of the video device; the multiple target parameters including multiple exposure factors and multiple pixel features of a target region in an image captured under the current environment; normalizing the corresponding target parameters based on at least one normalized parameter value corresponding to each target parameter among the multiple target parameters to obtain a standard parameter value for each target parameter; the at least one normalized parameter value being obtained based on sample data used in obtaining a target neural network model; and the target neural network model being used to output based on the parameter values of the input multiple target parameters. The corresponding illuminance value; input the standard parameter value of any first target parameter among multiple target parameters into the target deviation mapping model to obtain the mapping parameter value of the first target parameter output by the target deviation mapping model; the target deviation mapping model is obtained based on the parameter values of each parameter in the first functional relationship and multiple second functional relationships corresponding to multiple target parameters; the first functional relationship is the functional relationship between multiple target parameters and illuminance value obtained based on the target neural network model, and the second functional relationship corresponding to any second target parameter among multiple target parameters is the functional relationship between the second target parameter and illuminance value obtained based on sample data; input the mapping parameter values of all target parameters into the target neural network model; obtain the illuminance value of the environment where the video device is located based on the output of the target neural network model.
[0142] The device embodiments described above are merely illustrative. 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 the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.
[0143] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., including several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods of various embodiments or some parts of embodiments.
[0144] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for detecting the illuminance of a video device's environment, characterized in that, include: Obtain the parameter values of multiple target parameters of the video device; The multiple target parameters include multiple exposure factors and multiple pixel features of the target region in the image captured under the current environment; Based on at least one normalized parameter value corresponding to each of the plurality of target parameters, the corresponding target parameters are normalized to obtain standard parameter values for each target parameter; the at least one normalized parameter value is obtained based on sample data used in the process of obtaining the target neural network model; the target neural network model is used to output corresponding illuminance values based on the parameter values of the plurality of input target parameters; The standard parameter value of any first target parameter among the plurality of target parameters is input into the target deviation mapping model to obtain the mapping parameter value of the first target parameter output by the target deviation mapping model; the target deviation mapping model is obtained based on the parameter values of each parameter in a plurality of second functional relationships corresponding one-to-one with the plurality of target parameters; the first functional relationship is the functional relationship between the plurality of target parameters and the illuminance value obtained based on the target neural network model, and the second functional relationship corresponding to any second target parameter among the plurality of target parameters is the functional relationship between the second target parameter and the illuminance value obtained based on the sample data; Input the mapping parameter values of all the target parameters into the target neural network model; Based on the output of the target neural network model, the illuminance value of the environment where the video device is located is obtained.
2. The method for detecting the illuminance of a video device environment according to claim 1, characterized in that, Before acquiring the parameter values of multiple target parameters of the video device, the method further includes: The sample data is collected; the sample data includes multiple sample illuminance values, and sample parameter values of each of the target parameters in each frame of sample images collected under the target sample illuminance value; the multiple frame sample images are consecutive frame images, and the target sample illuminance value is any one of the multiple sample illuminance values; The normalization process is performed on the sample parameter values of each target parameter in each frame of the sample image. Based on the normalization processing results of the sample parameter values of each target parameter in each frame of sample images, the sample illumination values corresponding to the sample parameter values of each target parameter in each frame of sample images, and the bias mapping model to be updated, the neural network model to be trained completes 1 liter of training; wherein, the input data of the neural network model to be trained is obtained based on the normalization processing results of the sample parameter values of each target parameter in each frame of sample images and the bias mapping model to be updated. After completing 1 liter of training on the neural network model to be trained, update the first model parameters of the neural network model to be trained; When the neural network model to be trained has completed 1 epoch of training, the neural network function relationship of the neural network model to be trained is obtained as the first function relationship. Based on the first function relationship and the multiple second function relationships obtained based on the sample data, the second model parameters of the deviation mapping model to be updated are updated. If the number of training iterations for the neural network model to be trained is less than the set number, the neural network model to be trained is trained again for 1 liter based on the normalization processing result of the sample parameter values of the target parameters of each frame sample image, the sample illumination value corresponding to the sample parameter values of the target parameters of each frame sample image, and the deviation mapping model to be updated. If the number of training iterations for training the neural network model to be trained is greater than or equal to a set number, the deviation mapping model to be updated is used as the target deviation mapping model, and the neural network model to be trained is used as the target neural network model.
3. The illuminance detection method for the environment of video equipment according to claim 2, characterized in that, The step of updating the second model parameters of the deviation mapping model to be updated based on the first functional relationship and the plurality of second functional relationships obtained based on the sample data includes: The target mapping value is obtained sequentially from a set of preset mapping values. The target mapping value is used as the independent variable of the second functional relationship, and substituted into the second functional relationship for calculation to obtain the first calculation result; The first calculation result is used as the dependent variable of the first functional relationship, and substituted into the first functional relationship to obtain the second calculation result; Based on the target mapping value and the second calculation result, update the second model parameters of the deviation mapping model to be updated.
4. The method for detecting the illuminance of a video device environment according to claim 2, characterized in that, After collecting the sample data, the process also includes: Obtain the fluctuation range of the sample parameter value of the second target parameter from the E-th sample image to the F-th sample image; the second target parameter is any one of the plurality of target parameters; If the fluctuation amplitude is less than a set threshold, all sample images of all frames between the E-th sample image and the F-th sample image are determined to be valid. If the fluctuation amplitude is greater than or equal to the set threshold, all sample images of all frames between the E-th sample image and the F-th sample image are determined to be invalid.
5. The method for detecting the illuminance of a video device environment according to claim 2, characterized in that, One of the multiple pixel features is brightness; After collecting the sample data, the process also includes: Based on the parameter values of the multiple exposure factors, the effective ambient brightness range is determined; Based on the effective ambient brightness range, the effective parameter value is determined from the parameter values of the brightness of the target area in the image captured by the video device; Specifically, when the parameter value of each of the plurality of exposure factors of the video device is adjusted to the target parameter value, the parameter value of the brightness of the target area in the image captured by the video device is located within the effective brightness range; the target parameter value of the target exposure factor is located within the value range of the target exposure factor, and the target exposure factor is any one of the plurality of exposure factors.
6. The method for detecting the illuminance of a video device environment according to claim 2, characterized in that, The normalization process for the sample parameter values of each target parameter in each frame of sample images includes: Obtain the sample parameter value of the second target parameter of the multi-frame sample images; the second target parameter is any one of the multiple target parameters; Obtain the average and standard deviation of the sample parameter values of the second target parameter from the multi-frame sample images, and use the average and standard deviation as the at least one normalized parameter value corresponding to the second target parameter; and, Based on the average value and the standard deviation, the normalization processing result of the sample parameter values of the second target parameter of each frame sample image is obtained.
7. An illuminance detection device for a video equipment environment, characterized in that, include: The acquisition module is used to acquire parameter values of multiple target parameters of the video device; the multiple target parameters include multiple exposure factors and multiple pixel features of the target area in the image captured under the current environment; The preprocessing module is used to normalize the corresponding target parameters based on at least one normalized parameter value for each target parameter among the plurality of target parameters, thereby obtaining standard parameter values for each target parameter; the at least one normalized parameter value is obtained based on sample data used in the process of obtaining the target neural network model; The target neural network model is used to output the corresponding illuminance value based on the parameter values of the input multiple target parameters; A mapping module is used to input the standard parameter value of any first target parameter among the plurality of target parameters into a target deviation mapping model to obtain the mapped parameter value of the first target parameter output by the target deviation mapping model; the target deviation mapping model is obtained based on a first functional relationship and the parameter values of each parameter in a plurality of second functional relationships corresponding one-to-one with the plurality of target parameters; the first functional relationship is the functional relationship between the plurality of target parameters and the illuminance value obtained based on the target neural network model, and the second functional relationship corresponding to any second target parameter among the plurality of target parameters is the functional relationship between the second target parameter and the illuminance value obtained based on the sample data; An input module is used to input the mapping parameter values of all the target parameters into the target neural network model; The processing module is used to obtain the illuminance value of the environment where the video device is located based on the output of the target neural network model.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the illumination detection method for the video device environment as described in any one of claims 1 to 6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the illumination detection method for the video device environment as described in any one of claims 1 to 6.
10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the illumination detection method for the video device environment as described in any one of claims 1 to 6.