WO2020237940A1 - Fatigue detection method and device based on human eye state identification - Google Patents

Fatigue detection method and device based on human eye state identification Download PDF

Info

Publication number
WO2020237940A1
WO2020237940A1 PCT/CN2019/108073 CN2019108073W WO2020237940A1 WO 2020237940 A1 WO2020237940 A1 WO 2020237940A1 CN 2019108073 W CN2019108073 W CN 2019108073W WO 2020237940 A1 WO2020237940 A1 WO 2020237940A1
Authority
WO
WIPO (PCT)
Prior art keywords
image
human eye
face
feature points
point
Prior art date
Application number
PCT/CN2019/108073
Other languages
French (fr)
Chinese (zh)
Inventor
李源
王晋玮
侯喆
Original Assignee
初速度(苏州)科技有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 初速度(苏州)科技有限公司 filed Critical 初速度(苏州)科技有限公司
Publication of WO2020237940A1 publication Critical patent/WO2020237940A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/10Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
    • G06V40/16Human faces, e.g. facial parts, sketches or expressions
    • G06V40/172Classification, e.g. identification
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V20/00Scenes; Scene-specific elements
    • G06V20/50Context or environment of the image
    • G06V20/52Surveillance or monitoring of activities, e.g. for recognising suspicious objects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/10Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
    • G06V40/16Human faces, e.g. facial parts, sketches or expressions
    • G06V40/161Detection; Localisation; Normalisation
    • G06V40/165Detection; Localisation; Normalisation using facial parts and geometric relationships

