Safety belt wearing detection method and device, electronic equipment and storage medium

CN118575206APending Publication Date: 2024-08-30BOE TECHNOLOGY GROUP CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202280005079.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2022-12-16
Publication Date
2024-08-30

AI Technical Summary

Technical Problem

The existing technology has a problem of misjudgment when detecting whether a person on a vehicle is wearing a seat belt, especially when a person does not want to wear a seat belt by inserting a buckle to mislead the system, resulting in low detection accuracy and inability to effectively ensure traffic safety.

Method used

By performing face detection on the images captured by the in-car camera device, the target face located in the preset seat area is identified, the target human body image is cropped, and the seat belt area is segmented from it to determine whether the person is wearing a seat belt. Based on safety The attribute parameters of the belt (such as slope, area and coincidence degree) are used to determine the wearing condition.

Benefits of technology

It improves the accuracy of seat belt wearing detection, reduces misjudgments caused by human avoidance of detection, reduces the amount of detection calculations, improves driving safety, and avoids erroneous detection of people in non-seat areas.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118575206A
    Figure CN118575206A
Patent Text Reader

Abstract

The invention discloses a safety belt wearing detection method and device, electronic equipment and a storage medium, relates to the technical field of image processing, and is used for improving the safety belt wearing detection accuracy and detection efficiency so as to improve the driving safety. The safety belt wearing detection method comprises the following steps: performing face detection on a to-be-detected image to obtain position information of one or more face detection frames; based on the position information of the one or more face detection frames, identifying a target face detection frame located in a preset seat area from the one or more face detection frames; based on the position information of the target face detection frame, cutting out a target human body image corresponding to the target face detection frame from the to-be-detected image; segmenting a safety belt area image from the target human body image, and judging whether a person corresponding to the target human body image wears a safety belt or not based on the safety belt area image.
Need to check novelty before this filing date? Find Prior Art

Description

A safety belt wearing detection method, device, electronic device and storage medium Technical Field

[0001] The present application relates to the field of image processing technology, and in particular to a seat belt wearing detection method, device, electronic device and storage medium. Background Art

[0002] With the rapid growth of urban economies and the acceleration of urbanization, traffic safety has become a major challenge plaguing my country's urban transportation landscape. To ensure safe driving and reduce casualties in traffic accidents, passengers in vehicles are required to wear seatbelts. However, during actual driving, passengers may forget to wear seatbelts or intentionally fail to do so, posing a significant safety hazard. Therefore, effectively detecting seatbelt wear is a pressing technical issue that needs to be addressed.

[0003] Summary of the Invention

[0004] On the one hand, a seat belt wearing detection method is provided, which includes: performing face detection on an image to be detected to obtain position information of one or more face detection frames; based on the position information of the one or more face detection frames, identifying a target face detection frame located in a preset seat area from the one or more face detection frames; based on the position information of the target face detection frame, cropping a target human body image corresponding to the target face detection frame from the image to be detected; segmenting a seat belt area image from the target human body image, and judging whether the person corresponding to the target human body image is wearing a seat belt based on the seat belt area image.

[0005] In some embodiments, the above-mentioned method of identifying a target face detection frame located in a preset seat area from one or more face detection frames based on the position information of one or more face detection frames includes: for each face detection frame in the one or more face detection frames, determining the overlap between the face detection frame and the preset seat area based on the position information of the face detection frame and the position information of the preset seat area; and determining that the face detection frame is a target face detection frame when the overlap between the face detection frame and the preset seat area is greater than or equal to a first overlap threshold.

[0006] In some embodiments, the above-mentioned determination of whether the person corresponding to the target human image is wearing a seat belt based on the seat belt area image includes: determining the attribute parameters of the seat belt based on the seat belt area image, the attribute parameters of the seat belt including the slope of the seat belt; the slope of the seat belt is used to characterize the degree of inclination of the straight line after fitting the seat belt area image relative to the bottom edge of the target human image; when the attribute parameters of the seat belt meet preset conditions, determining that the person corresponding to the target human image is wearing a seat belt, the preset conditions include a first preset condition, and the first preset condition includes that the slope of the seat belt is within a preset range.

[0007] In some embodiments, the above method also includes: segmenting a human body area image from the target human body image; the attribute parameters of the seat belt also include at least one of the following: the area of ​​the seat belt area image, the overlap between the seat belt area image and the target human body image, and the overlap between the seat belt area image and the human body area image.

[0008] In some embodiments, the above-mentioned preset conditions also include a second preset condition, and the second preset condition includes at least one of the following: the area of ​​the seat belt area image exceeds a preset area threshold; the overlap between the seat belt area image and the target human body image is greater than or equal to a second overlap threshold; or, the overlap between the seat belt area image and the human body area image is greater than or equal to a third overlap threshold.

[0009] In some embodiments, the above-mentioned determination that the person corresponding to the target human image is wearing a seat belt when the attribute parameters of the seat belt meet the preset conditions includes: judging whether the attribute parameters of the seat belt meet the first preset condition; when the attribute parameters of the seat belt do not meet the first preset condition, determining that the person corresponding to the target human image is not wearing a seat belt; when the attribute parameters of the seat belt meet the first preset condition, judging whether the attribute parameters of the seat belt meet the second preset condition; when the attribute parameters of the seat belt do not meet the second preset condition, determining that the person corresponding to the target human image is not wearing a seat belt; when the attribute parameters of the seat belt meet the second preset condition, determining that the person corresponding to the target human image is wearing a seat belt.

[0010] In some embodiments, the above-mentioned cropping of the target human body image corresponding to the target face detection frame from the image to be detected based on the position information of the target face detection frame includes: determining the height and width of the target human body image corresponding to the target face detection frame based on the height and width of the target face detection frame; wherein, the ratio of the height of the target human body image to the height of the target face detection frame is a preset first ratio, and the ratio of the width of the target face detection frame to the width of the target human body image is a preset second ratio; based on the position information of the target face detection frame, and the height and width of the human body area image, cropping the target human body image corresponding to the target face detection frame from the image to be detected.

[0011] In some embodiments, the above method also includes: obtaining an original image captured by a shooting device arranged inside the vehicle and whose shooting area includes a preset seat area; performing an affine transformation on the original image to obtain an image to be detected; the preset seat area is located in the middle of the image to be detected.

[0012] In some embodiments, segmenting the seat belt area image from the target human body image includes:

[0013] Inputting a target human body image into a seat belt wearing detection model to obtain semantic information of each pixel in the target human body image; the semantic information is used to indicate the type of object corresponding to the pixel; based on the semantic information of each pixel, segmenting a seat belt area image from the target human body image; performing face detection on the image to be detected to obtain position information of one or more face detection frames, including: inputting the image to be detected into a face detection model to obtain position information of one or more face detection frames.

[0014] On the other hand, a seat belt wearing detection device is provided, which includes: a face detection module, a human body detection module, and a wearing detection module. The face detection module is used to perform face detection on the image to be detected to obtain the position information of one or more face detection frames; based on the position information of the one or more face detection frames, a target face detection frame located in a preset seat area is identified from the one or more face detection frames. The human body detection module is used to crop a target human body image corresponding to the target face detection frame from the image to be detected based on the position information of the target face detection frame. The wearing detection module is used to segment a seat belt area image from the target human body image, and determine whether the person corresponding to the human body area image is wearing a seat belt based on the seat belt area image.

[0015] In some embodiments, the above-mentioned face detection module is specifically used to determine the degree of overlap between the face detection frame and the preset seat area for each face detection frame in one or more face detection frames based on the position information of the face detection frame and the position information of the preset seat area; when the degree of overlap between the face detection frame and the preset seat area is greater than or equal to the first overlap threshold, the face detection frame is determined to be the target face detection frame.

[0016] In some embodiments, the above-mentioned wearing detection module is specifically used to determine the attribute parameters of the seat belt based on the seat belt area image, and the attribute parameters of the seat belt include the slope of the seat belt; the slope of the seat belt is used to characterize the degree of inclination of the straight line after fitting the seat belt area image relative to the bottom edge of the target human image; when the attribute parameters of the seat belt meet the preset conditions, it is determined that the person corresponding to the target human image is wearing the seat belt, and the preset conditions include a first preset condition, and the first preset condition includes that the slope of the seat belt is within a preset range.

[0017] In some embodiments, the above-mentioned wearing detection module is also used to segment a human body area image from the target human body image; the attribute parameters of the seat belt also include at least one of the following: the area of ​​the seat belt area image, the overlap between the seat belt area image and the target human body image, and the overlap between the seat belt area image and the human body area image.

[0018] In some embodiments, the above-mentioned preset conditions also include a second preset condition, and the second preset condition includes at least one of the following: the area of ​​the seat belt area image exceeds a preset area threshold; the overlap between the seat belt area image and the target human body image is greater than or equal to a second overlap threshold; or, the overlap between the seat belt area image and the human body area image is greater than or equal to a third overlap threshold.

[0019] In some embodiments, the above-mentioned wearing detection module is specifically used to determine whether the attribute parameters of the seat belt meet a first preset condition; when the attribute parameters of the seat belt do not meet the first preset condition, determine that the person corresponding to the target human image is not wearing a seat belt; when the attribute parameters of the seat belt meet the first preset condition, determine whether the attribute parameters of the seat belt meet a second preset condition; when the attribute parameters of the seat belt do not meet the second preset condition, determine that the person corresponding to the target human image is not wearing a seat belt; when the attribute parameters of the seat belt meet the second preset condition, determine that the person corresponding to the target human image is wearing a seat belt.

