Electronic device and method for controlling the electronic device
A method for adjusting a working state of an electronic device includes setting a predetermined value range of feature data of a user, and acquiring current feature data of the user from the camera device. The current feature data is compared to the predetermined value range of feature data. A working state of the electronic device is changed when the current feature data is out of the predetermined value range of feature data.
1. A method for controlling an electronic device, the method comprising:
setting a predetermined value range of feature data of a user; wherein the predetermined value range of feature data is set by:
recording a video of the user for a predetermined time duration by the camera device after the electronic device is activated;
acquiring the first distance, and the second distance from the camera device every second;
calculating a pixel value, an average first distance, and an average second distance; and
setting the predetermined value range of the pixel value, the first distance, and the second distance;
acquiring current feature data of the user from the camera device;
determining whether the current feature data is within the predetermined value range; and
changing a working state of the electronic device when the current feature data is out of the predetermined value range;
wherein the feature data includes pixel values of pixel points of an image of the user, a first distance from head of the user to ground, and a second distance between the camera device and the user when the user is using the electronic device.
2. The method according to claim 1 , wherein the current feature data is determined by comparing the current feature data with the predetermined value range of feature data.
3. A method for controlling an electronic device, the method comprising:
stopping or reducing an execution speed of the electronic device.