Driver glasses detection method, device and equipment and medium

By identifying the target motion and determining the target area on the driver's image, the problem of low accuracy in complex environments is solved, and higher detection accuracy and robustness are achieved.

CN119672680APending Publication Date: 2025-03-21CHINA FAW CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411522504.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-29
Publication Date
2025-03-21

AI Technical Summary

Technical Problem

Traditional driver glasses detection methods are prone to detection failure or mis-testing in complex environments, resulting in low detection accuracy.

Method used

By monitoring the driver, the initial driver image is obtained and the target action is recognized on the image to determine whether there is any action of holding the glasses or pushing the glasses up. If present, the center of the target area and the action frequency are determined, and the target detection area is determined based on these information, thereby determining whether the driver is wearing glasses.

Benefits of technology

It improves the accuracy of detecting whether the driver wears glasses, reduces environmental interference and mis-checking, and achieves accurate detection in complex environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119672680A_ABST
    Figure CN119672680A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a driver glasses detection method, device and equipment and a medium. The method comprises the steps that a driver in a current vehicle is monitored, an initial driver image is obtained, target action recognition is conducted on the initial driver image, and whether a target action exists in the initial driver image or not is determined; wherein the target action is an action of supporting glasses legs by a driver or an action of pushing up glasses by the driver; if the target action exists in the initial driver image, determining a target area center and a target action frequency of the initial driver image, and determining a target detection area according to a preset initial area radius, the target area center and the target action frequency corresponding to the target action; determining a target area image from the initial driver image based on the target detection area; and determining whether the driver in the initial driver image wears glasses or not according to the initial driver image and the target area image. According to the scheme, the accuracy of detecting whether the driver wears the glasses or not is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present invention relate to the field of image detection technology, and in particular to a method, device, equipment and medium for detecting a driver's glasses. Background Art

[0002] With the development of automobile driving assistance systems, driver status monitoring has become increasingly important. Knowing whether the driver is wearing glasses can provide a strong guarantee for driving safety. Traditional glasses detection methods are usually based on the detection of the entire glasses. Due to the complex environment and various glasses styles, detection failures or misdetections are prone to occur. Therefore, how to improve the accuracy of detecting whether the driver is wearing glasses is crucial. Summary of the invention

[0003] The present invention provides a method, device, equipment and medium for detecting glasses of a driver, so as to improve the accuracy of detecting whether the driver is wearing glasses.

[0004] According to one aspect of the present invention, there is provided a method for detecting glasses of a driver, comprising:

[0005] Monitor the driver in the current vehicle, obtain an initial driver image, and perform target action recognition on the initial driver image to determine whether there is a target action in the initial driver image; wherein the target action is an action of the driver holding the temple of glasses or an action of the driver pushing up glasses;

[0006] If there is a target action in the initial driver image, determining a target area center and a target action frequency of the initial driver image, and determining a target detection area according to a preset initial area radius corresponding to the target action, the target area center and the target action frequency;

[0007] Based on the target detection area, determining a target area image from the initial driver image;

[0008] According to the initial driver image and the target area image, it is determined whether the driver in the initial driver image wears glasses.

[0009] According to another aspect of the present invention, there is provided a driver's glasses detection device, comprising:

[0010] A target action recognition module is used to monitor the driver in the current vehicle, obtain an initial driver image, and perform target action recognition on the initial driver image to determine whether there is a target action in the initial driver image; wherein the target action is an action of the driver holding the temple of the glasses or an action of the driver pushing up the glasses;

[0011] a target detection area determination module, configured to determine a target area center and a target action frequency of the initial driver image if a target action exists in the initial driver image, and determine a target detection area according to a preset initial area radius corresponding to the target action, the target area center and the target action frequency;

[0012] a target area image determination module, configured to determine a target area image from the initial driver image based on the target detection area;

[0013] The glasses detection module is used to determine whether the driver in the initial driver image is wearing glasses based on the initial driver image and the target area image.

[0014] According to another aspect of the present invention, there is provided an electronic device, comprising:

[0015] one or more processors;

[0016] A memory for storing one or more programs;

[0017] When one or more programs are executed by one or more processors, the one or more processors can execute any one of the driver's glasses detection methods provided by the embodiments of the present invention.

[0018] According to another aspect of the present invention, a computer-readable storage medium is provided, which stores computer instructions, and the computer instructions are used to enable a processor to implement any driver's glasses detection method provided by the embodiments of the present invention when executed.

[0019] The embodiment of the present invention provides a driver's glasses detection scheme, which monitors the driver in the current vehicle, obtains an initial driver image, and performs target action recognition on the initial driver image to determine whether there is a target action in the initial driver image; wherein the target action is the driver's action of holding the temple of the glasses or the driver's action of pushing up the glasses; if there is a target action in the initial driver image, the target area center and target action frequency of the initial driver image are determined, and the target detection area is determined according to the preset initial area radius, target area center and target action frequency corresponding to the target action; based on the target detection area, the target area image is determined from the initial driver image; and according to the initial driver image and the target area image, it is determined whether the driver in the initial driver image wears glasses. The above scheme, by performing target action recognition on the initial driver image, determining the target area image, and jointly determining whether the driver wears glasses according to the initial driver image and the target area image, realizes the detection of whether the driver wears glasses on the basis of identifying the driver's action, thereby improving the accuracy of detecting whether the driver wears glasses.

[0020] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0022] Figure 1 is a flow chart of a method for detecting glasses of a driver provided in Embodiment 1 of the present invention;

[0023] Figure 2 is a flow chart of a method for detecting glasses of a driver provided in Embodiment 2 of the present invention;

[0024] Figure 3 is a structural schematic diagram of a driver's glasses detection device provided in Embodiment 3 of the present invention;