Definitions

  • the present invention relates to the technical field of video surveillance, and in particular to a fatigue detection method and device based on human eye state recognition.
  • the related fatigue detection process is generally: obtain the face image collected for the target person, detect the face image through the pre-trained eye state detection model, and detect the open and closed state of the target person’s eyes, that is, detection Whether the eyes of the target person are in a closed state, according to the detection result, determine whether the target person is fatigued. If it is detected that the eyes of the target person are in a closed state, it is determined that the target person is fatigued and an alarm is issued.
  • the trained human eye state detection model is a neural network model trained on sample images marked with human eyes in a closed state and human eyes in an open state.
  • the labeling standards for the closed state and open state of the eyes in the sample image cannot be unified, such as the labeling of half-opened eyes.
  • some annotators mark the closed state, which causes the pre-trained eye state detection model to blur the detection boundary between the closed state and the open state of the human eye in the image, which leads to insufficient accuracy of the detection result.
  • the present invention provides a fatigue detection method and device based on human eye state recognition, so as to determine the spatial information of the human eye, improve the accuracy of the detection result of the human eye state, and further improve the fatigue of the target person The accuracy of the test results.
  • the specific technical solutions are as follows:
  • embodiments of the present invention provide a fatigue detection method based on human eye state recognition, including:
  • the face image is detected, and the facial feature points of the face in the face image and the eyelid feature points of the upper and lower eyelids of the human eyes in the face are detected, wherein the facial feature points are: Describe the feature points of each part of the face in the face image;
  • the target three-dimensional face model includes: based on the eyelid feature The upper and lower eyelids of the human eye constructed by points;
  • the current fatigue degree of the target person is determined.
  • the step of detecting the face image and detecting the facial feature points of the face in the face image and the eyelid feature points of the upper and lower eyelids of the human eyes in the face includes:
  • the eyelid feature points of the upper and lower eyelids of the human eye are detected from the human eye image, where the preset eyelid feature point detection model is: A model trained on sample images of the eyelid feature points of the upper and lower eyelids.
  • the human eye image includes a left eye image and a right eye image
  • the method further includes:
  • the step of using a preset eyelid feature point detection model to detect the eyelid feature points of the upper and lower eyelids of the human eye from the human eye image includes:
  • Eyelid feature points of the upper and lower eyelids of the human eye in the mirror image, and the upper and lower eyelids of the human eye in the image without mirror processing are detected.
  • Mirror image processing is performed on the eyelid feature points of the upper and lower eyelids of the human eye in the mirror image to obtain the eyelid feature points after mirroring, so as to obtain the eyelid feature points of the upper and lower eyelids of the human eye in the human eye image.
  • the method before the step of performing mirror processing on the first image to obtain a mirror image, the method further includes:
  • the left-eye image and the right-eye image are subjected to normalization processing to obtain a corrected left-eye image and a normalized right-eye image, wherein the normalization processing is: making the two eye corner points in the image to be processed The line is parallel to the coordinate axis of the preset image coordinate system, and the image to be processed is the left-eye image and the right-eye image;
  • the step of performing mirror image processing on the first image to obtain a mirror image includes:
  • the step of constructing a target three-dimensional face model corresponding to the target person based on a preset three-dimensional face model, the face feature points, and the eyelid feature points includes:
  • the spatial position information of the spatial point at the preset face position is determined as the spatial position information of the spatial point to be processed, wherein the spatial point to be processed and the image feature point exist
  • the image feature points are: the facial feature points and the eyelid feature points;
  • a target three-dimensional face model corresponding to the target person is constructed.
  • the step of determining the current opening and closing length between the upper and lower eyelids of the human eye based on the three-dimensional position information of the upper and lower eyelids of the human eye in the target three-dimensional face model is achieved by the following two Realize in any one of the ways:
  • the step of determining the current fatigue degree of the target person based on the current opening and closing length includes:
  • the current fatigue degree of the target person is determined.
  • the step of determining the current fatigue degree of the target person based on the current opening and closing length and the historical opening and closing length includes:
  • the opening and closing length includes the current opening and closing length and the historical opening and closing length
  • the method further includes:
  • an embodiment of the present invention provides a fatigue detection device based on human eye state recognition, including:
  • the first obtaining module is configured to obtain a face image containing the face of the target person collected by the image capture device for shooting the target person;
  • the detection module is configured to detect the face image, and detect the facial feature points of the face in the face image and the eyelid feature points of the upper and lower eyelids of the human eyes in the face, wherein the facial feature points Is: used to characterize the feature points of each part of the face in the face image;
  • the construction module is configured to construct a target three-dimensional face model corresponding to the target person based on a preset three-dimensional face model, the facial feature points and the eyelid feature points, wherein the target three-dimensional face model includes : The upper and lower eyelids of the human eye constructed based on the eyelid feature points;
  • a first determining module configured to determine the current opening and closing length between the upper and lower eyelids of the human eye based on the three-dimensional position information of the upper and lower eyelids of the human eye in the target three-dimensional face model;
  • the second determining module is configured to determine the current fatigue degree of the target person based on the current opening and closing length.
  • the detection module includes:
  • the first detection unit is configured to detect the face image, and detect facial feature points of the face in the face image
  • the determining and intercepting unit is configured to determine and intercept the area where the human eye in the face is located from the face image based on the facial feature point, as a human eye image;
  • the second detection unit is configured to use a preset eyelid feature point detection model to detect the eyelid feature points of the upper and lower eyelids of the human eye from the human eye image, wherein the preset eyelid feature point detection
  • the model is a model trained based on sample images marked with feature points of the upper and lower eyelids of a human eye.
  • the human eye image includes a left eye image and a right eye image; the device may further include:
  • the mirroring module is configured to perform mirroring processing on the first image before detecting the eyelid feature points of the upper and lower eyelids of the human eye from the human eye image using the preset eyelid feature point detection model to obtain A mirror image, wherein the first image is the left eye image or the right eye image;
  • a splicing module configured to splice the mirror image and the image that has not been mirrored in the human eye image to obtain a spliced image
  • the second detection unit is specifically configured to: use a preset eyelid feature point detection model to detect, from the stitched image, the eyelid feature points of the upper and lower eyelids of the human eye in the mirror image, and the The eyelid feature points of the upper and lower eyelids of the human eye in the mirror image processed; the eyelid feature points of the upper and lower eyelids of the human eye in the mirror image are mirrored to obtain the eyelid feature points after mirroring to obtain the human eye image The characteristic points of the upper and lower eyelids of the human eye.
  • the detection module further includes:
  • the normalization unit is configured to perform normalization processing on the left-eye image and the right-eye image before the mirror image processing is performed on the first image to obtain the mirror image, to obtain a normalized left-eye image and a normalized right-eye image.
  • Eye image wherein the correction processing is: making the line of two eye corner points in the image to be processed parallel to the coordinate axis of the preset image coordinate system, and the image to be processed is the left eye image and the right eye image.
  • the mirroring unit is specifically configured to perform mirroring processing on the converted first image to obtain a mirrored image.
  • the construction module is specifically configured to determine the spatial position information of the spatial point at the preset face position from the preset three-dimensional face model, as the spatial position information of the spatial point to be processed, wherein, there is a corresponding relationship between the spatial points to be processed and image feature points, and the image feature points are: the facial feature points and the eyelid feature points; the weak perspective projection matrix and the spatial position of each spatial point to be processed are used Information, determine the projection position information of the projection point of each spatial point to be processed in the face image; based on the projection position information of the projection point of each spatial point to be processed and the image feature point corresponding to each spatial point to be processed To construct a target three-dimensional face model corresponding to the target person.
  • the first determining module is specifically configured to: detect, from the target three-dimensional face model, the three-dimensional position information of the first center point of the upper eyelid of the human eye and the second The three-dimensional position information of the center point; based on the three-dimensional position information of the first center point and the three-dimensional position information of the second center point, determine the distance between the first center point and the second center point as The current opening and closing length between the upper and lower eyelids of the human eye.
  • the first determining module is specifically configured to: determine, from the target three-dimensional face model, three-dimensional position information of a human eye space point corresponding to the human eye; based on the human eye space point Perform spherical fitting to obtain a sphere model that characterizes the human eye; from the target three-dimensional face model, detect the three-dimensional position information of the first center point of the upper eyelid of the human eye and the lower The three-dimensional position information of the second center point of the eyelid; based on the three-dimensional position information of the first center point and the three-dimensional position information of the second center point, it is determined from the sphere model that the first center point corresponds to The three-dimensional position information of the first spherical point and the three-dimensional position information of the second spherical point corresponding to the second center point; based on the three-dimensional position information of the first spherical point and the three-dimensional position information of the second spherical point, The distance between the first spherical point and the second s, the
  • the second determining module includes:
  • An obtaining unit configured to obtain the historical opening and closing length of the human eye of the target person determined within a preset time period
  • the determining unit is configured to determine the current fatigue degree of the target person based on the current opening and closing length and the historical opening and closing length.
  • the determining unit is specifically configured as
  • the opening and closing length includes the current opening and closing length and the historical opening and closing length
  • the device may further include:
  • the generating and sending module is configured to generate and send alarm information if the current fatigue degree of the target person is determined to be fatigue after the current fatigue degree of the target person is determined based on the current opening and closing length.
  • the fatigue detection method and device based on human eye state recognition provided by the embodiments of the present invention can obtain the face image containing the face of the target person collected by the image capture device for shooting the target person; The face image is detected, and the facial feature points of the face in the face image and the eyelid feature points of the upper and lower eyelids of the human eye in the face are detected.
  • the facial feature points are: the feature points used to represent each part of the face in the face image ; Based on the preset three-dimensional face model, facial feature points and eyelid feature points, construct a target three-dimensional face model corresponding to the target person, where the target three-dimensional face model includes: the upper and lower eyelids of the human eye constructed based on the eyelid feature points; Based on the three-dimensional position information of the upper and lower eyelids of the human eye in the target three-dimensional face model, the current opening and closing length between the upper and lower eyelids of the human eye is determined; based on the current opening and closing length, the current fatigue degree of the target person is determined.
  • the upper and lower eyelids of the target person’s eyes corresponding to the target person can be constructed based on the facial feature points and the eyelid feature points in the face image containing the target person’s face and the preset three-dimensional face model
  • the target three-dimensional face model which constructs the spatial information of the human eye of the target person. Based on this spatial information, the spatial distance between the upper and lower eyelids of the human eye can be determined with higher accuracy, that is, the open and closed state of the human eye Furthermore, based on the more accurate spatial distance between the upper and lower eyelids of the human eye, the current fatigue level of the target person can be determined more accurately.
  • the pre-trained human eye state detection model is no longer solely dependent on the detection result of the open and closed state of the human eye in the two-dimensional image, so as to realize the determination of the fatigue degree of the target person and avoid the pre-trained human eye.
  • the state detection model blurs the detection boundary between the closed state and the open state of the human eye in the image, which leads to the occurrence of insufficient detection results. It is possible to determine the spatial information of the human eye, thereby improving the accuracy of the detection result of the human eye state, and the accuracy of the detection result of the current fatigue degree of the target person.
  • any product or method of the present invention does not necessarily need to achieve all the advantages described above at the same time.
  • the spatial information of the human eye of the target person is constructed. Based on the spatial information, the spatial distance between the upper and lower eyelids of the human eye can be determined with higher accuracy, that is, the open and closed state of the human eye. The spatial distance between the upper and lower eyelids of the more flexible human eyes can more accurately determine the current fatigue level of the target person.
  • the pre-trained human eye state detection model is no longer solely dependent on the detection result of the open and closed state of the human eye in the two-dimensional image, so as to realize the determination of the fatigue degree of the target person and avoid the pre-trained human eye.
  • the state detection model blurs the detection boundary between the closed state and the open state of the human eye in the image, which leads to the occurrence of insufficient detection results. It is possible to determine the spatial information of the human eye, thereby improving the accuracy of the detection result of the state of the human eye, and the accuracy of the detection result of the current fatigue degree of the target person.
  • the eyelid feature point detection model in the stitched image simultaneously detects the eyelid feature points in the two human eyes in the stitched image, that is, through one detection, the eyelid feature points of the upper and lower eyelids of the two human eyes in the stitched image can be detected. Simplifies the detection process of eyelid feature points using the preset eyelid feature point detection model.
  • the left-eye image and the right-eye image are corrected to obtain the corrected left-eye image and the corrected right-eye image, and then the corrected left-eye image or the corrected right-eye image is subjected to subsequent processing, so that To a certain extent, the detection burden of the preset eyelid feature point detection model can be reduced, and the detection result of eyelid feature points can be improved to a certain extent.
  • the first implementation method is to combine the three-dimensional position information of the first center point of the upper eyelid of the human eye in the target three-dimensional face model and the lower eyelid
  • the three-dimensional position information of the second center point, the determined three-dimensional distance between the upper and lower eyelids is used as the current opening and closing length between the upper and lower eyelids of the human eye to ensure the accuracy of the determined current opening and closing length between the upper and lower eyelids
  • the calculation process is simplified.
  • the second implementation method considering that the actual human eye is spherical, the three-dimensional position information of the human eye space point corresponding to the human eye is determined from the target three-dimensional face model, and spherical fitting is performed to obtain more
  • the sphere model that accurately represents the real human eye, and the distance between the first sphere point corresponding to the first center point of the upper eyelid and the second sphere point corresponding to the second center point of the lower eyelid in the sphere model is determined as a person
  • the current opening and closing length between the upper and lower eyelids of the eye can better improve the accuracy of the current opening and closing length, thereby improving the accuracy of the detection result of the fatigue degree.
  • FIG. 1 is a schematic flowchart of a fatigue detection method based on eye state recognition provided by an embodiment of the present invention
  • FIG. 2A is a schematic flow chart of determining the current opening and closing length between the upper and lower eyelids of a human eye according to an embodiment of the present invention
  • 2B is a schematic diagram of another flow chart for determining the current opening and closing length between the upper and lower eyelids of a human eye according to an embodiment of the present invention
  • FIG. 3 is a schematic structural diagram of a fatigue detection device based on human eye state recognition provided by an embodiment of the present invention.
  • the present invention provides a fatigue detection method and device based on human eye state recognition, so as to determine the spatial information of the human eye, thereby improving the accuracy of the detection result of the human eye state, and improving the fatigue of the target person The accuracy of the test results.
  • the embodiments of the present invention will be described in detail below.
  • FIG. 1 is a schematic flowchart of a fatigue detection method based on eye state recognition provided by an embodiment of the present invention. The method can include the following steps:
  • S101 Obtain a face image containing the face of the target person collected by the image capture device for shooting the target person.
  • the method can be applied to any type of electronic device, where the electronic device can be a server or a terminal device.
  • the electronic device may be an image acquisition device.
  • the electronic device may directly obtain the face image including the face of the target person collected by itself, and then execute the facial image provided by the embodiment of the present invention for the face image. Fatigue detection process based on human eye status recognition.
  • the electronic device may be a non-image acquisition device, and correspondingly, the electronic device may communicate with the image acquisition device that shoots for the target person.
  • the electronic device can communicate with one or more image acquisition devices to obtain facial images collected by one or more image acquisition devices, and then implement the embodiments of the present invention for the facial images collected by each image acquisition device
  • the provided fatigue detection process based on human eye state recognition, in which different image acquisition devices can target different target persons.
  • the image acquisition device can be set in the vehicle, and correspondingly, the target person is the driver of the vehicle, the image acquisition device can photograph the face of the driver in the vehicle in real time, and the electronic device can obtain the image acquisition device A facial image containing the driver's face collected by shooting for the driver.
  • the image acquisition device can directly acquire a face image containing only the driver's face, and then send it to the electronic device.
  • the image captured by the image capture device may also include information such as the seat of the vehicle or the driver’s body.
  • the electronic device After the electronic device obtains the image captured by the image capture device, it can directly The obtained image is used as a face image for subsequent processes; it can also be based on a preset face detection algorithm to detect the image of the area where the face is located from the obtained image, and use the image of the area where the face is obtained from the obtained image.
  • the image is cut out to obtain a face image containing only the driver's face, so as to improve the detection accuracy of subsequent facial feature points and eyelid feature points, and reduce the amount of detection calculation to a certain extent.
  • the preset face detection algorithm can be: eigenface method (Eigenface) and face detection algorithm based on neural network model
  • face detection algorithm based on neural network model can be: FasterR-CNN (Faster Region-Convolutional Neural Networks, fast area-convolutional neural network) detection algorithm, this is all possible.
  • the embodiment of the present invention does not limit the specific type of the preset face detection algorithm.
  • the vehicle may be a private car, a truck, a bus, etc.
  • the embodiment of the present invention does not limit the vehicle type of the vehicle.
  • the image capture device can also monitor the passing vehicles on the road in real time.
  • the target person can be the target driver, and the electronic device can obtain multiple image capture devices to take pictures of the target driver.
  • the image acquisition device can directly acquire a face image containing only the face of the target driver, and then send it to the electronic device.
  • the image captured by the image capture device may also include information such as the window and front of the vehicle.
  • the electronic device After the electronic device obtains the image captured by the image capture device, it can directly The image of the face is used as the face image for the subsequent process; it can also be based on the preset face detection algorithm to detect the image of the area where the face is located from the image, and cut the image of the area where the face is located from the image to obtain only A face image containing the face of the target driver.
  • the image capture device can monitor indoor household personnel in real time.
  • the target person can be the target household person
  • the electronic device can obtain the target captured by the image capture device for shooting the target household person. Face image of the face of the householder.
  • S102 Detect the face image, and detect the facial feature points of the face in the face image and the eyelid feature points of the upper and lower eyelids of the human eyes in the face.
  • the facial feature points are: feature points used to represent various parts of the face in the face image.
  • the first feature point detection model established in advance can be used to detect the face image, and the facial feature points of the face in the face image and the eyelid feature points of the upper and lower eyelids of the human eyes in the face can be detected.
  • the pre-established first feature point detection model is: a neural network model obtained by training based on a first sample image calibrated with facial feature points and eyelid feature points.
  • the embodiment of the present invention may also include a process of training to obtain a pre-established first feature point detection model.
  • the electronic device may first obtain an initial first feature point detection model, and the initial first feature
  • the point detection model includes a feature extraction layer and a feature classification layer; a first sample image is obtained, and each first sample image includes a human face; and calibration information corresponding to each first sample image is obtained, wherein the calibration information includes the first sample image.
  • the sample image contains the calibration position information of the calibration feature points of the face, and the calibration feature points include: facial feature points representing various parts of the face and eyelid feature points in the upper and lower eyelids of the human eye.
  • the facial feature points of each part may include: each feature point in the face that characterizes the position of the nose, such as nose wings, nose bridge, and nose tip; it may also include various feature points that characterize the position of the lips, such as lips.
  • the calibration information can be manually calibrated or calibrated through a specific calibration procedure.
  • the electronic device inputs each first sample image into the feature extraction layer of the initial first feature point detection model to obtain the image feature of each first sample image; input the image feature of each first sample image into the initial The feature classification layer of the first feature point detection model of the first feature point to obtain the current location information of the calibration feature point in each first sample image; the current location information of the calibration feature point in each first sample image and its corresponding calibration location Information is matched; if the matching is successful, the first feature point detection model including the feature extraction layer and the feature classification layer is obtained, that is, the pre-established first feature point detection model is obtained; if the matching is not successful, the feature extraction layer and features are adjusted Classification layer parameters, return to the step of executing the feature extraction layer of inputting each first sample image into the initial feature point detection model to obtain the image features of each first sample image; until the matching is successful, the feature extraction is obtained The first feature point detection model of the layer and feature classification layer.
  • the above process of matching the current position information of the calibration feature point in each first sample image with the corresponding calibration position information may be: calculating the current position information of each calibration feature point by using a preset loss function Determine whether the first loss value is less than the first preset loss threshold value between the corresponding calibration position information; if it is determined that the first loss value is less than the first preset loss threshold value, it is determined that the matching is successful. It can be determined that the initial feature point detection model converges, that is, it is determined that the training of the initial feature point detection model is completed, and the pre-established feature point detection model is obtained; if it is determined that the first loss value is not less than the first preset loss threshold, It is determined that the matching is unsuccessful.
  • each first sample image has a corresponding relationship with the current position information of the calibration feature point
  • each first sample image has a corresponding relationship with the calibration position information of the calibration feature point in the calibration information
  • the calibration feature point There is a corresponding relationship between the current position information and the calibration position information of the calibration feature points in the calibration information.
  • the electronic device can detect the obtained face image based on the pre-established first feature point detection model, and detect the facial feature points of the face in the face image And the eyelid characteristic points of the upper and lower eyelids of the human eye in the face.
  • S103 Based on the preset three-dimensional face model, facial feature points, and eyelid feature points, construct a target three-dimensional face model corresponding to the target person.
  • the target three-dimensional face model includes: the upper and lower eyelids of a human eye constructed based on eyelid feature points.
  • a preset three-dimensional face model is prestored locally or in a storage device connected to the electronic device, and the electronic device determines the facial feature points of the face in the face image and the upper and lower eyelids of the human eyes in the face.
  • a target three-dimensional face model corresponding to the target person can be constructed based on the preset three-dimensional face model, facial feature points, and eyelid feature points.
  • 3DMM 3D Morphable Models, three-dimensional deformation model
  • the S103 may include:
  • the spatial position information of the spatial point at the preset facial position is determined as the spatial position information of the spatial point to be processed.
  • the feature points are: facial feature points and eyelid feature points;
  • a target three-dimensional face model corresponding to the target person is constructed.
  • the electronic device may receive a user selection instruction, where the user selection instruction carries a preset face position of a spatial point that needs to be selected, and the electronic device may, based on the preset face position carried by the user selection instruction, In the preset three-dimensional face model, the spatial position information of the spatial point at the preset face position is determined as the spatial position information of the spatial point to be processed.
  • the electronic device may prestore the preset face position, and the electronic device may read the preset face position from the corresponding storage location, and then determine from the preset three-dimensional face model The spatial position information of the spatial point at the preset face position is used as the spatial position information of the spatial point to be processed.
  • the spatial points to be processed and the image feature points are: facial feature points and eyelid feature points, and the to-be-processed spatial points have a one-to-one correspondence with the image feature points.
  • the preset face position may be set based on the position of the calibration feature point of the face contained in the first sample image.
  • the preset three-dimensional face model can be expressed by the following formula (1):
  • S represents the preset three-dimensional face model
  • a id represents the shape information of the human face
  • a exp represents the expression information of the human face
  • ⁇ id represents the weight of the shape information of the human face, which can be called the shape weight
  • ⁇ exp The weight of the expression information representing the human face can be called the expression weight.
  • the electronic device can draw the three-dimensional face model it represents based on the above formula (1), and the three-dimensional face model is composed of point clouds.
  • the electronic device can determine the spatial point at the preset face position from the drawn three-dimensional face model as the spatial point to be processed, and obtain the spatial position information of the spatial point to be processed.
  • the electronic device After the electronic device determines the spatial position information of the spatial point to be processed, it can project each spatial point to be processed into the face image based on the preset weak perspective projection matrix, that is, use the weak perspective projection matrix and each to be processed
  • the spatial position information of the spatial point determines the projection position information of the projection point of each spatial point to be processed in the face image. Based on the projection position information of the projection point of each spatial point to be processed and the imaging position information of the image feature point corresponding to each spatial point to be processed, a target three-dimensional face model corresponding to the target person is constructed.
  • the imaging location information of the image feature point is the location information of the image feature point in the face image.
  • the above-mentioned process of constructing the target three-dimensional face model corresponding to the target person based on the projection position information of the projection point of each spatial point to be processed and the imaging position information of the image feature point corresponding to each spatial point to be processed may be: Based on the projection position information of the projection point of each spatial point to be processed and the imaging position information of the image feature point corresponding to each spatial point to be processed, the distance error of each spatial point to be processed and its corresponding image feature point is determined, based on The principle of least squares and the distance error of each spatial point to be processed and its corresponding image feature point are used to construct the objective function.
  • the solution minimizes the function value of the objective function or satisfies a preset constraint condition a solution of the corresponding unknown quantity in the objective function is obtained based on the solution to obtain a target three-dimensional face model corresponding to the target person.
  • the preset weak perspective projection matrix can be expressed by the following formula (2):
  • s i2d represents the projection position information of the projection point of the i-th spatial point to be processed, where i can be an integer in [1, n], where n represents the number of spatial points to be processed, f represents the scale factor, and R ( ⁇ , ⁇ , ⁇ ) represents a 3*3 rotation matrix, ⁇ represents the rotation angle of the preset three-dimensional face model under the horizontal axis in the preset space rectangular coordinate system, and ⁇ represents the preset three-dimensional face The rotation angle of the model under the vertical axis in the preset space rectangular coordinate system, ⁇ represents the rotation angle of the preset three-dimensional face model under the vertical axis in the preset space rectangular coordinate system, and t 3d represents the translation vector; S i represents the spatial position information of the i-th spatial point to be processed, and the rotation matrix and translation vector are used to: convert the preset three-dimensional face model from the preset spatial rectangular coordinate system where it is located to the image acquisition device In the device coordinate system.
  • the objective function can be expressed by the following formula (3):
  • P represents the function value of the objective function
  • s i2dt represents the imaging position information of the image feature point corresponding to the i-th spatial point to be processed
  • represents the modulus of the vector
  • the vector represents: the i-th spatial point to be processed The distance error between the imaging position information of the corresponding image feature point and the projection position information of the projection point of the i-th spatial point to be processed.
  • the specific values of f, R( ⁇ , ⁇ , ⁇ ), t 3d , ⁇ id , and ⁇ exp can be continuously adjusted through an iterative method to minimize P or satisfy preset constraints.
  • the preset constraint condition may be that P is not greater than a preset distance error threshold.
  • S104 Determine the current opening and closing length between the upper and lower eyelids of the human eye based on the three-dimensional position information of the upper and lower eyelids of the human eye in the target three-dimensional face model.
  • S105 Determine the current fatigue level of the target person based on the current opening and closing length.
  • the opening and closing state of the human eye of a person can represent the fatigue degree of the person to a certain extent
  • the opening and closing state of the human eye can be measured by the opening and closing length between the upper and lower eyelids of the human eye Logo.
  • the distance between the upper and lower eyelids of the human eyes will be relatively small when the average person is in a fatigue state
  • the distance between the upper and lower eyelids of the human eye will be relatively large when the person is in a non-fatigue state.
  • the target three-dimensional face model includes the upper and lower eyelids of the human eye of the target person. Through the upper and lower eyelids in the target three-dimensional face model, the three-dimensional distance between the upper and lower eyelids can be determined and used as the current opening and closing length. Based on the current opening and closing length, the current fatigue level of the target person is determined.
  • it can be based on the three-dimensional position information of the upper and lower eyelids of any human eye in the target three-dimensional face model, such as the three-dimensional position information of the upper and lower eyelids of the left eye or the three-dimensional position information of the upper and lower eyelids of the right eye, to determine the upper and lower eyelids The current opening and closing length between the two, and then determine the current state of the target person.
  • it can be: for the three-dimensional position information of the upper and lower eyelids of the two human eyes of the target person, such as the three-dimensional position information of the upper and lower eyelids of the left and right eyes, determine the current opening and closing length between the upper and lower eyelids, and then , To determine the current status of the target personnel.
  • it can be the three-dimensional position information of the upper and lower eyelids of each eye of the target person to determine the opening and closing length between the upper and lower eyelids of each eye, and then calculating the average of the opening and closing lengths between the upper and lower eyelids of the two eyes The value is used as the current opening and closing length between the upper and lower eyelids to determine the current state of the target person.
  • the upper and lower eyelids of the target person’s eyes corresponding to the target person can be constructed based on the facial feature points and the eyelid feature points in the face image containing the target person’s face and the preset three-dimensional face model
  • the target three-dimensional face model which constructs the spatial information of the human eye of the target person. Based on this spatial information, the spatial distance between the upper and lower eyelids of the human eye can be determined with higher accuracy, that is, the open and closed state of the human eye Furthermore, based on the more accurate spatial distance between the upper and lower eyelids of the human eye, the current fatigue level of the target person can be determined more accurately.
  • the embodiment of the present invention no longer only relies on the detection result of the closed state of the human eye in the two-dimensional image by using the pre-trained human eye state detection model to realize the determination of the fatigue degree of the target person and avoid the pre-trained eye state
  • the detection model blurs the detection boundary between the closed state and the open state of the human eye in the image, which leads to the occurrence of insufficient detection results. It is possible to determine the spatial information of the human eye, thereby improving the accuracy of the detection result of the human eye state, and the accuracy of the detection result of the current fatigue degree of the target person.
  • the S102 may include:
  • the preset eyelid feature point detection model uses the preset eyelid feature point detection model to detect the eyelid feature points of the upper and lower eyelids of the human eye.
  • the preset eyelid feature point detection model is: a model trained based on sample images marked with the eyelid feature points of the upper and lower eyelids of a human eye.
  • the face image contains the characteristics of the entire face of the target person, and the eyelid point of the eyelid of the human eye is directly detected in the face image. It is inevitable that the detection is not accurate enough.
  • the face image can be detected first, and the facial feature points that can represent the various parts of the target person’s face in the face image are detected, and then, based on the facial feature points, the face is determined from the face image
  • the area where the human eye is located is used as the human eye image, and the human eye image is cut out from the face image.
  • the eyelid feature points of the upper and lower eyelids of the human eye are detected from the human eye image containing the human eye. In order to improve the accuracy of the detected eyelid feature points of the human eye to a certain extent.
  • the preset eyelid feature point detection model is: a model trained based on sample images marked with eyelid feature points of the upper and lower eyelids of a human eye.
  • the preset eyelid feature point detection model may be a neural network model.
  • the training process of the preset eyelid feature point detection model refer to the training process of the first feature point detection model established in advance. It can be understood that, for clear layout, the sample image required by the preset eyelid feature point detection model can be called the second sample image, which is different from the first sample image of the first feature point detection model established in advance.
  • the second sample image is an image marking the eyelid feature points of the upper and lower eyelids of a human eye
  • the calibration information corresponding to the second sample image includes the calibration position information of the eyelid feature points of the upper and lower eyelids of the human eye.
  • the eyelid feature points of the upper and lower eyelids of the human eye marked by the second sample image may be eyelid feature points calibrated manually or through a specific calibration procedure.
  • the above detection of the face image can be: based on the pre-established second feature point detection model, the face image is detected, and the detection is obtained
  • the face image can represent the facial feature points of each part of the target person’s face.
  • the pre-established second feature point detection model is: a nerve trained on the third sample image marked with facial feature points that can represent each part of the face Network model.
  • the third sample image required by the pre-established second feature point detection model is an image marked with facial feature points that can represent various parts of the face, and
  • the calibration information corresponding to the third sample image includes calibration position information that can characterize facial feature points of various parts of the face.
  • the area where the human eye of the target person is located is determined and cut out from the face image, as the human eye image.
  • it can be based on the two-dimensional position information of each feature point representing the location of the human eye in the facial feature point, determining the smallest rectangular area containing the human eye of the target person, taking the rectangular area as the area of the human eye, and Cut out to get the human eye image. It may be that the images of the area where the target person is located are respectively intercepted for the two eyes of the target person to obtain the human eye image.
  • the human eye image includes a left eye image and a right eye image
  • the method may further include:
  • the S102 may include:
  • Using a preset eyelid feature point detection model from the stitched image, detect the eyelid feature points of the upper and lower eyelids of the human eye in the mirror image, and the eyelid feature points of the upper and lower eyelid of the human eye in the image without mirror processing;
  • Mirror image processing is performed on the eyelid feature points of the upper and lower eyelids of the human eye in the mirror image to obtain the eyelid feature points after mirroring to obtain the eyelid feature points of the upper and lower eyelids of the human eye in the human eye image.
  • the human eye image includes: an image containing the left eye of the target person, which may be called a left eye image; and an image containing the right eye of the target person, which may be called a right eye image.
  • a left eye image an image containing the left eye of the target person
  • an image containing the right eye of the target person which may be called a right eye image.
  • mirror image processing may be performed on the first image to obtain a mirror image, that is, mirror image processing is performed on the left eye image or the right eye image to obtain a mirror image.
  • the preset eyelid feature point detection model can simultaneously detect the mirror image and the image without mirror processing, which can shorten the detection time required to detect the eyelid feature points of the target person by using the preset eyelid feature point detection model.
  • the image that has not been mirrored is the left-eye image; if the left-eye image is mirrored, the image that has not been mirrored is the right-eye image.
  • Mirroring the left-eye image or the right-eye image can make the left-eye image mirror the right-eye image corresponding to the left-eye image, or make the right-eye image mirror the left-eye image corresponding to the right-eye image, to a certain extent Reduce the complexity of using the preset eyelid feature point detection model to detect the eyelid feature points of the target person.
  • the required second sample image may include the left eye image of the sample person and the left eye image obtained by mirroring the right eye image of the sample person. Or include the right eye image of the sample person’s right eye image and the right eye image of the sample person’s left eye image.
  • the second sample image required by the above-mentioned preset eyelid feature point detection model is obtained through training, it contains the left eye image of the sample person and the left eye image obtained by mirroring the right eye image of the sample person, and the subsequent, in the detection process ,
  • the first image is the right eye image of the target person, that is, the right eye image of the target person needs to be mirrored.
  • the second sample image required by the above-mentioned preset eyelid feature point detection model is obtained by training, it contains the right eye image of the sample person and the right eye image obtained by mirroring the left eye image of the sample person, and then, in the detection process ,
  • the first image is the left eye image of the target person, that is, the left eye image of the target person needs to be mirrored.
  • the right eye image or left eye image of the sample person is mirrored. To a certain extent, it can also increase the training to obtain the above-mentioned preset eyelid feature point detection model.
  • the number of second sample images is obtained by training.
  • the above process of splicing the mirror image and the image that has not been mirrored in the human eye image to obtain the spliced image can be: splicing the mirror image and the image that has not been mirrored in the human eye image in the spatial dimension or channel dimension.
  • Splicing, where the splicing of the spatial dimension may be: splicing the mirror image and the image that has not been mirrored in the human eye image left and right spliced or spliced up and down.
  • Left and right splicing can be: the right side of the mirror image is spliced with the left side of the image that is not mirrored in the human eye image, and the left side of the mirror image is the right side of the image that is not mirrored in the human eye image.
  • Top and bottom splicing can be: the upper side of the mirror image is spliced with the lower side of the image that is not mirrored in the human eye image, and the lower side of the mirror image is the upper side of the image that is not mirrored in the human eye image. Make splicing.
  • the method may further include:
  • the left-eye image and the right-eye image are corrected to obtain the corrected left-eye image and the corrected right-eye image, where the normalized processing is: making the line between the two eye corner points in the image to be processed and the preset image
  • the coordinate axes of the coordinate system are parallel, and the images to be processed are the left eye image and the right eye image;
  • the step of performing mirror image processing on the first image to obtain a mirror image may include:
  • the head of the target person may be tilted.
  • the left-eye image and the right-eye image can be corrected first, that is, the connection between the two corner points of the left-eye image is parallel to the horizontal axis of the preset image coordinate system, and the two corner points of the right-eye image are connected.
  • the line is parallel to the horizontal axis of the preset image coordinate system; or, making the line between the two corner points of the left eye image parallel to the vertical axis of the preset image coordinate system, and making the line between the two corner points of the right eye image Parallel to the longitudinal axis of the preset image coordinate system, this is all possible.
  • mirror image processing can be performed on the left-eye image after normalization or the right-eye image after normalization to obtain a mirror image.
  • the preset image coordinate system may be the image coordinate system of the image acquisition device.
  • the S104 may include the following steps:
  • S201A From the target three-dimensional face model, detect the three-dimensional position information of the first center point of the upper eyelid and the three-dimensional position information of the second center point of the lower eyelid of the human eye.
  • S202A Based on the three-dimensional position information of the first center point and the three-dimensional position information of the second center point, determine the distance between the first center point and the second center point as the current opening and closing length between the upper and lower eyelids of the human eye.
  • the human eye in order to ensure the accuracy of the determined opening and closing lengths between the upper and lower eyelids of the human eye, and at the same time reduce the computational burden of the electronic device, the human eye can be directly detected from the target three-dimensional face model.
  • the first center point of the upper eyelid and the second center point of the lower eyelid are detected to obtain the bisecting point of the upper eyelid and the bisecting point of the lower eyelid of the human eye; further, the spatial position information of the first center point and The spatial position information of the second center point, that is, the three-dimensional position information of the first center point and the three-dimensional position information of the second center point of the lower eyelid.
  • the distance between the first center point and the second center point is determined as the current opening between the upper and lower eyelids of the human eye Closed length.
  • the distance between the first center point and the second center point can be expressed as: Among them, (x 1 , y 1 , z 1 ) represents the three-dimensional position information of the first center point, and (x 2 , y 2 , z 2 ) represents the three-dimensional position information of the second center point.
  • the S104 may include the following steps:
  • S201B Determine the three-dimensional position information of the human eye space point corresponding to the human eye from the target three-dimensional face model.
  • S202B Perform spherical fitting based on the three-dimensional position information of the spatial point of the human eye to obtain a sphere model representing the human eye.
  • S203B From the target three-dimensional face model, detect the three-dimensional position information of the first center point of the upper eyelid and the three-dimensional position information of the second center point of the lower eyelid of the human eye.
  • S204B Based on the three-dimensional position information of the first center point and the three-dimensional position information of the second center point, determine the three-dimensional position information of the first spherical point corresponding to the first center point and the second center point corresponding to the second center point from the sphere model The three-dimensional position information of the two spherical points.
  • S205B Based on the three-dimensional position information of the first spherical point and the three-dimensional position information of the second spherical point, determine the distance between the first spherical point and the second spherical point as the current opening and closing length between the upper and lower eyelids of the human eye.
  • the three-dimensional position information of the first spherical point corresponding to the first center point and the second center point corresponding to the second center point are determined from the sphere model.
  • the three-dimensional position information of the two spherical points based on the three-dimensional position information of the first spherical point and the three-dimensional position information of the second spherical point, determine the distance between the first spherical point and the second spherical point as the upper and lower eyelids of the human eye The current opening and closing length between.
  • the three-dimensional position information of the first spherical point corresponding to the first center point and the second center point are determined from the sphere model.
  • the process of the three-dimensional position information of the second spherical point corresponding to the center point may be: based on the three-dimensional position information of the first center point and the position information of the optical center of the image acquisition device, the optical center and the first center point of the image acquisition device.
  • the line between the line and the two intersection points of the sphere model, the intersection point closest to the first center point is taken as the first sphere point corresponding to the first center point, and the first sphere point is determined based on the sphere model
  • the three-dimensional position information based on the three-dimensional position information of the second center point and the position information of the optical center of the image acquisition device, make the connection between the optical center of the image acquisition device and the second center point, and connect the connection with the sphere model Among the two intersection points, the intersection point closest to the second center point is used as the second spherical point corresponding to the second center point, and the three-dimensional position information of the second spherical point is determined based on the sphere model.
  • the spatial points of the human eye in the target three-dimensional face model are spherically fitted to obtain a sphere model that characterizes the human eye, so that the obtained human eye shape is closer to the shape of the real human eye, and is based on the sphere.
  • the three-dimensional position information of the first spherical point and the three-dimensional position information of the second spherical point in the model can determine the opening and closing length between the upper and lower eyelids of the human eye with higher accuracy.
  • the S105 may include:
  • the current fatigue level of the target person is determined.
  • the time dimension information that is, the historical opening and closing length of the human eye, can be combined to determine the current fatigue degree of the target person.
  • the electronic device can obtain the face image containing the face of the target person collected at the current moment when the image capture device is shooting the target person.
  • the preset time length may be a time length preset by the user, or a time length independently set by the electronic device, both of which are possible.
  • the historical opening and closing length of the eyes of the target person determined within the preset time period may include: the historical opening and closing length of the eyes of the target person determined within the preset time period ahead of the current moment, that is, The historical opening and closing length of the human eye of the target person determined within the latest preset time period at the current moment.
  • the electronic device can store the historical opening and closing length of the human eye of the target person locally or in the storage device connected to it. After calculating the current opening and closing length of the human eye, the electronic device can download the corresponding storage location Obtain the historical opening and closing length of the target person’s eye.
  • the historical opening and closing length of the human eye of the target person is determined based on the face image before the face image collected when the image acquisition device shoots the target person. The process of determining the historical opening and closing length of the target person's eyes is similar to the process of determining the current opening and closing length of the target person's eyes, and will not be repeated here.
  • a more accurate opening and closing length of the human eye can be determined, that is, the physical length of the opening and closing of the human eye. Furthermore, combined with the time dimension, the target can be monitored more flexibly and accurately. The fatigue of the personnel.
  • the step of determining the current fatigue degree of the target person based on the current opening and closing length and the historical opening and closing length may include:
  • the opening and closing length includes the current opening and closing length and the historical opening and closing length
  • the current fatigue level of the target person is determined.
  • the electronic device can obtain a preset length threshold set in advance, and compare each opening and closing length, that is, the current opening and closing length and the historical opening and closing length, with the preset length threshold, respectively, to compare each opening and closing length.
  • the size of the length and the preset length threshold is used to obtain the comparison result; further, the number of comparison results indicating that the opening and closing length is less than the preset length threshold is obtained by statistics, as the first result quantity; subsequent, based on the current opening and closing length and historical opening and closing The total number of lengths and the number of first results determine the current fatigue level of the target person.
  • the process of determining the current fatigue degree of the target person based on the current opening and closing length and the total number of historical opening and closing lengths and the number of first results may be: calculating the ratio of the number of first results to the total number, if the ratio is greater than The preset ratio determines that the current fatigue degree of the target person is fatigue; if the ratio is not greater than the preset ratio, the current fatigue degree of the target person is determined to be non-fatigue. It can also be: Calculate the difference between the total quantity and the first result quantity, if the difference is less than the preset difference, determine the current fatigue degree of the target person as fatigue; if the difference is not less than the preset difference, then determine The current fatigue level of the target person is not fatigued.
  • the historical opening and closing length of the human eye of the target person determined within the preset time is 99; that is, the current opening and closing length and the historical opening and closing length are 100. If the statistics show that the opening and closing length is less than the preset length
  • the first result of the comparison result of the threshold is 80. At this time, it can be determined that the current fatigue degree of the target person is fatigue.
  • the first number can be directly compared with the preset number, and if the number of first results is greater than The preset number determines that the current fatigue level of the target person is fatigue; if the first result number is not greater than the preset number, it is determined that the current fatigue level of the target person is not fatigued.
  • the method may further include:
  • warning information can be generated, To remind the user that the target person is in a state of fatigue, so that the user can take corresponding measures for this situation, so as to reduce the occurrence of car accidents caused by fatigue driving to a certain extent.
  • the driver can also be prompted to enter the automatic driving mode, or the driving mode control signal can be sent to control the vehicle to automatically enter the automatic driving mode, so as to reduce the fatigue caused by driving to a certain extent Of the car accident.
  • a household control signal of the household equipment can be generated and sent.
  • the household control signal can be to control the playback volume of the TV to decrease or turn off the TV; it can be: control The current setting temperature of the air conditioner is within the preset temperature range, and so on.
  • the embodiment of the present invention provides a fatigue detection device based on human eye state recognition, as shown in FIG. 3, which may include:
  • the first obtaining module 310 is configured to obtain a face image containing the face of the target person collected by the image capturing device for shooting the target person;
  • the detection module 320 is configured to detect the face image, and detect facial feature points of the face in the face image and eyelid feature points of the upper and lower eyelids of the human eyes in the face, wherein the facial feature Points are: feature points used to characterize various parts of the face in the face image;
  • the construction module 330 is configured to construct a target three-dimensional face model corresponding to the target person based on a preset three-dimensional face model, the facial feature points and the eyelid feature points, wherein the target three-dimensional face model Including: the upper and lower eyelids of the human eye constructed based on the eyelid feature points;
  • the first determining module 340 is configured to determine the current opening and closing length between the upper and lower eyelids of the human eye based on the three-dimensional position information of the upper and lower eyelids of the human eye in the target three-dimensional face model;
  • the second determining module 350 is configured to determine the current fatigue degree of the target person based on the current opening and closing length.
  • the upper and lower eyelids of the target person’s eyes corresponding to the target person can be constructed based on the facial feature points and the eyelid feature points in the face image containing the target person’s face and the preset three-dimensional face model
  • the target three-dimensional face model which constructs the spatial information of the human eye of the target person. Based on this spatial information, the spatial distance between the upper and lower eyelids of the human eye can be determined with higher accuracy, that is, the open and closed state of the human eye Furthermore, based on the more accurate spatial distance between the upper and lower eyelids of the human eye, the current fatigue level of the target person can be determined more accurately.
  • the embodiment of the present invention no longer only relies on the detection result of the closed state of the human eye in the two-dimensional image by using the pre-trained human eye state detection model to realize the determination of the fatigue degree of the target person and avoid the pre-trained eye state
  • the detection model blurs the detection boundary between the closed state and the open state of the human eye in the image, which leads to the occurrence of insufficient detection results. It is possible to determine the spatial information of the human eye, thereby improving the accuracy of the detection result of the human eye state, and the accuracy of the detection result of the current fatigue degree of the target person.
  • the detection module 320 includes:
  • the first detection unit is configured to detect the face image, and detect facial feature points of the face in the face image
  • the determining and intercepting unit is configured to determine and intercept the area where the human eye in the face is located from the face image based on the facial feature point, as a human eye image;
  • the second detection unit is configured to use a preset eyelid feature point detection model to detect the eyelid feature points of the upper and lower eyelids of the human eye from the human eye image, wherein the preset eyelid feature point detection
  • the model is a model trained based on sample images marked with feature points of the upper and lower eyelids of a human eye.
  • the human eye image includes a left eye image and a right eye image; the apparatus may further include:
  • the mirroring module (not shown in the figure) is configured to detect the eyelid feature points of the upper and lower eyelids of the human eye from the human eye image using the preset eyelid feature point detection model, Performing mirror image processing on an image to obtain a mirror image, wherein the first image is the left eye image or the right eye image;
  • a splicing module (not shown in the figure), configured to splice the mirror image and the image that has not been mirrored in the human eye image to obtain a spliced image;
  • the second detection unit is specifically configured to use a preset eyelid feature point detection model to detect the eyelid feature points of the upper and lower eyelids of the human eye in the mirror image from the stitched image, and the The eyelid feature points of the upper and lower eyelids of the human eye in the mirror image processed; the eyelid feature points of the upper and lower eyelids of the human eye in the mirror image are mirrored to obtain the eyelid feature points after the mirror image to obtain the human eye image The characteristic points of the upper and lower eyelids of the human eye.
  • the detection module 320 may further include:
  • the normalization unit is configured to perform normalization processing on the left-eye image and the right-eye image before the mirror image processing is performed on the first image to obtain the mirror image, to obtain a normalized left-eye image and a normalized right-eye image.
  • Eye image wherein the correction processing is: making the line of two eye corner points in the image to be processed parallel to the coordinate axis of the preset image coordinate system, and the image to be processed is the left eye image and the right eye image.
  • the mirroring unit is specifically configured to perform mirroring processing on the converted first image to obtain a mirrored image.
  • the construction module 330 is specifically configured to determine the spatial position information of the spatial point at the preset face position from the preset three-dimensional face model, as the to-be-processed
  • the spatial position information of the spatial point wherein the spatial point to be processed and the image feature point have a corresponding relationship, and the image feature point is: the facial feature point and the eyelid feature point; using a weak perspective projection matrix and each
  • the spatial position information of the spatial point to be processed, the projection position information of the projection point of each spatial point to be processed in the face image is determined; the projection position information of the projection point of each spatial point to be processed and each to-be-processed
  • the imaging position information of the image feature point corresponding to the spatial point is used to determine the distance error of each spatial point to be processed and its corresponding image feature point; to determine whether the distance error is less than the preset error; if it is less, the corresponding target person is obtained
  • the target three-dimensional face model if it is not smaller than, adjust the spatial position information of the spatial point to
  • the first determining module 340 is specifically configured to: detect the three-dimensional position of the first center point of the upper eyelid of the human eye from the target three-dimensional face model Information and the three-dimensional position information of the second center point of the lower eyelid; determine the first center point and the second center based on the three-dimensional position information of the first center point and the three-dimensional position information of the second center point The distance between the points is used as the current opening and closing length between the upper and lower eyelids of the human eye.
  • the first determining module 340 is specifically configured to determine, from the target three-dimensional face model, the three-dimensional position information of the human eye spatial point corresponding to the human eye; Based on the three-dimensional position information of the human eye space point, perform spherical fitting to obtain a sphere model that characterizes the human eye; from the target three-dimensional face model, detect the first center of the upper eyelid of the human eye The three-dimensional position information of a point and the three-dimensional position information of the second center point of the lower eyelid; based on the three-dimensional position information of the first center point and the three-dimensional position information of the second center point, determine from the sphere model The three-dimensional position information of the first spherical point corresponding to the first center point and the three-dimensional position information of the second spherical point corresponding to the second center point; based on the three-dimensional position information of the first spherical point and the second The three-dimensional position information of the spherical point determines the distance between
  • the second determining module 350 includes:
  • An obtaining unit configured to obtain the historical opening and closing length of the human eye of the target person determined within a preset time period
  • the determining unit is configured to determine the current fatigue degree of the target person based on the current opening and closing length and the historical opening and closing length.
  • the determining unit is specifically configured to
  • the opening and closing length includes the current opening and closing length and the historical opening and closing length
  • the device may further include:
  • Generating a sending module (not shown in the figure), configured to determine the current fatigue level of the target person based on the current opening and closing length, if it is determined that the current fatigue level of the target person is fatigue , Generate and send alarm information.
  • the foregoing device embodiment corresponds to the method embodiment, and has the same technical effect as the method embodiment.
  • the device embodiment is obtained based on the method embodiment, and the specific description can be found in the method embodiment part, which will not be repeated here.
  • modules in the device in the embodiment may be distributed in the device in the embodiment according to the description of the embodiment, or may be located in one or more devices different from this embodiment with corresponding changes.
  • the modules of the above-mentioned embodiments can be combined into one module or further divided into multiple sub-modules.

