A sleep recognition method, device, electronic equipment and medium in a car cabin
By analyzing the target image of the car cabin, combining eye confidence and body posture, and using the head-to-body length ratio and the inclination of the human body trunk, the problem of low accuracy and misjudgment of sleep recognition in the car cabin in the existing technology is solved, and the problem is achieved Higher sleep recognition accuracy.
Patent Information
- Application Number
- CN202410931779.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-12
- Publication Date
- 2024-10-11
- Estimated Expiration
- 2044-07-12
AI Technical Summary
The accuracy of the sleep identification method in the car cabin in the existing technology is low, especially when the passenger is lying or reclining, it is impossible to accurately determine the sleep state of the passenger, and there is a phenomenon of misjudgment.
By acquiring the target image of the car cockpit, using the eye confidence judgment results and body posture, combined with the head-to-body length ratio and the inclination of the human body trunk, multiple methods are used to determine whether the passenger is sleeping, improving the accuracy of sleep recognition and preventing false detections. .
It improves the accuracy and precision of sleep recognition in the car cabin, reduces misjudgments, is suitable for different seating areas and models, and enhances the ability to judge the sleep status of lying or reclining passengers.
Smart Images

Figure CN118470695B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of vehicle services, and more specifically, to a method, device, electronic equipment and medium for identifying sleep in a vehicle cabin. Background Art
[0002] With the continuous development of the automotive industry, the application scenarios of vehicles are increasing, and people's requirements for vehicle services are also getting higher and higher. Passengers may sleep inside the vehicle while the car is driving or in leisure scenarios when not driving. This requires the vehicle to be able to identify the sleeping state of the passengers and adjust the in-vehicle environment accordingly to promote the passengers' rest and sleep quality.
[0003] The existing sleep recognition technology determines whether the passenger is in a sleeping state by analyzing the passenger's movements and behavior patterns. The passenger's sleeping behavior is usually judged based on the head posture. The result of sleep recognition is affected by the Euler angle solution of the head posture and the height and position of the passenger, which may lead to misjudgment. There is no better sleep judgment solution for the situation where the passenger is lying down / reclining with no eyes visible. Summary of the invention
[0004] In view of this, the purpose of the present application is to provide a method, device, electronic device and medium for identifying sleep in a car cabin, which can improve the sleep identification accuracy of sleeping passengers in the car cabin.
[0005] An embodiment of the present application provides a method for identifying sleep in a car cabin, the method comprising:
[0006] Acquire a target image of a car cabin; the target image includes passengers;
[0007] Based on the eye confidence judgment result of the passenger in the target image, a sleep state recognition method matching the eye confidence judgment result is used to determine whether the passenger is in a sleep state; the eye confidence judgment result indicates whether the eye is reliable for sleep recognition;
[0008] If yes, determining a verification result for the sleeping state of the passenger based on the detection result for the target behavior of the passenger in the target image;
[0009] Based on the verification result for the sleeping state, a sleeping state recognition result of a passenger in the vehicle cabin is determined.
[0010] In some embodiments, in the method for identifying sleep in a car cabin, the method of using a sleep state identification method that matches the eye confidence judgment result to determine whether the passenger is in a sleep state includes:
[0011] When the eye confidence judgment result of the passenger in the target image is qualified, determining whether the passenger is in a sleeping state based on the eye state of the passenger in the target image;
[0012] When the eye confidence judgment result of the passenger in the target image is unqualified, it is determined whether the passenger is in a sleeping state based on the body posture of the passenger in the target image.
[0013] In some embodiments, in the method for identifying sleep in a car cabin, determining whether the passenger is in a sleeping state based on the eye state of the passenger in the target image includes:
[0014] Based on the eye state of the passenger in the target image, determining the cumulative duration of the closed-eye image in which the eye state is closed within a preset first time period;
[0015] Determining whether the accumulated duration of the eye-closing image meets the preset eye-closing duration requirement;
[0016] If so, it is determined that the passenger is in a sleeping state.
[0017] In some embodiments, in the method for identifying sleep in a car cabin, determining whether the passenger is in a sleeping state based on the body posture of the passenger in the target image includes:
[0018] Identifying target human skeleton points of passengers in the target image;
[0019] Based on the target human skeleton points of the passenger, determining the head-to-torso length ratio and the human trunk inclination of the passenger; the head-to-torso length ratio represents the length ratio of the passenger's head and torso in the target image; the human trunk inclination represents the inclination of the passenger's human trunk in the target image along the horizontal direction of the image;
[0020] Based on the head-to-torso length ratio and the inclination of the human trunk, it is determined whether the passenger is in a sleeping state.
[0021] In some embodiments, in the method for identifying sleep in a car cabin, determining whether the passenger is in a sleeping state based on the head-to-torso length ratio and the inclination of the human trunk includes:
[0022] Based on the target human skeleton points of the passenger, determine the passenger's seat area in the cockpit; wherein different seat areas correspond to different head-to-body length ratio conditions and human trunk inclination conditions;
[0023] Determine whether the passenger's head-to-body length ratio meets the head-to-body length ratio condition corresponding to the seat area, and whether the passenger's trunk inclination meets the trunk inclination condition corresponding to the seat area;
[0024] If both are yes, it is determined that the passenger is in a sleeping state.
[0025] In some embodiments, in the in-car sleep recognition method, different seating areas correspond to different head-to-torso length ratio conditions and human trunk inclination conditions, which are determined based on images of passengers lying down or with their trunks tilted in different car models.
[0026] In some embodiments, in the method for identifying sleep in a car cabin, different seating areas correspond to different human trunk inclination conditions, including:
[0027] The trunk inclination conditions corresponding to the first row right passenger are: the trunk tilts to the left;
[0028] The trunk inclination conditions corresponding to the left passenger in the first row are: the trunk tilts to the right;
[0029] The trunk inclination condition corresponding to the second row passengers is: the trunk inclination is within the preset threshold range.
[0030] In some embodiments, in the above-mentioned method for identifying sleep in a car cabin, the human trunk inclination condition corresponding to the right passenger in the first row is: the tangent value of the human trunk inclination is less than 0;
[0031] The human trunk inclination condition corresponding to the left passenger in the first row is: the tangent value of the human trunk inclination is greater than 0;
[0032] The trunk inclination condition corresponding to the second row passengers is: the tangent value of the trunk inclination is greater than a preset first threshold and less than a preset second threshold.
[0033] In some embodiments, in the method for identifying sleep in a car cabin, before determining whether the passenger is in a sleeping state based on the eye confidence judgment result of the passenger in the target image and using a sleep state recognition method that matches the eye confidence judgment result, the method further includes:
[0034] The eye confidence judgment result is determined based on the angle between the face orientation and the camera imaging direction; the smaller the angle between the face orientation and the camera imaging direction, the higher the confidence of the eyes for sleep recognition; the larger the angle between the face orientation and the camera imaging direction, the lower the confidence of the eyes for sleep recognition.
[0035] In some embodiments, in the method for identifying sleep in a car cabin, determining the eye confidence judgment result based on the angle between the facial orientation and the camera imaging direction includes:
[0036] Determine an angle parameter corresponding to the angle between the face orientation and the camera imaging direction;
[0037] When the angle parameter meets the preset confidence condition, determining that the eye confidence judgment result is qualified;
[0038] Otherwise, the eye confidence judgment result is determined to be unqualified.
[0039] In some embodiments, in the method for identifying sleep in a car cabin, determining an angle parameter corresponding to the angle between the face orientation and the camera orientation includes:
[0040] Define the coordinates of the origin of the camera coordinate system in the head coordinate system;
[0041] Calculating a first angle between a line between the origin of the camera coordinate system and the origin of the head coordinate system and the z-axis of the head coordinate system, and determining an angle parameter corresponding to the first angle; the angle parameter corresponding to the first angle is used for eye confidence judgment;
[0042] At the same time, calculate the second angle between the projection of the line between the origin of the camera coordinate system and the origin of the head coordinate system on the xOy plane of the head coordinate system and the x-axis of the head coordinate system, and determine the angle parameter corresponding to the second angle.
[0043] In some embodiments, in the method for identifying sleep in a car cabin, determining a verification result for the sleep state based on a detection result of a target behavior of a passenger in the target image includes:
[0044] Determine a detection result of a target part movement and / or a detection result of a target object use by the passenger in the target image within a preset second time period;
[0045] Determining whether the target part motion detection result and / or the target object detection result meet the corresponding sleep suppression condition;
[0046] If any one of them is met, it is determined that the verification result for the sleep state is sleep inhibition.
[0047] In some embodiments, in the method for identifying sleep in a car cabin, determining the motion detection result of the passenger in the target image at the target part within the preset second time period includes:
[0048] Determining a rotation angle parameter of a passenger's face in the target image within a preset second time period; the rotation angle parameter represents a rotation angle of the face;
[0049] The moving distance of the passenger's arm in the target image within a preset second time period is determined.
[0050] In some embodiments, in the method for identifying sleep in a car cabin, the step of determining whether the motion detection result of the target part meets the corresponding sleep suppression condition includes:
[0051] Determining whether the rotation angle parameter of the face is greater than a preset third threshold;
[0052] Determine whether the moving distance of the passenger's arm is greater than a preset fourth threshold; wherein the preset fourth thresholds corresponding to different vehicle models and different seat areas are different.
[0053] In some embodiments, in the method for identifying sleep in a car cabin, determining whether the detection result of the target object meets the corresponding sleep suppression condition includes:
[0054] Detect whether there is a target object in the image;
[0055] If yes, judging whether the target object is in a handheld state based on the contact relationship between the target object and the hand and the contact relationship between the target object and a preset reference object;
[0056] If so, the test result is determined to be sleep inhibition.
[0057] In some embodiments, in the method for identifying sleep in a car cabin, determining the sleep state identification result of the passenger in the car cabin based on the verification result for the sleep state includes:
[0058] When the verification result is sleep suppression, the sleep state recognition result of the passenger is updated to a non-sleeping state;
[0059] When the verification result is non-suppressed sleep, the sleep state identification result of the passenger is maintained as the sleep state.
[0060] In some embodiments, in the method for identifying sleep in a car cabin, the sleep state identification result of the passenger in the car cabin is used to adjust the state of at least one device in the car cabin according to a preset sleep scene.
[0061] In some embodiments, a sleep recognition device in a car cabin is also provided, the device comprising:
[0062] An acquisition module, used to acquire a target image of a vehicle cabin; the target image includes passengers;
[0063] A judgment module, for determining whether the passenger is in a sleeping state based on an eye confidence judgment result of the passenger in the target image and using a sleep state recognition method that matches the eye confidence judgment result; the eye confidence judgment result indicates whether the eye is reliable for sleep recognition;
[0064] A first determination module is used to determine a verification result of the sleeping state of the passenger based on the state of the target object in the target image when it is determined that the passenger is in the sleeping state;
[0065] The second determination module is used to determine the sleep state recognition result of the passenger in the car cabin based on the verification result for the sleep state.
[0066] In some embodiments, an electronic device is also provided, including: a processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor and the memory communicate through the bus, and when the machine-readable instructions are executed by the processor, the steps of the method for identifying sleep in a car cabin are performed.
[0067] In some embodiments, a computer-readable storage medium is also provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of the method for identifying sleep in a car cabin are executed.
[0068] In an embodiment of the present application, a method, device, electronic device and medium for identifying sleep in a car cabin are provided. The method for identifying sleep in a car cabin first acquires a target image of a car cabin, and then uses different sleep state identification methods to determine whether the passenger is in a sleeping state based on whether the eyes of the passenger in the target image are reliable for sleep identification; then, the sleep state detection result is suppressed according to the detection result of the target behavior of the passenger in the image, thereby increasing the judgment range of sleep identification by using different detection methods, improving the detection accuracy of sleep identification, and further preventing false detection of the sleep state by the detection result based on the target behavior of the passenger, thereby further improving the detection accuracy of sleep identification. BRIEF DESCRIPTION OF THE DRAWINGS
[0069] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0070] Figure 1 A flow chart of a method for identifying sleep in a car cabin according to an embodiment of the present application is shown;
[0071] Figure 2 A schematic diagram of the head coordinate system and the camera coordinate system described in an embodiment of the present application is shown;
[0072] Figure 3 A flow chart of a method for determining whether the passenger is in a sleeping state according to an embodiment of the present application is shown;
[0073] Figure 4A flow chart of a method for determining whether a passenger is in a sleeping state based on the body posture of the passenger in the target image according to an embodiment of the present application is shown;
[0074] Figure 5 The recognition result of human skeleton points in the target image described in the embodiment of the present application is shown;
[0075] Figure 6 shows the recognition result of human skeleton points in another target image described in an embodiment of the present application;
[0076] Figure 7 shows the recognition result of human skeleton points in another target image described in an embodiment of the present application;
[0077] Figure 8 shows the recognition result of human skeleton points in another target image described in an embodiment of the present application;
[0078] Fig. 9 A schematic diagram of the structure of the sleep recognition device in a car cabin according to an embodiment of the present application is shown;
[0079] Fig.10 A schematic structural diagram of an electronic device described in an embodiment of the present application is shown. DETAILED DESCRIPTION
[0080] To make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the technical scheme in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. It should be understood that the drawings in the present application only serve the purpose of explanation and description and are not used to limit the scope of protection of the present application. In addition, it should be understood that the schematic drawings are not drawn in real proportion. The flowchart used in this application shows the operations implemented according to some embodiments of the present application. It should be understood that the operations of the flowchart can be implemented out of sequence, and the steps without logical context can be reversed in order or implemented simultaneously. In addition, those skilled in the art can add one or more other operations to the flowchart under the guidance of the content of the present application, or remove one or more operations from the flowchart.
[0081] In addition, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. The components of the embodiments of the present application described and shown in the drawings here can be arranged and designed in various configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present application.
[0082] It should be noted that the term "comprising" will be used in the embodiments of the present application to indicate the existence of the features declared thereafter, but does not exclude the addition of other features.
[0083] The sleep recognition in the prior art determines whether the passenger is in a sleeping state by analyzing the passenger's movements and behavior patterns. The passenger's sleep behavior is usually judged based on the head posture, and the recognition accuracy is low. There is no better sleep judgment scheme for the situation where the eyes cannot be seen when lying down / reclining. Specifically, the prior art usually uses Euler angles to represent the passenger's sleep behavior when using head posture to judge the passenger's sleep behavior. First, it is judged whether the passenger's head is leaning on the shoulder by judging whether the head roll angle and yaw angle are within a certain range, and whether the passenger's head is lowered by judging whether the head pitch angle is within a certain range; but when only Euler angles are used for judgment, there may be multiple different Euler angle solutions for a specific spatial direction, which affects the accuracy of sleep recognition; at the same time, due to the inconsistent positions of passengers in the cabin, it is impossible to use only one configuration to adapt to passengers of different heights and distances, which leads to errors in sleep recognition; it is particularly important to note that for the situation where the eyes cannot be seen when lying down / reclining, there is no better sleep judgment scheme because the open and closed state of the eyes cannot be accurately identified.
[0084] In addition to sleep recognition based on the above-mentioned behavioral recognition, sleep recognition can also be performed based on physiological signal detection; physiological signal detection is a method of identifying the sleeping state of passengers by monitoring human physiological parameters, including heartbeat, breathing, muscles, sounds, etc., which usually need to be combined with sensors and equipment in the vehicle. These devices may need to be installed and fixed in the vehicle, which increases cost and complexity, and physiological signals are usually weak and easily interfered by various noises, affecting the accuracy of sleep recognition. There may be large differences in physiological signals between different people, such as heart rate, breathing rate, etc. Such individual differences may affect the accuracy of physiological signal monitoring.
[0085] Based on this, in an embodiment of the present application, a method, device, electronic device and medium for identifying sleep in a car cabin are provided. The method for identifying sleep in a car cabin first acquires a target image of a car cabin, and then uses different sleep state identification methods to determine whether the passenger is in a sleeping state based on whether the eyes of the passenger in the target image are reliable for sleep identification; then, the sleep state detection result is suppressed according to the detection result of the target behavior of the passenger in the image, thereby increasing the judgment range of sleep identification by using different detection methods, improving the detection accuracy of sleep identification, and further preventing false detection of the sleep state by the detection result based on the target behavior of the passenger, thereby further improving the detection accuracy of sleep identification.
[0086] Please refer to Figure 1 , Figure 1 A flow chart of the method for identifying sleep in a car cabin according to an embodiment of the present application is shown; Figure 1 As shown, the method for identifying sleep in a car cabin includes the following steps S101-S104:
[0087] S101, acquiring a target image of a car cabin; the target image includes passengers;
[0088] S102, based on the eye confidence judgment result of the passenger in the target image, using a sleep state recognition method that matches the eye confidence judgment result to determine whether the passenger is in a sleep state; the eye confidence judgment result indicates whether the eye is reliable for sleep recognition;
[0089] S103: If yes, determining a verification result of the sleeping state of the passenger based on the detection result of the target behavior of the passenger in the target image;
[0090] S104: Based on the verification result for the sleep state, determine the sleep state recognition result of the passenger in the vehicle cabin.
[0091] In step S101, a target image of a car cabin is acquired; the target image includes passengers.
[0092] The target image of the car cabin is an image captured by the on-board camera in the car cabin. Different models of cars may install the on-board camera in different positions. Usually, the on-board camera is located in the middle of the head of the car cabin (above the middle of the front windshield). Installing the camera above the middle of the front windshield can ensure that the camera has a wider field of view, so that more areas in the car can be captured, thereby providing a more comprehensive image of the car, and ensuring that the front face image of each passenger is captured as much as possible.
[0093] The target image includes passengers. It should be noted that the passengers here include passengers in each seat, that is, drivers and non-drivers.
[0094] When a car is in driving state, the driver is usually unlikely to be in a sleeping state, especially lying flat or reclining. However, he may be in a state of fatigue driving and fall asleep. Therefore, the in-cabin sleep recognition method described in the embodiment of the present application still needs to be applicable to the driver.
[0095] When the car is not driving, that is, in a leisure state, passengers in each seat (including the driver's seat) may be in a lying or reclining sleeping state.
[0096] Since the vehicle-mounted camera usually captures the vehicle-mounted video, the target image, that is, the image frame in the video inside the car cabin captured by the vehicle-mounted camera, can also be called the vehicle-mounted video image.
[0097] The target image may be a partial image frame in the vehicle-mounted video.
[0098] Exemplarily, in some embodiments, the target image is an image frame in the vehicle-mounted video that meets a preset image quality condition; that is, only those frames that meet a specific image quality standard will be selected as the target image.
[0099] The preset image quality condition may be that the clarity is greater than a preset clarity threshold, the image brightness is greater than a preset brightness threshold, the noise is lower than a preset noise threshold, and the like.
[0100] Exemplarily, in some embodiments, the target image is an image frame extracted from the vehicle-mounted video according to a preset frame interval; for example, the frame rate of the vehicle-mounted camera may be 30fps or 60fps, and the computing resources required to process dozens of images in one second are relatively large, resulting in reduced real-time performance of sleep recognition. Therefore, some intermittent image frames can be used for sleep recognition. For example, if the preset frame interval is 5 frames, then one out of every 5 image frames will be extracted as the target image, and 6 frames will be extracted as the target image in one second.
[0101] In some embodiments, the target image may be an image frame in the vehicle video that meets a preset image quality condition and the target image may be an image frame extracted from the vehicle video at intervals of a preset number of frames.
[0102] Specifically, first, each image frame in the vehicle video is analyzed in real time to determine whether it meets the preset image quality conditions. For image frames that meet the preset image quality conditions, they are extracted according to the preset frame number interval, and the final target image meets the image quality requirements and follows the preset frame number interval. This combination strategy can ensure that high-quality and representative vehicle video image frames are obtained under limited resources, providing strong support for subsequent applications.
[0103] In some embodiments, when the vehicle control system is configured in an automatic sleep recognition mode, sleep recognition is automatically performed when a target image of a vehicle cabin is acquired.
[0104] That is to say, the automatic sleep recognition mode of the vehicle control system can be turned on or off.
[0105] In step S102, based on the eye confidence judgment result of the passenger in the target image, a sleep state recognition method matching the eye confidence judgment result is used to determine whether the passenger is in a sleeping state; the eye confidence judgment result indicates whether the eye is reliable for sleep recognition.
[0106] It is determined whether the eye confidence of the passenger in the target image meets a preset confidence condition. If so, the eye confidence determination result is determined to be qualified; if not, the eye confidence determination result is determined to be unqualified.
[0107] The eye confidence is determined based on the angle between the face orientation and the camera imaging direction; the smaller the angle between the face orientation and the camera imaging direction, the higher the confidence of the eyes for sleep recognition; the larger the angle between the face orientation and the camera imaging direction, the lower the confidence of the eyes for sleep recognition.
[0108] The angle between the facial orientation and the camera imaging direction refers to the angle in three-dimensional space; for example, the camera shoots from the side of the passenger's face, or from the top of the passenger's head, and the passenger's eyes are basically invisible in the image. In this case, it is unreliable to use the eyes for sleep recognition.
[0109] When there are multiple passengers in the target image, it is necessary to determine whether the passenger is in a sleeping state based on the eye confidence judgment result of each passenger and using a sleep state recognition method that matches the eye confidence judgment result.
[0110] That is to say, for multiple passengers in the target image, not all of them use the same sleep state recognition method; different passengers have different eye confidence judgment results, and their corresponding sleep state recognition methods are different.
[0111] Exemplarily, there are passengers A and B in the target image, passenger A is shown with a front face, and passenger B is shown with a side face, then different sleep state recognition methods are used for passengers A and B to determine whether they are in a sleep state.
[0112] Based on this, in the method for identifying sleep in a car cabin described in an embodiment of the present application, before determining whether the passenger is in a sleeping state based on the eye confidence judgment result of the passenger in the target image and using a sleep state recognition method that matches the eye confidence judgment result, the method further includes:
[0113] The eye confidence judgment result is determined based on the angle between the face orientation and the camera imaging direction; the smaller the angle between the face orientation and the camera imaging direction, the higher the confidence of the eyes for sleep recognition; the larger the angle between the face orientation and the camera imaging direction, the lower the confidence of the eyes for sleep recognition.
[0114] Specifically, based on the angle between the facial orientation and the camera imaging direction, the eye confidence judgment result is determined; including:
[0115] Determine an angle parameter corresponding to the angle between the face orientation and the camera imaging direction;
[0116] When the angle parameter meets the preset confidence condition, determining that the eye confidence judgment result is qualified;
[0117] Otherwise, the eye confidence judgment result is determined to be unqualified.
[0118] The facial orientation is the facial orientation, which is determined based on the head posture; and the angle between the facial orientation and the camera imaging direction is also related to the passenger's head position.
[0119] When detecting the passenger's head position and posture, the head position can be expressed as the coordinates of the head relative to the camera, and the head posture can be expressed as the rotation relationship of the head coordinate system relative to the camera coordinate system. Please refer to Figure 2 , Figure 2 A schematic diagram of the head coordinate system and the camera coordinate system described in an embodiment of the present application is shown.
[0120] In the embodiment of the present application, when defining the head posture of the passenger, two angle parameters of the angle between the facial orientation and the camera imaging direction are used for definition.
[0121] Specifically, in the method for identifying sleep in a car cabin described in the embodiment of the present application, determining the angle parameter corresponding to the angle between the face orientation and the camera orientation includes:
[0122] Define the coordinates of the origin of the camera coordinate system in the head coordinate system;
[0123] Calculating a first angle between a line between the origin of the camera coordinate system and the origin of the head coordinate system and the z-axis of the head coordinate system, and determining an angle parameter corresponding to the first angle; the angle parameter corresponding to the first angle is used for eye confidence judgment;
[0124] At the same time, calculate the second angle between the projection of the line between the origin of the camera coordinate system and the origin of the head coordinate system on the xOy plane of the head coordinate system and the x-axis of the head coordinate system, and determine the angle parameter corresponding to the second angle.
[0125] Among them, the relative position relationship between the passenger's head and the camera is represented by defining the coordinates of the origin of the camera coordinate system in the human head coordinate system.
[0126] Please refer to Figure 2, where the origin of the camera coordinate system is the optical center of the camera, the x-axis and y-axis are parallel to the X and Y axes of the image, and the z-axis is oriented toward the optical axis of the camera and is perpendicular to the image plane. Specifically, since the image coordinate system has the x-axis to the right and the y-axis downward, the camera coordinate system uses the center of the lens's main optical axis as its origin, with the x-positive direction to the right, the y-positive direction downward, and the z-positive direction forward. In this way, the x- and y-directions coincide with the directions of the image coordinate system, and the z-direction is the depth of field. This also conforms to the definition of the right-handed coordinate system, facilitating vector calculations in the algorithm.
[0127] In summary, the z-axis of the camera coordinate system is consistent with the direction of the camera's optical axis, both pointing to the front of the camera.
[0128] The head coordinate system is defined as follows: the origin of the head coordinate system is located at the center of the human head; the X-axis is parallel to the line connecting the left and right eyes, the Y-axis is parallel to the line connecting the nose endpoint and the chin endpoint, and the Z-axis is perpendicular to the X-axis and the Y-axis, which is the face orientation, or face direction.
[0129] Based on this, the line between the origin of the camera coordinate system and the origin of the head coordinate system and the first angle between the z-axis of the head coordinate system can indicate whether the eyes are reliable for sleep recognition.
[0130] The angle parameter is used to characterize the size, direction and other properties of the angle, and can be an angle, or a trigonometric function value corresponding to the angle, etc.
[0131] The following specifically describes the process of calculating the first angle between the line between the origin of the camera coordinate system and the origin of the head coordinate system and the z-axis of the head coordinate system, the projection of the line between the origin of the camera coordinate system and the origin of the head coordinate system on the xOy plane of the head coordinate system and the second angle between the x-axis of the head coordinate system. For ease of expression, in the embodiment of the present application, the first angle between the line between the origin of the camera coordinate system and the origin of the head coordinate system and the z-axis of the head coordinate system is referred to as latitude; the second angle between the projection of the line between the origin of the camera coordinate system and the origin of the head coordinate system on the xOy plane of the head coordinate system and the x-axis of the head coordinate system is referred to as longitude.
[0132] The second angle between the projection of the line between the origin of the camera coordinate system and the origin of the head coordinate system on the xOy plane of the head coordinate system and the x-axis of the head coordinate system, that is, the second angle between the projection of the line between the origin of the camera coordinate system and the origin of the head coordinate system on the xOy plane of the head coordinate system and the x-axis of the head coordinate system.
[0133] Specifically, the coordinates of the origin of the camera coordinate system in the human head coordinate system are defined as ,Will Normalize the vector to get the normalized vector .
[0134] Specifically, .
[0135] By normalizing the vector , we can get the longitude and latitude representation; specifically, longitude ;latitude .
[0136] Reference Figure 2 It can be seen that the , is the second angle between the projection of the line between the origin of the camera coordinate system and the origin of the head coordinate system on the xOy plane of the head coordinate system and the x-axis of the head coordinate system; The line between the origin of the camera coordinate system and the origin of the head coordinate system, and the second angle of the z-axis of the head coordinate system.
[0137] According to the definition of longitude and latitude, when the face is facing the camera, the camera is located on the z-axis of the head coordinate system, and the normalized vector is expressed as , at this time, latitude=0, longitude=0; similarly, when the camera is located in the positive direction of the x-axis of the head coordinate system, latitude=90, longitude=0; when the camera is located in the positive direction of the y-axis of the head coordinate system, latitude=90, longitude=90. According to the calculation method of longitude and latitude, it is used as the basis for judging the quality of the eyes. When the latitude is smaller, the angle between the face direction and the camera imaging direction is smaller, and the confidence of the eyes for quality judgment is higher. On the contrary, when the latitude is larger, the eyes will be affected by the side face, and the eyes will be invisible, so the confidence is lower.
[0138] However, when only Euler angles are used for judgment, there may be multiple different Euler angle solutions for a specific spatial direction. At the same time, due to the inconsistent positions of passengers in the cabin, it is impossible to use only one configuration to adapt to passengers of different heights and distances, and different configurations of Euler angles are required for each position. Correspondingly, in the embodiment of the present application, it is proposed to use longitude and latitude to analyze whether the eyes are visible. The same configuration constraints can be used for longitude and latitude at different positions in the cabin, which improves the calculation efficiency.
[0139] Please refer to Figure 3 , Figure 3 A flow chart of a method for determining whether the passenger is in a sleeping state according to an embodiment of the present application is shown; Figure 3 As shown, in the embodiment of the present application, the sleep state recognition method that matches the eye confidence judgment result is used to determine whether the passenger is in a sleep state, including the following steps S301-S302:
[0140] S301, when the eye confidence judgment result of the passenger in the target image is qualified, determining whether the passenger is in a sleeping state based on the eye state of the passenger in the target image;
[0141] S302: When the eye confidence judgment result of the passenger in the target image is unqualified, determine whether the passenger is in a sleeping state based on the body posture of the passenger in the target image.
[0142] That is to say, the sleep state recognition method includes two types, a sleep recognition method based on eye state and a sleep recognition method based on body posture.
[0143] The eye states include open and closed.
[0144] Specifically, determining whether the passenger is in a sleeping state based on the eye state of the passenger in the target image includes:
[0145] Based on the eye state of the passenger in the target image, determining the cumulative duration of the closed-eye image in which the eye state is closed within a preset first time period;
[0146] Determining whether the accumulated duration of the eye-closing image meets the preset eye-closing duration requirement;
[0147] If so, it is determined that the passenger is in a sleeping state.
[0148] The meeting of the preset eye-closing duration requirement is that the cumulative duration of the eye-closing image is greater than the preset eye-closing duration threshold.
[0149] In some embodiments, the cumulative duration of the closed-eye images in which the eyes are in a closed state within the preset first time period is determined based on the number of closed-eye images and the sampling duration.
[0150] Based on this, the number of closed-eye images in which the eye state is closed within the preset first time period may also be determined;
[0151] Determining whether the number of the closed-eye images meets a preset number requirement;
[0152] If so, it is determined that the passenger is in a sleeping state.
[0153] The meeting of the preset quantity requirement may be greater than a first preset quantity threshold.
[0154] Specifically, after identifying the eye state of the passenger in the target image, the eye state identification result of the target image in the current frame is updated to the sleep window; the window length of the sleep window is a preset first time period;
[0155] When the number of target images with closed eyes in the sleeping window meets a preset number requirement, it is determined that the passenger is in a sleeping state.
[0156] Based on the sleep window, it is possible to determine more timely whether the passenger is in a sleeping state.
[0157] Identify the eye state of the passenger in the target image. Specifically, use an eye open / closed classification model to identify the eye state of the passenger in the target image.
[0158] That is to say, the target image is input into the eyes open / closed classification model, and the eyes open / closed classification model outputs the passenger's eyes open / closed information.
[0159] Please refer to Figure 4 , Figure 4 A flow chart of a method for determining whether a passenger is in a sleeping state based on the body posture of the passenger in the target image according to an embodiment of the present application is shown; Figure 4 As shown, based on the body posture of the passenger in the target image, determining whether the passenger is in a sleeping state includes the following steps S401-S403:
[0160] S401, identifying target human skeleton points of passengers in the target image;
[0161] S402, based on the target human skeleton points of the passenger, determining the head-to-torso length ratio and the human trunk inclination of the passenger; the head-to-torso length ratio represents the length ratio of the passenger's head and torso in the target image; the human trunk inclination represents the inclination of the passenger's human trunk in the target image along the horizontal direction of the image;
[0162] S403: Determine whether the passenger is in a sleeping state based on the head-to-torso length ratio and the inclination of the human trunk.
[0163] Human skeleton points, also known as skeleton key points, usually refer to specific locations used to describe human posture in human posture recognition. These points are usually located at joints, characteristic parts, etc. of the human body and are used to build a skeleton model of the human body. Taking a common posture recognition system as an example, skeleton key points include: top of the head, the highest point of the head; neck, the top of the cervical spine; shoulders, including left and right shoulders, located at the left and right shoulder joints respectively; elbows, including left and right elbows, located at the left and right elbow joints respectively; wrists, including left and right wrists, located at the left and right wrists respectively; hips, including left and right hips, located at the left and right hip joints respectively.
[0164] It should be noted that in the embodiments of the present application, due to the limitations of the space in the cockpit and the position of the camera, it is usually necessary to only identify the human skeleton points of the upper body mentioned above.
[0165] The human body trunk includes a head and a torso.
[0166] The horizontal direction of the target image is from left to right, and the origin of the coordinate system is the upper left corner of the target image.
[0167] Please refer to Figure 5 , Figure 6 , Figure 7 and Figure 8 , Figure 5 The recognition result of human skeleton points in the target image described in the embodiment of the present application is shown; Figure 6 The figure shows the recognition result of human skeleton points in another target image described in the embodiment of the present application; Figure 7 The figure shows the recognition result of human skeleton points in another target image described in the embodiment of the present application; Figure 8 The recognition result of human skeleton points in another target image described in an embodiment of the present application is shown.
[0168] As mentioned above Figure 5 For example, the head length of the person sitting on the left side of the front row is L1, and the torso length is L2. The length ratio of L1 to L2 is close to 1:1. The head length of the person lying on the right side of the front row is L3, and the torso length is L4. Obviously, the length ratio of L3 to L4 is smaller. The value of the head length to torso length in the target image is called the head-to-body length ratio head_body_ratio; the head-to-body length ratio is used to determine whether the person in the front row is sitting or lying, and thus determine whether the passenger is sleeping. Set the head-to-body length ratio threshold, th_head_body_ratio. Head_body_ratio<th_head_body_ratio is called satisfying index 1.
[0169] With the above Figure 6 For example, for the person on the right side of the front row, when lying down, the human trunk (marked by the line segment from the top of the head to the middle of the left and right hip joints) tilts to the left. The angle between the white line and the X-axis of the target image (horizontally to the right at the bottom) is called body_ang, which is also the inclination of the human trunk. The human trunk tilts to the left, that is, tan(body_ang)<0, and the human trunk tilts to the right when sitting, that is, (tan(body_ang)>0). For the person on the left side of the front row, it is just the opposite. When lying down, the human trunk tilts to the right (tan(body_ang)>0), and when sitting, the human trunk tilts to the left (tan(body_ang)<0). Therefore, tan(body_ang)<0 on the right side of the front row and tan(body_ang)>0 on the left side of the front row are called meeting indicator 2. Indicator 2 can also determine whether the person in the front row is sitting or lying down.
[0170] In order to reduce misjudgment, when a person meets both indicators 1 and 2, the person is considered to be in a sleeping state.
[0171] For those in the back row, please refer to Figure 7 and Figure 8 It is possible to determine whether a person is sleeping in a reclined position by the body inclination angle body_ang of the human trunk. Preset first threshold th_back_left and preset second threshold th_back_right define a preset threshold range for the body inclination angle of the human trunk. When th_back_left < tan(body_ang) < th_back_right, it is considered that this person is in a sleeping state.
[0172] Meanwhile, from Figure 7 and Figure 8 it can be known that for the people in the back row, the head-trunk length ratio when sitting is greater than the head-trunk length ratio when reclined.
[0173] Based on the above-exemplified analysis Figure 5-Figure 8 When determining whether the passenger is in a sleeping state based on the head-trunk length ratio and the body inclination angle of the human trunk, the head-trunk length ratio conditions and body inclination angle conditions corresponding to different seat areas are different.
[0174] The seat area includes the left side of the first row, the right side of the first row, and the second row. Based on this, in the embodiments of the present application, when determining whether the passenger is in a sleeping state based on the head-trunk length ratio and the body inclination angle of the human trunk, it includes:
[0175] Determine the seat area of the passenger in the cockpit based on the target human bone points of the passenger;
[0176] Judge whether the head-trunk length ratio of the passenger meets the head-trunk length ratio condition corresponding to the seat area, and whether the body inclination angle of the passenger meets the body inclination angle condition corresponding to the seat area;
[0177] If both are yes, it is determined that the passenger is in a sleeping state.
[0178] Since the positions of the seats in the car cabin in the target image are basically unchanged, the positions of the left and right hip joints of the passenger in the target image are within a certain range.
[0179] Even if the positions of the seats in the car cabin can be adjusted forward and backward, the positions of the left and right hip joints of the passenger in the target image are still within a certain range.
[0180] Therefore, when determining the seat area of the passenger in the cockpit based on the target human bone points of the passenger, specifically, determine the seat area of the passenger in the cockpit according to the positions of the target human bone points of the passenger in the target image and the position ranges of different seat areas in the target image.
[0181] The target human bone points are the bone points of the left and right hip joints of the passenger.
[0182] Different seating areas correspond to different trunk inclination conditions, including:
[0183] The trunk inclination conditions corresponding to the first row right passenger are: the trunk tilts to the left;
[0184] The trunk inclination conditions corresponding to the left passenger in the first row are: the trunk tilts to the right;
[0185] The trunk inclination condition corresponding to the second row passengers is: the trunk inclination is within the preset threshold range.
[0186] The human trunk inclination condition is quantified to facilitate calculation. Specifically, the human trunk inclination condition corresponding to the first row right passenger is: the tangent value of the human trunk inclination is less than 0; that is, tan(body_ang)<0.
[0187] The body trunk inclination condition corresponding to the left passenger in the first row is: the tangent value of the body trunk inclination is greater than 0; that is, tan(body_ang)>0.
[0188] The human trunk inclination condition for the second row of passengers is: the tangent value of the human trunk inclination is greater than the preset first threshold and less than the preset second threshold; that is, th_back_left <tan(body_ang)<th_back_right。
[0189] The body_ang refers to the inclination of the human body trunk.
[0190] Specifically, different seating areas correspond to different head-to-torso length ratio conditions and human trunk inclination conditions, which are determined based on images of passengers lying down or with their trunks tilted in different vehicle types.
[0191] Parameters such as the space parameters in the car cabin of different models, the position of the camera, the internal parameters of the camera, the position of the seat, etc. will affect the head-to-torso length ratio and the inclination of the human trunk in the target image captured by the camera; therefore, the head-to-torso length ratio condition and the human trunk inclination condition are consistent with the corresponding model.
[0192] Specifically, for this type of car, multiple images of passengers of different heights, weights, and body shapes lying down or with their torsos tilted can be used to determine different head-to-torso length ratio conditions and human trunk inclination conditions corresponding to different seat areas.
[0193] In step S103, when determining whether the passenger is in a sleeping state, a verification result of the sleeping state of the passenger is determined based on the detection result of the target behavior of the passenger in the target image.
[0194] If the passenger is still able to move, such as moving his arms, turning his head, or playing with his mobile phone, reading a book, eating snacks, etc., it means that the passenger has not slept.
[0195] Therefore, in the embodiment of the present application, some target behaviors are set, and when it is detected that a passenger performs the target behaviors, it is determined that the passenger is in a non-sleeping state, that is, the verification result is inconsistent with sleeping.
[0196] The detection result of the target behavior of the passenger includes two types: the target behavior is detected and the target behavior is not detected.
[0197] In the embodiment of the present application, the target behaviors are divided into two types and two types of detection strategies are formulated; the target behaviors include the movement of the target part of the passenger and the use of the target item by the passenger.
[0198] Specifically, determining the verification result for the sleeping state based on the detection result of the target behavior of the passenger in the target image includes:
[0199] Determine a detection result of a target part movement and / or a detection result of a target object use by the passenger in the target image within a preset second time period;
[0200] Determining whether the target part motion detection result and / or the target object detection result meet the corresponding sleep suppression condition;
[0201] If any one of them is met, it is determined that the verification result for the sleep state is sleep inhibition.
[0202] The target part is a part of the cockpit that can make large movements and is easily detected, such as head rotation, arm movement, etc. Correspondingly, leg movements cannot be detected, and the torso cannot make large movements alone (torso movement will drive arm movement).
[0203] Based on this, in the embodiments of the present application, the target parts are specifically the hands and the head.
[0204] Specifically, determining the motion detection result of the target part of the passenger in the target image within the preset second time period includes:
[0205] Determining a rotation angle parameter of a passenger's face in the target image within a preset second time period; the rotation angle parameter represents a rotation angle of the face;
[0206] The movement distance of the passenger's arm in the target image is determined.
[0207] In the embodiment of the present application, the face rotation angle parameter specifically represents the change in the angle between the face orientation and the camera orientation. Specifically, based on the longitude latitude Sure.
[0208] Specifically, the longitude is calculated by judging the eye confidence latitude When the longitude latitude Add to the head posture time window to determine whether the head posture has changed significantly within the head posture time window, and set a set of preset third thresholds th_rotate_lat and th_rotate_long; that is, when latitude>th_rotate_lat or longitude>th_rotate_long, it means that the head posture has changed significantly.
[0209] The moving distance of the passenger's arm in the target image is determined, and the arm movement information of the person is used to suppress sleep. The arm position is added to the arm movement time window to determine whether the arm has moved significantly within a preset second time period.
[0210] Specifically, the preset fourth threshold of the front arm is set to th_front_hand_distance, and the preset fourth threshold of the back arm is set to th_back_hand_distance; that is, the front arm palm movement distance > th_front_hand_distance or the back arm palm movement distance > th_back_hand_distance, indicating that the arm has a large movement within the preset second time period.
[0211] The front arms and the back arms correspond to different preset fourth thresholds because the front arms and the back arms are at different distances from the camera and their sizes in the image are different. Therefore, the same distance moved in the actual space corresponds to a different distance changed in the image.
[0212] The determining whether the motion detection result of the target part meets the corresponding sleep suppression condition includes:
[0213] Determining whether the rotation angle parameter of the face is greater than a preset third threshold;
[0214] Determine whether the moving distance of the passenger's arm is greater than a preset fourth threshold; wherein the preset fourth thresholds corresponding to different vehicle models and different seat areas are different.
[0215] It should be noted that the position of the passenger's arm in the target image is determined based on the human skeleton points corresponding to the arm, for example, based on the elbow and wrist bones of the passenger's arm. In other words, the identified human skeleton points are not only used for sleep state recognition, but also for detecting the target behavior of the passenger in the target image, achieving multiple functions in one detection.
[0216] The determining whether the motion detection result of the target part meets the corresponding sleep suppression condition includes:
[0217] Determining whether the rotation angle parameter of the face is greater than a preset third threshold;
[0218] Determine whether the moving distance of the passenger's arm is greater than a preset fourth threshold; wherein the preset fourth thresholds corresponding to different vehicle models and different seat areas are different.
[0219] Correspondingly, if any one of the judgment results is yes, it is determined that the verification result for the sleep state is suppressed sleep; if both judgment results are no, it is determined that the verification result for the sleep state is non-suppressed sleep.
[0220] In the embodiment of the present application, sleep is also suppressed based on the use of the target object by the person.
[0221] Specifically, in the method for identifying sleep in a car cabin, judging whether the detection result of the target object meets the corresponding sleep suppression condition includes:
[0222] Detect whether there is a target object in the image;
[0223] If yes, judging whether the target object is in a handheld state based on the contact relationship between the target object and the hand and the contact relationship between the target object and a preset reference object;
[0224] If so, the test result is determined to be sleep inhibition.
[0225] The target object may be a mobile phone, food, book, tablet, etc.
[0226] The preset reference object may be a seat surface.
[0227] Based on the contact relationship between the target object and the hand, it is determined whether the target object is held in the hand; based on the contact relationship between the target object and the preset reference object, it is distinguished whether the target object is placed on the preset reference object and touches the hand at the same time, or the object is used by the hand.
[0228] Therefore, based on the contact relationship between the target object and the hand, and the contact relationship between the target object and the preset reference object, it is possible to more accurately determine whether the target object is in a handheld state, that is, to more accurately determine whether the passenger is using the target object.
[0229] The contact relationship between the target object and the hand is determined based on the position of the hand skeleton point and the position of the target object; if the position difference is less than a preset fifth threshold, it is determined that the target object and the hand are in contact.
[0230] The target object and the preset reference object are determined based on the position of the preset reference object and the position of the target object. If the position difference between them is less than a preset sixth threshold, it is determined that the target object and the preset reference object are in contact.
[0231] For example, when using information about a person playing with a mobile phone to suppress sleep, first detect whether there is a held mobile phone in the target image (the hand and the mobile phone are in contact). If so, determine whether the held mobile phone is placed on the seat. If not, suppress sleep.
[0232] In the step S104, based on the verification result for the sleep state, the sleep state recognition result of the passenger in the vehicle cabin is determined.
[0233] Specifically, the step of determining the sleep state recognition result of the passenger in the vehicle cabin based on the sleep state verification result includes:
[0234] When the verification result is sleep suppression, the sleep state recognition result of the passenger is updated to a non-sleeping state;
[0235] When the verification result is non-suppressed sleep, the sleep state identification result of the passenger is maintained as the sleep state.
[0236] Based on the verification of the sleep state, some false sleep detection situations are suppressed, and the sleep state recognition accuracy is improved.
[0237] In the method for identifying sleep in a car cabin described in an embodiment of the present application, the sleep state identification result of the passenger in the car cabin is used to adjust the state of at least one device in the car cabin according to a preset sleep scene.
[0238] The equipment includes: seat angle, car volume, interior lighting, temperature control equipment (such as car air conditioning), etc.
[0239] Specifically, when the sleep state recognition result is that the passenger is in a sleeping state, a sleep signal is generated and sent to the device control module. After receiving the sleep signal, the device control module adjusts the device state according to the preset sleep scene, such as adjusting the seat angle, vehicle computer volume, interior lighting, temperature of the temperature control device, etc.
[0240] Based on the same inventive concept, an embodiment of the present application also provides a method for identifying sleep in a car cabin corresponding to the method for identifying sleep in a car cabin. Since the principle of solving the problem by the device in the embodiment of the present application is similar to the method for identifying sleep in a car cabin mentioned in the embodiment of the present application, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be repeated.
[0241] Please refer to Fig. 9 , Fig. 9The structure diagram of the sleep recognition device in the vehicle cabin according to the embodiment of the present application is shown; the device comprises:
[0242] An acquisition module 901 is used to acquire a target image of a vehicle cabin; the target image includes passengers;
[0243] A judgment module 902 is used to determine whether the passenger is in a sleeping state based on the eye confidence judgment result of the passenger in the target image, using a sleep state recognition method that matches the eye confidence judgment result; the eye confidence judgment result indicates whether the eye is reliable for sleep recognition;
[0244] A first determination module 903 is used to determine a verification result of the sleeping state of the passenger based on the state of the target object in the target image when it is determined that the passenger is in the sleeping state;
[0245] The second determination module 904 is used to determine the sleep state recognition result of the passenger in the vehicle cabin based on the verification result for the sleep state.
[0246] In some embodiments, in the above-mentioned in-cabin sleep recognition method, the judgment module, when determining whether the passenger is in a sleeping state by using a sleep state recognition method that matches the eye confidence judgment result, is specifically used to:
[0247] When the eye confidence judgment result of the passenger in the target image is qualified, determining whether the passenger is in a sleeping state based on the eye state of the passenger in the target image;
[0248] When the eye confidence judgment result of the passenger in the target image is unqualified, it is determined whether the passenger is in a sleeping state based on the body posture of the passenger in the target image.
[0249] In some embodiments, in the above-mentioned sleep recognition device in a car cabin, the judgment module, when determining whether the passenger is in a sleeping state based on the eye state of the passenger in the target image, is specifically used to:
[0250] Based on the eye state of the passenger in the target image, determining the cumulative duration of the closed-eye image in which the eye state is closed within a preset first time period;
[0251] Determining whether the accumulated duration of the eye-closing image meets the preset eye-closing duration requirement;
[0252] If so, it is determined that the passenger is in a sleeping state.
[0253] In some embodiments, in the above-mentioned sleep recognition device for a car cabin, the judgment module, when determining whether the passenger is in a sleeping state based on the body posture of the passenger in the target image, is specifically used to:
[0254] Identifying target human skeleton points of passengers in the target image;
[0255] Based on the target human skeleton points of the passenger, determining the head-to-torso length ratio and the human trunk inclination of the passenger; the head-to-torso length ratio represents the length ratio of the passenger's head and torso in the target image; the human trunk inclination represents the inclination of the passenger's human trunk in the target image along the horizontal direction of the image;
[0256] Based on the head-to-torso length ratio and the inclination of the human trunk, it is determined whether the passenger is in a sleeping state.
[0257] In some embodiments, in the in-cabin sleep recognition device for a vehicle, the judgment module, when determining whether the passenger is in a sleeping state based on the head-to-body length ratio and the inclination of the human trunk, is specifically used to:
[0258] Based on the target human skeleton points of the passenger, determine the passenger's seat area in the cockpit; wherein different seat areas correspond to different head-to-body length ratio conditions and human trunk inclination conditions;
[0259] Determine whether the passenger's head-to-body length ratio meets the head-to-body length ratio condition corresponding to the seat area, and whether the passenger's trunk inclination meets the trunk inclination condition corresponding to the seat area;
[0260] If both are yes, it is determined that the passenger is in a sleeping state.
[0261] In some embodiments, in the in-car sleep recognition device, the different seating areas correspond to different head-to-torso length ratio conditions and human trunk inclination conditions, which are determined based on images of passengers lying down or with their trunks tilted in different car models.
[0262] In some embodiments, in the in-cabin sleep recognition device, the different seat areas correspond to different human trunk inclination conditions, including:
[0263] The trunk inclination conditions corresponding to the first row right passenger are: the trunk tilts to the left;
[0264] The trunk inclination conditions corresponding to the left passenger in the first row are: the trunk tilts to the right;
[0265] The trunk inclination condition corresponding to the second row passengers is: the trunk inclination is within the preset threshold range.
[0266] In some embodiments, in the in-cabin sleep recognition device for a vehicle, the trunk inclination condition corresponding to the right passenger in the first row is: the tangent value of the trunk inclination is less than 0;
[0267] The human trunk inclination condition corresponding to the left passenger in the first row is: the tangent value of the human trunk inclination is greater than 0;
[0268] The trunk inclination condition corresponding to the second row passengers is: the tangent value of the trunk inclination is greater than a preset first threshold and less than a preset second threshold.
[0269] In some embodiments, in the automobile in-cabin sleep recognition device, the judgment module is further used to determine the eye confidence judgment result based on the angle between the face orientation and the camera imaging direction before determining whether the passenger is in a sleeping state based on the eye confidence judgment result of the passenger in the target image and using a sleep state recognition method that matches the eye confidence judgment result; the smaller the angle between the face orientation and the camera imaging direction, the higher the confidence of the eye for sleep recognition; the larger the angle between the face orientation and the camera imaging direction, the lower the confidence of the eye for sleep recognition.
[0270] In some embodiments, in the above-mentioned in-cabin sleep recognition device for automobiles, the judgment module, when determining the eye confidence judgment result based on the angle between the facial orientation and the camera imaging direction, is specifically used to:
[0271] Determine an angle parameter corresponding to the angle between the face orientation and the camera imaging direction;
[0272] When the angle parameter meets the preset confidence condition, determining that the eye confidence judgment result is qualified;
[0273] Otherwise, the eye confidence judgment result is determined to be unqualified.
[0274] In some embodiments, in the in-cabin sleep recognition device for a vehicle, the determination module, when determining the angle parameter corresponding to the angle between the face orientation and the camera orientation, is specifically used to:
[0275] Define the coordinates of the origin of the camera coordinate system in the head coordinate system;
[0276] Calculating a first angle between a line between the origin of the camera coordinate system and the origin of the head coordinate system and the z-axis of the head coordinate system, and determining an angle parameter corresponding to the first angle; the angle parameter corresponding to the first angle is used for eye confidence judgment;
[0277] At the same time, calculate the second angle between the projection of the line between the origin of the camera coordinate system and the origin of the head coordinate system on the xOy plane of the head coordinate system and the x-axis of the head coordinate system, and determine the angle parameter corresponding to the second angle.
[0278] In some embodiments, in the in-cabin sleep recognition device for a vehicle, the first determination module, when determining the verification result for the sleep state based on the detection result for the target behavior of the passenger in the target image, is specifically used to:
[0279] Determine a detection result of a target part movement and / or a detection result of a target object use by the passenger in the target image within a preset second time period;
[0280] Determining whether the target part motion detection result and / or the target object detection result meet the corresponding sleep suppression condition;
[0281] If any one of them is met, it is determined that the verification result for the sleep state is sleep inhibition.
[0282] In some embodiments, in the above-mentioned sleep recognition device in a car cabin, the first determination module, when determining the motion detection result of the passenger at the target part in the target image within the preset second time period, is specifically used to:
[0283] Determining a rotation angle parameter of a passenger's face in the target image within a preset second time period; the rotation angle parameter represents a rotation angle of the face;
[0284] The moving distance of the passenger's arm in the target image within a preset second time period is determined.
[0285] In some embodiments, in the above-mentioned sleep recognition device in a car cabin, the first determination module, when determining whether the motion detection result of the target part meets the corresponding sleep suppression condition, is specifically used to:
[0286] Determining whether the rotation angle parameter of the face is greater than a preset third threshold;
[0287] Determine whether the moving distance of the passenger's arm is greater than a preset fourth threshold; wherein the preset fourth thresholds corresponding to different vehicle models and different seat areas are different.
[0288] In some embodiments, in the above-mentioned sleep recognition device in a car cabin, the first determination module, when determining whether the detection result of using the target object meets the corresponding sleep suppression condition, is specifically used to:
[0289] Detect whether there is a target object in the image;
[0290] If yes, judging whether the target object is in a handheld state based on the contact relationship between the target object and the hand and the contact relationship between the target object and a preset reference object;
[0291] If so, the test result is determined to be sleep inhibition.
[0292] In some embodiments, in the above-mentioned sleep recognition device for a car cabin, the second determination module, when determining the sleep state recognition result of the passenger in the car cabin based on the verification result for the sleep state, is specifically used to:
[0293] When the verification result is sleep suppression, the sleep state recognition result of the passenger is updated to a non-sleeping state;
[0294] When the verification result is non-suppressed sleep, the sleep state identification result of the passenger is maintained as the sleep state.
[0295] In some embodiments, in the sleep recognition device in the vehicle cabin, the sleep state recognition result of the passenger in the vehicle cabin is used to adjust the state of at least one device in the vehicle cabin according to a preset sleep scene.
[0296] Based on the same inventive concept, an electronic device corresponding to the method for identifying sleep in a car cabin is also provided in the embodiment of the present application. Since the principle of solving the problem by the electronic device in the embodiment of the present application is similar to the method for identifying sleep in a car cabin mentioned in the embodiment of the present application, the implementation of the electronic device can refer to the implementation of the method, and the repeated parts will not be repeated.
[0297] Please refer to Fig.10 , Fig.10 A schematic diagram of the structure of the electronic device described in an embodiment of the present application is shown; the electronic device 1000 includes: a processor 1002, a memory 1001 and a bus, the memory 1001 stores machine-readable instructions executable by the processor 1002, when the electronic device 1000 is running, the processor 1002 communicates with the memory 1001 through the bus, and when the machine-readable instructions are executed by the processor 1002, the steps of the method for identifying sleep in a car cabin are executed.
[0298] Based on the same inventive concept, a computer-readable storage medium corresponding to the method for identifying sleep in a car cabin is also provided in the embodiment of the present application. Since the principle of solving the problem by the computer-readable storage medium in the embodiment of the present application is similar to the method for identifying sleep in a car cabin mentioned in the embodiment of the present application, the implementation of the computer-readable storage medium can refer to the implementation of the method, and the repeated parts will not be repeated.
[0299] A computer-readable storage medium stores a computer program, which executes the steps of the method for identifying sleep in a car cabin when the computer program is run by a processor.
[0300] Those skilled in the art can clearly understand that, for the convenience and simplicity of description, the specific working process of the system and device described above can refer to the corresponding process in the method embodiment, and will not be repeated in this application. In the several embodiments provided in this application, it should be understood that the disclosed system, device and method can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the modules is only a logical function division. There may be other division methods in actual implementation. For example, multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, indirect coupling or communication connection of devices or modules, which can be electrical, mechanical or other forms.
[0301] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0302] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0303] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium that is executable by a processor. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a platform server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as USB flash drives, mobile hard drives, ROM, RAM, magnetic disks, or optical disks.
[0304] The above are only specific implementations of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A method for identifying sleep in a car cabin, characterized in that: The method comprises: Acquire a target image of a car cabin; the target image includes passengers; Determine an angle parameter corresponding to the angle between the passenger's facial orientation and the camera imaging direction; when the angle parameter meets a preset confidence condition, determine that the eye confidence judgment result of the passenger in the target image is qualified; otherwise, determine that the eye confidence judgment result is unqualified; wherein, the smaller the angle between the facial orientation and the camera imaging direction, the higher the confidence of the eye for sleep recognition; the larger the angle between the facial orientation and the camera imaging direction, the lower the confidence of the eye for sleep recognition; Based on the eye confidence judgment result of the passenger in the target image, a sleep state recognition method matching the eye confidence judgment result is used to determine whether the passenger is in a sleep state; wherein the eye confidence judgment result indicates whether the eye is reliable for sleep recognition; when the eye confidence judgment result of the passenger in the target image is qualified, based on the eye state of the passenger in the target image, it is determined whether the passenger is in a sleep state; when the eye confidence judgment result of the passenger in the target image is unqualified, based on the body posture of the passenger in the target image, it is determined whether the passenger is in a sleep state; If so, determine the target part motion detection result and / or the target item use detection result of the passenger in the target image within the preset second time period; determine whether the target part motion detection result and / or the target item use detection result meet the corresponding sleep suppression condition; if any one of them meets, determine that the verification result for the sleep state is suppressed sleep; if the judgment results are all negative, determine that the verification result for the sleep state is non-suppressed sleep; When the verification result is suppressed sleep, the sleep state recognition result of the passenger is updated to a non-sleeping state; when the verification result is non-suppressed sleep, the sleep state recognition result of the passenger is maintained as a sleeping state.
2. The method for identifying sleep in a car cabin according to claim 1, characterized in that: Determining whether the passenger is in a sleeping state based on the eye state of the passenger in the target image includes: Based on the eye state of the passenger in the target image, determining the cumulative duration of the closed-eye image in which the eye state is closed within a preset first time period; Determining whether the accumulated duration of the eye-closing image meets the preset eye-closing duration requirement; If so, it is determined that the passenger is in a sleeping state.
3. The method for identifying sleep in a car cabin according to claim 1, characterized in that: Determining whether the passenger is in a sleeping state based on the body posture of the passenger in the target image includes: Identifying target human skeleton points of passengers in the target image; Based on the target human skeleton points of the passenger, determining the head-to-torso length ratio and the human trunk inclination of the passenger; the head-to-torso length ratio represents the length ratio of the passenger's head and torso in the target image; the human trunk inclination represents the inclination of the passenger's human trunk in the target image along the horizontal direction of the image; Based on the head-to-torso length ratio and the inclination of the human trunk, it is determined whether the passenger is in a sleeping state.
4. The method for identifying sleep in a car cabin according to claim 3, characterized in that: Based on the head-to-body length ratio and the human body trunk inclination, determining whether the passenger is in a sleeping state includes: Based on the target human skeleton points of the passenger, determine the passenger's seat area in the cockpit; wherein different seat areas correspond to different head-to-body length ratio conditions and human trunk inclination conditions; Determine whether the passenger's head-to-body length ratio meets the head-to-body length ratio condition corresponding to the seat area, and whether the passenger's trunk inclination meets the trunk inclination condition corresponding to the seat area; If both are yes, it is determined that the passenger is in a sleeping state.
5. The method for identifying sleep in a car cabin according to claim 4, characterized in that: Different seating areas correspond to different head-to-torso length ratio conditions and trunk inclination conditions, which are determined based on images of passengers lying down or with their trunks tilted in different vehicle types.
6. The method for identifying sleep in a car cabin according to claim 4, characterized in that: Different seating areas correspond to different trunk inclination conditions, including: The trunk inclination conditions corresponding to the first row right passenger are: the trunk tilts to the left; The trunk inclination conditions corresponding to the left passenger in the first row are: the trunk tilts to the right; The trunk inclination condition corresponding to the second row passengers is: the trunk inclination is within the preset threshold range.
7. The method for identifying sleep in a car cabin according to claim 4 or 6, characterized in that: The trunk inclination condition for the first row right passenger is: the tangent value of the trunk inclination is less than 0; The human trunk inclination condition corresponding to the left passenger in the first row is: the tangent value of the human trunk inclination is greater than 0; The trunk inclination condition corresponding to the second row passengers is: the tangent value of the trunk inclination is greater than a preset first threshold and less than a preset second threshold.
8. The method for identifying sleep in a car cabin according to claim 1, characterized in that : Determine an angle parameter corresponding to the angle between the face orientation and the camera orientation, including: Define the coordinates of the origin of the camera coordinate system in the head coordinate system; Calculating a first angle between a line between the origin of the camera coordinate system and the origin of the head coordinate system and the z-axis of the head coordinate system, and determining an angle parameter corresponding to the first angle; the angle parameter corresponding to the first angle is used for eye confidence judgment; At the same time, calculate the second angle between the projection of the line between the origin of the camera coordinate system and the origin of the head coordinate system on the xOy plane of the head coordinate system and the x-axis of the head coordinate system, and determine the angle parameter corresponding to the second angle.
9. The method for identifying sleep in a car cabin according to claim 1, characterized in that: Determining a motion detection result of a target part of a passenger in the target image within a preset second time period includes: Determining a rotation angle parameter of a passenger's face in the target image within a preset second time period; the rotation angle parameter represents a rotation angle of the face; The moving distance of the passenger's arm in the target image within a preset second time period is determined.
10. The method for identifying sleep in a car cabin according to claim 9, characterized in that: The determining whether the motion detection result of the target part meets the corresponding sleep suppression condition includes: Determining whether the rotation angle parameter of the face is greater than a preset third threshold; Determine whether the moving distance of the passenger's arm is greater than a preset fourth threshold; wherein the preset fourth thresholds corresponding to different vehicle models and different seat areas are different.
11. The method for identifying sleep in a car cabin according to claim 9, characterized in that: Determine whether the detection result of the target object meets the corresponding sleep suppression condition; including: Detect whether there is a target object in the image; If yes, judging whether the target object is in a handheld state based on the contact relationship between the target object and the hand and the contact relationship between the target object and a preset reference object; If so, the test result is determined to be sleep inhibition.
12. The method for identifying sleep in a car cabin according to claim 1, characterized in that: The sleep state recognition result of the passenger in the vehicle cabin is used to adjust the state of at least one device in the vehicle cabin according to a preset sleep scene.
13. A sleep recognition device in a car cabin, characterized in that: The device comprises: An acquisition module, used to acquire a target image of a vehicle cabin; the target image includes passengers; A judgment module, used to determine an angle parameter corresponding to the angle between the passenger's facial orientation and the camera imaging direction; when the angle parameter meets a preset confidence condition, determine that the passenger's eye confidence judgment result in the target image is qualified; otherwise, determine that the eye confidence judgment result is unqualified; wherein, the smaller the angle between the facial orientation and the camera imaging direction, the higher the confidence of the eye for sleep recognition; the larger the angle between the facial orientation and the camera imaging direction, the lower the confidence of the eye for sleep recognition; The judgment module is further used to determine whether the passenger is in a sleeping state based on the eye confidence judgment result of the passenger in the target image, using a sleep state recognition method that matches the eye confidence judgment result; wherein the eye confidence judgment result indicates whether the eye is reliable for sleep recognition; when the eye confidence judgment result of the passenger in the target image is qualified, based on the eye state of the passenger in the target image, determine whether the passenger is in a sleeping state; when the eye confidence judgment result of the passenger in the target image is unqualified, based on the body posture of the passenger in the target image, determine whether the passenger is in a sleeping state; The first determination module is used to determine, when it is determined that the passenger is in a sleeping state, a target part motion detection result and / or a target object use detection result of the passenger in the target image within a preset second time period; determine whether the target part motion detection result and / or the target object use detection result meet the corresponding sleep suppression condition; if any one of them meets, determine that the verification result for the sleeping state is suppressed sleep; if the judgment results are all negative, determine that the verification result for the sleeping state is non-suppressed sleep; The second determination module is used to update the sleep state recognition result of the passenger to a non-sleep state when the verification result is suppressed sleep; and to keep the sleep state recognition result of the passenger as a sleep state when the verification result is non-suppressed sleep.
14. An electronic device, characterized in that: include: A processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor and the memory communicate via the bus, and when the machine-readable instructions are executed by the processor, the steps of the method for identifying sleep in a car cabin as described in any one of claims 1 to 12 are performed.
15. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method for identifying sleep in a vehicle cabin as claimed in any one of claims 1 to 12 are executed.
Citation Information
Cited By
Method and apparatus for recognizing sleep in vehicle cabin, electronic device, and medium
EP4718395A1