[0025] Figure 4 It is a structural schematic diagram of an electronic device for implementing a method for detecting a driver's glasses provided in a fourth embodiment of the present invention. DETAILED DESCRIPTION

[0026] The present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the present invention, rather than to limit the present invention. It should also be noted that, for ease of description, only parts related to the present invention, rather than all structures, are shown in the accompanying drawings.

[0027] Embodiment 1

[0028] Figure 1 This is a flow chart of a method for detecting a driver's glasses provided in Embodiment 1 of the present invention. This embodiment can be applied to detecting whether a driver in a vehicle is wearing glasses. The method can be executed by a driver's glasses detection device, which can be implemented in software and / or hardware and can be configured in an electronic device that carries the driver's glasses detection function.

[0029] See also Figure 1 The driver's glasses detection method shown includes:

[0030] S110: Monitor the driver in the current vehicle, obtain an initial driver image, and perform target action recognition on the initial driver image to determine whether the target action exists in the initial driver image.

[0031] The current vehicle refers to a vehicle that needs to perform eyeglass detection on the driver at the current moment. The initial driver image refers to the driver image captured at the initial moment. The target action refers to the driver's action. Exemplarily, the target action is the driver's action of holding the temple of the glasses or the driver's action of pushing up the glasses. Exemplarily, the initial driver image can be obtained by a camera installed on the A-pillar of the current vehicle.

[0032] Specifically, the driver in the current vehicle is monitored, an initial driver image is obtained, and target action recognition is performed on the driver in the initial driver image to determine whether there is an action of the driver holding the temple of glasses or the driver pushing up glasses in the initial driver image.

[0033] S120. If there is a target action in the initial driver image, determine the target area center and target action frequency of the initial driver image, and determine the target detection area according to the preset initial area radius, target area center and target action frequency corresponding to the target action.

[0034] Specifically, if the target action in the initial driver image is the driver holding the glasses leg, the initial driver image is the initial glasses leg image; if the target action in the initial driver image is the driver pushing up the glasses, the initial driver image is the initial glasses nose pad image. The glasses leg image refers to an image with the driver holding the glasses leg. The glasses nose pad image refers to an image with the driver pushing up the glasses.

[0035] The target area center refers to a point that can be used to determine the center of the target detection area. The target detection area refers to a detection area used to determine the target area image. The target area image refers to at least a partial image including the target action obtained by cutting out the initial driver image.

[0036] Exemplarily, the target area center may be the target temple area center or the target nose pad area center; the target detection area may be the temple area detection area or the nose pad detection area; the target area image may be the temple area image or the nose pad area image. It should be noted that, for the initial driver image, the target area center is the initial area center of the initial driver image. The initial area center refers to the center point determined based on the initial driver image. Exemplarily, the initial area center may be the initial temple area center or the initial nose pad area center.

[0037] Exemplarily, if the initial driver image is an initial glasses leg image, the center of the initial area is the center of the target glasses leg area, the target detection area is the glasses leg detection area, and the target area image is the glasses leg area image; if the initial driver image is an initial glasses nose pad image, the center of the initial area is the center of the target nose pad area, the target detection area is the nose pad detection area, and the target area image is the nose pad area image.

[0038] The initial eyeglass leg region center refers to the center point determined based on the initial eyeglass leg image. The target eyeglass leg region center refers to the point used to determine the center of the eyeglass leg detection region. The eyeglass leg detection region refers to the detection region used to determine the eyeglass leg region image. The eyeglass leg region image refers to at least a partial image including the eyeglass leg obtained by clipping the initial eyeglass leg image.

[0039] The initial nose pad area center refers to the center point determined based on the initial eyeglass nose pad image. The target nose pad area center refers to the point used to determine the center of the nose pad detection area. The nose pad detection area refers to the detection area used to determine the nose pad area image. The nose pad area image refers to at least a partial image including the eyeglass nose pad obtained by clipping the initial eyeglass nose pad image.

[0040] For example, if the initial driver image is an initial glasses leg image, the driver's hands and head in the initial driver image can be detected based on a preset detection algorithm, and the intersection of the hands and the head is used as the center of the target glasses leg area.

[0041] The preset detection algorithm refers to a pre-set detection algorithm. The embodiment of the present invention does not impose any limitation on the preset detection algorithm, which can be set by a technician based on experience. Exemplarily, the preset detection algorithm can be a key point detection algorithm (such as OpenPose).

[0042] For example, if the initial driver image is an initial eyeglass nose pad image, the driver's hands and face in the initial driver image are detected based on a preset detection algorithm, and the intersection of the hands and the face is used as the center of the target nose pad area.

[0043] The target action frequency refers to the number of times the driver has the target action. Exemplarily, the target action frequency can be the glasses leg frequency or the nose pad frequency. The glasses leg frequency refers to the number of times the driver holds the glasses leg. The nose pad frequency refers to the number of times the driver pushes up the glasses. It should be noted that the target action frequency of the initial driver image is the initial action frequency, and the initial action frequency is 0.

[0044] Specifically, if the initial driver image is an initial glasses leg image, the target action frequency of the initial driver image is the glasses leg frequency; if the initial driver image is an initial glasses nose pad image, the target action frequency of the initial driver image is the nose pad frequency.

[0045] The preset initial area radius refers to the preset initial radius of the target detection area. The embodiment of the present invention does not impose any limitation on the size of the preset initial area radius, which can be set by technicians based on experience.

[0046] Exemplarily, the preset initial area radius may be an initial temple area radius or an initial nose pad area radius. The initial temple area radius refers to an initial radius for determining the temple detection area. Exemplarily, the initial temple area radius may be preset by a technician based on experience or needs. The initial nose pad area radius refers to an initial radius for determining the nose pad detection area. Exemplarily, the initial nose pad area radius may be preset by a technician based on experience or needs.

