1. Technical Field
Embodiments of the present disclosure relate to alarm clocks, and more particularly to a face recognition-based alarm shutdown method and an alarm clock thereof.
2. Description of Related Art
Various alarm clocks typically provide an alarm function. However, users may return to sleep after using a control to shut down an initial or primary alarm of the alarm clocks. This can cause the users to oversleep. What is needed, therefore, is an alarm shutdown method to overcome the limitations described.
The disclosure is illustrated by way of example and not by way of limitation in the figures of the accompanying drawings in which like references indicate similar elements. It should be noted that references to “an” or “one” embodiment in this disclosure are not necessarily to the same embodiment, and such references mean at least one.
In general, the word “module” as used herein, refers to logic embodied in hardware or firmware, or to a collection of software instructions, written in a programming language, such as, for example, Java, C, or Assembly. One or more software instructions in the module may be embedded in firmware, such as an EPROM. It will be appreciated that module may comprise connected logic units, such as gates and flip-flops, and may comprise programmable units, such as programmable gate arrays or processors. The module described herein may be implemented as either software and/or hardware module and may be stored in any type of computer-readable medium or other computer storage device.
The capture unit 10 is a digital camera module that is operable to capture an image, such as a still image of the user. In addition, the capture unit 10 can also include a video camera module that can capture a video clip or a still image. If a video clip is captured by the video camera module, the at least one processor 40 can perform sampling to generate a number of still images from the video clip.
The timer unit 20 is operable to determine whether a current time matches an alarm time. In addition, the timer unit 20 determines whether an open-eye image exists after a predetermined time period. The open-eye image is an image of opening eye of the user. In one embodiment, if the current time matches the alarm time, and the timer unit 20 implements an alarm of the alarm clock 1.
The memory 30 is electronically connected to the capture unit 10, the timer unit 20, the at least one processor 40, the speaker 50, the receiving module 101, the execution module 102, the analysis module 103 and the shutdown module 104. The memory 30 is operable to store many kinds of data, such as images captured from the capture unit 10, a customization function code of the alarm clock 1, computerized codes of the system 100, programs of an operating system and other applications of the alarm clock 1. The memory 30 may include flash memory, RAM, ROM, cache, or other storage media.
The modules 101-104 may comprise computerized code in the form of one or more programs that are stored in the memory 30. The computerized code includes instructions executed by the at least one processor 40 to provide functions for modules 101-104. The at least one processor 40, as an example, may include a CPU, math coprocessor, or shift register, for example.
The speaker 50 is operable to sound the alarm. In one embodiment, the at least one processor 40 can transform an audio file into an analog signal to the speaker 50. Accordingly, the speaker 50 sounds the alarm.
The receiving module 101 is operable to set the alarm time of the alarm clock 1. In one embodiment, if the current time matches the alarm time, the alarm clock 1 executes the alarm.
In addition, the receiving module 101 is also operable to set the predetermined time period to determine whether the open-eye image exists after the predetermined time period. In other embodiments, the receiving module 101 sets the predetermined time period equal to 30 seconds. For example, the capture unit 10 captures one more image of the user at 30 seconds after the prior captured image. The one more captured image is then sent to the analysis module 103 for analysis.
The execution module 102 is operable to execute the alarm upon determining that the current time matches the alarm time. In addition, upon determining that the current time matches the alarm time, the execution module 102 further directs the capture unit 10 to capture the image of the user to save in the memory 30. In addition, the execution module 102 directs the capture unit 10 to capture the one more image of the user when the current time equals to the predetermined time period after the prior captured image.
The analysis module 103 is operable to determine whether the image includes the open-eye image. Accordingly, the analysis module 103 reads the image from the memory 30 then analyzes the image. In one embodiment, the analysis module 103 detects a facial zone of the user from the image captured from the capture unit 10.
Specifically, the detection of the facial zone can be accomplished by a skin-color algorithm. That is, the facial zone is defined according to a range of skin colors of the user's face. The range of the skin color is disclosed as:
where, if the value of Skincolor (x, y) is 1, the detected range of the face color is determined as the skin color. The analysis module 103 then sets the color of the detected range as white. If the value of Skincolor (x, y) is not 1, the detected range of the face color is determined as being a non-skin color. The analysis module 103 then sets the color of the detected range as black. After defining the facial zone, the analysis module 103 defines a face-rectangular representative of a maximal of the facial zone. The face-rectangular is a sampling space of characteristics within the facial zone which is defined by the analysis module 103 according to the characteristics within the facial zone.
Accordingly, the analysis module 103 is further configured to locate an eye area (that is, an area of the eyes of a user) from the defined facial zone. Firstly, the analysis module 103 locates a rough eye area by detecting two circular shapes having deeper color than a neighborhood from the defined facial zone. After detecting the rough eye area, the analysis module 103 utilizes an algorithm, such as the Sobel algorithm, to enhance the border of the eye area and further darken the eye area. The eye area is then processed by a binarization process. Herein, the binarization process is an image binarizing algorithm based on a mathematical morphology.
After performing the binarization process, the analysis module 103 samples the border of the eye area so as to obtain an outline of the eye area using an algorithm, such as the Snake algorithm. The outline of the eye area is then utilized to define an eye-rectangular representative of a maximal of the eye area, and thus the analysis module 103 may obtain a height (H) and a width (W) of the eye-rectangular.
The analysis module 103 then calculates the ratio of the height and the width of the eye area (H/W), and determine whether the user is awake. In one embodiment, if the ratio of H/W exceeds a threshold value, the analysis module 103 determines that the user is awake. If the ratio of H/W is smaller than the threshold value, the analysis module 103 determines that the user is asleep. Usually, the threshold value is preset by the manufacturer.
The shutdown module 104 is operable to disable the alarm upon determining that the image includes the open-eye image exists after the predetermined time period. For example, if the analysis module 103 detects the open-eye image exists after 30 seconds, the shutdown module 104 disables the alarm.
In block S10, the receiving module 101 receives an alarm time and a predetermined time period set by a user. For example, the user can set the alarm time at 06:20 AM and the predetermined time period to 30 seconds.
In block S20, the execution module 102 executes an alarm upon determining that the current time matches the alarm time.
In block S30, upon determining that the current time matches the alarm time, the execution module 102 further directs the capture unit 10 to capture an image. In one embodiment, the capture unit 10 captures at least one image of the user.
In block S40, the analysis module 103 determines whether the image includes an open-eye image. If the image includes the open-eye image, block S50 is implemented. If the image does not include the open-eye image, block S20 is repeated.
In block S50, upon determining that the image includes the open-eye image, the timer unit 20 determines whether the open-eye image exists after the predetermined time period. In one embodiment, upon determining that the current time equals to 6:20:30 AM, the execution module 102 directs the capture unit 10 to capture one more image of the user. The analysis module 103 then determines whether the new image of the user includes the open-eye image. If the open-eye image exists after the predetermined time period, block S60 is implemented. If the open-eye image does not exist after the predetermined time period, block S20 is repeated.
In block S60, the shutdown module 104 shuts down the alarm upon determining that the image includes the open-eye image exits after the predetermined time period.
Although certain embodiments of the present disclosure have been specifically described, the present disclosure is not to be construed as being limited thereto. Various changes or modifications may be made to the present disclosure without departing from the scope and spirit of the present disclosure.
Number | Date | Country | Kind |
---|---|---|---|
99139264 | Nov 2010 | TW | national |