Abnormal driving behavior detection method, device, terminal and medium
Through human body key point model recognition and image recognition technology, abnormal behaviors of drivers are detected, which solves the problem of insufficient detection reliability in the existing technology, improves detection speed and accuracy, and improves driving safety.
Patent Information
- Application Number
- CN202110349516.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-03-31
- Publication Date
- 2024-10-15
- Estimated Expiration
- 2041-03-31
AI Technical Summary
In the existing technology, the reliability of detecting abnormal driving behavior based on the observations of the driver himself and the passengers in the same vehicle is limited, resulting in insufficient detection speed and accuracy, especially when the driver is the only driver.
By acquiring images of drivers, identifying and calculating the positional relationships of key human body points based on the human body key point model, abnormal driving behaviors are detected, including indicators such as hand-ear distance, hand-lip distance, and facial deflection angle, and image recognition technology is used to determine abnormal behaviors.
It improves the detection speed and accuracy of abnormal driving behavior, avoids the problem of limited reliability and poor timeliness, and improves driving safety.
Smart Images

Figure CN112990069B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image processing technology, and in particular to an abnormal driving behavior detection method, device, terminal and medium. Background Art
[0002] With the development of the economy and society, the number of motor vehicles is increasing. The convenience and speed of motor vehicles have brought a lot of convenience to people's travel and transportation, but there are also certain traffic risks. Generally speaking, more focused driving of motor vehicles can effectively reduce traffic risks, but because the cab is relatively private, in real life, many drivers may engage in abnormal driving behaviors such as smoking, watching TV, reading novels, making phone calls, etc. while driving, causing certain risks.
[0003] In the related technologies, it is often necessary to rely on the driver's own awareness and the observation of passengers in the car to detect the occurrence or continuation of the above-mentioned abnormal driving behavior, which has limited reliability. Therefore, there is an urgent need for a method that can automatically detect abnormal driving behavior to accurately detect abnormal driving behavior and improve driving safety. Summary of the invention
[0004] In view of the shortcomings of the prior art described above, the purpose of the present invention is to provide a method, device, terminal and medium for detecting abnormal driving behavior, which are used to solve the technical problem of limited reliability of detecting the occurrence or continuation of abnormal driving behavior by relying on the driver's own consciousness and the observation of passengers in the same car.
[0005] In view of the above problems, the present invention provides a method for detecting abnormal driving behavior, comprising:
[0006] Acquire driver images;
[0007] Identifying the key points of the human body of the driver in the driver image and the position information of the key points of the human body based on the key point model;
[0008] If the identified human body key point set includes target human body key points, the positional relationship between the target human body key points is obtained to perform abnormal driving behavior detection, and the target human body key points include human body key points in at least two preset parts.
[0009] Optionally, the target human body key points include hand key points and ear key points, and the acquiring the positional relationship between the target human body key points and performing abnormal driving behavior detection includes:
[0010] Determine the hand-ear distance between the hand key point and the ear key point according to the position information of the hand key point and the position information of the ear key point;
[0011] If the hand-ear distance is less than the preset hand-ear distance, a hand-ear partial image is selected from the driver image, wherein the hand-ear partial image includes an image of the positions of the hand key points and the ear key points;
[0012] Image recognition is performed on the partial images of the hand and ear, and if a mobile phone is recognized, it is determined that abnormal driving behavior exists.
[0013] Optionally, the target human body key points include hand key points and lip key points, and the acquiring the positional relationship between the target human body key points and performing abnormal driving behavior detection includes:
[0014] Determine the hand-lip distance between the hand key point and the lip key point according to the position information of the hand key point and the position information of the lip key point;
[0015] If the hand-lip distance is less than the preset hand-lip distance, a hand-lip partial image is selected from the driver image, wherein the hand-lip partial image includes an image of positions where the hand key points and the lip key points are located;
[0016] Image recognition is performed on the partial image of the hand and lips, and if a slender object is recognized, it is determined that abnormal driving behavior exists.
[0017] Optionally, determining the presence of abnormal driving behavior includes:
[0018] Respectively obtaining a first pixel average value of an end of the slender object away from the lips and a second pixel average value of the local image of the hand and lips;
[0019] If the first pixel average value is greater than the second pixel average value, it is determined that abnormal driving behavior exists.
[0020] Optionally, also include:
[0021] Obtain the position information of the current human body key points on the face and select the partial facial image;
[0022] Identifying facial key points in the partial facial image and position information of the facial key points based on a facial key point model;
[0023] Determine a deflection angle according to the position information of the facial key points, wherein the deflection angle includes at least one of a pitch angle, a roll angle, and a yaw angle;
[0024] If the deflection angle is greater than a preset deflection angle threshold, it is determined that abnormal driving behavior exists.
[0025] Optionally, the yaw angle is obtained by:
[0026] θ x =atan2(-r yz , rzz );
[0027] The rolling angle is obtained by:
[0028]
[0029] The pitch angle is obtained by:
[0030] θ z =atan2(-r xy , r xx );
[0031] Among them, θ x is the yaw angle, θ y is the roll angle, θ z is the pitch angle.
[0032] Optionally, the training method of the human key point model includes:
[0033] Obtaining M human key points in the human key point image, each of the human key points is converted into a maximum activation point in an N*N matrix through Gaussian distribution;
[0034] Obtain a backbone network, and input the human body key point image into the backbone network to generate an output result;
[0035] According to the maximum activation point and the output result, L2 loss is determined as a loss function, and the backbone network is trained.
[0036] The present invention also provides an abnormal driving behavior detection device, comprising:
[0037] An acquisition module, used for acquiring a driver image;
[0038] A recognition module, used for recognizing the key points of the human body of the driver in the driver image and the position information of the key points of the human body based on the key point model of the human body;
[0039] The detection module is used to obtain the positional relationship between the target human key points if the identified human key point set includes the target human key points, and perform abnormal driving behavior detection. The target human key points include the human key points of at least two preset parts.
[0040] The present invention also provides a terminal, comprising a processor, a memory and a communication bus;
[0041] The communication bus is used to connect the processor and the memory;
[0042] The processor is used to execute the computer program stored in the memory to implement the abnormal driving behavior detection method as described in any one of the above embodiments.
[0043] The present invention also provides a computer-readable storage medium having a computer program stored thereon.
[0044] The computer program is used to enable the computer to execute the abnormal driving behavior detection method as described in any one of the above embodiments.
[0045] As described above, the abnormal driving behavior detection method, device, terminal and medium provided by the present invention have the following beneficial effects:
[0046] This method obtains the driver's image, identifies the driver's human body key points in the driver's image and the position information of the human body key points according to the human body key point model, and if the set of identified human body key points includes the target human body key points, obtains the position relationship between the target human body key points to detect abnormal driving behavior. This avoids the problem of limited reliability and poor timeliness caused by relying solely on the driver's own or the passengers' continuous attention to detect the occurrence of abnormal driving behavior, and the difficulty of abnormal driving behavior detection when there is only one driver in the driving tool. It improves the detection speed and accuracy of abnormal driving behavior, and can effectively improve driving safety. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] Figure 1 A schematic diagram of a flow chart of an abnormal driving behavior detection method provided in Embodiment 1 of the present invention;
[0048] Figure 2 A schematic diagram of a human body key point determined according to the human skeleton joint points;
[0049] Figure 3 A schematic diagram of a key point image of a human body;
[0050] Figure 4 A schematic diagram of a partial image of a hand and ear;
[0051] Figure 5 A schematic diagram of a partial image of a hand and lip;
[0052] Figure 6 A schematic diagram of the recognition result of facial key point recognition on a partial facial image;
[0053] Figure 7 A schematic diagram of the structure of an abnormal driving behavior detection device provided in Embodiment 2 of the present invention;
[0054] Figure 8 A schematic diagram of the structure of a terminal provided in Embodiment 2 of the present invention. DETAILED DESCRIPTION
[0055] The following describes the embodiments of the present invention by specific examples, and those skilled in the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that the following embodiments and features in the embodiments can be combined with each other without conflict.
[0056] It should be noted that the illustrations provided in the following embodiments are only schematic illustrations of the basic concept of the present invention, and thus the drawings only show components related to the present invention rather than being drawn according to the number, shape and size of components in actual implementation. In actual implementation, the type, quantity and proportion of each component may be changed arbitrarily, and the component layout may also be more complicated.
[0057] Embodiment 1
[0058] See also Figure 1 , an abnormal driving behavior detection method provided by an embodiment of the present invention includes:
[0059] S101: Acquire a driver image.
[0060] Drivers include but are not limited to drivers of motor vehicles, non-motor vehicles, ships, aircraft and other driving vehicles.
[0061] The driver's image can be captured by a camera installed on the driving tool (such as an in-vehicle monitoring device installed in the cab, etc.), or by an outdoor camera such as a road monitoring camera, a road crossing capture device, etc.
[0062] When the driver image is based on video frames extracted from the driver video, video frames with good lighting within a certain time range may be selected as the driver image.
[0063] The driver image can be acquired based on external instructions, or can be acquired automatically at certain intervals.
[0064] Optionally, in order to make the abnormal driving behavior detection more accurate, the shooting angle of the driver's image can try to capture the driver's frontal image.
[0065] In some embodiments, before acquiring the driver image, the method further includes:
[0066] The current driving state of the driving tool is obtained. If the current driving state includes driving, the driver's image is obtained. This can avoid the waste of resources caused by continuing to shoot the driver when the driving tool is in a stopped state, and the reasonable actions of the driver are captured when the driving tool is in a braking state, resulting in false detection.
[0067] S102: Identifying the key points of the human body of the driver in the driver image and the position information of the key points of the human body based on the key point model.
[0068] The human body key point model may be a pre-trained recognition model, and the human body key point model may adopt a recognition model in existing related technologies.
[0069] Optionally, the human key point model can also be trained and obtained in the following way:
[0070] Obtain M human key points in the human key point image, and transform each human key point into the maximum activation point in the N*N matrix through Gaussian distribution;
[0071] Obtain the backbone network and input the key point image of the human body into the backbone network to generate the output result;
[0072] According to the maximum activation point and the output result, L2 loss is determined as the loss function, and the backbone network is trained.
[0073] The human body key point image is an image with human body key points marked in advance. The positions of human body key points can be determined according to the positions of human bones. Figure 2 and Figure 3 , Figure 3 is a schematic diagram of a human key point image. Figure 2 It is a schematic diagram of key points of the human body determined based on the joints of the human skeleton.
[0074] It should be noted that Figure 2 The serial number is only an example, and those skilled in the art can change the identification method of the serial number as needed, including but not limited to using letters, words, etc. for identification.
[0075] Figure 2 The identification method of the human body key points in is only an example. Those skilled in the art can add and define other feature points as human body key points, or delete some human body key points as needed.
[0076] Optionally, the backbone network includes but is not limited to the mobilenetv2 network. Figure 3Taking the human key points shown in the figure as an example, the 21 human key points are converted into the maximum activation points in the 64*64 matrix through Gaussian distribution to obtain a 21*64*64 gt heatmap. The human key point image is input into the mobilenetv2 network to obtain a 21*64*64 output result. According to the output result and the 21*64*64 gt heatmap, L2 loss is determined as the loss function, and the mobilenetv2 network is optimized through this loss function.
[0077] Optionally, the loss function can be determined based on the distance from the maximum activation point to the corresponding point mapped on the output result.
[0078] Through the above-mentioned feature map method, taking into account the interrelated characteristics of human feature points, the human key point model obtained after training can learn the contextual semantic information in the image, which can effectively prevent overfitting and predict more accurate human key points.
[0079] Based on the human body key point model, the human body key points and the position information of the human body key points in the driver's image can be accurately identified.
[0080] S103: If the identified human body key point set includes the target human body key points, the positional relationship between the target human body key points is obtained to perform abnormal driving behavior detection.
[0081] It should be noted that the target human body key points include human body key points at at least two preset parts.
[0082] Optionally, whether the human body key points include the target human body key points can be determined by the identification information of the human body key points, and the identification information includes but is not limited to the above Figure 2 Serial number etc. shown.
[0083] In some embodiments, if the set of identified human key points does not include the target human key points, it means that part of the driver's body may be outside the shooting area, for example, the driver sticks his head out of the car window, puts his hands outside the shooting area, lowers his head, or reaches out to look for items dropped in the car, etc. At this time, the driver's actions are all abnormal driving actions, and the detection result of abnormal driving behavior detection is that abnormal driving behavior exists.
[0084] Optionally, the key points of the target human body may be determined by a person skilled in the art according to an actual application scenario of the detection method.
[0085] In some embodiments, the target human body key points include hand key points and ear key points, and obtaining the positional relationship between the target human body key points and performing abnormal driving behavior detection includes:
[0086] Determine the hand-ear distance between the hand key point and the ear key point according to the position information of the hand key point and the position information of the ear key point;
[0087] If the hand-ear distance is less than the preset hand-ear distance, a hand-ear partial image is selected from the driver image, where the hand-ear partial image includes an image of the positions of the hand key points and the ear key points;
[0088] Perform image recognition on the local image of the hand and ear. If the target object is recognized, it is determined that abnormal driving behavior exists.
[0089] The hand key points include at least one of the left hand key points and the right hand key points, and the ear key points include at least one of the left ear key points and the right ear key points.
[0090] Optionally, the hand-ear distance includes but is not limited to at least one of the following:
[0091] The first hand-ear distance is from the left ear to the left hand, the second hand-ear distance from the left ear to the right hand, the third hand-ear distance from the right ear to the left hand, and the fourth hand-ear distance from the right ear to the right hand.
[0092] In some embodiments, the method of performing image recognition on the partial image of the hand and ear can adopt the image recognition method in the related art to identify the target object.
[0093] Optionally, the target items include but are not limited to mobile phones, etc.
[0094] When the distance between the hand and the ear is small, it is likely that the driver is talking on the mobile phone, and mobile phone talking has a great impact on driving safety. Therefore, this method can accurately detect this abnormal driving behavior.
[0095] It should be noted that the preset hand-ear distance can be set according to the needs of technical personnel in this field and is not limited here.
[0096] In some embodiments, the preset hand-ear distance can vary according to the driver's physical condition. By pre-collecting images of the driver's various normal driving actions, an unreasonable hand-ear distance can be determined as the preset hand-ear distance. This avoids system misjudgment due to the rough use of preset values, thereby improving the accuracy and reliability of detection.
[0097] In some embodiments, the target object may be identified by determining whether there is an object in the driver's hand close to the ear. If there is an object, the object is considered a target object regardless of whether it is identified as a mobile phone or not. Sometimes, the driver may be wearing earrings, and although the mobile phone cannot be identified, the behavior is still a dangerous driving behavior. Therefore, it can also be stipulated that as long as the object is detected in the hand, the object is a target object.
[0098] In some embodiments, the partial image of the hand and ear is the hand and ear corresponding to the hand-ear distance being less than a preset hand-ear distance, rather than the entire facial image. For example, if it is detected that the distance from the left hand to the left ear is less than the preset hand-ear distance, the partial image of the hand and ear only needs to include the left hand and left ear, and does not need to include at least one of the right ear or the right hand.
[0099] In some embodiments, see Figure 3 ,Although Figure 3 The middle hand-ear distance is smaller than the preset hand-ear distance, but since there is nothing in the driver's hands, there is no abnormal driving behavior. This can effectively avoid false detection due to normal operations such as raising the driver's hands or stroking the hair, further improving detection accuracy.
[0100] See also Figure 4 , Figure 4 This is an example of a local hand-ear image. When the left hand key point is detected near the left ear key point, that is, when the first hand-ear distance from the left hand to the left ear is detected to be less than the preset hand-ear distance, the area where the left hand and the left ear are located is captured, and the hand-ear local image is normalized, for example, the hand-ear local image is resized to a size of 224x224, and the SSD (Single shot multibox detector) detection method is continued to be used to detect whether a mobile phone is contained therein. If a mobile phone is detected, it is determined that a phone call is made, that is, abnormal driving behavior exists.
[0101] In some embodiments, the target human body key points include hand key points and lip key points, and obtaining the positional relationship between the target human body key points and performing abnormal driving behavior detection includes:
[0102] Determine the hand-lip distance between the hand key point and the lip key point according to the position information of the hand key point and the position information of the lip key point;
[0103] If the hand-lip distance is less than the preset hand-lip distance, a hand-lip partial image is selected from the driver image, where the hand-lip partial image includes an image of the positions of the hand key points and the lip key points;
[0104] Image recognition is performed on the partial image of the lip. If a slender object is identified, it is determined that abnormal driving behavior has occurred.
[0105] The hand key points include at least one of left hand key points and right hand key points.
[0106] Optionally, the hand-ear distance includes but is not limited to at least one of the following:
[0107] The distance from lips to the left hand is the first hand lip distance, and the distance from lips to the right hand lip is the second hand lip distance.
[0108] In some embodiments, the method of performing image recognition on the partial image of the lip may adopt the image recognition method in the related art to identify the slender object.
[0109] Optionally, the elongated objects include but are not limited to cigarettes, electronic cigarettes, etc.
[0110] When the distance between the hand and the lips is small, it is likely that the driver is smoking, and smoking has a great impact on driving safety, so this abnormal behavior can be accurately detected through this method.
[0111] It should be noted that the preset hand-lip distance can be set according to the needs of technical personnel in this field and is not limited here.
[0112] In some embodiments, the preset hand-lip distance can vary according to the driver's physical condition. By pre-collecting images of the driver's various normal driving actions, an unreasonable hand-lip distance can be determined as the preset hand-lip distance. This avoids system misjudgment due to the rough use of preset values, thereby improving the accuracy and reliability of detection.
[0113] In some embodiments, the identification and determination method of the slender object can also be to determine whether there is an object in the driver's hand close to the lips. If there is an object, no matter whether it is identified as a slender object or not, the object is regarded as a slender object. Sometimes the driver may be eating or other operations, although the slender object cannot be identified, but this behavior is still a dangerous driving behavior. Therefore, it can also be stipulated that as long as the existence of a slender object is detected in the hand, the object is a slender object.
[0114] In some embodiments, the partial image of hand and lips is the hand and lips corresponding to the hand-lip distance being less than a preset hand-lip distance, rather than the entire facial image. For example, if it is detected that the distance from the left hand to the lips is less than the preset hand-lip distance, the partial image of hand and lips only needs to include the left hand and lips, and does not need to include the right hand.
[0115] In some embodiments, determining that abnormal driving behavior exists includes:
[0116] respectively obtaining a first pixel average value of an end of the slender object away from the lips and a second pixel average value of the local image of the hand and lips;
[0117] If the first pixel average value is greater than the second pixel average value, it is determined that abnormal driving behavior exists.
[0118] When the distance between the driver's hand and lips is too small, sometimes the driver may be drinking water, eating, sending voice messages, or smoking. In comparison, the smoking process lasts longer and is more dangerous. Regardless of whether it is an electronic cigarette or a cigarette, the end away from the lips may appear to be glowing during the smoking process. Therefore, the first pixel average value of the area where the end of the slender object is away from the lips can be compared with the second pixel average value of the entire Shouchun local image. If the first pixel average value is greater than the second pixel average value, it means that one end of the slender object is in a glowing state, and it is very likely that the driver is smoking at this time, so it is determined that there is abnormal driving behavior.
[0119] Of course, the cigarette may still be in the state of the driver exhaling smoke. In order to further determine whether the driver is smoking, a partial image of the driver's lips can be further obtained, and image recognition can be used to identify whether there is smoke. If there is smoke, it can be further determined that there is abnormal driving behavior.
[0120] See also Figure 5 , Figure 5 This is an example of a partial image of hand and lips. When the left hand key point is detected near the lip key point, that is, when the first hand-lip distance from the left hand to the lips is detected to be less than the preset hand-lip distance, the area where the left hand and lips are located is captured, and the partial image of the hand and lips is normalized, for example, the partial image of the hand and lips is resized to a size of 224x224, and the SSD (Single shot multibox detector) detection method is continued to be used to detect whether there is a cigarette in the partial image of the hand and lips. If a cigarette is detected, it is determined that there is smoking behavior, that is, there is abnormal driving behavior.
[0121] In some embodiments, in order to improve the accuracy of abnormal driving behavior detection, based on the determination of abnormal driving behavior based on the current driver image, at least one image of a preset time before or after the current driver image can be further obtained to perform at least one further abnormal driving behavior detection. If more than a certain proportion of the detection results are consistent, it is determined that abnormal driving behavior does exist. For example, the driver image currently obtained is obtained at 10:00:00, and abnormal driving behavior is detected based on the image, then the driver images of 10:00:03 and 9:59:58 are obtained respectively for detection. If it is detected that the driver has abnormal driving behavior in at least one of the images, it can be further determined that abnormal driving behavior exists.
[0122] In some embodiments, the abnormal driving behavior detection method further includes:
[0123] The target key points include hand key points, and the hand key points include left hand key points and right hand key points;
[0124] The hand distance between the left hand key point and the right hand key point is obtained. If the hand distance is not within the preset hand distance range threshold, a partial image of the hand is obtained and recognized. If the hand key point is recognized to be located on the steering wheel, the abnormal behavior is determined to be normal. Otherwise, it is determined that abnormal driving behavior exists.
[0125] When the driving tool is an automatic transmission motor vehicle, gear shifting is often not required during driving. Therefore, the driver is usually required to hold the steering wheel with both hands during driving. Some drivers have the bad habit of leaving their hands on the steering wheel when the vehicle is close to constant speed and straight driving. Therefore, the hand distance can be detected. If the key points of the hands cannot be detected, or the distance between the key points of the hands is too large or too small, it means that the driver may not have both hands on the steering wheel, which may cause danger to driving. By determining whether the hands are placed on the steering wheel through image recognition, the abnormal driving behavior of leaving the steering wheel with both hands can be effectively detected.
[0126] In some embodiments, the target key points include left-hand key points and right-hand key points, and obtaining the positional relationship between the target human body key points and performing abnormal driving behavior detection includes:
[0127] Determine the hand distance between the two hands according to the position information of the left hand key points and the position information of the right hand key points;
[0128] Acquire a partial image of the hand, identify a steering wheel in the partial image of the hand, and determine the diameter of the steering wheel;
[0129] If the hand distance is smaller than the diameter, it is determined that abnormal driving behavior exists.
[0130] In life, some people have very bad driving habits. They are used to putting their hands on the lower half of the steering wheel. When an emergency occurs, they often do not have time to adjust the direction. Therefore, this method can detect dangerous actions in time, and then remind relevant personnel in time to avoid accidents.
[0131] In some embodiments, if two hands are not successfully detected in the steering wheel area, the hand-ear distance between the hand key points and the ear key points is further determined based on the position information of the hand key points and the position information of the ear key points, and / or the hand-lip distance between the hand key points and the lip key points is determined based on the position information of the hand key points and the position information of the lip key points, and then the corresponding detection steps are executed accordingly.
[0132] In some embodiments, the abnormal driving behavior detection method further includes:
[0133] Obtain the position information of the current human body key points on the face and select the partial facial image;
[0134] Identify facial key points in a partial facial image and the location information of the facial key points based on a facial key point model;
[0135] Determine the deflection angle according to the position information of the facial key points;
[0136] If the deflection angle is greater than a preset deflection angle threshold, it is determined that abnormal driving behavior exists.
[0137] In some embodiments, after selecting the partial facial image and before identifying the facial key points and the position information of the facial key points in the partial facial image based on the facial key point model, the method further includes:
[0138] Normalize the local facial image.
[0139] Optionally, the partial facial image is resized to a 112x112 image and then input into a facial key point model to obtain the coordinate information of the facial key points.
[0140] In some embodiments, the facial key point model may be an existing related model. A possible recognition result may be found in Figure 6 As shown in the figure, multiple recognition points are set according to the positions of facial features and contours.
[0141] In some embodiments, the number of facial key points output by the facial key point model is 68, and its distribution can be seen in Figure 6 .
[0142] In some embodiments, the deflection angle includes at least one of a pitch angle, a roll angle, and a yaw angle. When the deflection angle includes at least two of the pitch angle, the roll angle, and the yaw angle, it can be set that when one of the angles is greater than a preset deflection angle threshold, it can be determined that the driver has a deflection behavior, and further it can be determined that there is abnormal driving behavior.
[0143] Optionally, the yaw angle is obtained by:
[0144] θ x =atan2(-r yz , r zz ) formula (1).
[0145] Optionally, the roll angle is obtained by:
[0146]
[0147] Optionally, the pitch angle is obtained by:
[0148] θ z =atan2(-r xy , r xx ) formula (3).
[0149] Among them, θ x is the yaw angle, θ y is the roll angle, θ z is the pitch angle.
[0150] where r yz 、r zz 、r rz 、r xy 、r xx It can be determined as follows:
[0151] The yaw angle Yaw is the angle of rotation around the Y axis, the pitch angle pitch is the angle of rotation around the x axis, and the roll angle roll is the angle of rotation around the z axis, then:
[0152]
[0153]
[0154]
[0155] Rotate in yaw-pitch-roll order, and the matrix is described as:
[0156]
[0157] According to the position information of each facial key point, r can be determined yz 、r zz 、r rz 、r xy 、r xx , and then determine the deflection angle.
[0158] In some embodiments, the abnormal driving behavior detection method further includes:
[0159] If abnormal driving behavior is determined, an alarm message will be issued.
[0160] Optionally, the alarm message can be displayed through the driving tool's own alarm bells, alarm lights, etc., and the alarm message can also be transmitted to the corresponding message receiving terminal through wired or wireless communication. The message receiving terminal includes but is not limited to the mobile terminal (mobile phone, etc.) carried by the driver, third-party platforms (such as traffic police monitoring platform, driver management platform), etc.
[0161] In some embodiments, the abnormal driving behavior detection method further includes:
[0162] Obtain information on abnormal driving behavior and determine the degree of danger of abnormal driving based on preset rules.
[0163] Abnormal driving behavior information includes but is not limited to abnormal driving duration, geographic location information of the location where the abnormal driving behavior occurred, current driving speed, current road status of the driving tool, specific type of abnormal behavior, etc.
[0164] The current road section status of the driving tool includes but is not limited to at least one of a long straight road, a road with many turns, a one-way road, a downhill slope, an uphill slope, etc.
[0165] Specific types of abnormal behaviors include, but are not limited to, at least one of smoking, making phone calls, eating snacks, and being distracted.
[0166] The preset rules may be to pre-set certain weight scores for various abnormal driving behavior information, and then determine the comprehensive score, and determine the degree of danger of abnormal driving behavior according to the comprehensive score. The degree of danger includes but is not limited to: very dangerous, relatively dangerous, generally dangerous, etc.
[0167] For example, the current abnormal driving behavior information includes turning, long downhill, distraction, and distraction for 3 seconds. According to the preset weight score, the comprehensive score is determined to be 80 points, and the pre-set comprehensive score is over 70 points, which is very dangerous. At this time, the danger level of abnormal driving is very dangerous.
[0168] Optionally, the alarm frequency and alarm method can be determined according to the dangerousness level of abnormal driving.
[0169] The embodiment of the present invention provides an abnormal driving behavior detection method, which obtains a driver image, identifies the driver's human body key points in the driver image and the position information of the human body key points according to the human body key point model, and if the identified human body key point set includes the target human body key points, obtains the position relationship between the target human body key points, and performs abnormal driving behavior detection. It avoids the problem of limited reliability and poor timeliness caused by relying solely on the continuous attention of the driver himself or the passengers in the same car to detect the occurrence of abnormal driving behavior, and the problem that abnormal driving behavior detection is difficult when there is only one driver in the driving tool, improves the detection speed and accuracy of abnormal driving behavior, and can effectively improve driving safety.
[0170] Embodiment 2
[0171] See also Figure 7 , an abnormal driving behavior detection device 1000, comprising:
[0172] An acquisition module 1001 is used to acquire a driver image;
[0173] The recognition module 1002 is used to recognize the key points of the human body of the driver in the driver image and the position information of the key points of the human body based on the key point model of the human body;
[0174] The detection module 1003 is used to obtain the positional relationship between the target human key points and perform abnormal driving behavior detection if the identified human key point set includes the target human key points. The target human key points include the human key points of at least two preset parts.
[0175] In this embodiment, the abnormal driving behavior detection device is essentially provided with multiple modules for executing the abnormal driving behavior detection method in the above embodiment. The specific functions and technical effects can be referred to the above embodiment 1, which will not be repeated here.
[0176] See also Figure 8 , an embodiment of the present invention further provides a terminal 1100, including a processor 1101, a memory 1102 and a communication bus 1103;
[0177] The communication bus 1103 is used to connect the processor 1101 and the memory 1102;
[0178] The processor 1101 is used to execute the computer program stored in the memory 1102 to implement the abnormal driving behavior detection method as described in any of the above embodiments.
[0179] The embodiment of the present invention further provides a computer-readable storage medium, characterized in that a computer program is stored thereon.
[0180] The computer program is used to enable a computer to execute the abnormal driving behavior detection method as described in any one of the above-mentioned embodiments.
[0181] The embodiment of the present application also provides a non-volatile readable storage medium, which stores one or more modules (programs). When the one or more modules are applied to a device, the device can execute instructions (instructions) of the steps included in the embodiment 1 of the embodiment of the present application.
[0182] It should be noted that the computer-readable medium disclosed above may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
[0183] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.
[0184] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages, or a combination thereof, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).
[0185] The flow chart and block diagram in the accompanying drawings illustrate the possible implementation architecture, function and operation of the method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0186] The above embodiments are merely illustrative of the principles and effects of the present invention, and are not intended to limit the present invention. Anyone familiar with the art may modify or alter the above embodiments without departing from the spirit and scope of the present invention. Therefore, all equivalent modifications or alterations made by a person of ordinary skill in the art without departing from the spirit and technical concept disclosed by the present invention shall still be covered by the claims of the present invention.
Claims
1. A method for detecting abnormal driving behavior, characterized in that: include: Acquire driver images; Identifying the key points of the human body of the driver in the driver image and the position information of the key points of the human body based on the key point model; If the identified human body key point set includes the target human body key point, the positional relationship between the target human body key points is obtained to perform abnormal driving behavior detection, and the target human body key points include human body key points of at least two preset parts; The target human body key points include hand key points and lip key points, and the acquiring of the positional relationship between the target human body key points and the abnormal driving behavior detection includes: Determine the hand-lip distance between the hand key point and the lip key point according to the position information of the hand key point and the position information of the lip key point; If the hand-lip distance is less than the preset hand-lip distance, a hand-lip partial image is selected from the driver image, wherein the hand-lip partial image includes an image of positions where the hand key points and the lip key points are located; Performing image recognition on the partial image of the hand and lip, and if a slender object is recognized, determining that abnormal driving behavior exists; The target human body key points include hand key points and ear key points, and the acquiring of the positional relationship between the target human body key points and the abnormal driving behavior detection includes: Determine the hand-ear distance between the hand key point and the ear key point according to the position information of the hand key point and the position information of the ear key point; If the hand-ear distance is less than the preset hand-ear distance, a hand-ear partial image is selected from the driver image, wherein the hand-ear partial image includes an image of the positions of the hand key points and the ear key points; Image recognition is performed on the partial images of the hand and ear, and if a mobile phone is recognized, it is determined that abnormal driving behavior exists.
2. The abnormal driving behavior detection method according to claim 1, characterized in that: Determination of abnormal driving behavior includes: Respectively obtaining a first pixel average value of an end of the slender object away from the lips and a second pixel average value of the local image of the hand and lips; If the first pixel average value is greater than the second pixel average value, it is determined that abnormal driving behavior exists.
3. The abnormal driving behavior detection method according to claim 1, characterized in that: Also includes: Obtain the position information of the current human body key points on the face and select the partial facial image; Identifying facial key points in the partial facial image and position information of the facial key points based on a facial key point model; Determine a deflection angle according to the position information of the facial key points, wherein the deflection angle includes at least one of a pitch angle, a roll angle, and a yaw angle; If the deflection angle is greater than a preset deflection angle threshold, it is determined that abnormal driving behavior exists.
4. The abnormal driving behavior detection method according to claim 3, characterized in that: The yaw angle is obtained by: i x =atan2(-r yz ,r zz ); The rolling angle is obtained by: The pitch angle is obtained by: i z =atan2(-r xy ,r xx ); Among them, θ x is the yaw angle, θ y is the roll angle, θ z is the pitch angle.
5. The abnormal driving behavior detection method according to any one of claims 1 to 4, characterized in that: The training method of the human body key point model includes: Obtaining M human key points in the human key point image, each of the human key points is converted into a maximum activation point in an N*N matrix through Gaussian distribution; Obtain a backbone network, and input the human body key point image into the backbone network to generate an output result; According to the maximum activation point and the output result, L2 loss is determined as a loss function, and the backbone network is trained.
6. An abnormal driving behavior detection device, characterized in that: include: An acquisition module, used for acquiring a driver image; A recognition module, used for recognizing the key points of the human body of the driver in the driver image and the position information of the key points of the human body based on the key point model of the human body; A detection module, for obtaining the positional relationship between the target human key points and performing abnormal driving behavior detection if the identified human key point set includes the target human key points, wherein the target human key points include the human key points of at least two preset parts; Wherein, the target human body key points include hand key points and lip key points, and the detection module is further used for: Determine the hand-lip distance between the hand key point and the lip key point according to the position information of the hand key point and the position information of the lip key point; If the hand-lip distance is less than the preset hand-lip distance, a hand-lip partial image is selected from the driver image, wherein the hand-lip partial image includes an image of positions where the hand key points and the lip key points are located; Performing image recognition on the partial image of the hand and lip, and if a slender object is recognized, determining that abnormal driving behavior exists; Wherein, the target human body key points include hand key points and ear key points, and the detection module is also used for: Determine the hand-ear distance between the hand key point and the ear key point according to the position information of the hand key point and the position information of the ear key point; If the hand-ear distance is less than the preset hand-ear distance, a hand-ear partial image is selected from the driver image, wherein the hand-ear partial image includes an image of the positions of the hand key points and the ear key points; Image recognition is performed on the partial images of the hand and ear, and if a mobile phone is recognized, it is determined that abnormal driving behavior exists.
7. A terminal, characterized in that: including a processor, a memory and a communication bus; The communication bus is used to connect the processor and the memory; The processor is used to execute the computer program stored in the memory to implement the abnormal driving behavior detection method according to any one of claims 1 to 5.
8. A computer-readable storage medium, characterized in that: A computer program is stored thereon, The computer program is used to enable the computer to execute the abnormal driving behavior detection method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Intelligent control method for vehicle driver fatigue driving
CN107697069A
Driving state monitoring method and device and electronic device
CN109803583A
Driver state monitoring method based on convolutional neural network
CN110837815A
Action recognition method and device and driver state analysis method and device
CN110956061A
Dangerous state identification method and device
CN111301280A