[0047] The radius of the initial temple region in the embodiment of the present invention is greater than the radius of the initial nose pad region.

[0048] Exemplarily, if the target action is the driver holding up the temple of the glasses, the preset initial area radius is the initial temple area radius; if the target action is the driver pushing up the glasses, the preset initial area radius is the initial nose pad area radius.

[0049] Exemplarily, if the target action in the initial driver image is the action of holding the temple, then the initial driver image is the initial temple image, and the target temple area center and temple frequency of the initial temple image are determined; the temple detection area is determined based on the initial temple area radius, target temple area center and temple frequency corresponding to the action of holding the temple.

[0050] Exemplarily, if the target action in the initial driver image is the action of pushing up the glasses, then the initial driver image is the initial glasses nose pads image, and the target nose pads area center and nose pads frequency of the initial glasses nose pads image are determined; the nose pads detection area is determined based on the initial nose pads area radius, target nose pads area center and nose pads frequency corresponding to the pushing up the glasses action.

[0051] It should be noted that if the target action does not exist in the initial driver image, the initial driver image is filtered, the driver image at the next moment is obtained, and the driver image at the next moment is used as the new initial driver image, and the target action recognition is performed on the new initial driver image. If the target action exists in the new initial driver image, the subsequent process is carried out; if the target action does not exist in the new initial driver image either, the driver image at the next moment is continued to be obtained, and the target action recognition is performed again on the driver image at the next moment until a driver image with the target action is obtained.

[0052] S130: Determine a target area image from the initial driver image based on the target detection area.

[0053] Specifically, based on the target detection area, at least a portion of the target area image including the target action is extracted from the initial driver image.

[0054] Exemplarily, if the target detection area is a temple detection area, the temple area image is determined from the initial temple image.

[0055] Exemplarily, if the target detection area is a nose pad detection area, the nose pad area image is determined from the initial glasses nose pad image.

[0056] S140: Determine whether the driver in the initial driver image wears glasses based on the initial driver image and the target area image.

[0057] In an optional embodiment, determining whether the driver in the initial driver image is wearing glasses is performed based on the initial driver image and the target area image, including: determining a first detection result based on the initial driver image; determining a target detection model corresponding to the target area image from preset candidate detection models; inputting the target area image into a trained target detection model and outputting a second detection result; and determining whether the driver in the initial driver image is wearing glasses based on the first detection result and the second detection result.

[0058] The first detection result refers to whether there are glasses in the initial driver image. Exemplarily, the first detection result may be whether there are glasses or not.

[0059] The candidate detection model can be used to detect whether there are glasses parts in the target area image. The candidate detection model can be a deep learning model. Exemplarily, the candidate detection model can include a glasses leg detection model and a glasses nose pad detection model. The glasses leg detection model can be used to detect whether there are glasses legs in the glasses leg area image. The glasses nose pad detection model can be used to detect whether there are glasses nose pads in the nose pad area image.

[0060] The second detection result refers to whether there are glasses parts corresponding to the target action in the target area image. Exemplarily, the second detection result may be the presence of the parts or the absence of the parts. The second detection result may include a temple detection result and a nose pad detection result. The temple detection result refers to whether there are glasses parts in the temple area image. The temple detection result may be the presence of glasses parts or the absence of glasses parts. The nose pad detection result refers to whether there are nose pads in the nose pad area image. The nose pad detection result may be the presence of nose pads or the absence of nose pads.

[0061] Exemplarily, determining whether the driver in the initial driver image is wearing glasses is performed based on the first detection result and the second detection result, including: if any one of the first detection result and the second detection result is present, determining that the driver in the initial driver image is wearing glasses; if both the first detection result and the second detection result are not present, determining that the driver in the initial driver image is not wearing glasses.

[0062] Exemplarily, a first detection result is determined based on an initial temple image; a temple detection model is determined as a target detection model from preset candidate detection models; the temple area image is input into a trained temple detection model, and a temple detection result is output; based on the first detection result and the temple detection result, it is determined whether the driver in the initial temple image is wearing glasses.

[0063] Furthermore, if any one of the first detection result and the temple detection result is present, it is determined that the driver in the initial temple image is wearing glasses; if both the first detection result and the temple detection result are not present, it is determined that the driver in the initial temple image is not wearing glasses.

[0064] Exemplarily, a first detection result is determined based on an initial glasses nose pads image; a glasses nose pads detection model is determined as a target detection model from preset candidate detection models; the nose pads area image is input into a trained glasses nose pads detection model, and the nose pads detection result is output; based on the first detection result and the nose pads detection result, it is determined whether the driver in the initial glasses nose pads image is wearing glasses.

[0065] Furthermore, if any one of the first detection result and the nose pad detection result is present, it is determined that the driver in the initial glasses and nose pads image is wearing glasses; if both the first detection result and the nose pad detection result are not present, it is determined that the driver in the initial glasses and nose pads image is not wearing glasses.

[0066] It should be noted that, in the embodiment of the present invention, a method based on edge detection and features may also be used to determine the second detection result according to the target area image.

[0067] It should be noted that, in the initial driver image in the embodiment of the present invention, there may be both actions of the driver holding up the temples of the glasses and actions of the driver pushing up the glasses, in which case the temple detection result and the nose pad detection result of the initial driver image are determined separately; a second detection result including the temple detection result and the nose pad detection result is generated; and based on the first detection result and the second detection result, it is determined whether the driver in the initial driver image is wearing glasses.

[0068] It can be understood that by determining whether the driver in the current vehicle wears glasses based on the first detection result and the second detection result, it is possible to determine whether the driver wears glasses from multiple dimensions, thereby improving the accuracy of determining whether the driver wears glasses.

