An Image Quality Optimization System for Automotive DMS Cameras

Through the light intensity monitoring module and facial occlusion coefficient calculation module combined with the parameter dynamic correction module, the DMS camera parameters are dynamically adjusted to solve the image quality problem affected by ambient stray light and improve the accuracy and safety of the DMS system.

CN118379230BActive Publication Date: 2024-09-24JUNJIE INTELLIGENT (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410809610.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-21
Publication Date
2024-09-24
Estimated Expiration
2044-06-21

AI Technical Summary

Technical Problem

The image quality of DMS cameras deteriorates under the influence of ambient stray light, resulting in false alarms and reduced accuracy, affecting driving safety.

Method used

The light intensity monitoring module, facial occlusion coefficient calculation module and parameter dynamic correction module are used to monitor the light intensity in the car through the ambient light sensor, calculate the facial occlusion coefficient and adjust the camera parameters according to the correction index, and dynamically adjust the contrast to reduce the impact of stray light.

Benefits of technology

It effectively improves the image quality, reduces the false alarm rate, improves the accuracy of driver status analysis, and enhances driving safety.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118379230B
    Figure CN118379230B
Patent Text Reader

Abstract

The invention discloses an image quality optimization system for a car DMS camera, and relates to the technical field of image quality optimization. A light intensity monitoring module is used to monitor changes in the light intensity in the car. When the light intensity in the car is too high, a facial occlusion coefficient calculation module combines multiple frames of facial images to calculate the light spot status and shadow status of the driver's face, and outputs the driver's current facial occlusion coefficient. A parameter dynamic correction module weights the facial occlusion coefficient and the light intensity in the car to obtain a correction index. If it is determined that the camera parameters need to be dynamically adjusted, the camera parameters are recalibrated through the correction index. The optimization system combines the environment and the driver's facial image information to realize dynamic adjustment of the camera parameters, thereby effectively reducing the impact of ambient stray light on the image, ensuring image quality, improving the accuracy of the DMS system's analysis of the driver's state, and reducing the false alarm rate of the DMS system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image quality optimization, and in particular to an image quality optimization system for a DMS camera of an automobile. Background Art

[0002] DMS (Driver-Monitoring-System) is an automotive safety technology designed to monitor the driver's status and behavior to ensure driving safety. DMS typically includes cameras, sensors, and software algorithms that work together to monitor the driver's attention, fatigue, and emotional state. The DMS camera is one of the core components of the system and is usually installed inside the car, facing the driver. They can be a single camera or a combination of multiple cameras, depending on the vehicle manufacturer and system design. These cameras monitor the driver's behavior through real-time image capture and analysis.

[0003] In actual use, the DMS (driver monitoring system) camera is affected by ambient stray light, which can cause image quality degradation and easily lead to the following problems:

[0004] 1. Due to the degradation of image quality, the system may frequently issue false alarms or ignore real warnings, which will not only annoy the driver, but also cause the driver to lose trust in the system alarms, ultimately affecting driving safety;

[0005] 2. Ambient stray light will interfere with the camera's detection of the driver's head posture and eye direction, causing the system to be unable to accurately determine whether the driver is paying attention. For example, strong sunlight reflection may make the camera unable to recognize the direction of the driver's eyes, and thus unable to detect whether the driver is paying attention to the road. Summary of the invention

[0006] The purpose of the present invention is to provide an image quality optimization system for an automobile DMS camera to solve the deficiencies in the background technology.

[0007] In order to achieve the above object, the present invention provides the following technical solutions: an image quality optimization system for an automobile DMS camera, comprising a light intensity monitoring module, a facial occlusion coefficient calculation module, and a parameter dynamic correction module;

[0008] Light intensity monitoring module: monitors changes in light intensity inside the vehicle through ambient light sensors;

[0009] Facial occlusion coefficient calculation module: When the light intensity inside the monitored vehicle is too high, the camera continuously captures the driver's face to obtain multiple frames of facial images at different times, and combines the multiple frames of facial images to calculate the driver's facial light spot and shadow conditions. After analyzing the facial light spot and shadow conditions through an intelligent model, the driver's current facial occlusion coefficient is output;

[0010] Parameter dynamic correction module: The facial occlusion coefficient and the light intensity inside the vehicle are weighted to obtain the correction index. Based on the comparison result between the correction index and the index threshold, it is determined whether the camera parameters need to be dynamically adjusted. If it is determined that the camera parameters need to be dynamically adjusted, the module will

[0011] In a preferred embodiment, the facial occlusion coefficient calculation module compares the light intensity inside the car obtained by the ambient light sensor with a preset intensity threshold. If the intensity change exceeds the intensity threshold, it is determined that the ambient light has changed significantly, that is, the light intensity inside the car is too high.

[0012] In a preferred embodiment, the facial occlusion coefficient calculation module camera continuously captures the driver's face at a fixed frame rate, acquires multiple frames of facial images in real time, stores the continuously acquired multiple frames of facial images in a buffer area of ​​the optimization system, and maintains an image sequence window of a fixed size;

[0013] Convert multiple frames of facial images into grayscale images, apply filters to denoise the grayscale images, use facial detection algorithms to locate the driver's facial region in each frame, and extract the facial region in each frame;

[0014] By setting the first threshold, the highlight area in the facial area is identified, and the number, size and position of the light spots are counted. By setting the second threshold, the shadow area in the facial area is identified, and the number, size and position of the shadows are counted. Combined with the light intensity distribution of multiple frames of images, the time changes of light spots and shadows are analyzed, the continuity and movement trajectory of light spots and shadows are determined, and the spatiotemporal characteristics of light spots and shadows are extracted to construct feature vectors.

[0015] In a preferred embodiment, the facial occlusion coefficient calculation module extracts the spatiotemporal features of light spots and shadows to construct feature vectors, including the following steps:

[0016] Identify the light spot area and shadow area of ​​the face;

[0017] Mark and segment the light spots and shadow areas in each frame of the image, mark each independent light spot and shadow area using the connected component marking algorithm, and extract the geometric features of each marked area, including area and centroid;

[0018] For each light spot and shadow area, its area and centroid position are recorded in each frame to form time series data: , For the The area of ​​the frame spot or shadow area, For the The centroid of the frame spot or shadow area is The coordinates of the direction, For the The centroid of the frame spot or shadow area is Coordinates of the direction;

[0019] Between adjacent frames, the centroid position and area shape matching algorithm are used to determine the persistence of the same spot area or shadow area;

[0020] Track the position changes of the same light spot or shadow area in multiple frames of images to form a trajectory;

[0021] The spatiotemporal characteristics of each light spot or shadow area are combined into a feature vector. for: , For the The area of ​​the frame spot or shadow area, For the The centroid of the frame spot or shadow area is The coordinates of the direction, For the The centroid of the frame spot or shadow area is The coordinates of the direction, is the speed at which the center of mass of the light spot or shadow area changes, is the rate of change of the light spot or shadow area.

[0022] In a preferred embodiment, after the facial occlusion coefficient calculation module analyzes the facial spot condition and shadow condition through an intelligent model, the spot condition includes the spot area and the spot area change rate in the feature vector of the spot area, and the shadow condition includes the shadow area and the shadow area change rate in the feature vector of the shadow area;

[0023] The intelligent model sums the area of ​​the light spot and the area of ​​the shadow on the driver's face to obtain the occlusion area, and adds the area change rate of the light spot to the area change rate of the shadow to obtain the occlusion area change rate;

[0024] The occlusion area and the occlusion area change rate are normalized, the occlusion area and the occlusion area change rate are mapped to [0,1], the normalized occlusion area value and the normalized occlusion area change rate value are obtained, and the normalized occlusion area value plus the normalized occlusion area change rate value are added to obtain the facial occlusion coefficient.

[0025] In a preferred embodiment, the parameter dynamic correction module compares the obtained correction index with a preset index threshold. If the correction index is less than or equal to the index threshold, it is determined that the camera parameters do not need to be dynamically adjusted. If the correction index is greater than the index threshold, it is determined that the camera parameters need to be dynamically adjusted. The steps of the dynamic adjustment algorithm are:

[0026] The parameter dynamic correction module obtains the light spot area and shadow area in the driver's facial image, and adjusts the contrast in the light spot area and shadow area through the correction index. The expression is:

[0027]

[0028] In the formula, This is the contrast of the spot area before adjustment. is the contrast of the spot area after adjustment. This is the contrast before adjustment for the shadow area. Adjusted contrast for shadow areas. is the correction index.

[0029] In a preferred embodiment, the light intensity monitoring module uses a moving average algorithm to smooth the continuously sampled data. The ambient light sensor continuously collects the light intensity data in the vehicle at a set frequency, and stores the collected data in a buffer. Each time new data is collected, the latest light intensity data is added to the sliding window, and the oldest data is removed, keeping the window size constant. The average value of all data in the sliding window is calculated to calculate the smoothed light intensity value at the current moment. The calculation formula of the moving average value is: , where is the moving average, is the size of the sliding window, For the window The calculated moving average value is used as the smoothed light intensity data at the current moment and stored in the system's temporary memory. As new light intensity data is continuously collected, the smoothing process is repeated to update the moving average value in real time.

[0030] An image quality optimization method for a vehicle DMS camera, the optimization method comprising the following steps:

[0031] The optimization system monitors changes in the light intensity inside the car through the ambient light sensor. When the light intensity inside the car is too high, the camera continuously captures the driver's face to obtain multiple frames of facial images at different times. The system combines the multiple frames of facial images to calculate the light spot and shadow conditions on the driver's face. After analyzing the light spot and shadow conditions on the face through the intelligent model, the system outputs the driver's current facial occlusion coefficient.

[0032] The facial occlusion coefficient and the light intensity inside the vehicle are weighted to obtain the correction index. Based on the comparison result between the correction index and the index threshold, it is determined whether the camera parameters need to be dynamically adjusted. If it is determined that the camera parameters need to be dynamically adjusted, the camera parameters are recalibrated using the correction index.

[0033] In the above technical solution, the technical effects and advantages provided by the present invention are:

[0034] The present invention monitors the change of light intensity in the car through the light intensity monitoring module. When the light intensity in the car is too high, the facial occlusion coefficient calculation module continuously shoots the driver's face through the camera to obtain multiple frames of facial images at different times, calculates the driver's facial light spot status and shadow status in combination with the multiple frames of facial images, and outputs the driver's current facial occlusion coefficient after analyzing the facial light spot status and shadow status through the intelligent model. The parameter dynamic correction module calculates the facial occlusion coefficient and the light intensity in the car by weighted calculation to obtain the correction index, and judges whether the camera parameters need to be dynamically adjusted according to the comparison result of the correction index and the index threshold. If it is judged that the camera parameters need to be dynamically adjusted, the camera parameters are re-calibrated by the correction index. The optimization system combines the environment and the driver's facial image information to realize the dynamic adjustment of the camera parameters, so as to effectively reduce the influence of environmental stray light on the image, ensure the image quality, improve the accuracy of the DMS system in analyzing the driver's state, and reduce the false alarm rate of the DMS system. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present invention. For ordinary technicians in this field, other drawings can also be obtained based on these drawings.

[0036] Figure 1 It is a system module diagram of the present invention. DETAILED DESCRIPTION

[0037] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are 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 creative work are within the scope of protection of the present invention.

[0038] Example 1: Please refer to Figure 1As shown, the image quality optimization system of an automobile DMS camera described in this embodiment includes a light intensity monitoring module, a facial occlusion coefficient calculation module, and a parameter dynamic correction module;

[0039] Light intensity monitoring module: monitors changes in light intensity in the car through ambient light sensors, and sends the results of light intensity changes to the facial occlusion coefficient calculation module and the parameter dynamic correction module;

[0040] Facial occlusion coefficient calculation module: When the light intensity inside the monitored vehicle is too high, the camera continuously captures the driver's face to obtain multiple frames of facial images at different times, and combines the multiple frames of facial images to calculate the driver's facial light spot and shadow conditions. After analyzing the facial light spot and shadow conditions through an intelligent model, the driver's current facial occlusion coefficient is output and sent to the parameter dynamic correction module;

[0041] Parameter dynamic correction module: The facial occlusion coefficient and the light intensity inside the vehicle are weighted to obtain the correction index. Based on the comparison result between the correction index and the index threshold, it is determined whether the camera parameters need to be dynamically adjusted. If it is determined that the camera parameters need to be dynamically adjusted, the camera parameters are recalibrated using the correction index.

[0042] This application monitors the changes in the light intensity in the car through the light intensity monitoring module. When the light intensity in the car is too high, the facial occlusion coefficient calculation module continuously shoots the driver's face through the camera to obtain multiple frames of facial images at different times, and calculates the driver's facial light spot and shadow conditions by combining the multiple frames of facial images. After analyzing the facial light spot and shadow conditions through the intelligent model, the driver's current facial occlusion coefficient is output. The parameter dynamic correction module calculates the facial occlusion coefficient and the light intensity in the car by weighted calculation to obtain the correction index. According to the comparison result of the correction index and the index threshold, it is judged whether the camera parameters need to be dynamically adjusted. If it is judged that the camera parameters need to be dynamically adjusted, the camera parameters are recalibrated through the correction index. The optimization system combines the environment and the driver's facial image information to realize the dynamic adjustment of the camera parameters, so as to effectively reduce the impact of environmental stray light on the image, ensure image quality, improve the accuracy of the DMS system's analysis of the driver's status, and reduce the false alarm rate of the DMS system.

[0043] The optimization system works as follows:

[0044] The optimization system monitors changes in the light intensity inside the car through the ambient light sensor. When the monitored light intensity inside the car is too high, the camera is used to continuously shoot the driver's face to obtain multiple frames of facial images at different times, and the driver's facial light spot and shadow conditions are calculated by combining the multiple frames of facial images. After analyzing the facial light spot and shadow conditions through the intelligent model, the driver's current facial occlusion coefficient is output, and the facial occlusion coefficient and the light intensity inside the car are weighted to obtain the correction index. Based on the comparison result of the correction index and the index threshold, it is determined whether the camera parameters need to be dynamically adjusted. If it is determined that the camera parameters need to be dynamically adjusted, the camera parameters are recalibrated through the correction index.

[0045] Embodiment 2: The light intensity monitoring module monitors the changes in the light intensity in the vehicle through the ambient light sensor, and the light intensity change results are sent to the facial occlusion coefficient calculation module and the parameter dynamic correction module;

[0046] The ambient light sensor performs self-tests to ensure that it works properly and can accurately measure light intensity. The ambient light sensor collects light intensity data in the car at a fixed frequency (e.g., 10 times per second) to ensure the real-time and continuity of the data. The moving average algorithm is used to smooth the continuously sampled data to reduce the impact of instantaneous fluctuations and noise, and obtain a stable light intensity value. The real-time measured light intensity value is compared with the preset intensity threshold to determine whether the ambient light in the car has changed significantly.

[0047] The ambient light sensor needs to be calibrated before use. The calibration is a static calibration of the car in the laboratory. The calibration process includes setting the baseline value and eliminating the deviation.

[0048] For example: select a standard light source with known light intensity (such as a laboratory standard lamp), whose light intensity has been calibrated by a professional instrument and set to 1000 lux, place the car in a laboratory environment, turn off all other light sources in the car, and place the standard light source in a fixed position in front of the ambient light sensor to ensure that the light directly shines on the ambient light sensor;

[0049] Start the ambient light sensor to measure the light intensity and record five readings: 980lux, 995lux, 990lux, 1005lux, 1000lux. Calculate the average value of the measured values ​​to be 994lux and record the measured average value of 994lux as the baseline value of the ambient light sensor.

[0050] Measure under different known light intensity conditions, such as using standard light sources of 500 lux and 1500 lux;

[0051] 500lux measurement: record 5 readings: 480lux, 490lux, 495lux, 485lux, 490lux. Calculate the average value: 488lux;

[0052] 1500lux measurement: record 5 readings: 1480lux, 1500lux, 1490lux, 1510lux, 1500lux. Calculate the average value: 1496lux;

[0053] Compare the reading of the ambient light sensor with the actual light intensity value, calculate the deviation value of each measurement point, 500lux deviation is 12lux, 1500lux deviation is 4lux, and build a linear deviation model based on these measurement data. For example, a correction formula can be derived, the calibration value is equal to the measured value plus the deviation coefficient, and the deviation coefficient can be obtained through linear regression analysis;

[0054] The calibration coefficient is calculated by linear regression analysis. For example, assuming that the calculated calibration coefficient is: the calibration coefficient is equal to 09.8 × measured value + 10, the calibration coefficient is stored in the non-volatile memory of the ambient light sensor or the vehicle system to ensure that it is automatically applied every time a measurement is made;

[0055] Re-measure using a standard light source and apply the calibration factor to correct the ambient light sensor reading. For example, under 500 lux conditions, the corrected reading is: the correction value is equal to 497 lux. Check whether the calibrated reading is close to the actual light intensity value and ensure that the deviation is within an acceptable range (for example, ±5 lux). By analogy, the ambient light sensor can be calibrated to effectively improve the accuracy of the ambient light sensor during vehicle driving.

[0056] The ambient light sensor collects the light intensity data in the car at a fixed frequency and uses a moving average algorithm to smooth the continuously sampled data;

[0057] The ambient light sensor continuously collects the light intensity data in the car at a set frequency, and stores the collected data in a buffer. It maintains a fixed-size sliding window (for example, the data of the last 10 samples) to store the most recent light intensity measurement values. Each time new data is collected, the latest light intensity data is added to the sliding window, and the oldest data is removed to keep the window size constant. The average of all data in the sliding window is calculated to calculate the smoothed light intensity value at the current moment. The moving average calculation formula is: , where is the moving average, is the size of the sliding window, For the window The calculated moving average value is used as the smoothed light intensity data at the current moment and stored in the system's temporary memory. As new light intensity data is continuously collected, the above steps are repeated to update the moving average value in real time, ensuring the continuity and real-time performance of the light intensity data smoothing process.

[0058] When the light intensity inside the monitored vehicle is too high, the facial occlusion coefficient calculation module continuously captures the driver's face through a camera to obtain multiple frames of facial images at different times, and calculates the driver's facial light spot and shadow conditions by combining the multiple frames of facial images. After analyzing the facial light spot and shadow conditions through an intelligent model, the driver's current facial occlusion coefficient is output, and the facial occlusion coefficient is sent to the parameter dynamic correction module;

[0059] The facial occlusion coefficient calculation module compares the light intensity inside the car obtained by the ambient light sensor with the preset intensity threshold. If the intensity change exceeds the intensity threshold, it is determined that the ambient light has changed significantly, that is, the light intensity inside the car is too high.

[0060] The camera continuously captures the driver's face at a fixed frame rate (such as 30 frames per second), obtains multiple frames of facial images in real time, temporarily stores the continuously acquired multiple frames of facial images in the cache area of ​​the optimization system, maintains a fixed-size image sequence window (such as the images of the most recent 5 seconds), converts the multiple frames of facial images into grayscale images, applies filters (such as median filtering or Gaussian filtering) to denoise the grayscale images, reduces the impact of random noise in the images, uses existing facial detection algorithms (such as Haar features or Dlib library) to locate the driver's facial area in each frame of the image, extracts the facial region (Region-of-Interest, ROI) in each frame of the image, and unifies the size and position of the facial region;

[0061] The facial occlusion coefficient calculation module identifies the highlight area (light spot) in the facial area by setting a first threshold. The number, size and position of the light spots are counted, and by setting a second threshold, the first threshold is greater than the second threshold, and the area in the facial area with brightness greater than the first threshold is the highlight area, and the area in the facial area with brightness less than the second threshold is the shadow area, and the shadow area in the facial area is identified. The number, size and position of the shadows are counted, and the time change of the light spots and shadows is analyzed in combination with the light intensity distribution of multiple frames of images, the continuity and movement trajectory of the light spots and shadows are determined, the spatiotemporal characteristics of the light spots and shadows (such as area change, position movement speed, etc.) are extracted, and the feature vector is constructed;

[0062] The facial occlusion coefficient calculation module combines the light intensity distribution of multiple frames of images, analyzes the temporal changes of light spots and shadows, determines the persistence and movement trajectory of light spots and shadows, extracts the temporal and spatial characteristics of light spots and shadows (such as area changes, position movement speed, etc.), and constructs feature vectors, including the following steps:

[0063] Set the first threshold to , the second threshold is set to , identify the spot area and shadow area of ​​the face, the expression is:

[0064]

[0065] In the formula, is the light spot area, is the shaded area, is the pixel position in the region, for Pixel position in the frame image The light intensity value;

[0066] The light spots and shadow areas in each frame are marked and segmented. The existing connected component marking algorithm is used to mark each independent light spot and shadow area, and the geometric features of each marked area, such as area, centroid, etc., are extracted. The function model is:

[0067]

[0068] In the formula, is the area of ​​the pixel position in the region that is the light spot or shadow area, that is, the total number of pixels in the region, is the centroid of the light spot or shadow area The coordinates of the direction, is the centroid of the light spot or shadow area The coordinates of the direction, is the pixel position in the region;

[0069] For each light spot and shadow area, its area and centroid position are recorded in each frame to form time series data: , For the The area of ​​the frame spot or shadow area, For the The centroid of the frame spot or shadow area is The coordinates of the direction, For the The centroid of the frame spot or shadow area is Coordinates of the direction;

[0070] Between adjacent frames, the centroid position and area shape matching algorithm is used to determine the continuity of the same spot area or shadow area. The function expression is:

[0071]

[0072] In the formula, is the Euclidean distance between the centroid positions in adjacent frames, is the area similarity, For the The centroid of the frame spot or shadow area is The coordinates of the direction, For the The centroid of the frame spot or shadow area is The coordinates of the direction, For the The area of ​​the frame spot or shadow area;

[0073] The Euclidean distance between the obtained centroid positions in adjacent frames The distance threshold to the preset Compare and similarity of area Similarity threshold For comparison, if and , judged as the same light spot area or shadow area;

[0074] Track the position changes of the same light spot or shadow area in multiple frames of images to form a trajectory;

[0075]

[0076] In the formula, is the speed at which the center of mass of the light spot or shadow area changes, is the rate of change of the area of ​​the light spot or shadow area, is the time interval between adjacent frames, For the The centroid of the frame spot or shadow area is The coordinates of the direction, For the The centroid of the frame spot or shadow area is The coordinates of the direction, For the The area of ​​the frame spot or shadow area;

[0077] The spatiotemporal characteristics of each light spot or shadow area are combined into a feature vector. for: , For the The area of ​​the frame spot or shadow area, For the The centroid of the frame spot or shadow area is The coordinates of the direction, For the The centroid of the frame spot or shadow area is The coordinates of the direction, is the speed at which the center of mass of the light spot or shadow area changes, is the rate of change of the light spot or shadow area.

[0078] The facial occlusion coefficient calculation module analyzes the facial light spot and shadow conditions through an intelligent model, obtains the feature vector of each light spot or shadow area on the driver's face, and then analyzes it through an intelligent model to output the driver's current facial occlusion coefficient;

[0079] The facial spot condition and shadow condition are analyzed by an intelligent model. The spot condition includes the spot area and the rate of change of the spot area in the feature vector of the spot area. The shadow condition includes the shadow area and the rate of change of the shadow area in the feature vector of the shadow area.

[0080] The intelligent model sums the area of ​​the light spot area and the area of ​​the shadow area on the driver's face to obtain the occlusion area, adds the area change rate of the light spot area to the area change rate of the shadow area to obtain the occlusion area change rate, normalizes the occlusion area and the occlusion area change rate, maps the occlusion area and the occlusion area change rate value range to [0,1], obtains the normalized occlusion area value and the normalized occlusion area change rate value, and adds the normalized occlusion area value to the normalized occlusion area change rate value to obtain the facial occlusion coefficient. The larger the facial occlusion coefficient, the larger the occlusion range caused by the light spot or shadow on the driver's face, or the faster the occlusion range increases, which makes it easier for the quality of the driver's facial image taken by the camera to deteriorate.

[0081] Embodiment 3: The parameter dynamic correction module calculates the face occlusion coefficient and the light intensity in the vehicle by weighted calculation to obtain the correction index, and determines whether the camera parameters need to be dynamically adjusted based on the comparison result between the correction index and the index threshold. If it is determined that the camera parameters need to be dynamically adjusted, the camera parameters are recalibrated using the correction index.

[0082] The parameter dynamic correction module calculates the face occlusion coefficient and the light intensity inside the car by weighted calculation to obtain the correction index, which is expressed as: , where is the correction index, is the facial occlusion coefficient, is the light intensity inside the car, , are the weights of the light intensity inside the car and the facial occlusion coefficient, respectively, and ;

[0083] The larger the correction index, the lower the image quality due to the influence of ambient stray light. Therefore, the obtained correction index is compared with the preset index threshold. If the correction index is less than or equal to the index threshold, it is determined that the camera parameters do not need to be dynamically adjusted. If the correction index is greater than the index threshold, it is determined that the camera parameters need to be dynamically adjusted. The steps of the dynamic adjustment algorithm are as follows:

[0084] The parameter dynamic correction module obtains the light spot area and shadow area in the driver's facial image, and adjusts the contrast in the light spot area and shadow area through the correction index. The expression is:

[0085]

[0086] In the formula, This is the contrast of the spot area before adjustment. is the contrast of the spot area after adjustment. This is the contrast before adjustment for the shadow area. Adjusted contrast for shadow areas. is the correction index;

[0087] In summary, when light spots appear on the driver's face, it is usually necessary to reduce the contrast to deal with this situation. If the contrast is increased, the bright parts of the image will become brighter and the dark parts will become darker. This will cause the light spot area to be more prominent, further lose details, and make it difficult to restore the true color and details. Reducing the contrast can reduce the difference between the bright and dark parts and reduce the visual impact of the overexposed area. By reducing the contrast, the brightness of the light spot area can be reduced, so that the details of these areas can be preserved or restored;

[0088] When a shadow appears on the driver's face, it is usually necessary to increase the contrast to deal with this situation. If the contrast is reduced, the difference between the bright and dark parts of the image will become smaller, which will cause the brightness of the shadow area to be further reduced and the details to be more blurred. Increasing the contrast can increase the brightness of the dark part, making the details of the shadow area clearer and the overall image more layered.

[0089] No dynamic contrast adjustment is performed on the driver's face where no light spot or shadow area appears.

[0090] The above formulas are all dimensionless and numerical calculations. The formula is a formula for the most recent real situation obtained by collecting a large amount of data and performing software simulation. The preset parameters in the formula are set by technicians in this field according to actual conditions.

[0091] It should be understood that the term "and / or" in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. A and B can be singular or plural. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship, but it may also indicate an "and / or" relationship. Please refer to the context for specific understanding.

[0092] It should be understood that in the various embodiments of the present application, the size of the serial numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0093] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working process of the above-described system, device and unit can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.

