The present invention relates to an eyelid detection device, eyelid detection method and program, and more particularly to an eyelid detection device for detecting eyelids from an image of eyes, and an eyelid detection method and program for detecting eyelids from an image of eyes.
In recent years, the incidence of traffic accidents has remained at a high level. There are various factors in accidents, and one of the factors that leads to accidents is a driver operating a vehicle when in a state of reduced wakefulness, such as falling asleep at the wheel. Hence, various technologies have been proposed for detecting with good precision movement of the eyelids as an indicator when determining the wakefulness of the driver (for example, see Patent Literature 1 and 2).
Patent Literature 1: Unexamined Japanese Patent Application Kokai Publication No. 2009-125518
Patent Literature 2: Unexamined Japanese Patent Application Kokai Publication No. H9-230436
The device disclosed in Patent Literature 1 generates a difference image from photographs of a driver's face. Furthermore, this device determines that the driver is blinking when there is an afterimage of the eyelids in the difference image. However, when the driver's entire face moves, there are cases when an afterimage of the eyelids appears despite the fact that the eyelids are not moving. In this kind of case, with the device disclosed in Patent Literature 1 it is thought to be difficult to accurately determine whether or not the driver is blinking.
The device disclosed in Patent Literature 2 determines whether or not the driver is blinking using the fact that the strength of reflected light reflected by the driver's eyes changes between when the eyes are open and when the eyes are closed. However, when the strength of light incident on the driver's eyes changes accompanying changes in the environment surrounding the driver, the strength of reflected light changes regardless of blinking occurring or not. In this kind of case, with the device disclosed in Patent Literature 2 it is considered difficult to accurately determine whether or not the driver is blinking.
In consideration of the foregoing, it is an objective of the present invention to accurately detect the driver's eyelids.
In order to achieve the above objective, the eyelid detection device according to a first aspect of the present invention comprises:
The eyelid detection method according to a second aspect of the present invention includes:
The program according to a third aspect of the present invention causes a computer to execute:
With the present invention, candidates for the edges of the eyelids are extracted and paired from among edges detected from an image of the driver's face. Furthermore, pairs of edges of the driver's eyelids are detected based on changes with time in the distance between the paired edges. Consequently, even if the driver momentarily moves his or her face or the surrounding environment temporarily changes, by observing for a fixed period the change with time, it is possible to accurately detect the edges of the driver's eyelids. As a result, it is possible to accurately determine how awake the driver is.
Below, a first preferred embodiment of the present invention is described with reference to the drawings.
The photography device 30 is a device for converting images acquired by photographing a subject into electrical signals and outputting these signals. The photography device 30 is for example mounted on the steering column or attached to the steering wheel.
For convenience in explaining, an XY coordinate system is defined with the lower left corner of the image IM as the origin, and the explanation below will use the XY coordinate system as appropriate.
Returning to
The CPU 21 reads and executes programs stored in the auxiliary memory 23. Specific operations of the CPU 21 are described below.
The main memory 22 comprises volatile memory such as RAM (Random Access Memory) and/or the like. The main memory 22 is used as a work area for the CPU 21.
The auxiliary memory 23 comprises non-volatile memory such as ROM (Read Only Memory), a magnetic disk, semiconductor memory and/or the like. The auxiliary memory 23 stores programs executed by the CPU 21 and various types of parameters. In addition, the auxiliary memory 23 successively stores information related to images output from the photography device 30 and information including process results from the CPU 21.
The display 24 comprises a display unit such as an LCD (Liquid Crystal Display) and/or the like. The display 24 displays process results from the CPU 21, and/or the like.
The input device 25 comprises input keys and a pointing device such as a touch panel and/or the like. Instructions from an operator are input via the input device 25 and are communicated to the CPU 21 via a system bus 27.
The interface 26 is composed so as to include a serial interface or a LAN (Local Area Network) interface, and/or the like. The photography device 30 is connected to the system bus 27 via the interface 26.
The flowchart in
First, in step S201, the CPU 21 resets to zero the counter value N of a built-in counter.
In the ensuing step S202, the CPU 21 increments the counter value N.
In the ensuing step S203, the CPU 21 acquires image information of images IMN successively accumulated in the auxiliary memory 23 and detects edges in these images IMN. Detection of the edges is accomplished through execution of image processing using a Sobel filter on the images IMN.
Specifically, the CPU 21 first computes respective edge values for each pixel comprising the image IMN using the horizontal edge detection operator shown in
Next, the CPU 21 computes the edge value of each pixel comprising the image IMN, using the vertical edge detection operator shown in
The pixels extracted by the CPU 21 in the above-described manner comprise edges 60A and 60B indicated by the broken lines and solid lines in
In the ensuing step S204, the CPU 21 accomplishes detection of consecutive edges. Specifically, the CPU 21 groups pixels that are mutually adjacent and have edge values whose positive and negative polarities are equal, out of the pixels extracted in step S203. Through this, multiple pixel groups each composed of multiple pixels are stipulated. Next, the CPU 21 detects, as consecutive edges, groups whose length in the horizontal direction (X-axis direction) is at least as great as a threshold value, from among the multiple pixel groups.
For example, the edge 60A5 shown in
In the ensuing step S205, the CPU 21 computes the centroid and length of each of the edges 60A and 60B.
For example, as can be seen by referring to
AX
1=(X1+X2)/2 (1)
Similarly, the CPU 21 when finding the centroid of the edge 60B1 computes the X-coordinate BX1 of the centroid SB1 by performing the computation indicated by equation (2) below, using the X-coordinates X3 and X4 of the points D3 and D4 at the two ends of the edge 60B1. Furthermore, the CPU 21 computes, as the centroid SB1, the point on the edge 60B1 having BX1 as the X-coordinate.
BX
1=(X3+X4)/2 (2)
In addition, it is possible to find the lengths of the edges 60A and 60B for example by computing the lengths of curves fitted to the edges 60A and 60B.
In the ensuing step S206, the CPU 21 accomplishes edge pairing. Although there is some difference between individuals in the size of the eyelids, it is possible to roughly predict the size thereof. Hence, the CPU 21 extracts candidates for eyelid edges based on the size in the X-axis direction (width) of the edges 60A and 60B. Through this, extremely long edges and extremely short edges are excluded from candidates for eyelid edges.
Next, the CPU 21 extracts combinations of edges 60A and 60B such that the difference between centroid positions in the horizontal direction for the edge 60A and the edge 60B is not greater than a reference value and the distance between the centroid SA of the edge 60A and the centroid SB of the edge 60B is not greater than a reference value.
For example, as can be seen by referring to
The CPU 21 accomplishes pairing of the edges 60A, and the edges 60B1 by accomplishing the above-described process for each edge 60Ai and each edge 60Bj. Through this, as can be seen by referring to
The edge 60A1 is the edge on the top side of the right eyebrow of the driver 50, and the edge 60B1 is the edge on the lower side of the right eyebrow. The edge 60A2 is the edge on the top side of the left eyebrow of the driver 50, and the edge 60B2 is the edge on the lower side of the left eyebrow. The edge 60A3 is the edge of the top eyelid of the right eye of the driver 50, and the edge 60B3 is the edge of the lower eyelid of the right eye. The edge 60A4 is the edge of the top eyelid of the left eye of the driver 50, and the edge 60B4 is the edge of the lower eyelid of the left eye. The edge 60A5 is the edge on the top side of the upper lip of the driver 50, and the edge 60B5 is the edge on the lower side of the lower lip.
In addition, the CPU 21 stores the distances dij between the respectively paired edges 60Ai and 60Bj, linked with the time tN at which the image IMN was shot, as data DijN (dij, tN) in the auxiliary memory 23. Through this, the data DijN (dij, tN) is stored chronologically.
In the ensuing step S207, the CPU 21 determines whether or not the counter value N is at least 20. When the determination in step S207 is negative (step S207: No), the CPU 21 returns to step S202. Following this, the CPU 21 repeatedly executes the processes from step S202 through step S207. Through this, the processes of detecting the edges and pairing the edges are accomplished for respective images IM1 to IM20. Furthermore, the data DijN (dij, tN) is stored chronologically in the auxiliary memory 23.
With this preferred embodiment, image information related to four images IM are output to the computation device 20 each second. Consequently, this data Dij1 (dij, t1) to Dij20 (dij, t20) is data from when the driver 50 was observed for around 5 seconds.
On the other hand, when the determination in step S207 is affirmative (step S207: Yes), the CPU 21 moves to step S208.
In step S208, the CPU 21 detects the pair that is the edge of the upper eyelid and the edge of the lower eyelid, from among the edges that were paired. Specifically, the CPU 21 detects the pair that is the edge of the upper eyelid and the edge of the lower eyelid by accomplishing the below-described first process, second process, third process and fourth process.
For example,
As shown in
Furthermore, when the data DijN (dij, tN) is data corresponding to the edge of the upper eyelid and the edge of the lower eyelid, the number M1 of data items DijN (dij, tN) having a distance dij at least as great as the threshold value th1 is dominant over the number of data items DijN (dij, tN) having a distance dij smaller than the threshold value th1.
(First Process)
Here, the CPU 21 reads the data DijN (dij, tN) from the auxiliary memory 23. Then, the CPU 21 accomplishes the computation shown in equation (3) below, using the minimum value dMIN and the maximum value dMAX of the distances dij, from among the data DijN (dij, tN) that was read, and calculates the threshold value th (th1, th2, th3).
th=d
MIN+((dMAX−dMIN)/3) (3)
Then, the CPU 21 counts the number M (M1, M2) of data items DijN (dij, tN) having a distance dij at least as great as the threshold value th. Then, when the value of M is smaller than a reference value, the CPU 21 excludes the pair of edges corresponding to the data DijN (dij, tN) that was read from candidates for the edge of the upper eyelid and the edge of the lower eyelid.
For example, as shown in
(Second Process)
As can be seen by referring to
For example, as shown in
(Third Process)
As shown in
For example, as can be seen by referring to
(Fourth Process)
The distance d when the driver 50 has his or her eyes open converges to a roughly constant value (here, 9), as scan be seen by referring to
For example, the CPU 21 computes the variance vr of the data DijN (dij, tN) corresponding to the points indicated by the filled-in dots in
When the first through fourth processes are executed by the CPU 21, the pairs of edges of the eyebrows, the pair of edges of the lips and/or the like are excluded. Through this, only the data DijN (dij, tN) corresponding to the edges 60A3 and 60A4 of the upper eyelids and the edges 60B3 and 60B4 of the lower eyelids as shown in
When detection of the pairs of edges of the eyelids of the driver 50 concludes, the CPU 21 concludes the series of processes. Following this, the CPU 21 observes the pair of edges 60A3 and 60B3 and the pair of edges 60A4 and 60B4 included in the image IM output from the photography device 30 as the edges of the eyelids of both eyes. Then the CPU 21 samples the frequency and intervals of blinking by the driver 50. When for example the distance d33 between the edge 60A3 and the edge 60B3 or the distance d44 between the edge 60A4 and the edge 60B4 becomes smaller than a prescribed threshold value and then becomes a constant size, the CPU 21 determines that the driver 50 has blinked.
The CPU 21 outputs the blink sampling results for example to an external device and/or the like. Through this, it is possible to observe the wakefulness and/or the like of the driver 50 driving the vehicle.
As explained above, with this first preferred embodiment, distances d between edges detected and paired from the image IM are successively computed. Then, low-probability candidates for pairs of edges of the eyelids are excluded based on changes in the computed distance d. The pairs of edges ultimately remaining as a result of this exclusion are detected as pairs of edges of the upper eyelids and lower eyelids. Consequently, detection taking into consideration not only a feature that is near to an eyelid edge but also movement as an eyelid is accomplished. Accordingly, it is possible to accurately detect the edges of the eyelids of the driver 50.
Specifically, for example as shown in
In addition, for example as shown in
In addition, for example as shown in
In addition, when the variance vr of the data DijN (dij, tN) corresponding to the filled-in dots in
Next, a second preferred embodiment of the present invention is described with reference to the drawings. The same reference signs are used for compositions that are the same as or similar to the first preferred embodiment, and explanation of such is omitted or abbreviated.
An eyelid detection device 10A according to this preferred embodiment is different from the eyelid detection device 10 according to the first preferred embodiment in that the computation device 20 comprises hardware for executing a series of processes. As shown in
The memory 20a successively records information related to images output from the photography device 30 and information including process results from the above-described components 20b-20f.
The edge detector 20b acquires image information for images IMN successively accumulated in the memory 20a and detects edges in the images IMN. This edge detection is accomplished by executing an image process using a Sobel filter on the images IM.
The consecutive edge detector 20c accomplishes detection of consecutive edges. Specifically, the consecutive edge detector 20c groups pixels that are mutually adjacent and have the same polarity in edge values, out of the pixels extracted by the edge detector 20b. Through this, multiple pixel groups are stipulated, each composed of multiple pixels. Next, the consecutive edge detector 20c detects as consecutive edges groups whose length in the horizontal direction (X-axis direction) is at least as great as a threshold value, from among the multiple pixel groups. Through this, the edges 60A and 60B indicated by the broken lines and solid lines in
The calculator 20d calculates the centroids SA and SB and the lengths of the edges 60A and 60B, respectively.
The pairer 20e accomplishes pairing of the edges. Eyelid sizes differ from individual to individual, but it is possible to roughly predict the size thereof. Hence, the pairer 20e extracts candidates for the edges of the eyelids based on the sizes (widths) of the edges 60Ai and 60Bj in the X-axis direction. Next, the pairer 20e extracts pairs of edges 60Ai and 60Bj for which the difference in the centroid positions of the edge 60Ai and the edge 60Bj in the horizontal direction is not greater than a reference value and for which the distance between the centroid SAi of the edge 60Ai and the centroid SBj of the edge 60Bj is not greater than a reference value.
In addition, the pairer 20e stores the distances dij between the paired edges 60Ai and 60Bj linked with the time tN when the image IMN was shot in the auxiliary memory 23 as data DijN (dij, tN). Through this, the data DijN (dij, tN) is preserved chronologically.
The detector 20f detects the pairs of edges of the upper eyelids and the lower eyelids from the paired edges. Specifically, the detector 20f detects the pairs of upper eyelid edges and lower eyelid edges by accomplishing the above-described first process, second process, third process and fourth process. Then, the detector 20f outputs the detection results for example to an external device and/or the like.
As described above, with this second preferred embodiment, distances d between paired edges detected from the image IM are successively calculated. Then, low-probability candidates for pairs of eyelid edges are excluded based on changes in the calculated distances. Pairs of edges ultimately remaining as the exclusion result are detected as pairs of upper eyelid edges and lower eyelid edges. Consequently, detection is accomplished not just based on a feature which is near to an eyelid edge but also taking into consideration movement as an eyelid. Accordingly, it is possible to accurately detect the edges of the eyelids of the driver 50.
The explanation above was for preferred embodiments of the present invention, but the present invention is not limited by the above-described preferred embodiments.
For example, in the above-described preferred embodiments, the photography device 30 was assumed to output image information related to four images per second. This is intended to be illustrative and not limiting, for it would be fine for the photography device 30 to output image information related to a number of images equal to the frame rate, and for the computation device 20 to accomplish the processes for detecting pairs of eyelid edges based on the chronological data of all image information input in 20 seconds.
In the above-described preferred embodiment, the threshold value th was calculated based on the above-described equation (3). This is one example of the computation equation, and it would be fine to calculate the threshold value th using another equation.
It is possible to realize the functions of the computation device 20 according to the above-described preferred embodiments through specialized hardware and also through a regular computer system.
It would be fine for the programs stored in the auxiliary memory 23 of the computation device 20 in the above-described first preferred embodiment to be stored and distributed on a computer-readable recording medium such as flexible disk, CD-ROM (Compact Disk Read-Only Memory), DVD (Digital Versatile Disk), MO (Magneto-Optical disk) and/or the like, and to comprise the device for executing the above-described processes by installing those programs on a computer.
Having described and illustrated the principles of this application by reference to one or more preferred embodiments, it should be apparent that the preferred embodiments may be modified in arrangement and detail without departing from the principles disclosed herein and that it is intended that the application be construed as including all such modifications and variations insofar as they come within the spirit and scope of the subject matter disclosed herein.
This application claims the benefit of Japanese Patent Application No. 2011-147470, filed on 1 Jul. 2011, the entire disclosure of which is incorporated by reference herein.
The eyelid detection device, eyelid detection method and program are suitable for detecting eyelids.
Number | Date | Country | Kind |
---|---|---|---|
2011-147470 | Jul 2011 | JP | national |
Filing Document | Filing Date | Country | Kind | 371c Date |
---|---|---|---|---|
PCT/JP2012/065435 | 6/15/2012 | WO | 00 | 12/20/2013 |