[0069] The embodiment of the present invention provides a driver's glasses detection scheme, which monitors the driver in the current vehicle, obtains an initial driver image, and performs target action recognition on the initial driver image to determine whether there is a target action in the initial driver image; wherein the target action is the driver's action of holding the temple of the glasses or the driver's action of pushing up the glasses; if there is a target action in the initial driver image, the target area center and target action frequency of the initial driver image are determined, and the target detection area is determined according to the preset initial area radius, target area center and target action frequency corresponding to the target action; based on the target detection area, the target area image is determined from the initial driver image; and according to the initial driver image and the target area image, it is determined whether the driver in the initial driver image wears glasses. The above scheme, by performing target action recognition on the initial driver image, determining the target area image, and jointly determining whether the driver wears glasses according to the initial driver image and the target area image, realizes the detection of whether the driver wears glasses on the basis of identifying the driver's action, thereby improving the accuracy of detecting whether the driver wears glasses.

[0070] On the basis of the above technical solution, the embodiment of the present invention further introduces vehicle-machine function linkage, that is, if it is detected that the driver is not wearing glasses and needs to wear them, an alarm is triggered.

[0071] Embodiment 2

[0072] Figure 2It is a flow chart of a method for detecting glasses of a driver provided in the second embodiment of the present invention. Based on the above embodiments, this embodiment further adds "obtaining a reference driver image, and performing target action recognition on the reference driver image to determine whether there is a target action identical to that of the initial driver image in the reference driver image; if there is the same target action in the reference driver image, then updating the target action frequency to obtain a new target action frequency, and determining the reference area center of the reference driver image; updating the target area center according to the target area center and the reference area center to obtain a new target area center, and updating the initial area radius according to the new target action frequency and the preset initial area radius to obtain the target area radius; determining a new target detection area according to the new target area center and the target area radius, and determining a new target area image from the reference driver image according to the new target detection area; determining whether the driver in the reference driver image wears glasses according to the reference driver image and the new target area image" to improve the driver's glasses detection mechanism. It should be noted that for the parts not described in detail in the embodiments of the present invention, reference may be made to the descriptions of other embodiments.

[0073] Based on the technical solution of the first embodiment, in order to further expand the target detection area and improve the accuracy of the detection result, the target detection area is updated.

[0074] After determining whether the driver in the initial driver image is wearing glasses according to the initial driver image and the target area image in the first embodiment, see Figure 2 The driver's glasses detection method shown includes:

[0075] S210: Acquire a reference driver image, and perform target action recognition on the reference driver image to determine whether the reference driver image contains the same target action as the initial driver image.

[0076] The reference driver image refers to a driver image acquired in chronological order based on the initial driver image. Exemplarily, the reference driver image may be a reference glasses leg image or a reference glasses nose pad image.

[0077] Exemplarily, if the initial driver image is an initial glasses leg image, and the reference driver image contains the same target action as the initial glasses leg image (i.e., the driver's action of holding the glasses leg), then the reference driver image is the reference glasses leg image; if the initial driver image is an initial glasses nose pad image, and the reference driver image contains the same target action as the initial glasses leg image (i.e., the driver's action of pushing up the glasses), then the reference driver image is the reference glasses nose pad image.

[0078] S220: If the same target action exists in the reference driver image, the target action frequency is updated to obtain a new target action frequency, and the reference area center of the reference driver image is determined.

[0079] The new target action frequency refers to a frequency obtained by updating (such as adding 1) the target action frequency. Exemplarily, the new target action frequency may be a new temple frequency or a new nose pad frequency. The new temple frequency refers to an action frequency obtained by adding 1 to the temple frequency. The new nose pad frequency refers to an action frequency obtained by adding 1 to the nose pad frequency.

[0080] Exemplarily, the frequency counter records the target action frequency, and each time a target action is detected, the corresponding target action frequency is increased by 1, that is, c=c0+1, c represents the new target action frequency, and c0 represents the target action frequency.

[0081] The reference area center refers to the center point determined based on the reference driver image. Exemplarily, the reference area center may be the reference temple area center or the reference nose pad area center. The reference temple area center refers to the center point determined based on the reference temple image. The reference nose pad area center refers to the center point determined based on the reference nose pad image.

[0082] Exemplarily, if the reference driver image is a reference temple image, the temple frequency is updated to obtain a new temple frequency, and the center of the reference temple region of the reference temple image is determined.

[0083] Exemplarily, if the reference driver image is a reference glasses nose pad image, the nose pad frequency is updated to obtain a new nose pad frequency, and the reference nose pad area center of the reference glasses nose pad image is determined.

[0084] For example, if the reference driver image is a reference glasses leg image, the driver's hands and head in the reference glasses leg image can be detected based on a preset detection algorithm, and the intersection of the hands and the head is used as the center of the reference glasses leg area.

[0085] For example, if the reference driver image is a reference glasses nose pad image, the driver's hands and face in the reference glasses nose pad image are detected based on a preset detection algorithm, and the intersection of the hands and the face is used as the center of the reference nose pad area.

[0086] S230: updating the target area center according to the target area center and the reference area center to obtain a new target area center, and updating the preset initial area radius according to the new target action frequency and the preset initial area radius to obtain the target area radius.

[0087] The new target area center refers to the updated target area center. Exemplarily, the new target area center can be the new target temple area center or the new target nose pad area center. The new target temple area center refers to the center point obtained after the target temple area center is updated. The new target nose pad area center refers to the center point obtained after the target nose pad area center is updated.

[0088] The target area radius refers to the area radius obtained by updating the preset initial area radius. Exemplarily, the target area radius may be a target temple area radius or a target nose pad area radius. The target temple area radius refers to the area radius obtained by updating the initial temple area radius, and the target nose pad area radius refers to the area radius obtained by updating the initial nose pad area radius.