Abstract

Disclosed by the embodiment of the present invention are a fatigue detection method and device based on human eye state identification. The method comprises: obtaining a face image acquired when an image acquisition device shoots a target person, the face image containing the face of the target person; detecting the face image to obtain facial feature points and eyelid feature points of upper and lower eyelids of human eyes in the face; constructing a target three-dimensional face model corresponding to the target person on the basis of a preset three-dimensional face model, the facial feature points and the eyelid feature points, wherein the target three-dimensional face model comprises upper and lower eyelids of human eyes constructed on the basis of the eyelid feature points; determining the current opening and closing length between the upper eyelids and the lower eyelids of the human eyes based on the upper eyelids and the lower eyelids of the human eyes in the target three-dimensional face model; and determining the current fatigue degree of the target person based on the current opening and closing length. The method can determine the spatial information of human eyes, improve the accuracy of the detection result of human eye state, and further improve the accuracy of the detection result of fatigue degree of the target person.

Description

一种基于人眼状态识别的疲劳检测方法及装置Fatigue detection method and device based on human eye state recognition 技术领域Technical field
本发明涉及视频监控技术领域,具体而言,涉及一种基于人眼状态识别的疲劳检测方法及装置。The present invention relates to the technical field of video surveillance, and in particular to a fatigue detection method and device based on human eye state recognition.
背景技术Background technique
人员在疲劳的状态下,易出现操作错误的情况,例如:驾驶员在疲劳驾驶时,易出现车祸。为了在一定程度上降低因人员疲劳而导致的危险情况的发生,一般会对人员进行疲劳检测。相关的疲劳检测的过程,一般为:获得针对目标人员采集的人脸图像,通过预先训练的人眼状态检测模型,对人脸图像进行检测,检测出目标人员的眼睛的开闭状态,即检测目标人员的眼睛是否处于闭合的状态,根据检测结果,确定目标人员是否出现疲劳,其中,若检测到目标人员的眼睛处于闭合的状态,则确定目标人员出现疲劳,并进行告警,其中,该预先训练的人眼状态检测模型为:基于标注有处于闭合状态的人眼和处于睁开状态的人眼的样本图像训练所得的神经网络模型。People are prone to operating errors when they are fatigued. For example, when the driver is fatigued, he is prone to accidents. In order to reduce the occurrence of dangerous situations caused by fatigue of personnel to a certain extent, fatigue testing is generally performed on personnel. The related fatigue detection process is generally: obtain the face image collected for the target person, detect the face image through the pre-trained eye state detection model, and detect the open and closed state of the target person’s eyes, that is, detection Whether the eyes of the target person are in a closed state, according to the detection result, determine whether the target person is fatigued. If it is detected that the eyes of the target person are in a closed state, it is determined that the target person is fatigued and an alarm is issued. The trained human eye state detection model is a neural network model trained on sample images marked with human eyes in a closed state and human eyes in an open state.
上述疲劳检测的过程中,在训练模型之前,对样本图像进行标注时,对样本图像中的眼睛的闭合状态和睁开状态的标注标准无法统一,如对于半睁开的眼睛有的标注人员标注为睁开状态,有的标注人员标注为闭合状态,导致预先训练的人眼状态检测模型对图像中人眼的闭合状态和睁开状态的检测边界模糊,进而导致检测结果不够准确。In the above fatigue detection process, before training the model, when labeling the sample image, the labeling standards for the closed state and open state of the eyes in the sample image cannot be unified, such as the labeling of half-opened eyes. In order to open the state, some annotators mark the closed state, which causes the pre-trained eye state detection model to blur the detection boundary between the closed state and the open state of the human eye in the image, which leads to insufficient accuracy of the detection result.
发明内容Summary of the invention
本发明提供了一种基于人眼状态识别的疲劳检测方法及装置,以实现确定出人眼的空间信息,提高对人眼的状态的检测结果的准确性,进而提高对目标人员的疲劳程度的检测结果的准确性。具体的技术方案如下:The present invention provides a fatigue detection method and device based on human eye state recognition, so as to determine the spatial information of the human eye, improve the accuracy of the detection result of the human eye state, and further improve the fatigue of the target person The accuracy of the test results. The specific technical solutions are as follows:
第一方面,本发明实施例提供了一种基于人眼状态识别的疲劳检测方法,包括:In the first aspect, embodiments of the present invention provide a fatigue detection method based on human eye state recognition, including:
获得图像采集设备针对目标人员进行拍摄所采集到的包含所述目标人员的面部的人脸图像;Obtaining a face image containing the face of the target person collected by the image capture device for shooting the target person;
对所述人脸图像进行检测,检测得到所述人脸图像中面部的面部特征点以及所述面部中人眼的上下眼睑的眼睑特征点,其中,所述面部特征点为:用于表征所述人脸图像中面部各个部位的特征点;The face image is detected, and the facial feature points of the face in the face image and the eyelid feature points of the upper and lower eyelids of the human eyes in the face are detected, wherein the facial feature points are: Describe the feature points of each part of the face in the face image;
基于预设的三维人脸模型、所述面部特征点以及所述眼睑特征点,构建所述目标人员对应的目标三维人脸模型,其中,所述目标三维人脸模型包括:基于所述眼睑特征点构建的所述人眼的上下眼睑;Based on the preset three-dimensional face model, the facial feature points, and the eyelid feature points, constructing a target three-dimensional face model corresponding to the target person, wherein the target three-dimensional face model includes: based on the eyelid feature The upper and lower eyelids of the human eye constructed by points;
基于所述目标三维人脸模型中所述人眼的上下眼睑的三维位置信息,确定所述人眼的上下眼睑之间的当前开闭长度;Determining the current opening and closing length between the upper and lower eyelids of the human eye based on the three-dimensional position information of the upper and lower eyelids of the human eye in the target three-dimensional face model;
基于所述当前开闭长度,确定出所述目标人员的当前疲劳程度。Based on the current opening and closing length, the current fatigue degree of the target person is determined.
可选的,所述对所述人脸图像进行检测,检测得到所述人脸图像中面部的面部特征点以及所述面部中人眼的上下眼睑的眼睑特征点的步骤,包括:Optionally, the step of detecting the face image and detecting the facial feature points of the face in the face image and the eyelid feature points of the upper and lower eyelids of the human eyes in the face includes:
对所述人脸图像进行检测,检测得到所述人脸图像中面部的面部特征点;Detecting the face image, and detecting facial feature points of the face in the face image;
基于所述面部特征点,从所述人脸图像中确定并截取出所述面部中人眼所在区域,作为人眼图像;Based on the facial feature points, determine and cut out the area where the human eyes in the face are located from the human face image, as a human eye image;
利用预设的眼睑特征点检测模型,从所述人眼图像中检测出所述人眼的上下眼睑的眼睑特征点,其中,所述预设的眼睑特征点检测模型为:基于标注有人眼的上下眼睑的眼睑特征点的样本图像训练所得的模型。Using a preset eyelid feature point detection model, the eyelid feature points of the upper and lower eyelids of the human eye are detected from the human eye image, where the preset eyelid feature point detection model is: A model trained on sample images of the eyelid feature points of the upper and lower eyelids.
可选的,所述人眼图像包括左眼图像和右眼图像;Optionally, the human eye image includes a left eye image and a right eye image;
在所述利用预设的眼睑特征点检测模型,从所述人眼图像中检测出所述人眼的上下眼睑的眼睑特征点的步骤之前,所述方法还包括:Before the step of using a preset eyelid feature point detection model to detect the eyelid feature points of the upper and lower eyelids of the human eye from the human eye image, the method further includes:
对第一图像进行镜像处理,得到镜像图像,其中,所述第一图像为所述左眼图像或所述右眼图像;Performing mirror image processing on the first image to obtain a mirror image, wherein the first image is the left eye image or the right eye image;
对所述镜像图像以及所述人眼图像中未进行镜像处理的图像进行拼接,得到拼接图像;Stitching the mirror image and the image that has not been mirrored in the human eye image to obtain a stitched image;
所述利用预设的眼睑特征点检测模型,从所述人眼图像中检测出所述人眼的上下眼睑的眼睑特征点的步骤,包括:The step of using a preset eyelid feature point detection model to detect the eyelid feature points of the upper and lower eyelids of the human eye from the human eye image includes:
利用预设的眼睑特征点检测模型,从所述拼接图像中,检测出所述镜像图像中人眼的上下眼睑的眼睑特征点,以及所述未进行镜像处理的图像中人眼的上下眼睑的眼睑特征点;Using a preset eyelid feature point detection model, from the stitched image, the eyelid feature points of the upper and lower eyelids of the human eye in the mirror image, and the upper and lower eyelids of the human eye in the image without mirror processing are detected. Eyelid feature points;
对所述镜像图像中人眼的上下眼睑的眼睑特征点进行镜像处理,得到镜像后的眼睑特征点,以得 到所述人眼图像中的人眼的上下眼睑的眼睑特征点。Mirror image processing is performed on the eyelid feature points of the upper and lower eyelids of the human eye in the mirror image to obtain the eyelid feature points after mirroring, so as to obtain the eyelid feature points of the upper and lower eyelids of the human eye in the human eye image.
可选的,在所述对第一图像进行镜像处理,得到镜像图像的步骤之前,所述方法还包括:Optionally, before the step of performing mirror processing on the first image to obtain a mirror image, the method further includes:
对所述左眼图像和所述右眼图像进行转正处理,得到转正后的左眼图像和转正后的右眼图像,其中,所述转正处理为:使得待处理图像中的两个眼角点的连线与预设图像坐标系的坐标轴平行,所述待处理图像为所述左眼图像和所述右眼图像;The left-eye image and the right-eye image are subjected to normalization processing to obtain a corrected left-eye image and a normalized right-eye image, wherein the normalization processing is: making the two eye corner points in the image to be processed The line is parallel to the coordinate axis of the preset image coordinate system, and the image to be processed is the left-eye image and the right-eye image;
所述对第一图像进行镜像处理,得到镜像图像的步骤,包括:The step of performing mirror image processing on the first image to obtain a mirror image includes:
对转正后的第一图像进行镜像处理,得到镜像图像。Perform mirror image processing on the converted first image to obtain a mirror image.
可选的,所述基于预设的三维人脸模型、所述人脸特征点以及所述眼睑特征点,构建所述目标人员对应的目标三维人脸模型的步骤,包括:Optionally, the step of constructing a target three-dimensional face model corresponding to the target person based on a preset three-dimensional face model, the face feature points, and the eyelid feature points includes:
从所述预设的三维人脸模型中,确定出预设面部位置处的空间点的空间位置信息,作为待处理空间点的空间位置信息,其中,所述待处理空间点与图像特征点存在对应关系,所述图像特征点为:所述面部特征点和所述眼睑特征点;From the preset three-dimensional face model, the spatial position information of the spatial point at the preset face position is determined as the spatial position information of the spatial point to be processed, wherein the spatial point to be processed and the image feature point exist Corresponding relationship, the image feature points are: the facial feature points and the eyelid feature points;
利用弱透视投影矩阵以及每一待处理空间点的空间位置信息,确定每一待处理空间点在所述人脸图像中的投影点的投影位置信息;Using the weak perspective projection matrix and the spatial position information of each spatial point to be processed to determine the projection position information of the projection point of each spatial point to be processed in the face image;
基于每一待处理空间点的投影点的投影位置信息及每一待处理空间点对应的图像特征点的成像位置信息,构建所述目标人员对应的目标三维人脸模型。Based on the projection position information of the projection point of each spatial point to be processed and the imaging position information of the image feature point corresponding to each spatial point to be processed, a target three-dimensional face model corresponding to the target person is constructed.
可选的,所述基于所述目标三维人脸模型中所述人眼的上下眼睑的三维位置信息,确定所述人眼的上下眼睑之间的当前开闭长度的步骤,通过以下两种实现方式中任一实现方式中实现:Optionally, the step of determining the current opening and closing length between the upper and lower eyelids of the human eye based on the three-dimensional position information of the upper and lower eyelids of the human eye in the target three-dimensional face model is achieved by the following two Realize in any one of the ways:
第一种实现方式:The first way to achieve:
从所述目标三维人脸模型中,检测得到所述人眼的上眼睑的第一中心点的三维位置信息和下眼睑的第二中心点的三维位置信息;From the target three-dimensional face model, detecting the three-dimensional position information of the first center point of the upper eyelid and the three-dimensional position information of the second center point of the lower eyelid of the human eye;
基于所述第一中心点的三维位置信息以及所述第二中心点的三维位置信息,确定所述第一中心点和所述第二中心点之间的距离,作为所述人眼的上下眼睑之间的当前开闭长度;Based on the three-dimensional position information of the first center point and the three-dimensional position information of the second center point, determine the distance between the first center point and the second center point as the upper and lower eyelids of the human eye The current opening and closing length between;
第二种实现方式:The second way to achieve:
从所述目标三维人脸模型中,确定出所述人眼对应的人眼空间点的三维位置信息;From the target three-dimensional face model, determine the three-dimensional position information of the human eye spatial point corresponding to the human eye;
基于所述人眼空间点的三维位置信息,进行球面拟合,得到表征所述人眼的球体模型;Performing spherical fitting based on the three-dimensional position information of the human eye space point to obtain a sphere model representing the human eye;
从所述目标三维人脸模型中,检测得到所述人眼的上眼睑的第一中心点的三维位置信息和下眼睑的第二中心点的三维位置信息;Detecting, from the target three-dimensional face model, the three-dimensional position information of the first center point of the upper eyelid and the three-dimensional position information of the second center point of the lower eyelid of the human eye;
基于所述第一中心点的三维位置信息和所述第二中心点的三维位置信息,从所述球体模型中,确定出所述第一中心点对应的第一球面点的三维位置信息和所述第二中心点对应的第二球面点的三维位置信息;Based on the three-dimensional position information of the first center point and the three-dimensional position information of the second center point, from the sphere model, determine the three-dimensional position information and the three-dimensional position information of the first spherical point corresponding to the first center point. The three-dimensional position information of the second spherical point corresponding to the second center point;
基于所述第一球面点的三维位置信息和所述第二球面点的三维位置信息,确定所述第一球面点和第二球面点之间的距离,作为所述人眼的上下眼睑之间的当前开闭长度。Based on the three-dimensional position information of the first spherical point and the three-dimensional position information of the second spherical point, determine the distance between the first spherical point and the second spherical point as the distance between the upper and lower eyelids of the human eye The current opening and closing length.
可选的,所述基于所述当前开闭长度,确定出所述目标人员的当前疲劳程度的步骤,包括:Optionally, the step of determining the current fatigue degree of the target person based on the current opening and closing length includes:
获得在预设时长内所确定出的所述目标人员的人眼的历史开闭长度;Obtaining the historical opening and closing length of the human eye of the target person determined within a preset time period;
基于所述当前开闭长度以及所述历史开闭长度,确定出所述目标人员的当前疲劳程度。Based on the current opening and closing length and the historical opening and closing length, the current fatigue degree of the target person is determined.
可选的,所述基于所述当前开闭长度以及所述历史开闭长度,确定出所述目标人员的当前疲劳程度的步骤,包括:Optionally, the step of determining the current fatigue degree of the target person based on the current opening and closing length and the historical opening and closing length includes:
将每一开闭长度与预设长度阈值进行比较,获得比较结果,其中,所述开闭长度包括所述当前开闭长度以及所述历史开闭长度;Comparing each opening and closing length with a preset length threshold to obtain a comparison result, where the opening and closing length includes the current opening and closing length and the historical opening and closing length;
统计得到表征开闭长度小于所述预设长度阈值的比较结果的第一结果数量;Statistically obtain the first result quantity representing the comparison result whose opening and closing length is less than the preset length threshold;
基于所述当前开闭长度以及所述历史开闭长度的总数量和所述第一结果数量,确定所述目标人员的当前疲劳程度。Based on the current opening and closing length and the total number of historical opening and closing lengths and the first result number, determine the current fatigue level of the target person.
可选的,在所述基于所述当前开闭长度,确定出所述目标人员的当前疲劳程度的步骤之后,所述方法还包括:Optionally, after the step of determining the current fatigue level of the target person based on the current opening and closing length, the method further includes:
若确定出所述目标人员的当前疲劳程度为疲劳,生成并发送告警信息。If it is determined that the current fatigue degree of the target person is fatigue, an alarm message is generated and sent.
第二方面,本发明实施例提供了一种基于人眼状态识别的疲劳检测装置,包括:In the second aspect, an embodiment of the present invention provides a fatigue detection device based on human eye state recognition, including:
第一获得模块,被配置为获得图像采集设备针对目标人员进行拍摄所采集到的包含所述目标人员的面部的人脸图像;The first obtaining module is configured to obtain a face image containing the face of the target person collected by the image capture device for shooting the target person;
检测模块,被配置为对所述人脸图像进行检测,检测得到所述人脸图像中面部的面部特征点以及 所述面部中人眼的上下眼睑的眼睑特征点,其中,所述面部特征点为:用于表征所述人脸图像中面部各个部位的特征点;The detection module is configured to detect the face image, and detect the facial feature points of the face in the face image and the eyelid feature points of the upper and lower eyelids of the human eyes in the face, wherein the facial feature points Is: used to characterize the feature points of each part of the face in the face image;
构建模块,被配置为基于预设的三维人脸模型、所述面部特征点以及所述眼睑特征点,构建所述目标人员对应的目标三维人脸模型,其中,所述目标三维人脸模型包括:基于所述眼睑特征点构建的所述人眼的上下眼睑;The construction module is configured to construct a target three-dimensional face model corresponding to the target person based on a preset three-dimensional face model, the facial feature points and the eyelid feature points, wherein the target three-dimensional face model includes : The upper and lower eyelids of the human eye constructed based on the eyelid feature points;
第一确定模块,被配置为基于所述目标三维人脸模型中所述人眼的上下眼睑的三维位置信息,确定所述人眼的上下眼睑之间的当前开闭长度;A first determining module configured to determine the current opening and closing length between the upper and lower eyelids of the human eye based on the three-dimensional position information of the upper and lower eyelids of the human eye in the target three-dimensional face model;
第二确定模块,被配置为基于所述当前开闭长度,确定出所述目标人员的当前疲劳程度。The second determining module is configured to determine the current fatigue degree of the target person based on the current opening and closing length.
可选的,所述检测模块,包括:Optionally, the detection module includes:
第一检测单元,被配置为对所述人脸图像进行检测,检测得到所述人脸图像中面部的面部特征点;The first detection unit is configured to detect the face image, and detect facial feature points of the face in the face image;
确定截取单元,被配置为基于所述面部特征点,从所述人脸图像中确定并截取出所述面部中人眼所在区域,作为人眼图像;The determining and intercepting unit is configured to determine and intercept the area where the human eye in the face is located from the face image based on the facial feature point, as a human eye image;
第二检测单元,被配置为利用预设的眼睑特征点检测模型,从所述人眼图像中检测出所述人眼的上下眼睑的眼睑特征点,其中,所述预设的眼睑特征点检测模型为:基于标注有人眼的上下眼睑的眼睑特征点的样本图像训练所得的模型。The second detection unit is configured to use a preset eyelid feature point detection model to detect the eyelid feature points of the upper and lower eyelids of the human eye from the human eye image, wherein the preset eyelid feature point detection The model is a model trained based on sample images marked with feature points of the upper and lower eyelids of a human eye.
可选的,所述人眼图像包括左眼图像和右眼图像;所述装置还可以包括:Optionally, the human eye image includes a left eye image and a right eye image; the device may further include:
镜像模块,被配置为在所述利用预设的眼睑特征点检测模型,从所述人眼图像中检测出所述人眼的上下眼睑的眼睑特征点之前,对第一图像进行镜像处理,得到镜像图像,其中,所述第一图像为所述左眼图像或所述右眼图像;The mirroring module is configured to perform mirroring processing on the first image before detecting the eyelid feature points of the upper and lower eyelids of the human eye from the human eye image using the preset eyelid feature point detection model to obtain A mirror image, wherein the first image is the left eye image or the right eye image;
拼接模块,被配置为对所述镜像图像以及所述人眼图像中未进行镜像处理的图像进行拼接,得到拼接图像;A splicing module configured to splice the mirror image and the image that has not been mirrored in the human eye image to obtain a spliced image;
所述第二检测单元,被具体配置为:利用预设的眼睑特征点检测模型,从所述拼接图像中,检测出所述镜像图像中人眼的上下眼睑的眼睑特征点,以及所述未进行镜像处理的图像中人眼的上下眼睑的眼睑特征点;对所述镜像图像中人眼的上下眼睑的眼睑特征点进行镜像处理,得到镜像后的眼睑特征点,以得到所述人眼图像中的人眼的上下眼睑的眼睑特征点。The second detection unit is specifically configured to: use a preset eyelid feature point detection model to detect, from the stitched image, the eyelid feature points of the upper and lower eyelids of the human eye in the mirror image, and the The eyelid feature points of the upper and lower eyelids of the human eye in the mirror image processed; the eyelid feature points of the upper and lower eyelids of the human eye in the mirror image are mirrored to obtain the eyelid feature points after mirroring to obtain the human eye image The characteristic points of the upper and lower eyelids of the human eye.
可选的,所述检测模块还包括:Optionally, the detection module further includes:
转正单元,被配置为在所述对第一图像进行镜像处理,得到镜像图像之前,对所述左眼图像和所述右眼图像进行转正处理,得到转正后的左眼图像和转正后的右眼图像,其中,所述转正处理为:使得待处理图像中的两个眼角点的连线与预设图像坐标系的坐标轴平行,所述待处理图像为所述左眼图像和所述右眼图像;The normalization unit is configured to perform normalization processing on the left-eye image and the right-eye image before the mirror image processing is performed on the first image to obtain the mirror image, to obtain a normalized left-eye image and a normalized right-eye image. Eye image, wherein the correction processing is: making the line of two eye corner points in the image to be processed parallel to the coordinate axis of the preset image coordinate system, and the image to be processed is the left eye image and the right eye image. Eye image
所述镜像单元,被具体配置为:对转正后的第一图像进行镜像处理,得到镜像图像。The mirroring unit is specifically configured to perform mirroring processing on the converted first image to obtain a mirrored image.
可选的,所述构建模块,被具体配置为从所述预设的三维人脸模型中,确定出预设面部位置处的空间点的空间位置信息,作为待处理空间点的空间位置信息,其中,所述待处理空间点与图像特征点存在对应关系,所述图像特征点为:所述面部特征点和所述眼睑特征点;利用弱透视投影矩阵以及每一待处理空间点的空间位置信息,确定每一待处理空间点在所述人脸图像中的投影点的投影位置信息;基于每一待处理空间点的投影点的投影位置信息及每一待处理空间点对应的图像特征点的成像位置信息,构建所述目标人员对应的目标三维人脸模型。Optionally, the construction module is specifically configured to determine the spatial position information of the spatial point at the preset face position from the preset three-dimensional face model, as the spatial position information of the spatial point to be processed, Wherein, there is a corresponding relationship between the spatial points to be processed and image feature points, and the image feature points are: the facial feature points and the eyelid feature points; the weak perspective projection matrix and the spatial position of each spatial point to be processed are used Information, determine the projection position information of the projection point of each spatial point to be processed in the face image; based on the projection position information of the projection point of each spatial point to be processed and the image feature point corresponding to each spatial point to be processed To construct a target three-dimensional face model corresponding to the target person.
可选的,所述第一确定模块,被具体配置为:从所述目标三维人脸模型中,检测得到所述人眼的上眼睑的第一中心点的三维位置信息和下眼睑的第二中心点的三维位置信息;基于所述第一中心点的三维位置信息以及所述第二中心点的三维位置信息,确定所述第一中心点和所述第二中心点之间的距离,作为所述人眼的上下眼睑之间的当前开闭长度。Optionally, the first determining module is specifically configured to: detect, from the target three-dimensional face model, the three-dimensional position information of the first center point of the upper eyelid of the human eye and the second The three-dimensional position information of the center point; based on the three-dimensional position information of the first center point and the three-dimensional position information of the second center point, determine the distance between the first center point and the second center point as The current opening and closing length between the upper and lower eyelids of the human eye.
可选的,所述第一确定模块,被具体配置为:从所述目标三维人脸模型中,确定出所述人眼对应的人眼空间点的三维位置信息;基于所述人眼空间点的三维位置信息,进行球面拟合,得到表征所述人眼的球体模型;从所述目标三维人脸模型中,检测得到所述人眼的上眼睑的第一中心点的三维位置信息和下眼睑的第二中心点的三维位置信息;基于所述第一中心点的三维位置信息和所述第二中心点的三维位置信息,从所述球体模型中,确定出所述第一中心点对应的第一球面点的三维位置信息和所述第二中心点对应的第二球面点的三维位置信息;基于所述第一球面点的三维位置信息和所述第二球面点的三维位置信息,确定所述第一球面点和第二球面点之间的距离,作为所述人眼的上下眼睑之间的当前开闭长度。Optionally, the first determining module is specifically configured to: determine, from the target three-dimensional face model, three-dimensional position information of a human eye space point corresponding to the human eye; based on the human eye space point Perform spherical fitting to obtain a sphere model that characterizes the human eye; from the target three-dimensional face model, detect the three-dimensional position information of the first center point of the upper eyelid of the human eye and the lower The three-dimensional position information of the second center point of the eyelid; based on the three-dimensional position information of the first center point and the three-dimensional position information of the second center point, it is determined from the sphere model that the first center point corresponds to The three-dimensional position information of the first spherical point and the three-dimensional position information of the second spherical point corresponding to the second center point; based on the three-dimensional position information of the first spherical point and the three-dimensional position information of the second spherical point, The distance between the first spherical point and the second spherical point is determined as the current opening and closing length between the upper and lower eyelids of the human eye.
可选的,所述第二确定模块,包括:Optionally, the second determining module includes:
获得单元,被配置为获得在预设时长内所确定出的所述目标人员的人眼的历史开闭长度;An obtaining unit configured to obtain the historical opening and closing length of the human eye of the target person determined within a preset time period;
确定单元,被配置为基于所述当前开闭长度以及所述历史开闭长度,确定出所述目标人员的当前疲劳程度。The determining unit is configured to determine the current fatigue degree of the target person based on the current opening and closing length and the historical opening and closing length.
可选的,所述确定单元,被具体配置为Optionally, the determining unit is specifically configured as
将每一开闭长度与预设长度阈值进行比较,获得比较结果,其中,所述开闭长度包括所述当前开闭长度以及所述历史开闭长度;Comparing each opening and closing length with a preset length threshold to obtain a comparison result, where the opening and closing length includes the current opening and closing length and the historical opening and closing length;
统计得到表征开闭长度小于所述预设长度阈值的比较结果的第一结果数量;Statistically obtain the first result quantity representing the comparison result whose opening and closing length is less than the preset length threshold;
基于所述当前开闭长度以及所述历史开闭长度的总数量和所述第一结果数量,确定所述目标人员的当前疲劳程度。Based on the current opening and closing length and the total number of historical opening and closing lengths and the first result number, determine the current fatigue level of the target person.
可选的,所述装置还可以包括:Optionally, the device may further include:
生成发送模块,被配置为在所述基于所述当前开闭长度,确定出所述目标人员的当前疲劳程度之后,若确定出所述目标人员的当前疲劳程度为疲劳,生成并发送告警信息。The generating and sending module is configured to generate and send alarm information if the current fatigue degree of the target person is determined to be fatigue after the current fatigue degree of the target person is determined based on the current opening and closing length.
由上述内容可知,本发明实施例提供的一种基于人眼状态识别的疲劳检测方法及装置,可以获得图像采集设备针对目标人员进行拍摄所采集到的包含目标人员的面部的人脸图像;对人脸图像进行检测,检测得到人脸图像中面部的面部特征点以及面部中人眼的上下眼睑的眼睑特征点,其中,面部特征点为:用于表征人脸图像中面部各个部位的特征点;基于预设的三维人脸模型、面部特征点以及眼睑特征点,构建目标人员对应的目标三维人脸模型,其中,目标三维人脸模型包括:基于眼睑特征点构建的人眼的上下眼睑;基于目标三维人脸模型中人眼的上下眼睑的三维位置信息,确定人眼的上下眼睑之间的当前开闭长度;基于当前开闭长度,确定出目标人员的当前疲劳程度。It can be seen from the above content that the fatigue detection method and device based on human eye state recognition provided by the embodiments of the present invention can obtain the face image containing the face of the target person collected by the image capture device for shooting the target person; The face image is detected, and the facial feature points of the face in the face image and the eyelid feature points of the upper and lower eyelids of the human eye in the face are detected. The facial feature points are: the feature points used to represent each part of the face in the face image ; Based on the preset three-dimensional face model, facial feature points and eyelid feature points, construct a target three-dimensional face model corresponding to the target person, where the target three-dimensional face model includes: the upper and lower eyelids of the human eye constructed based on the eyelid feature points; Based on the three-dimensional position information of the upper and lower eyelids of the human eye in the target three-dimensional face model, the current opening and closing length between the upper and lower eyelids of the human eye is determined; based on the current opening and closing length, the current fatigue degree of the target person is determined.
应用本发明实施例,可以基于包含目标人员的面部的人脸图像中的面部特征点和眼睑特征点和预设的三维人脸模型,构建出目标人员对应的包括目标人员的人眼的上下眼睑目标三维人脸模型,即构建出了目标人员的人眼的空间信息,基于该空间信息,可以确定出准确性更高的人眼的上下眼睑之间的空间距离,即人眼的开闭状态,进而,基于准确性更高的人眼的上下眼睑之间的空间距离,可以更加准确地确定出目标人员的当前疲劳程度。本发明实施例中不再仅依赖利用预先训练的人眼状态检测模型对二维图像中人眼的开闭状态的检测结果,实现度目标人员的疲劳程度的确定,避免了预先训练的人眼状态检测模型对图像中人眼的闭合状态和睁开状态的检测边界模糊,进而导致检测结果不够准确的情况的发生。实现确定出人眼的空间信息,进而提高人眼状态的检测结果的准确性,以及提高对目标人员的当前疲劳程度的检测结果的准确性。当然,实施本发明的任一产品或方法并不一定需要同时达到以上所述的所有优点。With the application of the embodiment of the present invention, the upper and lower eyelids of the target person’s eyes corresponding to the target person can be constructed based on the facial feature points and the eyelid feature points in the face image containing the target person’s face and the preset three-dimensional face model The target three-dimensional face model, which constructs the spatial information of the human eye of the target person. Based on this spatial information, the spatial distance between the upper and lower eyelids of the human eye can be determined with higher accuracy, that is, the open and closed state of the human eye Furthermore, based on the more accurate spatial distance between the upper and lower eyelids of the human eye, the current fatigue level of the target person can be determined more accurately. In the embodiment of the present invention, the pre-trained human eye state detection model is no longer solely dependent on the detection result of the open and closed state of the human eye in the two-dimensional image, so as to realize the determination of the fatigue degree of the target person and avoid the pre-trained human eye. The state detection model blurs the detection boundary between the closed state and the open state of the human eye in the image, which leads to the occurrence of insufficient detection results. It is possible to determine the spatial information of the human eye, thereby improving the accuracy of the detection result of the human eye state, and the accuracy of the detection result of the current fatigue degree of the target person. Of course, implementing any product or method of the present invention does not necessarily need to achieve all the advantages described above at the same time.
本发明实施例的创新点包括:The innovative points of the embodiments of the present invention include:
1、基于包含目标人员的面部的人脸图像中的面部特征点和眼睑特征点和预设的三维人脸模型,构建出目标人员对应的包括目标人员的人眼的上下眼睑目标三维人脸模型,即构建出了目标人员的人眼的空间信息,基于该空间信息,可以确定出准确性更高的人眼的上下眼睑之间的空间距离,即人眼的开闭状态,进而,基于准确性更高的人眼的上下眼睑之间的空间距离,可以更加准确地确定出目标人员的当前疲劳程度。本发明实施例中不再仅依赖利用预先训练的人眼状态检测模型对二维图像中人眼的开闭状态的检测结果,实现度目标人员的疲劳程度的确定,避免了预先训练的人眼状态检测模型对图像中人眼的闭合状态和睁开状态的检测边界模糊,进而导致检测结果不够准确的情况的发生。实现确定出人眼的空间信息,进而提高人眼的状态的检测结果的准确性,以及提高对目标人员的当前疲劳程度的检测结果的准确性。1. Based on the facial feature points and eyelid feature points in the face image containing the target person’s face and the preset three-dimensional face model, construct a three-dimensional face model of the upper and lower eyelid target corresponding to the target person’s eyes including the target person’s eyes , That is, the spatial information of the human eye of the target person is constructed. Based on the spatial information, the spatial distance between the upper and lower eyelids of the human eye can be determined with higher accuracy, that is, the open and closed state of the human eye. The spatial distance between the upper and lower eyelids of the more flexible human eyes can more accurately determine the current fatigue level of the target person. In the embodiment of the present invention, the pre-trained human eye state detection model is no longer solely dependent on the detection result of the open and closed state of the human eye in the two-dimensional image, so as to realize the determination of the fatigue degree of the target person and avoid the pre-trained human eye. The state detection model blurs the detection boundary between the closed state and the open state of the human eye in the image, which leads to the occurrence of insufficient detection results. It is possible to determine the spatial information of the human eye, thereby improving the accuracy of the detection result of the state of the human eye, and the accuracy of the detection result of the current fatigue degree of the target person.
2、从人脸图像中截取出面部中人眼所在区域,即人眼图像,进而利用预设的眼睑特征点检测模型,从人眼图像中检测出人眼的上下眼睑的眼睑特征点,可以提高所检测出的眼睑特征点的准确性,进而可以提高基于该眼睑特征点所构建的目标三维人脸模型中人眼的上下眼睑的准确性,以更好地提高对目标人员的疲劳程度的检测结果的准确性。2. Cut out the area where the human eye is located in the face from the face image, that is, the human eye image, and then use the preset eyelid feature point detection model to detect the eyelid feature points of the upper and lower eyelids of the human eye from the human eye image. Improve the accuracy of the detected eyelid feature points, thereby improving the accuracy of the upper and lower eyelids of the human eye in the target three-dimensional face model constructed based on the eyelid feature points, so as to better improve the fatigue of the target person The accuracy of the test results.
3、对第一图像,即左眼图像或右眼图像进行镜像处理得到镜像图像,进而对镜像图像以及人眼图像中未进行镜像处理的图像进行拼接,得到拼接图像;后续的可以利用预设的眼睑特征点检测模型,同时对该拼接图像中的两只人眼中的眼睑特征点进行检测过程,即通过一次检测则可检测出该拼接图像中两只人眼的上下眼睑的眼睑特征点,简化了利用预设的眼睑特征点检测模型,对眼睑特征点的检测过程。3. Perform mirror image processing on the first image, that is, the left-eye image or the right-eye image to obtain a mirror image, and then stitch the mirror image and the image that has not been mirrored in the human eye image to obtain a stitched image; the subsequent can use the preset The eyelid feature point detection model in the stitched image simultaneously detects the eyelid feature points in the two human eyes in the stitched image, that is, through one detection, the eyelid feature points of the upper and lower eyelids of the two human eyes in the stitched image can be detected. Simplifies the detection process of eyelid feature points using the preset eyelid feature point detection model.
4、对左眼图像和右眼图像进行转正处理,得到转正后的左眼图像和转正后的右眼图像,进而对转正后的左眼图像或转正后的右眼图像进行后续的处理,使得在一定程度上可以减轻预设的眼睑特征点 检测模型的检测负担,并在一定程度上提高对眼睑特征点的检测结果。4. The left-eye image and the right-eye image are corrected to obtain the corrected left-eye image and the corrected right-eye image, and then the corrected left-eye image or the corrected right-eye image is subjected to subsequent processing, so that To a certain extent, the detection burden of the preset eyelid feature point detection model can be reduced, and the detection result of eyelid feature points can be improved to a certain extent.
5、在计算人眼的上下眼睑之间的当前开闭长度时,第一种实现方式,将目标三维人脸模型中人眼的上眼睑的第一中心点的三维位置信息,以及下眼睑的第二中心点的三维位置信息,所确定出的上下眼睑的三维距离,作为人眼的上下眼睑之间的当前开闭长度,在保证所确定的上下眼睑之间的当前开闭长度的准确性的同时,简化计算流程。第二种实现方式,考虑到实际的人眼为球型,对从目标三维人脸模型中,确定出的人眼对应的人眼空间点的三维位置信息,并进行球面拟合,得到能够更加准确的表征真实的人眼的球体模型,将球体模型中上眼睑的第一中心点对应的第一球面点,以及下眼睑的第二中心点对应的第二球面点之间的距离,确定为人眼的上下眼睑之间的当前开闭长度,更好地提高当前开闭长度的准确性,进而提高对疲劳程度的检测结果的准确性。5. When calculating the current opening and closing length between the upper and lower eyelids of the human eye, the first implementation method is to combine the three-dimensional position information of the first center point of the upper eyelid of the human eye in the target three-dimensional face model and the lower eyelid The three-dimensional position information of the second center point, the determined three-dimensional distance between the upper and lower eyelids, is used as the current opening and closing length between the upper and lower eyelids of the human eye to ensure the accuracy of the determined current opening and closing length between the upper and lower eyelids At the same time, the calculation process is simplified. The second implementation method, considering that the actual human eye is spherical, the three-dimensional position information of the human eye space point corresponding to the human eye is determined from the target three-dimensional face model, and spherical fitting is performed to obtain more The sphere model that accurately represents the real human eye, and the distance between the first sphere point corresponding to the first center point of the upper eyelid and the second sphere point corresponding to the second center point of the lower eyelid in the sphere model is determined as a person The current opening and closing length between the upper and lower eyelids of the eye can better improve the accuracy of the current opening and closing length, thereby improving the accuracy of the detection result of the fatigue degree.
附图说明Description of the drawings
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单介绍。显而易见地,下面描述中的附图仅仅是本发明的一些实施例。对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to explain the embodiments of the present invention or the technical solutions in the prior art more clearly, the following will briefly introduce the drawings that need to be used in the description of the embodiments or the prior art. Obviously, the drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained from these drawings without creative work.
图1为本发明实施例提供的基于人眼状态识别的疲劳检测方法的一种流程示意图;FIG. 1 is a schematic flowchart of a fatigue detection method based on eye state recognition provided by an embodiment of the present invention;
图2A为本发明实施例提供的确定人眼的上下眼睑之间的当前开闭长度的一种流程示意图;2A is a schematic flow chart of determining the current opening and closing length between the upper and lower eyelids of a human eye according to an embodiment of the present invention;
图2B为本发明实施例提供的确定人眼的上下眼睑之间的当前开闭长度的另一种流程示意图;2B is a schematic diagram of another flow chart for determining the current opening and closing length between the upper and lower eyelids of a human eye according to an embodiment of the present invention;
图3为本发明实施例提供的基于人眼状态识别的疲劳检测装置的一种结构示意图。FIG. 3 is a schematic structural diagram of a fatigue detection device based on human eye state recognition provided by an embodiment of the present invention.
具体实施方式Detailed ways
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整的描述。显然,所描述的实施例仅仅是本发明的一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有付出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative work shall fall within the protection scope of the present invention.
需要说明的是,本发明实施例及附图中的术语“包括”和“具有”以及它们的任何变形,意图在于覆盖不排他的包含。例如包含的一系列步骤或单元的过程、方法、系统、产品或设备没有限定于已列出的步骤或单元,而是可选地还包括没有列出的步骤或单元,或可选地还包括对于这些过程、方法、产品或设备固有的其他步骤或单元。It should be noted that the terms "including" and "having" in the embodiments of the present invention and the drawings and any variations thereof are intended to cover non-exclusive inclusions. For example, the process, method, system, product or device that contains a series of steps or units is not limited to the listed steps or units, but optionally also includes unlisted steps or units, or optionally also includes Other steps or units inherent to these processes, methods, products or equipment.
本发明提供了一种基于人眼状态识别的疲劳检测方法及装置,以实现确定出人眼的空间信息,进而提高对人眼状态的检测结果的准确性,并提高对目标人员的疲劳程度的检测结果的准确性。下面对本发明实施例进行详细说明。The present invention provides a fatigue detection method and device based on human eye state recognition, so as to determine the spatial information of the human eye, thereby improving the accuracy of the detection result of the human eye state, and improving the fatigue of the target person The accuracy of the test results. The embodiments of the present invention will be described in detail below.
图1为本发明实施例提供的基于人眼状态识别的疲劳检测方法的一种流程示意图。该方法可以包括以下步骤:FIG. 1 is a schematic flowchart of a fatigue detection method based on eye state recognition provided by an embodiment of the present invention. The method can include the following steps:
S101:获得图像采集设备针对目标人员进行拍摄所采集到的包含目标人员的面部的人脸图像。S101: Obtain a face image containing the face of the target person collected by the image capture device for shooting the target person.
本发明实施例中,该方法可以应用于任意类型的电子设备,其中,该电子设备可以为服务器或者终端设备。一种情况中,该电子设备可以为图像采集设备,相应的,电子设备可以直接获得自身所采集的包括目标人员的面部的人脸图像,进而针对该人脸图像执行本发明实施例所提供的基于人眼状态识别的疲劳检测流程。另一种情况,电子设备可以为非图像采集设备,相应的,该电子设备可以与针对目标人员进行拍摄的图像采集设备进行通信连接。其中,电子设备可以与一个或多个图像采集设备进行通信连接,进而获得一个或多个图像采集设备采集的人脸图像,进而针对每一图像采集设备采集的人脸图像,执行本发明实施例所提供的基于人眼状态识别的疲劳检测流程,其中,不同图像采集设备针对的目标人员可以不同。In the embodiment of the present invention, the method can be applied to any type of electronic device, where the electronic device can be a server or a terminal device. In one case, the electronic device may be an image acquisition device. Correspondingly, the electronic device may directly obtain the face image including the face of the target person collected by itself, and then execute the facial image provided by the embodiment of the present invention for the face image. Fatigue detection process based on human eye status recognition. In another case, the electronic device may be a non-image acquisition device, and correspondingly, the electronic device may communicate with the image acquisition device that shoots for the target person. Wherein, the electronic device can communicate with one or more image acquisition devices to obtain facial images collected by one or more image acquisition devices, and then implement the embodiments of the present invention for the facial images collected by each image acquisition device The provided fatigue detection process based on human eye state recognition, in which different image acquisition devices can target different target persons.
一种实现中,图像采集设备可以设置于车辆内,相应的,该目标人员为该车辆的驾驶员,图像采集设备可以实时针对车辆内的驾驶员的面部进行拍摄,电子设备可以获得图像采集设备针对驾驶员进行拍摄所采集到的包含驾驶员的面部的人脸图像。一种情况中,图像采集设备可以直接采集得到仅包含驾驶员的面部的人脸图像,进而发送至电子设备。另一种情况中,图像采集设备所采集的图像中除包含驾驶员的面部外还可以包含车辆的车座或驾驶员的身体等信息,电子设备获得图像采集设备采集的图像之后,可以直接将所获得的图像作为人脸图像进行后续流程;也可以基于预设的人脸检测算法,从所获得的图像中检测出人脸所在区域的图像,将该人脸所在区域图像,从所获得的图像中截取出,得到仅包含驾驶员面部的人脸图像,以便提高后续的面部特征点以及眼睑特征点的检测精度,并在一定程度上降低检测计算量。其中,该预设的人脸检测算法可以为:特征脸方法(Eigenface)以及基于神经网络模型的人脸检测算法,基于神经网络模型的人脸检测算法可以为:FasterR-CNN(Faster  Region-Convolutional Neural Networks,快速的区域-卷积神经网络)检测算法,这都是可以的。本发明实施例并不对预设的人脸检测算法的具体类型进行限定。该车辆可以为私家车、卡车以及公交车等,本发明实施例并不对车辆的车辆类型进行限定。In one implementation, the image acquisition device can be set in the vehicle, and correspondingly, the target person is the driver of the vehicle, the image acquisition device can photograph the face of the driver in the vehicle in real time, and the electronic device can obtain the image acquisition device A facial image containing the driver's face collected by shooting for the driver. In one case, the image acquisition device can directly acquire a face image containing only the driver's face, and then send it to the electronic device. In another case, in addition to the driver’s face, the image captured by the image capture device may also include information such as the seat of the vehicle or the driver’s body. After the electronic device obtains the image captured by the image capture device, it can directly The obtained image is used as a face image for subsequent processes; it can also be based on a preset face detection algorithm to detect the image of the area where the face is located from the obtained image, and use the image of the area where the face is obtained from the obtained image. The image is cut out to obtain a face image containing only the driver's face, so as to improve the detection accuracy of subsequent facial feature points and eyelid feature points, and reduce the amount of detection calculation to a certain extent. Among them, the preset face detection algorithm can be: eigenface method (Eigenface) and face detection algorithm based on neural network model, face detection algorithm based on neural network model can be: FasterR-CNN (Faster Region-Convolutional Neural Networks, fast area-convolutional neural network) detection algorithm, this is all possible. The embodiment of the present invention does not limit the specific type of the preset face detection algorithm. The vehicle may be a private car, a truck, a bus, etc. The embodiment of the present invention does not limit the vehicle type of the vehicle.
另一种实现中,图像采集设备也可以实时针对道路中过往的车辆进行监控,相应的,该目标人员可以为目标驾驶员,电子设备可以获得多个图像采集设备针对该目标驾驶员进行拍摄所采集到的包含该目标驾驶员的面部的人脸图像。一种情况中,图像采集设备可以直接采集得到仅包含目标驾驶员的面部的人脸图像,进而发送至电子设备。另一种情况中,图像采集设备所采集的图像中除包含目标驾驶员的面部外还可以包含车辆的车窗以及车头等信息,电子设备获得图像采集设备采集的图像之后,可以直接将所获得的图像作为人脸图像进行后续流程;也可以基于预设的人脸检测算法,从该图像中检测出人脸所在区域的图像,将该人脸所在区域的图像从该图像截取出,得到仅包含目标驾驶员的面部的人脸图像。In another implementation, the image capture device can also monitor the passing vehicles on the road in real time. Correspondingly, the target person can be the target driver, and the electronic device can obtain multiple image capture devices to take pictures of the target driver. The collected face image containing the face of the target driver. In one case, the image acquisition device can directly acquire a face image containing only the face of the target driver, and then send it to the electronic device. In another case, in addition to the face of the target driver, the image captured by the image capture device may also include information such as the window and front of the vehicle. After the electronic device obtains the image captured by the image capture device, it can directly The image of the face is used as the face image for the subsequent process; it can also be based on the preset face detection algorithm to detect the image of the area where the face is located from the image, and cut the image of the area where the face is located from the image to obtain only A face image containing the face of the target driver.
另一种实现中,图像采集设备可以实时针对室内的居家人员进行监控,相应的,该目标人员可以为目标居家人员,电子设备可以获得图像采集设备针对目标居家人员进行拍摄所采集到的包含目标居家人员的面部的人脸图像。In another implementation, the image capture device can monitor indoor household personnel in real time. Accordingly, the target person can be the target household person, and the electronic device can obtain the target captured by the image capture device for shooting the target household person. Face image of the face of the householder.
S102:对人脸图像进行检测,检测得到人脸图像中面部的面部特征点以及面部中人眼的上下眼睑的眼睑特征点。S102: Detect the face image, and detect the facial feature points of the face in the face image and the eyelid feature points of the upper and lower eyelids of the human eyes in the face.
其中,面部特征点为:用于表征人脸图像中面部各个部位的特征点。Among them, the facial feature points are: feature points used to represent various parts of the face in the face image.
本步骤中,可以利用预先建立的第一特征点检测模型,对人脸图像进行检测,检测得到人脸图像中面部的面部特征点以及面部中人眼的上下眼睑的眼睑特征点。一种情况,该预先建立的第一特征点检测模型为:基于标定有面部特征点以及眼睑特征点的第一样本图像,训练所得的神经网络模型。In this step, the first feature point detection model established in advance can be used to detect the face image, and the facial feature points of the face in the face image and the eyelid feature points of the upper and lower eyelids of the human eyes in the face can be detected. In one case, the pre-established first feature point detection model is: a neural network model obtained by training based on a first sample image calibrated with facial feature points and eyelid feature points.
在一种情况中,本发明实施例还可以包括训练得到预先建立的第一特征点检测模型的过程,具体的:电子设备可以先获得初始的第一特征点检测模型,该初始的第一特征点检测模型包括特征提取层和特征分类层;获得第一样本图像,每一第一样本图像包括人脸;获得每一第一样本图像对应的标定信息,其中,该标定信息包括第一样本图像中所包含人脸的标定特征点的标定位置信息,该标定特征点包括:表征该人脸的各个部位的面部特征点以及人眼的上下眼睑中的眼睑特征点。In one case, the embodiment of the present invention may also include a process of training to obtain a pre-established first feature point detection model. Specifically: the electronic device may first obtain an initial first feature point detection model, and the initial first feature The point detection model includes a feature extraction layer and a feature classification layer; a first sample image is obtained, and each first sample image includes a human face; and calibration information corresponding to each first sample image is obtained, wherein the calibration information includes the first sample image. The sample image contains the calibration position information of the calibration feature points of the face, and the calibration feature points include: facial feature points representing various parts of the face and eyelid feature points in the upper and lower eyelids of the human eye.
该各个部位的面部特征点可以包括:该人脸中表征出鼻子所在位置的各特征点,如鼻翼、鼻梁以及鼻尖等特征点;还可以包括表征出嘴唇所在位置的各特征点,如嘴唇的唇线边缘的各特征点;还可以包括表征出眉毛所在位置的各特征点,如眉毛边缘的各特征点;还可以包括表征出人眼所在位置的各特征点,如眼角特征点、眼窝特征点以及瞳孔特征点等等;还可以包括表征出下颌所在位置的各特征点,如下颌轮廓上的各特征点,即下巴轮廓上的各特征点等;还可以包括表征出耳朵所在位置的各特征点,如耳朵的各轮廓上的各特征点等。该标定信息可以为人工标定也可以是通过特定标定程序标定。The facial feature points of each part may include: each feature point in the face that characterizes the position of the nose, such as nose wings, nose bridge, and nose tip; it may also include various feature points that characterize the position of the lips, such as lips. The feature points of the edge of the lip line; it can also include the feature points that characterize the position of the eyebrows, such as the feature points of the edge of the eyebrow; it can also include the feature points that characterize the location of the human eye, such as the corner of the eye feature point, the eye socket feature Points and pupil feature points, etc.; can also include feature points that characterize the position of the mandible, such as feature points on the contour of the mandible, that is, feature points on the chin contour, etc.; can also include features that characterize the position of the ear Feature points, such as each feature point on each contour of the ear. The calibration information can be manually calibrated or calibrated through a specific calibration procedure.
电子设备将每一第一样本图像输入初始的第一特征点检测模型的特征提取层,得到每一第一样本图像的图像特征;将每一第一样本图像的图像特征,输入初始的第一特征点检测模型的特征分类层,得到每一第一样本图像中标定特征点的当前位置信息;将每一第一样本图像中标定特征点的当前位置信息与其对应的标定位置信息进行匹配;若匹配成功,则得到包含特征提取层和特征分类层的第一特征点检测模型,即得到预先建立的第一特征点检测模型;若匹配不成功,则调整特征提取层和特征分类层参数,返回执行该将每一第一样本图像输入初始的特征点检测模型的特征提取层,得到每一第一样本图像的图像特征的步骤;直至匹配成功,则得到包含特征提取层和特征分类层的第一特征点检测模型。The electronic device inputs each first sample image into the feature extraction layer of the initial first feature point detection model to obtain the image feature of each first sample image; input the image feature of each first sample image into the initial The feature classification layer of the first feature point detection model of the first feature point to obtain the current location information of the calibration feature point in each first sample image; the current location information of the calibration feature point in each first sample image and its corresponding calibration location Information is matched; if the matching is successful, the first feature point detection model including the feature extraction layer and the feature classification layer is obtained, that is, the pre-established first feature point detection model is obtained; if the matching is not successful, the feature extraction layer and features are adjusted Classification layer parameters, return to the step of executing the feature extraction layer of inputting each first sample image into the initial feature point detection model to obtain the image features of each first sample image; until the matching is successful, the feature extraction is obtained The first feature point detection model of the layer and feature classification layer.
其中,上述将每一第一样本图像中标定特征点的当前位置信息与其对应的标定位置信息进行匹配的过程,可以是:利用预设的损失函数,计算每一标定特征点的当前位置信息与其对应的标定位置信息之间的第一损失值,判断该第一损失值是否小于第一预设损失阈值;若判断该第一损失值小于第一预设损失阈值,则确定匹配成功,此时可以确定该初始的特征点检测模型收敛,即确定该初始的特征点检测模型训练完成,得到该预先建立的特征点检测模型;若判断该第一损失值不小于第一预设损失阈值,则确定匹配不成功。Wherein, the above process of matching the current position information of the calibration feature point in each first sample image with the corresponding calibration position information may be: calculating the current position information of each calibration feature point by using a preset loss function Determine whether the first loss value is less than the first preset loss threshold value between the corresponding calibration position information; if it is determined that the first loss value is less than the first preset loss threshold value, it is determined that the matching is successful. It can be determined that the initial feature point detection model converges, that is, it is determined that the training of the initial feature point detection model is completed, and the pre-established feature point detection model is obtained; if it is determined that the first loss value is not less than the first preset loss threshold, It is determined that the matching is unsuccessful.
其中,每一第一样本图像与标定特征点的当前位置信息存在对应关系,且每一第一样本图像与标定信息中的标定特征点的标定位置信息存在对应关系,则标定特征点的当前位置信息与标定信息中的标定特征点的标定位置信息存在对应关系。Wherein, each first sample image has a corresponding relationship with the current position information of the calibration feature point, and each first sample image has a corresponding relationship with the calibration position information of the calibration feature point in the calibration information, then the calibration feature point There is a corresponding relationship between the current position information and the calibration position information of the calibration feature points in the calibration information.
训练得到预先建立的第一特征点检测模型之后,电子设备则可以基于预先建立的第一特征点检测 模型,对所获得的人脸图像进行检测,检测得到该人脸图像中面部的面部特征点以及面部中人眼的上下眼睑的眼睑特征点。After training to obtain the pre-established first feature point detection model, the electronic device can detect the obtained face image based on the pre-established first feature point detection model, and detect the facial feature points of the face in the face image And the eyelid characteristic points of the upper and lower eyelids of the human eye in the face.
S103:基于预设的三维人脸模型、面部特征点以及眼睑特征点,构建目标人员对应的目标三维人脸模型。S103: Based on the preset three-dimensional face model, facial feature points, and eyelid feature points, construct a target three-dimensional face model corresponding to the target person.
其中,目标三维人脸模型包括:基于眼睑特征点构建的人眼的上下眼睑。Among them, the target three-dimensional face model includes: the upper and lower eyelids of a human eye constructed based on eyelid feature points.
本步骤中,电子设备本地或所连接的存储设备中,预存有预设的三维人脸模型,电子设备确定出人脸图像中面部的面部特征点以及所述面部中人眼的上下眼睑的眼睑特征点之后,可以基于预设的三维人脸模型、面部特征点以及眼睑特征点,构建目标人员对应的目标三维人脸模型。其中,可以通过3DMM(3D Morphable Models,三维形变模型)技术,基于预设的三维人脸模型、面部特征点以及眼睑特征点,构建目标人员对应的目标三维人脸模型。In this step, a preset three-dimensional face model is prestored locally or in a storage device connected to the electronic device, and the electronic device determines the facial feature points of the face in the face image and the upper and lower eyelids of the human eyes in the face. After the feature points, a target three-dimensional face model corresponding to the target person can be constructed based on the preset three-dimensional face model, facial feature points, and eyelid feature points. Among them, 3DMM (3D Morphable Models, three-dimensional deformation model) technology can be used to construct a target three-dimensional face model corresponding to the target person based on preset three-dimensional face models, facial feature points, and eyelid feature points.
在一种实现方式中,所述S103,可以包括:In an implementation manner, the S103 may include:
从预设的三维人脸模型中,确定出预设面部位置处的空间点的空间位置信息,作为待处理空间点的空间位置信息,其中,待处理空间点与图像特征点存在对应关系,图像特征点为:面部特征点和眼睑特征点;From the preset three-dimensional face model, the spatial position information of the spatial point at the preset facial position is determined as the spatial position information of the spatial point to be processed. Among them, there is a corresponding relationship between the spatial point to be processed and the image feature point. The feature points are: facial feature points and eyelid feature points;
利用弱透视投影矩阵以及每一待处理空间点的空间位置信息,确定每一待处理空间点在所述人脸图像中的投影点的投影位置信息;Using the weak perspective projection matrix and the spatial position information of each spatial point to be processed to determine the projection position information of the projection point of each spatial point to be processed in the face image;
基于每一待处理空间点的投影点的投影位置信息及每一待处理空间点对应的图像特征点的成像位置信息,构建目标人员对应的目标三维人脸模型。Based on the projection position information of the projection point of each spatial point to be processed and the imaging position information of the image feature point corresponding to each spatial point to be processed, a target three-dimensional face model corresponding to the target person is constructed.
一种实现方式中,电子设备可以接收用户选取指令,其中,该用户选取指令携带所需选取的空间点的预设面部位置,电子设备可以基于该用户选取指令所携带的预设面部位置,从预设的三维人脸模型中,确定出该预设面部位置处的空间点的空间位置信息,作为待处理空间点的空间位置信息。另一种实现方式中,电子设备可以预存有该预设面部位置,进而电子设备可以从相应的存储位置处读取得到该预设面部位置,进而从预设的三维人脸模型中,确定出该预设面部位置处的空间点的空间位置信息,作为待处理空间点的空间位置信息。In one implementation manner, the electronic device may receive a user selection instruction, where the user selection instruction carries a preset face position of a spatial point that needs to be selected, and the electronic device may, based on the preset face position carried by the user selection instruction, In the preset three-dimensional face model, the spatial position information of the spatial point at the preset face position is determined as the spatial position information of the spatial point to be processed. In another implementation manner, the electronic device may prestore the preset face position, and the electronic device may read the preset face position from the corresponding storage location, and then determine from the preset three-dimensional face model The spatial position information of the spatial point at the preset face position is used as the spatial position information of the spatial point to be processed.
其中,待处理空间点与图像特征点存在对应关系,图像特征点为:面部特征点和眼睑特征点,该待处理空间点与图像特征点存在一一对应的关系。一种情况,该预设面部位置可以基于上述第一样本图像中所包含人脸的标定特征点的位置进行设置。Among them, there is a corresponding relationship between the spatial points to be processed and the image feature points, and the image feature points are: facial feature points and eyelid feature points, and the to-be-processed spatial points have a one-to-one correspondence with the image feature points. In one case, the preset face position may be set based on the position of the calibration feature point of the face contained in the first sample image.
一种情况中,该预设的三维人脸模型可以通过如下公式(1)表示:In one case, the preset three-dimensional face model can be expressed by the following formula (1):
Figure PCTCN2019108073-appb-000001
Figure PCTCN2019108073-appb-000001
其中,S表示该预设的三维人脸模型,
Figure PCTCN2019108073-appb-000002
表示预设的平均脸,A id表示人的人脸的形状信息,A exp表示人的人脸的表情信息,α id表示人的人脸的形状信息的权重,可以称为形状权重,α exp表示人的人脸的表情信息的权重,可以称为表情权重。
Among them, S represents the preset three-dimensional face model,
Figure PCTCN2019108073-appb-000002
Represents the preset average face, A id represents the shape information of the human face, A exp represents the expression information of the human face, α id represents the weight of the shape information of the human face, which can be called the shape weight, α exp The weight of the expression information representing the human face can be called the expression weight.
电子设备可以基于上述公式(1)绘制出其所表征的三维人脸模型,该三维人脸模型由点云组成。电子设备可以从该绘制的三维人脸模型中,确定出预设面部位置处的空间点,作为待处理空间点,并获得待处理空间点的空间位置信息。The electronic device can draw the three-dimensional face model it represents based on the above formula (1), and the three-dimensional face model is composed of point clouds. The electronic device can determine the spatial point at the preset face position from the drawn three-dimensional face model as the spatial point to be processed, and obtain the spatial position information of the spatial point to be processed.
电子设备确定出待处理空间点的空间位置信息之后,可以基于预设的弱透视投影矩阵,将每一待处理空间点投影至该人脸图像中,即利用弱透视投影矩阵以及每一待处理空间点的空间位置信息,确定每一待处理空间点在人脸图像中的投影点的投影位置信息。基于每一待处理空间点的投影点的投影位置信息以及每一待处理空间点对应的图像特征点的成像位置信息,构建目标人员对应的目标三维人脸模型。其中,上述图像特征点的成像位置信息为图像特征点在人脸图像中的位置信息。After the electronic device determines the spatial position information of the spatial point to be processed, it can project each spatial point to be processed into the face image based on the preset weak perspective projection matrix, that is, use the weak perspective projection matrix and each to be processed The spatial position information of the spatial point determines the projection position information of the projection point of each spatial point to be processed in the face image. Based on the projection position information of the projection point of each spatial point to be processed and the imaging position information of the image feature point corresponding to each spatial point to be processed, a target three-dimensional face model corresponding to the target person is constructed. Wherein, the imaging location information of the image feature point is the location information of the image feature point in the face image.
其中,上述基于每一待处理空间点的投影点的投影位置信息以及每一待处理空间点对应的图像特征点的成像位置信息,构建目标人员对应的目标三维人脸模型的过程,可以是:基于每一待处理空间点的投影点的投影位置信息以及每一待处理空间点对应的图像特征点的成像位置信息,确定每一待处理空间点及其对应的图像特征点的距离误差,基于最小二乘法原理以及每一待处理空间点及其对应的图像特征点的距离误差,构建目标函数。求解使得该目标函数的函数值达到最小或满足预设约束条件时,该目标函数中的相应未知量的解,基于该解得到目标人员对应的目标三维人脸模型。Among them, the above-mentioned process of constructing the target three-dimensional face model corresponding to the target person based on the projection position information of the projection point of each spatial point to be processed and the imaging position information of the image feature point corresponding to each spatial point to be processed may be: Based on the projection position information of the projection point of each spatial point to be processed and the imaging position information of the image feature point corresponding to each spatial point to be processed, the distance error of each spatial point to be processed and its corresponding image feature point is determined, based on The principle of least squares and the distance error of each spatial point to be processed and its corresponding image feature point are used to construct the objective function. When the solution minimizes the function value of the objective function or satisfies a preset constraint condition, a solution of the corresponding unknown quantity in the objective function is obtained based on the solution to obtain a target three-dimensional face model corresponding to the target person.
一种情况中,该预设的弱透视投影矩阵可以通过如下公式(2)表示:In one case, the preset weak perspective projection matrix can be expressed by the following formula (2):
s i2d=fPR(α,β,γ)(S i+t 3d);  (2) s i2d =fPR(α,β,γ)(S i +t 3d ); (2)
其中,s i2d表示第i个待处理空间点的投影点的投影位置信息,其中,i可以取[1,n]中的整数,该n表示待处理空间点的数量,f表示比例因子,R(α,β,γ)表示3*3的旋转矩阵,α表示该预设的三维人脸 模型在预设空间直角坐标系下的横轴下的旋转角度,β表示该预设的三维人脸模型在预设空间直角坐标系下的纵轴下的旋转角度,γ表示该预设的三维人脸模型在预设空间直角坐标系下的竖轴下的旋转角度,该t 3d表示平移向量;S i表示第i个待处理空间点的空间位置信息,该旋转矩阵和平移向量用于:将该预设的三维人脸模型从其所在的预设空间直角坐标系下,转换至图像采集设备的设备坐标系下。 Among them, s i2d represents the projection position information of the projection point of the i-th spatial point to be processed, where i can be an integer in [1, n], where n represents the number of spatial points to be processed, f represents the scale factor, and R (α, β, γ) represents a 3*3 rotation matrix, α represents the rotation angle of the preset three-dimensional face model under the horizontal axis in the preset space rectangular coordinate system, and β represents the preset three-dimensional face The rotation angle of the model under the vertical axis in the preset space rectangular coordinate system, γ represents the rotation angle of the preset three-dimensional face model under the vertical axis in the preset space rectangular coordinate system, and t 3d represents the translation vector; S i represents the spatial position information of the i-th spatial point to be processed, and the rotation matrix and translation vector are used to: convert the preset three-dimensional face model from the preset spatial rectangular coordinate system where it is located to the image acquisition device In the device coordinate system.
目标函数可以通过如下公式(3)表示:The objective function can be expressed by the following formula (3):
Figure PCTCN2019108073-appb-000003
Figure PCTCN2019108073-appb-000003
其中,P表示目标函数的函数值,s i2dt表示第i个待处理空间点对应的图像特征点的成像位置信息,‖·‖表示求向量的模,该向量表示:第i个待处理空间点对应的图像特征点的成像位置信息和第i个待处理空间点的投影点的投影位置信息之间的距离误差。 Among them, P represents the function value of the objective function, s i2dt represents the imaging position information of the image feature point corresponding to the i-th spatial point to be processed, ‖·‖ represents the modulus of the vector, and the vector represents: the i-th spatial point to be processed The distance error between the imaging position information of the corresponding image feature point and the projection position information of the projection point of the i-th spatial point to be processed.
本发明实施例中,可以通过迭代的方法,不断调整f,R(α,β,γ),t 3didexp的具体取值,以使得P达到最小或使得P满足预设约束条件,该预设约束条件可以为P不大于预设距离误差阈值。获得P达到最小或使得P满足预设约束条件时,f,R(α,β,γ),t 3didexp的具体取值,作为最终的取值,将,α idexp的最终的取值,代入公式(1)中,得到目标人员对应的目标三维人脸模型。 In the embodiment of the present invention, the specific values of f, R(α, β, γ), t 3d , α id , and α exp can be continuously adjusted through an iterative method to minimize P or satisfy preset constraints. Condition, the preset constraint condition may be that P is not greater than a preset distance error threshold. Obtain the specific values of f,R(α,β,γ),t 3didexp when P reaches the minimum or makes P meet the preset constraints, as the final value, α id ,α The final value of exp is substituted into formula (1) to obtain the target three-dimensional face model corresponding to the target person.
S104:基于目标三维人脸模型中人眼的上下眼睑的三维位置信息,确定人眼的上下眼睑之间的当前开闭长度。S104: Determine the current opening and closing length between the upper and lower eyelids of the human eye based on the three-dimensional position information of the upper and lower eyelids of the human eye in the target three-dimensional face model.
S105:基于当前开闭长度,确定出目标人员的当前疲劳程度。S105: Determine the current fatigue level of the target person based on the current opening and closing length.
其中,人员的人眼的开闭的状态,即人眼状态,在一定程度上可以表征出人员的疲劳程度,而人眼的开闭的状态可以通过人眼的上下眼睑之间的开闭长度标识。其中,一般人员在疲劳状态下,人眼的上下眼睑之间的距离会相对较小,而人员在非疲劳状态下,人眼的上下眼睑之间的距离会相对较大。本发明实施例中,目标三维人脸模型包含目标人员的人眼的上下眼睑,通过目标三维人脸模型中的上下眼睑,可以确定得到上下眼睑之间的三维距离,作为当前开闭长度,进而基于当前开闭长度,确定出目标人员的当前疲劳程度。Among them, the opening and closing state of the human eye of a person, that is, the state of the human eye, can represent the fatigue degree of the person to a certain extent, and the opening and closing state of the human eye can be measured by the opening and closing length between the upper and lower eyelids of the human eye Logo. Among them, the distance between the upper and lower eyelids of the human eyes will be relatively small when the average person is in a fatigue state, and the distance between the upper and lower eyelids of the human eye will be relatively large when the person is in a non-fatigue state. In the embodiment of the present invention, the target three-dimensional face model includes the upper and lower eyelids of the human eye of the target person. Through the upper and lower eyelids in the target three-dimensional face model, the three-dimensional distance between the upper and lower eyelids can be determined and used as the current opening and closing length. Based on the current opening and closing length, the current fatigue level of the target person is determined.
一种情况,可以是针对目标三维人脸模型中任一只人眼的上下眼睑的三维位置信息,如左眼的上下眼睑的三维位置信息或右眼的上下眼睑的三维位置信息,确定上下眼睑之间的当前开闭长度,进而,确定出目标人员的当前状态。In one case, it can be based on the three-dimensional position information of the upper and lower eyelids of any human eye in the target three-dimensional face model, such as the three-dimensional position information of the upper and lower eyelids of the left eye or the three-dimensional position information of the upper and lower eyelids of the right eye, to determine the upper and lower eyelids The current opening and closing length between the two, and then determine the current state of the target person.
另一种情况,可以是:针对目标人员的两只人眼的上下眼睑的三维位置信息,如左眼和右眼的上下眼睑的三维位置信息,确定上下眼睑之间的当前开闭长度,进而,确定出目标人员的当前状态。其中,可以是分别针对目标人员的每一人眼的上下眼睑的三维位置信息,确定每一人眼的上下眼睑之间的开闭长度,进而计算两只眼的上下眼睑之间的开闭长度的平均值,作为上下眼睑之间的当前开闭长度,进而确定出目标人员的当前状态。In another case, it can be: for the three-dimensional position information of the upper and lower eyelids of the two human eyes of the target person, such as the three-dimensional position information of the upper and lower eyelids of the left and right eyes, determine the current opening and closing length between the upper and lower eyelids, and then , To determine the current status of the target personnel. Among them, it can be the three-dimensional position information of the upper and lower eyelids of each eye of the target person to determine the opening and closing length between the upper and lower eyelids of each eye, and then calculating the average of the opening and closing lengths between the upper and lower eyelids of the two eyes The value is used as the current opening and closing length between the upper and lower eyelids to determine the current state of the target person.
应用本发明实施例,可以基于包含目标人员的面部的人脸图像中的面部特征点和眼睑特征点和预设的三维人脸模型,构建出目标人员对应的包括目标人员的人眼的上下眼睑目标三维人脸模型,即构建出了目标人员的人眼的空间信息,基于该空间信息,可以确定出准确性更高的人眼的上下眼睑之间的空间距离,即人眼的开闭状态,进而,基于准确性更高的人眼的上下眼睑之间的空间距离,可以更加准确地确定出目标人员的当前疲劳程度。本发明实施例中不再仅依赖利用预先训练的人眼状态检测模型对二维图像中人眼的闭合状态的检测结果,实现度目标人员的疲劳程度的确定,避免了预先训练的人眼状态检测模型对图像中人眼的闭合状态和睁开状态的检测边界模糊,进而导致检测结果不够准确的情况的发生。实现确定出人眼的空间信息,进而提高人眼状态的检测结果的准确性,以及提高对目标人员的当前疲劳程度的检测结果的准确性。With the application of the embodiment of the present invention, the upper and lower eyelids of the target person’s eyes corresponding to the target person can be constructed based on the facial feature points and the eyelid feature points in the face image containing the target person’s face and the preset three-dimensional face model The target three-dimensional face model, which constructs the spatial information of the human eye of the target person. Based on this spatial information, the spatial distance between the upper and lower eyelids of the human eye can be determined with higher accuracy, that is, the open and closed state of the human eye Furthermore, based on the more accurate spatial distance between the upper and lower eyelids of the human eye, the current fatigue level of the target person can be determined more accurately. The embodiment of the present invention no longer only relies on the detection result of the closed state of the human eye in the two-dimensional image by using the pre-trained human eye state detection model to realize the determination of the fatigue degree of the target person and avoid the pre-trained eye state The detection model blurs the detection boundary between the closed state and the open state of the human eye in the image, which leads to the occurrence of insufficient detection results. It is possible to determine the spatial information of the human eye, thereby improving the accuracy of the detection result of the human eye state, and the accuracy of the detection result of the current fatigue degree of the target person.
在本发明的另一实施例中,所述S102,可以包括:In another embodiment of the present invention, the S102 may include:
对人脸图像进行检测,检测得到人脸图像中面部的面部特征点;Detect the face image, and detect the facial feature points of the face in the face image;
基于面部特征点,从人脸图像中确定并截取出面部中人眼所在区域,作为人眼图像;Based on the facial feature points, determine and cut out the area where the eyes of the face are located from the face image, and use it as the eye image;
利用预设的眼睑特征点检测模型,从人眼图像中检测出人眼的上下眼睑的眼睑特征点。其中,预设的眼睑特征点检测模型为:基于标注有人眼的上下眼睑的眼睑特征点的样本图像训练所得的模型。Using the preset eyelid feature point detection model, the eyelid feature points of the upper and lower eyelids of the human eye are detected from the human eye image. Among them, the preset eyelid feature point detection model is: a model trained based on sample images marked with the eyelid feature points of the upper and lower eyelids of a human eye.
人脸图像中包含目标人员的整个面部的特征,直接在人脸图像中检测人眼眼睑的眼睑点,难免出现检测不够准确的情况。本实施例中,可以先对人脸图像进行检测,检测得到人脸图像中可以表征目标人员面部的各个部位的面部特征点,进而,基于该面部特征点,从人脸图像中确定出面部中人眼所在区域,作为人眼图像,并从该人脸图像中截取出该人眼图像。进而基于预设的眼睑特征点检测模型,从包含人眼的人眼图像中检测出人眼的上下眼睑的眼睑特征点。以在一定程度上提高所检测出的人眼的眼睑特征点的准确性。The face image contains the characteristics of the entire face of the target person, and the eyelid point of the eyelid of the human eye is directly detected in the face image. It is inevitable that the detection is not accurate enough. In this embodiment, the face image can be detected first, and the facial feature points that can represent the various parts of the target person’s face in the face image are detected, and then, based on the facial feature points, the face is determined from the face image The area where the human eye is located is used as the human eye image, and the human eye image is cut out from the face image. Furthermore, based on the preset eyelid feature point detection model, the eyelid feature points of the upper and lower eyelids of the human eye are detected from the human eye image containing the human eye. In order to improve the accuracy of the detected eyelid feature points of the human eye to a certain extent.
其中,该预设的眼睑特征点检测模型为:基于标注有人眼的上下眼睑的眼睑特征点的样本图像训练所得的模型。该预设的眼睑特征点检测模型可以为神经网络模型。该预设的眼睑特征点检测模型的训练过程,可以参见上述预先建立的第一特征点检测模型的训练过程。可以理解的是,为了布局清楚,该预设的眼睑特征点检测模型所需的样本图像,可以称为第二样本图像,区别于预先建立的第一特征点检测模型的第一样本图像,该第二样本图像为标注有人眼的上下眼睑的眼睑特征点的图像,且第二样本图像对应的标定信息包含该的人眼的上下眼睑的眼睑特征点的标定位置信息。其中,该第二样本图像标注的人眼的上下眼睑的眼睑特征点,可以是人工标定或通过特定标定程序标定的眼睑特征点。Wherein, the preset eyelid feature point detection model is: a model trained based on sample images marked with eyelid feature points of the upper and lower eyelids of a human eye. The preset eyelid feature point detection model may be a neural network model. For the training process of the preset eyelid feature point detection model, refer to the training process of the first feature point detection model established in advance. It can be understood that, for clear layout, the sample image required by the preset eyelid feature point detection model can be called the second sample image, which is different from the first sample image of the first feature point detection model established in advance. The second sample image is an image marking the eyelid feature points of the upper and lower eyelids of a human eye, and the calibration information corresponding to the second sample image includes the calibration position information of the eyelid feature points of the upper and lower eyelids of the human eye. Wherein, the eyelid feature points of the upper and lower eyelids of the human eye marked by the second sample image may be eyelid feature points calibrated manually or through a specific calibration procedure.
上述对人脸图像进行检测,检测得到人脸图像中可以表征目标人员面部的各个部位的面部特征点,可以是:基于预先建立的第二特征点检测模型,对人脸图像进行检测,检测得到人脸图像中可以表征目标人员面部的各个部位的面部特征点,该预先建立的第二特征点检测模型为:基于标注有可表征面部各部位的面部特征点的第三样本图像训练所得的神经网络模型。该预先建立的第二特征点检测模型的训练过程,可以参见上述预先建立的第一特征点检测模型的训练过程。区别于预先建立的第一特征点检测模型的第一样本图像,预先建立的第二特征点检测模型所需的第三样本图像为标注有可表征面部各部位的面部特征点的图像,且第三样本图像对应的标定信息包含可表征面部各部位的面部特征点的标定位置信息。The above detection of the face image, the detection of facial feature points that can represent each part of the target person’s face in the face image, can be: based on the pre-established second feature point detection model, the face image is detected, and the detection is obtained The face image can represent the facial feature points of each part of the target person’s face. The pre-established second feature point detection model is: a nerve trained on the third sample image marked with facial feature points that can represent each part of the face Network model. For the training process of the pre-established second feature point detection model, refer to the above-mentioned training process of the pre-established first feature point detection model. Different from the first sample image of the pre-established first feature point detection model, the third sample image required by the pre-established second feature point detection model is an image marked with facial feature points that can represent various parts of the face, and The calibration information corresponding to the third sample image includes calibration position information that can characterize facial feature points of various parts of the face.
进而,基于面部特征点中表征人眼所在位置的各特征点的二维位置信息,从人脸图像中,确定并截取出目标人员的人眼所在区域,作为人眼图像。其中,可以是基于面部特征点中表征人眼所在位置的各特征点的二维位置信息,确定出最小的包含该目标人员的人眼的矩形区域,将该矩形区域作为人眼所在区域,并截取出,得到人眼图像。可以是分别针对目标人员的两只眼睛分别截取出其所在区域的图像,得到人眼图像。Furthermore, based on the two-dimensional position information of each feature point representing the location of the human eye in the facial feature point, the area where the human eye of the target person is located is determined and cut out from the face image, as the human eye image. Among them, it can be based on the two-dimensional position information of each feature point representing the location of the human eye in the facial feature point, determining the smallest rectangular area containing the human eye of the target person, taking the rectangular area as the area of the human eye, and Cut out to get the human eye image. It may be that the images of the area where the target person is located are respectively intercepted for the two eyes of the target person to obtain the human eye image.
在本发明的另一实施例中,该人眼图像包括左眼图像和右眼图像;In another embodiment of the present invention, the human eye image includes a left eye image and a right eye image;
在所述利用预设的眼睑特征点检测模型,从人眼图像中检测出人眼的上下眼睑的眼睑特征点(S102)的步骤之前,所述方法还可以包括:Before the step of using the preset eyelid feature point detection model to detect the eyelid feature points of the upper and lower eyelids of the human eye from the human eye image (S102), the method may further include:
对第一图像进行镜像处理,得到镜像图像,其中,第一图像为左眼图像或右眼图像;Performing mirror image processing on the first image to obtain a mirror image, where the first image is a left-eye image or a right-eye image;
对镜像图像以及人眼图像中未进行镜像处理的图像进行拼接,得到拼接图像;Splicing the mirror image and the image that has not been mirrored in the human eye image to obtain a spliced image;
所述S102,可以包括:The S102 may include:
利用预设的眼睑特征点检测模型,从拼接图像中,检测出镜像图像中人眼的上下眼睑的眼睑特征点,以及未进行镜像处理的图像中人眼的上下眼睑的眼睑特征点;Using a preset eyelid feature point detection model, from the stitched image, detect the eyelid feature points of the upper and lower eyelids of the human eye in the mirror image, and the eyelid feature points of the upper and lower eyelid of the human eye in the image without mirror processing;
对镜像图像中人眼的上下眼睑的眼睑特征点进行镜像处理,得到镜像后的眼睑特征点,以得到人眼图像中的人眼的上下眼睑的眼睑特征点。Mirror image processing is performed on the eyelid feature points of the upper and lower eyelids of the human eye in the mirror image to obtain the eyelid feature points after mirroring to obtain the eyelid feature points of the upper and lower eyelids of the human eye in the human eye image.
其中,人眼图像包括:包含目标人员左眼的图像,可称为左眼图像;和包含目标人员的右眼的图像,可称为右眼图像。为了在一定程度上降低利用预设的眼睑特征点检测模型,检测得到目标人员的眼睑特征点的复杂度,并缩短利用预设的眼睑特征点检测模型,检测得到目标人员的眼睑特征点所需的检测时间。本实施例中,可以对第一图像进行镜像处理,得到镜像图像,即对左眼图像或右眼图像进行镜像处理,得到镜像图像。进而对镜像图像以及人眼图像中未进行镜像处理的图像进行拼接,得到拼接图像;将拼接图像输入预设的眼睑特征点检测模型,以利用预设的眼睑特征点检测模型,从拼接图像中,检测出镜像图像中人眼的上下眼睑的眼睑特征点,以及未进行镜像处理的图像中人眼的上下眼睑的眼睑特征点。使得预设的眼睑特征点检测模型可以同时对镜像图像和未进行镜像处理的图像进行检测,可以缩短利用预设的眼睑特征点检测模型,检测得到目标人员的眼睑特征点所需的检测时间。Among them, the human eye image includes: an image containing the left eye of the target person, which may be called a left eye image; and an image containing the right eye of the target person, which may be called a right eye image. In order to reduce the complexity of using the preset eyelid feature point detection model to detect the target person’s eyelid feature point to a certain extent, and shorten the use of the preset eyelid feature point detection model to detect the target person’s eyelid feature point. The detection time. In this embodiment, mirror image processing may be performed on the first image to obtain a mirror image, that is, mirror image processing is performed on the left eye image or the right eye image to obtain a mirror image. Then stitch the mirror image and the image that has not been mirrored in the human eye image to obtain the stitched image; input the stitched image into the preset eyelid feature point detection model to use the preset eyelid feature point detection model to extract , To detect the eyelid feature points of the upper and lower eyelids of the human eye in the mirror image, and the eyelid feature points of the upper and lower eyelids of the human eye in the image without mirror processing. The preset eyelid feature point detection model can simultaneously detect the mirror image and the image without mirror processing, which can shorten the detection time required to detect the eyelid feature points of the target person by using the preset eyelid feature point detection model.
其中,若对右眼图像进行镜像处理,上述未进行镜像处理的图像为左眼图像;若对左眼图像进行镜像处理,上述未进行镜像处理的图像为右眼图像。Wherein, if the right-eye image is mirrored, the image that has not been mirrored is the left-eye image; if the left-eye image is mirrored, the image that has not been mirrored is the right-eye image.
对左眼图像或右眼图像进行镜像处理,可以使得左眼图像镜像为该左眼图像对应的右眼图像,或使得右眼图像镜像为该右眼图像对应的左眼图像,在一定程度上降低利用预设的眼睑特征点检测模型,检测得到目标人员的眼睑特征点的复杂度。Mirroring the left-eye image or the right-eye image can make the left-eye image mirror the right-eye image corresponding to the left-eye image, or make the right-eye image mirror the left-eye image corresponding to the right-eye image, to a certain extent Reduce the complexity of using the preset eyelid feature point detection model to detect the eyelid feature points of the target person.
可以理解的是,在训练得到上述预设的眼睑特征点检测模型,所需的第二样本图像中,可以包含样本人员的左眼图像及该样本人员的右眼图像镜像所得的左眼图像,或包含样本人员的右眼图像及该样本人员的左眼图像镜像所得的右眼图像。若训练得到上述预设的眼睑特征点检测模型所需的第二样本图像中,包含样本人员的左眼图像及该样本人员的右眼图像镜像所得的左眼图像,后续的,在检测过程中,该第一图像为目标人员的右眼图像,即需要对目标人员的右眼图像进行镜像处理。若训练得 到上述预设的眼睑特征点检测模型所需的第二样本图像中,包含样本人员的右眼图像及该样本人员的左眼图像镜像所得的右眼图像,后续的,在检测过程中,该第一图像为目标人员的左眼图像,即需要对目标人员的左眼图像进行镜像处理。It is understandable that after training to obtain the aforementioned preset eyelid feature point detection model, the required second sample image may include the left eye image of the sample person and the left eye image obtained by mirroring the right eye image of the sample person. Or include the right eye image of the sample person’s right eye image and the right eye image of the sample person’s left eye image. If the second sample image required by the above-mentioned preset eyelid feature point detection model is obtained through training, it contains the left eye image of the sample person and the left eye image obtained by mirroring the right eye image of the sample person, and the subsequent, in the detection process , The first image is the right eye image of the target person, that is, the right eye image of the target person needs to be mirrored. If the second sample image required by the above-mentioned preset eyelid feature point detection model is obtained by training, it contains the right eye image of the sample person and the right eye image obtained by mirroring the left eye image of the sample person, and then, in the detection process , The first image is the left eye image of the target person, that is, the left eye image of the target person needs to be mirrored.
在训练得到上述预设的眼睑特征点检测模型时,对样本人员的右眼图像或左眼图像进行镜像处理,在一定程度上还可以增加训练得到上述预设的眼睑特征点检测模型所需的第二样本图像的数量。When the above-mentioned preset eyelid feature point detection model is obtained by training, the right eye image or left eye image of the sample person is mirrored. To a certain extent, it can also increase the training to obtain the above-mentioned preset eyelid feature point detection model. The number of second sample images.
上述对镜像图像以及人眼图像中未进行镜像处理的图像进行拼接,得到拼接图像的过程,可以是:对镜像图像以及人眼图像中未进行镜像处理的图像进行空间维度的拼接或者通道维度的拼接,其中,该空间维度的拼接可以为:将镜像图像以及人眼图像中未进行镜像处理的图像进行左右拼接或上下拼接。左右拼接可以是:镜像图像的右侧边与人眼图像中未进行镜像处理的图像的左侧边进行拼接,镜像图像的左侧边与人眼图像中未进行镜像处理的图像的右侧边进行拼接。上下拼接可以是:镜像图像的上侧边与人眼图像中未进行镜像处理的图像的下侧边进行拼接,镜像图像的下侧边与人眼图像中未进行镜像处理的图像的上侧边进行拼接。The above process of splicing the mirror image and the image that has not been mirrored in the human eye image to obtain the spliced image can be: splicing the mirror image and the image that has not been mirrored in the human eye image in the spatial dimension or channel dimension. Splicing, where the splicing of the spatial dimension may be: splicing the mirror image and the image that has not been mirrored in the human eye image left and right spliced or spliced up and down. Left and right splicing can be: the right side of the mirror image is spliced with the left side of the image that is not mirrored in the human eye image, and the left side of the mirror image is the right side of the image that is not mirrored in the human eye image. Make splicing. Top and bottom splicing can be: the upper side of the mirror image is spliced with the lower side of the image that is not mirrored in the human eye image, and the lower side of the mirror image is the upper side of the image that is not mirrored in the human eye image. Make splicing.
在本发明的另一实施例中,在所述对第一图像进行镜像处理,得到镜像图像的步骤之前,所述方法还可以包括:In another embodiment of the present invention, before the step of performing mirror image processing on the first image to obtain a mirror image, the method may further include:
对左眼图像和右眼图像进行转正处理,得到转正后的左眼图像和转正后的右眼图像,其中,转正处理为:使得待处理图像中的两个眼角点的连线与预设图像坐标系的坐标轴平行,待处理图像为左眼图像和右眼图像;The left-eye image and the right-eye image are corrected to obtain the corrected left-eye image and the corrected right-eye image, where the normalized processing is: making the line between the two eye corner points in the image to be processed and the preset image The coordinate axes of the coordinate system are parallel, and the images to be processed are the left eye image and the right eye image;
所述对第一图像进行镜像处理,得到镜像图像的步骤,可以包括:The step of performing mirror image processing on the first image to obtain a mirror image may include:
对转正后的第一图像进行镜像处理,得到镜像图像。Perform mirror image processing on the converted first image to obtain a mirror image.
在一种情况中,目标人员的头部可能会出现倾斜的情况,本实施例中,为了提高对眼睑特征点的检测结果的准确性,在对左眼图像和右眼图像进行镜像处理之前,可以首先对左眼图像和右眼图像进行转正处理,即使得左眼图像的两个眼角点的连线与预设图像坐标系的横轴平行,且使得右眼图像的两个眼角点的连线与预设图像坐标系的横轴平行;或,使得左眼图像的两个眼角点的连线与预设图像坐标系的纵轴平行,且使得右眼图像的两个眼角点的连线与预设图像坐标系的纵轴平行,这都是可以的。In one case, the head of the target person may be tilted. In this embodiment, in order to improve the accuracy of the detection result of the eyelid feature points, before mirroring the left eye image and the right eye image, The left-eye image and the right-eye image can be corrected first, that is, the connection between the two corner points of the left-eye image is parallel to the horizontal axis of the preset image coordinate system, and the two corner points of the right-eye image are connected. The line is parallel to the horizontal axis of the preset image coordinate system; or, making the line between the two corner points of the left eye image parallel to the vertical axis of the preset image coordinate system, and making the line between the two corner points of the right eye image Parallel to the longitudinal axis of the preset image coordinate system, this is all possible.
后续的,可以对转正后左眼图像或转正后的右眼图像进行镜像处理,得到镜像图像。Subsequent, mirror image processing can be performed on the left-eye image after normalization or the right-eye image after normalization to obtain a mirror image.
其中,该预设图像坐标系可以为该图像采集设备的图像坐标系。Wherein, the preset image coordinate system may be the image coordinate system of the image acquisition device.
在本发明的另一实施例中,如图2A所示,所述S104可以包括如下步骤:In another embodiment of the present invention, as shown in FIG. 2A, the S104 may include the following steps:
S201A:从目标三维人脸模型中,检测得到人眼的上眼睑的第一中心点的三维位置信息和下眼睑的第二中心点的三维位置信息。S201A: From the target three-dimensional face model, detect the three-dimensional position information of the first center point of the upper eyelid and the three-dimensional position information of the second center point of the lower eyelid of the human eye.
S202A:基于第一中心点的三维位置信息以及第二中心点的三维位置信息,确定第一中心点和第二中心点之间的距离,作为人眼的上下眼睑之间的当前开闭长度。S202A: Based on the three-dimensional position information of the first center point and the three-dimensional position information of the second center point, determine the distance between the first center point and the second center point as the current opening and closing length between the upper and lower eyelids of the human eye.
本实施例中,为了在保证所确定的人眼的上下眼睑之间的开闭长度的准确性的同时,降低电子设备的计算负担,可以直接从目标三维人脸模型中,检测得到人眼的上眼睑的第一中心点和下眼睑的第二中心点,即检测得到人眼的上眼睑的2等分点和下眼睑的2等分点;进而,得到第一中心点的空间位置信息以及第二中心点的空间位置信息,即第一中心点的三维位置信息和下眼睑的第二中心点的三维位置信息。基于该第一中心点的三维位置信息和下眼睑的第二中心点的三维位置信息,确定出第一中心点和第二中心点之间的距离,作为人眼的上下眼睑之间的当前开闭长度。具体的,第一中心点和第二中心点之间的距离可以表示为:
Figure PCTCN2019108073-appb-000004
其中,(x 1,y 1,z 1)表示第一中心点的三维位置信息,(x 2,y 2,z 2)表示第二中心点的三维位置信息。
In this embodiment, in order to ensure the accuracy of the determined opening and closing lengths between the upper and lower eyelids of the human eye, and at the same time reduce the computational burden of the electronic device, the human eye can be directly detected from the target three-dimensional face model. The first center point of the upper eyelid and the second center point of the lower eyelid are detected to obtain the bisecting point of the upper eyelid and the bisecting point of the lower eyelid of the human eye; further, the spatial position information of the first center point and The spatial position information of the second center point, that is, the three-dimensional position information of the first center point and the three-dimensional position information of the second center point of the lower eyelid. Based on the three-dimensional position information of the first center point and the three-dimensional position information of the second center point of the lower eyelid, the distance between the first center point and the second center point is determined as the current opening between the upper and lower eyelids of the human eye Closed length. Specifically, the distance between the first center point and the second center point can be expressed as:
Figure PCTCN2019108073-appb-000004
Among them, (x 1 , y 1 , z 1 ) represents the three-dimensional position information of the first center point, and (x 2 , y 2 , z 2 ) represents the three-dimensional position information of the second center point.
在本发明的另一实施例中,如图2B所示,所述S104可以包括如下步骤:In another embodiment of the present invention, as shown in FIG. 2B, the S104 may include the following steps:
S201B:从目标三维人脸模型中,确定出人眼对应的人眼空间点的三维位置信息。S201B: Determine the three-dimensional position information of the human eye space point corresponding to the human eye from the target three-dimensional face model.
S202B:基于人眼空间点的三维位置信息,进行球面拟合,得到表征人眼的球体模型。S202B: Perform spherical fitting based on the three-dimensional position information of the spatial point of the human eye to obtain a sphere model representing the human eye.
S203B:从目标三维人脸模型中,检测得到人眼的上眼睑的第一中心点的三维位置信息和下眼睑的第二中心点的三维位置信息。S203B: From the target three-dimensional face model, detect the three-dimensional position information of the first center point of the upper eyelid and the three-dimensional position information of the second center point of the lower eyelid of the human eye.
S204B:基于第一中心点的三维位置信息和第二中心点的三维位置信息,从球体模型中,确定出第一中心点对应的第一球面点的三维位置信息和第二中心点对应的第二球面点的三维位置信息。S204B: Based on the three-dimensional position information of the first center point and the three-dimensional position information of the second center point, determine the three-dimensional position information of the first spherical point corresponding to the first center point and the second center point corresponding to the second center point from the sphere model The three-dimensional position information of the two spherical points.
S205B:基于第一球面点的三维位置信息和第二球面点的三维位置信息,确定第一球面点和第二球面点之间的距离,作为人眼的上下眼睑之间的当前开闭长度。S205B: Based on the three-dimensional position information of the first spherical point and the three-dimensional position information of the second spherical point, determine the distance between the first spherical point and the second spherical point as the current opening and closing length between the upper and lower eyelids of the human eye.
本实施例中,鉴于对人眼的眼球的实际形状的考虑,为了更加提高所确定的人眼的上下眼睑之间 的开闭长度的准确性,可以首先从目标三维人脸模型中,确定出人眼对应的人眼空间点,例如:表征眼球的眼球空间点;基于目标三维人脸模型中的人眼空间点的三维位置信息,进行球面拟合,得到表征人眼的球体模型。进而,基于第一中心点的三维位置信息和第二中心点的三维位置信息,从球体模型中,确定出第一中心点对应的第一球面点的三维位置信息和第二中心点对应的第二球面点的三维位置信息,基于该第一球面点的的三维位置信息和第二球面点的三维位置信息,确定第一球面点和第二球面点之间的距离,作为人眼的上下眼睑之间的当前开闭长度。In this embodiment, in view of the consideration of the actual shape of the eyeball of the human eye, in order to further improve the accuracy of the determined opening and closing length between the upper and lower eyelids of the human eye, it is possible to first determine from the target three-dimensional face model Human eye space points corresponding to human eyes, for example: eyeball space points representing eyeballs; based on the three-dimensional position information of the eye space points in the target three-dimensional face model, spherical fitting is performed to obtain a spherical model representing human eyes. Furthermore, based on the three-dimensional position information of the first center point and the three-dimensional position information of the second center point, the three-dimensional position information of the first spherical point corresponding to the first center point and the second center point corresponding to the second center point are determined from the sphere model. The three-dimensional position information of the two spherical points, based on the three-dimensional position information of the first spherical point and the three-dimensional position information of the second spherical point, determine the distance between the first spherical point and the second spherical point as the upper and lower eyelids of the human eye The current opening and closing length between.
在一种情况中,上述基于第一中心点的三维位置信息和第二中心点的三维位置信息,从球体模型中,确定出第一中心点对应的第一球面点的三维位置信息和第二中心点对应的第二球面点的三维位置信息的过程,可以是:基于第一中心点的三维位置信息和像采集设备的光心的位置信息,作图像采集设备的光心和第一中心点之间的连线,将该连线与球体模型的两个交点中,距离第一中心点最近的交点,作为第一中心点对应的第一球面点,并基于球体模型确定出第一球面点的三维位置信息;基于第二中心点的三维位置信息和像采集设备的光心的位置信息,作图像采集设备的光心和第二中心点之间的连线,将该连线与球体模型的两个交点中,距离第二中心点最近的交点,作为第二中心点对应的第二球面点,并基于球体模型确定出第二球面点的三维位置信息。In one case, based on the three-dimensional position information of the first center point and the three-dimensional position information of the second center point, the three-dimensional position information of the first spherical point corresponding to the first center point and the second center point are determined from the sphere model. The process of the three-dimensional position information of the second spherical point corresponding to the center point may be: based on the three-dimensional position information of the first center point and the position information of the optical center of the image acquisition device, the optical center and the first center point of the image acquisition device The line between the line and the two intersection points of the sphere model, the intersection point closest to the first center point is taken as the first sphere point corresponding to the first center point, and the first sphere point is determined based on the sphere model The three-dimensional position information; based on the three-dimensional position information of the second center point and the position information of the optical center of the image acquisition device, make the connection between the optical center of the image acquisition device and the second center point, and connect the connection with the sphere model Among the two intersection points, the intersection point closest to the second center point is used as the second spherical point corresponding to the second center point, and the three-dimensional position information of the second spherical point is determined based on the sphere model.
本实施例中,将目标三维人脸模型中人眼的空间点进行球面拟合,得到表征人眼的球体模型,使得所得到的人眼的形状更接近于真实人眼的形状,进而基于球体模型中第一球面点的三维位置信息和第二球面点的三维位置信息,可以所确定出准确性更高的人眼的上下眼睑之间的开闭长度。In this embodiment, the spatial points of the human eye in the target three-dimensional face model are spherically fitted to obtain a sphere model that characterizes the human eye, so that the obtained human eye shape is closer to the shape of the real human eye, and is based on the sphere. The three-dimensional position information of the first spherical point and the three-dimensional position information of the second spherical point in the model can determine the opening and closing length between the upper and lower eyelids of the human eye with higher accuracy.
在本发明的另一实施例中,所述S105,可以包括:In another embodiment of the present invention, the S105 may include:
获得在预设时长内所确定出的目标人员的人眼的历史开闭长度;Obtain the historical opening and closing length of the human eye of the target person determined within the preset time period;
基于当前开闭长度以及历史开闭长度,确定出目标人员的当前疲劳程度。Based on the current opening and closing length and the historical opening and closing length, the current fatigue level of the target person is determined.
本实施例中,在确定目标人员的人眼的上下眼睑之间的当前开闭长度之后,可以结合时间维度信息,即该人眼的历史开闭长度,确定目标人员的当前疲劳程度。In this embodiment, after determining the current opening and closing length between the upper and lower eyelids of the human eye of the target person, the time dimension information, that is, the historical opening and closing length of the human eye, can be combined to determine the current fatigue degree of the target person.
其中,为了保证所确定出的目标人员的疲劳程度的及时性,电子设备可以获得图像采集设备针对目标人员进行拍摄时,在当前时刻采集到的包含目标人员的面部的人脸图像。该预设时长可以是用户预先设置的时长,也可以是电子设备自主设置的时长,都是可以的。其中,在预设时长内所确定出的目标人员的人眼的历史开闭长度可以包括:当前时刻向前的预设时长内所确定出的目标人员的人眼的历史开闭长度,即与当前时刻最近的预设时长内所确定出的目标人员的人眼的历史开闭长度。Wherein, in order to ensure the timeliness of the determined fatigue degree of the target person, the electronic device can obtain the face image containing the face of the target person collected at the current moment when the image capture device is shooting the target person. The preset time length may be a time length preset by the user, or a time length independently set by the electronic device, both of which are possible. Wherein, the historical opening and closing length of the eyes of the target person determined within the preset time period may include: the historical opening and closing length of the eyes of the target person determined within the preset time period ahead of the current moment, that is, The historical opening and closing length of the human eye of the target person determined within the latest preset time period at the current moment.
一种情况中,电子设备本地或所连接的存储设备中,可以存储有目标人员的人眼的历史开闭长度,在计算得到人眼的当前开闭长度之后,电子设备可以从相应的存储位置处获得目标人员的人眼的历史开闭长度。其中,目标人员的人眼的历史开闭长度为:基于该图像采集设备针对目标人员进行拍摄时,所采集到的该人脸图像之前的人脸图像确定的。该目标人员的人眼的历史开闭长度的确定过程,与确定目标人员的人眼的当前开闭长度的确定过程相似,在此不再赘述。In one case, the electronic device can store the historical opening and closing length of the human eye of the target person locally or in the storage device connected to it. After calculating the current opening and closing length of the human eye, the electronic device can download the corresponding storage location Obtain the historical opening and closing length of the target person’s eye. Wherein, the historical opening and closing length of the human eye of the target person is determined based on the face image before the face image collected when the image acquisition device shoots the target person. The process of determining the historical opening and closing length of the target person's eyes is similar to the process of determining the current opening and closing length of the target person's eyes, and will not be repeated here.
本发明实施例中,通过目标三维人脸模型,可以确定出更加准确的人眼的开闭长度,即人眼开闭的物理长度,进而,结合时间维度,可以更加灵活、准确地监控得到目标人员的疲劳程度。In the embodiment of the present invention, through the target three-dimensional face model, a more accurate opening and closing length of the human eye can be determined, that is, the physical length of the opening and closing of the human eye. Furthermore, combined with the time dimension, the target can be monitored more flexibly and accurately. The fatigue of the personnel.
在本发明的另一实施例中,所述基于当前开闭长度以及历史开闭长度,确定目标人员的当前疲劳程度的步骤,可以包括:In another embodiment of the present invention, the step of determining the current fatigue degree of the target person based on the current opening and closing length and the historical opening and closing length may include:
将每一开闭长度与预设长度阈值进行比较,获得比较结果,其中,开闭长度包括所述当前开闭长度以及所述历史开闭长度;Comparing each opening and closing length with a preset length threshold to obtain a comparison result, where the opening and closing length includes the current opening and closing length and the historical opening and closing length;
统计得到表征开闭长度小于预设长度阈值的比较结果的第一结果数量;Count the number of first results that characterize the comparison results whose opening and closing length is less than the preset length threshold;
基于当前开闭长度以及历史开闭长度的总数量和第一结果数量,确定目标人员的当前疲劳程度。Based on the current opening and closing length and the total number of historical opening and closing lengths and the first result number, the current fatigue level of the target person is determined.
本实施例中,电子设备可以获得预先设置的预设长度阈值,并将每一开闭长度,即当前开闭长度以及历史开闭长度分别与预设长度阈值进行比较,以比较每一开闭长度与预设长度阈值的大小,得到比较结果;进而,统计得到表征开闭长度小于预设长度阈值的比较结果的数量,作为第一结果数量;后续的,基于当前开闭长度以及历史开闭长度的总数量和第一结果数量,确定目标人员的当前疲劳程度。其中,该基于当前开闭长度以及历史开闭长度的总数量和第一结果数量,确定目标人员的当前疲劳程度的过程,可以是:计算第一结果数量和总数量的比值,若该比值大于预设比值,则确定目标人员的当前疲劳程度为疲劳;若该比值不大于预设比值,则确定目标人员的当前疲劳程度为不疲劳。也可以是:计算总数量和第一结果数量的差值,若该差值小于预设差值,则确定目标人员的当前疲劳程度为疲劳;若该差值不小于预设差值,则确定目标人员的当前疲劳程度为不疲劳。In this embodiment, the electronic device can obtain a preset length threshold set in advance, and compare each opening and closing length, that is, the current opening and closing length and the historical opening and closing length, with the preset length threshold, respectively, to compare each opening and closing length. The size of the length and the preset length threshold is used to obtain the comparison result; further, the number of comparison results indicating that the opening and closing length is less than the preset length threshold is obtained by statistics, as the first result quantity; subsequent, based on the current opening and closing length and historical opening and closing The total number of lengths and the number of first results determine the current fatigue level of the target person. Among them, the process of determining the current fatigue degree of the target person based on the current opening and closing length and the total number of historical opening and closing lengths and the number of first results may be: calculating the ratio of the number of first results to the total number, if the ratio is greater than The preset ratio determines that the current fatigue degree of the target person is fatigue; if the ratio is not greater than the preset ratio, the current fatigue degree of the target person is determined to be non-fatigue. It can also be: Calculate the difference between the total quantity and the first result quantity, if the difference is less than the preset difference, determine the current fatigue degree of the target person as fatigue; if the difference is not less than the preset difference, then determine The current fatigue level of the target person is not fatigued.
例如:在预设时长内所确定出的目标人员的人眼的历史开闭长度为99个;即当前开闭长度和历史 开闭长度共100个,若统计得到表征开闭长度小于预设长度阈值的比较结果的第一结果数量为80,此时,可以确定目标人员的当前疲劳程度为疲劳。For example: The historical opening and closing length of the human eye of the target person determined within the preset time is 99; that is, the current opening and closing length and the historical opening and closing length are 100. If the statistics show that the opening and closing length is less than the preset length The first result of the comparison result of the threshold is 80. At this time, it can be determined that the current fatigue degree of the target person is fatigue.
另一种实现方式中,在统计得到表征开闭长度小于预设长度阈值的比较结果的第一结果数量之后,可以直接将该第一数量与预设数量进行比较,若该第一结果数量大于该预设数量,则确定目标人员的当前疲劳程度为疲劳;若该第一结果数量不大于该预设数量,则确定目标人员的当前疲劳程度为不疲劳。In another implementation manner, after the number of first results indicating that the opening and closing length is less than the preset length threshold is obtained by statistics, the first number can be directly compared with the preset number, and if the number of first results is greater than The preset number determines that the current fatigue level of the target person is fatigue; if the first result number is not greater than the preset number, it is determined that the current fatigue level of the target person is not fatigued.
在本发明的另一实施例中,在所述基于当前开闭长度,确定目标人员的当前疲劳程度的步骤之后,所述方法还可以包括:In another embodiment of the present invention, after the step of determining the current fatigue degree of the target person based on the current opening and closing length, the method may further include:
若确定出目标人员的当前疲劳程度为疲劳,生成并发送告警信息。If it is determined that the current fatigue degree of the target person is fatigue, an alarm message is generated and sent.
本发明实施例中,若目标人员为驾驶员,为了在一定程度上减少因疲劳驾驶所导致的车祸的情况的发生,在确定出目标人员的疲劳程度为疲劳的情况下,可以生成告警信息,以提示用户该目标人员处于疲劳的状态,以便用户可以针对该种情况采取相应措施,以在一定程度上减少因疲劳驾驶所导致的车祸的情况的发生。In the embodiment of the present invention, if the target person is the driver, in order to reduce the occurrence of car accidents caused by fatigue driving to a certain extent, when the fatigue degree of the target person is determined to be fatigue, warning information can be generated, To remind the user that the target person is in a state of fatigue, so that the user can take corresponding measures for this situation, so as to reduce the occurrence of car accidents caused by fatigue driving to a certain extent.
另一种情况中,若目标人员为驾驶员,还可以提示驾驶员进入自动驾驶模式,或发出行驶模式控制信号,以控制车辆自动进入自动驾驶模式,以在一定程度上减少因疲劳驾驶所导致的车祸的情况的发生。In another case, if the target person is the driver, the driver can also be prompted to enter the automatic driving mode, or the driving mode control signal can be sent to control the vehicle to automatically enter the automatic driving mode, so as to reduce the fatigue caused by driving to a certain extent Of the car accident.
在本发明的另一实施例中,若目标人员为居家人员,可以生成并发送家居设备的家居控制信号,该家居控制信号可以是控制电视机的播放音量降低或关闭电视机;可以是:控制空调的当前设置温度在预设温度范围内,等等。In another embodiment of the present invention, if the target person is a householder, a household control signal of the household equipment can be generated and sent. The household control signal can be to control the playback volume of the TV to decrease or turn off the TV; it can be: control The current setting temperature of the air conditioner is within the preset temperature range, and so on.
相应于上述方法实施例,本发明实施例提供了一种基于人眼状态识别的疲劳检测装置,如图3所示,可以包括:Corresponding to the foregoing method embodiment, the embodiment of the present invention provides a fatigue detection device based on human eye state recognition, as shown in FIG. 3, which may include:
第一获得模块310,被配置为获得图像采集设备针对目标人员进行拍摄所采集到的包含所述目标人员的面部的人脸图像;The first obtaining module 310 is configured to obtain a face image containing the face of the target person collected by the image capturing device for shooting the target person;
检测模块320,被配置为对所述人脸图像进行检测,检测得到所述人脸图像中面部的面部特征点以及所述面部中人眼的上下眼睑的眼睑特征点,其中,所述面部特征点为:用于表征所述人脸图像中面部各个部位的特征点;The detection module 320 is configured to detect the face image, and detect facial feature points of the face in the face image and eyelid feature points of the upper and lower eyelids of the human eyes in the face, wherein the facial feature Points are: feature points used to characterize various parts of the face in the face image;
构建模块330,被配置为基于预设的三维人脸模型、所述面部特征点以及所述眼睑特征点,构建所述目标人员对应的目标三维人脸模型,其中,所述目标三维人脸模型包括:基于所述眼睑特征点构建的所述人眼的上下眼睑;The construction module 330 is configured to construct a target three-dimensional face model corresponding to the target person based on a preset three-dimensional face model, the facial feature points and the eyelid feature points, wherein the target three-dimensional face model Including: the upper and lower eyelids of the human eye constructed based on the eyelid feature points;
第一确定模块340,被配置为基于所述目标三维人脸模型中所述人眼的上下眼睑的三维位置信息,确定所述人眼的上下眼睑之间的当前开闭长度;The first determining module 340 is configured to determine the current opening and closing length between the upper and lower eyelids of the human eye based on the three-dimensional position information of the upper and lower eyelids of the human eye in the target three-dimensional face model;
第二确定模块350,被配置为基于所述当前开闭长度,确定出所述目标人员的当前疲劳程度。The second determining module 350 is configured to determine the current fatigue degree of the target person based on the current opening and closing length.
应用本发明实施例,可以基于包含目标人员的面部的人脸图像中的面部特征点和眼睑特征点和预设的三维人脸模型,构建出目标人员对应的包括目标人员的人眼的上下眼睑目标三维人脸模型,即构建出了目标人员的人眼的空间信息,基于该空间信息,可以确定出准确性更高的人眼的上下眼睑之间的空间距离,即人眼的开闭状态,进而,基于准确性更高的人眼的上下眼睑之间的空间距离,可以更加准确地确定出目标人员的当前疲劳程度。本发明实施例中不再仅依赖利用预先训练的人眼状态检测模型对二维图像中人眼的闭合状态的检测结果,实现度目标人员的疲劳程度的确定,避免了预先训练的人眼状态检测模型对图像中人眼的闭合状态和睁开状态的检测边界模糊,进而导致检测结果不够准确的情况的发生。实现确定出人眼的空间信息,进而提高人眼状态的检测结果的准确性,以及提高对目标人员的当前疲劳程度的检测结果的准确性。With the application of the embodiment of the present invention, the upper and lower eyelids of the target person’s eyes corresponding to the target person can be constructed based on the facial feature points and the eyelid feature points in the face image containing the target person’s face and the preset three-dimensional face model The target three-dimensional face model, which constructs the spatial information of the human eye of the target person. Based on this spatial information, the spatial distance between the upper and lower eyelids of the human eye can be determined with higher accuracy, that is, the open and closed state of the human eye Furthermore, based on the more accurate spatial distance between the upper and lower eyelids of the human eye, the current fatigue level of the target person can be determined more accurately. The embodiment of the present invention no longer only relies on the detection result of the closed state of the human eye in the two-dimensional image by using the pre-trained human eye state detection model to realize the determination of the fatigue degree of the target person and avoid the pre-trained eye state The detection model blurs the detection boundary between the closed state and the open state of the human eye in the image, which leads to the occurrence of insufficient detection results. It is possible to determine the spatial information of the human eye, thereby improving the accuracy of the detection result of the human eye state, and the accuracy of the detection result of the current fatigue degree of the target person.
在本发明的另一实施例中,所述检测模块320,包括:In another embodiment of the present invention, the detection module 320 includes:
第一检测单元,被配置为对所述人脸图像进行检测,检测得到所述人脸图像中面部的面部特征点;The first detection unit is configured to detect the face image, and detect facial feature points of the face in the face image;
确定截取单元,被配置为基于所述面部特征点,从所述人脸图像中确定并截取出所述面部中人眼所在区域,作为人眼图像;The determining and intercepting unit is configured to determine and intercept the area where the human eye in the face is located from the face image based on the facial feature point, as a human eye image;
第二检测单元,被配置为利用预设的眼睑特征点检测模型,从所述人眼图像中检测出所述人眼的上下眼睑的眼睑特征点,其中,所述预设的眼睑特征点检测模型为:基于标注有人眼的上下眼睑的眼睑特征点的样本图像训练所得的模型。The second detection unit is configured to use a preset eyelid feature point detection model to detect the eyelid feature points of the upper and lower eyelids of the human eye from the human eye image, wherein the preset eyelid feature point detection The model is a model trained based on sample images marked with feature points of the upper and lower eyelids of a human eye.
在本发明的另一实施例中,所述人眼图像包括左眼图像和右眼图像;所述装置还可以包括:In another embodiment of the present invention, the human eye image includes a left eye image and a right eye image; the apparatus may further include:
镜像模块(图中未示出),被配置为在所述利用预设的眼睑特征点检测模型,从所述人眼图像中 检测出所述人眼的上下眼睑的眼睑特征点之前,对第一图像进行镜像处理,得到镜像图像,其中,所述第一图像为所述左眼图像或所述右眼图像;The mirroring module (not shown in the figure) is configured to detect the eyelid feature points of the upper and lower eyelids of the human eye from the human eye image using the preset eyelid feature point detection model, Performing mirror image processing on an image to obtain a mirror image, wherein the first image is the left eye image or the right eye image;
拼接模块(图中未示出),被配置为对所述镜像图像以及所述人眼图像中未进行镜像处理的图像进行拼接,得到拼接图像;A splicing module (not shown in the figure), configured to splice the mirror image and the image that has not been mirrored in the human eye image to obtain a spliced image;
所述第二检测单元,被具体配置为:利用预设的眼睑特征点检测模型,从所述拼接图像中,检测出所述镜像图像中人眼的上下眼睑的眼睑特征点,以及所述未进行镜像处理的图像中人眼的上下眼睑的眼睑特征点;对所述镜像图像中人眼的上下眼睑的眼睑特征点进行镜像处理,得到镜像后的眼睑特征点,以得到所述人眼图像中的人眼的上下眼睑的眼睑特征点。The second detection unit is specifically configured to use a preset eyelid feature point detection model to detect the eyelid feature points of the upper and lower eyelids of the human eye in the mirror image from the stitched image, and the The eyelid feature points of the upper and lower eyelids of the human eye in the mirror image processed; the eyelid feature points of the upper and lower eyelids of the human eye in the mirror image are mirrored to obtain the eyelid feature points after the mirror image to obtain the human eye image The characteristic points of the upper and lower eyelids of the human eye.
在本发明的另一实施例中,所述检测模块320还可以包括:In another embodiment of the present invention, the detection module 320 may further include:
转正单元,被配置为在所述对第一图像进行镜像处理,得到镜像图像之前,对所述左眼图像和所述右眼图像进行转正处理,得到转正后的左眼图像和转正后的右眼图像,其中,所述转正处理为:使得待处理图像中的两个眼角点的连线与预设图像坐标系的坐标轴平行,所述待处理图像为所述左眼图像和所述右眼图像;The normalization unit is configured to perform normalization processing on the left-eye image and the right-eye image before the mirror image processing is performed on the first image to obtain the mirror image, to obtain a normalized left-eye image and a normalized right-eye image. Eye image, wherein the correction processing is: making the line of two eye corner points in the image to be processed parallel to the coordinate axis of the preset image coordinate system, and the image to be processed is the left eye image and the right eye image. Eye image
所述镜像单元,被具体配置为:对转正后的第一图像进行镜像处理,得到镜像图像。The mirroring unit is specifically configured to perform mirroring processing on the converted first image to obtain a mirrored image.
在本发明的另一实施例中,所述构建模块330,被具体配置为从所述预设的三维人脸模型中,确定出预设面部位置处的空间点的空间位置信息,作为待处理空间点的空间位置信息,其中,所述待处理空间点与图像特征点存在对应关系,所述图像特征点为:所述面部特征点和所述眼睑特征点;利用弱透视投影矩阵以及每一待处理空间点的空间位置信息,确定每一待处理空间点在所述人脸图像中的投影点的投影位置信息;基于每一待处理空间点的投影点的投影位置信息及每一待处理空间点对应的图像特征点的成像位置信息,确定每一待处理空间点及其对应的图像特征点的距离误差;判断所述距离误差是否小于预设误差;若小于,得到所述目标人员对应的目标三维人脸模型;若不小于,调整所述预设的三维人脸模型中待处理空间点的空间位置信息;返回执行所述利用弱透视投影矩阵以及每一待处理空间点的空间位置信息,确定每一待处理空间点在所述人脸图像中的投影点的投影位置信息。In another embodiment of the present invention, the construction module 330 is specifically configured to determine the spatial position information of the spatial point at the preset face position from the preset three-dimensional face model, as the to-be-processed The spatial position information of the spatial point, wherein the spatial point to be processed and the image feature point have a corresponding relationship, and the image feature point is: the facial feature point and the eyelid feature point; using a weak perspective projection matrix and each The spatial position information of the spatial point to be processed, the projection position information of the projection point of each spatial point to be processed in the face image is determined; the projection position information of the projection point of each spatial point to be processed and each to-be-processed The imaging position information of the image feature point corresponding to the spatial point is used to determine the distance error of each spatial point to be processed and its corresponding image feature point; to determine whether the distance error is less than the preset error; if it is less, the corresponding target person is obtained The target three-dimensional face model; if it is not smaller than, adjust the spatial position information of the spatial point to be processed in the preset three-dimensional face model; return to execute the use of the weak perspective projection matrix and the spatial position of each spatial point to be processed Information, determining the projection position information of the projection point of each spatial point to be processed in the face image.
在本发明的另一实施例中,所述第一确定模块340,被具体配置为:从所述目标三维人脸模型中,检测得到所述人眼的上眼睑的第一中心点的三维位置信息和下眼睑的第二中心点的三维位置信息;基于所述第一中心点的三维位置信息以及所述第二中心点的三维位置信息,确定所述第一中心点和所述第二中心点之间的距离,作为所述人眼的上下眼睑之间的当前开闭长度。In another embodiment of the present invention, the first determining module 340 is specifically configured to: detect the three-dimensional position of the first center point of the upper eyelid of the human eye from the target three-dimensional face model Information and the three-dimensional position information of the second center point of the lower eyelid; determine the first center point and the second center based on the three-dimensional position information of the first center point and the three-dimensional position information of the second center point The distance between the points is used as the current opening and closing length between the upper and lower eyelids of the human eye.
在本发明的另一实施例中,所述第一确定模块340,被具体配置为:从所述目标三维人脸模型中,确定出所述人眼对应的人眼空间点的三维位置信息;基于所述人眼空间点的三维位置信息,进行球面拟合,得到表征所述人眼的球体模型;从所述目标三维人脸模型中,检测得到所述人眼的上眼睑的第一中心点的三维位置信息和下眼睑的第二中心点的三维位置信息;基于所述第一中心点的三维位置信息和所述第二中心点的三维位置信息,从所述球体模型中,确定出所述第一中心点对应的第一球面点的三维位置信息和所述第二中心点对应的第二球面点的三维位置信息;基于所述第一球面点的三维位置信息和所述第二球面点的三维位置信息,确定所述第一球面点和第二球面点之间的距离,作为所述人眼的上下眼睑之间的当前开闭长度。In another embodiment of the present invention, the first determining module 340 is specifically configured to determine, from the target three-dimensional face model, the three-dimensional position information of the human eye spatial point corresponding to the human eye; Based on the three-dimensional position information of the human eye space point, perform spherical fitting to obtain a sphere model that characterizes the human eye; from the target three-dimensional face model, detect the first center of the upper eyelid of the human eye The three-dimensional position information of a point and the three-dimensional position information of the second center point of the lower eyelid; based on the three-dimensional position information of the first center point and the three-dimensional position information of the second center point, determine from the sphere model The three-dimensional position information of the first spherical point corresponding to the first center point and the three-dimensional position information of the second spherical point corresponding to the second center point; based on the three-dimensional position information of the first spherical point and the second The three-dimensional position information of the spherical point determines the distance between the first spherical point and the second spherical point as the current opening and closing length between the upper and lower eyelids of the human eye.
在本发明的另一实施例中,所述第二确定模块350,包括:In another embodiment of the present invention, the second determining module 350 includes:
获得单元,被配置为获得在预设时长内所确定出的所述目标人员的人眼的历史开闭长度;An obtaining unit configured to obtain the historical opening and closing length of the human eye of the target person determined within a preset time period;
确定单元,被配置为基于所述当前开闭长度以及所述历史开闭长度,确定出所述目标人员的当前疲劳程度。The determining unit is configured to determine the current fatigue degree of the target person based on the current opening and closing length and the historical opening and closing length.
在本发明的另一实施例中,所述确定单元,被具体配置为In another embodiment of the present invention, the determining unit is specifically configured to
将每一开闭长度与预设长度阈值进行比较,获得比较结果,其中,所述开闭长度包括所述当前开闭长度以及所述历史开闭长度;Comparing each opening and closing length with a preset length threshold to obtain a comparison result, where the opening and closing length includes the current opening and closing length and the historical opening and closing length;
统计得到表征开闭长度小于所述预设长度阈值的比较结果的第一结果数量;Statistically obtain the first result quantity representing the comparison result whose opening and closing length is less than the preset length threshold;
基于所述当前开闭长度以及所述历史开闭长度的总数量和所述第一结果数量,确定所述目标人员的当前疲劳程度。Based on the current opening and closing length and the total number of historical opening and closing lengths and the first result number, determine the current fatigue level of the target person.
在本发明的另一实施例中,所述装置还可以包括:In another embodiment of the present invention, the device may further include:
生成发送模块(图中未示出),被配置为在所述基于所述当前开闭长度,确定出所述目标人员的当前疲劳程度之后,若确定出所述目标人员的当前疲劳程度为疲劳,生成并发送告警信息。Generating a sending module (not shown in the figure), configured to determine the current fatigue level of the target person based on the current opening and closing length, if it is determined that the current fatigue level of the target person is fatigue , Generate and send alarm information.
上述装置实施例与方法实施例相对应,与该方法实施例具有同样的技术效果,具体说明参见方法实施例。装置实施例是基于方法实施例得到的,具体的说明可以参见方法实施例部分,此处不再赘述。The foregoing device embodiment corresponds to the method embodiment, and has the same technical effect as the method embodiment. For specific description, refer to the method embodiment. The device embodiment is obtained based on the method embodiment, and the specific description can be found in the method embodiment part, which will not be repeated here.
本领域普通技术人员可以理解:附图只是一个实施例的示意图,附图中的模块或流程并不一定是实施本发明所必须的。Those of ordinary skill in the art can understand that the drawings are only schematic diagrams of an embodiment, and the modules or processes in the drawings are not necessarily necessary for implementing the present invention.
本领域普通技术人员可以理解:实施例中的装置中的模块可以按照实施例描述分布于实施例的装置中,也可以进行相应变化位于不同于本实施例的一个或多个装置中。上述实施例的模块可以合并为一个模块,也可以进一步拆分成多个子模块。A person of ordinary skill in the art can understand that the modules in the device in the embodiment may be distributed in the device in the embodiment according to the description of the embodiment, or may be located in one or more devices different from this embodiment with corresponding changes. The modules of the above-mentioned embodiments can be combined into one module or further divided into multiple sub-modules.
最后应说明的是:以上实施例仅用以说明本发明的技术方案,而非对其限制;尽管参照前述实施例对本发明进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本发明实施例技术方案的精神和范围。Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: The technical solutions recorded in the foregoing embodiments are modified, or some of the technical features are equivalently replaced; these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims (10)

  1. 一种基于人眼状态识别的疲劳检测方法,其特征在于,包括:A fatigue detection method based on human eye state recognition, which is characterized in that it includes:
    获得图像采集设备针对目标人员进行拍摄所采集到的包含所述目标人员的面部的人脸图像;Obtaining a face image containing the face of the target person collected by the image capture device for shooting the target person;
    对所述人脸图像进行检测,检测得到所述人脸图像中面部的面部特征点以及所述面部中人眼的上下眼睑的眼睑特征点,其中,所述面部特征点为:用于表征所述人脸图像中面部各个部位的特征点;The face image is detected, and the facial feature points of the face in the face image and the eyelid feature points of the upper and lower eyelids of the human eyes in the face are detected, wherein the facial feature points are: Describe the feature points of each part of the face in the face image;
    基于预设的三维人脸模型、所述面部特征点以及所述眼睑特征点,构建所述目标人员对应的目标三维人脸模型,其中,所述目标三维人脸模型包括:基于所述眼睑特征点构建的所述人眼的上下眼睑;Based on the preset three-dimensional face model, the facial feature points, and the eyelid feature points, constructing a target three-dimensional face model corresponding to the target person, wherein the target three-dimensional face model includes: based on the eyelid feature The upper and lower eyelids of the human eye constructed by points;
    基于所述目标三维人脸模型中所述人眼的上下眼睑的三维位置信息,确定所述人眼的上下眼睑之间的当前开闭长度;Determining the current opening and closing length between the upper and lower eyelids of the human eye based on the three-dimensional position information of the upper and lower eyelids of the human eye in the target three-dimensional face model;
    基于所述当前开闭长度,确定出所述目标人员的当前疲劳程度。Based on the current opening and closing length, the current fatigue degree of the target person is determined.
  2. 如权利要求1所述的方法,其特征在于,所述对所述人脸图像进行检测,检测得到所述人脸图像中面部的面部特征点以及所述面部中人眼的上下眼睑的眼睑特征点的步骤,包括:The method according to claim 1, wherein the detection of the face image, the detection of facial feature points of the face in the face image and the eyelid features of the upper and lower eyelids of the human eye in the face The steps to point include:
    对所述人脸图像进行检测,检测得到所述人脸图像中面部的面部特征点;Detecting the face image, and detecting facial feature points of the face in the face image;
    基于所述面部特征点,从所述人脸图像中确定并截取出所述面部中人眼所在区域,作为人眼图像;Based on the facial feature points, determine and cut out the area where the human eyes in the face are located from the human face image, as a human eye image;
    利用预设的眼睑特征点检测模型,从所述人眼图像中检测出所述人眼的上下眼睑的眼睑特征点,其中,所述预设的眼睑特征点检测模型为:基于标注有人眼的上下眼睑的眼睑特征点的样本图像训练所得的模型。Using a preset eyelid feature point detection model, the eyelid feature points of the upper and lower eyelids of the human eye are detected from the human eye image, where the preset eyelid feature point detection model is: A model trained on sample images of the eyelid feature points of the upper and lower eyelids.
  3. 如权利要求2所述的方法,其特征在于,所述人眼图像包括左眼图像和右眼图像;3. The method according to claim 2, wherein the human eye image comprises a left eye image and a right eye image;
    在所述利用预设的眼睑特征点检测模型,从所述人眼图像中检测出所述人眼的上下眼睑的眼睑特征点的步骤之前,所述方法还包括:Before the step of using a preset eyelid feature point detection model to detect the eyelid feature points of the upper and lower eyelids of the human eye from the human eye image, the method further includes:
    对第一图像进行镜像处理,得到镜像图像,其中,所述第一图像为所述左眼图像或所述右眼图像;Performing mirror image processing on the first image to obtain a mirror image, wherein the first image is the left eye image or the right eye image;
    对所述镜像图像以及所述人眼图像中未进行镜像处理的图像进行拼接,得到拼接图像;Stitching the mirror image and the image that has not been mirrored in the human eye image to obtain a stitched image;
    所述利用预设的眼睑特征点检测模型,从所述人眼图像中检测出所述人眼的上下眼睑的眼睑特征点的步骤,包括:The step of using a preset eyelid feature point detection model to detect the eyelid feature points of the upper and lower eyelids of the human eye from the human eye image includes:
    利用预设的眼睑特征点检测模型,从所述拼接图像中,检测出所述镜像图像中人眼的上下眼睑的眼睑特征点,以及所述未进行镜像处理的图像中人眼的上下眼睑的眼睑特征点;Using a preset eyelid feature point detection model, from the stitched image, the eyelid feature points of the upper and lower eyelids of the human eye in the mirror image, and the upper and lower eyelids of the human eye in the image without mirror processing are detected. Eyelid feature points;
    对所述镜像图像中人眼的上下眼睑的眼睑特征点进行镜像处理,得到镜像后的眼睑特征点,以得到所述人眼图像中的人眼的上下眼睑的眼睑特征点。Mirror processing is performed on the eyelid feature points of the upper and lower eyelids of the human eye in the mirror image to obtain the eyelid feature points after mirroring, so as to obtain the eyelid feature points of the upper and lower eyelids of the human eye in the human eye image.
  4. 如权利要求3所述的方法,其特征在于,在所述对第一图像进行镜像处理,得到镜像图像的步骤之前,所述方法还包括:The method according to claim 3, wherein before the step of performing mirror image processing on the first image to obtain a mirror image, the method further comprises:
    对所述左眼图像和所述右眼图像进行转正处理,得到转正后的左眼图像和转正后的右眼图像,其中,所述转正处理为:使得待处理图像中的两个眼角点的连线与预设图像坐标系的坐标轴平行,所述待处理图像为所述左眼图像和所述右眼图像;The left-eye image and the right-eye image are subjected to normalization processing to obtain a corrected left-eye image and a normalized right-eye image, wherein the normalization processing is: making the two eye corner points in the image to be processed The line is parallel to the coordinate axis of the preset image coordinate system, and the image to be processed is the left-eye image and the right-eye image;
    所述对第一图像进行镜像处理,得到镜像图像的步骤,包括:The step of performing mirror image processing on the first image to obtain a mirror image includes:
    对转正后的第一图像进行镜像处理,得到镜像图像。Perform mirror image processing on the converted first image to obtain a mirror image.
  5. 如权利要求1所述的方法,其特征在于,所述基于预设的三维人脸模型、所述人脸特征点以及所述眼睑特征点,构建所述目标人员对应的目标三维人脸模型的步骤,包括:The method of claim 1, wherein the method of constructing a target three-dimensional face model corresponding to the target person is based on a preset three-dimensional face model, the face feature points, and the eyelid feature points The steps include:
    从所述预设的三维人脸模型中,确定出预设面部位置处的空间点的空间位置信息,作为待处理空间点的空间位置信息,其中,所述待处理空间点与图像特征点存在对应关系,所述图像特征点为:所述面部特征点和所述眼睑特征点;From the preset three-dimensional face model, the spatial position information of the spatial point at the preset face position is determined as the spatial position information of the spatial point to be processed, wherein the spatial point to be processed and the image feature point exist Corresponding relationship, the image feature points are: the facial feature points and the eyelid feature points;
    利用弱透视投影矩阵以及每一待处理空间点的空间位置信息,确定每一待处理空间点在所述人脸图像中的投影点的投影位置信息;Using the weak perspective projection matrix and the spatial position information of each spatial point to be processed to determine the projection position information of the projection point of each spatial point to be processed in the face image;
    基于每一待处理空间点的投影点的投影位置信息及每一待处理空间点对应的图像特征点的成像位置信息,构建所述目标人员对应的目标三维人脸模型。Based on the projection position information of the projection point of each spatial point to be processed and the imaging position information of the image feature point corresponding to each spatial point to be processed, a target three-dimensional face model corresponding to the target person is constructed.
  6. 如权利要求1-5任一项所述的方法,其特征在于,所述基于所述目标三维人脸模型中所述人眼的上下眼睑的三维位置信息,确定所述人眼的上下眼睑之间的当前开闭长度的步骤,通过以下两种实现方式中任一实现方式中实现:The method according to any one of claims 1 to 5, wherein the determination is based on the three-dimensional position information of the upper and lower eyelids of the human eye in the target three-dimensional face model. The steps of the current opening and closing length of the space are implemented in either of the following two implementations:
    第一种实现方式:The first way to achieve:
    从所述目标三维人脸模型中,检测得到所述人眼的上眼睑的第一中心点的三维位置信息和下眼睑 的第二中心点的三维位置信息;From the target three-dimensional face model, detecting the three-dimensional position information of the first center point of the upper eyelid and the three-dimensional position information of the second center point of the lower eyelid of the human eye;
    基于所述第一中心点的三维位置信息以及所述第二中心点的三维位置信息,确定所述第一中心点和所述第二中心点之间的距离,作为所述人眼的上下眼睑之间的当前开闭长度;Based on the three-dimensional position information of the first center point and the three-dimensional position information of the second center point, determine the distance between the first center point and the second center point as the upper and lower eyelids of the human eye The current opening and closing length between;
    第二种实现方式:The second way to achieve:
    从所述目标三维人脸模型中,确定出所述人眼对应的人眼空间点的三维位置信息;From the target three-dimensional face model, determine the three-dimensional position information of the human eye spatial point corresponding to the human eye;
    基于所述人眼空间点的三维位置信息,进行球面拟合,得到表征所述人眼的球体模型;Performing spherical fitting based on the three-dimensional position information of the human eye space point to obtain a sphere model representing the human eye;
    从所述目标三维人脸模型中,检测得到所述人眼的上眼睑的第一中心点的三维位置信息和下眼睑的第二中心点的三维位置信息;Detecting, from the target three-dimensional face model, the three-dimensional position information of the first center point of the upper eyelid and the three-dimensional position information of the second center point of the lower eyelid of the human eye;
    基于所述第一中心点的三维位置信息和所述第二中心点的三维位置信息,从所述球体模型中,确定出所述第一中心点对应的第一球面点的三维位置信息和所述第二中心点对应的第二球面点的三维位置信息;Based on the three-dimensional position information of the first center point and the three-dimensional position information of the second center point, from the sphere model, determine the three-dimensional position information and the three-dimensional position information of the first spherical point corresponding to the first center point. The three-dimensional position information of the second spherical point corresponding to the second center point;
    基于所述第一球面点的三维位置信息和所述第二球面点的三维位置信息,确定所述第一球面点和第二球面点之间的距离,作为所述人眼的上下眼睑之间的当前开闭长度。Based on the three-dimensional position information of the first spherical point and the three-dimensional position information of the second spherical point, determine the distance between the first spherical point and the second spherical point as the distance between the upper and lower eyelids of the human eye The current opening and closing length.
  7. 如权利要求1-5任一项所述的方法,其特征在于,所述基于所述当前开闭长度,确定出所述目标人员的当前疲劳程度的步骤,包括:The method according to any one of claims 1 to 5, wherein the step of determining the current fatigue degree of the target person based on the current opening and closing length comprises:
    获得在预设时长内所确定出的所述目标人员的人眼的历史开闭长度;Obtaining the historical opening and closing length of the human eye of the target person determined within a preset time period;
    基于所述当前开闭长度以及所述历史开闭长度,确定出所述目标人员的当前疲劳程度。Based on the current opening and closing length and the historical opening and closing length, the current fatigue degree of the target person is determined.
  8. 如权利要求7所述的方法,其特征在于,所述基于所述当前开闭长度以及所述历史开闭长度,确定出所述目标人员的当前疲劳程度的步骤,包括:8. The method of claim 7, wherein the step of determining the current fatigue level of the target person based on the current opening and closing length and the historical opening and closing length comprises:
    将每一开闭长度与预设长度阈值进行比较,获得比较结果,其中,所述开闭长度包括所述当前开闭长度以及所述历史开闭长度;Comparing each opening and closing length with a preset length threshold to obtain a comparison result, where the opening and closing length includes the current opening and closing length and the historical opening and closing length;
    统计得到表征开闭长度小于所述预设长度阈值的比较结果的第一结果数量;Statistically obtain the first result quantity representing the comparison result whose opening and closing length is less than the preset length threshold;
    基于所述当前开闭长度以及所述历史开闭长度的总数量和所述第一结果数量,确定所述目标人员的当前疲劳程度。Based on the current opening and closing length and the total number of historical opening and closing lengths and the first result number, determine the current fatigue level of the target person.
  9. 如权利要求1-8任一项所述的方法,其特征在于,在所述基于所述当前开闭长度,确定出所述目标人员的当前疲劳程度的步骤之后,所述方法还包括:8. The method according to any one of claims 1-8, wherein after the step of determining the current fatigue level of the target person based on the current opening and closing length, the method further comprises:
    若确定出所述目标人员的当前疲劳程度为疲劳,生成并发送告警信息。If it is determined that the current fatigue degree of the target person is fatigue, an alarm message is generated and sent.
  10. 一种基于人眼状态识别的疲劳检测装置,其特征在于,包括:A fatigue detection device based on human eye state recognition, characterized in that it comprises:
    第一获得模块,被配置为获得图像采集设备针对目标人员进行拍摄所采集到的包含所述目标人员的面部的人脸图像;The first obtaining module is configured to obtain a face image containing the face of the target person collected by the image capture device for shooting the target person;
    检测模块,被配置为对所述人脸图像进行检测,检测得到所述人脸图像中面部的面部特征点以及所述面部中人眼的上下眼睑的眼睑特征点,其中,所述面部特征点为:用于表征所述人脸图像中面部各个部位的特征点;The detection module is configured to detect the face image, and detect the facial feature points of the face in the face image and the eyelid feature points of the upper and lower eyelids of the human eyes in the face, wherein the facial feature points Is: used to characterize the feature points of each part of the face in the face image;
    构建模块,被配置为基于预设的三维人脸模型、所述面部特征点以及所述眼睑特征点,构建所述目标人员对应的目标三维人脸模型,其中,所述目标三维人脸模型包括:基于所述眼睑特征点构建的所述人眼的上下眼睑;The construction module is configured to construct a target three-dimensional face model corresponding to the target person based on a preset three-dimensional face model, the facial feature points and the eyelid feature points, wherein the target three-dimensional face model includes : The upper and lower eyelids of the human eye constructed based on the eyelid feature points;
    第一确定模块,被配置为基于所述目标三维人脸模型中所述人眼的上下眼睑的三维位置信息,确定所述人眼的上下眼睑之间的当前开闭长度;A first determining module configured to determine the current opening and closing length between the upper and lower eyelids of the human eye based on the three-dimensional position information of the upper and lower eyelids of the human eye in the target three-dimensional face model;
    第二确定模块,被配置为基于所述当前开闭长度,确定出所述目标人员的当前疲劳程度。The second determining module is configured to determine the current fatigue degree of the target person based on the current opening and closing length.
