The subject matter herein generally relates to electrical device control technology, and particularly to a computing device and a method for controlling power of electrical devices using the computing device.
A user may fall asleep while one or more electrical devices such as a computer and/or a television are running It may result in wasting electricity.
Many aspects of the disclosure can be better understood with reference to the following drawings. The components in the drawings are not necessarily drawn to scale, the emphasis instead being placed upon clearly illustrating the principles of the disclosure.
Moreover, in the drawings, like reference numerals designate corresponding parts throughout the several views.
It will be appreciated that for simplicity and clarity of illustration, where appropriate, reference numerals have been repeated among the different figures to indicate corresponding or analogous elements. In addition, numerous specific details are set forth in order to provide a thorough understanding of the embodiments described herein. However, it will be understood by those of ordinary skill in the art that the embodiments described herein can be practiced without these specific details. In other instances, methods, procedures, and components have not been described in detail so as not to obscure the related relevant feature being described. Also, the description is not to be considered as limiting the scope of the embodiments described herein. The drawings are not necessarily to scale and the proportions of certain parts may be exaggerated to better illustrate details and features of the present disclosure.
The present disclosure, including the accompanying drawings, is illustrated by way of examples and not by way of limitation. 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.”
Furthermore, the term “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, Java, C, or assembly. One or more software instructions in the modules can be embedded in firmware, such as in an EPROM. The modules described herein can be implemented as either software and/or hardware modules and can be stored in any type of non-transitory computer-readable medium or other storage device. Some non-limiting examples of non-transitory computer-readable media include CDs, DVDs, BLU-RAY, flash memory, and hard disk drives. The term “comprising” means “including, but not necessarily limited to”; it specifically indicates open-ended inclusion or membership in a so-described combination, group, series and the like.
The one or more electrical devices 3 are electrically connected to a controller 2. The controller 2 is electronically connected to the computing device 1 via a communication device 21 of the controller 2 and a communication device 12 of the computing device 1. The computing device 1 is further electronically connected to a camera device 4 via the communication device 12 and a communication device 41 of the camera device 4. As shown in
The controller 2 can be a programmable automation controller (PAC) or a programmable logic controller (PLC). The computing device 1 may be a server or any other device that has data processing function. The communication devices 12, 21, and 41 can be BLUETOOTH devices or WIFI devices.
The computing device 1 further includes a storage device 13 and at least one processor 14. In one embodiment, the storage device 13 can be an internal storage device, such as a flash memory, a random access memory (RAM) for temporary storage of information, and/or a read-only memory (ROM) for permanent storage of information. The storage device 13 can also be an external storage device, such as an external hard disk, a storage card, or a data storage medium.
The at least one processor 14 can be a central processing unit (CPU), a microprocessor, or other data processor chip that performs functions of the computing device 1.
The control system 11 can control the one or more electrical devices 3 according to images that are captured by the camera device 4. For example, the control system 11 can turn off power to the one or more electrical devices 3, when it has been determined that the user has closed eyes for a predetermined time duration according to the images. Details will be given in the following paragraphs.
The capturing module 111 can control the camera device 4 to capture an image of the user 5.
The identifying module 112 can obtain the image and identify a face area of the user 5 in the image.
In one embodiment, the identifying module 112 can compare the image with one or more predetermined face templates. In one embodiment, the one or more predetermined face templates can be face templates of different facial expressions of the user 5. For example, the one or more predetermined face templates can be a face template of the user 5 smiling expression, and/or a face template of the user 5 with a serious expression, and etc.
When a first similarity degree between a first area of the image and one of the predetermined face templates is greater than a first preset value (e.g., 95%), the first area of the image is determined to be the face area of the user 5 in the image.
For example, as shown in
The identifying module 112 can identify an eye area of the user 5 in the image.
In one embodiment, the identifying module 112 can compare the face area of the user 5 with one or more predetermined eye templates. In one embodiment, the one or more predetermined eye templates may include, but not limited to, an eye template of the user 5 with closed eyes, an eye template of the user 5 with opened eyes.
When a second similarity degree between a second area of the face area of the user 5 in the image and one of the predetermined eye templates, is greater than a second preset value (e.g., 90%), the second area of the face area of the user 5 in the image is determined to be the eye area of the user 5 in the image.
For example, as shown in
The determining module 113 can determine whether the eyes of the user 5 are closed in the image, according to the eye area of the user 5 in the image.
In one embodiment, the determining module 113 can determine a total number of eyeballs in the eye area of the user 5 in the image. When the total number of eyeballs in the eye area of the user 5 in the image is determined to be equal to 0, the determining module 113 can determine that the user 5 has closed eyes. When the total number of eyeballs in the eye area of the user 5 in the image is determined to be not equal to 0, the determining module 113 can determine that the user 5 has open eyes.
In one embodiment, the determining module 113 can compare the eye area of the user 5 in the image with a first predetermined eyeball template that includes both eyeballs, and a second predetermined eyeball template that does not include any eyeballs.
When a third similarity degree between the eye area of the user 5 in the image and the first predetermined eyeball template, is greater than a third preset value (e.g., 98%), the determining module 113 can determine the total number of eyeballs in the eye area of the user 5 in the image is equal to 2.
When a fourth similarity degree between the eye area of the user 5 in the image and the second predetermined eyeball template, is greater than a fourth preset value (e.g., 98%), the determining module 113 can determine the total number of eyeballs in the eye area of the user 5 in the image is equal to 0.
The determining module 113 can further determine whether the user 5 has eyes closed for a predetermined time duration (e.g., 3 minutes).
In one embodiment, when the user 5 has been determined to have closed eyes in each of images that are captured in the predetermined time duration, the determining module 113 can determine the user 5 has eyes closed for the predetermined time duration.
For example, when the user 5 in a first image captured at “T1” is determined to have closed eyes, the user 5 is further determined to have closed eyes in each of other images that are captured from “T1” to “T2”, and the time duration between “T1” and “T2” is equal to the predetermined time duration, the determining module 113 can determine the user 5 has closed eyes for the predetermined time duration.
When the user 5 has been determined to have closed eyes for the predetermined time duration, the controlling module 114 can turn off power of the one or more electrical devices 3 via the controller 2.
In one embodiment, the controlling module 114 can send a control command to the controller 3 through the communication device 12. The controller 3 can turn off power to the one or more electrical devices 3 to save power, when the control command is received through the communication device 21.
At block 1001, a capturing module can control a camera device that is electronically connected to a computing device to capture an image of a user.
At block 1002, an identifying module can obtain the image and identify a face area of the user in the image.
In one embodiment, the identifying module can compare the image with one or more predetermined face templates. In one embodiment, the one or more predetermined face templates can be face templates of different facial expressions of the user. For example, the one or more predetermined face templates can be a face template of the user smiling, and/or a face template of the user being serious, and etc.
When a first similarity degree between a first area of the image and one of the predetermined face templates is greater than a first preset value (e.g., 95%), the first area of the image is determined to be the face area of the user in the image.
At block 1003, the identifying module can identify an eye area of the user in the image.
In one embodiment, the identifying module can compare the face area of the user with one or more predetermined eye templates. In one embodiment, the one or more predetermined eye templates may include, but are not limited to, an eye template of the user with closed eyes, an eye template of the user with opened eyes.
When a second similarity degree between a second area of the face area of the user in the image and one of the predetermined eye templates, is greater than a second preset value (e.g., 90%), the second area of the face area of the user in the image is determined to be the eye area of the user in the image.
At block 1004, a determining module can determine whether the user has closed eyes in the image, according to the eye area of the user in the image. When the user has closed eyes in the image, the process goes to block 1005. When the user does not have closed eyes in the image, the process goes to block 1001.
In one embodiment, the determining module can determine a total number of eyeballs in the eye area of the user in the image. When the total number of eyeballs in the eye area of the user in the image is determined to be equal to 0, the determining module can determine the user has closed eyes. When the total number of eyeballs in the eye area of the user in the image is determined to be not equal to 0, the determining module can determine the user has open eyes.
In one embodiment, the determining module can compare the eye area of the user in the image with a first predetermined eyeball template that includes both eyeballs, and a second predetermined eyeball template that does not include any eyeballs.
When a third similarity degree between the eye area of the user in the image and the first predetermined eyeball template, is greater than a third preset value (e.g., 98%), the determining module can determine the total number of eyeballs in the eye area of the user in the image is equal to 2.
When a fourth similarity degree between the eye area of the user in the image and the second predetermined eyeball template, is greater than a fourth preset value (e.g., 98%), the determining module can determine the total number of eyeballs in the eye area of the user in the image is equal to 0.
At block 1005, the determining module can further determine whether the user has closed eyes for a predetermined time duration (e.g., 3 minutes). When the user has closed eyes for the predetermined time duration, the process goes to block 1006.
When the user has not closed eyes for the predetermined time duration, the process goes back to block 1001.
In one embodiment, when the user has been determined to be have closed eyes in each of images that are captured in the predetermined time duration, the determining module can determine the user has closed eyes for the predetermined time duration.
For example, when the user in a first image captured at “T1” is determined to be have closed eyes, the user is further determined to be have closed eyes in each of other images that are captured from “T1” to “T2”, and the time duration between “T1” and “T2” is equal to the predetermined time duration, the determining module can determine the user has closed eyes for the predetermined time duration.
At block 1006, When the user has been determined to close eyes for the predetermined time duration, a controlling module can turn off power of the one or more electrical devices via a controller that is electronically connected to the computing device.
In one embodiment, the controlling module can send a control command to the controller through a communication device of the computing device. The controller can turn off power to one or more electrical devices that are electrically connected to the controller to save power, when the control command is received through a communication device of the controller.
It should be emphasized that the above-described embodiments of the present disclosure, including any particular embodiments, are merely possible examples of implementations, set forth for a clear understanding of the principles of the disclosure. Many variations and modifications can be made to the above-described embodiment(s) of the disclosure without departing substantially from the spirit and principles of the disclosure. All such modifications and variations are intended to be included herein within the scope of this disclosure and protected by the following claims.