[0089] Exemplarily, if the target area center is the initial eyeglass leg area center and the reference area center is the reference eyeglass leg area center, then the target eyeglass leg area center is updated according to the initial eyeglass leg area center and the reference eyeglass leg area center to obtain a new target eyeglass leg area center; the initial eyeglass leg area radius is updated according to the new eyeglass leg frequency and the initial eyeglass leg area radius to obtain the target eyeglass leg area radius.

[0090] Exemplarily, if the target area center is the initial nose pad area center and the reference area center is the reference nose pad area center, the target nose pad area center is updated according to the initial nose pad area center and the reference nose pad area center to obtain a new target nose pad area center; the initial nose pad area radius is updated according to the new nose pad frequency and the initial nose pad area radius to obtain the target nose pad area radius.

[0091] It should be noted that the target regional center may be the initial regional center, or the target regional center may include the initial regional center and at least one previously obtained historical reference regional center; if the target regional center includes the initial regional center and the historical reference regional center, a weighted average is taken based on the initial regional center, the historical reference regional center, and the currently obtained reference regional center to determine the current new target regional center.

[0092] In an optional embodiment, the target area center is updated according to the target area center and the reference area center to obtain a new target area center, including: determining a first weight of the target area center and determining a second weight of the reference area center; and updating the target area center according to the first weight, the second weight, the target area center and the reference area center to obtain a new target area center.

[0093] Wherein, the first weight can be used to quantify the importance of the target area center (i.e., the initial area center and / or the historical reference area center). Exemplarily, the first weight can be a first temple weight or a first nose pad weight. The first temple weight can be used to quantify the importance of the initial temple area center and / or the historical reference temple area center. The first nose pad weight can be used to quantify the importance of the initial nose pad area center and / or the historical reference nose pad area center.

[0094] The historical reference area center refers to the reference area center determined based on the previous reference driver image. The historical reference glasses leg area center refers to the reference glasses leg center determined based on the previous reference glasses leg image. The historical reference nose pad area center refers to the reference nose pad area center determined based on the previous reference glasses nose pad image.

[0095] It should be noted that, in the embodiment of the present invention, the reference driver images and reference area centers that are not marked as “historical” are all current reference driver images and reference area centers.

[0096] It should be noted that the first weight corresponding to the initial regional center and the first weight corresponding to the historical reference regional center may be the same or different, and the embodiment of the present invention does not impose any specific limitation on this.

[0097] Wherein, the second weight can be used to quantify the importance of the center of the reference area. Exemplarily, the second weight can be a second temple weight or a second nose pad weight. The second temple weight can be used to quantify the importance of the center of the reference temple area. The second nose pad weight can be used to quantify the importance of the center of the reference nose pad area.

[0098] Exemplarily, a first temple weight of an initial temple area center is determined, and a second temple weight of a reference temple area center is determined; based on the first temple weight, the second temple weight, the initial temple area center and the reference temple area center, the initial temple area center is updated to obtain a new temple area center.

[0099] Exemplarily, a first nose pad weight of an initial nose pad area center is determined, and a second nose pad weight of a reference nose pad area center is determined; based on the first nose pad weight, the second nose pad weight, the initial nose pad area center and the reference nose pad area center, the initial nose pad area center is updated to obtain a new nose pad area center.

[0100] For example, the new target area center can be determined by the following formula:

[0101]

[0102] Among them, P h,avgrepresents the center of the new target area; n represents the number of detections to obtain the current reference driver image; i represents the i-th detection; w i represents the weight corresponding to the i-th detection (such as the first weight or the second weight); P h,i Represents the center of the target area for the i-th time.

[0103] It can be understood that by introducing the first weight and the second weight to determine the new target area center, the accuracy of the determined new target area center is improved.

[0104] In an optional embodiment, the target area radius is determined based on the new target action frequency and the preset initial area radius, including: determining the corresponding radius update step size based on the target action in the reference driver image; determining the target area radius based on the new target action frequency, the radius update step size and the preset initial area radius.

[0105] Among them, the radius update step refers to the expansion coefficient used to update the radius of the preset initial area each time. Exemplarily, the radius update step can be the temple radius update step or the nose pad radius update step. The temple radius update step refers to the expansion coefficient each time the initial temple area radius is updated. The nose pad radius update step refers to the expansion coefficient each time the initial nose pad area radius is updated. It should be noted that the embodiment of the present invention does not impose any limitation on the size of the radius update step, which can be set by the technician according to experience or needs. The temple radius update step is larger than the nose pad radius update step.

[0106] Exemplarily, if the reference driver image is a reference temple image, the target temple area radius is determined according to the new temple frequency, the temple radius update step and the initial temple area radius.

[0107] Exemplarily, if the reference driver image is a reference nose pad image, the target nose pad area radius is determined according to the new nose pad frequency, the nose pad radius update step size, and the initial nose pad area radius.

[0108] For example, the radius of the target area can be determined by the following formula:

[0109] r = r0 + k × c;

[0110] Among them, r represents the radius of the target area; r0 represents the preset initial area radius; k represents the radius update step; and c represents the new target action frequency.

[0111] It can be understood that by determining the radius of the target area according to the radius update step, the accuracy of updating the preset initial area radius is improved, and the accuracy of the determined target area radius is improved.

[0112] In an optional embodiment, the method further includes: performing key point detection on the initial driver image to determine the boundary key points of the driver's head in the initial driver image; determining the key point distance based on the boundary key points, and using the key point distance as the area radius threshold.

[0113] The boundary key point refers to the boundary point of the driver's head in the initial driver image. The key point distance refers to the distance between boundary key points. The area radius threshold can be used to limit the size of the target area radius. The area radius threshold can be understood as the width of the driver's face.

[0114] Specifically, key point detection is performed on the initial driver image to determine two boundary key points of the driver's head in the initial driver image; a key point distance between the boundary key points is determined, and the key point distance is used as a region radius threshold.