PCT/CN2019/108073 2019-05-29 2019-09-26 Fatigue detection method and device based on human eye state identification WO2020237940A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910456538.6 2019-05-29
CN201910456538.6A CN110956068B (en) 2019-05-29 2019-05-29 Fatigue detection method and device based on human eye state recognition

Publications (1)

Publication Number Publication Date
WO2020237940A1 true WO2020237940A1 (en) 2020-12-03

Family

ID=69975513

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/108073 WO2020237940A1 (en) 2019-05-29 2019-09-26 Fatigue detection method and device based on human eye state identification

Country Status (2)

Country Link
CN (1) CN110956068B (en)
WO (1) WO2020237940A1 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112220450B (en) * 2020-08-21 2023-08-15 上海交通大学医学院附属第九人民医院 Orbital disease screening method, system and terminal based on three-dimensional model
CN113747057B (en) * 2021-07-26 2022-09-30 荣耀终端有限公司 Image processing method, electronic equipment, chip system and storage medium
CN113591682A (en) * 2021-07-28 2021-11-02 地平线(上海)人工智能技术有限公司 Fatigue state detection method, fatigue state detection device, readable storage medium and electronic equipment

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108135469A (en) * 2015-08-21 2018-06-08 奇跃公司 Estimated using the eyelid shape of eyes attitude measurement
CN108460345A (en) * 2018-02-08 2018-08-28 电子科技大学 A kind of facial fatigue detection method based on face key point location
CN109496309A (en) * 2018-08-07 2019-03-19 深圳市汇顶科技股份有限公司 Detection method, device and the equipment of fatigue state
CN109643366A (en) * 2016-07-21 2019-04-16 戈斯蒂冈有限责任公司 For monitoring the method and system of the situation of vehicle driver

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102073857A (en) * 2011-01-24 2011-05-25 沈阳工业大学 Multimodal driver fatigue detection method and special equipment thereof

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108135469A (en) * 2015-08-21 2018-06-08 奇跃公司 Estimated using the eyelid shape of eyes attitude measurement
CN109643366A (en) * 2016-07-21 2019-04-16 戈斯蒂冈有限责任公司 For monitoring the method and system of the situation of vehicle driver
CN108460345A (en) * 2018-02-08 2018-08-28 电子科技大学 A kind of facial fatigue detection method based on face key point location
CN109496309A (en) * 2018-08-07 2019-03-19 深圳市汇顶科技股份有限公司 Detection method, device and the equipment of fatigue state