[0020] In some embodiments, the above-mentioned human body detection module is specifically used to determine the height and width of the target human body image corresponding to the target face detection frame based on the height and width of the target face detection frame; wherein, the ratio of the height of the target human body image to the height of the target face detection frame is a preset first ratio, and the ratio of the width of the target face detection frame to the width of the target human body image is a preset second ratio; based on the position information of the target face detection frame, and the height and width of the human body area image, the target human body image corresponding to the target face detection frame is cropped from the image to be detected.

[0021] In some embodiments, the apparatus further includes a camera module and a preprocessing module. The camera module is configured to capture an original image; the camera module is positioned within the vehicle, and its imaging area includes a predetermined seating area. The preprocessing module is configured to perform an affine transformation on the original image to obtain an image to be detected; the predetermined seating area is located in the center of the image to be detected.

[0022] In some embodiments, the camera module is disposed at at least one of the following locations: a cockpit A-pillar, an instrument panel, a reading light, a central control screen, or a central console.

[0023] In some embodiments, the above-mentioned wearing detection module is specifically used to input the target human body image into the seat belt wearing detection model to obtain the semantic information of each pixel in the target human body image; the semantic information is used to indicate the object type corresponding to the pixel; based on the semantic information of each pixel, the seat belt area image is segmented from the target human body image.

[0024] In some embodiments, the above-mentioned face detection module is specifically used to input the image to be detected into the face detection model to obtain the position information of one or more face detection frames.

[0025] In yet another aspect, an electronic device is provided. The electronic device includes a memory and a processor; the memory and processor are coupled; the memory is configured to store computer program code, which includes computer instructions. When the processor executes the computer instructions, the electronic device performs one or more steps of the seatbelt wearing detection method described in any of the above embodiments.

[0026] In yet another aspect, a non-transitory computer-readable storage medium is provided. The non-transitory computer-readable storage medium stores computer program instructions that, when executed on a computer (e.g., the electronic device or seat belt wearing detection device described above), cause the computer to perform one or more steps of the seat belt wearing detection method described in any of the above embodiments.

[0027] In yet another aspect, a computer program product is provided. The computer program product includes computer program instructions that, when executed on a computer (e.g., the electronic device or the seat belt wearing detection device described above), cause the computer to perform one or more steps of the seat belt wearing detection method described in any of the above embodiments.

[0028] In another aspect, a computer program is provided. When executed on a computer (e.g., the electronic device or the seat belt wearing detection device described above), the computer program causes the computer to perform one or more steps of the seat belt wearing detection method described in any of the above embodiments. BRIEF DESCRIPTION OF THE DRAWINGS

[0029] To more clearly illustrate the technical solutions of this application, the following briefly introduces the drawings required for use in some embodiments of this application. Obviously, the drawings described below are only drawings of some embodiments of this application, and those skilled in the art can also derive other drawings based on these drawings. Furthermore, the drawings described below are schematic diagrams and do not limit the actual dimensions of the products, actual processes of the methods, actual timing of signals, etc. involved in the embodiments of this application.

[0030] FIG1 is a structural diagram of a seat belt wearing detection system according to some embodiments;

[0031] FIG2 is a diagram of a vehicle interior structure according to some embodiments;

[0032] FIG3 is a flowchart 1 of a seat belt wearing detection method according to some embodiments;

[0033] FIG4 is a second flowchart of a seat belt wearing detection method according to some embodiments;

[0034] FIG5 is a third flowchart of a seat belt wearing detection method according to some embodiments;

[0035] FIG6 is a schematic diagram of a method for determining position information of a human body region image according to some embodiments;

[0036] FIG7 is a fourth flowchart of a seat belt wearing detection method according to some embodiments;

[0037] FIG8 is a flow chart of a method for training a model according to some embodiments;

[0038] FIG9 is a flowchart of a fifth method for detecting seat belt wearing according to some embodiments;

[0039] FIG10 is a sixth flowchart of a seat belt wearing detection method according to some embodiments;

[0040] FIG11 is a structural diagram of a seat belt wearing detection device according to some embodiments;

[0041] FIG12 is a block diagram of an electronic device according to some embodiments. DETAILED DESCRIPTION

[0042] The following will be combined with the accompanying drawings to clearly and completely describe the technical solutions in some embodiments of the present application. Obviously, the embodiments described are only some embodiments of the present application, not all embodiments. Based on the embodiments provided in this application, all other embodiments obtained by ordinary technicians in this field are within the scope of protection of this application.

[0043] It should be noted that, in this application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design described in this application as "exemplary" or "for example" should not be interpreted as being more preferred or advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present the relevant concepts in a concrete way. Unless the context requires otherwise, throughout the specification and claims, the term "comprise" and other forms such as the third person singular form "comprises" and the present participle form "comprising" are interpreted as open and inclusive, that is, "including, but not limited to".

[0044] In addition, in the description of this application, unless otherwise specified, " / " means "or." For example, A / B can mean A or B. "And / or" in this document is simply a description of an association relationship between related objects, indicating that three relationships can exist. For example, "A and / or B" can mean: A exists alone, A and B exist simultaneously, and B exists alone. Furthermore, "at least one" means one or more, and "a plurality" means two or more.

[0045] Additionally, the use of “based on” is meant to be open and inclusive, as a process, step, calculation, or other action “based on” one or more stated conditions or values ​​may, in practice, be based on additional conditions or values ​​beyond those stated.

[0046] As mentioned in the background, with the accelerated pace of urbanization, traffic safety has become a major challenge plaguing my country's urban transportation sector. To ensure safe driving and reduce casualties in traffic accidents, passengers in vehicles are required to wear seat belts. However, during actual driving, passengers may forget to wear seat belts or intentionally fail to do so, posing a significant safety hazard. Therefore, effectively detecting seat belt wear is a technical issue that urgently needs to be addressed.

[0047] In related technology, sensors are installed in the seatbelt to detect whether the occupants of a vehicle are wearing seatbelts. For example, when the seatbelt buckle is inserted into the seatbelt holder and locked, the system automatically confirms that the occupant has fastened their seatbelt. Otherwise, if the seatbelt buckle is not inserted into the seatbelt holder, the system confirms that the occupant is not wearing their seatbelt and issues an alarm.

[0048] However, when using this method to detect seatbelt wear, if a occupant does not want to wear a seatbelt, they can simply sit in a seat with a pre-fastened seatbelt or purchase a separate buckle and insert it into the slot, causing the vehicle system to mistakenly identify the seatbelt as being worn. As a result, the accuracy of seatbelt detection is low, and it fails to effectively protect driving safety.

[0049] In this regard, an embodiment of the present application provides a seat belt wearing detection method, which includes: performing face detection on an image to be detected to obtain position information of one or more face detection frames; based on the position information of the one or more face detection frames, identifying a target face detection frame located in a preset seat area from the one or more face detection frames; based on the position information of the target face detection frame, cropping a target human body image corresponding to the target face detection frame from the image to be detected; segmenting a seat belt area image from the target human body image, and judging whether the person corresponding to the target human body image is wearing a seat belt based on the seat belt area image.

[0050] As can be seen, the core idea is that when a person in the vehicle is detected to be in the preset seat area (i.e., when a target face detection frame is identified within the preset seat area), a target body image of the person is segmented from the image to be detected based on the person's facial position. The seatbelt area image within the target body image is then used to determine whether the corresponding person is wearing a seatbelt. This eliminates the need for a seatbelt sensor, reduces detection errors caused by human intervention to avoid detection (e.g., purchasing a separate buckle and inserting it into the seatbelt slot), improves the accuracy of seatbelt wearing detection, and thus enhances driving safety. Furthermore, seatbelt wearing is only detected when the person in the vehicle is in the preset seat area, reducing the computational complexity and improving the efficiency of seatbelt wearing detection. Furthermore, because seatbelt wearing detection is performed only when the person is in the preset seat area, it is possible to skip detection if the image to be detected includes people outside the preset seat area (e.g., pedestrians outside the vehicle window). This avoids the possibility of incorrect detection results from seatbelt wearing tests performed on people outside the preset seat area.

[0051] In order to more clearly illustrate the solution provided by the embodiment of the present application, the application scenario of the seat belt wearing detection method provided by the embodiment of the present application is first described below.

[0052] The seat belt wearing detection method provided in the embodiment of the present application can be applied to any scenario that requires seat belt detection. Optionally, it can be used to detect whether the driver or passengers of the vehicle are wearing seat belts while the vehicle is driving. Optionally, it can also be extended to other scenarios where seat belt detection may exist; for example, when using entertainment facilities (such as high-altitude entertainment facilities such as cable cars or roller coasters), seat belt wearing detection can also be performed based on the seat belt wearing detection method provided in the embodiment of the present application. It should be understood that the present application does not limit the specific application scenarios of the seat belt wearing detection method.