[0094] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. An image quality optimization system for automotive DMS cameras, Features: It includes light intensity monitoring module, facial occlusion coefficient calculation module and parameter dynamic correction module; Light intensity monitoring module: monitors changes in light intensity inside the vehicle through ambient light sensors; Facial occlusion coefficient calculation module: When the light intensity inside the monitored vehicle is too high, the camera continuously captures the driver's face to obtain multiple frames of facial images at different times, and combines the multiple frames of facial images to calculate the driver's facial light spot and shadow conditions. After analyzing the facial light spot and shadow conditions through an intelligent model, the driver's current facial occlusion coefficient is output; Dynamic parameter correction module: The facial occlusion coefficient and the light intensity in the car are weighted to obtain the correction index. Based on the comparison between the correction index and the index threshold, it is determined whether the camera parameters need to be dynamically adjusted. If so, the camera parameters need to be dynamically adjusted. The facial occlusion coefficient calculation module compares the light intensity inside the car obtained by the ambient light sensor with a preset intensity threshold. If the intensity change exceeds the intensity threshold, it is determined that the ambient light has changed significantly, that is, it is determined that the light intensity inside the car is too high. The camera of the facial occlusion coefficient calculation module continuously shoots the driver's face at a fixed frame rate, obtains multiple frames of facial images in real time, stores the continuously acquired multiple frames of facial images in a buffer area of ​​the optimization system, and maintains an image sequence window of a fixed size; Convert multiple frames of facial images into grayscale images, apply filters to denoise the grayscale images, use facial detection algorithms to locate the driver's facial region in each frame, and extract the facial region in each frame; By setting a first threshold, the highlight area in the facial area is identified, and the number, size and position of the light spots are counted. By setting a second threshold, the shadow area in the facial area is identified, and the number, size and position of the shadows are counted. In combination with the light intensity distribution of multiple frames of images, the time variation of the light spots and shadows is analyzed, the persistence and movement trajectory of the light spots and shadows are determined, and the spatiotemporal characteristics of the light spots and shadows are extracted to construct feature vectors. The facial occlusion coefficient calculation module extracts the spatiotemporal features of light spots and shadows to construct a feature vector, including the following steps: Identify the light spot area and shadow area of ​​the face; Mark and segment the light spots and shadow areas in each frame of the image, mark each independent light spot and shadow area using the connected component marking algorithm, and extract the geometric features of each marked area, including area and centroid; For each light spot and shadow area, its area and centroid position are recorded in each frame to form time series data: A t ,(c x,t ,c y,t ), A t is the area of ​​the light spot or shadow area in the tth frame, c x,t is the coordinate of the center of mass of the light spot or shadow area in the tth frame in the x direction, c y,t is the coordinate of the centroid of the light spot or shadow area in the tth frame in the y direction; Between adjacent frames, the centroid position and area shape matching algorithm are used to determine the persistence of the same spot area or shadow area; Track the position changes of the same light spot or shadow area in multiple frames of images to form a trajectory; The spatiotemporal features of each light spot or shadow area are combined into a feature vector, and the feature vector F is: F = [A t ,(c x,t ,c y,t ),v,r A ], A t is the area of ​​the light spot or shadow area in the tth frame, c x,t is the coordinate of the center of mass of the light spot or shadow area in the tth frame in the x direction, c y,t is the coordinate of the center of mass of the light spot or shadow area in the tth frame in the y direction, v is the speed of the change of the center of mass position of the light spot or shadow area, r A is the rate of change of the area of ​​the light spot or shadow area; The facial occlusion coefficient calculation module analyzes the facial light spot condition and shadow condition through the intelligent model, wherein the light spot condition includes the light spot area and the light spot area change rate in the feature vector of the light spot area, and the shadow condition includes the shadow area and the shadow area change rate in the feature vector of the shadow area; The intelligent model sums the area of ​​the light spot and the area of ​​the shadow on the driver's face to obtain the occlusion area, and adds the area change rate of the light spot to the area change rate of the shadow to obtain the occlusion area change rate; The occlusion area and the occlusion area change rate are normalized, the occlusion area and the occlusion area change rate are mapped to [0,1], the normalized occlusion area value and the normalized occlusion area change rate value are obtained, and the normalized occlusion area value plus the normalized occlusion area change rate value are added to obtain the facial occlusion coefficient.

