Camera starting method and device, terminal equipment and computer readable storage medium
By automatically starting the front camera with face images and gravity data, it solves the problem of cumbersome operation of users, simplifies the self-preparation process and improves the convenience of self-presentation.
Patent Information
- Application Number
- CN202411356015.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-26
- Publication Date
- 2025-01-10
AI Technical Summary
When users use terminal devices to take selfies, they need to manually turn on the camera application and switch to the front camera. The operation is cumbersome, resulting in a long preparation time for selfies and poor convenience.
By obtaining the face position information in the first face image and the gravity data of the terminal device, after determining whether specific conditions are met, the front camera will be automatically activated to simplify user operations.
It enables users to automatically start the front camera without manual operation, reducing self-time preparation time and improving Selfie convenience.
Smart Images

Figure CN119299842A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication technology, and in particular to a camera startup method, device, terminal equipment and computer-readable storage medium. Background Art
[0002] Currently, many terminal devices are equipped with front cameras, which are cameras placed on the front of the terminal device. The front camera can realize functions such as selfies, fast facial recognition unlocking, and smart payment. However, when users take selfies through terminal devices, they usually need to manually open the camera application and switch to the front camera, which is a cumbersome operation. Summary of the invention
[0003] The embodiments of the present application provide a camera activation method, apparatus, terminal device, and computer-readable storage medium, which can automatically activate a front camera in combination with a first face image and gravity data of the terminal device, thereby simplifying user operations, reducing selfie preparation time, and improving the convenience of selfies.
[0004] The technical solution adopted by the present invention to solve the problem is as follows:
[0005] On the one hand, the present application provides a camera startup method, comprising:
[0006] Obtaining first position information of a face in a first face image, and determining whether the first position information satisfies a first condition;
[0007] If the first position information satisfies the first condition, obtaining gravity data of the terminal device;
[0008] Based on the gravity data, the front camera of the terminal device is activated.
[0009] In some implementation schemes of the present application, determining whether the first location information satisfies the first condition includes:
[0010] Obtaining center position information of the first face image;
[0011] Calculating and processing the first position information and the center position information to obtain a distance value;
[0012] If the distance value is less than a preset distance threshold, it is determined that the first location information satisfies the first condition.
[0013] In some embodiments of the present application, based on gravity data, starting the front camera of the terminal device includes:
[0014] Based on the gravity data, determining whether the screen state of the terminal device is switched from a first state to a second state;
[0015] If the screen state of the terminal device switches from the first state to the second state, obtaining a second facial image;
[0016] Based on the first face image and the second face image, a front camera of the terminal device is started.
[0017] In some embodiments of the present application, determining whether the screen state of the terminal device is switched from the first state to the second state based on gravity data includes:
[0018] Based on the gravity data, determine the rotation angle of the terminal device;
[0019] If the rotation angle is greater than or equal to a preset angle threshold, it is determined that the screen state of the terminal device is switched from the first state to the second state.
[0020] In some embodiments of the present application, the gravity data includes a first acceleration value, a second acceleration value, and a third acceleration value. Based on the gravity data, determining the rotation angle of the terminal device includes:
[0021] Calculating and processing the first acceleration value and the second acceleration value to obtain a fourth acceleration value;
[0022] Dividing the fourth acceleration value and the third acceleration value to obtain a first proportional value;
[0023] An inverse tangent operation is performed on the first ratio value to obtain a rotation angle of the terminal device.
[0024] In some embodiments of the present application, based on the first face image and the second face image, starting the front camera of the terminal device includes:
[0025] Performing face detection on the second face image to obtain second position information of the face in the second face image;
[0026] Determining first size information of the face in the second face image based on the second position information;
[0027] Based on the first size information and the second size information of the face in the first face image, the front camera of the terminal device is started.
[0028] In some embodiments of the present application, starting a front camera of a terminal device based on the first size information and the second size information of the face in the first face image includes:
[0029] Divide the first size information and the second size information to obtain a second ratio value;
[0030] If the second ratio value is less than the preset ratio threshold, the front camera of the terminal device is started.
[0031] In a second aspect, an embodiment of the present invention further provides a camera activation device, comprising:
[0032] An information acquisition module, used to acquire first position information of a face in a first face image, and determine whether the first position information satisfies a first condition;
[0033] A data acquisition module, configured to acquire gravity data of the terminal device if the first position information satisfies a first condition;
[0034] The camera startup module is used to start the front camera of the terminal device based on gravity data.
[0035] In a third aspect, the present application further provides a terminal device, the terminal device comprising:
[0036] one or more processors;
[0037] Memory; and
[0038] One or more applications, wherein the one or more applications are stored in a memory and configured to be executed by a processor to implement any camera startup method in the first aspect.
[0039] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon, and the computer program is loaded by a processor to execute the steps in any one of the camera startup methods in the first aspect.
[0040] The beneficial effects of the present invention are as follows: by judging whether the first position information of the face in the first face image satisfies the first condition, if the first position information satisfies the first condition, obtaining the gravity data of the terminal device, and starting the front camera of the terminal device based on the gravity data, the front camera can be automatically started in combination with the first face image and the gravity data of the terminal device, thereby simplifying user operations, reducing selfie preparation time and improving the convenience of selfies. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0042] Figure 1 is a flowchart of a camera startup system provided by an embodiment of the present invention;
[0043] Figure 2 is a flowchart of an embodiment of a camera startup method provided by an embodiment of the present invention;
[0044] Figure 3 is a flowchart of a specific embodiment of determining whether the first location information meets the first condition provided by an embodiment of the present invention;
[0045] Figure 4 is a flowchart of a specific embodiment of starting a front camera of a terminal device provided by an embodiment of the present invention;
[0046] Figure 5 is a principle block diagram of a camera activation device provided by an embodiment of the present invention;
[0047] Figure 6 It is a schematic diagram of the structure of a terminal device provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0048] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of this application.
[0049] In the description of this application, the terms "first", "second", "third", etc. are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, features defined as "first", "second", "third", etc. may explicitly or implicitly include one or more of the features.
[0050] In this application, the word "exemplary" is used to mean "used as an example, illustration, or description." Any embodiment described in this application as "exemplary" is not necessarily to be construed as being preferred or advantageous over other embodiments. The following description is given to enable any technician in the field to implement and use the present application. In the following description, details are listed for the purpose of explanation. It should be understood that a person of ordinary skill in the art can recognize that the present application can be implemented without using these specific details. In other instances, well-known structures and processes will not be elaborated in detail to avoid obscuring the description of the present application with unnecessary details. Therefore, the present application is not intended to be limited to the embodiments shown, but is consistent with the widest scope consistent with the principles and features disclosed in the present application.
[0051] It should be noted that since the method of the embodiment of the present application is executed in the terminal device, the processing objects of each terminal device exist in the form of data or information. For example, time is actually time information. It can be understood that if size, quantity, position, etc. are mentioned in subsequent embodiments, they are all corresponding data for the terminal device to process. The details will not be repeated here.
[0052] The embodiments of the present application provide a camera activation method, apparatus, terminal device, and computer-readable storage medium, which are described in detail below.
[0053] See also Figure 1 , Figure 1 Schematic diagram of a camera activation system provided in an embodiment of the present application. The camera activation system may include a terminal device 100, in which a camera activation device is integrated. Figure 1 The terminal device in.
[0054] In the embodiment of the present application, the terminal device 100 is mainly used to obtain first position information of a face in a first face image, and determine whether the first position information satisfies a first condition; if the first position information satisfies the first condition, the gravity data of the terminal device is obtained, and based on the gravity data, the front camera of the terminal device is started. The front camera can be automatically started in combination with the first face image and the gravity data of the terminal device, thereby simplifying user operations, reducing selfie preparation time and improving the convenience of selfies.
[0055] In the embodiment of the present application, the terminal device 100 may be an independent server, or a server network or server cluster composed of servers. For example, the terminal device 100 described in the embodiment of the present application includes but is not limited to a computer, a network host, a single network server, a plurality of network server sets or a cloud server composed of a plurality of servers. The cloud server is composed of a large number of computers or network servers based on cloud computing.
[0056] It is understandable that the terminal device 100 used in the embodiments of the present application may be a device including both receiving and transmitting hardware, that is, a device having receiving and transmitting hardware capable of performing two-way communication on a two-way communication link. Such a device may include: a cellular or other communication device having a single-line display or a multi-line display or a cellular or other communication device without a multi-line display. The terminal device 100 may specifically be a desktop terminal or a mobile terminal, and the terminal device 100 may specifically be one of a mobile phone, a tablet computer, a laptop computer, and the like.
[0057] Those skilled in the art will understand that Figure 1The application environment shown in the figure is only one application scenario of the present application solution and does not constitute a limitation on the application scenario of the present application solution. Other application environments may also include Figure 1 More or fewer terminal devices as shown in, for example Figure 1 Only one terminal device is shown. It can be understood that the camera startup system can also include one or more other services, which are not specifically limited here.
[0058] In addition, if Figure 1 As shown, the camera startup system may further include a memory 200 for storing data, such as image data, such as a first face image, a second face image, etc., and position information, such as center position information, first position information, etc.
[0059] It should be noted that Figure 1 The scene diagram of the camera startup system shown is merely an example. The camera startup system and scene described in the embodiment of the present application are intended to more clearly illustrate the technical solution of the embodiment of the present application, and do not constitute a limitation on the technical solution provided in the embodiment of the present application. A person of ordinary skill in the art can appreciate that with the evolution of the camera startup system and the emergence of new business scenarios, the technical solution provided in the embodiment of the present application is equally applicable to similar technical problems.
[0060] First, a camera startup method is provided in an embodiment of the present application, and the executor of the camera startup method is a camera startup device, and the camera startup device is applied to a terminal device. The camera startup method includes: obtaining first position information of a face in a first face image, and determining whether the first position information meets a first condition; if the first position information meets the first condition, obtaining gravity data of the terminal device; and based on the gravity data, starting the front camera of the terminal device.
[0061] like Figure 2 FIG. 2 is a flow chart of an embodiment of a camera startup method in an embodiment of the present application. The camera startup method may include the following steps S201 to S203, which are as follows:
[0062] Step S201: Obtain first position information of a face in a first face image, and determine whether the first position information satisfies a first condition.
[0063] In a specific embodiment, the first face image refers to an image containing a face, and the terminal device is equipped with an always-on camera (AOC), and the first face image can be collected by the always-on camera (AOC). The first position information is the position information of the face in the first face image in the first face image, the first position information can be the position information of the center point of the area where the face is located in the first face image in the first face image, the first position information can also be the position information of any pixel point in the area where the face is located in the first face image in the first face image, and the first position information can also be the position information of each pixel point in the area where the face is located in the first face image in the first face image, which is not limited in this embodiment.
[0064] Furthermore, determining whether the first position information satisfies the first condition may be determining whether the area corresponding to the first position information is located in the middle area of the first face image. Determining whether the first position information satisfies the first condition may also be determining whether the distance value between the position point corresponding to the first position information and the center point of the first face image is less than a preset distance threshold, which is not limited in this embodiment.
[0065] Step S202: If the first position information satisfies the first condition, obtain gravity data of the terminal device.
[0066] In a specific embodiment, a gravity sensor is provided on the terminal device, and the gravity data is data collected by the gravity sensor of the terminal device. The gravity data can be expressed as (g x , g y , g z ), where g x Indicates the acceleration value of the terminal device on the x-axis, g y Indicates the acceleration value of the terminal device on the y-axis, g z Indicates the acceleration value of the terminal device on the z-axis, g x Reflects the horizontal motion state of the terminal device, g y Reflects the vertical motion state of the terminal device, g z Reflects the movement state of the terminal device in the direction of gravity.
[0067] In this embodiment, if the first position information satisfies the first condition, gravity data collected by the gravity sensor on the terminal device is further obtained. For example, if the area corresponding to the first position information is located in the middle area of the first face image, the gravity data of the terminal device is obtained; if the distance value between the position point corresponding to the first position information and the center point of the first face image is less than a preset distance threshold, the gravity data of the terminal device is obtained.
[0068] Step S203: based on the gravity data, start the front camera of the terminal device.
[0069] In a specific embodiment, the step of starting the front camera of the terminal device based on gravity data includes: determining whether the screen state of the terminal device switches from a first state to a second state based on the gravity data; if the screen state of the terminal device switches from the first state to the second state, starting the front camera of the terminal device, and the front camera can be automatically started in combination with the first facial image and the gravity data of the terminal device, thereby simplifying user operations, reducing selfie preparation time and improving the convenience of selfies.
[0070] In another specific embodiment, the step of starting the front camera of the terminal device based on gravity data includes: determining whether the screen state of the terminal device switches from a first state to a second state based on gravity data; if the screen state of the terminal device switches from the first state to the second state, obtaining a second facial image; based on the first facial image and the second facial image, starting the front camera of the terminal device, and the front camera can be automatically started in combination with the first facial image, the gravity data of the terminal device and the second facial image, thereby simplifying user operation, reducing selfie preparation time and improving the convenience of selfies.
[0071] In a specific implementation, referring to Figure 3 As shown, in step S201, determining whether the first location information satisfies the first condition may include steps S301 to S303, which are specifically as follows:
[0072] Step S301: Obtain center position information of a first face image.
[0073] In a specific embodiment, the center position information is the position information of the center point of the first face image. The center position information can be determined based on the image width and image height of the first face image. For example, if the image width of the first face image is w and the image height of the first face image is h, then the center position information of the first face image is
[0074] Step S302: Calculate and process the first position information and the center position information to obtain a distance value.
[0075] In a specific embodiment, the first position information is the position information of the center point of the face area in the first face image in the first face image, and the distance value is the distance value between the position point corresponding to the first position information and the position point corresponding to the center position information. The process of calculating and processing the first position information and the center position information can be expressed as: Where d represents the distance value, (x f ,y f ) represents the first position information, (x c,y c ) indicates the center location information.
[0076] Step S303: If the distance value is less than a preset distance threshold, it is determined that the first location information meets the first condition.
[0077] In a specific embodiment, the distance threshold is a pre-set threshold used to measure the degree of proximity between the position point corresponding to the first position information and the position point corresponding to the center position information. When the distance value is less than the distance threshold, it indicates that the area where the face is located in the first face image is located in the middle area of the first face image, and then it is determined that the first position information meets the first condition; conversely, if the distance value is greater than or equal to the distance threshold, it indicates that the area where the face is located in the first face image is not located in the middle area of the first face image, and then it is determined that the first position information does not meet the first condition.
[0078] In a specific implementation, referring to Figure 4 As shown, in step S203, starting the front camera of the terminal device based on gravity data may include steps S401 to S403, which are specifically as follows:
[0079] Step S401: Based on gravity data, determine whether the screen state of the terminal device is switched from a first state to a second state.
[0080] In a specific embodiment, the screen state of the terminal device includes a horizontal screen state and a vertical screen state, the horizontal screen state is a state in which the long side of the screen of the terminal device is perpendicular to the line of sight of the human eye, and the vertical screen state is a state in which the mobile phone screen is rotated 90 degrees and the long side is parallel to the line of sight of the human eye. Optionally, the first state is the vertical screen state, and the second state is the horizontal screen state, and determining whether the screen state of the terminal device is switched from the first state to the second state based on gravity data refers to determining whether the screen state of the terminal device is switched from the vertical screen state to the horizontal screen state based on gravity data.
[0081] In a specific embodiment, based on gravity data, the step of determining whether the screen state of the terminal device switches from a first state to a second state specifically includes: based on gravity data, determining the rotation angle of the terminal device; if the rotation angle is greater than or equal to a preset angle threshold, determining that the screen state of the terminal device switches from the first state to the second state.
[0082] In this embodiment, the angle threshold is a pre-set threshold used to measure whether the screen state of the terminal device switches from the first state to the second state. If the rotation angle is greater than or equal to the angle threshold, it is determined that the screen state of the terminal device switches from the first state to the second state. If the rotation angle is less than the angle threshold, it is determined that the screen state of the terminal device does not switch from the first state to the second state.
[0083] In a specific embodiment, the gravity data includes a first acceleration value, a second acceleration value and a third acceleration value, the first acceleration value is the acceleration value of the terminal device on the x-axis, the second acceleration value is the acceleration value of the terminal device on the y-axis, and the third acceleration value is the acceleration value of the terminal device on the z-axis. The above-mentioned steps of determining the rotation angle of the terminal device based on the gravity data specifically include: calculating the first acceleration value and the second acceleration value to obtain a fourth acceleration value; dividing the fourth acceleration value and the third acceleration value to obtain a first proportional value; performing an inverse tangent operation on the first proportional value to obtain the rotation angle of the terminal device.
[0084] Optionally, the process of calculating and processing the first acceleration value and the second acceleration value can be expressed as: The process of determining the rotation angle can be expressed as: Among them, g x Indicates the first acceleration value, g y Indicates the second acceleration value, g z Indicates the third acceleration value, g c represents the fourth acceleration value, and θ represents the rotation angle.
[0085] Step S402: If the screen state of the terminal device is switched from the first state to the second state, a second facial image is obtained.
[0086] In this embodiment, the second face image is an image containing a face, and the second face image can also be collected by an always-on camera (AOC) configured on the terminal device. The first face image and the second face image contain the same face. For example, if user A takes a selfie using the terminal device, the first face image and the second face image both contain the face of user A.
[0087] Step S403: Based on the first face image and the second face image, start the front camera of the terminal device.
[0088] In this embodiment, if the first position information satisfies the first condition, it is determined whether the screen state of the terminal device is switched from the first state to the second state. If the screen state of the terminal device is switched from the first state to the second state, the front camera of the terminal device is started based on the first face image and the second face image. By starting the front camera of the terminal device in combination with multiple conditions, the accuracy of camera startup can be improved and accidental startup of the camera can be avoided.
[0089] In a specific embodiment, based on the first face image and the second face image, the step of starting the front camera of the terminal device specifically includes: performing face detection on the second face image to obtain second position information of the face in the second face image; based on the second position information, determining first size information of the face in the second face image; based on the first size information and the second size information of the face in the first face image, starting the front camera of the terminal device.
[0090] In this embodiment, the second position information is the position information of the face in the second facial image, and the first size information is the area of the region where the face is located in the second facial image. Based on the second position information, the width and height of the region where the face is located in the second facial image can be determined, and then the area of the region where the face is located in the second facial image can be determined, thereby obtaining the first size information of the face in the second facial image.
[0091] Furthermore, the second size information is the area of the region where the face is located in the first face image. Based on the first size information and the second size information of the face in the first face image, the step of starting the front camera of the terminal device specifically includes: dividing the first size information and the second size information to obtain a second ratio value; if the second ratio value is less than a preset ratio threshold, starting the front camera of the terminal device.
[0092] In this embodiment, the ratio threshold is a pre-set threshold used to measure whether the face in the face image becomes smaller. If the second ratio value is less than the ratio threshold, it is determined that the face in the face image becomes smaller, and the front camera of the terminal device is started; otherwise, if the second ratio value is greater than or equal to the ratio threshold, it is determined that the face in the face image has not become smaller, and the front camera of the terminal device is not started.
[0093] In a specific embodiment, the process of determining the second ratio value can be expressed as: Wherein, r represents the second ratio value, A2 represents the first size information, and A1 represents the second size information.
[0094] In order to better implement the camera startup method in the embodiment of the present application, based on the camera startup method, a camera startup device is also provided in the embodiment of the present application, such as Figure 5 As shown, the camera activation device 700 includes:
[0095] The information acquisition module 710 is used to acquire first position information of a face in a first face image, and determine whether the first position information satisfies a first condition;
[0096] A data acquisition module 720, configured to acquire gravity data of the terminal device if the first position information satisfies a first condition;
[0097] The camera activation module 730 is used to activate the front camera of the terminal device based on gravity data.
[0098] In an embodiment of the present application, by determining whether the first position information of the face in the first face image satisfies the first condition, if the first position information satisfies the first condition, the gravity data of the terminal device is obtained, and the front camera of the terminal device is started based on the gravity data. The front camera can be automatically started in combination with the first face image and the gravity data of the terminal device, thereby simplifying user operations, reducing selfie preparation time and improving the convenience of selfies.
[0099] In some embodiments of the present application, the information acquisition module 710 determines whether the first location information satisfies the first condition, including:
[0100] Obtaining center position information of the first face image;
[0101] Calculating and processing the first position information and the center position information to obtain a distance value;
[0102] If the distance value is less than a preset distance threshold, it is determined that the first location information satisfies the first condition.
[0103] In some embodiments of the present application, the camera activation module 730 activates the front camera of the terminal device based on gravity data, including:
[0104] Based on the gravity data, determining whether the screen state of the terminal device is switched from a first state to a second state;
[0105] If the screen state of the terminal device switches from the first state to the second state, obtaining a second facial image;
[0106] Based on the first face image and the second face image, a front camera of the terminal device is started.
[0107] In some embodiments of the present application, the camera activation module 730 determines whether the screen state of the terminal device is switched from the first state to the second state based on the gravity data, including:
[0108] Based on the gravity data, determine the rotation angle of the terminal device;
[0109] If the rotation angle is greater than or equal to a preset angle threshold, it is determined that the screen state of the terminal device is switched from the first state to the second state.
[0110] In some embodiments of the present application, the gravity data includes a first acceleration value, a second acceleration value, and a third acceleration value. The camera start module 730 determines the rotation angle of the terminal device based on the gravity data, including:
[0111] Calculating and processing the first acceleration value and the second acceleration value to obtain a fourth acceleration value;
[0112] Dividing the fourth acceleration value and the third acceleration value to obtain a first proportional value;
[0113] An inverse tangent operation is performed on the first ratio value to obtain a rotation angle of the terminal device.
[0114] In some embodiments of the present application, the camera activation module 730 activates the front camera of the terminal device based on the first face image and the second face image, including:
[0115] Performing face detection on the second face image to obtain second position information of the face in the second face image;
[0116] Determining first size information of the face in the second face image based on the second position information;
[0117] Based on the first size information and the second size information of the face in the first face image, the front camera of the terminal device is started.
[0118] In some embodiments of the present application, the camera activation module 730 activates the front camera of the terminal device based on the first size information and the second size information of the face in the first face image, including:
[0119] Divide the first size information and the second size information to obtain a second ratio value;
[0120] If the second ratio value is less than the preset ratio threshold, the front camera of the terminal device is started.
[0121] The embodiment of the present application further provides a terminal device, which integrates any camera activation device provided in the embodiment of the present application, and the terminal device includes:
[0122] one or more processors;
[0123] Memory; and
[0124] One or more applications, wherein the one or more applications are stored in the memory and are configured to execute, by the processor, the steps of the camera startup method in any of the above camera startup method embodiments.
[0125] The present application also provides a terminal device, which integrates any camera activation device provided in the present application. Figure 6 As shown, it shows a schematic diagram of the structure of the terminal device involved in the embodiment of the present application, specifically:
[0126] The terminal device may include one or more processing core processors 801, one or more computer-readable storage media memories 802, a power supply 803, an input unit 804 and other components. Those skilled in the art will appreciate that Figure 6 The terminal device structure shown in the figure does not constitute a limitation on the terminal device, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently. Among them:
[0127] The processor 801 is the control center of the terminal device. It uses various interfaces and lines to connect various parts of the entire terminal device. By running or executing software programs and / or modules stored in the memory 802 and calling data stored in the memory 802, it executes various functions of the terminal device and processes data, thereby monitoring the terminal device as a whole. Optionally, the processor 801 may include one or more processing cores; preferably, the processor 801 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 801.
[0128] The memory 802 can be used to store software programs and modules. The processor 801 executes various functional applications and data processing by running the software programs and modules stored in the memory 802. The memory 802 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area may store data created according to the use of the terminal device, etc. In addition, the memory 802 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices. Accordingly, the memory 802 may also include a memory controller to provide the processor 801 with access to the memory 802.
[0129] The terminal device also includes a power supply 803 for supplying power to each component. Preferably, the power supply 803 can be logically connected to the processor 801 through a power management system, so as to manage charging, discharging, power consumption management and other functions through the power management system. The power supply 803 can also include one or more DC or AC power supplies, recharging systems, power failure detection circuits, power converters or inverters, power status indicators and other arbitrary components.
[0130] The terminal device may further include an input unit 804, which may be used to receive input digital or character information and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control.
[0131] Although not shown, the terminal device may further include a display unit, etc., which will not be described in detail herein. Specifically in this embodiment, the processor 801 in the terminal device will load the executable files corresponding to the processes of one or more application programs into the memory 802 according to the following instructions, and the processor 801 will run the application programs stored in the memory 802, thereby realizing various functions, as follows:
[0132] Obtaining first position information of a face in a first face image, and determining whether the first position information satisfies a first condition;
[0133] If the first position information satisfies the first condition, obtaining gravity data of the terminal device;
[0134] Based on the gravity data, the front camera of the terminal device is activated.
[0135] A person of ordinary skill in the art will appreciate that all or part of the steps in the various methods of the above embodiments may be completed by instructions, or by controlling related hardware through instructions. The instructions may be stored in a computer-readable storage medium and loaded and executed by a processor.
[0136] To this end, the embodiment of the present application provides a computer-readable storage medium, which may include: a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, etc. A computer program is stored thereon, and the computer program is loaded by a processor to execute the steps in any camera startup method provided in the embodiment of the present application. For example, the computer program loaded by the processor can execute the following steps:
[0137] Obtaining first position information of a face in a first face image, and determining whether the first position information satisfies a first condition;
[0138] If the first position information satisfies the first condition, obtaining gravity data of the terminal device;
[0139] Based on the gravity data, the front camera of the terminal device is activated.
[0140] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the detailed description of other embodiments above, and will not be repeated here.
[0141] In specific implementation, the above units or structures can be implemented as independent entities, or can be arbitrarily combined to be implemented as the same or several entities. The specific implementation of the above units or structures can refer to the previous method embodiments, which will not be repeated here.
[0142] The specific implementation of the above operations can be found in the previous embodiments, which will not be described in detail here.
[0143] The above is a detailed introduction to a camera startup method, device, terminal device and computer-readable storage medium provided in an embodiment of the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for technical personnel in this field, according to the idea of the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. A camera startup method, characterized in that: include: Obtaining first position information of a face in a first face image, and determining whether the first position information satisfies a first condition; If the first position information satisfies the first condition, obtaining gravity data of the terminal device; Based on the gravity data, the front camera of the terminal device is started.
2. The method according to claim 1, characterized in that The determining whether the first location information satisfies a first condition includes: Obtaining center position information of the first face image; Calculating and processing the first position information and the center position information to obtain a distance value; If the distance value is less than a preset distance threshold, it is determined that the first location information meets the first condition.
3. The method according to claim 1, characterized in that The step of starting the front camera of the terminal device based on the gravity data includes: Based on the gravity data, determining whether the screen state of the terminal device is switched from a first state to a second state; If the screen state of the terminal device is switched from the first state to the second state, acquiring a second facial image; Based on the first facial image and the second facial image, a front camera of the terminal device is started.
4. The method according to claim 3, characterized in that The determining, based on the gravity data, whether the screen state of the terminal device is switched from the first state to the second state comprises: Based on the gravity data, determining a rotation angle of the terminal device; If the rotation angle is greater than or equal to a preset angle threshold, it is determined that the screen state of the terminal device is switched from the first state to the second state.
5. The method according to claim 4, characterized in that The gravity data includes a first acceleration value, a second acceleration value and a third acceleration value; The determining the rotation angle of the terminal device based on the gravity data includes: Calculating and processing the first acceleration value and the second acceleration value to obtain a fourth acceleration value; Dividing the fourth acceleration value and the third acceleration value to obtain a first proportional value; An inverse tangent operation is performed on the first ratio value to obtain a rotation angle of the terminal device.
6. The method according to claim 3, characterized in that The method of starting the front camera of the terminal device based on the first face image and the second face image includes: Performing face detection on the second face image to obtain second position information of the face in the second face image; Determining first size information of the face in the second face image based on the second position information; Based on the first size information and the second size information of the face in the first face image, the front camera of the terminal device is started.
7. The method according to claim 6, characterized in that The method of starting the front camera of the terminal device based on the first size information and the second size information of the face in the first face image includes: Dividing the first size information and the second size information to obtain a second ratio value; If the second ratio value is less than a preset ratio threshold, the front camera of the terminal device is started.
8. A camera activation device, characterized in that: include: An information acquisition module, used to acquire first position information of a face in a first face image, and determine whether the first position information satisfies a first condition; a data acquisition module, configured to acquire gravity data of a terminal device if the first position information satisfies the first condition; A camera activation module is used to activate the front camera of the terminal device based on the gravity data.
9. A terminal device, characterized in that: The terminal device comprises: one or more processors, a memory and one or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the processor to implement the camera startup method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and the computer program is loaded by a processor to execute the steps in the camera startup method according to any one of claims 1 to 7.