[0053] In addition, the seat belt wearing detection method provided in the embodiments of the present application can be executed by any device with processing functions, and the present application does not specifically limit the execution subject of the seat belt wearing detection method. For example, the above-mentioned execution subject can be a server. For another example, the above-mentioned execution subject can be a vehicle-mounted host. For another example, the above-mentioned execution subject can be an electronic chip with processing functions, such as a graphics processing unit (GPU). For another example, the above-mentioned execution subject can be a mobile phone, tablet computer, desktop, laptop, handheld computer, notebook computer, ultra-mobile personal computer (UMPC), netbook, as well as cellular phone, personal digital assistant (PDA), augmented reality (AR) / virtual reality (VR) device, etc. Optionally, the above-mentioned execution subject can have one or more of a shooting function, a storage function or a communication function. It should be understood that the present application does not specifically limit the specific form of the execution subject of the seat belt wearing detection method.

[0054] To facilitate understanding of the solution, a possible seat belt wearing detection system is introduced below using a vehicle driving scenario as an example. The seat belt wearing detection system can implement the seat belt wearing detection method provided in the embodiment of the present application.

[0055] Figure 1 illustrates a seatbelt detection system 100 according to some embodiments. Referring to Figure 1 , the seatbelt detection system 100 includes a camera 101 and a processing device 102. A wired or wireless communication connection exists between the camera 101 and the processing device 102. In some embodiments, the seatbelt detection system 100 may also include one or more of the following: an alarm device 103, a communication device 104, and a storage device 105.

[0056] The camera device 101 includes at least one camera configured to capture and generate at least one raw image frame. For example, the camera device 101 may be configured to capture and generate a surveillance video comprising at least one raw image frame. Furthermore, the camera device 101 may transmit the generated raw image data to the processing device 102 or the storage device 105.

[0057] In some examples, the camera device 101 can be set inside the vehicle, and the shooting area of ​​the camera device 101 includes the preset seat area. For example, referring to the interior structure diagram of the vehicle shown in Figure 2, the camera device 101 can be set at least one of the following locations: the cockpit A-pillar (the left cockpit A-pillar 201 and / or the right cockpit A-pillar 202), the instrument panel 203, the reading light (not shown in the figure), the central control screen 204 or the center console 205. Furthermore, when setting the position of the camera device 101, it should be ensured that the camera device 101 does not block the driving field of view as much as possible. In a specific example, the camera device 101 is set on the interior panel of the cockpit A-pillar, and the setting of the camera device 101 does not block the driving field of view near the A-pillar. It should be understood that the above-mentioned setting position of the camera device 101 is only an example. As long as it is ensured that the shooting area of ​​the camera device 101 covers the preset seat area of ​​the vehicle after the camera device 101 is set, this application does not impose specific restrictions on this.

[0058] In some examples, the imaging device 101 may be a single camera or a collection of multiple cameras. For example, one or more cameras may be located in the same location. In another example, multiple cameras may be located in different locations within a vehicle. The embodiments of the present application do not impose any specific limitation on the number of cameras included in the imaging device 101.

[0059] The processing device 102 is used to receive the original image taken by the camera device 101, or obtain the original image taken by the camera device 101 from the storage device 105, and analyze and detect the original image. In some examples, the processing device 102 can perform an affine change on the original image so that the preset seat area is adjusted to the middle of the image after the affine change (that is, the image to be detected) through the affine change. In other examples, the processing device 102 may not perform an affine change on the original image, but directly use the original image as the image to be detected. In some examples, the processing device 102 is used to determine whether the person in the vehicle is wearing a seat belt by analyzing and detecting. Furthermore, the processing device 102 can also determine whether an alarm is needed based on the results of the analysis and detection. For example, if it is detected that the person in the vehicle is not wearing a seat belt, the alarm device 103 is notified to issue a corresponding alarm.

[0060] In some examples, the processing device 102 is configured to execute the seat belt wearing detection method and possible implementation thereof shown below.

[0061] In some examples, the processing device 102 can implement one or more of the following functions: pre-processing the image to be detected, such as denoising, sharpening, etc. to improve the clarity of the image to be detected; performing face recognition on the image to be detected to obtain face detection frames of each person in the image to be detected; judging whether the person corresponding to the face detection frame is located in the preset seat area based on the position of the face detection frame detected in the image to be detected and the position of the preset seat area; segmenting the target human image corresponding to the face detection frame from the image to be detected based on the position of the detected face detection frame; detecting whether there is a seat belt in the image to be detected or the target human image in the image to be detected; detecting the position of the seat belt in the image to be detected or the target human image in the image to be detected; determining the slope of the seat belt in the image to be detected or the target human image in the image to be detected based on image recognition; when the face detection frame detected in the image to be detected is located in the preset seat area, judging whether the person corresponding to the face detection frame is wearing a seat belt; detecting whether the vehicle is in a driving state; and notifying the alarm device 103 to issue an alarm when it is detected that the person in the preset seat area is not wearing a seat belt while the vehicle is driving.

[0062] It should be understood that the processing device 102 can be any device with processing functions, such as a vehicle-mounted host, computer equipment, server, chip system, circuit or other discrete device, etc. The processing device 102 can implement the seat belt wearing detection method provided in the embodiment of the present application and its possible implementation methods. This application does not impose specific restrictions on this.

[0063] The alarm device 103 is used to receive the notification from the processing device 102 and perform corresponding alarm operations.

[0064] In some examples, the alarm device 103 may include one or more of a strobe device, a display device, an audio device, or a vibration device. Further, optionally, the alarm device 103 may prompt the alarm information in the form of text, animation, strobe, voice, buzzer, or vibration.

[0065] The communication device 104 is used to implement at least one of the following functions: interactive communication with other devices, communication with the Internet, or communication between various devices within the seat belt wearing detection system 100. For example, the communication device 104 can communicate with the user's terminal device, so that the alarm device 103 sends an alarm message indicating that the seat belt is not worn to the user's terminal device through the communication device 104. For another example, the communication device 104 can receive update information from the Internet, and the update information is used to update the relevant algorithms of the seat belt wearing detection method provided in the embodiment of the present application. For another example, the communication device 104 can implement communication between the camera device 101 and the processing device 102. For another example, the communication device 104 can implement communication between the processing device 102 and the alarm device 103.

[0066] The storage device 105 is used to store one or more of the following information: the original image or surveillance video generated by the camera device 101, the position of the preset seat area, the surveillance video taken by the camera device 101, the algorithm resources required for the processing device 102 to perform detection, the detection results of the processing device 102 (such as the position of the face detection frame obtained by face recognition, the semantic information of each pixel in the image, the position of the seat belt, the slope of the seat belt, etc.), program instructions for executing the seat belt wearing detection method, or alarm information.

[0067] It should be noted that one or more of the aforementioned camera device 101, processing device 102, alarm device 103, communication device 104, and storage device 105 can be deployed independently or integrated. For example, the camera device 101 and processing device 102 can be deployed integrated. For another example, the processing device 102 and alarm device 103 can be deployed integrated. For another example, the processing device 102 and storage device 105 can be deployed integrated. For another example, the camera device 101, processing device 102, and alarm device 103 can be deployed integrated. For another example, the camera device 101, processing device 102, alarm device 103, communication device 104, and storage device 105 can be deployed integrated. Those skilled in the art can combine and deploy them according to actual needs, which will not be listed here, and this application does not impose any specific restrictions on this.

[0068] It should be understood that the various devices of the seat belt detection system shown in FIG1 are merely examples, and other devices may be present in actual applications. For example, although not shown in FIG1 , the seat belt detection system 100 may further include a power supply device (e.g., a battery and a power management chip) to power the various devices of the seat belt detection system 100.

[0069] In addition, those skilled in the art will appreciate that the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems. For example, when the safety wearing detection method provided in the embodiments of the present application is applied to the seat belt wearing detection in the cable car facility scenario, analogous to setting the camera device 101 inside the vehicle in the vehicle driving scenario, the camera device 101 can be set to a position inside the cable car in the cable car facility scenario so that the shooting area covered by the captured image to be detected includes the preset seat area. It should be understood that the system and scenario introduced in the embodiments of the present application are for the purpose of more clearly illustrating the technical solutions of the embodiments of the present application, and do not constitute a limitation on the technical solutions provided in the embodiments of the present application.

[0070] The technical solution in this application will be described in detail below with reference to the accompanying drawings.

[0071] FIG3 is a method for detecting seat belt wearing according to an embodiment of the present application. The method provided by the embodiment of the present application is described in detail below, taking the processing device shown in FIG2 as an example. As shown in FIG3 , the method for detecting seat belt wearing includes the following steps S101 to S104:

[0072] S101 : Perform face detection on an image to be detected to obtain position information of one or more face detection frames.

[0073] In some embodiments, the image to be detected can be a multi-channel image, such as a color image such as an RGB image or a YUV image. Alternatively, the image to be detected can be a single-channel image, such as a brightness image. The embodiments of the present application do not impose any specific restrictions on the type of image to be detected.

[0074] In some embodiments, the image to be detected is acquired by the processing device from a camera device. Exemplarily, the processing device is connected to the camera device, and the processing device acquires an original image captured by the camera device, which is located inside the vehicle (e.g., at least one of the cockpit A-pillars, instrument panel, reading lights, central control screen, or center console) and whose capture area includes a predetermined seating area.

[0075] Optionally, the processing device uses the original image as the image to be detected.