Also Published As

Publication number Publication date
CN110956068B (en) 2022-06-10
CN110956068A (en) 2020-04-03

Similar Documents

Publication Publication Date Title
CN108427503B (en) Human eye tracking method and human eye tracking device
WO2020237940A1 (en) Fatigue detection method and device based on human eye state identification
CN109690553A (en) The system and method for executing eye gaze tracking
CN106529409B (en) A kind of eye gaze visual angle measuring method based on head pose
US11068704B2 (en) Head pose and distraction estimation
JP6973258B2 (en) Image analyzers, methods and programs
JP2020509441A5 (en)
EP3154407B1 (en) A gaze estimation method and apparatus
WO2018218839A1 (en) Living body recognition method and system
JP2016173313A (en) Visual line direction estimation system, visual line direction estimation method and visual line direction estimation program
WO2019010959A1 (en) Method and device for determining sight line, and computer readable storage medium
US20140062704A1 (en) Sleepiness-estimating device and sleepiness-estimating method
KR20130054636A (en) Device and method for monitoring a driver's posture using infrared light camera and 3d modeling
CN111854620B (en) Monocular camera-based actual pupil distance measuring method, device and equipment
JP2021531601A (en) Neural network training, line-of-sight detection methods and devices, and electronic devices
CN111860292A (en) Monocular camera-based human eye positioning method, device and equipment
CN109711239B (en) Visual attention detection method based on improved mixed increment dynamic Bayesian network
CN114894337A (en) Temperature measurement method and device for outdoor face recognition
CN114022514A (en) Real-time sight line inference method integrating head posture and eyeball tracking
WO2020237941A1 (en) Personnel state detection method and apparatus based on eyelid feature information
CN112084820B (en) Personnel state detection method and device based on head information
CN117392644A (en) Fatigue detection method and system based on machine vision
CN112036217B (en) Person state detection method and device based on mouth information
CN112084821B (en) Personnel state detection method and device based on multi-face information
KR102199809B1 (en) Method and device for controlling vehicle seats based on upper body image

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 19930347

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19930347

Country of ref document: EP

Kind code of ref document: A1

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205 DATED 25.01.2022)