[0115] It can be understood that by determining the area radius threshold according to the boundary key points, leakage of the driver's facial privacy information is avoided.

[0116] In an optional embodiment, after determining the target area radius based on the new target action frequency and the preset initial area radius, the method also includes: if the target area radius reaches the area radius threshold, stopping the next update of the preset initial area radius, and using the new target area radius obtained as the final target area radius obtained by the update.

[0117] Exemplarily, if the target temple area radius reaches the area radius threshold, the updating of the initial temple area radius is stopped.

[0118] Exemplarily, if the target nose pad area radius reaches the area radius threshold, the updating of the initial nose pad area radius is stopped.

[0119] It can be understood that by introducing the area radius threshold, the number of updates of the preset initial area radius is limited, which avoids the determined target area radius being too large, and improves the accuracy and applicability of the determined target area radius.

[0120] S240: Determine a new target detection area according to the new target area center and the target area radius, and determine a new target area image from the reference driver image according to the new target detection area.

[0121] The new target detection area refers to the detection area obtained after the target detection area is updated. Exemplarily, the new target detection area may be a new temple detection area or a new nose pad detection area. The new temple detection area refers to the detection area obtained after the temple detection area is updated. The new nose pad detection area refers to the nose pad detection area obtained after the nose pad detection area is updated.

[0122] Wherein, the new target area image refers to the area image obtained after updating the target area image. Exemplarily, the new target area image can be a new temple area image or a new nose pad area image. The new temple area image refers to at least a partial image including the temples obtained by cutting out the reference driver image. The new nose pad area image refers to at least a partial image including the nose pads of the glasses obtained by cutting out the reference driver image.

[0123] Exemplarily, a new temple detection area is determined according to the new target temple area center and the target temple area radius, and a new temple area image is determined from the reference temple image.

[0124] Exemplarily, a new nose pad detection area is determined according to the new target nose pad area center and the target nose pad area radius, and a new nose pad area image is determined from a reference glasses nose pad image.

[0125] S250: Determine whether the driver in the reference driver image wears glasses based on the reference driver image and the new target area image.

[0126] Similar to the method of determining whether the driver in the initial driver image wears glasses based on the initial driver image and the target area image in Example 1, the embodiment of the present invention determines whether the driver in the reference driver image wears glasses based on the reference driver image and the new target area image, including: determining a first detection result based on the reference driver image; determining a target detection model corresponding to the new target area image from preset candidate detection models; inputting the new target area image into the trained target detection model and outputting a second detection result; and determining whether the driver in the reference driver image wears glasses based on the first detection result and the second detection result.

[0127] It should be noted that the first detection result at this time is a detection result determined by referring to the driver image, but the actual content of the first detection result is the same as that in the first embodiment, that is, the first detection result is the presence of glasses or the absence of glasses.

[0128] It should be noted that the second detection result at this time is a detection result determined by the new target area image, but the actual content of the second detection result is the same as that in the first embodiment, that is, the second detection result is the existence of the component or the non-existence of the component.

[0129] The embodiment of the present invention provides a driver's glasses detection scheme, which adds and obtains a reference driver image, and performs target action recognition on the reference driver image to determine whether there is the same target action as the initial driver image in the reference driver image; if there is the same target action in the reference driver image, the target action frequency is updated to obtain a new target action frequency, and the reference area center of the reference driver image is determined; according to the target area center and the reference area center, the target area center is updated to obtain a new target area center, and according to the new target action frequency and the preset initial area radius, the initial area radius is updated to obtain the target area radius; according to the new target area center and the target area radius, a new target detection area is determined, and according to the new target detection area, a new target area image is determined from the reference driver image; according to the reference driver image and the new target area image, whether the driver in the reference driver image wears glasses is determined, thereby improving the driver's glasses detection mechanism. The above scheme realizes real-time detection of whether the driver wears glasses, and improves the timeliness of the glasses detection results.

[0130] The technical solution provided by the embodiment of the present invention aims to solve the problems of poor robustness and low accuracy in the traditional glasses detection method. By detecting the driver's specific actions of holding the glasses and pushing up the glasses, a certain part of the glasses (such as the temples or nose pads) can be accurately located, thereby improving the accuracy and reliability of glasses detection.

[0131] There are often a lot of environmental interference changes in driving environments, such as tunnels, backlight, rainy and snowy days, etc. In these cases, if the entire glasses are detected, there may be certain false omissions, because there may be some obstructions in the glasses area. Based on this, the present invention proposes a detection method based on motion information + key parts of the glasses. It only needs to detect the nose pads or the temples to determine whether the driver is wearing glasses. The specific idea is to determine the possible position of the temples (the center of the temple area + the radius of the target temple area) by the action of holding the temples with hands; and to determine the possible position of the nose pads (the center of the nose pad area + the radius of the target nose pad area) by the action of pushing up the glasses with hands. The area in a picture is determined by the target area center and the target area radius, and then the area is cut out from the original image to detect the temples and nose pads.

[0132] In an embodiment of the present invention, the driver may have some unconscious movements, and this movement may also be misidentified due to actions similar to holding the temples of glasses and pushing up glasses. Therefore, the present invention further proposes a method for regional expansion based on the frequency of movements. The specific idea is to combine the frequency of the movement with the detection area. When the movement is detected for the first time, the radius of the local area detection is small, and then gradually increases with the increase of the movement until the area radius threshold is reached. A smaller area at the beginning can avoid the waste of resources caused by false touches, and if the action exists multiple times, it means that the action information is clear, so the detection area can be increased according to the number of times. The area radius threshold can infer the width of the face based on the size of the hand, and the width of the face is used as the threshold to avoid the leakage of facial privacy information. In addition, for the problem that multiple actions may have different intersections each time, a weighted average is used to uniquely determine the position of the intersection.