[0076] Optionally, the processing device preprocesses the original image and uses the preprocessed image as the image to be detected. For example, if the capture area of ​​the original image captured by the camera device includes a preset seating area, the captured original image can be affine transformed so that the preset seating area is located in the center of the affine-transformed image, and the affine-transformed image can be used as the image to be detected. This can improve the accuracy of subsequent detection (e.g., face detection) of the image to be detected.

[0077] It should be understood that when the processing device is integrated with the camera device, the processing device can obtain the image to be detected from itself.

[0078] In other embodiments, the image to be detected is obtained by the processing device from a storage device. Exemplarily, the processing device is connected to the storage device, and the storage device stores the original image. The processing device reads the original image from the storage device and uses the original image as the image to be detected, or pre-processes the original image (e.g., performs an affine transformation) and uses it as the image to be detected. The affine transformation process can be referred to the description above and will not be repeated here.

[0079] Optionally, a surveillance video is stored in the storage device, which includes at least one frame of original image; when the processing device reads the original image from the storage device, it can read it frame by frame or skip frames (for example, reading the original image once every preset number of frames), and this application does not impose any specific restrictions on this.

[0080] It should be understood that when the processing device is integrated with the storage device, the processing device can obtain the image to be detected from itself.

[0081] In some embodiments, the position information of the face detection frame may include the pixel coordinates of the four vertices of the face detection frame. For example, the position information of the face detection frame may be {(x1, y1), (x1, y2), (x2, y1), (x2, y2)}, where (x1, y1) is the pixel coordinate of the upper left vertex of the face detection frame in the image to be detected, (x1, y2) is the pixel coordinate of the lower left vertex of the face detection frame in the image to be detected, (x2, y1) is the pixel coordinate of the upper right vertex of the face detection frame in the image to be detected, and (x2, y2) is the pixel coordinate of the lower right vertex of the face detection frame in the image to be detected.

[0082] In some embodiments, before performing face detection on the image to be detected, a first image preprocessing operation is further performed on the image to be detected to improve the accuracy of face detection.

[0083] Optionally, the first image preprocessing includes resizing. Exemplarily, the image to be detected is resized to a preset size so that the input to the face detection model is an image of the preset size, thereby improving the accuracy of face detection. In a specific example, the preset size is 1920*1080.

[0084] Optionally, the first image preprocessing includes at least one of brightness change, sharpening, or denoising, so as to improve the clarity of the image to be detected.

[0085] Optionally, the first image preprocessing includes normalization processing to make the gradient of the face detection model converge when performing face detection, thereby improving the speed and accuracy of face detection. Exemplarily, the normalization processing can be performed on the image to be detected based on the following formula (1) or formula (2):

[0086]

[0087] Among them, Input is used to represent the pixel value of a single pixel in the image to be detected, mean is used to represent the average value of the pixel values ​​of all pixels in the image to be detected, std is used to represent the standard deviation of the pixel values ​​of all pixels in the image to be detected, and Output is used to represent the value obtained after normalizing the pixel value of the single pixel.

[0088]

[0089] Among them, Input is used to represent the pixel value of a single pixel of the image to be detected, min is used to represent the minimum value among the pixel values ​​of all pixels in the image to be detected, max is used to represent the maximum value among the pixel values ​​of all pixels in the image to be detected, and Output is used to represent the value obtained after normalizing the pixel value of the single pixel.

[0090] The following explanation uses an RGB image as an example. When the image to be detected is an RGB image, the pixel value Input of a single pixel of the image to be detected can be expressed as Input = [ri, gi, bi], where ri is the value of the R channel of the pixel, gi is the value of the G channel of the pixel, and bi is the value of the B channel of the pixel. In an RGB image, the values ​​of the R channel, G channel, and B channel all range from [0, 255]. Therefore, the value range of each channel of the pixel value corresponding to the single pixel of Input can be [0, 255].

[0091] It should be noted that when using some data processing software (such as MATLAB) for normalization processing, in order to facilitate calculation, the value range of the pixel value Input of a single pixel is sometimes mapped proportionally from [0,255] to [0,1] (for example, the pixel value of a single pixel is multiplied by 1 / 255), and then the mapped Input is substituted into the above formula (1) or formula (2) for normalization. It is understandable that after the pixel values ​​of all pixels in the image to be detected are proportionally mapped, the value range of the mean value mean and the standard deviation std calculated based on the pixel values ​​of all pixels will also be correspondingly reduced to 1 / 255 of the value range before mapping, so it does not affect the normalization results of formula (1) and formula (2), so this application does not impose any restrictions on this.

[0092] In some embodiments, step S101 is specifically implemented by inputting the image to be detected into a pre-trained face detection model to obtain location information of one or more face detection frames. For example, the image to be detected is input into the pre-trained face detection model, and when a face is detected in the image to be detected, the location information of one or more face detection frames is output.

[0093] The face detection model can be a model trained using deep learning or machine learning. In some examples, the face detection model is a model trained using the RetinaFace network or the InsightFace network. It should be understood that the embodiments of this application do not specifically limit the networks used for deep learning or machine learning. As an example, the training method for the face detection model can refer to the embodiment shown in Figure 8 below and will not be described in detail here.

[0094] S102: Based on the position information of the one or more face detection frames, identify a target face detection frame located in a preset seat area from the one or more face detection frames.

[0095] In some embodiments, the preset seating area includes at least one of the following areas: the driver's seat area, the passenger seat area, or the rear seat area of ​​the vehicle. It should be understood that the preset seating area herein is exemplified in a vehicle driving scenario and may include different contents in different application scenarios. For example, in a cable car application scenario, the preset seating area is the seating area in the cable car. It should be understood that the specific contents of the preset seating area are not limited in this embodiment of the application.

[0096] In some embodiments, the position information of the preset seat area is preset by the processing device. Exemplarily, the position information of the preset seat area is the pixel coordinates of the preset seat area in the image to be detected.

[0097] In some embodiments, the size information of the preset seat area is preset by the processing device, and is the size information of the preset seat area image corresponding to the preset seat area. For example, the size information of the preset seat area image can be preset to 640*640.

[0098] In some embodiments, as shown in FIG4 , step S102 may be specifically implemented as the following steps S1021 and S1022:

[0099] S1021. For each face detection frame in the one or more face detection frames, determine the degree of overlap between the face detection frame and the preset seat area based on the position information of the face detection frame and the position information of the preset seat area.

[0100] In some examples, the degree of overlap between the face detection frame and the preset seat area is: the area of ​​the overlapped area between the face detection frame and the preset seat area.

[0101] Correspondingly, step S1021 can be specifically implemented as follows: for each face detection frame in one or more face detection frames, based on the position information of the face detection frame and the position information of the preset seat area, determine the position information of the overlapping area between the face detection frame and the preset seat area; based on the position information of the overlapping area, determine the number of pixels of the overlapping area image, determine the number of pixels of the overlapping area image as the area of ​​the overlapping area, and use the area of ​​the overlapping area as the degree of overlap between the face detection frame and the preset seat area.

[0102] In some examples, the degree of overlap between the face detection frame and the preset seat area is: the ratio of the area of ​​the overlap between the face detection frame and the preset seat area to the area of ​​the preset seat area.

[0103] Correspondingly, step S1021 can be specifically implemented as follows: for each face detection frame in one or more face detection frames, based on the position information of the face detection frame and the position information of the preset seat area, determine the position information of the overlapping area between the face detection frame and the preset seat area; based on the position information of the overlapping area, determine the number of pixels of the overlapping area image, and determine the number of pixels of the overlapping area image as the area of ​​the overlapping area; based on the position information of the preset seat area, determine the number of pixels of the preset seat area image, and determine the number of pixels of the preset seat area image as the area of ​​the preset seat area; determine the ratio of the area of ​​the overlapping area to the area of ​​the preset seat area, and use the ratio of the area of ​​the overlapping area to the area of ​​the preset seat area as the degree of overlap between the face detection frame and the preset seat area.

[0104] In some examples, the degree of overlap between the face detection frame and the preset seat area is: the ratio of the area of ​​the overlap between the face detection frame and the preset seat area to the area of ​​the face detection frame.

[0105] Correspondingly, step S1021 can be specifically implemented as follows: for each face detection frame in one or more face detection frames, based on the position information of the face detection frame and the position information of the preset seat area, determine the position information of the overlapping area between the face detection frame and the preset seat area; based on the position information of the overlapping area, determine the number of pixels of the overlapping area image, and determine the number of pixels of the overlapping area image as the area of ​​the overlapping area; based on the position information of the face detection frame, determine the number of pixels of the face detection frame image, and determine the number of pixels of the face detection frame image as the area of ​​the face detection frame; determine the ratio of the area of ​​the overlapping area to the area of ​​the face detection frame, and use the ratio of the area of ​​the overlapping area to the area of ​​the face detection frame as the degree of overlap between the face detection frame and the preset seat area.

[0106] In some examples, the degree of overlap between the face detection frame and the preset seat area is calculated as: the intersection-and-union ratio (IoU) of the face detection frame and the preset seat area. The IoU is also called the overlap ratio. If the overlap area between the face detection frame and the preset seat area is defined as a first area, and the union area between the face detection frame and the preset seat area is defined as a second area, the IoU ratio of the face detection frame and the preset seat area is the ratio of the area of ​​the first area to the area of ​​the second area.

