A method and system for detecting driver's line of sight deviation
The method uses laser ranging probes and facial image analysis to accurately and efficiently detect driver's line of sight deviation, addressing the limitations of high computational demands and improving real-time detection for enhanced driving safety.
Patent Information
- Application Number
- CN202411218232.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-02
- Publication Date
- 2024-12-06
- Estimated Expiration
- 2044-09-02
AI Technical Summary
Existing methods for detecting driver's line of sight deviation require high computing power and result in poor real-time detection, leading to potential driving safety hazards.
A method using laser ranging probes on the vehicle roof to measure distances and determine head deviation scores, combined with facial image analysis to detect sight deviation, generating alarms when thresholds are exceeded.
Improves judgment accuracy and real-time detection of line of sight deviation, reducing computational complexity and enhancing driving safety by providing timely warnings.
Smart Images

Figure CN118762351B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of driving safety detection, and in particular to a method for detecting driver's line of sight deviation. Background Art
[0002] In the related art, CN103839055B discloses a method for detecting the driver's sight direction, which includes: determining the region of interest of each frame in the video image, and detecting the position of the driver's nose in the region of interest based on the haar feature; combining the position of the driver's nose detected in the current frame with the position of the driver's nose detected in the previous frame, calculating the motion information of the driver's nose; and judging the driver's sight direction based on the position of the driver's nose detected in the previous S frames and the corresponding motion information of the driver's nose; if the driver's nose is not detected, estimating the driver's sight direction based on the number of frames that are not detected and the historical sight direction. By adopting this solution, the driver's sight direction can be detected more accurately, avoiding the safety hazards caused by fatigue driving.
[0003] CN107818310B discloses a driver attention detection method based on line of sight, which includes five parts: 2D face key point detection, 3D face feature extraction, sunglasses detection, line of sight estimation and attention area detection; line of sight is the best way to express the driver's attention state, but when the driver wears sunglasses, line of sight estimation cannot be performed, so this solution detects whether the driver is wearing sunglasses through computer vision-related algorithms; in the scenario where the driver wears sunglasses, the driver's head direction is used instead of line of sight as the attention direction. This solution detects the driver's attention state through an automated monitoring system, which can effectively reduce distracted driving and thus reduce the occurrence of traffic accidents; it has good robustness for different lighting conditions and driver characteristics, and good real-time performance, and can issue reminders in time at dangerous moments.
[0004] During driving, the driver's line of sight may be deviated due to fatigue driving or distraction. According to relevant technologies, whether the driver's line of sight is deviated can be judged based on the collected images. However, relevant technologies usually detect the driver's line of sight through complex image algorithm models, which requires high computing power and a long calculation process. Therefore, the real-time detection is poor and it is difficult to generate alarm information in time, resulting in safety hazards during driving.
[0005] The information disclosed in the background technology section of this application is only intended to deepen the understanding of the general background technology of this application, and should not be regarded as an admission or any form of implication that the information constitutes the prior art already known to those skilled in the art. Summary of the invention
[0006] The present invention provides a method for detecting driver's line of sight deviation, which can solve the technical problems that related technologies have high requirements on computing power, poor real-time detection, and lead to potential driving safety hazards.
[0007] According to a first aspect of the present invention, a method for detecting a driver's line of sight deviation is provided, comprising:
[0008] After the driver takes his seat and starts the vehicle, a plurality of laser ranging probes arranged on the roof of the vehicle are used to measure first distances between a plurality of positions above the driver's head and the plurality of laser ranging probes, wherein the plurality of laser ranging probes are evenly arranged on the roof of the vehicle along a straight line, and the straight line is parallel to the center line of the driver's seat and is located directly above the center line of the driver's seat;
[0009] Determine a first target laser ranging probe according to first distances measured by a plurality of laser ranging probes, and determine a first reference distance measured by the first target laser ranging probe;
[0010] At multiple times after the vehicle is started, determining a driver's head deviation score according to a second distance measured by the laser ranging probe and the first reference distance;
[0011] generating a warning message when the driver's head deviation score is greater than or equal to a first score threshold;
[0012] When the driver's head deviation score is lower than the first score threshold, photographing the driver's facial image at multiple times by a camera arranged on a vehicle dashboard;
[0013] In the facial image, a first outline of the driver's eyes is identified, and within the range of the first outline, a first area where the cornea of the eye is located and a second area where the white of the eye is located are identified;
[0014] determining a driver's sight deviation score based on the first profile, the first area, and the second area;
[0015] In a case where the driver's sight deviation score is higher than or equal to a second score threshold, a warning message is generated.
[0016] According to a second aspect of the present invention, there is provided a driver sight deviation detection system, comprising:
[0017] a first distance measurement module, after the driver takes his seat and starts the vehicle, measuring first distances between multiple positions above the driver's head and the multiple laser ranging probes respectively through multiple laser ranging probes arranged on the roof of the vehicle, wherein the multiple laser ranging probes are evenly arranged on the roof of the vehicle along a straight line, and the straight line is parallel to the center line of the driver's seat and is located directly above the center line of the driver's seat;
[0018] A first target laser ranging probe and a first reference distance determination module, which determines the first target laser ranging probe according to the first distances measured by the plurality of laser ranging probes, and determines the first reference distance measured by the first target laser ranging probe;
[0019] a driver head deviation score determination module, which determines the driver head deviation score according to the second distance measured by the laser ranging probe and the first reference distance at multiple times after the vehicle is started;
[0020] an alarm information generating module, for generating an alarm message when the driver's head deviation score is higher than or equal to a first score threshold;
[0021] a driver's facial image acquisition module, which, when the driver's head deviation score is lower than the first score threshold, captures the driver's facial image at multiple times through a camera arranged on the vehicle dashboard;
[0022] A first contour, first area, and second area determination module, which identifies a first contour of the driver's eyes in the facial image, and identifies a first area where the cornea of the eye is located, and a second area where the white of the eye is located within the range of the first contour;
[0023] a driver sight deviation score determination module, which determines a driver sight deviation score according to the first contour, the first area, and the second area;
[0024] The warning information generating module generates a warning message when the driver's sight deviation score is higher than or equal to a second score threshold.
[0025] Technical effect: According to the present invention, multiple first distances can be measured by multiple laser ranging probes, and the first target laser ranging probe and the first reference distance can be determined. At multiple moments after starting the vehicle, the driver's head deviation score can be determined based on the second distance measured by the laser ranging probe and the first reference distance. When the driver's head deviation score is higher than or equal to the first scoring threshold, an alarm message is generated, so that the distance data can be used to determine whether the driver's head direction has deviated, while improving the judgment accuracy, reducing the computational complexity, improving the real-time nature of the judgment, and improving driving safety. Moreover, when the driver's head deviation score is lower than the first scoring threshold, the driver's sight deviation score is determined based on the first contour, the first area and the second area of the driver's facial image at multiple moments captured by the recognition camera, and when the driver's sight deviation score is higher than or equal to the second scoring threshold, an alarm message is generated. When the head is not deviated, the driver's sight deviation can be detected, and the area surrounded by the first contour, the first area and the second area can be used to determine whether the driver's sight has deviated. Without a complex image calculation model, accurate judgment can be implemented, the computational complexity can be reduced, the detection accuracy and real-time nature can be improved, and the hidden dangers of driving safety can be reduced. When determining the first reference distance, multiple laser rangefinders can be set on the roof of the vehicle and multiple first distances can be measured after the driver sits down and starts the vehicle. After sorting the first distances from small to large, multiple first reference distances and corresponding first target laser rangefinders are determined based on a preset number, and the first reference distance measured by the laser rangefinder located above the driver's head can be found, which can be used as the reference data for detecting the driver's line of sight deviation. When determining the driver's head deviation score, the similarity between the driver's head orientation and the driver's head orientation when sitting and looking forward can be determined by the first reference vector, the shift matrix and the second distance vector, and then the head deviation score at each moment can be obtained. When solving, the similarity difference caused by the forward and backward movement of the driver's body can be excluded, thereby improving the accuracy of the head deviation score. And based on the preset deviation threshold, the trend of the driver's head deviation and whether there is a continuous and large degree of head deviation can be determined, and then the driver's head deviation score can be obtained, so that the driver's head deviation score can accurately and objectively represent the driver's line of sight deviation caused by the head deviation. And in the case of driving safety hazards, an alarm message is generated to improve driving safety.When determining the driver's line of sight deviation score, the driver's facial images at multiple moments can be captured, and the first contour, the first area, and the second area can be determined. Then, when the vehicle starts to drive, the first reference contour, the first reference area, and the second reference area can be determined. By scaling the first scaled contours, the first comparison area, and the second comparison area of the left eye and the right eye obtained respectively, the weight of the similarity between the driver's cornea at each moment and the driver's cornea when the vehicle starts to drive, and the weight of the similarity between the driver's white of the eye and the driver's white of the eye when the vehicle starts to drive are determined, and then the line of sight deviation score at each moment is determined. Based on the preset deviation threshold, the trend of the driver's line of sight deviation and whether there is a continuous and large degree of line of sight deviation phenomenon are determined, and then the driver's line of sight deviation score is obtained, so that the driver's line of sight deviation score can accurately and objectively represent the driver's line of sight deviation. In addition, in the case of driving safety hazards, an alarm message is generated to improve driving safety.
[0026] It should be understood that the above general description and the following detailed description are exemplary and explanatory only and do not limit the present invention. Other features and aspects of the present invention will become more apparent from the following detailed description of exemplary embodiments with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, other embodiments can be obtained based on these drawings without creative work.
[0028] Figure 1 A schematic diagram of a process flow of a method for detecting a driver's sight deviation according to an embodiment of the present invention is exemplarily shown;
[0029] Figure 2 A schematic diagram of a driver's sight deviation detection system according to an embodiment of the present invention is exemplarily shown. DETAILED DESCRIPTION
[0030] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0031] The technical solution of the present invention is described in detail with specific embodiments below. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments.
[0032] Figure 1 A flowchart of a method for detecting a driver's line of sight deviation according to an embodiment of the present invention is exemplarily shown. The method comprises:
[0033] Step S101, after the driver takes his seat and starts the vehicle, a plurality of laser ranging probes arranged on the roof of the vehicle are used to measure first distances between a plurality of positions above the driver's head and the plurality of laser ranging probes, wherein the plurality of laser ranging probes are evenly arranged on the roof of the vehicle along a straight line, and the straight line is parallel to the center line of the driver's seat and is located directly above the center line of the driver's seat;
[0034] Step S102, determining a first target laser ranging probe according to first distances measured by a plurality of laser ranging probes, and determining a first reference distance measured by the first target laser ranging probe;
[0035] Step S103, determining the driver's head deviation score according to the second distance measured by the laser ranging probe and the first reference distance at multiple times after the vehicle is started;
[0036] Step S104, generating an alarm message when the driver's head deviation score is higher than or equal to a first score threshold;
[0037] Step S105, when the driver's head deviation score is lower than the first score threshold, photographing the driver's facial image at multiple times by a camera arranged on the vehicle dashboard;
[0038] Step S106, identifying a first outline of the driver's eyes in the facial image, and identifying a first area where the cornea of the eye is located and a second area where the white of the eye is located within the range of the first outline;
[0039] Step S107, determining a driver's sight deviation score according to the first contour, the first area, and the second area;
[0040] Step S108 : generating a warning message when the driver's sight deviation score is higher than or equal to a second score threshold.
[0041] According to the driver's sight deviation detection method of the embodiment of the present invention, multiple first distances can be measured by multiple laser ranging probes, and the first target laser ranging probe and the first reference distance can be determined. At multiple moments after starting the vehicle, the driver's head deviation score can be determined based on the second distance measured by the laser ranging probe and the first reference distance. When the driver's head deviation score is higher than or equal to the first scoring threshold, an alarm message is generated, so that the distance data can be used to determine whether the driver's head direction is deviated, while improving the judgment accuracy, reducing the computational complexity, improving the real-time nature of the judgment, and improving driving safety. Moreover, when the driver's head deviation score is lower than the first scoring threshold, the driver's sight deviation score is determined based on the first contour, the first area and the second area of the driver's facial image at multiple moments captured by the recognition camera, and when the driver's sight deviation score is higher than or equal to the second scoring threshold, an alarm message is generated. When the head is not deviated, the driver's sight deviation can be detected, and the area surrounded by the first contour, the first area and the second area can be used to determine whether the driver's sight is deviated. Without a complex image calculation model, accurate judgment can be implemented, the computational complexity is reduced, the detection accuracy and real-time nature are improved, and the hidden dangers of driving safety are reduced.
[0042] According to an embodiment of the present invention, in step S101, after the driver takes his seat and starts the vehicle, the first distances between the multiple positions on the top of the driver's head and the multiple laser ranging probes are measured by using the multiple laser ranging probes arranged on the roof of the vehicle, wherein the multiple laser ranging probes are evenly arranged on the roof of the vehicle along a straight line, and the straight line is parallel to the center line of the driver's seat and is located directly above the center line of the driver's seat. For example, a mounting frame for the laser ranging probe can be arranged on the roof of the vehicle, and the mounting frame is a linear mounting frame, which is parallel to the center line of the driver's seat, and a laser ranging probe is arranged at a certain distance (for example, 2 cm), and after the driver takes his seat and starts the vehicle, the distance between each laser probe and each position on the top of the driver's head is measured, that is, the first distance, which can be considered to be the distance measured when the driver sits upright on the driver's seat and looks forward.
[0043] According to an embodiment of the present invention, in step S102, a first target laser ranging probe is determined according to the first distances measured by a plurality of laser ranging probes, and a first reference distance measured by the first target laser ranging probe is determined, including: sorting the first distances measured by the plurality of laser ranging probes in ascending order, and determining the first N first distances in the sorted sequence as the first reference distance, wherein N is a preset number; and determining the laser ranging probe corresponding to the first reference distance as the first target laser ranging probe. The first distances measured by the respective laser ranging probes may be sorted in ascending order, and the first N first distances in the sequence may be determined as the first distances of the N positions closest to the roof of the vehicle, i.e., the distance between the top of the driver's head and the laser ranging probe measured by the laser ranging probe located above the driver's head, i.e., the first reference distance. The laser ranging probes corresponding to the N first distances are determined as the first target laser ranging probe, i.e., the laser ranging probe located above the driver's head.
[0044] In this way, multiple laser ranging probes can be set on the roof of the vehicle and multiple first distances can be measured after the driver sits down and starts the vehicle. After the first distances are sorted from small to large, multiple first reference distances and corresponding first target laser ranging probes are determined based on a preset number. The first reference distance measured by the laser ranging probe located above the driver's head can be found, which can be used as benchmark data for detecting the driver's line of sight deviation.
[0045] According to an embodiment of the present invention, in step S103, at multiple moments after starting the vehicle, the driver's head deviation score is determined according to the second distance measured by the laser ranging probe and the first reference distance, including: combining the first distances according to the serial number order of the laser ranging probes to obtain a first reference vector; setting the first distances other than the first reference distance in the first reference vector to 0 to obtain a first reference vector; sorting the second distances measured by multiple laser ranging probes in ascending order, and determining the first N second distances in the sorted sequence as second target distances, wherein N is a preset number; determining the laser ranging probe corresponding to the second target distance as the second target laser ranging probe; at the multiple moments, combining the second distances measured by the laser ranging probes according to the serial number order of the laser ranging probes to obtain second vectors at the multiple moments; setting the second distances other than the second target distance in the second vector to 0 to obtain a second distance vector; determining the driver's head deviation score according to the first reference vector and the second distance vectors at the multiple moments.
[0046] According to an embodiment of the present invention, after the driver starts the vehicle at multiple moments, the serial numbers of the laser rangefinders can be determined from front to back, and the first distances measured by the laser rangefinders can be combined in the order of the serial numbers of the laser rangefinders to obtain a first reference vector. For example, the first distance measured by the first laser rangefinder is the first component in the first reference vector, and the first distance measured by the second laser rangefinder is the second component in the first reference vector. In the first reference vector, the other first distances other than the first reference distance are set to 0, that is, only the first reference distance measured by the first target laser rangefinder above the driver's head is retained in the first reference vector, and the other components are set to 0 to obtain the first reference vector. Similar to determining the first reference vector, the second distances measured by the multiple laser rangefinders are sorted in order from small to large, and the first N second distances in the sequence are determined as the second target distances, which can represent the distance between the driver's head and the second target laser rangefinder at each moment after the vehicle is started. At each moment, the second distances are combined according to the serial number order of the laser ranging probes to obtain second vectors at multiple moments, and other components of the second vector except the second target distance are set to 0 to obtain a second distance vector.
[0047] According to an embodiment of the present invention, determining the driver's head deviation score according to the first reference vector and the second distance vectors at the plurality of moments includes: obtaining the head deviation score at the i-th moment according to formula (1): ,
[0048] (1)
[0049] is the first reference vector, is the second distance vector at the i-th moment, for The transposed vector of , T represents the transposed, is the shift matrix, where
[0050]
[0051] It means that when the number of steps s is the kth step, ,otherwise , s and k are positive integers less than or equal to n, n is the number of laser ranging probes, and i, s, k and n are all positive integers; the driver's head deviation score is determined according to the head deviation scores at multiple moments.
[0052] According to an embodiment of the present invention, the first reference vector is a vector composed of the first reference distance between the laser ranging probe on the roof and the top of the driver's head when the driver is sitting upright and looking forward. If the driver raises his head, lowers his head, turns his head, etc., that is, when the head moves such that the line of sight deviates from the front, the distance measured by each laser ranging probe will change. In the second distance vector, there will also be a difference between the second target distance measured by the laser ranging probe above the driver's head and the first reference distance.
[0053] According to an embodiment of the present invention, since the driver's head position may be different at different times after starting the vehicle, the first target laser ranging probe and the second target laser ranging probe may be different laser ranging probes. For example, the driver leans forward but still faces straight ahead. In this case, the driver does not make a head movement that causes the line of sight to deviate from the straight ahead, but the first target laser ranging probe and the second target laser ranging probe may be different, resulting in a difference between the first reference vector and the second distance vector. Therefore, when determining whether the driver's head is offset, the difference in the forward and backward movement of the driver's body can be excluded, and only the driver's head is judged to have raised, lowered, turned, and other movements. Therefore, in formula (1), It represents the cosine similarity between the first reference vector and the second distance vector after the s-th step shift at the ith moment. If the driver only moves forward and backward such as leaning forward, but the head does not deviate from the front, the first target laser ranging probe and the second target laser ranging probe are different. Therefore, the sequence number of the first reference distance in the first reference vector is different from the sequence number of the second target distance in the second distance vector. For example, if the sequence number of the first target laser probe is 2-6, the first reference distance is the 2-6th component in the first reference vector, and the remaining components are 0. If the sequence number of the second target laser probe is 1-5, the second target distance is the second distance vector. The 1st to 5th components of the quantity are equal, and the remaining components are 0. In this case, even if the values of the first reference distance and the second target distance are equal, the cosine similarity between the first reference vector and the second distance vector will be low. Therefore, the shift matrix can be used to shift the second distance vector. For each shift, the components in the second distance vector can be shifted backward by one position as a whole, and the last position in the original second distance vector is moved to the first position in the new second distance vector, that is, the first component in the second distance vector is moved to the second position, the second component is moved to the third position... the n-1th component is moved to the nth position, and the nth component is moved to the first position. After each shift, the cosine similarity between the first reference vector and the shifted second distance vector can be solved, and after shifting n-1 steps, n cosine similarities are obtained, that is, the cosine similarity corresponding to the 0th step shift, the cosine similarity corresponding to the 1st step shift... the cosine similarity corresponding to the n-1th step shift. Therefore, The maximum value of the above n cosine similarities can be expressed as the similarity between the driver's head orientation and the driver's head orientation when sitting upright and looking forward without considering the driver's body moving forward and backward. It can represent the deviation of the head direction at the i-th moment after the driver starts the vehicle. The above deviation can be used as the driver's head deviation score at the i-th moment after the driver starts the vehicle.
[0054] According to an embodiment of the present invention, determining the driver's head deviation score according to the head deviation scores at multiple moments includes: determining the driver's head deviation score according to formula (2): ,
[0055] (2)
[0056] in, is the head deviation score at the tth moment, m is the preset number, is the first preset deviation threshold, if ( ) is the conditional function, and t and m are both positive integers.
[0057] According to an embodiment of the present invention, in formula (2), m is a preset number, It can represent the average value of the driver's head deviation score at m moments before the i-th moment. In the outer conditional function, when the driver's head deviation score at the i-th moment is less than the average value of the driver's head deviation scores at m moments before the i-th moment, the value of the conditional function is 0. After the driver's head is deflected, the driver may find it in time and adjust it to the front. The driver's head deviation moves smaller and smaller. At this time, the driver's head deviation score is 0. On the contrary, when the driver's head deviation score at the i-th moment is greater than or equal to the average value of the driver's head deviation scores at m moments before the i-th moment, after the driver's head is deflected, the driver may not find it in time, resulting in the driver's head deviation remaining at a large degree or even increasing. In this case, the value of the outer conditional function is the value of the inner conditional function. In the inner conditional function, is the preset deviation threshold, It can represent the average value of the driver's head deviation score from the im-th moment to the i-th moment, a total of m+1 moments. When the average value is less than the first preset deviation threshold, the value of the conditional function is 0, that is, although the driver's head deviation is getting bigger and bigger, the average deviation degree in the time period between the m+1 moments is small, and the impact on driving is small. At this time, the driver's head deviation score is 0. On the contrary, when the average value is greater than or equal to the preset first deviation threshold, the value of the conditional function is 1, indicating that the driver failed to find the driver's head in time after the deviation, and the overall deviation degree of the driver's head is not only getting bigger and bigger, but also the average deviation degree in the time period between the m+1 moments is large, there is a hidden danger to driving safety, and the driver's head deviation score is 1 at this time.
[0058] According to an embodiment of the present invention, in step S104, when the driver's head deviation score is higher than or equal to the first scoring threshold, an alarm message is generated. When the driver's head deviation score is higher than or equal to the first scoring threshold, it means that the driver may have a serious and continuous head deviation due to fatigue driving and other reasons, and cannot observe the road conditions in time, which poses a driving safety hazard. An alarm message is immediately generated to remind the driver to correct or take a rest in time.
[0059] In this way, the first reference vector, the shift matrix and the second distance vector can be used to determine the similarity between the driver's head orientation and the head orientation when the driver is sitting upright and looking forward, and then the head deviation score at each moment can be obtained. When solving, the similarity difference caused by the forward and backward movement of the driver's body can be excluded, thereby improving the accuracy of the head deviation score. Based on the preset deviation threshold, the trend of the driver's head deviation and whether there is a continuous and large degree of head deviation can be determined, and then the driver's head deviation score can be obtained, so that the driver's head deviation score can accurately and objectively represent the driver's line of sight deviation caused by head deviation. In addition, in the case of driving safety hazards, an alarm message is generated to improve driving safety.
[0060] According to an embodiment of the present invention, in step S105, if the driver's head deviation score is lower than the first score threshold, it means that the driver's head has not been significantly deviated, and it can be further determined whether the driver's line of sight has deviated from the front, and the driver's facial image can be captured at multiple times by a camera arranged on the vehicle dashboard. The driver may have a situation where the head has not deviated but the line of sight has been continuously and seriously deviated, which may also lead to driving safety hazards. Therefore, the driver's facial image can be captured at multiple times by a camera arranged on the vehicle dashboard to further detect the driver's line of sight deviation.
[0061] According to an embodiment of the present invention, in step S106, in the facial image, the first contour of the driver's eyes is identified, and within the scope of the first contour, the first area where the cornea of the eye is located, and the second area where the white of the eye is located are identified. For example, the contour of the driver's eyes, that is, the first contour, can be identified by contour detection models such as Canny edge detection and Sobel operator. And within the scope of the first contour, the first area where the cornea of the eye is located, and the second area where the white of the eye is located are identified. The present invention does not limit the specific method for determining the first contour.
[0062] According to an embodiment of the present invention, in step S107, determining the driver's sight deviation score according to the first contour, the first area and the second area includes: when the vehicle starts to drive, taking a reference facial image of the driver through a camera; in the reference facial image, identifying a first reference contour of the driver's eyes, and within the range of the first reference contour, identifying a first reference area where the cornea of the eye is located, and a second reference area where the white of the eye is located; determining the driver's sight deviation score according to the first reference contour, the first contour, the first reference area, the first area, the second reference area and the second area. When the vehicle starts to drive, and the driver sits upright in the driver's seat and looks forward, the driver's facial image at this time is taken by the camera, that is, the reference facial image. Similar to determining the first contour, the first reference contour of the driver's eyes can be determined by contour detection models such as Canny edge detection and Sobel operator, and within the range of the first reference contour, the first reference area where the cornea of the eye is located, and the second reference area where the white of the eye is located are identified. The above-mentioned first reference contour, first reference area, and second reference area can be used as a benchmark for judging whether the driver's sight is deviated. The present invention does not limit the specific method for determining the first reference contour.
[0063] According to an embodiment of the present invention, a driver's line of sight deviation score is determined based on the first reference contour, the first contour, the first reference area, the first area, the second reference area and the second area, including: scaling the area surrounded by the first contour of the left eye in the facial image at the i-th moment to obtain the first scaled contour of the left eye, wherein the distance between the left and right ends of the area surrounded by the first scaled contour of the left eye is equal to the distance between the left and right ends of the area surrounded by the first reference contour of the left eye; intercepting the left eye reference image block where the area surrounded by the first reference contour of the left eye is located, wherein the width of the left eye reference image block is equal to the width of the left eye The left eye reference image block is a preset height; the left eye comparison image block where the area surrounded by the first scaled outline of the left eye is located is intercepted, wherein the width of the left eye comparison image block is equal to the distance between the left and right ends of the area surrounded by the first scaled outline of the left eye, and the height of the left eye comparison image block is a preset height; according to the first area, a first comparison area where the cornea of the eye is located in the left eye comparison image block is determined, and according to the second area, a second comparison area where the white of the eye is located in the left eye comparison image block is determined; the area surrounded by the first outline of the right eye in the facial image at the i-th moment is scaled , obtain a first scaled outline of the right eye, wherein the distance between the left and right ends of the area surrounded by the first scaled outline of the right eye is equal to the distance between the left and right ends of the area surrounded by the first reference outline of the right eye; intercept the right eye reference image block where the area surrounded by the first reference outline of the right eye is located, wherein the width of the right eye reference image block is equal to the distance between the left and right ends of the area surrounded by the first reference outline of the right eye, and the height of the right eye reference image block is a preset height; intercept the right eye comparison image block where the area surrounded by the first scaled outline of the right eye is located, wherein the width of the right eye comparison image block is equal to the distance between the left and right ends of the area surrounded by the first scaled outline of the right eye, and the right eye The height of the comparison image block is a preset height; based on the first area, the first comparison area where the cornea of the eye is located in the right eye comparison image block is determined, and based on the second area, the second comparison area where the white of the eye is located in the right eye comparison image block is determined; based on the first reference contour of the left eye, the first scaled contour of the left eye, the first reference area of the left eye, the first comparison area of the left eye, the second reference area of the left eye, the second comparison area of the left eye, the first reference contour of the right eye, the first scaled contour of the right eye, the first reference area of the right eye, the first comparison area of the right eye, the second reference area of the right eye and the second comparison area of the right eye, the driver's line of sight deviation score is determined.
[0064] According to an embodiment of the present invention, since the distance from the driver's eyes to the camera when capturing the driver's facial image at each moment is different, eye contours of different sizes will be obtained. Therefore, the area surrounded by the first contour of the left eye in the facial image at the i-th moment can be scaled, and the distance between the left and right ends of the area surrounded by the scaled first contour of the left eye is equal to the distance between the left and right ends of the area surrounded by the first reference contour of the left eye. The scaled first contour of the left eye is the first scaled contour, which can reduce the influence of the difference in the size of the first contour and the first reference contour on the judgment of whether the driver's sight is deviated. The left eye reference image block where the area surrounded by the first reference contour of the left eye is located is intercepted, that is, the image block of the first reference contour of the left eye. Since the width of the left eye reference image block is equal to the distance between the left and right ends of the area surrounded by the first reference contour of the left eye, when the left eye reference image block where the area surrounded by the first reference contour of the left eye is intercepted, the width of the corresponding area surrounded by the left eye contour will not be changed. The height of the left eye reference image block is a preset height. For example, the preset height can also be equal to the distance between the left and right ends of the area surrounded by the first reference contour, so that the left eye reference image block is a square image block. Similarly, the left eye comparison image block where the area surrounded by the first scaled contour of the left eye is located can be intercepted. According to the position of the first area in the first contour of the left eye, the area where the cornea of the eye is located in the left eye comparison image block is determined, that is, the first comparison area, and according to the position of the second area in the first contour of the left eye, the area where the white of the eye is located in the left eye comparison image block is determined, that is, the second comparison area. Similar to the left eye, the first scaled contour of the right eye can be obtained by scaling, and the right eye reference image block where the area surrounded by the first reference contour of the right eye is located and the right eye comparison image block where the area surrounded by the first scaled contour of the right eye is located can be intercepted, and then according to the first area, the first comparison area where the cornea of the eye is located in the right eye comparison image block is determined, and according to the second area, the second comparison area where the white of the eye is located in the right eye comparison image block is determined. The difference in the size of the first contour and the first reference contour area can be reduced, and the influence on judging whether the driver's line of sight is deviated can be reduced, and the comparison can be made more convenient.
[0065] According to an embodiment of the present invention, a driver's sight deviation score is determined based on the first reference contour of the left eye, the first scaled contour of the left eye, the first reference area of the left eye, the first comparison area of the left eye, the second reference area of the left eye, the second comparison area of the left eye, the first reference contour of the right eye, the first scaled contour of the right eye, the first reference area of the right eye, the first comparison area of the right eye, the second reference area of the right eye, and the second comparison area of the right eye, including: determining the sight deviation score at the i-th moment according to formula (3): ,
[0066] (3)
[0067] in, is the area enclosed by the first reference contour of the left eye, is the first scaled contour of the left eye corresponding to the facial image at the i-th moment, is the area enclosed by the first reference contour of the right eye, is the area enclosed by the first scaled outline of the right eye corresponding to the facial image at the i-th moment, is the first reference area for the left eye, is the first contrast area of the left eye corresponding to the facial image at the i-th moment, is the first reference area for the right eye, is the first contrast area of the right eye corresponding to the facial image at the i-th moment, is the second reference area for the left eye, is the second contrast area of the left eye corresponding to the facial image at the i-th moment, is the second reference area for the right eye, is the second contrast area of the right eye corresponding to the facial image at the i-th moment, is an area function; according to the sight deviation scores at multiple moments, the sight deviation score of the driver is determined.
[0068] According to an embodiment of the present invention, in formula (3), The ratio of the area of the intersection of the area enclosed by the first reference contour of the left eye and the first scaled contour of the left eye corresponding to the facial image at the ith moment to the area of the union can be used as the similarity between the left eye contour of the driver at the ith moment and the left eye contour of the driver when the vehicle starts to move. The larger the above ratio, the higher the similarity between the left eye contour of the driver at the ith moment and the left eye contour of the driver when the vehicle starts to move. Similarly, The similarity between the right eye contour of the driver at the i-th moment and the right eye contour of the driver when the vehicle starts to move can be expressed. The similarity between the left eye contour similarity and the right eye contour similarity can be averaged to obtain the similarity between the eye contour of the driver at the i-th moment and the eye contour of the driver when the vehicle starts to move.
[0069] According to an embodiment of the present invention, in formula (3), The ratio information representing the total area of the first reference area of the driver's eyes to the area of the area surrounded by the first reference contour of the eyes, that is, the ratio information of the area of the driver's cornea to the area of the eye contour when the vehicle starts to move. The larger the ratio information, the greater the proportion of the driver's cornea in judging the degree of the driver's line of sight deviation, and the greater the importance. Therefore, the above ratio information can be used as the weight of the similarity between the driver's cornea at the i-th moment and the driver's cornea when the vehicle starts to move. In formula (3), The ratio of the area of the intersection of the first reference area of the left eye and the first comparison area of the left eye corresponding to the facial image at the ith moment to the area of the union can be used as the similarity between the left cornea of the driver at the ith moment and the left cornea of the driver when the vehicle starts to drive. Similarly, It can be used as the similarity between the right cornea of the driver at the i-th moment and the right cornea of the driver when the vehicle starts to move. The similarity of the right cornea and the left cornea is averaged to obtain the similarity between the cornea of the driver at the i-th moment and the cornea of the driver when the vehicle starts to move. After the weighting, the weighted similarity between the cornea of the driver at the i-th moment and the cornea of the driver when the vehicle starts to move can be obtained.
[0070] According to an embodiment of the present invention, similar to determining the similarity between the cornea of the driver's eye at the ith moment and the cornea of the driver's eye when the vehicle starts to drive, the weight of the similarity between the white of the driver's eye at the ith moment and the white of the driver's eye when the vehicle starts to drive can be determined based on the ratio information of the total area of the second reference area of the driver's eyes to the area of the area surrounded by the first reference contour of the eyes. And the ratio of the area of the intersection of the second reference area of the right eye and the second contrast area of the right eye corresponding to the facial image at the ith moment to the area of the union is determined as the similarity between the white of the right eye of the driver at the ith moment and the white of the right eye of the driver when the vehicle starts to drive. Similarly, the similarity between the white of the left eye of the driver at the ith moment and the white of the left eye of the driver when the vehicle starts to drive can be determined. The similarity of the white of the eye of the two eyes is averaged to obtain the similarity between the white of the driver's eye at the ith moment and the white of the driver's eye when the vehicle starts to drive. After the above-mentioned weighting, the weighted similarity between the white of the driver's eye at the ith moment and the white of the driver's eye when the vehicle starts to drive can be obtained.
[0071] According to an embodiment of the present invention, It can represent the overall similarity of the contours of both eyes, and and Respectively represent the weighted similarity of the cornea and the white of the eye. Therefore, the overall similarity of the contour can be multiplied by the weighted sum of the weighted similarities of the two parts to obtain the overall similarity of all areas within the contour, which can be used to represent the image similarity between the driver's eyes at the i-th moment and the driver's eyes when the vehicle starts to move, and can also represent the similarity between the driver's sight at the i-th moment and the driver's sight when the vehicle starts to move. Therefore, 1 minus the above sight similarity can obtain the deviation of the driver's sight at the i-th moment, which can be used as the sight deviation score at the i-th moment.
[0072] According to an embodiment of the present invention, determining the driver's sight deviation score based on the sight deviation scores at multiple moments includes: (4) determining the driver's sight deviation score according to a formula ,
[0073] (4)
[0074] in, is the sight deviation score at the tth moment, m is the preset number, is the second preset deviation threshold, if ( ) is the conditional function, and t and m are both positive integers.
[0075] According to an embodiment of the present invention, similar to determining the driver's head deviation score, It can represent the average value of the driver's line of sight deviation scores at m moments before the i-th moment. In the outer conditional function, when the driver's line of sight deviation score at the i-th moment is less than the average value of the driver's line of sight deviation scores at m moments before the i-th moment, the value of the conditional function is 0. After the driver's line of sight deviates, the driver may discover it in time and adjust it to the front. The driver's line of sight deviation becomes smaller and smaller. At this time, the driver's line of sight deviation score is 0. On the contrary, when the driver's line of sight deviation score at the i-th moment is greater than or equal to the average value of the driver's line of sight deviation scores at m moments before the i-th moment, after the driver's line of sight deviates, the driver may not discover it in time, causing the driver's line of sight deviation to remain at a large degree or even become larger. In this case, the value of the outer conditional function is the value of the inner conditional function. In the inner conditional function, It can represent the average value of the driver's line of sight deviation scores from the im-th moment to the i-th moment, a total of m+1 moments. When the average value is less than the second preset deviation threshold, the value of the conditional function is 0, that is, although the driver's line of sight deviation is getting bigger and bigger, the average deviation degree in the time period between m+1 moments is small, and the impact on driving is small. At this time, the driver's line of sight deviation score is 0. On the contrary, when the average value is greater than or equal to the preset second deviation threshold, the value of the conditional function is 1, indicating that the driver's line of sight has deviated, and the driver failed to find it in time. The overall deviation degree of the driver's line of sight is not only getting bigger and bigger, but also the average deviation degree in the time period between m+1 moments is large, and there is a hidden danger to driving safety. At this time, the driver's line of sight deviation score is 1.
[0076] According to an embodiment of the present invention, in step S108, when the driver's line of sight deviation score is higher than or equal to the second score threshold, an alarm message is generated. When the driver's line of sight deviation score is higher than or equal to the second score threshold, it indicates that the driver may have serious and continuous line of sight deviation due to reasons such as fatigue driving, and there is a hidden danger to driving safety, and an alarm message is immediately generated to remind the driver to correct or take a rest in time.
[0077] In this way, facial images of the driver at multiple moments can be captured, and the first contour, the first area, and the second area can be determined. Then, when the vehicle starts to drive, the first reference contour, the first reference area, and the second reference area can be determined. By scaling the first scaled contours, the first comparison area, and the second comparison area of the left eye and the right eye respectively, the weight of the similarity between the driver's cornea at each moment and the driver's cornea when the vehicle starts to drive, and the weight of the similarity between the driver's white of the eye and the driver's white of the eye when the vehicle starts to drive can be determined, and then the sight deviation score at each moment can be determined. Based on the preset deviation threshold, the trend of the driver's sight deviation and whether there is a continuous and large degree of sight deviation phenomenon can be determined, and then the driver's sight deviation score can be obtained, so that the driver's sight deviation score can accurately and objectively represent the driver's sight deviation. In addition, in the case of driving safety hazards, an alarm message is generated to improve driving safety.
[0078] According to the driver's sight deviation detection method of the embodiment of the present invention, multiple first distances can be measured by multiple laser ranging probes, and the first target laser ranging probe and the first reference distance can be determined. At multiple moments after starting the vehicle, the driver's head deviation score can be determined based on the second distance measured by the laser ranging probe and the first reference distance. When the driver's head deviation score is higher than or equal to the first scoring threshold, an alarm message is generated, so that the distance data can be used to determine whether the driver's head direction is deviated, while improving the judgment accuracy, reducing the computational complexity, improving the real-time nature of the judgment, and improving driving safety. Moreover, when the driver's head deviation score is lower than the first scoring threshold, the driver's sight deviation score is determined based on the first contour, the first area and the second area of the driver's facial image at multiple moments captured by the recognition camera, and when the driver's sight deviation score is higher than or equal to the second scoring threshold, an alarm message is generated. When the head is not deviated, the driver's sight deviation can be detected, and the area surrounded by the first contour, the first area and the second area can be used to determine whether the driver's sight is deviated. Without a complex image calculation model, accurate judgment can be implemented, the computational complexity is reduced, the detection accuracy and real-time nature are improved, and the hidden dangers of driving safety are reduced. When determining the first reference distance, multiple laser rangefinders can be set on the roof of the vehicle and multiple first distances can be measured after the driver sits down and starts the vehicle. After sorting the first distances from small to large, multiple first reference distances and corresponding first target laser rangefinders are determined based on a preset number, and the first reference distance measured by the laser rangefinder located above the driver's head can be found, which can be used as the reference data for detecting the driver's line of sight deviation. When determining the driver's head deviation score, the similarity between the driver's head orientation and the driver's head orientation when sitting and looking forward can be determined by the first reference vector, the shift matrix and the second distance vector, and then the head deviation score at each moment can be obtained. When solving, the similarity difference caused by the forward and backward movement of the driver's body can be excluded, thereby improving the accuracy of the head deviation score. And based on the preset deviation threshold, the trend of the driver's head deviation and whether there is a continuous and large degree of head deviation can be determined, and then the driver's head deviation score can be obtained, so that the driver's head deviation score can accurately and objectively represent the driver's line of sight deviation caused by the head deviation. And in the case of driving safety hazards, an alarm message is generated to improve driving safety.When determining the driver's line of sight deviation score, the driver's facial images at multiple moments can be captured, and the first contour, the first area, and the second area can be determined. Then, when the vehicle starts to drive, the first reference contour, the first reference area, and the second reference area can be determined. By scaling the first scaled contours, the first comparison area, and the second comparison area of the left eye and the right eye obtained respectively, the weight of the similarity between the driver's cornea at each moment and the driver's cornea when the vehicle starts to drive, and the weight of the similarity between the driver's white of the eye and the driver's white of the eye when the vehicle starts to drive are determined, and then the line of sight deviation score at each moment is determined. Based on the preset deviation threshold, the trend of the driver's line of sight deviation and whether there is a continuous and large degree of line of sight deviation phenomenon are determined, and then the driver's line of sight deviation score is obtained, so that the driver's line of sight deviation score can accurately and objectively represent the driver's line of sight deviation. In addition, in the case of driving safety hazards, an alarm message is generated to improve driving safety.
[0079] Figure 2 A schematic diagram of a driver's sight deviation detection system according to an embodiment of the present invention is exemplarily shown, the system comprising:
[0080] a first distance measurement module, after the driver takes his seat and starts the vehicle, measuring first distances between multiple positions above the driver's head and the multiple laser ranging probes respectively through multiple laser ranging probes arranged on the roof of the vehicle, wherein the multiple laser ranging probes are evenly arranged on the roof of the vehicle along a straight line, and the straight line is parallel to the center line of the driver's seat and is located directly above the center line of the driver's seat;
[0081] A first target laser ranging probe and a first reference distance determination module, which determines the first target laser ranging probe according to the first distances measured by the plurality of laser ranging probes, and determines the first reference distance measured by the first target laser ranging probe;
[0082] a driver head deviation score determination module, which determines the driver head deviation score according to the second distance measured by the laser ranging probe and the first reference distance at multiple times after the vehicle is started;
[0083] an alarm information generating module, for generating an alarm message when the driver's head deviation score is higher than or equal to a first score threshold;
[0084] a driver's facial image acquisition module, which, when the driver's head deviation score is lower than the first score threshold, captures the driver's facial image at multiple times through a camera arranged on the vehicle dashboard;
[0085] A first contour, first area, and second area determination module, which identifies a first contour of the driver's eyes in the facial image, and identifies a first area where the cornea of the eye is located, and a second area where the white of the eye is located within the range of the first contour;
[0086] a driver sight deviation score determination module, which determines a driver sight deviation score according to the first contour, the first area, and the second area;
[0087] The warning information generating module generates a warning message when the driver's sight deviation score is higher than or equal to a second score threshold.
[0088] The present invention may be a method, an apparatus, a system and / or a computer program product. The computer program product may include a computer-readable storage medium carrying computer-readable program instructions for executing various aspects of the present invention.
[0089] It should be understood by those skilled in the art that the embodiments of the present invention described above and shown in the accompanying drawings are only examples and do not limit the present invention. The purpose of the present invention has been fully and effectively achieved. The functional and structural principles of the present invention have been demonstrated and explained in the embodiments, and the embodiments of the present invention may be deformed or modified in any way without departing from the principles.
[0090] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for detecting driver's line of sight deviation, characterized in that: include: After the driver takes his seat and starts the vehicle, a plurality of laser ranging probes arranged on the roof of the vehicle are used to measure first distances between a plurality of positions above the driver's head and the plurality of laser ranging probes, wherein the plurality of laser ranging probes are evenly arranged on the roof of the vehicle along a straight line, and the straight line is parallel to the center line of the driver's seat and is located directly above the center line of the driver's seat; Determine a first target laser ranging probe according to first distances measured by a plurality of laser ranging probes, and determine a first reference distance measured by the first target laser ranging probe; At multiple times after the vehicle is started, determining a driver's head deviation score according to a second distance measured by the laser ranging probe and the first reference distance; generating a warning message when the driver's head deviation score is greater than or equal to a first score threshold; When the driver's head deviation score is lower than the first score threshold, photographing the driver's facial image at multiple times by a camera arranged on a vehicle dashboard; In the facial image, a first outline of the driver's eyes is identified, and within the range of the first outline, a first area where the cornea of the eye is located and a second area where the white of the eye is located are identified; determining a driver's sight deviation score based on the first profile, the first area, and the second area; generating a warning message when the driver's sight deviation score is higher than or equal to a second score threshold; Determining a first target laser ranging probe according to first distances measured by a plurality of laser ranging probes, and determining a first reference distance measured by the first target laser ranging probe, comprises: Sorting the first distances measured by the plurality of laser distance measuring probes in ascending order, and determining the first N first distances in the sorted sequence as the first reference distance, wherein N is a preset number; Determine the laser ranging probe corresponding to the first reference distance as the first target laser ranging probe; At multiple times after the vehicle is started, according to the second distance measured by the laser ranging probe and the first reference distance, a driver's head deviation score is determined, including: Combining the first distances according to the serial number order of the laser ranging probes to obtain a first reference vector; Setting other first distances in the first reference vector except the first reference distance to 0 to obtain a first reference vector; Sorting the second distances measured by the plurality of laser ranging probes in ascending order, and determining the first N second distances in the sorted sequence as the second target distance, wherein N is a preset number; Determine the laser ranging probe corresponding to the second target distance as the second target laser ranging probe; At the multiple moments, the second distances measured by the laser ranging probes are combined according to the sequence of the laser ranging probes to obtain the second vectors at the multiple moments; Setting the other second distances in the second vector except the second target distance to 0 to obtain a second distance vector; A driver head deviation score is determined based on the first reference vector and the second distance vectors at the plurality of moments.
2. The method for detecting driver's line of sight deviation according to claim 1, characterized in that: Determining the driver's head deviation score according to the first reference vector and the second distance vectors at the plurality of moments includes: According to the formula ; Get the head deviation score at the i-th moment , is the first reference vector, for The transposed vector of , T represents the transposed, is the second distance vector at the i-th moment, is the shift matrix, are the n values obtained when s is equal to n integers in [0, n-1] respectively. The maximum value among the values of ; It means that when the step number s is the kth step, ,otherwise , s and k are positive integers less than or equal to n, n is the number of laser ranging probes, and i, s, k and n are all positive integers; the driver's head deviation score is determined according to the head deviation scores at multiple moments.
3. The method for detecting driver's sight deviation according to claim 2, characterized in that: The driver's head deviation score is determined based on the head deviation scores at multiple moments, including: According to the formula ; Determine the driver's head deviation score ,in, is the head deviation score at the tth moment, m is the preset number, is the first preset deviation threshold, if(*) is a conditional function, and t and m are both positive integers.
4. The method for detecting driver's sight deviation according to claim 1, characterized in that: Determining a driver's sight deviation score according to the first profile, the first area, and the second area includes: When the vehicle starts to move, a reference facial image of the driver is captured by a camera; In the reference facial image, a first reference contour of the driver's eyes is identified, and within the range of the first reference contour, a first reference region where the cornea of the eye is located and a second reference region where the white of the eye is located are identified; A driver's sight deviation score is determined based on the first reference profile, the first profile, the first reference area, the first area, the second reference area, and the second area.
5. The method for detecting driver's sight deviation according to claim 4, characterized in that: Determining a driver's sight deviation score according to the first reference profile, the first profile, the first reference area, the first area, the second reference area, and the second area includes: Scaling the area surrounded by the first outline of the left eye in the facial image at the i-th moment to obtain a first scaled outline of the left eye, wherein the distance between the left and right ends of the area surrounded by the first scaled outline of the left eye is equal to the distance between the left and right ends of the area surrounded by the first reference outline of the left eye; Cutting off a left-eye reference image block where the area surrounded by the first reference outline of the left eye is located, wherein the width of the left-eye reference image block is equal to the distance between the left and right ends of the area surrounded by the first reference outline of the left eye, and the height of the left-eye reference image block is a preset height; Cutting off the left eye comparison image block where the area surrounded by the first scaled outline of the left eye is located, wherein the width of the left eye comparison image block is equal to the distance between the left and right ends of the area surrounded by the first scaled outline of the left eye, and the height of the left eye comparison image block is a preset height; Determine a first contrast region where the cornea of the eye is located in the left eye contrast image block according to the first region, and determine a second contrast region where the white of the eye is located in the left eye contrast image block according to the second region; Scaling the area surrounded by the first outline of the right eye in the facial image at the i-th moment to obtain a first scaled outline of the right eye, wherein the distance between the left and right ends of the area surrounded by the first scaled outline of the right eye is equal to the distance between the left and right ends of the area surrounded by the first reference outline of the right eye; Cutting off a right-eye reference image block where the area surrounded by the first reference outline of the right eye is located, wherein the width of the right-eye reference image block is equal to the distance between the left and right ends of the area surrounded by the first reference outline of the right eye, and the height of the right-eye reference image block is a preset height; Cutting off a right eye comparison image block where the area surrounded by the first scaled outline of the right eye is located, wherein the width of the right eye comparison image block is equal to the distance between the left and right ends of the area surrounded by the first scaled outline of the right eye, and the height of the right eye comparison image block is a preset height; Determine a first contrast region where the cornea of the eye is located in the right eye contrast image block according to the first region, and determine a second contrast region where the white of the eye is located in the right eye contrast image block according to the second region; The driver's line of sight deviation score is determined based on the first reference contour of the left eye, the first scaled contour of the left eye, the first reference area of the left eye, the first contrast area of the left eye, the second reference area of the left eye, the second contrast area of the left eye, the first reference contour of the right eye, the first scaled contour of the right eye, the first reference area of the right eye, the first contrast area of the right eye, the second reference area of the right eye and the second contrast area of the right eye.
6. The method for detecting driver's sight deviation according to claim 5, characterized in that: Determining a driver's sight deviation score according to the first reference contour of the left eye, the first scaled contour of the left eye, the first reference area of the left eye, the first comparison area of the left eye, the second reference area of the left eye, the second comparison area of the left eye, the first reference contour of the right eye, the first scaled contour of the right eye, the first reference area of the right eye, the first comparison area of the right eye, the second reference area of the right eye, and the second comparison area of the right eye, including: According to the formula ; Determine the sight deviation score at the i-th moment ,in, is the area enclosed by the first reference contour of the left eye, is the first scaled contour of the left eye corresponding to the facial image at the i-th moment, is the area enclosed by the first reference contour of the right eye, is the area enclosed by the first scaled outline of the right eye corresponding to the facial image at the i-th moment, is the first reference area for the left eye, is the first contrast area of the left eye corresponding to the facial image at the i-th moment, is the first reference area for the right eye, is the first contrast area of the right eye corresponding to the facial image at the i-th moment, is the second reference area for the left eye, is the second contrast area of the left eye corresponding to the facial image at the i-th moment, is the second reference area for the right eye, is the second contrast area of the right eye corresponding to the facial image at the i-th moment, is the area function; The driver's gaze deviation score is determined according to the gaze deviation scores at multiple moments.
7. The method for detecting driver's sight deviation according to claim 6, characterized in that: The driver's gaze deviation score is determined based on the gaze deviation scores at multiple moments, including: According to the formula ; Determine the driver's sight deviation score ,in, is the sight deviation score at the tth moment, m is the preset number, is the second preset deviation threshold, if(*) is a conditional function, and t and m are both positive integers.
8. A driver sight deviation detection system for executing the method according to any one of claims 1 to 7, characterized in that: include: a first distance measurement module, after the driver takes his seat and starts the vehicle, measuring first distances between multiple positions above the driver's head and the multiple laser ranging probes respectively through multiple laser ranging probes arranged on the roof of the vehicle, wherein the multiple laser ranging probes are evenly arranged on the roof of the vehicle along a straight line, and the straight line is parallel to the center line of the driver's seat and is located directly above the center line of the driver's seat; A first target laser ranging probe and a first reference distance determination module, which determines the first target laser ranging probe according to the first distances measured by the plurality of laser ranging probes, and determines the first reference distance measured by the first target laser ranging probe; a driver head deviation score determination module, which determines the driver head deviation score according to the second distance measured by the laser ranging probe and the first reference distance at multiple times after the vehicle is started; an alarm information generating module, for generating an alarm message when the driver's head deviation score is higher than or equal to a first score threshold; a driver's facial image acquisition module, which, when the driver's head deviation score is lower than the first score threshold, captures the driver's facial image at multiple times through a camera arranged on the vehicle dashboard; A first contour, first area, and second area determination module, which identifies a first contour of the driver's eyes in the facial image, and identifies a first area where the cornea of the eye is located, and a second area where the white of the eye is located within the range of the first contour; a driver sight deviation score determination module, which determines a driver sight deviation score according to the first contour, the first area, and the second area; The warning information generating module generates a warning message when the driver's sight deviation score is higher than or equal to a second score threshold.
