A vehicle-mounted camera light supplement lamp brightness self-adaptive adjusting system and method
By building an environmental brightness and status monitoring model and combining it with the particle swarm optimization algorithm to dynamically adjust the weight coefficient, automatic adjustment of the vehicle camera fill light is achieved, solving the energy waste and life shortening problems of traditional adjustment methods and improving the robustness and accuracy of the system.
Patent Information
- Application Number
- CN202510250562.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-04
- Publication Date
- 2025-10-24
- Estimated Expiration
- 2045-03-04
AI Technical Summary
The brightness adjustment of traditional vehicle camera fill lights relies on manual intervention and cannot monitor the ambient brightness in real time, resulting in energy waste, shortened fill light life, and insufficient system robustness and accuracy.
The data acquisition module is used to obtain images and environmental parameters. After preprocessing through the data processing module, the environmental brightness monitoring model and state monitoring model are constructed. The particle swarm optimization algorithm is used to dynamically adjust the weight coefficient to achieve automatic adjustment of the fill light.
It achieves precise current and brightness control of the fill light, reduces energy waste, extends lamp life, and improves system robustness and accuracy.
Smart Images

Figure CN119888158B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of automatic control, more particularly, the present application relates to a kind of vehicle camera light supplement lamp brightness self-adapting regulation system and method. BACKGROUND
[0002] With the continuous development of automobile technology, vehicle camera is increasingly widely used in the fields of vehicle safety, intelligent driving assistance system and panoramic view system.
[0003] The patent with application publication number CN115985218A discloses an automobile cabin adaptive dimming system and method based on visual monitoring, which can improve the image quality collected according to the brightness of the current environment and can adaptively adjust the brightness of the vehicle display screen in the cabin according to the brightness of the current environment, improving the driving experience. The system includes first, second, and third in-vehicle monitoring cameras and a driver monitoring camera. The brightness of the current environment is obtained from the image data from the driver visual monitoring device. The automobile cabin monitoring controller judges the brightness of the current environment against the set dim light threshold and notifies the driver visual monitoring device to turn on the infrared light supplement lamp according to the judgment result. The automobile cabin monitoring controller sends the brightness of the current environment to the vehicle display screen. The vehicle display screen adjusts the brightness according to the received brightness of the current environment.
[0004] The traditional brightness adjustment method of vehicle camera light supplement lamp mainly relies on mechanical adjustment and manual switch adjustment, which has the following main problems:
[0005] Traditional vehicle cameras do not have the function of real-time monitoring of environmental brightness and automatic adjustment of light supplement lamps. The turning on and off and brightness adjustment of light supplement lamps depend on manual adjustment. Due to the need for human intervention, the maintenance and management of light supplement lamps are more troublesome. The vehicle system cannot accurately determine the current working state of the light supplement lamp, causing unnecessary energy waste. Without precise current and brightness control, light supplement lamps cannot avoid working at excessively high or low current and brightness for a long time, increasing the internal thermal stress, light decay, and other adverse factors of the lamp, thereby shortening the service life of the light supplement lamp. It does not consider irrelevant information and interference in images, which has obvious shortcomings in improving image quality, feature data set richness, system robustness, and system accuracy. Effective algorithms are not used, which makes the system maintain high accuracy and robustness in different scenarios, and easily falls into local optimum.
[0006] In view of this, the present application proposes a vehicle camera light supplement lamp brightness self-adapting regulation system and method to solve the above problems. SUMMARY
[0007] In order to overcome the above-mentioned defects of the prior art, in order to achieve the above-mentioned purposes, the present application provides the following technical scheme: a vehicle-mounted camera light supplement lamp brightness self-adaptive adjustment system, comprising:
[0008] A data acquisition module is configured to acquire camera image data, environmental parameter data, POC parameter data and GPIO parameter data within a time period;
[0009] A data processing module is configured to preprocess the acquired camera image data, environmental parameter data, POC parameter data and GPIO parameter data to obtain image feature data set, environmental feature data set, POC feature data set and GPIO feature data set; and to perform weighted fusion on the image feature data set and the environmental feature data set to obtain a comprehensive feature data set.
[0010] An environmental monitoring module is configured to construct an environmental brightness monitoring model, input the comprehensive feature data set into the trained environmental brightness monitoring model to obtain a predicted environmental brightness, and compare the predicted environmental brightness with a preset environmental brightness threshold to determine whether the current environment needs light supplement.
[0011] If the current environment does not need light supplement, the current environmental brightness is continuously monitored; if the current environment needs light supplement, the light supplement lamp is adjusted to an open state.
[0012] A state monitoring module is configured to monitor changes in the POC parameter data and the GPIO parameter data in the open state of the light supplement lamp, construct a state monitoring model, input the POC feature data set and the GPIO feature data set into the trained state monitoring model to obtain a predicted current-brightness state, and compare the predicted current-brightness state with a preset current-brightness state threshold to determine whether adjustment is needed.
[0013] A dynamic adjustment module is configured to continue monitoring the POC parameter data and the GPIO parameter data if adjustment is not needed, and to perform dynamic adjustment according to the changes in the monitored POC parameter data and GPIO parameter data if adjustment is needed.
[0014] Further, the method for acquiring camera image data, environmental parameter data, POC parameter data and GPIO parameter data within a time period comprises: discretizing time points within the time period, and acquiring camera image data, environmental parameter data, POC parameter data and GPIO parameter data at each time point;
[0015] Camera image data includes brightness data, shape data and texture data; environmental parameter data includes ambient light intensity data, weather condition data and timestamp data; timestamp data includes Discretized in time The specific time and date of each time point; POC parameter data includes POC voltage data and POC current data.
[0016] Furthermore, the method for preprocessing the acquired camera image data, environmental parameter data, POC parameter data and GPIO parameter data includes:
[0017] Extract brightness features and morphological features from the camera image data to obtain an image feature dataset; perform data cleaning and standard deviation normalization on the environmental parameter data, POC parameter data, and GPIO parameter data, converting them into a standard normal distribution with a mean of 0 and a standard deviation of 1, and obtain an environmental feature dataset, a POC feature dataset, and a GPIO feature dataset;
[0018] The method for extracting brightness features includes: using a weighted average method to convert the format of camera image data, converting the RGB value of each pixel in the camera image data into a single grayscale value through a grayscale conversion formula, and then obtaining grayscale image data; using a Gaussian filter to smooth the grayscale image data and remove image noise;
[0019] The brightness distribution of the grayscale image data is adjusted by histogram equalization, and the total number of pixels of the grayscale image data is recorded as , use the probability density function to calculate the cumulative distribution function of each gray level of the grayscale image data ;in, From grayscale arrive The cumulative distribution function of is the index of the grayscale category; is the grayscale level in the grayscale image data The number of pixels; To obtain the index of the summed grayscale level; perform histogram equalization mapping on the grayscale image data based on the cumulative distribution function to obtain a new grayscale level; calculate the average brightness and brightness standard deviation of the grayscale image data according to the new grayscale level, and then obtain the brightness feature;
[0020] Methods for extracting morphological features include:
[0021] Use the Sobel operator to calculate the gradient component of each pixel of the grayscale image data and obtain the horizontal gradient and vertical gradient ; Based on the horizontal gradient obtained and vertical gradient , calculate the gradient amplitude of each pixel point of the gray image data and the gradient direction ;
[0022] For each pixel point, compare its gradient amplitude with the gradient amplitudes of the two adjacent pixel points along the gradient direction, and retain the local maximum value; if the gradient amplitude of the current pixel point is greater than the gradient amplitudes of the two adjacent pixel points, retain the pixel point; otherwise, eliminate the pixel point; integrate the remaining pixel points to obtain an edge pixel point set; set a threshold and , mark the pixel points in the edge pixel point set with a gradient amplitude greater than as strong edges, mark the pixel points in the edge pixel point set with a gradient amplitude less than as noise points, and mark the pixel points in the edge pixel point set with a gradient amplitude between and as weak edges; connect the weak edges and the strong edges to form a complete edge structure; based on the complete edge structure, extract the morphological features of the camera image data
[0023] Set the threshold and by Otsu's algorithm, including:
[0024] Based on the gradient amplitude of each pixel point of the gray image data, obtain a gradient amplitude image; by counting the number of pixels of each gray level in the gradient amplitude image, obtain a histogram of the gradient amplitude image ; a preset threshold , the gradient amplitude image is divided into foreground and background at the threshold ; measure the separation degree between the foreground and the background by an inter-class variance calculation formula ; wherein, is the inter-class variance; is the background weight; is the background mean value; is the foreground weight; is the foreground mean value; use grid search to traverse all possible values of the preset threshold , select the threshold with the maximum value of as the best threshold ; set the threshold and based on the best threshold ; the threshold ; the threshold ; wherein, and are the thresholds and The proportional coefficient of .
[0025] Furthermore, the method for obtaining the comprehensive feature data set includes:
[0026] The image feature dataset and the environment feature dataset are weightedly fused through the weighted fusion formula. The preset image feature dataset is , the environmental feature dataset is , the comprehensive feature dataset is ; The weighted fusion formula is: ;in, is the weight coefficient of the image feature dataset; is the weight coefficient of the environmental feature dataset;
[0027] The weight coefficients are optimized by particle swarm optimization algorithm. and Perform dynamic adjustments, including: initializing the particle swarm, where each particle represents a set of weight coefficients , randomly generate the position of each particle and speed ;
[0028] Define the fitness function ; Among them, the fitness function For the The position of the particle The corresponding fitness function value; is the index of the particle number; is the total number of particle samples; is the index of the particle sample; For particle samples target brightness; For particles The weight coefficient of the image feature dataset; For particle samples Feature values in the image feature dataset; For particles The weight coefficient of the environmental feature dataset; For particle samples Feature values in the environmental feature dataset;
[0029] The particle speed and position are updated through the particle speed update formula; the particle speed update formula is: ;in, For particles In the The velocity vector after iterations; For particles In the The velocity vector at the iteration; is the inertia weight; and is the cognitive factor, and its value is determined by the cognitive factor restriction formula; the cognitive factor restriction formula is: ;in, is the cognitive factor after restriction; is the total number of iterations of the particle; is the total number of particles; and for A random number between For particles The historical optimal position vector of is the global optimal position vector; For particles In the The position vector at the iteration;
[0030] Update the particle's historical optimal position and global optimal position; repeat the above steps until the maximum number of iterations is reached, and then obtain the final global optimal position. , that is, to obtain the optimal set of weight coefficients ; Apply the optimal set of weight coefficients to the weighted fusion formula to obtain a comprehensive feature data set.
[0031] Furthermore, the method for constructing the environmental brightness monitoring model includes:
[0032] An environmental brightness monitoring model is constructed using a convolutional neural network model. The model consists of an input layer, a convolutional layer, a pooling layer, a fully connected layer, and an output layer. The model's input data is a comprehensive feature dataset, and the output label is the corresponding environmental brightness. The dataset is divided into a training set, a test set, and a validation set. Softmax is used as the activation function.
[0033] The mean square error is used as the loss function to measure the difference between the model's predicted value and the actual value; the model is trained using the training set data, and the loss function is minimized using the Adam optimizer; the model is evaluated using the validation set, and the accuracy index is calculated to measure the model's performance; based on the evaluation results of the model performance, the model's hyperparameters are tuned; the model's performance in the prediction task is evaluated using the test set, and the test is stopped when the model's performance in the prediction task reaches the preset performance threshold, resulting in a trained ambient brightness monitoring model.
[0034] Furthermore, the method for determining whether fill light is required in the current environment includes:
[0035] If the predicted ambient brightness is greater than or equal to the preset ambient brightness threshold, it is determined that the current environment does not require fill light;
[0036] If the predicted ambient brightness is less than the preset ambient brightness threshold, it is determined that the current environment needs to be lighted.
[0037] Further, the method for constructing the state monitoring model comprises:
[0038] dividing the data set into a training set, a test set and a validation set; the data set comprises a POC feature data set and a GPIO feature data set and corresponding current-brightness states; constructing a state monitoring model, the model comprising an input layer, a full connection layer and two output layers;
[0039] The two output layers of the model correspond to current state tasks and brightness state tasks; the input layer is used for inputting historical POC feature data sets and GPIO feature data sets; the output layers are respectively used for outputting current states and brightness states; the state monitoring model is a multi-task learning network model;
[0040] For the current state task and the brightness state task, two mean square error loss functions are defined respectively and to measure the difference between the predicted value and the actual value of the model;
[0041] The mean square error loss function ; wherein, is the actual value of the current state task ; is the predicted value of the current state task ; is the index of the sample in the current state task; is the number of samples in the current state task;
[0042] The mean square error loss function ; wherein, is the actual value of the brightness state task ; is the predicted value of the brightness state task ; is the index of the sample in the brightness state task; is the number of samples in the brightness state task;
[0043] The loss functions and are weighted and fused to obtain a comprehensive loss function; the training set is used to train the state monitoring model, and the model parameters are updated through the back propagation algorithm to minimize the comprehensive loss function; the performance evaluation index is calculated to evaluate the performance of the state monitoring model using the validation set;
[0044] Adam optimization algorithm is selected as the optimizer, the model is optimized according to the performance feedback of the verification set, the model parameters are adjusted until the preset iteration number is reached, and the test set is used to evaluate the performance of the model in the prediction task, and the trained state monitoring model is used to predict the current POC feature data set and GPIO feature data set to obtain the current-brightness state.
[0045] Further, the method of comparing the predicted current-brightness state with the preset current-brightness state threshold to determine whether adjustment is needed comprises:
[0046] If the predicted current-brightness state is consistent with the preset current-brightness state threshold, it is determined that no adjustment is needed.
[0047] If the predicted current-brightness state is not consistent with the preset current-brightness state threshold, it is determined that adjustment is needed.
[0048] Further, the method of dynamically adjusting according to the changes of the monitored POC parameter data and GPIO parameter data comprises:
[0049] Adjusting the PWM duty cycle: when the predicted current state is greater than the preset current state threshold, the POC voltage is adjusted by increasing the PWM0 duty cycle; when the predicted current state is less than the preset current state threshold, the POC voltage is adjusted by reducing the PWM0 duty cycle.
[0050] When the predicted brightness state is higher than the preset brightness state threshold, the light intensity of the light compensation lamp is adjusted by reducing the PWM1 duty cycle; when the predicted brightness state is lower than the preset brightness state threshold, the light intensity of the light compensation lamp is adjusted by increasing the PWM1 duty cycle.
[0051] Further, a vehicle-mounted camera light compensation lamp brightness adaptive adjustment system comprises:
[0052] S1. Obtain camera image data, environmental parameter data, POC parameter data and GPIO parameter data within a certain time period;
[0053] S2. Preprocess the obtained camera image data, environmental parameter data, POC parameter data and GPIO parameter data to obtain image feature data set, environmental feature data set, POC feature data set and GPIO feature data set; and weight and fuse the image feature data set and the environmental feature data set to obtain a comprehensive feature data set.
[0054] S3. Construct an ambient brightness monitoring model, input the comprehensive feature data set into the trained ambient brightness monitoring model to obtain the predicted ambient brightness; compare the predicted ambient brightness with the preset ambient brightness threshold to determine whether the current environment needs to be lighted up;
[0055] If the current environment does not need to be lighted up, the current ambient brightness is continuously monitored; if the current environment needs to be lighted up, the light-up lamp is adjusted to an open state;
[0056] S4. Monitor the changes of POC parameter data and GPIO parameter data in the light-up lamp open state; construct a state monitoring model, input the POC feature data set and the GPIO feature data set into the trained state monitoring model to obtain the predicted current-brightness state; compare the predicted current-brightness state with the preset current-brightness threshold to determine whether adjustment is needed;
[0057] S5. If adjustment is not needed, the POC parameter data and the GPIO parameter data continue to be monitored; if adjustment is needed, dynamic adjustment is performed according to the changes of the monitored POC parameter data and the GPIO parameter data
[0058] The technical effects and advantages of the vehicle-mounted camera light-up lamp brightness self-adaptive adjustment system of the application are as follows:
[0059] Through preprocessing of the camera image data, irrelevant information and interference in the image are effectively reduced, a clearer image basis is provided for subsequent processing, and significant advantages are achieved in improving image quality, enriching feature data sets, enhancing system robustness and improving system accuracy.
[0060] Using the particle swarm optimization algorithm to dynamically adjust the weight coefficient helps the system to maintain high accuracy and robustness in different scenarios; introducing the cognitive factor restriction formula makes the cognitive factor gradually increase with the increase of the iteration number, but the growth rate is controlled, which helps to maintain a larger global search ability in the early search stage and avoid falling into local optimization, and gradually enhances the local search ability in the later search stage to improve the search precision.
[0061] By monitoring the POC and GPIO data in real time, the system can accurately determine the current working state of the light-up lamp and avoid unnecessary energy waste; when the current or brightness state deviates from the preset threshold, the system automatically adjusts the PWM duty cycle to ensure that the light-up lamp operates at the optimal current and brightness, thereby saving energy; precise current and brightness control can avoid the light-up lamp working at excessively high or low current and brightness for a long time, which helps to reduce adverse factors such as thermal stress and light decay in the lamp, thereby prolonging the service life of the light-up lamp; the automatic adjustment function reduces the need for manual intervention, making the maintenance and management of the light-up lamp more convenient. BRIEF DESCRIPTION OF THE DRAWINGS
[0062] Figure 1 This is a schematic structural diagram of a vehicle-mounted camera fill light brightness adaptive adjustment system of the present invention;
[0063] Figure 2 The present invention is a flowchart of a method for adaptively adjusting the brightness of a vehicle-mounted camera fill light. DETAILED DESCRIPTION
[0064] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.
[0065] Example 1
[0066] See also Figure 1 and Figure 2 As shown, this embodiment provides a vehicle-mounted camera fill light brightness adaptive adjustment system, including:
[0067] Data acquisition module, used to obtain Camera image data, environmental parameter data, POC (power over coaxial) parameter data and GPIO (input / output port) parameter data within a certain period of time;
[0068] The data processing module is used to pre-process the acquired camera image data, environmental parameter data, POC parameter data and GPIO parameter data to obtain an image feature data set, an environmental feature data set, a POC feature data set and a GPIO feature data set; and perform weighted fusion of the image feature data set and the environmental feature data set to obtain a comprehensive feature data set;
[0069] The environmental monitoring module is used to build an environmental brightness monitoring model. The comprehensive feature data set is input into the trained environmental brightness monitoring model to obtain the predicted environmental brightness; the predicted environmental brightness is compared with the preset environmental brightness threshold to determine whether the current environment needs fill light;
[0070] If the current environment does not require fill light, the current ambient brightness is continuously monitored; if the current environment requires fill light, the fill light is turned on;
[0071] The state monitoring module is used to monitor changes in the POC parameter data and GPIO parameter data when the fill light is turned on. A state monitoring model is constructed, and the POC feature data set and GPIO feature data set are input into the trained state monitoring model to obtain a predicted current-brightness state. The predicted current-brightness state is compared with the preset current-brightness state threshold to determine whether adjustment is needed.
[0072] The dynamic adjustment module continues to monitor the POC parameter data and GPIO parameter data if no adjustment is required; if adjustment is required, dynamic adjustment is performed based on changes in the monitored POC parameter data and GPIO parameter data.
[0073] Get The method of obtaining camera image data, environmental parameter data, POC parameter data and GPIO parameter data within a certain time period includes: Discretization in time At each time point, camera image data, environmental parameter data, POC parameter data, and GPIO parameter data are collected;
[0074] Camera image data includes brightness data, shape data and texture data; environmental parameter data includes ambient light intensity data, weather condition data and timestamp data; timestamp data includes Discretized in time The specific time and date of each time point; POC parameter data includes POC voltage data and POC current data.
[0075] The method for preprocessing the acquired camera image data, environmental parameter data, POC parameter data, and GPIO parameter data includes:
[0076] Extract brightness features and morphological features from the camera image data to obtain an image feature dataset; perform data cleaning and standard deviation normalization on the environmental parameter data, POC parameter data, and GPIO parameter data, converting them into a standard normal distribution with a mean of 0 and a standard deviation of 1, and obtain an environmental feature dataset, a POC feature dataset, and a GPIO feature dataset;
[0077] The method for extracting brightness features includes: using a weighted average method to convert the format of the camera image data, converting the RGB value of each pixel in the camera image data into a single grayscale value through a grayscale conversion formula, and then obtaining grayscale image data; the grayscale conversion formula is: ;in, Indicates the intensity of red light in the image; Indicates the intensity of green light in the image; Represents the intensity of blue light in the image; uses a Gaussian filter to smooth the grayscale image data and remove image noise;
[0078] It should be noted that the grayscale conversion formula appears 、 and A set of fixed weight coefficients used to convert color images into grayscale images. This set of weight coefficients is mainly related to the sensitivity of the human eye to different bands of light (red, green, and blue). It first appeared in the calculation of the brightness component of the analog television standard NTSC and was also used in subsequent digital video standards. It approximately reflects the human eye's subjective brightness perception of RGB, allowing grayscale images to better match the human eye's subjective perception of brightness. The human eye is most sensitive to green, followed by red, and least sensitive to blue. Therefore, when converting the RGB value of each pixel into a single grayscale value, green light will be given a larger weight, red light will be given a smaller weight, and blue light will be given the least weight.
[0079] The brightness distribution of the grayscale image data is adjusted by histogram equalization, so that the grayscale distribution of the image is more uniform and the overall contrast is improved; the total number of pixels of the grayscale image data is recorded as , use the probability density function to calculate the cumulative distribution function of each gray level of the grayscale image data ;in, From grayscale arrive The cumulative distribution function of The index of the grayscale category, used to represent the grayscale currently calculated, with a range of arrive ; is the grayscale level in the grayscale image data The number of pixels; To sum the grayscale index, when calculating the cumulative distribution function, it is used to traverse from arrive grayscale; perform histogram equalization mapping on the grayscale image data based on the cumulative distribution function to obtain a new grayscale; calculate the average brightness and brightness standard deviation of the grayscale image data according to the new grayscale, and then obtain the brightness feature;
[0080] Methods for morphological feature extraction include:
[0081] Use the Sobel operator to calculate the gradient component of each pixel of the grayscale image data and obtain the horizontal gradient and vertical gradient ; Based on the horizontal gradient obtained and vertical gradient , calculate the gradient amplitude of each pixel of the grayscale image data and gradient direction ;
[0082] The calculation formula of the gradient amplitude of the pixel point is: ; wherein, is the gradient amplitude of the pixel point; is the horizontal direction gradient; is the vertical direction gradient;
[0083] The calculation formula of the gradient direction of the pixel point is: ; wherein, is the arctangent function;
[0084] For each pixel point, the gradient amplitude thereof is compared with the gradient amplitudes of two adjacent pixel points along the gradient direction, and the local maximum value is retained; for example, if the gradient direction is 0°, the pixel points on the left and right sides of the current pixel point are selected; if the gradient direction is 45°, the pixel points above the right side and below the left side of the current pixel point are selected; if the gradient amplitude of the current pixel point is greater than the gradient amplitudes of the two adjacent pixel points, the pixel point is retained; otherwise, the pixel point is excluded; the remaining pixel points are integrated to obtain an edge pixel point set; a threshold and are set, the pixel points in the edge pixel point set with the gradient amplitudes greater than are marked as strong edges, the pixel points in the edge pixel point set with the gradient amplitudes less than are marked as noise points, and the pixel points in the edge pixel point set with the gradient amplitudes between and are marked as weak edges; the weak edges and the strong edges are connected to form a complete edge structure; based on the complete edge structure, morphological features of the camera image data are extracted; the morphological features include the length, the curvature, the connected region area and the like of the edge of the dark region in the camera image data;
[0085] The threshold and are set by Otsu's algorithm, including:
[0086] Based on the gradient amplitude of each pixel point of the gray-scale image data, a gradient amplitude image is obtained; by counting the number of pixels of each gray level in the gradient amplitude image, a histogram of the gradient amplitude image is obtained ; a threshold is preset, the gradient amplitude image is divided into a foreground (an edge region) and a background (a non-edge region) at the threshold ; the separation degree between the foreground and the background is measured by an inter-class variance calculation formula, the inter-class variance calculation formula is ; wherein, is the inter-class variance; is the background weight, which is the ratio of the number of background pixels to the total number of pixels; is the background mean, the average value of the gradient amplitude of background pixels; is the foreground weight, which is the ratio of the number of foreground pixels to the total number of pixels; is the foreground mean, the average value of the foreground pixel gradient amplitude; use grid search to traverse the preset threshold Of all possible values of The threshold with the largest value is the optimal threshold ; Based on the optimal threshold Setting the threshold and ;Threshold ;Threshold ;in, and The thresholds and The proportional coefficient of .
[0087] Methods for obtaining comprehensive feature datasets include:
[0088] The image feature dataset and the environment feature dataset are weightedly fused through the weighted fusion formula. The preset image feature dataset is , the environmental feature dataset is , the comprehensive feature dataset is ; The weighted fusion formula is: ;in, is the weight coefficient of the image feature dataset; is the weight coefficient of the environmental feature dataset;
[0089] The weight coefficients are optimized by particle swarm optimization algorithm. and Perform dynamic adjustments, including: initializing the particle swarm, where each particle represents a set of weight coefficients , randomly generate the position of each particle and speed ;
[0090] Define the fitness function ; Among them, the fitness function For the The position of the particle The corresponding fitness function value is used to evaluate the position of each particle; is the index of the particle number; is the total number of particle samples; is the index of the particle sample; For particle samples target brightness; For particles The weight coefficient of the image feature dataset; For particle samples Feature values in the image feature dataset; For particles The weight coefficient of the environmental feature dataset; For particle samples Feature values in the environmental feature dataset;
[0091] The particle speed and position are updated through the particle speed update formula; the particle speed update formula is: ;in, For particles In the The velocity vector after iterations; For particles In the The velocity vector at the iteration; is the inertia weight; and is the cognitive factor, and its value is determined by the cognitive factor restriction formula; the cognitive factor restriction formula is: ;in, is the cognitive factor after restriction; is the total number of iterations of the particle; is the total number of particles; and for A random number between For particles The historical optimal position vector of is the global optimal position vector; For particles In the The position vector at the iteration;
[0092] The cognitive factor limiting formula draws on the ideas of adaptive parameter adjustment and time decay model, introduces a dynamic adjustment strategy on the basis of the standard PSO algorithm, balances the relationship between exploration and development, and improves the global search ability and convergence speed. In the standard PSO algorithm, the search behavior of particles is affected by the cognitive factor and the social factor, and the fixed cognitive factor may lead to uneven search efficiency of the algorithm at different stages. Therefore, the cognitive factor limiting formula dynamically adjusts the cognitive factor, so that the algorithm can explore a larger range in the early search stage and realize faster convergence in the later search stage, thereby improving the search ability of the global optimal solution. In the early search stage, particles should be encouraged to explore the search space more, so as to avoid falling into local optimum too early; in the later search stage, the dependence of particles on the historical optimal and global optimal solutions should be enhanced to speed up the convergence. To achieve this goal, the cognitive factor limiting formula controls the weight of the cognitive factor through the iteration progress, so that it changes with time.
[0093] updating the historical optimal position and the global optimal position of the particle; repeating the above steps until the maximum number of iterations is reached, and obtaining the final global optimal position , that is, obtaining the optimal set of weight coefficients ; applying the optimal set of weight coefficients to the weighted fusion formula to obtain the comprehensive feature data set.
[0094] The method for constructing the environment brightness monitoring model comprises:
[0095] The environment brightness monitoring model is constructed by a convolutional neural network model, and the environment brightness monitoring model comprises an input layer, a convolutional layer, a pooling layer, a fully connected layer and an output layer; the input data of the model is the comprehensive feature data set, and the output label is the corresponding environment brightness; the data set is divided into a training set, a test set and a validation set; a softmax is used as an activation function;
[0096] The mean square error is used as a loss function to measure the difference between the predicted value and the actual value of the model; the training set data is used for model training, and the Adam optimizer is used to minimize the loss function; the validation set is used to evaluate the model, and the accuracy index is calculated to measure the performance of the model; according to the evaluation result of the performance of the model, the hyperparameters of the model are optimized; the performance of the model in the prediction task is evaluated through the test set, and the training of the environment brightness monitoring model is stopped when the performance of the model in the prediction task reaches a preset performance threshold.
[0097] The method for determining whether the current environment needs to be supplemented with light comprises:
[0098] If the predicted environment brightness is greater than or equal to the preset environment brightness threshold, it is determined that the current environment does not need to be supplemented with light;
[0099] If the predicted ambient brightness is lower than the preset ambient brightness threshold, it is determined that the current environment needs fill light.
[0100] The construction methods of condition monitoring models include:
[0101] The dataset is divided into training, testing, and validation sets; the dataset includes the POC feature dataset and the GPIO feature dataset as well as the corresponding current-brightness status; a state monitoring model is constructed, which includes an input layer, a fully connected layer, and two output layers;
[0102] The two output layers of the model correspond to the current state task and the brightness state task; the input layer is used to input the historical POC feature dataset and the GPIO feature dataset; the output layer is used to output the current state and brightness state respectively; the state monitoring model is a multi-task learning network model;
[0103] For the current state task and the brightness state task, two mean square error loss functions are defined respectively: and , which measures the difference between the model's predicted values and the actual values;
[0104] Mean squared error loss function ;in, For current state tasks The actual value of For current state tasks The predicted value of is the index of the sample in the current state task; is the number of samples in the current state task;
[0105] Mean squared error loss function ;in, Brightness status task The actual value of Brightness status task The predicted value of is the index of the sample in the brightness state task; is the number of samples in the brightness state task;
[0106] The loss function and Perform weighted fusion to obtain a comprehensive loss function; use the training set to train the condition monitoring model, and update the model parameters through the back propagation algorithm to minimize the comprehensive loss function; use the validation set to evaluate the performance of the condition monitoring model by calculating the performance evaluation index;
[0107] Adam optimization algorithm is selected as the optimizer, the model is optimized according to the performance feedback of the verification set, the model parameters are adjusted until the preset iteration number is reached, and then the test set is used to evaluate the performance of the model in the prediction task, and the trained state monitoring model is used to predict the current POC feature data set and GPIO feature data set to obtain the current-brightness state.
[0108] The predicted current-brightness state is compared with the preset current-brightness state threshold, and the method for determining whether adjustment is needed includes:
[0109] If the predicted current-brightness state is consistent with the preset current-brightness state threshold, it is determined that no adjustment is needed.
[0110] If the predicted current-brightness state is not consistent with the preset current-brightness state threshold, it is determined that adjustment is needed.
[0111] According to the changes of the monitored POC parameter data and GPIO parameter data, the method for dynamically adjusting includes:
[0112] Adjusting the PWM (Pulse Width Modulation) duty cycle: when the predicted current state is greater than the preset current state threshold, the PWM0 (Pulse Width Modulation 0) duty cycle is increased to increase the POC voltage; when the predicted current state is less than the preset current state threshold, the PWM0 duty cycle is reduced to decrease the POC voltage.
[0113] PWM0 is responsible for adjusting the POC voltage, and the adjustment of its duty cycle affects the stability of the system power supply current; increasing the PWM0 duty cycle POC voltage increases Power supply current increases Light intensity of the light increases; reducing the PWM0 duty cycle POC voltage decreases Power supply current decreases Light intensity of the light decreases.
[0114] When the predicted brightness state is higher than the preset brightness state threshold, the PWM1 (Pulse Width Modulation 1) duty cycle is reduced to decrease the light intensity of the light; when the predicted brightness state is lower than the preset brightness state threshold, the PWM1 duty cycle is increased to increase the light intensity of the light.
[0115] PWM1 is responsible for controlling the light intensity of the light, and the adjustment of its duty cycle affects the strength of the light; reducing the PWM1 duty cycle Light supply time of the light decreases Light intensity of the light decreases; increasing the PWM1 duty cycle Light supply time of the light increases Light intensity of the light increases.
[0116] The embodiment effectively reduces irrelevant information and interference in the image through preprocessing of the camera image data, provides a clearer image basis for subsequent processing, and has significant advantages in improving image quality, enriching feature data sets, enhancing system robustness, and improving system accuracy.
[0117] Using the particle swarm optimization algorithm to dynamically adjust the weight coefficients helps the system to maintain high accuracy and robustness in different scenarios; introducing the cognitive factor restriction formula makes the cognitive factor gradually increase with the increase of the number of iterations, but the growth rate is controlled, which helps to maintain a larger global search ability in the early search stage and avoid falling into local optimization, while gradually enhancing the local search ability in the later search stage to improve search accuracy;
[0118] By monitoring POC and GPIO data in real time, the system can accurately determine the current working state of the light supplement lamp and avoid unnecessary energy waste; when the predicted current or brightness state deviates from the preset threshold, the system automatically adjusts the PWM duty cycle to ensure that the light supplement lamp operates at the optimal current and brightness, thereby saving energy; precise current and brightness control can avoid the light supplement lamp working at too high or too low current and brightness for a long time, which helps to reduce the adverse factors such as thermal stress and light decay inside the lamp, thereby prolonging the service life of the light supplement lamp; the automatic adjustment function reduces the need for manual intervention, making the maintenance and management of the light supplement lamp more convenient.
[0119] Embodiment 2
[0120] Please refer to Figure 2 The embodiment does not describe some parts in detail, see the description of embodiment 1, and provides a kind of vehicle-mounted camera light supplement lamp brightness self-adapting adjustment method, comprising:
[0121] S1. Obtain Camera image data, environmental parameter data, POC parameter data and GPIO parameter data in a period of time;
[0122] S2. The camera image data, environmental parameter data, POC parameter data and GPIO parameter data obtained are preprocessed to obtain image feature data set, environmental feature data set, POC feature data set and GPIO feature data set;The image feature data set and the environmental feature data set are weighted and fused to obtain a comprehensive feature data set;
[0123] S3. Build an environmental brightness monitoring model, input the comprehensive feature data set into the trained environmental brightness monitoring model, obtain the predicted environmental brightness;The predicted environmental brightness is compared with the preset environmental brightness threshold value, to judge whether the current environment needs to be lighted;
[0124] If the current environment does not need to be lighted, the current environment brightness is continuously monitored; if the current environment needs to be lighted, the light is adjusted to an open state;
[0125] S4. Monitor the changes of POC parameter data and GPIO parameter data in the open state of the light; build a state monitoring model, input the POC feature data set and the GPIO feature data set into the trained state monitoring model, obtain the predicted current-brightness state; compare the predicted current-brightness state with the preset current-brightness threshold, and determine whether adjustment is needed;
[0126] S5. If adjustment is not needed, the POC parameter data and the GPIO parameter data continue to be monitored; if adjustment is needed, dynamic adjustment is performed according to the changes of the monitored POC parameter data and the GPIO parameter data.
[0127] Since the electronic device introduced in the embodiment is the electronic device used to implement the vehicle-mounted camera light lamp brightness adaptive adjustment system in the embodiment, the specific implementation of the electronic device and its various changes can be understood by those skilled in the art based on the vehicle-mounted camera light lamp brightness adaptive adjustment system introduced in the embodiment, so the implementation of the electronic device in the method of the embodiment will not be introduced in detail. As long as the electronic device used in the vehicle-mounted camera light lamp brightness adaptive adjustment system in the embodiment is implemented by those skilled in the art, it belongs to the scope of protection of the present application.
[0128] The above formulas are all de-dimensioned to calculate the numerical values, the formulas are obtained by collecting a large amount of data to simulate the most recent real situation, and the preset parameters and threshold values in the formulas are set by those skilled in the art according to the actual situation.
[0129] The above is only the preferred embodiment of the present application, the protection scope of the present application is not limited to the above-mentioned embodiments, any technical solution belonging to the idea of the present application is also within the protection scope of the present application. It should be noted that for ordinary technical users in the technical field, some improvements and decorations without departing from the principles of the present application are also considered as the protection scope of the present application.
Claims
1. A vehicle-mounted camera light supplementing lamp brightness self-adaptive adjusting system, characterized in that, The method comprises the following steps: The data acquisition module is configured to acquire camera image data, environment parameter data, POC parameter data and GPIO parameter data within a time period. The data processing module is used for preprocessing the obtained camera image data, environment parameter data, POC parameter data and GPIO parameter data to obtain image feature data set, environment feature data set, POC feature data set and GPIO feature data set; and the image feature data set and the environment feature data set are weighted and fused to obtain a comprehensive feature data set; The environment monitoring module is used for constructing an environment brightness monitoring model, inputting the comprehensive feature data set into the trained environment brightness monitoring model to obtain a predicted environment brightness; and comparing the predicted environment brightness with a preset environment brightness threshold to determine whether the current environment needs to be lighted up; If the current environment does not need to be lighted up, the current environment brightness is continuously monitored; If the current environment needs to be lighted up, the light-up lamp is adjusted to an open state; The state monitoring module is used for monitoring the changes of the POC parameter data and the GPIO parameter data in the open state of the light-up lamp; a state monitoring model is constructed, the POC feature data set and the GPIO feature data set are input into the trained state monitoring model to obtain a predicted current-brightness state; and the predicted current-brightness state is compared with a preset current-brightness state threshold to determine whether adjustment is needed; The dynamic adjustment module is used for continuously monitoring the POC parameter data and the GPIO parameter data if adjustment is not needed; and the dynamic adjustment module is used for performing dynamic adjustment according to the monitored changes of the POC parameter data and the GPIO parameter data if adjustment is needed.
2. The brightness self-adaptive adjusting system of a car-mounted camera light filling lamp according to claim 1, characterized in that, The acquisition The method for discretizing the camera image data, the environmental parameter data, the POC parameter data and the GPIO parameter data within the time period comprises: Discretizing The camera image data, the environmental parameter data, the POC parameter data and the GPIO parameter data are collected at each of the time points; the camera image data comprises luminance data, shape data and texture data; the environmental parameter data comprises environmental light intensity data, weather condition data and timestamp data; the timestamp data comprises The specific time and date of the discretized The POC parameter data comprises POC voltage data and POC current data.
3. The brightness self-adaptive adjusting system of a car-mounted camera light filling lamp according to claim 2, characterized in that, The method for preprocessing the obtained camera image data, environment parameter data, POC parameter data and GPIO parameter data comprises the following steps: Luminance features and morphological features are extracted from the camera image data to obtain an image feature data set; the environment parameter data, POC parameter data and GPIO parameter data are subjected to data cleaning and standard deviation normalization processing to convert them into a standard normal distribution with a mean of 0 and a standard deviation of 1 to obtain an environment feature data set, a POC feature data set and a GPIO feature data set; The method for extracting luminance features comprises the following steps: The brightness distribution of the gray image data is adjusted by histogram equalization, and the total pixel number of the gray image data is denoted as The cumulative distribution function of each gray level of the gray image data is calculated by using a probability density function ; wherein, is the cumulative distribution function from the gray level to ; is the index of the gray level category; is the pixel number of the gray level in the gray image data; is the index of the summation gray level; the gray image data is mapped by histogram equalization based on the cumulative distribution function to obtain new gray levels; the average brightness and the brightness standard deviation of the gray image data are calculated according to the new gray levels, and then the brightness feature is obtained; The method for extracting morphological features comprises the following steps: The Sobel operator is used to calculate the gradient component of each pixel point of the gray image data to obtain a horizontal direction gradient and a vertical direction gradient ; based on the obtained horizontal direction gradient and the vertical direction gradient , the gradient amplitude and the gradient direction of each pixel point of the gray image data are calculated; For each pixel, compare its gradient amplitude with the gradient amplitudes of the two adjacent pixels along the gradient direction, and retain the local maximum value; if the gradient amplitude of the current pixel is greater than that of the two adjacent pixels, retain the pixel; otherwise, eliminate the pixel; integrate the remaining pixels to obtain an edge pixel set; set a threshold and mark the pixels in the edge pixel set with a gradient amplitude greater than as strong edges, mark the pixels in the edge pixel set with a gradient amplitude less than as noise points, and mark the pixels in the edge pixel set with a gradient amplitude between and as weak edges; connect the weak edges and the strong edges to form a complete edge structure; based on the complete edge structure, extract the morphological features of the camera image data; Setting a threshold value by Otsu's algorithm and comprising: Based on the gradient amplitude of each pixel point of the gray image data, a gradient amplitude image is obtained; by counting the number of pixels of each gray level in the gradient amplitude image, a histogram of the gradient amplitude image is obtained ; a preset threshold value , the gradient amplitude image is divided into foreground and background under the threshold value ; the separation degree between the foreground and the background is measured by an inter-class variance calculation formula ; wherein, is the inter-class variance; is the background weight; is the background mean; is the foreground weight; is the foreground mean; all possible values of the preset threshold value are traversed using a grid search, and the threshold value with the maximum value of is selected as the optimal threshold value ; based on the optimal threshold value , threshold values and are set; the threshold value ; the threshold value ; wherein, and are proportional coefficients of the threshold values and respectively.
4. The brightness self-adaptive adjusting system of a car-mounted camera light filling lamp according to claim 3, characterized in that, The method for obtaining the comprehensive feature data set comprises the following steps: The image feature dataset and the environment feature dataset are weighted and fused by a weighting fusion formula, the preset image feature dataset is , the environment feature dataset is , the comprehensive feature dataset is , the weighting fusion formula is ; wherein, is a weight coefficient of the image feature dataset; is a weight coefficient of the environment feature dataset. The weight coefficients are optimized by particle swarm optimization algorithm. and Perform dynamic adjustments, including: initializing the particle swarm, where each particle represents a set of weight coefficients , randomly generate the position of each particle and speed ; Define the fitness function ; Among them, the fitness function For the The position of the particle The corresponding fitness function value; is the index of the particle number; is the total number of particle samples; is the index of the particle sample; For particle samples target brightness; For particles The weight coefficient of the image feature dataset; For particle samples Feature values in the image feature dataset; For particles The weight coefficient of the environmental feature dataset; For particle samples Feature values in the environmental feature dataset; The particle speed and position are updated through the particle speed update formula; the particle speed update formula is: ;in, For particles In the The velocity vector after iterations; For particles In the The velocity vector at the iteration; is the inertia weight; and is the cognitive factor, and its value is determined by the cognitive factor restriction formula; the cognitive factor restriction formula is: ;in, is the cognitive factor after restriction; is the total number of iterations of the particle; is the total number of particles; and for A random number between For particles The historical optimal position vector of is the global optimal position vector; For particles In the The position vector at the iteration; updating the history optimal position and the global optimal position of the particle; repeating the above steps until a maximum iteration number is reached to stop, and obtaining a final global optimal position , that is, obtaining an optimal set of weight coefficients ; applying the optimal set of weight coefficients to the weighted fusion formula to obtain a comprehensive feature dataset.
5. The brightness self-adaptive adjusting system of a car-mounted camera light filling lamp according to claim 4, characterized in that, The method for constructing the environment brightness monitoring model comprises the following steps: The environment brightness monitoring model is constructed through a convolutional neural network model, and the environment brightness monitoring model comprises an input layer, a convolutional layer, a pooling layer, a full connection layer and an output layer; the input data of the model is the comprehensive feature data set, and the output label is the corresponding environment brightness; the data set is divided into a training set, a test set and a validation set; and a softmax is used as an activation function; The method for constructing the environment brightness monitoring model comprises the following steps: The mean square error is used as a loss function to measure the difference between the predicted value and the actual value of the model; the model is trained using the training set data, and the Adam optimizer is used to minimize the loss function; the model is evaluated using the validation set, and the accuracy index is calculated to measure the performance of the model; the hyperparameters of the model are optimized according to the evaluation results of the model performance; the performance of the model in the prediction task is evaluated through the test set, and the test is stopped when the performance of the model in the prediction task reaches the preset performance threshold, and the trained environmental brightness monitoring model is obtained.
6. The brightness self-adaptive adjusting system of a car-mounted camera light filling lamp according to claim 5, characterized in that, The method for determining whether the current environment needs to be supplemented with light comprises: If the predicted environmental brightness is greater than or equal to the preset environmental brightness threshold, it is determined that the current environment does not need to be supplemented with light; If the predicted environmental brightness is less than the preset environmental brightness threshold, it is determined that the current environment needs to be supplemented with light.
7. The brightness self-adaptive adjusting system of a car-mounted camera light filling lamp according to claim 6, characterized in that, The method for constructing the state monitoring model comprises: Divide the data set into a training set, a test set and a validation set; the data set includes a POC feature data set and a GPIO feature data set, and corresponding current-brightness states; construct a state monitoring model, which includes an input layer, a fully connected layer and two output layers; The two output layers of the model correspond to current state tasks and brightness state tasks; the input layer is used to input the historical POC feature data set and the GPIO feature data set; the output layer is used to output the current state and the brightness state, respectively; the state monitoring model is a multi-task learning network model; For the current state task and the brightness state task, two mean square error loss functions are defined respectively and , measure the difference between the predicted value of the model and the actual value. mean squared error loss function ; wherein, is an actual value of a current state task ; is a predicted value of a current state task ; is an index of a sample in a current state task ; and is a number of samples in a current state task mean squared error loss function ; wherein is an actual value for a brightness state task ; is a predicted value for a brightness state task ; is an index of a sample in a brightness state task is a number of samples in a brightness state task The loss function and Perform weighted fusion to obtain a comprehensive loss function; use the training set to train the condition monitoring model, and update the model parameters through the back propagation algorithm to minimize the comprehensive loss function; use the validation set to evaluate the performance of the condition monitoring model by calculating the performance evaluation index; Select the Adam optimization algorithm as the optimizer, and adjust the model parameters according to the performance feedback of the validation set until the preset number of iterations is reached; use the test set to evaluate the performance of the model in the prediction task, and use the trained state monitoring model to predict the current POC feature data set and the GPIO feature data set to obtain the current-brightness state.
8. The brightness self-adaptive adjusting system of a car-mounted camera light filling lamp according to claim 7, characterized in that, The method for comparing the predicted current-brightness state with the preset current-brightness state threshold to determine whether adjustment is needed comprises: If the predicted current-brightness state is consistent with the preset current-brightness state threshold, it is determined that no adjustment is needed; If the predicted current-brightness state is not consistent with the preset current-brightness state threshold, it is determined that adjustment is needed.
9. The brightness self-adaptive adjusting system of a car-mounted camera light filling lamp according to claim 8, characterized in that, The method for dynamically adjusting according to the changes in the monitored POC parameter data and GPIO parameter data comprises: Adjust the PWM duty cycle: when the predicted current state is greater than the preset current state threshold, increase the PWM0 duty cycle to increase the POC voltage; when the predicted current state is less than the preset current state threshold, decrease the PWM0 duty cycle to decrease the POC voltage; When the predicted brightness state is higher than the preset brightness state threshold, decrease the PWM1 duty cycle to decrease the brightness of the light supplement lamp; when the predicted brightness state is lower than the preset brightness state threshold, increase the PWM1 duty cycle to increase the brightness of the light supplement lamp.
10. A method for adaptive adjustment of brightness of a car camera light, used for implementing the system for adaptive adjustment of brightness of a car camera light according to any one of claims 1 to 9, characterized in that, The method comprises: S1. obtaining camera image data, environmental parameter data, POC parameter data, and GPIO parameter data within a time period; S2. Preprocess the acquired camera image data, environmental parameter data, POC parameter data and GPIO parameter data to obtain image feature data set, environmental feature data set, POC feature data set and GPIO feature data set; weight and fuse the image feature data set and the environmental feature data set to obtain a comprehensive feature data set; S3. Construct an environmental brightness monitoring model, input the comprehensive feature data set into the trained environmental brightness monitoring model to obtain a predicted environmental brightness; compare the predicted environmental brightness with a preset environmental brightness threshold to determine whether the current environment needs to be lighted up; If the current environment does not need to be lighted up, the current environmental brightness is continuously monitored; If the current environment needs to be lighted up, the light-up lamp is adjusted to an open state; S4. Monitor the changes of the POC parameter data and the GPIO parameter data in the open state of the light-up lamp; construct a state monitoring model, input the POC feature data set and the GPIO feature data set into the trained state monitoring model to obtain a predicted current-brightness state; compare the predicted current-brightness state with a preset current-brightness threshold to determine whether adjustment is needed; S5. If adjustment is not needed, the POC parameter data and the GPIO parameter data continue to be monitored; if adjustment is needed, dynamic adjustment is performed according to the monitored changes of the POC parameter data and the GPIO parameter data.
Citation Information
Patent Citations
Automobile cabin self-adaptive dimming system and method based on visual monitoring
CN115985218A
Vehicle-mounted DMS camera light supplement lamp brightness self-adaptive adjusting system
CN119629816A