[0107] Correspondingly, step S1021 can be specifically implemented as follows: for each face detection frame in one or more face detection frames, determine the position information of the first area and the position information of the second area based on the position information of the face detection frame and the position information of the preset seat area; determine the number of pixels of the image corresponding to the first area based on the position information of the first area, and determine the number of pixels of the image corresponding to the first area as the area of ​​the first area; determine the number of pixels of the image corresponding to the second area based on the position information of the second area, and determine the number of pixels of the image corresponding to the second area as the area of ​​the second area; determine the intersection-and-union ratio of the face detection frame and the preset seat area based on the ratio of the area of ​​the first area to the area of ​​the second area, and use the intersection-and-union ratio of the face detection frame and the preset seat area as the degree of overlap between the face detection frame and the preset seat area.

[0108] S1022: When the degree of overlap between the face detection frame and the preset seat area is greater than a first overlap threshold, determine that the face detection frame is a target face detection frame.

[0109] It should be understood that if the degree of overlap between the face detection frame and the preset seating area is greater than a first overlap threshold, the person corresponding to the face detection frame can be considered to be within the preset seating area. Therefore, the face detection frame can be determined as the target face detection frame for subsequent processing (such as seatbelt wearing detection). This allows the seatbelt wearing detection to be performed on the person corresponding to the face detection frame only when the detected face detection frame is within the preset seating area. This reduces the amount of computation required in subsequent detection processes.

[0110] S103 : based on the position information of the target face detection frame, cropping a target human body image corresponding to the target face detection frame from the image to be detected.

[0111] In some embodiments, as shown in FIG5 , step S103 may be specifically implemented as the following steps S1031 to S1032:

[0112] S1031. Determine the height and width of the target human body image corresponding to the target face detection frame based on the height and width of the target face detection frame.

[0113] The ratio of the height of the target human image to the height of the target face detection frame is a preset first ratio, and the ratio of the width of the target face detection frame to the width of the target human image is a preset second ratio.

[0114] In a specific example, the first ratio is 1.5 and the second ratio is 2. In another specific example, the first ratio is 2.5 and the second ratio is 2. It should be understood that the first ratio and the second ratio here are only examples, and the present application does not limit their specific values.

[0115] S1032: based on the position information of the target face detection frame and the height and width of the target body image, crop the target body image corresponding to the target face detection frame from the image to be detected.

[0116] For example, as shown in FIG6 , if the position information of the target face detection frame is {(x3, y3), (x4, y3), (x3, y4), (x4, y4)}, the height of the target body image is h, and the width of the target body image is w, then the position information of the target body image is {(x3-w / 2, y3), (x3-w / 2, y3+h), (x4+w / 2, y3), (x4+w / 2, y3+h)}. Then, based on the position information of the target body image, the target body image corresponding to the target face detection frame is segmented from the image to be detected.

[0117] Among them, (x3, y3) is the pixel coordinate of the upper left corner vertex of the target face detection frame in the image to be detected, (x4, y3) is the pixel coordinate of the lower left corner vertex of the target face detection frame in the image to be detected, (x3, y4) is the pixel coordinate of the upper right corner vertex of the target face detection frame in the image to be detected, and (x4, y4) is the pixel coordinate of the lower right corner vertex of the target face detection frame in the image to be detected.

[0118] It should be understood that the method for determining the position information of the target human image shown in Figure 6 is only an example. As long as the target face detection frame is roughly located in the middle and upper part of the target human image, this application does not impose any specific restrictions on this.

[0119] S104 , segmenting a seat belt area image from the target human image, and determining whether the person corresponding to the target human image is wearing a seat belt based on the seat belt area image.

[0120] In some embodiments, as shown in FIG7 , the above step S104 may be specifically implemented as the following steps S1041 to S1043:

[0121] S1041. Segment a seat belt area image from the target human body image.

[0122] In some examples, the above-mentioned step S1041 can be specifically implemented as follows: inputting the target human body image into a seat belt wearing detection model to obtain semantic information of each pixel in the target human body image, and the semantic information is used to indicate the object type corresponding to the pixel; based on the semantic information of each pixel, segmenting the seat belt area image from the target human body image.

[0123] As an example, the object type indicated by the semantic information includes: seat belt.

[0124] As an example, considering that when performing actual seat belt area image segmentation, if the human body in the target human image is marked at the same time during the process of segmenting the seat belt area image, the accuracy of seat belt segmentation will be improved to a certain extent, the object type indicated by the semantic information can also include: human body.

[0125] As an example, the training method of the seat belt wearing detection model can still refer to the embodiment shown in Figure 8 below, which will not be described in detail here.

[0126] S1042: Determine attribute parameters of the seat belt based on the seat belt area image.

[0127] In some embodiments, the attribute parameters of the seat belt include one or more of the following: the slope of the seat belt, which is used to characterize the degree of inclination of the straight line after fitting the seat belt area image relative to the bottom edge of the target human body image; the area of ​​the seat belt area image; the degree of overlap between the seat belt area image and the target human body image; and the degree of overlap between the seat belt area image and the human body area image segmented from the target human body image.

[0128] In some exemplary embodiments, the slope of the seat belt can be determined by performing a straight line fit on the seat belt area image based on a Hough transform, and determining the degree of inclination of the straight line after fitting the seat belt area image relative to the bottom edge of the target human image based on the straight line fit result, thereby determining the slope of the seat belt. Optionally, before performing the Hough transform on the seat belt area image, the seat belt area image can also be subjected to at least one erosion and / or dilation operation to remove redundant detail information in the seat belt area image, so that the seat belt area image forms a more coherent connected domain, thereby improving the accuracy of subsequent straight line fitting. It should be understood that the above-mentioned slope of the seat belt can also be replaced by the angle between the straight line after fitting the seat belt and the bottom edge of the target human image.

[0129] In some exemplary embodiments, the area of ​​the seat belt area image may be determined by: determining the number of pixels of the seat belt area image based on the seat belt area image; and determining the number of pixels of the seat belt area image as the area of ​​the seat belt area image.

[0130] In some exemplary embodiments, the degree of overlap between the seatbelt area image and the target body image is any one of the following: the area of ​​the seatbelt area image; or the ratio of the area of ​​the seatbelt area image to the area of ​​the target body image. It should be understood that the area of ​​the seatbelt area image can be the number of pixels in the seatbelt area image, and the area of ​​the target body image can be the number of pixels in the target body image.

[0131] In some exemplary embodiments, the degree of overlap between the seatbelt region image and the human body region image is any one of the following: the area of ​​the overlapping region between the seatbelt region image and the human body region image; the ratio of the area of ​​the overlapping region between the seatbelt region image and the human body region image to the area of ​​the human body region image; the ratio of the area of ​​the overlapping region between the seatbelt region image and the human body region image to the area of ​​the seatbelt region image; or the intersection-and-union ratio between the seatbelt region image and the human body region image. It should be understood that, for ease of calculation, the area of ​​the image can be represented by the number of pixels in the image. For example, the number of pixels in the human body region image can be used as the area of ​​the human body region image.

[0132] The human body region image can be obtained by inputting the target human body image into a seatbelt detection model to obtain a segmented human body region image and a seatbelt region image. Alternatively, the target human body image can be subjected to human body contour edge detection to determine the pixel positions of the human body contour edges; and based on the pixel positions of the human body contour edges, the human body region image can be segmented from the target human body image. It should be understood that this application does not impose any specific limitations on the method for human body region image segmentation.

[0133] S1043: When the attribute parameters of the safety belt meet the preset conditions, determine that the person corresponding to the target human image is wearing the safety belt.

[0134] In some embodiments, the preset condition includes a first preset condition, and the first preset condition includes: the slope of the seat belt is within a preset range.

[0135] In some embodiments, the preset condition includes a second preset condition, and the second preset condition includes at least one of the following: the area of ​​the seat belt area image exceeds a preset area threshold; the overlap between the seat belt area image and the target human body image is greater than or equal to a second overlap threshold; or, the overlap between the seat belt area image and the human body area image is greater than or equal to a third overlap threshold.

[0136] It should be understood that when a person is wearing a seatbelt correctly, the seatbelt sits diagonally across their chest. Therefore, the seatbelt appears over a large area in the target person image and at a certain angle. Therefore, based on the combination of various sub-conditions within the aforementioned pre-set conditions (e.g., the first pre-set condition and / or the second pre-set condition), it is possible to accurately determine whether a person is wearing a seatbelt.

[0137] In a specific example, if the attribute parameters of the seat belt meet a first preset condition, it is determined that the person corresponding to the target human image is wearing the seat belt. For example, if the slope of the seat belt is within a preset range, it is determined that the person corresponding to the target human image is wearing the seat belt.

[0138] In another specific example, if the attribute parameters of the seat belt meet a second preset condition, the person corresponding to the target human image is determined to be wearing a seat belt. For example, assuming the second preset condition is that the area of ​​the seat belt region image exceeds a preset area threshold, then if the area of ​​the seat belt region image exceeds the preset area threshold, the person corresponding to the target human image is determined to be wearing a seat belt.

[0139] In another specific example, when the attribute parameters of the seat belt meet the first preset condition and the second preset condition, it is determined that the person corresponding to the target human image is wearing the seat belt.

[0140] For example, assuming that the second preset condition is that the area of ​​the seat belt area image exceeds the preset area threshold, then when the slope of the seat belt is within the preset range and the area of ​​the seat belt area image exceeds the preset area threshold, it is determined that the person corresponding to the target human image is wearing a seat belt.

