Fatigue driving detection method and device
By performing distortion correction on the face images collected by the camera, the problem of poor image effects in the existing technology is solved, the accuracy of fatigue driving detection is improved, and accurate assessment of the driver's status and timely warning are achieved.
Patent Information
- Application Number
- CN202410612672.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-16
- Publication Date
- 2024-08-27
- Estimated Expiration
- 2044-05-16
AI Technical Summary
Existing fatigue driving detection methods are easily affected by light, weather and camera placement, resulting in poor image quality and thus reduced detection accuracy.
By obtaining the face image collected by the camera, distortion correction is performed, and the corrected image is used for fatigue driving detection and early warning information is output.
It improves the accuracy of fatigue driving detection, reduces the impact of perspective distortion on detection results, and can more truly reflect the driver's status and issue early warnings in a timely manner.
Smart Images

Figure CN118552940A
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the technical field of automobile driving, and in particular, to a fatigue driving detection method and device. Background Art
[0002] Traffic accidents are a common type of accident, and the casualties and property losses caused by these accidents cannot be ignored. Accidents often occur due to uneven driver quality and frequent violations, the most common of which include speeding, running red lights, and fatigue driving. Fatigue driving is one of the main causes of traffic accidents, threatening the lives of drivers, passengers, and people on the road and even the surrounding areas.
[0003] In order to reduce the safety hazards caused by fatigue driving, there are currently some fatigue driving monitoring systems based on cameras and sensors to detect the driver's behavior. However, the existing detection methods are easily affected by light, weather and camera placement, resulting in poor image quality, which leads to low accuracy in fatigue driving detection. Summary of the invention
[0004] The embodiments of the present invention provide a fatigue driving detection method and device to at least solve the problem of low fatigue driving detection accuracy due to poor captured image quality.
[0005] According to an embodiment of the present invention, a method for detecting fatigue driving is provided, comprising:
[0006] Get the face image captured by the camera;
[0007] If the facial image is distorted, correcting the facial image;
[0008] Performing fatigue driving detection based on the corrected face image;
[0009] When the corrected facial image meets the condition of fatigue driving, a warning message is output.
[0010] According to one embodiment of the present invention, a fatigue driving detection device is provided, comprising:
[0011] An acquisition module is used to acquire a face image captured by a camera;
[0012] A correction module, used for correcting the face image if the face image is distorted;
[0013] A detection module, used for performing fatigue driving detection based on the corrected face image;
[0014] The output module is used to output warning information when the corrected facial image meets the conditions of fatigue driving.
[0015] According to another embodiment of the present invention, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the steps in any one of the embodiments of the above-mentioned fatigue driving detection method when running.
[0016] According to another embodiment of the present invention, there is provided an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any embodiment of the above-mentioned fatigue driving detection method.
[0017] Through the present invention, when a captured image is distorted, the distortion of the face image is corrected, and the corrected face image is used for fatigue driving detection, thereby improving the accuracy of fatigue driving detection. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Figure 1 It is a hardware structure diagram of a mobile terminal of a fatigue driving detection method according to an embodiment of the present invention;
[0019] Figure 2 is a flow chart of a fatigue driving detection method according to an embodiment of the present invention;
[0020] Figure 3 is a schematic diagram of coordinate transformation for image correction according to an embodiment of the present invention;
[0021] Figure 4 is a diagram of a lightweight architecture model of an embodiment of the present invention;
[0022] Figure 5 is a structural diagram of the building blocks of an embodiment of the present invention;
[0023] Figure 6 is a schematic diagram of rotation angles of an embodiment of the present invention;
[0024] Figure 7 is an eye extraction feature map according to an embodiment of the present invention;
[0025] Figure 8 is a mouth extraction feature map according to an embodiment of the present invention;
[0026] Fig. 9 is a structural diagram of a fatigue driving detection system according to an embodiment of the present invention;
[0027] Fig.10 is a call relationship structure diagram of a fatigue driving detection system according to an embodiment of the present invention;
[0028] Fig.11 is a schematic diagram of a fatigue driving detection interface according to an embodiment of the present invention;
[0029] Fig.12 is a structural diagram of a fatigue driving detection device according to an embodiment of the present invention;
[0030] Fig.13 4 is a structural diagram of a fatigue driving detection device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0031] Hereinafter, embodiments of the present invention will be described in detail with reference to the accompanying drawings and in combination with the embodiments.
[0032] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.
[0033] The method embodiments provided in the embodiments of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Taking running on a mobile terminal as an example, Figure 1 1 is a hardware structure block diagram of a mobile terminal of a fatigue driving detection method according to an embodiment of the present invention. Figure 1 As shown, the mobile terminal may include one or more (only one is shown in the figure) processors 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data, wherein the mobile terminal may also include a transmission device 106 and an input / output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the mobile terminal. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations shown.
[0034] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as a computer program corresponding to a fatigue driving detection method in an embodiment of the present invention. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, to implement the above method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the mobile terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0035] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the mobile terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0036] This embodiment provides a method for detecting fatigue driving, wherein: Figure 2 is a flow chart of a fatigue driving detection method according to an embodiment of the present invention. Figure 2 As shown, the process includes the following steps:
[0037] Step S201: Acquire a face image captured by a camera.
[0038] In order to monitor the driver's facial expression and head posture, the face image collected by the camera in real time is obtained. Due to the movement of the camera position during the vehicle driving and the influence of factors such as environmental changes, the face image may be distorted.
[0039] Step S202: If the face image is distorted, correct the face image.
[0040] When the face image is distorted, the recognition result obtained by performing facial expression recognition based on the acquired face image will have a large error. Therefore, the face of the face image is first corrected so that the face of the corrected face image is not distorted.
[0041] Optionally, when the facial image is distorted, correcting the facial image includes:
[0042] Obtaining the center of the face image;
[0043] The face image is subjected to face correction based on the center of the face image to obtain the corrected face image.
[0044] In this embodiment, a distorted face image is corrected to obtain a corrected face image.
[0045] like Figure 3 As shown, Figure 3 is the face image of the driver captured by the camera. Point O is the center of the camera optical axis, C0 represents the real camera system, x0 and z0 represent the x-axis and z-axis of the camera system C0 respectively, and the y-axis (not shown) is perpendicular to the x-axis and z-axis; C R represents a virtual camera system with the center of the head aligned with the virtual optical axis, x R and z R Represent the camera system C R The x-axis and z-axis of the face image are perpendicular to the y-axis (not shown). When the face image is distorted, it is difficult to accurately obtain the true rotation angle and facial condition of the face image. Therefore, the face image of the face image can be extracted, the center of the facial boundary is used as the center of the face image, and the face image is corrected with the center of the face image, and the face image is corrected to the image in a normal shooting state, and the center of the corrected face image is aligned with the optical axis of the virtual optical system.
[0046] The corrected image obtained in the above manner can more realistically reflect the driver's state, can more clearly obtain the driver's nodding features, such as the head rotation angle, and can improve the accuracy of fatigue driving detection.
[0047] Optionally, performing fatigue driving detection based on the corrected face image includes:
[0048] Acquire a first rotation angle of the corrected face image in the first coordinate system, wherein the center of the corrected face image is located on an extension line of a coordinate axis of the first coordinate system;
[0049] Determining a second rotation angle of the face image in a second coordinate system based on the first rotation angle, where the second coordinate system is a coordinate system corresponding to the optical axis of the camera;
[0050] Fatigue driving detection is performed on the facial image based on the second rotation angle.
[0051] In this embodiment, after the facial image is corrected, the center of the corrected facial image is aligned with the optical axis of the virtual optical system. When multiple frames of images are acquired, the first rotation angle of the facial image in the first coordinate system can be acquired based on the difference between the multiple frames of facial images, and the acquired image can be compared with the facial image of the driver in a normal state to determine the first rotation angle. Specifically, the corrected facial image can be input into the convolutional neural network to obtain the rotation angle of the corrected facial image in the virtual camera system, that is, the first rotation angle.
[0052] In order to obtain a more realistic rotation angle of the face image, the first rotation angle in the first coordinate system corresponding to the virtual camera system is converted to the coordinate system of the real camera system, that is, the second rotation angle corresponding to the second coordinate system. The second rotation angle can fit the actual rotation angle, thereby improving the accuracy of nod detection. The first coordinate system can be Figure 3 The real camera system C0 shown in , the second coordinate system can be Figure 3 The virtual camera system C shown in R After the face image is corrected, the center of the face image is located at the coordinate axis z of the virtual camera system. R on the extension line.
[0053] For example, the facial region of the rectified face image is extracted and then used as the input of the convolutional neural network to estimate the face image in the virtual camera system C R The output of the convolutional neural network is transformed back to the camera coordinate system C0 as the final head pose estimate. In order to evaluate the head pose estimation algorithm, a benchmark dataset containing real head poses is required. These real head poses are measured or estimated relative to the real camera system C0.
[0054] In order to train a convolutional neural network to estimate the virtual camera system C R The head pose in the dataset must be appropriately transformed to the real head pose provided by the dataset. In order to evaluate the accuracy of the head pose estimation algorithm, the head pose estimate obtained from the convolutional neural network is transformed back to the camera system C0 for accuracy evaluation. These head pose estimates are usually expressed in the form of Euler angles, which can be converted to the form of rotation matrices as shown in the following formula:
[0055]
[0056] where α, β, and γ are the pitch, yaw, and roll angles, respectively. The ground truth head pose provided by the dataset in camera system C0 can be converted to the same matrix form and represented by M0. Similarly, M R Represents the virtual camera system C R The rotation matrix of the head pose in C.R The Euler angles in can be calculated by the following formula:
[0057]
[0058] where α R , β R and γ R Represents C R Pitch, yaw and roll in M Rmn Represents the matrix M R Through the above coordinate transformation, the rotation angle in the virtual camera system is converted to the rotation angle in the real camera system, so as to obtain the rotation angle of the face image in each direction in the real camera system.
[0059] In order to achieve the above effects, a lightweight convolutional neural network is constructed to accurately estimate the head posture based on the rectified image. To achieve this goal, the group convolution and depth-separable convolution techniques are used. Its structure is as follows Figure 4 This network model is relatively small and designed specifically for this application.
[0060] Depthwise separable convolution is a method of decomposing convolution, which consists of two parts: depthwise convolution (DW) and pointwise convolution (PW). By repeatedly applying group convolution and depthwise separable convolution techniques in the building block, a lightweight network can be effectively constructed, which is widely used in many CNN-based recognition algorithms. MobileNetV2 adopts a strategy of first introducing an extension layer (pointwise convolution) and then using depthwise separable convolution to significantly improve performance. In the building block of MobileNetV2, the extension layer is used to map the input features to high dimensions, followed by filtering through depthwise convolution, and finally mapping the features to low dimensions through pointwise convolution.
[0061] Based on MobileNetV1 and MobileNetV2, the present invention adopts a lightweight network structure for head posture estimation. This network consists of a series of building blocks, where the building blocks are constructed using point-by-point group convolution (PWG) and depth-separable convolution techniques, such as Figure 5 shown.
[0062] Pointwise group convolution is a special type of group convolution, which can be viewed as an implementation of group convolution using a kernel with 1×1 spatial size. Compared to standard pointwise convolution, pointwise group convolution uses fewer parameters and helps reduce the size of the network. We use pointwise group convolution to map the input features to high dimensions. The high-dimensional features are then further processed by depthwise separable convolution, where the expansion factor is set to 2 and the number of groups is set to 4 to achieve a balance between performance and network size. In the building blocks of the network, each convolution layer is followed by a batch normalization operation and an activation layer to improve the performance of the model.
[0063] In the proposed network, the following two types of activation functions are used: ReLU and h-swish. Previous work on MobileNetV3 showed that the introduction of h-swish can improve network performance at the cost of more computation compared to ReLU. These two activation functions are used in the network of this system to achieve a better balance between model accuracy and computational cost.
[0064] In this embodiment, fatigue driving detection is performed using the corrected face image. The detection process is shown in Figure 6 As shown. Obtain the face image in the camera system C0, detect the face image, obtain the head center in the presence of distortion, and perform correction with the head center as the center. The center of the corrected face image is aligned with the virtual optical axis of the virtual camera. Input the corrected face image into the estimation network, i.e., the convolutional neural network, obtain the rotation angle of the face image in the virtual camera system through the neural network, and perform coordinate transformation to obtain the rotation angle of the face image in the real camera system. Fatigue driving detection is performed based on the rotation angle.
[0065] Image correction is used to reduce the effect of perspective distortion and a lightweight convolutional neural network is designed for head pose estimation. When the head center of the input image of the neural network is not aligned with the camera coordinate system, mathematical correction is performed to align the head center with the optical axis of the virtual camera coordinate system.
[0066] Step S203: performing fatigue driving detection based on the corrected facial image.
[0067] In this step, based on the corrected face image, the driver's facial expression and head movement are detected to determine whether the driver is in a fatigue driving state. For example, whether the driver frequently blinks, nods, leaves the driving seat, etc. Fatigue driving detection based on the corrected face image can improve the detection accuracy.
[0068] Optionally, the performing fatigue driving detection on the face image based on the second rotation angle includes:
[0069] Determine a nodding operation of the face image based on the second rotation angle, where the nodding operation includes at least one of a vertical nodding operation, a horizontal nodding operation, and a tilted nodding operation;
[0070] When it is determined based on the second rotation angle that the nodding amplitude and the nodding frequency of the nodding operation are within a first preset range, it is determined that the corrected facial image meets the condition of fatigue driving.
[0071] The first rotation angle is converted to a corresponding second rotation angle in the real camera system, and whether a nodding operation occurs in the face image is determined based on the second rotation angle. For example, the nodding amplitude is determined based on the rotation angle, and when the nodding amplitude is within a preset amplitude range and the nodding frequency is within a preset frequency range, the above factors can also be combined at the same time to determine the nodding operation.
[0072] The main parameter for judging sleepiness is the Euler angle. The schematic diagram of the rotation angle is as follows: Figure 7 As shown in the figure, it can be seen that when the driver is dozing off, his head will obviously make movements similar to nodding and tilting. According to the head posture of ordinary people when they are dozing off, there will obviously be few movements on Yaw, and the behavior is mainly concentrated on Pitch and Roll. Therefore, the parameter ratio threshold is set. For example, within a time period of 10s, when the nodding angle on Pitch and Roll is greater than 20°, and the duration ratio exceeds 0.3, it is determined that the driver is in a dozing state and an early warning is issued.
[0073] Wherein, vertical nodding can be as follows Figure 7 The nod in the picth direction as shown in the figure, the horizontal nod can be the nod in the roll direction as shown in the figure, and the tilted nod can be the nod between the picth and roll directions. In addition, irregular nods such as tilted nods, irregular nod frequency and amplitude, but nods that meet the characteristics of sleepy nods can also be included.
[0074] The corrected facial image can more clearly capture the driver's nodding features, thereby improving the accuracy of fatigue driving detection.
[0075] Optionally, performing fatigue driving detection based on the corrected face image includes:
[0076] Detecting features of a blink operation of the corrected face image, wherein the features of the blink operation include at least one of a blink frequency and speed, a blink duration, and an irregular blink operation;
[0077] When the characteristic of the blinking operation is within a second preset range, it is determined that the corrected facial image meets the condition of fatigue driving.
[0078] Because the corrected face image can more accurately capture the features of the face image, such as eye features and mouth features.
[0079] In order to detect fatigue driving characteristics, this embodiment detects the blinking operation of the face image, including any one or more of the blinking frequency, blinking speed, blinking duration, irregular blinking operation, etc.
[0080] (a) Blinking frequency and speed analysis: Blinking frequency, for example, the number of blinks per minute, blinking speed reflects the time it takes to blink. Normal blinking is very fast, while blinking in a drowsy state is slower. Normal blinking and blinking caused by fatigue driving are different. For example, frequent and rapid blinking may indicate fatigue, while normal blinking is relatively smooth and regular.
[0081] (b) Blink duration: Longer periods of eye closure may indicate that the driver is experiencing eye fatigue, or is trying to resist falling asleep. This can be used to more accurately identify potential drowsy driving situations.
[0082] (c) Irregular blinking behaviors: such as slow blinking, staccato blinking, or asymmetrical blinking. These abnormal blinking behaviors may indicate driver fatigue or distraction because they are usually different from blinking during normal alertness.
[0083] Blink functionality modules typically provide data visualization, allowing drivers and monitoring personnel to view real-time and historical blink data. This helps drivers understand their alertness status and can take action when needed.
[0084] By calculating the eye aspect ratio (EAR), it is possible to determine whether there is fatigue driving. When the human eyes are open, the EAR fluctuates around a certain value. When the human eyes are closed, the EAR drops rapidly and theoretically approaches zero. In this system, a threshold is set for the EAR. If the value is lower than the set threshold, the eyes are judged to be in a closed state. In order to detect the number of blinks, the number of consecutive frames of the same blink needs to be set. The blinking speed is relatively fast, and generally 1-3 frames are required to complete the blinking action. Figure 8 As shown, the eye aspect ratio (EAR) calculation formula is shown in formula (3):
[0085]
[0086] By detecting the above blinking characteristics, the driver's fatigue driving state can be detected, so that corresponding measures can be taken.
[0087] Optionally, performing fatigue driving detection based on the corrected face image includes:
[0088] Detecting features of a yawning operation of the corrected face image, wherein the features of the yawning operation include at least one of a mouth opening degree, a mouth opening time, a mouth opening frequency, and a mouth opening speed;
[0089] When the characteristic of the yawning operation is within a third preset range, it is determined that the corrected facial image meets the condition of fatigue driving.
[0090] Yawning is a common sign of fatigue, usually indicating that the driver's alertness has decreased and that they need to rest or take other measures to maintain safe driving. Yawn detection includes the number of yawns, as well as the speed and frequency of yawns. The speed of opening the mouth can reflect the time it takes to yawn, and the frequency of yawns reflects the frequency. Frequent and rapid yawning may indicate a sharp decrease in the driver's alertness, which is a potential sign of danger.
[0091] The present invention adopts a dual threshold method for yawn detection, that is, to detect the inner contour: combining the mouth opening degree and the mouth opening time. In this system, Yawn is the number of frames that meet the yawning requirement, N is the total number of frames within 1 minute, and the threshold is set to 10%. When Freq>10%, it is considered that a deep yawn or at least two consecutive shallow yawns have occurred, and a fatigue reminder is given at this time.
[0092] The Dlib model is used for face recognition. The 68 facial feature points are detected and the index of the mouth facial landmarks is obtained. The video stream is grayed out through OpenCV to detect the position of the mouth.
[0093] from Fig. 9 As can be seen from the figure, yawning can be calculated using the coordinate points at the mouth, where 51, 59, 53, and 57 are the ordinates, represented by y; 49 and 55 are the abscissas, represented by x, to calculate the degree of mouth opening. The Euclidean distance formula for calculating yawning is shown in formula (4). By calculating the distance, we can determine whether the mouth is open and the mouth opening time, thereby determining whether a person is yawning. At the same time, the threshold should be reasonable and needs to be distinguished from normal speaking or humming.
[0094]
[0095] Determining whether a yawn occurs based on the corrected face image can improve the accuracy of detection.
[0096] Step S204: if the corrected facial image meets the condition of fatigue driving, output warning information.
[0097] If the driver is determined to be fatigued through facial images, a warning prompt can be output or other measures can be taken to prevent the vehicle from being in danger.
[0098] The embodiment of the present invention performs distortion correction on a face image and uses the corrected face image to perform fatigue driving detection, which can improve the accuracy of fatigue driving detection.
[0099] In order to make this embodiment more clearly understood, the following is an example of a specific embodiment. The fatigue driving detection system includes five modules, and the system diagram is as follows: Fig.10 As shown, it reflects the hierarchical structure between the various modules of the system, from camera capturing images to fatigue status monitoring, and then judging whether fatigue driving occurs through the monitoring module. If fatigue driving occurs, the result is output through the alarm module.
[0100] Fig.11 Reflects the calling relationship between each module, from the sensor layer to the data acquisition and preprocessing layer: The sensor layer captures data from the camera and then passes the raw data to the data acquisition and preprocessing layer. In this layer, the data is preprocessed, including denoising, calibration, and time synchronization to ensure the quality and consistency of the data. In the case of distortion in the captured image, the face image is corrected for distortion and then passed to the detection module.
[0101] Data acquisition and preprocessing layer to monitoring module: The processed data is passed from the data acquisition and preprocessing layer to the monitoring module. These modules are responsible for monitoring the driver's facial expressions and head posture. Monitoring modules with different functions, such as the blinking function module, the yawning function module and the sleepy nodding function module, first extract the corresponding features and further analyze the feature data to monitor signs of fatigue. Among them, the blinking function module is used to detect the driver's blinking operation, the yawning function module is used to detect the driver's yawning operation, and the sleepy nodding function module is used to detect the driver's nodding operation. The implementation of the above functional modules is based on the corrected face image.
[0102] Monitoring function module to data integration and analysis layer: This part passes the analysis results of the monitoring module to the data integration and analysis layer. This layer integrates the results of different modules to comprehensively evaluate the driver's status.
[0103] Data integration and analysis layer to alarm triggering layer: The data integration and analysis layer determines if there are potential signs of fatigue, and if so, it triggers the appropriate alarm. These alarms can include audible alarms, vibration alarms, or visual cues.
[0104] Alarm trigger layer to user interface layer: The alarm trigger layer communicates the alarm to the driver through the user interface layer.
[0105] The alarm function module is used to issue an alarm to remind the driver to take measures to maintain alertness and safety. The alarm function module is responsible for triggering the alarm based on the analysis results of other modules (such as the blinking function module, the yawning function module, and the sleepy nodding function module). If the system detects potential signs of fatigue, the alarm function module will start the alarm process.
[0106] The alert function module usually supports multiple different types of alerts. This includes sound alerts, vibration alerts, or a combination. Different types of alerts can better adapt to the driver's perception. Usually, the alert will last for a period of time to ensure that the driver is effectively reminded. The persistence can also automatically extend the alert time when signs of fatigue persist. In addition to sound and vibration, the alert function module can also use other methods, such as displaying text or icons on the driver's dashboard.
[0107] In order to facilitate the detection of driver fatigue, a human-machine interface of the driving detection system can be designed, such as Fig.12 shown.
[0108] The operating console can select the video source. The video source module is the entrance to the system and is responsible for real-time monitoring of the driver. This module usually includes a camera or other video capture device to obtain the driver's facial expressions, head posture and behavior. Through the video source, the system obtains real-time visual information for subsequent analysis. The fatigue monitoring part is the core part of the system, which can be selectively monitored to determine whether there is a fatigue driving state by analyzing the driver's yawning, blinking and nodding data. Usually, if this state persists for a certain period of time (for example, 3 seconds), the system will determine it as a fatigue driving state. The task of off-post monitoring is to monitor whether the driver has left the driving seat. Off-post monitoring helps to warn the driver in time to avoid potential dangers caused by distraction.
[0109] The status output bar is the result presentation part of the system, which is responsible for real-time output of the system's judgment of the driver's status. This module usually presents information to the driver in a visual way to remind them whether their status is normal. This can be achieved through alarm sounds, vibrations, graphical interfaces or other methods to ensure that the driver can quickly take measures to maintain alertness.
[0110] In the embodiment of the present invention, by introducing an image correction algorithm to correct the facial image, the system can effectively reduce the negative impact of perspective distortion on the facial image, thereby improving the accuracy of head posture estimation. And by adopting a lightweight convolutional neural network based on deep separable convolution, the system has a small model size and fast processing speed while maintaining high accuracy. The network model is small, which reduces memory and storage requirements and provides efficient application possibilities for platforms with limited resources. Lightweight convolutional neural networks have relatively few parameters and computational complexity, so they can perform well in real-time performance, achieve rapid response, and issue fatigue warnings in a timely manner.
[0111] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for enabling a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present invention.
[0112] In this embodiment, a fatigue driving detection device is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
[0113] Fig.13 is a structural diagram of a fatigue driving detection device according to an embodiment of the present invention. Fig.13 As shown, the device comprises:
[0114] An acquisition module 1301 is used to acquire a face image captured by a camera;
[0115] A correction module 1302, configured to correct the face image if the face image is distorted;
[0116] A detection module 1303, configured to perform fatigue driving detection based on the corrected face image;
[0117] The output module 1304 is used to output warning information when the corrected face image meets the condition of fatigue driving.
[0118] Optionally, the correction module includes:
[0119] A first acquisition submodule, used to acquire the center of the face image;
[0120] The correction submodule is used to perform facial correction on the facial image based on the center of the facial image to obtain the corrected facial image.
[0121] Optionally, the detection module includes:
[0122] A second acquisition submodule is used to acquire a first rotation angle of the corrected face image in the first coordinate system, wherein the center of the corrected face image is located on an extension line of a coordinate axis of the first coordinate system;
[0123] A first determining submodule, configured to determine a second rotation angle of the face image in a second coordinate system based on the first rotation angle, where the second coordinate system is a coordinate system corresponding to the optical axis of the camera;
[0124] The first detection submodule is used to perform fatigue driving detection on the face image based on the second rotation angle.
[0125] Optionally, the first detection submodule includes:
[0126] a first determining unit, configured to determine a nodding operation of the face image based on the second rotation angle, wherein the nodding operation includes at least one of a vertical nodding operation, a horizontal nodding operation, and a tilted nodding operation;
[0127] The second determining unit is used to determine that the corrected facial image meets the condition of fatigue driving when the nodding amplitude and the nodding frequency of the nodding operation are determined to be within a first preset range based on the second rotation angle.
[0128] Optionally, the detection module includes:
[0129] A second detection submodule is used to detect the characteristics of the blinking operation of the corrected face image, wherein the characteristics of the blinking operation include at least one of the blinking frequency and speed, the blinking duration, and the irregular blinking operation;
[0130] The second determination submodule is used to determine that the corrected facial image meets the condition of fatigue driving when the characteristic of the blinking operation is within a second preset range.
[0131] Optionally, performing fatigue driving detection based on the corrected face image includes:
[0132] A third detection submodule is used to detect the characteristics of the yawning operation of the corrected face image, wherein the characteristics of the yawning operation include at least one of the following: mouth opening degree, mouth opening time, mouth opening frequency, and mouth opening speed;
[0133] The third determination submodule is used to determine that the corrected face image meets the condition of fatigue driving when the characteristic of the yawning operation is within a third preset range.
[0134] It should be noted that the above modules can be implemented by software or hardware. For the latter, it can be implemented in the following ways, but not limited to: the above modules are all located in the same processor; or the above modules are located in different processors in any combination.
[0135] In the embodiment of the present invention, by introducing an image correction algorithm to correct the facial image, the system can effectively reduce the negative impact of perspective distortion on the facial image, thereby improving the accuracy of head posture estimation. And by adopting a lightweight convolutional neural network based on deep separable convolution, the system has a small model size and fast processing speed while maintaining high accuracy. The network model is small, which reduces memory and storage requirements and provides efficient application possibilities for platforms with limited resources. Lightweight convolutional neural networks have relatively few parameters and computational complexity, so they can perform well in real-time performance, achieve rapid response, and issue fatigue warnings in a timely manner.
[0136] An embodiment of the present invention further provides a computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when running.
[0137] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk.
[0138] An embodiment of the present invention further provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0139] In an exemplary embodiment, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.
[0140] For specific examples in this embodiment, reference may be made to the examples described in the above embodiments and exemplary implementation modes, and this embodiment will not be described in detail herein.
[0141] Obviously, those skilled in the art should understand that the above modules or steps of the present invention can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order than here, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present invention is not limited to any specific combination of hardware and software.
[0142] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A method for detecting fatigue driving, characterized in that: include: Get the face image captured by the camera; If the facial image is distorted, correcting the facial image; Performing fatigue driving detection based on the corrected face image; When the corrected facial image meets the condition of fatigue driving, a warning message is output.
2. The method according to claim 1, characterized in that When the face image is distorted, correcting the face image includes: Obtaining the center of the face image; The face image is subjected to face correction based on the center of the face image to obtain the corrected face image.
3. The method according to claim 2, characterized in that The step of performing fatigue driving detection based on the corrected face image includes: Acquire a first rotation angle of the corrected face image in the first coordinate system, wherein the center of the corrected face image is located on an extension line of a coordinate axis of the first coordinate system; Determining a second rotation angle of the face image in a second coordinate system based on the first rotation angle, where the second coordinate system is a coordinate system corresponding to the optical axis of the camera; Fatigue driving detection is performed on the facial image based on the second rotation angle.
4. The method according to claim 3, characterized in that The performing fatigue driving detection on the face image based on the second rotation angle includes: Determine a nodding operation of the face image based on the second rotation angle, where the nodding operation includes at least one of a vertical nodding operation, a horizontal nodding operation, and a tilted nodding operation; When it is determined based on the second rotation angle that the nodding amplitude and the nodding frequency of the nodding operation are within a first preset range, it is determined that the corrected facial image meets the condition of fatigue driving.
5. The method according to claim 1 or 2, characterized in that: The step of performing fatigue driving detection based on the corrected face image includes: Detecting features of a blink operation of the corrected face image, wherein the features of the blink operation include at least one of a blink frequency and speed, a blink duration, and an irregular blink operation; When the characteristic of the blinking operation is within a second preset range, it is determined that the corrected facial image meets the condition of fatigue driving.
6. The method according to claim 1 or 2, characterized in that: The step of performing fatigue driving detection based on the corrected face image includes: Detecting features of a yawning operation of the corrected face image, wherein the features of the yawning operation include at least one of a mouth opening degree, a mouth opening time, a mouth opening frequency, and a mouth opening speed; When the characteristic of the yawning operation is within a third preset range, it is determined that the corrected facial image meets the condition of fatigue driving.
7. A fatigue driving detection device, characterized in that: include: An acquisition module is used to acquire a face image captured by a camera; A correction module, used for correcting the face image if the face image is distorted; A detection module, used for performing fatigue driving detection based on the corrected face image; The output module is used to output warning information when the corrected facial image meets the conditions of fatigue driving.
8. The device according to claim 7, characterized in that The correction module comprises: A first acquisition submodule, used to acquire the center of the face image; The correction submodule is used to perform facial correction on the facial image based on the center of the facial image to obtain the corrected facial image.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program is configured to execute the method according to any one of claims 1 to 6 when executed.
10. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to run the computer program to perform the method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Method and device for detecting fatigue driving
CN106203293A
A machine vision image correction method for online detection
CN109887038A
Driver fatigue detection method based on neural network
CN110119676A
Fatigue driving detection method and system based on facial feature fusion
CN110532887A
Face image pose estimation and correction method and system, medium and electronic equipment
CN113011401A