[0133] In summary, the present invention not only improves the accuracy and efficiency of glasses detection by combining the action frequency and the detection area expansion method, but also reduces resource waste and environmental interference, and realizes the functions of real-time monitoring and alarm. This method has a wide range of application prospects in driving assistance systems and helps to improve driving safety.

[0134] The driver's glasses detection solution provided by the embodiment of the present invention improves the accuracy of detection. By detecting the driver's specific actions and locating a certain part of the glasses, the detection area is gradually expanded, and it can more accurately identify whether the driver is wearing glasses; it reduces environmental interference and does not rely on the detection of the entire glasses, reducing the interference of environmental factors such as light and angle; it enhances robustness and detects the actions of holding the temples of the glasses and pushing up the glasses, thereby improving the robustness and stability of the system; it has strong real-time performance and can monitor the driver's actions in real time and determine whether he is wearing glasses, which is suitable for application in driving assistance systems; it reduces resource waste, the initial detection area is small, and resource waste caused by false touches is avoided. As the frequency of actions increases, the detection area is gradually expanded to improve detection efficiency; it enhances privacy protection, infers the width of the face based on the size of the hand, and uses the width of the face as the threshold of the detection area to avoid involving too much facial privacy information.

[0135] Embodiment 3

[0136] Figure 3 This is a structural schematic diagram of a driver's glasses detection device provided in Example 3 of the present invention. This embodiment can be applied to detecting whether the driver in a vehicle is wearing glasses. The method can be executed by the driver's glasses detection device, which can be implemented in software and / or hardware and can be configured in an electronic device that carries the driver's glasses detection function.

[0137] like Figure 3As shown, the device includes: a target action recognition module 310, a target detection area determination module 320, a target area image determination module 330 and a glasses detection module 340. Among them,

[0138] The target action recognition module 310 is used to monitor the driver in the current vehicle, obtain an initial driver image, and perform target action recognition on the initial driver image to determine whether there is a target action in the initial driver image; wherein the target action is an action of the driver holding the temple of the glasses or an action of the driver pushing up the glasses;

[0139] A target detection area determination module 320 is used to determine the target area center and the target action frequency of the initial driver image if there is a target action in the initial driver image, and determine the target detection area according to the preset initial area radius corresponding to the target action, the target area center and the target action frequency;

[0140] A target area image determination module 330, configured to determine a target area image from the initial driver image based on the target detection area;

[0141] The glasses detection module 340 is used to determine whether the driver in the initial driver image is wearing glasses based on the initial driver image and the target area image.

[0142] The embodiment of the present invention provides a driver's glasses detection scheme, which monitors the driver in the current vehicle, obtains an initial driver image, and performs target action recognition on the initial driver image to determine whether there is a target action in the initial driver image; wherein the target action is the driver's action of holding the temple of the glasses or the driver's action of pushing up the glasses; if there is a target action in the initial driver image, the target area center and target action frequency of the initial driver image are determined, and the target detection area is determined according to the preset initial area radius, target area center and target action frequency corresponding to the target action; based on the target detection area, the target area image is determined from the initial driver image; and according to the initial driver image and the target area image, it is determined whether the driver in the initial driver image wears glasses. The above scheme, by performing target action recognition on the initial driver image, determining the target area image, and jointly determining whether the driver wears glasses according to the initial driver image and the target area image, realizes the detection of whether the driver wears glasses on the basis of identifying the driver's action, thereby improving the accuracy of detecting whether the driver wears glasses.

[0143] Optionally, the device further comprises:

[0144] A reference image recognition module, used to obtain a reference driver image, and perform target action recognition on the reference driver image to determine whether the reference driver image has the same target action as the initial driver image;

[0145] A reference area center determination module, configured to update the target action frequency if the same target action exists in the reference driver image, obtain a new target action frequency, and determine the reference area center of the reference driver image;

[0146] a target area radius determination module, configured to update the target area center according to the target area center and the reference area center to obtain a new target area center, and to update the preset initial area radius according to the new target action frequency and the preset initial area radius to obtain a target area radius;

[0147] A new target area image determination module, used to determine a new target detection area according to the new target area center and the target area radius, and determine a new target area image from the reference driver image according to the new target detection area;

[0148] The reference glasses detection module is used to determine whether the driver in the reference driver image is wearing glasses based on the reference driver image and the new target area image.

[0149] Optionally, the target area radius determination module includes:

[0150] a radius update step length determination unit, configured to determine a corresponding radius update step length according to a target action in the reference driver image;

[0151] The target area radius determination unit is used to determine the target area radius according to the new target action frequency, the radius update step and the preset initial area radius.

[0152] Optionally, the device further comprises:

[0153] A boundary key point determination module, used to perform key point detection on the initial driver image, and determine the boundary key points of the driver's head in the initial driver image;

[0154] The area radius threshold determination module is used to determine the key point distance according to the boundary key point, and use the key point distance as the area radius threshold.

[0155] Optionally, after the target area radius determination module, the device further includes:

[0156] The update stop module is used to stop updating the preset initial area radius if the target area radius reaches an area radius threshold.

[0157] Optionally, the target area radius determination module includes:

[0158] a weight determination unit, configured to determine a first weight of the target area center and a second weight of the reference area center;

[0159] A new target area center determination unit is configured to update the target area center according to the first weight, the second weight, the target area center and the reference area center to obtain a new target area center.

[0160] Optionally, the glasses detection module 340 includes:

[0161] A first result determination unit, configured to determine a first detection result according to the initial driver image;

[0162] A target model determination unit, used to determine a target detection model corresponding to the target area image from preset candidate detection models;

[0163] A second result determination unit, used for inputting the target area image into a trained target detection model and outputting a second detection result;

[0164] A glasses detection unit is used to determine whether the driver in the initial driver image wears glasses based on the first detection result and the second detection result.