[0141] For another example, assuming that the second preset condition includes: the area of ​​the seat belt area image exceeds the preset area threshold, and the degree of overlap between the seat belt area image and the target human image is greater than or equal to the second overlap threshold, then when the slope of the seat belt is within the preset range, the area of ​​the seat belt area image exceeds the preset area threshold, and the degree of overlap between the seat belt area image and the target human image is greater than or equal to the second overlap threshold, it is determined that the person corresponding to the target human image is wearing a seat belt.

[0142] Furthermore, to reduce the amount of computation required during the detection process, it is not necessary to individually determine all of the pre-set conditions. For example, assuming that the property parameters of the seat belt satisfy both the first and second pre-set conditions, and that the person corresponding to the target body image is wearing a seat belt, it is possible to first determine whether the property parameters of the seat belt satisfy the first pre-set condition. If not, it is then directly determined that the person corresponding to the target body image is not wearing a seat belt, without further determining whether the property parameters of the seat belt satisfy the second pre-set condition.

[0143] As a specific example, step S1043 can be implemented as follows: determining whether the attribute parameters of the seat belt meet the first preset condition; if the attribute parameters of the seat belt do not meet the first preset condition, determining that the person is not wearing the seat belt; if the attribute parameters of the seat belt meet the first preset condition, determining whether the attribute parameters of the seat belt meet the second preset condition; if the attribute parameters of the seat belt do not meet the second preset condition, determining that the person is not wearing the seat belt; if the attribute parameters of the seat belt meet the second preset condition, determining that the person is wearing the seat belt.

[0144] Based on this, the computational complexity of the seatbelt wearing detection process can be reduced. Similarly, it is also possible to first determine whether the seatbelt attribute parameters meet the second preset condition. If not, it is directly determined that the person corresponding to the target human image is not wearing a seatbelt, without further determining whether the seatbelt attribute parameters meet the second preset condition. It should be understood that this application does not impose specific limitations on this.

[0145] The technical solution provided by the embodiment of the present application does not rely on the card seat sensor, reduces the detection error caused by human active avoidance of detection (such as purchasing a separate card buckle and inserting it into the card slot of the seat belt), improves the accuracy of the seat belt wearing detection, and thus improves driving safety. In addition, when the person on the vehicle is located in the preset seat area, it is detected whether the person is wearing a seat belt, which reduces the amount of detection calculation and improves the efficiency of the seat belt wearing detection. Moreover, since the seat belt wearing detection is performed on the person located in the preset seat area in the image to be detected, it can avoid the error of performing the seat belt wearing detection on the person outside the preset seat area (such as pedestrians outside the car window) in the image to be detected, thereby avoiding the error of obtaining an erroneous detection result.

[0146] In some embodiments, the present application provides a model training method applicable to the above-mentioned face detection model and / or seat belt wearing detection model. As shown in Figure 8, the model training method includes the following steps S201 to S205:

[0147] S201: Obtain a sample set.

[0148] The sample set includes multiple samples, each sample corresponds to a frame of image and a label corresponding to the image, and the image and the label correspond one to one.

[0149] As an example, the sample images display at least one of the following: cockpit, driver, driver's seat, passenger, and seat belt. It should be understood that the content here is merely illustrative and can vary based on actual needs (for example, when training a face detection model, the sample images display content should include faces), and this application does not impose specific restrictions on this.

[0150] As an example, when training a face detection model, the label corresponding to the image can be used to annotate the location information of the face detection box in the image.

[0151] As an example, when training a seatbelt wearing detection model, the label corresponding to the image can be used to annotate the semantic information of each pixel in the image, and the semantic information is used to indicate the object type corresponding to the pixel. Optionally, when it is necessary to segment the seatbelt area image based on the seatbelt wearing detection model, the object type indicated by the semantic information includes the seatbelt. Furthermore, to improve the accuracy of the seatbelt area image segmentation, the object type indicated by the semantic information can also include the human body. Optionally, when it is necessary to segment the human body area image based on the seatbelt wearing detection model, the object type indicated by the semantic information includes the human body.

[0152] S202 : For each sample in the sample set, perform image preprocessing on the image in the sample to obtain a preprocessed image.

[0153] In some examples, image preprocessing includes first image preprocessing and / or second image preprocessing.

[0154] Wherein, the second image preprocessing includes at least one of the following: random cropping, left-right flipping, random cropping and splicing, or color enhancement. Optionally, based on random cropping (randomcrop) processing, the generalization of the face detection model in the case of different sizes of images can be improved. Optionally, based on left-right flipping processing, the generalization of the face detection model in the case of people wearing seat belts in different directions in the seat area in the image can be improved. Optionally, based on random cropping and splicing (cutmix) processing, the generalization of the image in different splicing situations can be improved. Optionally, based on color enhancement (color jetter) processing, such as random adjustment of brightness, random adjustment of saturation, or random adjustment of contrast, the generalization of the image under different colors can be improved.

[0155] The first image preprocessing may refer to the above description and will not be repeated here.

[0156] S203: Input the preprocessed image into the model to be trained to obtain the prediction result corresponding to the sample.

[0157] Optionally, the size of the preprocessed image is a preset size.

[0158] Optionally, when training a face detection model, the prediction result corresponding to the sample is the position information of the predicted face detection frame.

[0159] Optionally, when training a seat belt wearing detection model, the prediction result corresponding to the sample includes semantic information of each predicted pixel.

[0160] Optionally, when training a face detection model, the model to be trained can be built based on the RetinaFace network; when training a seatbelt detection model, the model to be trained can be built based on the Deeplabv3+ network. It should be understood that this application does not impose any specific restrictions on the networks used during the training process of models (e.g., face detection models and / or seatbelt detection models).

[0161] It should be understood that the above step S202 is optional. When step S202 is not performed, step S203 can be implemented as follows: inputting the image in the sample into the model to be trained to obtain the prediction result corresponding to the sample.

[0162] S204: Determine the loss value output by the model based on the cross entropy of the prediction result corresponding to the sample and the label corresponding to the sample.

[0163] In some examples, the cross entropy between the prediction result corresponding to the sample and the label corresponding to the sample can satisfy the following formula (3):

[0164]

[0165] Among them, loss is used to represent the cross entropy between the prediction result corresponding to the sample and the label corresponding to the sample, label is used to represent the label corresponding to the sample, and x is used to represent the prediction result corresponding to the sample.

[0166] S205. Determine the gradient of the weight of each node in the model to be trained based on the loss value output by the model, and update the weight of each node in the model to be trained based on the obtained gradient.

[0167] In this way, the above steps S203 to S205 are repeated until the preset training termination condition is met to obtain a trained model.

[0168] In some embodiments, when it is detected that the person corresponding to the target human image is not wearing a seat belt, an alarm may be issued. For example, as shown in FIG9 , after step S104, step S105 is further included:

[0169] S105 : In response to detecting that the vehicle is in a driving state and the person corresponding to the target human image is not wearing a seat belt, issuing a prompting message for prompting the person to wear a seat belt.

[0170] In some embodiments, in response to detecting that the vehicle is in motion and the person corresponding to the target human image is not wearing a seat belt, an alarm message is prompted in the form of text, animation, strobe light, voice, beep, or vibration.

[0171] In some embodiments, the processing device and the alarm device are independently deployed and connected, and step S105 is specifically implemented as follows: in response to detecting that the vehicle is in a driving state and the person corresponding to the target human image is not wearing a seat belt, the processing device sends a prompt message through the alarm device to remind the person to wear a seat belt.

[0172] In some embodiments, the processing device is integrated with the alarm device, and step S105 is specifically implemented as follows: in response to detecting that the vehicle is in a driving state and the person corresponding to the target human image is not wearing a seat belt, a prompt message is issued to remind the person to wear a seat belt.

[0173] In some embodiments, after the seat belt wearing detection function is turned on, the processing device obtains the image to be detected and executes the seat belt wearing detection method shown in the embodiments of the present application.

[0174] Optionally, the processing device enables a seat belt wearing detection function.

[0175] Optionally, in response to receiving an instruction to start the seat belt wearing detection function, the processing device starts the seat belt wearing detection function.

[0176] To facilitate understanding, a specific example is shown below.

[0177] 10 , after the processing device obtains the image to be detected 500 , it performs face detection on the image to be detected 500 to obtain position information of a face detection frame 501 in the image to be detected 500 .

[0178] After determining that the face detection frame 501 is located in the preset seat area based on the position information of the face detection frame 501 , the face detection frame 501 is determined as a target face detection frame.

[0179] Based on the position information of the target face detection frame (i.e., the face detection frame 501), according to the first ratio of 2 and the second ratio of 2.5, the target human body image 502 corresponding to the target face detection frame is cropped from the image 500 to be detected, so that the height of the target human body image 502 is twice the height of the face detection frame 501, and the width of the target human body image 502 is 2.5 times the width of the face detection frame 501.

[0180] A seat belt area image 503 and a human body area image 504 are segmented from the target human body image 502 .

[0181] A linear fit is performed on the seat belt area image 503 through Hough transform to obtain the slope of the seat belt.

[0182] The degree of overlap between the seat belt area image 503 and the human body area image 504 is calculated.