2. The image quality optimization system of an automotive DMS camera according to claim 1, Features: The parameter dynamic correction module compares the obtained correction index with the preset index threshold. If the correction index is less than or equal to the index threshold, it is determined that the camera parameters do not need to be dynamically adjusted. If the correction index is greater than the index threshold, it is determined that the camera parameters need to be dynamically adjusted. The steps of the dynamic adjustment algorithm are as follows: The parameter dynamic correction module obtains the light spot area and shadow area in the driver's facial image, and adjusts the contrast in the light spot area and shadow area through the correction index. The expression is: Where, GC_ratio new is the contrast of the spot area before adjustment, GC_ratio old YC_ratio is the contrast of the spot area after adjustment. new YC_ratio is the contrast of the shadow area before adjustment. old is the contrast of the shadow area after adjustment, and C_index is the correction index.

3. The image quality optimization system of an automotive DMS camera according to claim 2, Features: The light intensity monitoring module uses a moving average algorithm to smooth the continuously sampled data. The ambient light sensor continuously collects the light intensity data in the car at a set frequency and stores the collected data in a buffer. Each time new data is collected, the latest light intensity data is added to the sliding window, and the oldest data is removed to keep the window size constant. The average value of all data in the sliding window is calculated to calculate the smoothed light intensity value at the current moment. The calculation formula of the moving average value is: In the formula, YDP is the moving average, N is the size of the sliding window, and z i For the i-th light intensity measurement value in the window, the calculated moving average is used as the smoothed light intensity data at the current moment and stored in the system's temporary memory. As new light intensity data is continuously collected, the smoothing process is repeated to update the moving average in real time.

4. A method for optimizing the image quality of a vehicle DMS camera, implemented by the optimization system according to any one of claims 1 to 3, Features: The optimization method comprises the following steps: The optimization system monitors changes in the light intensity inside the car through the ambient light sensor. When the light intensity inside the car is too high, the camera continuously captures the driver's face to obtain multiple frames of facial images at different times. The system combines the multiple frames of facial images to calculate the light spot and shadow conditions on the driver's face. After analyzing the light spot and shadow conditions on the face through the intelligent model, the system outputs the driver's current facial occlusion coefficient. The facial occlusion coefficient and the light intensity inside the vehicle are weighted to obtain the correction index. Based on the comparison result between the correction index and the index threshold, it is determined whether the camera parameters need to be dynamically adjusted. If it is determined that the camera parameters need to be dynamically adjusted, the camera parameters are recalibrated using the correction index.