[0165] The driver's glasses detection device provided in the embodiment of the present invention can execute the driver's glasses detection method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects for executing each driver's glasses detection method.

[0166] In the technical solution of the present invention, the collection, storage, use, processing, transmission, provision and disclosure of the initial driver images and reference driver images involved are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0167] Embodiment 4

[0168] Figure 44 is a schematic diagram of the structure of an electronic device for implementing a method for detecting glasses of a driver provided by Embodiment 4 of the present invention. Electronic device 410 is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workbenches, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.

[0169] like Figure 4 As shown, the electronic device 410 includes at least one processor 411, and a memory connected to the at least one processor 411 in communication, such as a read-only memory (ROM) 412, a random access memory (RAM) 413, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 411 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 412 or the computer program loaded from the storage unit 418 to the random access memory (RAM) 413. In the RAM 413, various programs and data required for the operation of the electronic device 410 can also be stored. The processor 411, the ROM 412, and the RAM 413 are connected to each other via a bus 414. An input / output (I / O) interface 415 is also connected to the bus 414.

[0170] Multiple components in the electronic device 410 are connected to the I / O interface 415, including: an input unit 416, such as a keyboard, a mouse, etc.; an output unit 417, such as various types of displays, speakers, etc.; a storage unit 418, such as a disk, an optical disk, etc.; and a communication unit 419, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 419 allows the electronic device 410 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0171] The processor 411 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 411 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 411 performs the various methods and processes described above, such as a driver's glasses detection method.

[0172] In some embodiments, the driver's glasses detection method can be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 418. In some embodiments, part or all of the computer program can be loaded and / or installed on the electronic device 410 via the ROM 412 and / or the communication unit 419. When the computer program is loaded into the RAM 413 and executed by the processor 411, one or more steps of the driver's glasses detection method described above can be performed. Alternatively, in other embodiments, the processor 411 can be configured to perform the driver's glasses detection method by any other appropriate means (e.g., by means of firmware).

[0173] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0174] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0175] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0176] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).

[0177] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.

[0178] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.

[0179] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.

[0180] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A method for detecting a driver's glasses, characterized in that: include: Monitor the driver in the current vehicle, obtain an initial driver image, and perform target action recognition on the initial driver image to determine whether there is a target action in the initial driver image; wherein the target action is an action of the driver holding the temple of glasses or an action of the driver pushing up glasses; If there is a target action in the initial driver image, determining a target area center and a target action frequency of the initial driver image, and determining a target detection area according to a preset initial area radius corresponding to the target action, the target area center and the target action frequency; Based on the target detection area, determining a target area image from the initial driver image; According to the initial driver image and the target area image, it is determined whether the driver in the initial driver image wears glasses.

2. The method according to claim 1, characterized in that The method further comprises: Acquire a reference driver image, and perform target action recognition on the reference driver image to determine whether the reference driver image has the same target action as the initial driver image; If the same target action exists in the reference driver image, the target action frequency is updated to obtain a new target action frequency, and the reference area center of the reference driver image is determined; According to the target area center and the reference area center, the target area center is updated to obtain a new target area center, and according to the new target action frequency and the preset initial area radius, the preset initial area radius is updated to obtain a target area radius; Determining a new target detection area according to the new target area center and the target area radius, and determining a new target area image from the reference driver image according to the new target detection area; According to the reference driver image and the new target area image, it is determined whether the driver in the reference driver image wears glasses.

3. The method according to claim 2, characterized in that The step of determining the target area radius according to the new target action frequency and the preset initial area radius includes: Determining a corresponding radius update step size according to the target action in the reference driver image; The target area radius is determined according to the new target action frequency, the radius update step and the preset initial area radius.

4. The method according to claim 2, characterized in that: The method further comprises: Performing key point detection on the initial driver image to determine boundary key points of the driver's head in the initial driver image; According to the boundary key points, a key point distance is determined, and the key point distance is used as a region radius threshold.

5. The method according to claim 4, characterized in that After determining the target area radius according to the new target action frequency and the preset initial area radius, the method further includes: If the target area radius reaches the area radius threshold, then the updating of the preset initial area radius is stopped.

6. The method according to claim 2, characterized in that: The updating of the target area center according to the target area center and the reference area center to obtain a new target area center includes: Determining a first weight of the target area center, and determining a second weight of the reference area center; The target area center is updated according to the first weight, the second weight, the target area center and the reference area center to obtain a new target area center.

7. The method according to any one of claims 1 to 6, characterized in that The step of determining, based on the initial driver image and the target area image, whether the driver in the initial driver image wears glasses comprises: Determining a first detection result according to the initial driver image; Determine the target detection model corresponding to the target area image from preset candidate detection models; Inputting the target area image into a trained target detection model, and outputting a second detection result; According to the first detection result and the second detection result, it is determined whether the driver in the initial driver image wears glasses.

8. A driver's glasses detection device, characterized in that: include: A target action recognition module is used to monitor the driver in the current vehicle, obtain an initial driver image, and perform target action recognition on the initial driver image to determine whether there is a target action in the initial driver image; wherein the target action is an action of the driver holding the temple of the glasses or an action of the driver pushing up the glasses; a target detection area determination module, configured to determine a target area center and a target action frequency of the initial driver image if a target action exists in the initial driver image, and determine a target detection area according to a preset initial area radius corresponding to the target action, the target area center and the target action frequency; a target area image determination module, configured to determine a target area image from the initial driver image based on the target detection area; The glasses detection module is used to determine whether the driver in the initial driver image is wearing glasses based on the initial driver image and the target area image.

9. An electronic device, characterized in that: include: one or more processors; A memory for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the driver's glasses detection method as described in any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, a driver's glasses detection method as described in any one of claims 1 to 7 is implemented.