[0183] When the slope of the seat belt is within a preset range and the overlap between the seat belt area image 503 and the human body area image 504 is greater than or equal to a third overlap threshold, it is determined that the person corresponding to the target human body image is not wearing a seat belt.

[0184] Furthermore, when it is detected that the person corresponding to the target human image is not wearing a seat belt and the vehicle is in a moving state, a prompting message for prompting the person to wear a seat belt may be issued.

[0185] It can be seen that the above mainly introduces the solution provided by the embodiment of the present application from the perspective of the method. In order to achieve the above functions, the embodiment of the present application provides a hardware structure and / or software module corresponding to the execution of each function. Those skilled in the art should easily appreciate that, in combination with the modules and algorithm steps of each example described in the embodiment disclosed herein, the embodiment of the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in a hardware or computer software driven hardware manner depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0186] As shown in Figure 11, an embodiment of the present application provides a seat belt wearing detection device for executing the above-mentioned seat belt wearing detection method and any possible implementation thereof. The seat belt wearing detection device 300 includes: a face detection module 301, a human body detection module 302, and a wearing detection module 303. The face detection module 301 is used to perform face detection on the image to be detected and obtain the position information of one or more face detection frames; based on the position information of one or more face detection frames, identify the target face detection frame located in the preset seat area from the one or more face detection frames. The human body detection module 302 is used to crop the target human body image corresponding to the target face detection frame from the image to be detected based on the position information of the target face detection frame. The wearing detection module 303 is used to segment the seat belt area image from the target human body image, and judge whether the person corresponding to the human body area image is wearing a seat belt based on the seat belt area image.

[0187] In some embodiments, the above-mentioned face detection module 301 is specifically used to determine the overlap between the face detection frame and the preset seat area for each face detection frame in one or more face detection frames based on the position information of the face detection frame and the position information of the preset seat area; when the overlap between the face detection frame and the preset seat area is greater than or equal to the first overlap threshold, the face detection frame is determined to be a target face detection frame.

[0188] In some embodiments, the above-mentioned wearing detection module 303 is specifically used to determine the attribute parameters of the seat belt based on the seat belt area image, and the attribute parameters of the seat belt include the slope of the seat belt; the slope of the seat belt is used to characterize the degree of inclination of the straight line after fitting the seat belt area image relative to the bottom edge of the target human image; when the attribute parameters of the seat belt meet the preset conditions, it is determined that the person corresponding to the target human image is wearing the seat belt, and the preset conditions include a first preset condition, and the first preset condition includes that the slope of the seat belt is within a preset range.

[0189] In some embodiments, the wearing detection module 303 is further used to segment a human body area image from a target human body image; the attribute parameters of the seat belt also include at least one of the following: the area of ​​the seat belt area image, the degree of overlap between the seat belt area image and the target human body image, and the degree of overlap between the seat belt area image and the human body area image.

[0190] In some embodiments, the above-mentioned preset conditions also include a second preset condition, and the second preset condition includes at least one of the following: the area of ​​the seat belt area image exceeds a preset area threshold; the overlap between the seat belt area image and the target human body image is greater than or equal to a second overlap threshold; or, the overlap between the seat belt area image and the human body area image is greater than or equal to a third overlap threshold.

[0191] In some embodiments, the above-mentioned wearing detection module 303 is specifically used to determine whether the attribute parameters of the seat belt meet the first preset condition; when the attribute parameters of the seat belt do not meet the first preset condition, determine that the person corresponding to the target human image is not wearing a seat belt; when the attribute parameters of the seat belt meet the first preset condition, determine whether the attribute parameters of the seat belt meet the second preset condition; when the attribute parameters of the seat belt do not meet the second preset condition, determine that the person corresponding to the target human image is not wearing a seat belt; when the attribute parameters of the seat belt meet the second preset condition, determine that the person corresponding to the target human image is wearing a seat belt.

[0192] In some embodiments, the above-mentioned human body detection module 302 is specifically used to determine the height and width of the target human body image corresponding to the target face detection frame based on the height and width of the target face detection frame; wherein, the ratio of the height of the target human body image to the height of the target face detection frame is a preset first ratio, and the ratio of the width of the target face detection frame to the width of the target human body image is a preset second ratio; based on the position information of the target face detection frame, and the height and width of the human body area image, the target human body image corresponding to the target face detection frame is cropped from the image to be detected.

[0193] In some embodiments, the apparatus further includes a camera module 304 and a preprocessing module 305. The camera module 304 is configured to capture an original image; the camera module 304 is positioned within the vehicle interior, and the camera area captured by the camera module 304 includes a predetermined seating area. The preprocessing module 305 is configured to perform an affine transformation on the original image to obtain an image to be detected; the predetermined seating area is located in the center of the image to be detected.

[0194] In some embodiments, the camera module 304 is disposed at at least one of the following locations: a cockpit A-pillar, an instrument panel, a reading light, a central control screen, or a central console.

[0195] In some embodiments, the above-mentioned wearing detection module 303 is specifically used to input the target human body image into the seat belt wearing detection model to obtain the semantic information of each pixel in the target human body image; the semantic information is used to indicate the object type corresponding to the pixel; based on the semantic information of each pixel, the seat belt area image is segmented from the target human body image.

[0196] In some embodiments, the face detection module 301 is specifically configured to input the image to be detected into a face detection model to obtain position information of one or more face detection frames.

[0197] In some embodiments, the above-mentioned seat belt wearing detection device also includes an alarm module 306, and the above-mentioned alarm module 306 is also used to issue a prompt message to remind the person to wear a seat belt in response to detecting that the vehicle is in a driving state and the person corresponding to the target human image is not wearing a seat belt.

[0198] It should be noted that the module division shown in FIG11 is schematic and represents only one logical functional division. In actual implementation, other divisions may be employed. For example, two or more functions may be integrated into a single processing module. Such integrated modules may be implemented in either hardware or software functional modules.

[0199] In addition, an embodiment of the present application provides an electronic device as described in the above embodiments. As shown in FIG12 , the electronic device 400 includes a processor 402 and a bus 404 . Optionally, the electronic device may further include a memory 401 ; and optionally, a communication interface 403 .

[0200] Processor 402 may implement or execute the various exemplary logic blocks, modules, and circuits described in conjunction with the disclosure of this application. Processor 402 may be a central processing unit, a general-purpose processor, a digital signal processor, an application-specific integrated circuit, a field-programmable gate array or other programmable logic device, a transistor logic device, a hardware component, or any combination thereof. It may implement or execute the various exemplary logic blocks, modules, and circuits described in conjunction with the disclosure of this application. Processor 402 may also be a combination that implements computing functions, such as a combination of one or more microprocessors, or a combination of a DSP and a microprocessor.

[0201] The communication interface 403 is used to connect to other devices via a communication network, such as Ethernet, wireless access network, wireless local area network (WLAN), etc.

[0202] The memory 401 may be a read-only memory (ROM) or other type of static storage device that can store static information and instructions, a random access memory (RAM) or other type of dynamic storage device that can store information and instructions, or an electrically erasable programmable read-only memory (EEPROM), a disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto.

[0203] As a possible implementation, memory 401 can exist independently of processor 402. Memory 401 can be connected to processor 402 via bus 404 to store instructions or program codes. When processor 402 calls and executes the instructions or program codes stored in memory 401, the seat belt wearing detection method provided in the embodiment of the present application can be implemented.

[0204] In another possible implementation, the memory 401 may also be integrated with the processor 402 .

[0205] Bus 404 can be an Extended Industry Standard Architecture (EISA) bus, etc. Bus 404 can be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, FIG12 shows only one thick line, but this does not mean that there is only one bus or only one type of bus.

[0206] Through the description of the above implementation methods, technical personnel in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the electronic device can be divided into different functional modules to complete all or part of the functions described above.

[0207] Some embodiments of the present application provide a computer-readable storage medium (e.g., a non-transitory computer-readable storage medium), which stores computer program instructions. When the computer program instructions are run on a computer (e.g., an electronic device or a seat belt wearing detection device), the computer executes the seat belt wearing detection method described in any of the above embodiments.

[0208] Exemplarily, the above-mentioned computer-readable storage media may include, but are not limited to: magnetic storage devices (e.g., hard disks, floppy disks, or magnetic tapes), optical disks (e.g., CDs (Compact Disks), DVDs (Digital Versatile Disks), etc.), smart cards, and flash memory devices (e.g., EPROMs (Erasable Programmable Read-Only Memory), cards, sticks, or key drives, etc.). The various computer-readable storage media described herein may represent one or more devices and / or other machine-readable storage media for storing information. The term "machine-readable storage medium" may include, but is not limited to, wireless channels and various other media capable of storing, containing, and / or carrying instructions and / or data.

[0209] Some embodiments of the present application further provide a computer program product, for example, stored on a non-transitory computer-readable storage medium. The computer program product includes computer program instructions that, when executed on a computer (e.g., an electronic device or a seat belt wearing detection device), cause the computer to perform the seat belt wearing detection method described in the above embodiments.

[0210] Some embodiments of the present application further provide a computer program that, when executed on a computer (eg, an electronic device or a seat belt wearing detection device), causes the computer to execute the seat belt wearing detection method described in the above embodiments.

[0211] The beneficial effects of the above-mentioned non-transitory computer-readable storage medium, computer program product and computer program are the same as the beneficial effects of the seat belt wearing detection method described in some of the above embodiments, and will not be repeated here.

[0212] Although the present application is described herein in conjunction with various embodiments, in the process of implementing the claimed application, those skilled in the art may understand and implement other variations of the disclosed embodiments by reviewing the drawings, the disclosure, and the appended claims. In the claims, the word "comprising" does not exclude other components or steps, and "one" or "an" does not exclude multiple components. A single processor or other unit may implement several functions listed in the claims. Certain measures are recorded in different dependent claims, but this does not mean that these measures cannot be combined to produce good results.

[0213] Although the present application has been described with reference to specific features and embodiments thereof, it is apparent that various modifications and combinations may be made thereto without departing from the spirit and scope of the present application. Accordingly, this specification and the drawings are merely illustrative of the present application as defined by the appended claims and are deemed to cover any and all modifications, variations, combinations or equivalents within the scope of the present application. Obviously, those skilled in the art may make various modifications and variations to the present application without departing from the spirit and scope of the present application. Thus, the present application is intended to include such modifications and variations as fall within the scope of the claims of the present application and their equivalents.

[0214] The above are only specific embodiments of the present application, but the scope of protection of the present application is not limited thereto. Any changes or replacements within the technical scope disclosed in this application should be included in the scope of protection of the present application. Therefore, the scope of protection of the present application should be based on the scope of protection of the claims.

Claims

1. A method for detecting seat belt wearing, wherein: include: Perform face detection on the image to be detected to obtain the position information of one or more face detection frames; Based on the position information of the one or more face detection frames, identifying a target face detection frame located in a preset seat area from the one or more face detection frames; Based on the position information of the target face detection frame, cropping the target human body image corresponding to the target face detection frame from the image to be detected; A seat belt area image is segmented from the target human image, and based on the seat belt area image, it is determined whether the person corresponding to the target human image is wearing a seat belt.

2. The method according to claim 1, wherein The step of identifying a target face detection frame located within a preset seat area from the one or more face detection frames based on the position information of the one or more face detection frames includes: For each of the one or more face detection frames, determining a degree of overlap between the face detection frame and the preset seat area based on position information of the face detection frame and position information of the preset seat area; In a case where the degree of overlap between the face detection frame and the preset seat area is greater than or equal to a first overlap threshold, the face detection frame is determined to be the target face detection frame.

3. The method according to claim 1, wherein The determining, based on the seat belt area image, whether the person corresponding to the target human image is wearing a seat belt includes: Determining attribute parameters of the seat belt based on the seat belt area image, wherein the attribute parameters of the seat belt include a slope of the seat belt; the slope of the seat belt is used to represent the degree of inclination of a straight line fitted to the seat belt area image relative to a bottom edge of the target human body image; When the attribute parameters of the seat belt meet preset conditions, it is determined that the person corresponding to the target human image wears the seat belt, and the preset conditions include a first preset condition, and the first preset condition includes that the slope of the seat belt is within a preset range.

4. The method according to claim 3, wherein: The method further comprises: segmenting a human body region image from the target human body image; The attribute parameters of the seat belt further include at least one of the following: the area of ​​the seat belt area image, the overlap between the seat belt area image and the target human body image, and the overlap between the seat belt area image and the human body area image.

5. The method according to claim 4, wherein The preset condition further includes a second preset condition, and the second preset condition includes at least one of the following: The area of ​​the seat belt area image exceeds a preset area threshold; The degree of overlap between the seat belt area image and the target human body image is greater than or equal to a second overlap threshold; or The degree of overlap between the seat belt area image and the human body area image is greater than or equal to a third overlap threshold.

6. The method according to claim 5, wherein: The step of determining that a person corresponding to the target human image is wearing a seat belt when the attribute parameters of the seat belt meet a preset condition includes: Determining whether the attribute parameters of the seat belt meet the first preset condition; In a case where the attribute parameter of the seat belt does not satisfy the first preset condition, determining that the person corresponding to the target human image is not wearing a seat belt; In a case where the property parameter of the seat belt satisfies the first preset condition, determining whether the property parameter of the seat belt satisfies the second preset condition; In a case where the attribute parameter of the seat belt does not satisfy the second preset condition, determining that the person corresponding to the target human image is not wearing a seat belt; In a case where the attribute parameters of the seat belt meet the second preset condition, it is determined that the person corresponding to the target human image is wearing a seat belt.

7. The method according to claim 1, wherein The step of cropping a target human body image corresponding to the target face detection frame from the image to be detected based on the position information of the target face detection frame includes: Determining, based on the height and width of the target face detection frame, the height and width of a target human image corresponding to the target face detection frame; wherein a ratio of the height of the target human image to the height of the target face detection frame is a preset first ratio, and a ratio of the width of the target face detection frame to the width of the target human image is a preset second ratio; Based on the position information of the target face detection frame and the height and width of the human body region image, a target human body image corresponding to the target face detection frame is cropped from the image to be detected.

8. The method according to claim 1, wherein The method further comprises: Acquiring an original image captured by a camera disposed inside the vehicle and having a capture area including the preset seat area; An affine transformation is performed on the original image to obtain the image to be detected; the preset seat area is located in the middle of the image to be detected.

9. The method according to any one of claims 1 to 8, wherein: The step of segmenting the seat belt area image from the target human body image includes: Inputting the target human image into a seatbelt wearing detection model to obtain semantic information of each pixel in the target human image; the semantic information is used to indicate the type of object corresponding to the pixel; and segmenting a seatbelt area image from the target human image based on the semantic information of each pixel; The method of performing face detection on the image to be detected and obtaining position information of one or more face detection frames includes: The image to be detected is input into a face detection model to obtain position information of one or more face detection frames.

10. A safety belt wearing detection device, wherein: include: A face detection module is used to perform face detection on the image to be detected and obtain the position information of one or more face detection frames; Based on the position information of the one or more face detection frames, identifying a target face detection frame located in a preset seat area from the one or more face detection frames; A human body detection module is used to crop a target human body image corresponding to the target face detection frame from the image to be detected based on the position information of the target face detection frame; The wearing detection module is used to segment a seat belt area image from the target human image and determine whether the person corresponding to the target human image is wearing a seat belt based on the seat belt area image.

11. The device according to claim 10, wherein The wearing detection module is specifically used to determine the attribute parameters of the seat belt based on the seat belt area image, and the attribute parameters of the seat belt include the slope of the seat belt; when the attribute parameters of the seat belt meet preset conditions, it is determined that the person corresponding to the target human body image is wearing a seat belt, and the preset conditions include a first preset condition, and the first preset condition includes: the slope of the seat belt is within a preset range.

12. The device according to claim 11, wherein The wearing detection module is further used to segment a human body region image from the target human body image; The attribute parameters of the seat belt further include at least one of the following: the area of ​​the seat belt area image, the overlap between the seat belt area image and the target human body image, and the overlap between the seat belt area image and the human body area image; The preset conditions also include a second preset condition, which includes at least one of the following: the area of ​​the seat belt area image exceeds a preset area threshold; the degree of overlap between the seat belt area image and the target human body image is greater than or equal to a second overlap threshold; or, the degree of overlap between the seat belt area image and the human body area image is greater than or equal to a third overlap threshold.

13. The device according to claim 12, wherein The wearing detection module is specifically configured to determine whether the attribute parameters of the seat belt meet the first preset condition; if the attribute parameters of the seat belt do not meet the first preset condition, determine that the person corresponding to the target human image is not wearing a seat belt; if the attribute parameters of the seat belt meet the first preset condition, determine whether the attribute parameters of the seat belt meet the second preset condition; When the attribute parameters of the seat belt do not meet the second preset condition, it is determined that the person corresponding to the target human image is not wearing a seat belt; when the attribute parameters of the seat belt meet the second preset condition, it is determined that the person corresponding to the target human image is wearing a seat belt.

14. The device according to claim 11, wherein The device also includes a camera module and a pre-processing module; The camera module is used to obtain an original image; wherein the camera module is arranged inside the vehicle, and the shooting area of ​​the camera module includes a preset seat area; The pre-processing module is used to perform affine transformation on the original image to obtain the image to be detected; the preset seat area is located in the middle of the image to be detected.

15. The device according to claim 14, wherein The camera module is arranged at at least one of the following locations: a cockpit A-pillar, an instrument panel, a reading light, a central control screen or a central console.

16. An electronic device, wherein: include: a processor and a memory for storing instructions executable by the processor; The processor is configured to execute the instructions so that the electronic device performs the method according to any one of claims 1 to 9.

17. The apparatus according to claim 16, wherein The electronic device further includes a camera device, which is data-connected to the processor or the memory and is configured to capture an original image; the camera device is disposed inside the vehicle, and a capture area of ​​the camera device includes a preset seating area; The processor is further configured to perform an affine transformation on the original image to obtain an image to be detected; the preset seat area is located in the middle of the image to be detected.

18. The apparatus according to claim 16, wherein The camera device is arranged at at least one of the following positions: a cockpit A-pillar, an instrument panel, a reading light, a central control screen or a central console.

19. A non-transitory computer-readable storage medium, wherein: The non-transitory computer-readable storage medium stores computer instructions, and when the computer instructions are executed on an electronic device, the electronic device is caused to perform the method according to any one of claims 1 to 9.