Capture method, device and storage medium based on physical sensor

By collecting gyroscope data and exposure time in the terminal device and judging the jitter state during image acquisition, the problem of unclear images when capturing by the terminal device is solved, and a higher quality image acquisition is achieved.

CN118555487BActive Publication Date: 2025-03-21HONOR DEVICE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310208358.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-02-24
Publication Date
2025-03-21
Estimated Expiration
2043-02-24

AI Technical Summary

Technical Problem

The images obtained by the terminal device during capture may not be clear, resulting in not meeting user needs.

Method used

By using a physical sensor-based capture method, the status identification bit is updated by collecting the gyroscope data and exposure time of the terminal device, and the jitter state during image acquisition is determined whether to perform capture processing.

Benefits of technology

It effectively improves the clarity of the images during capture and ensures that the acquired images meet the needs of users.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118555487B_ABST
    Figure CN118555487B_ABST
Patent Text Reader

Abstract

The embodiment of the present application provides a capture method, device and storage medium based on a physical sensor. The method includes: when collecting images, the state identification bit at the first moment is a first identification; the state identification bit represents the degree of jitter of the terminal device when collecting images, and the first identification is a motion state identification or a static state identification; obtain the first gyroscope data and the first exposure time; the first gyroscope data is the data collected by the gyroscope of the terminal device when collecting the current frame image, and the first exposure time is the exposure time when collecting the current frame image; when the state identification bit at the second moment is the second identification, and the second identification is a static state identification, the current frame image is captured; the second moment is the moment of collecting the current frame image. The state identification bit is used as a new clarity parameter; before generating an image, it is pre-determined whether the collected current frame image is clear.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of terminal technology, and in particular to a capture method, device and storage medium based on a physical sensor. Background Art

[0002] With the advancement of technology and life, terminal devices have become important electronic tools in people's lives. Terminal devices can take pictures; terminal devices can realize snapshot functions, such as automatic snapshot and manual snapshot. Automatic snapshot means that after the terminal device triggers the camera application to enter the preview mode, the terminal device can automatically capture multiple images. Manual snapshot means that after the terminal device triggers the camera application to enter the preview mode, the user needs to press the photo button, and then the terminal device captures multiple images according to the user's trigger.

[0003] However, when the terminal device is capturing, the image obtained by the terminal device may not be clear, resulting in the image not meeting the needs of the user. Therefore, a method is urgently needed to make the image obtained clear when the terminal device is capturing. Summary of the invention

[0004] The embodiments of the present application provide a capture method, device and storage medium based on a physical sensor, which are applied to the field of terminal technology and solve the problem of unclear images obtained when the terminal device captures.

[0005] In a first aspect, an embodiment of the present application proposes a capture method based on a physical sensor. The method comprises:

[0006] When the terminal device captures an image, the state identification bit at the first moment is the first identification bit; wherein, the first moment is the moment of capturing the previous frame image of the current frame image; the state identification bit represents the degree of jitter of the terminal device when capturing the image, and the first identification bit is a motion state identification bit or a static state identification bit; the terminal device obtains first gyroscope data and a first exposure time; wherein, the first gyroscope data is the data collected by the gyroscope of the terminal device when capturing the current frame image, and the first exposure time is the exposure time when capturing the current frame image; the first gyroscope data and the first exposure time are used to update the state identification bit; when the state identification bit at the second moment is the second identification bit, and the second identification bit is the static state identification bit, the terminal device performs a snapshot process on the current frame image; wherein, the second moment is the moment of capturing the current frame image.

[0007] In this way, since the shaking of the terminal device is an important factor leading to the generation of blurred images, the state flag is updated based on the gyroscope data and exposure time of the terminal device when the terminal device collects the current frame image, and it is determined whether the state flag when collecting the current frame image is a static state flag or a motion state flag. The state flag is used as a new clarity parameter; before generating an image, if the state flag when collecting the current frame image is a static state flag, it is determined that the image is clear to a certain extent, and then the current frame image is captured; before generating an image, if the state flag when collecting the current frame image is a motion state flag, it is determined in advance that the collected current frame image is unclear, and the next frame image is directly analyzed.

[0008] In one possible implementation, the method further includes: when the first gyroscope data is greater than or equal to the dynamic threshold of the current frame image, the terminal device determines a motion counter plus a preset value; wherein the motion counter represents the continuous number of images whose gyroscope data is greater than or equal to the dynamic threshold of the image; the dynamic threshold is a threshold for distinguishing gyroscope data; the first exposure time is used to determine the dynamic threshold of the previous frame image; wherein the state identification bit at the first moment and the motion counter are used to determine the state identification bit at the second moment.

[0009] Thus, if it is determined that the first gyroscope data is greater than or equal to the dynamic threshold of the current frame image, the motion counter is updated, and then it is determined that the terminal device is in a shaking state, and the captured image may be unclear, but the clarity of the current frame image needs to be further determined.

[0010] In a possible implementation, the method further includes:

[0011] When the first identifier is a stationary state identifier and the motion counter is greater than or equal to a first preset counting threshold, the terminal device determines that the second identifier is a motion state identifier and clears the motion counter;

[0012] When the first identifier is a stationary state identifier and the motion counter is less than the first preset counting threshold, the terminal device determines that the second identifier is a stationary state identifier.

[0013] In this way, if the first flag is a static state flag, it is determined that the jitter of the terminal device when acquiring the last frame of image is small, and the value of the motion counter needs to be judged.

[0014] In a possible implementation, the first exposure time corresponds to a first time range segment, the first time range segment corresponds to a first threshold range segment, the first time range segment is a value range segment of the exposure time, and the first threshold range segment is a value range segment of a gyroscope threshold for determining gyroscope data; the exposure time in the first time range segment and the gyroscope threshold in the first threshold range segment are positively correlated;

[0015] The method further includes: the terminal device performing a mapping calculation on the first exposure time, the first time range segment, and the first threshold range segment to obtain a dynamic threshold of the current frame image.

[0016] In this way, the terminal device determines the dynamic threshold value of the current frame image in real time according to the first exposure time of the current frame image; wherein the dynamic threshold value is a threshold value used to distinguish gyroscope data.

[0017] In a possible implementation, the method further includes:

[0018] When the first gyroscope data is smaller than the dynamic threshold of the current frame image, the terminal device determines a still counter plus a preset value; wherein the still counter represents the continuous number of images whose gyroscope data is smaller than the dynamic threshold of the image; wherein the state flag at the first moment and the still counter are used to determine the state flag at the second moment.

[0019] Thus, if it is determined that the first gyroscope data is less than the dynamic threshold of the current frame image, the static counter is updated, and then it is determined that the terminal device is in a state of less jitter, the captured image is clear to a certain extent, and then the clarity of the current frame image is further determined.

[0020] In a possible implementation, the method further includes:

[0021] When the first identifier is a motion state identifier and the static counter is greater than or equal to a second preset counting threshold, the terminal device determines that the second identifier is a static state identifier and clears the static counter;

[0022] When the first identifier is a motion state identifier and the stationary counter is less than the second preset counting threshold, the terminal device determines that the second identifier is a motion state identifier.

[0023] In this way, if the first identifier is a motion state identifier, it is determined that the terminal device has a large jitter when capturing the last frame of image, and the value of the still counter needs to be determined.

[0024] In a possible implementation, the first exposure time corresponds to a second time range, the first time range corresponds to a second threshold range, the second time range is a value range of the exposure time, and the second threshold range is a value range for determining a count threshold of a still counter; the exposure time in the second time range is positively correlated with the gyroscope threshold in the second threshold range;

[0025] The method further comprises:

[0026] The terminal device performs mapping calculation on the first exposure time, the second time range segment, and the second threshold range segment to obtain the second preset counting threshold.

[0027] In this way, the lower the brightness of the ambient light (i.e., dark light environment), the longer the exposure time when shooting the image, and the larger the counting threshold corresponding to the still counter needs to be, so that the process of steps S416-S417 is not easy to reach a stable state (i.e., stillness), and avoid the terminal device shooting unclear images. Therefore, it is necessary to determine the second preset counting threshold of the current frame image in real time according to the first exposure time of the current frame image.

[0028] In a possible implementation, the method further includes:

[0029] When the state flag at the second moment is a second flag, and the second flag is a motion state flag, the terminal device captures a next frame of image.

[0030] In this way, if it is determined that the state flag when the current frame image is collected is a motion state flag, there is no need to capture the current frame image, and the next frame image can be directly processed.

[0031] In a possible implementation, when the state flag at the second moment is a second flag, and the second flag is a static state flag, before the terminal device performs snapshot processing on the current frame image, the method further includes:

[0032] When the first gyroscope data is greater than or equal to a preset limit value, the terminal device determines that the state identification bit at the second moment is a second identification, and the second identification is the same as the first identification;

[0033] When the first gyroscope data is less than the preset limit value, the terminal device determines that when the state identification bit at the second moment is the second identification bit and the second identification bit is the static state identification bit, the terminal device performs a snapshot process on the current frame image.

[0034] In this way, if the terminal device determines that the acceleration value represented by the first gyroscope data of the current frame image is greater than or equal to the preset limit value, it can be determined that the gyroscope is abnormal when the terminal device collects the current frame image, or the data collected by the gyroscope is abnormal.

[0035] In a possible implementation manner, the terminal device performs a capture process on the current frame image, including:

[0036] The terminal device determines the image parameters of the current frame image;

[0037] When the image parameter is greater than or equal to a preset parameter threshold, the terminal device captures the current frame image.

[0038] In this way, when it is determined that the state flag when the current frame image is collected is the motion state flag, other definition parameters are determined to complete the capture processing of the current frame image.

[0039] In a possible implementation, the image parameters include one or more of the following: parameters obtained by an image processing method based on a spatial domain, parameters obtained by an image processing method based on a frequency domain, and parameters obtained by an image processing method based on a deep learning model.

[0040] In a second aspect, an embodiment of the present application provides a terminal device, which may also be referred to as a terminal, user equipment (UE), mobile station (MS), mobile terminal (MT), etc. The terminal device may be a mobile phone, a smart TV, a wearable device, a tablet computer (Pad), a computer with wireless transceiver function, a virtual reality (VR) terminal device, an augmented reality (AR) terminal device, a wireless terminal in industrial control, a wireless terminal in self-driving, a wireless terminal in remote medical surgery, a wireless terminal in smart grid, a wireless terminal in transportation safety, a wireless terminal in smart city, a wireless terminal in smart home, etc. The terminal device may also be a drone.

[0041] The terminal device comprises: a processor and a memory; the memory stores computer-executable instructions; the processor executes the computer-executable instructions stored in the memory, so that the terminal device executes the method of the first aspect.

[0042] In a third aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program. When the computer program is executed by a processor, the method of the first aspect is implemented.

[0043] In a fourth aspect, an embodiment of the present application provides a computer program product, which includes a computer program. When the computer program is executed, the computer executes the method of the first aspect.

[0044] In a fifth aspect, an embodiment of the present application provides a chip, the chip including a processor, the processor being used to call a computer program in a memory to execute the method described in the first aspect.

[0045] It should be understood that the second to fifth aspects of the present application correspond to the technical solutions of the first aspect of the present application, and the beneficial effects achieved by each aspect and the corresponding feasible implementation methods are similar and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] Figure 1 A schematic diagram of the structure of the terminal device 100 is shown;

[0047] Figure 2 is a software structure block diagram of the terminal device 100 according to an embodiment of the present application;

[0048] Figure 3 A schematic diagram of a process of capturing a photo based on a physical sensor provided in an embodiment of the present application Figure 1 ;

[0049] Figure 4 A schematic diagram of a capture method based on a physical sensor provided in an embodiment of the present application Figure 2 ;

[0050] Figure 5 A block diagram of the software layer of a terminal device provided in an embodiment of the present application;

[0051] Figure 6 The figure shows a schematic diagram of the structure of a chip provided in an embodiment of the present application;

[0052] Figure 7 A schematic diagram of the structure of a terminal device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0053] In order to facilitate the clear description of the technical solutions of the embodiments of the present application, in the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design described as "exemplary" or "for example" in the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.

[0054] In the embodiments of the present application, "at least one" refers to one or more, and "plurality" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, or c can represent: a, b, c, ab, ac, bc, or abc, where a, b, c can be single or multiple.

[0055] It should be noted that the "at..." in the embodiment of the present application can be the instant when a certain situation occurs, or a period of time after a certain situation occurs, and the embodiment of the present application does not specifically limit this. In addition, the display interface provided in the embodiment of the present application is only an example, and the display interface can also include more or less content.

[0056] With the advancement of technology and life, terminal devices have become important electronic tools in people's lives. Terminal devices can take photos. Terminal devices provide artificial intelligence (AI) snapshot function. Terminal devices can output the recognition results in the preview stream (preview image stream) based on the AI ​​recognition algorithm, for example, recognize a person's smile, natural beauty, etc.; the terminal device automatically selects the most exciting frame of the photo for the user based on the recognition result and captures it.

[0057] Among them, the AI ​​capture function includes automatic capture and manual capture.

[0058] Automatic capture means that when a user opens the camera preview of a terminal device, the terminal device triggers the camera application to enter the preview mode, and then the terminal device can automatically capture multiple images.

[0059] Manual capture means that when the user opens the terminal device camera preview, the terminal device triggers the camera application to enter the preview mode; then the user is required to press the photo button, so that the terminal device takes multiple images according to the user's trigger.

[0060] When the terminal device is capturing, the image obtained by the terminal device may not be clear, resulting in the image not meeting the needs of the user. Therefore, a method is urgently needed to make the image obtained clear when the terminal device is capturing.

[0061] Electronic devices include terminal devices, which may also be referred to as terminals, user equipment (UE), mobile stations (MS), mobile terminals (MT), etc. Terminal devices may be mobile phones, smart TVs, wearable devices, tablet computers (Pad), computers with wireless transceiver functions, virtual reality (VR) terminal devices, augmented reality (AR) terminal devices, wireless terminals in industrial control, wireless terminals in self-driving, wireless terminals in remote medical surgery, wireless terminals in smart grids, wireless terminals in transportation safety, wireless terminals in smart cities, wireless terminals in smart homes, etc. The embodiments of the present application do not limit the specific technology and specific device form used by the terminal devices.

[0062] In order to better understand the embodiment of the present application, the structure of the terminal device in the embodiment of the present application is introduced below:

[0063] Figure 1The structure diagram of the terminal device 100 is shown. The terminal device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.

[0064] It is understood that the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the terminal device 100. In other embodiments of the present application, the terminal device 100 may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.

[0065] The processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.

[0066] The controller can generate operation control signals according to the instruction operation code and timing signal to complete the control of instruction fetching and execution.

[0067] The processor 110 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may store instructions or data that the processor 110 has just used or cyclically used. If the processor 110 needs to use the instruction or data again, it may be called from the memory. This avoids repeated access, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.

[0068] The wireless communication function of the terminal device 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.

[0069] The terminal device 100 implements the display function through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs, which execute program instructions to generate or change display information.

[0070] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-oLed, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the terminal device 100 may include 1 or N display screens 194, where N is a positive integer greater than 1.

[0071] The terminal device 100 can realize the shooting function through ISP, camera 193, video codec, GPU, display screen 194 and application processor.

[0072] ISP is used to process the data fed back by camera 193. For example, when taking a photo, the shutter is opened, and the light is transmitted to the camera photosensitive element through the lens. The light signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to ISP for processing and converts it into an image visible to the naked eye. ISP can also perform algorithm optimization on the noise, brightness, and skin color of the image. ISP can also optimize the exposure, color temperature and other parameters of the shooting scene. In some embodiments, ISP can be set in camera 193.

[0073] The camera 193 is used to capture still images or videos. The object generates an optical image through the lens and projects it onto the photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, and then passes the electrical signal to the ISP to be converted into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV or other format. In some embodiments, the terminal device 100 may include 1 or N cameras 193, where N is a positive integer greater than 1.

[0074] The digital signal processor is used to process digital signals, and can process not only digital image signals but also other digital signals. For example, when the terminal device 100 is selecting a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy.

[0075] NPU is a neural network (NN) computing processor. By drawing on the structure of biological neural networks, such as the transmission mode between neurons in the human brain, it can quickly process input information and can also continuously self-learn. Through NPU, applications such as intelligent cognition of the terminal device 100 can be realized, such as image recognition, face recognition, voice recognition, text understanding, etc.

[0076] The terminal device 100 can implement audio functions such as music playing and recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the application processor.

[0077] The pressure sensor 180A is used to sense the pressure signal and can convert the pressure signal into an electrical signal. In some embodiments, the pressure sensor 180A can be set on the display screen 194. There are many types of pressure sensors 180A, such as resistive pressure sensors, inductive pressure sensors, capacitive pressure sensors, etc. A capacitive pressure sensor can be a parallel plate including at least two conductive materials. When a force acts on the pressure sensor 180A, the capacitance between the electrodes changes. The terminal device 100 determines the intensity of the pressure based on the change in capacitance. When a touch operation acts on the display screen 194, the terminal device 100 detects the intensity of the touch operation according to the pressure sensor 180A. The terminal device 100 can also calculate the position of the touch based on the detection signal of the pressure sensor 180A. In some embodiments, touch operations acting on the same touch position but with different touch operation intensities can correspond to different operation instructions.

[0078] The gyroscope sensor 180B can be used to determine the motion posture of the terminal device 100. In some embodiments, the angular velocity of the terminal device 100 around three axes (i.e., x, y, and z axes) can be determined by the gyroscope sensor 180B. The gyroscope sensor 180B can be used for anti-shake shooting. For example, when the shutter is pressed, the gyroscope sensor 180B detects the angle of the terminal device 100 shaking, calculates the distance that the lens module needs to compensate based on the angle, and allows the lens to offset the shaking of the terminal device 100 through reverse movement to achieve anti-shake. The gyroscope sensor 180B can also be used for navigation and somatosensory game scenes.

[0079] The air pressure sensor 180C is used to measure air pressure. In some embodiments, the terminal device 100 calculates the altitude through the air pressure value measured by the air pressure sensor 180C to assist positioning and navigation.

[0080] The magnetic sensor 180D includes a Hall sensor. The terminal device 100 can use the magnetic sensor 180D to detect the opening and closing of the flip leather case. In some embodiments, when the terminal device 100 is a flip phone, the terminal device 100 can detect the opening and closing of the flip cover according to the magnetic sensor 180D. Then, according to the detected opening and closing state of the leather case or the opening and closing state of the flip cover, the flip cover automatic unlocking and other features are set.

[0081] The acceleration sensor 180E can detect the magnitude of the acceleration of the terminal device 100 in all directions (generally three axes). When the terminal device 100 is stationary, the magnitude and direction of gravity can be detected. It can also be used to identify the posture of the terminal device and applied to applications such as horizontal and vertical screen switching and pedometers.

[0082] The distance sensor 180F is used to measure the distance. The terminal device 100 can measure the distance by infrared or laser. In some embodiments, when shooting a scene, the terminal device 100 can use the distance sensor 180F to measure the distance to achieve fast focusing.

[0083] The touch sensor 180K is also called a "touch control device". The touch sensor 180K can be set on the display screen 194, and the touch sensor 180K and the display screen 194 form a touch screen, also called a "touch control screen". The touch sensor 180K is used to detect touch operations acting on or near it. The touch sensor can pass the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through the display screen 194. In other embodiments, the touch sensor 180K can also be set on the surface of the terminal device 100, which is different from the position of the display screen 194.

[0084] The key 190 includes a power key, a volume key, etc. The key 190 may be a mechanical key or a touch key. The terminal device 100 may receive key input and generate key signal input related to user settings and function control of the terminal device 100.

[0085] The software system of the terminal device 100 may adopt a layered architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture, etc. The embodiment of the present application takes the Android system of the layered architecture as an example to exemplify the software structure of the terminal device 100.

[0086] Figure 2 It is a software structure block diagram of the terminal device 100 according to an embodiment of the present application.

[0087] The layered architecture divides the software into several layers, each with clear roles and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, from top to bottom: the application layer, the application framework layer, the Android runtime and system library, and the kernel layer.

[0088] The application layer can include a series of application packages.

[0089] like Figure 2 As shown, the application package may include applications such as camera, calendar, phone, map, call, music, settings, mailbox, video, social, etc.

[0090] The application framework layer provides an application programming interface (API) and a programming framework for the applications in the application layer. The application framework layer includes some predefined functions.

[0091] like Figure 2 As shown, the application framework layer may include a window manager, a content provider, a resource manager, a view system, a notification manager, and the like.

[0092] The window manager is used to manage window programs. The window manager can obtain the display size, determine whether there is a status bar, lock the screen, touch the screen, drag the screen, capture the screen, etc.

[0093] Content providers are used to store and retrieve data and make it accessible to applications. The data can include videos, images, audio, calls made and received, browsing history and bookmarks, phone books, etc.

[0094] Android runtime includes core libraries and virtual machines. Android runtime is responsible for scheduling and management of the Android system.

[0095] The core library consists of two parts: one part is the function that needs to be called by the Java language, and the other part is the Android core library.

[0096] The application layer and the application framework layer run in a virtual machine. The virtual machine executes the Java files of the application layer and the application framework layer as binary files. The virtual machine is used to perform functions such as object life cycle management, stack management, thread management, security and exception management, and garbage collection.

[0097] The system library may include multiple functional modules, such as surface manager, media library, 3D graphics processing library (such as OpenGL ES), 2D graphics engine (such as SGL), etc.

[0098] The surface manager is used to manage the display subsystem and provide the fusion of 2D and 3D layers for multiple applications.

[0099] The media library supports playback and recording of a variety of commonly used audio and video formats, as well as static image files, etc. The media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.

[0100] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.

[0101] A 2D graphics engine is a drawing engine for 2D drawings.

[0102] The kernel layer is the layer between hardware and software. The kernel layer contains at least display driver, camera driver, audio driver, and sensor driver.

[0103] The following is an illustrative description of the software and hardware workflow of the terminal device 100 in conjunction with a scenario where an application is started or an interface switch occurs in an application.

[0104] When the touch sensor 180K receives a touch operation, the corresponding hardware interrupt is sent to the kernel layer. The kernel layer processes the touch operation into raw input events (including touch coordinates, touch strength, timestamp of the touch operation, and other information). The raw input events are stored in the kernel layer. The application framework layer obtains the raw input events from the kernel layer and identifies the control corresponding to the input event. For example, if the touch operation is a touch single-click operation and the control corresponding to the single-click operation is the control of the mailbox application icon, the mailbox application calls the interface of the application framework layer to start the mailbox application, and then starts the display driver by calling the kernel layer to display the functional interface of the mailbox application.

[0105] The solution provided by the embodiment of the present application is described in detail below with reference to the accompanying drawings.

[0106] The terminal device of the present application may be a mobile phone, or an intelligent imaging device such as a drone.

[0107] Figure 3 A schematic diagram of a capture method based on a physical sensor provided in an embodiment of the present application Figure 1 .like Figure 4 As shown, the method may include:

[0108] S301, when the terminal device captures an image, the state identification bit at the first moment is the first identification; wherein the first moment is the moment of capturing the previous frame image of the current frame image; the state identification bit represents the degree of jitter of the terminal device when capturing the image, and the first identification is a motion state identification or a static state identification.

[0109] Exemplarily, after the terminal device enters the preview mode of the camera, the terminal device captures images, and each frame of the image is acquired based on the preview stream (i.e., the image stream). For each frame of the image, the terminal device must determine the status information of each frame of the image according to the scheme of the present application; wherein the status information represents the degree of jitter of the terminal device when capturing the image, and the degree of jitter is a static state or a moving state. The status information is a static state, which represents that the terminal device is in a static state (for example, not jittering, not being moved) when capturing the image. The status information is a moving state, which represents that the terminal device is in a moving state (for example, jittering, being moved) when capturing the image.

[0110] In the present application, a status flag is set; for each frame of image, the status flag is updated to obtain the status information of each frame of image.

[0111] The state flag indicates the degree of shaking of the terminal device when capturing an image. The state flag may be a moving state flag (is_moving) or a stationary state flag (is_stable).

[0112] The "status flag" is used as a new definition parameter. Then, the terminal device decides whether to complete the capture process of the current frame image based on the "status flag".

[0113] When the terminal device collects images, when the terminal device collects the last frame of image at the first moment, the state flag is assigned a first flag, for example, the first flag is a moving state flag (is_moving) or a stationary state flag (is_stable).

[0114] S302, the terminal device obtains first gyroscope data and a first exposure time; wherein, the first gyroscope data is the data collected by the gyroscope of the terminal device when collecting the current frame image, and the first exposure time is the exposure time when collecting the current frame image; the first gyroscope data and the first exposure time are used to update the status identification bit.

[0115] Exemplarily, since a gyroscope is provided in the terminal device, the gyroscope can obtain gyroscope data (gyro data); the gyroscope data is a kind of attitude data, and the gyroscope data represents the attitude acceleration of the terminal device.

[0116] The terminal device collects the current frame image at the second moment. The gyroscope in the terminal device will synchronously collect the first gyroscope data, and the terminal device can determine the first exposure time when collecting the current frame image. It can be seen that the first gyroscope data is the data collected by the gyroscope of the terminal device when collecting the current frame image.

[0117] The first gyroscope data is the attitude acceleration collected by the gyroscope when the terminal device collects the current frame image.

[0118] The first exposure time refers to the time interval from the opening to the closing of the shutter when the terminal device captures the current frame image.

[0119] S303: When the state flag at the second moment is the second flag, and the second flag is the static state flag, the terminal device performs a snapshot process on the current frame image; wherein the second moment is the moment of capturing the current frame image.

[0120] Exemplarily, the terminal device updates the status flag according to the first gyroscope data and the first exposure time, and thereby obtains the status flag at the second moment.

[0121] The terminal device determines that the state flag at the second moment is a stationary state flag (is_stable); that is, the second flag is determined to be a stationary state flag (is_stable). The terminal device determines that the current frame image collected may be clear. Thus, the state flag is used as a new clarity parameter.

[0122] Then, the terminal device determines the image parameters of the current frame image based on the preset image processing method. If the terminal device determines that the image parameters meet the preset conditions (for example, the image parameters are greater than or equal to the preset parameter threshold), it further determines that the current frame image is clear. Then, the terminal device completes the capture processing of the current frame image, for example, displays or stores the current frame image.

[0123] In this embodiment, since the shaking of the terminal device is an important factor leading to the generation of blurred images, the state flag is updated based on the gyroscope data and exposure time of the terminal device when the terminal device collects the current frame image, and it is determined whether the state flag when collecting the current frame image is a static state flag or a motion state flag. The state flag is used as a new clarity parameter; before generating an image, if the state flag when collecting the current frame image is a static state flag, it is determined that the image is clear to a certain extent, and then the current frame image is captured; before generating an image, if the state flag when collecting the current frame image is a motion state flag, it is determined in advance that the collected current frame image is unclear, and the next frame image is directly analyzed.

[0124] Figure 4 A schematic diagram of a capture method based on a physical sensor provided in an embodiment of the present application Figure 2 .like Figure 4 As shown, the method may include:

[0125] S401, when the terminal device captures an image, the state identification bit at the first moment is the first identification; wherein the first moment is the moment of capturing the previous frame image of the current frame image; the state identification bit represents the degree of jitter of the terminal device when capturing the image, and the first identification is a motion state identification or a static state identification.

[0126] Exemplarily, after the terminal device enters the preview mode of the camera, the terminal device captures images, and each frame of the image is acquired based on the preview stream (i.e., the image stream). For each frame of the image, the terminal device must determine the status information of each frame of the image according to the scheme of the present application; wherein the status information represents the degree of jitter of the terminal device when capturing the image, and the degree of jitter is a static state or a moving state. The status information is a static state, which represents that the terminal device is in a static state (for example, not jittering, not being moved) when capturing the image. The status information is a moving state, which represents that the terminal device is in a moving state (for example, jittering, being moved) when capturing the image.

[0127] In the present application, a status flag is set; for each frame of image, the status flag is updated to obtain the status information of each frame of image.

[0128] The state flag indicates the degree of shaking of the terminal device when capturing an image. The state flag may be a moving state flag (is_moving) or a stationary state flag (is_stable).

[0129] The "status flag" is used as a new definition parameter. Then, the terminal device decides whether to complete the capture process of the current frame image based on the "status flag".

[0130] When the terminal device collects images, when the terminal device collects the last frame of image at the first moment, the state flag is assigned a first flag, for example, the first flag is a moving state flag (is_moving) or a stationary state flag (is_stable).

[0131] S402, the terminal device obtains first gyroscope data and a first exposure time; wherein, the first gyroscope data is the data collected by the gyroscope of the terminal device when collecting the current frame image, and the first exposure time is the exposure time when collecting the current frame image; the first gyroscope data and the first exposure time are used to update the status identification bit.

[0132] Exemplarily, since a gyroscope is provided in the terminal device, the gyroscope can obtain gyroscope data (gyro data); the gyroscope data is a kind of attitude data, and the gyroscope data represents the attitude acceleration of the terminal device.

[0133] The terminal device collects the current frame image at the second moment. The gyroscope in the terminal device will synchronously collect the first gyroscope data, and the terminal device can determine the first exposure time when collecting the current frame image. It can be seen that the first gyroscope data is the data collected by the gyroscope of the terminal device when collecting the current frame image.

[0134] The first gyroscope data is the attitude acceleration collected by the gyroscope when the terminal device collects the current frame image.

[0135] The first exposure time refers to the time interval from the opening to the closing of the shutter when the terminal device captures the current frame image.

[0136] S403: The terminal device determines whether the first gyroscope data is greater than or equal to a preset limit value.

[0137] Exemplarily, after step S402, the terminal device first determines whether the acceleration value represented by the first gyroscope data of the current frame image exceeds a preset limit value.

[0138] The preset limit value is a gyroscope threshold used to determine the acceleration value represented by the gyroscope data, and the preset limit value may be an empirical value.

[0139] S404: When the first gyroscope data is greater than or equal to a preset limit value, the terminal device determines that the state identification bit at the second moment is a second identification, and the second identification is the same as the first identification;

[0140] Exemplarily, after step S403, if the terminal device determines that the acceleration value represented by the first gyroscope data of the current frame image is greater than or equal to a preset limit value, it can be determined that the gyroscope is abnormal when the terminal device collects the current frame image, or the data collected by the gyroscope is abnormal.

[0141] At this time, the terminal device does not need to update the motion counter or the stationary counter, and can directly determine that the state flag at the second moment is the same as the state flag at the first moment, thereby keeping the state flag unchanged.

[0142] For example, if the terminal device determines that the acceleration value represented by the first gyroscope data of the current frame image is greater than or equal to the preset limit value, then if the state flag at the first moment is a motion state flag, then the state flag at the first moment is also a motion state flag. If the terminal device determines that the acceleration value represented by the first gyroscope data of the current frame image is greater than or equal to the preset limit value, then if the state flag at the first moment is a stationary state flag, then the state flag at the first moment is also a stationary state flag.

[0143] If the terminal device determines that the acceleration value represented by the first gyroscope data of the current frame image is greater than or equal to the preset limit value, the terminal device does not execute steps S405-S417; and directly executes step S418 or step S419.

[0144] S405. When the first gyroscope data is less than a preset limit value, execute step S407.

[0145] For example, after step S403, if the terminal device determines that the acceleration value represented by the first gyroscope data of the current frame image is less than the preset limit value, the gyroscope is normal when the terminal device collects the current frame image, or the data collected by the gyroscope is normal. Then, step S407 is executed.

[0146] S406: The terminal device performs mapping calculation on the first exposure time, the first time range segment, and the first threshold range segment to obtain a dynamic threshold of the current frame image.

[0147] Among them, the first exposure time corresponds to the first time range segment, the first time range segment corresponds to the first threshold range segment, the first time range segment is the value range segment of the exposure time, and the first threshold range segment is the value range segment of the gyroscope threshold used to determine the gyroscope data; the exposure time in the first time range segment and the gyroscope threshold in the first threshold range segment are positively correlated.

[0148] For example, before step S407, step S406 needs to be performed first to determine the dynamic threshold of the current frame image in real time according to the first exposure time of acquiring the current frame image, wherein the dynamic threshold is a threshold for distinguishing gyroscope data.

[0149] Furthermore, after step S402, after the first exposure time is obtained, step S406 can be executed.

[0150] In this step, the terminal device needs to determine the dynamic threshold of the current frame image in real time according to the first exposure time of the current frame image; wherein the dynamic threshold is a threshold used to distinguish gyroscope data. The terminal device distinguishes the first gyroscope data of the current frame image according to the dynamic threshold of the current frame image to determine the degree of jitter when the terminal device collects the current frame image.

[0151] First, since the terminal device has obtained the first exposure time of the current frame image, the terminal device can determine the dynamic threshold that matches the current frame image in real time based on the first exposure time of the current frame image; the dynamic threshold that matches the current frame image is the threshold used to determine the first gyroscope data of the current frame image.

[0152] In one example, the exposure time value range of the terminal device is divided into a plurality of first time range segments. For each first time range segment, the first time range segment is a value range segment of the exposure time. The way of dividing the value range of the exposure time of the terminal device can determine the value range of each time range segment based on the shooting effect obtained by the experimental test method. Among them, the difference between the maximum value and the minimum value in each first time range segment is the same or different; there is no restriction on this, and it is set according to the needs.

[0153] In addition, the exposure time value range of the terminal device corresponds to the gyroscope threshold value range, and the gyroscope threshold value range includes multiple gyroscope thresholds, and the gyroscope threshold value in the gyroscope threshold value range is an empirical value. The gyroscope threshold value range is divided to obtain multiple preset first threshold range segments, and each first time range segment corresponds to each first threshold range segment. Among them, the preset first threshold range segment is a gyroscope threshold value range segment used to distinguish gyroscope data. For each first time range segment, the maximum exposure time in the first time range segment and the maximum gyroscope threshold in the first threshold range segment corresponding to the first time range segment correspond to each other; that is, the gyroscope threshold corresponding to the maximum exposure time in the first time range segment is the maximum gyroscope threshold in the first threshold range segment corresponding to the first time range segment. For each first time range segment, the minimum exposure time in the first time range segment and the minimum gyroscope threshold in the first threshold range segment corresponding to the first time range segment are corresponding to each other; that is, the gyroscope threshold corresponding to the minimum exposure time in the first time range segment is the minimum gyroscope threshold in the first threshold range segment corresponding to the first time range segment.

[0154] The division of the value range of the gyroscope threshold can be based on the shooting effect obtained by the experimental test method to determine the value range of the first threshold range segment.

[0155] There is a one-to-one correspondence between the first time range and the first threshold range. The exposure time in the first time range and the gyroscope threshold in the first threshold range are positively correlated; the greater the exposure time, the greater the gyroscope threshold.

[0156] Through the above process, the exposure time value range is quantized into a plurality of first time range segments; the first time range segment is the exposure time value range segment. Each first time range segment has a maximum exposure time and a minimum exposure time corresponding to the first time range segment.

[0157] The value range of the gyroscope threshold is quantized into a plurality of first threshold range segments; the first threshold range segment is a value range segment of the gyroscope threshold used to distinguish gyroscope data. Each first threshold range segment has a maximum gyroscope threshold and a minimum gyroscope threshold corresponding to the first threshold range segment.

[0158] In the process of quantizing the exposure time value range into a plurality of first time range segments, the number of the first time range segments can be adjusted in real time for each frame of image. In the process of quantizing the gyroscope threshold value range into a plurality of first threshold range segments, the number of the first threshold range segments can be adjusted in real time for each frame of image.

[0159] Then, since the first exposure time of the current frame image has been acquired, the first time range segment to which the first exposure time of the current frame image belongs can be determined, that is, the first time range segment corresponding to the first exposure time of the current frame image is obtained.

[0160] Since there is a one-to-one correspondence between the first time range and the first threshold range, the first time range corresponding to the first exposure time of the current frame image and the first threshold range corresponding thereto can also be determined. That is, the first threshold range corresponding to the first exposure time of the current frame image is determined.

[0161] Then, a linear mapping process is performed on the first exposure time corresponding to the current frame image, the first time range corresponding to the first exposure time of the current frame image, and the first threshold range corresponding to the first time range to obtain a dynamic threshold matching the current frame image (i.e., the dynamic threshold corresponding to the current frame image). The dynamic threshold matching the current frame image is a threshold for distinguishing the first gyroscope data of the current frame image.

[0162] For example, a first-order linear mapping calculation is performed on the first exposure time corresponding to the current frame image, the first time range segment corresponding to the first exposure time of the current frame image, and the first threshold range segment corresponding to the first time range segment to obtain a dynamic threshold matching the current frame image.

[0163] For another example, a second-order linear mapping calculation is performed on the first exposure time corresponding to the current frame image, the first time range segment corresponding to the first exposure time of the current frame image, and the first threshold range segment corresponding to the first time range segment to obtain a dynamic threshold matching the current frame image.

[0164] For example, the exposure time value range is [100, 200]. The exposure time value range [100, 200] is quantized into multiple first time range segments, and the multiple first time range segments are respectively the first time range segment [100, 125], the first time range segment [125, 150], the first time range segment [150, 175], and the first time range segment [175, 200].

[0165] The value range of the gyroscope threshold is [0.1, 0.7]. According to the value range of the exposure time [100, 200], the value range of the gyroscope threshold [0.1, 0.7] is quantized into multiple first threshold range segments, and the multiple first threshold range segments are respectively the first threshold range segment [0.1, 0.2], the first threshold range segment [0.2, 0.3], the first threshold range segment [0.3, 0.6], and the first threshold range segment [0.6, 0.7].

[0166] The first exposure time corresponding to the current frame image has been obtained as x=130. It can be determined that the first exposure time 130 corresponding to the current frame image corresponds to the first time range [125,150]; the first time range [125,150] corresponds to the first threshold range [0.2,0.3]. However, at this time, the gyroscope threshold corresponding to the first exposure time corresponding to the current frame image cannot be directly determined.

[0167] It is necessary to calculate the first exposure time 130, the first time range segment [125, 150], and the first threshold range segment [0.2, 0.3] corresponding to the current frame image (for example, first-order linear mapping, or second-order linear mapping), and then obtain the dynamic threshold of the current frame image. The dynamic threshold of the current frame image is the threshold of the first gyroscope data used to determine the current frame image.

[0168] For example, the dynamic threshold y1=(0.3-0.2) / (150-125)*(130-125)+0.2=0.22 corresponding to the current frame image can be calculated based on the first exposure time 130, the first time range [125,150], and the first threshold range [0.2,0.3] corresponding to the current frame image.

[0169] S407: The terminal device determines whether the first gyroscope data is greater than or equal to a dynamic threshold of the current frame image.

[0170] Exemplarily, after step S405, the terminal device determines whether the first gyroscope data when the current frame image is collected is greater than or equal to the dynamic threshold of the current frame image, wherein the dynamic threshold of the current frame image is determined by the above step S406.

[0171] S408: When the first gyroscope data is greater than or equal to the dynamic threshold of the current frame image, the terminal device determines that the motion counter is added with a preset value.

[0172] The motion counter represents the number of consecutive images whose gyroscope data is greater than or equal to the dynamic threshold of the image; the dynamic threshold is a threshold for distinguishing gyroscope data; the first exposure time is used to determine the dynamic threshold of the previous frame image. The state flag and the motion counter at the first moment are used to determine the state flag at the second moment.

[0173] Exemplarily, after step S407, if the terminal device determines that the first gyroscope data is greater than or equal to the dynamic threshold of the current frame image, the terminal device adds a preset value to the motion counter, for example, adds 1 to the motion counter.

[0174] It can be seen that the value of the motion counter can indicate the number of consecutive images whose gyroscope data is greater than or equal to the dynamic threshold of the image.

[0175] S409: The terminal device determines whether the first flag is a static state flag. That is, the terminal device determines whether the state flag at the first moment is a static state flag.

[0176] Exemplarily, after step S408, the terminal device determines whether the state flag at the first moment is a stationary state flag (is_stable).

[0177] S410: When the first identifier is a stationary state identifier, the terminal device determines whether the motion counter is greater than or equal to a first preset counting threshold.

[0178] Exemplarily, after step S409, the terminal device determines that the state flag at the first moment is a stationary state flag (is_stable); that is, the terminal device determines that the first flag is a stationary state flag (is_stable). At this time, when the terminal device collects the previous frame of image, according to the solution of this embodiment, it is determined that when collecting the previous frame of image, the state flag is set to the stationary state flag (is_stable).

[0179] At this time, the terminal device has updated the value of the motion counter in step S408. The terminal device first determines whether the value of the motion counter is greater than or equal to the first preset counting threshold.

[0180] The first preset counting threshold used to determine the value of the motion counter may be a preset fixed value, which is an empirical value. For example, the value of the first preset counting threshold is 5.

[0181] For the first frame image, the state flag at the time of capturing the first frame image may be set to a motion state flag (is_moving).

[0182] S411: When the first identifier is a stationary state identifier and the motion counter is greater than or equal to a first preset counting threshold, the terminal device determines that the second identifier is a motion state identifier and clears the motion counter;

[0183] Exemplarily, after step S410, the terminal device determines that the state flag at the first moment is a stationary state flag (is_stable), that is, determines that the first flag is a stationary state flag; and the terminal determines that the motion counter is greater than or equal to a first preset count threshold.

[0184] At this time, since the state flag at the first moment is a static state flag, it can be determined that the terminal device had a small jitter when capturing the previous frame of image, and the previous frame of image can be considered clear. Then, if the value of the motion counter is greater than or equal to the first preset count threshold, it can be determined that the terminal device is continuously in a state of large jitter, and the current frame of image captured can be considered unclear.

[0185] Therefore, the terminal device determines that the state flag at the second moment is the moving state flag (is_moving), that is, determines that the second flag is the moving state flag. In addition, the terminal device clears the movement counter.

[0186] S412: When the first identifier is a stationary state identifier and the motion counter is less than a first preset counting threshold, the terminal device determines that the second identifier is a stationary state identifier.

[0187] Exemplarily, after step S410, the terminal device determines that the state flag at the first moment is a stationary state flag (is_stable), that is, determines that the first flag is a stationary state flag; and the terminal determines that the motion counter is less than a first preset count threshold.

[0188] At this time, since the state flag at the first moment is a static state flag, it can be determined that the jitter of the terminal device was small when the previous frame of the image was collected, and the previous frame of the image can be considered to be clear. Then, if the value of the motion counter is less than the first preset count threshold, the terminal device determines that a stable state has been reached, and the terminal device determines that the jitter was small when the current frame of the image was collected, then the collected current frame of the image can be considered to be clear.

[0189] Therefore, the terminal device determines that the state flag at the second moment is the stationary state flag (is_stable), that is, determines that the second flag is the stationary state flag. At this time, the motion counter is not modified.

[0190] It can be seen that in step S412, the terminal device keeps the status identification bit unchanged.

[0191] In the two situations shown in step S411 and step S412, since the status flag is in a static state when the previous frame image is captured, it is necessary to judge the value of the motion counter to determine whether the terminal device is shaking when capturing the current frame image, and then determine whether the status flag is a static state flag when capturing the current frame image.

[0192] S413. When the first gyroscope data is smaller than the dynamic threshold of the current frame image, the terminal device determines a still counter plus a preset value; wherein the still counter represents the number of consecutive images whose gyroscope data is smaller than the dynamic threshold of the image.

[0193] The state flag at the first moment and the static counter are used to determine the state flag at the second moment.

[0194] Exemplarily, after step S407, if the terminal device determines that the first gyroscope data is less than the dynamic threshold of the current frame image, the terminal device adds a preset value to the still counter, for example, adds 1 to the still counter.

[0195] It can be seen that the value of the still counter can indicate the number of consecutive images whose gyroscope data is less than the dynamic threshold of the image.

[0196] S414. The terminal device performs mapping calculation on the first exposure time, the second time range, and the second threshold range to obtain a second preset counting threshold.

[0197] Among them, the first exposure time corresponds to the second time range segment, the first time range segment corresponds to the second threshold range segment, the second time range segment is a value range segment of the exposure time, and the second threshold range segment is a value range segment for determining the counting threshold of the still counter; the exposure time in the second time range segment and the gyroscope threshold in the second threshold range segment are positively correlated.

[0198] For example, before step S415, step S414 needs to be performed first to determine the second preset counting threshold corresponding to the current frame image in real time according to the first exposure time of acquiring the current frame image. The second preset counting threshold corresponding to the current frame image is a threshold for determining the value of the still counter.

[0199] Furthermore, after step S402, after the first exposure time is obtained, step S414 may be executed.

[0200] In this step, the terminal device needs to determine the second preset counting threshold corresponding to the current frame image in real time according to the first exposure time of the current frame image; wherein the second preset counting threshold corresponding to the current frame image is the threshold for determining the value of the still counter.

[0201] In one example, the exposure time value range of the terminal device is divided into a plurality of second time range segments. For each second time range segment, the second time range segment is a value range segment of the exposure time. The way of dividing the value range of the exposure time of the terminal device can be based on the shooting effect obtained by the experimental test method to determine the value range of each second time range segment. Among them, the difference between the maximum value and the minimum value in each second time range segment is the same or different; there is no restriction on this, and it is set according to the needs.

[0202] The obtained first time range and the obtained second time range are different.

[0203] In addition, the value range of the exposure time of the terminal device corresponds to the value range of the counting threshold, and the value range of the counting threshold includes multiple counting thresholds, and the counting threshold in the value range of the counting threshold is an empirical value. The value range of the counting threshold is divided to obtain multiple preset second threshold range segments, and each second time range segment corresponds to each second threshold range segment. Among them, the preset second threshold range segment is a value range segment of the counting threshold used to distinguish counting data. For each second time range segment, the maximum exposure time in the second time range segment and the maximum counting threshold in the second threshold range segment corresponding to the second time range segment are corresponding; that is, the counting threshold corresponding to the maximum exposure time in the second time range segment is the maximum counting threshold in the second threshold range segment corresponding to the second time range segment. For each second time range segment, the minimum exposure time in the second time range segment and the minimum counting threshold in the second threshold range segment corresponding to the second time range segment are corresponding; that is, the counting threshold corresponding to the minimum exposure time in the second time range segment is the minimum counting threshold in the second threshold range segment corresponding to the second time range segment.

[0204] The value range of the counting threshold can be divided into the value range of each second threshold range segment based on an experiment.

[0205] There is a one-to-one correspondence between the second time range and the second threshold range. The exposure time in the second time range and the counting threshold in the second threshold range are positively correlated; the greater the exposure time, the greater the counting threshold.

[0206] Through the above process, the exposure time value range is quantized into a plurality of second time range segments; the second time range segment is the exposure time value range segment. Each second time range segment has a maximum exposure time and a minimum exposure time corresponding to the second time range segment.

[0207] The value range of the counting threshold is quantized into a plurality of second threshold range segments; the second threshold range segment is a value range segment of the counting threshold used to distinguish counting data. Each second threshold range segment has a maximum counting threshold and a minimum counting threshold corresponding to the second threshold range segment.

[0208] In the process of quantizing the exposure time value range into a plurality of second time range segments, the number of the second time range segments can be adjusted in real time for each frame of image. In the process of quantizing the counting threshold value range into a plurality of second threshold range segments, the number of the second threshold range segments can be adjusted in real time for each frame of image.

[0209] Then, since the first exposure time of the current frame image has been acquired, the second time range segment to which the first exposure time of the current frame image belongs can be determined, that is, the second time range segment corresponding to the first exposure time of the current frame image is obtained.

[0210] Since the second time range segment corresponds to the second threshold range segment one by one, the second time range segment corresponding to the first exposure time of the current frame image and the corresponding second threshold range segment can also be determined. That is, the second threshold range segment corresponding to the first exposure time of the current frame image is determined.

[0211] Then, a linear mapping process is performed on the first exposure time corresponding to the current frame image, the second time range corresponding to the first exposure time of the current frame image, and the second threshold range corresponding to the second time range to obtain the second preset counting threshold matched by the current frame image (i.e., the second preset counting threshold corresponding to the current frame image). The second preset counting threshold matched by the current frame image is a threshold used to determine the value of the still counter.

[0212] For example, a first-order linear mapping calculation is performed on the first exposure time corresponding to the current frame image, the second time range segment corresponding to the first exposure time of the current frame image, and the second threshold range segment corresponding to the second time range segment to obtain a second preset counting threshold for matching the current frame image.

[0213] For another example, a second-order linear mapping calculation is performed on the first exposure time corresponding to the current frame image, the second time range segment corresponding to the first exposure time of the current frame image, and the second threshold range segment corresponding to the second time range segment to obtain a second preset counting threshold for matching the current frame image.

[0214] For example, the exposure time value range is [100, 200]. The exposure time value range [100, 200] is quantized into multiple second time range segments, and the multiple second time range segments are respectively second time range segment [100, 120], second time range segment [120, 140], second time range segment [140, 160], second time range segment [160, 180], and second time range segment [180, 200].

[0215] The value range of the counting threshold is [1,16]. According to the value range of the exposure time being [100,200], the value range of the counting threshold [1,16] is quantized into a plurality of second threshold range segments, and the plurality of second threshold range segments are respectively the second threshold range segment [1,2], the second threshold range segment [2,4], the second threshold range segment [4,7], the second threshold range segment [7,12], and the second threshold range segment [12,16]. The counting threshold in the second threshold range segment is a positive integer.

[0216] The first exposure time corresponding to the current frame image has been obtained as x=130. It can be determined that the exposure time 130 corresponding to the current frame image corresponds to the second time range [120,140], and the second time range [120,140] corresponds to the second threshold range [2,4]. However, the counting threshold corresponding to the first exposure time corresponding to the current frame image cannot be directly determined at this time.

[0217] It is necessary to calculate the first exposure time 130, the second time range segment [120, 140], and the second threshold range segment [2, 4] corresponding to the current frame image (for example, first-order linear mapping, or second-order linear mapping), and then obtain the second preset counting threshold corresponding to the current frame image.

[0218] For example, the second preset counting threshold y2=(4-2) / (140-120)*(130-120)+2=3 corresponding to the current frame image can be calculated according to the first exposure time 130, the second time range [120,140], and the second threshold range [2,4] corresponding to the current frame image. The second preset counting threshold needs to be an integer.

[0219] After step S413, the terminal device may execute the above step S409, where the terminal device determines whether the first flag is a static state flag, that is, the terminal device determines whether the state flag at the first moment is a static state flag.

[0220] S415: When the first identifier is a motion state identifier, the terminal device determines whether the static counter is greater than or equal to a second preset counting threshold.

[0221] Exemplarily, after step S413, the terminal device determines that the state flag at the first moment is the motion state flag (is_moving); that is, the terminal device determines the first flag as the motion state flag (is_moving). At this time, when the terminal device collects the previous frame of image, according to the solution of this embodiment, it is determined that when collecting the previous frame of image, the state flag is set to the motion state flag (is_moving).

[0222] At this time, the terminal device has updated the value of the still counter in step S413. The terminal device determines whether the value of the still counter is greater than or equal to the second preset count threshold corresponding to the current frame image.

[0223] The second preset counting threshold corresponding to the current frame image is the counting threshold determined based on step S414.

[0224] For the first frame image, the state flag at the time of capturing the first frame image may be set to a motion state flag (is_moving).

[0225] S416: When the first identifier is a motion state identifier and the static counter is greater than or equal to a second preset counting threshold, the terminal device determines that the second identifier is a static state identifier and clears the static counter.

[0226] Exemplarily, after step S415, the terminal device determines that the state flag at the first moment is a motion state flag (is_moving), that is, determines that the first flag is a motion state flag; and the terminal determines that the still counter is greater than or equal to a second preset count threshold corresponding to the current frame image.

[0227] At this time, since the state flag at the first moment is a motion state flag, it can be determined that the terminal device had a large jitter when capturing the previous frame of image, and it can be considered that the previous frame of image is not clear. Then, if the value of the static counter is greater than or equal to the second preset count threshold corresponding to the current frame of image, it can be determined that the terminal device is continuously in a state of small jitter, and it can be considered that the captured current frame of image is clear.

[0228] Therefore, the terminal device determines that the state flag at the second moment is the static state flag (is_stable), that is, determines that the second flag is the static state flag. In addition, the terminal device clears the static counter.

[0229] S417: When the first identifier is a motion state identifier and the stationary counter is less than a second preset counting threshold, the terminal device determines that the second identifier is a motion state identifier.

[0230] Exemplarily, after step S415, the terminal device determines that the state flag at the first moment is a motion state flag (is_moving), that is, determines that the first flag is a motion state flag; and the terminal determines that the still counter is less than the second preset count threshold corresponding to the current frame image.

[0231] At this time, since the state flag at the first moment is a motion state flag, it can be determined that the terminal device jittered greatly when capturing the previous frame of image, and it can be considered that the previous frame of image is not clear. Then, if the value of the static counter is less than the first preset count threshold, the terminal device determines that a stable state has not been reached, and the terminal device determines that the jitter was large when capturing the current frame of image, and it can be considered that the captured current frame of image is not clear.

[0232] Therefore, the terminal device determines that the state flag at the second moment is the moving state flag (is_moving), that is, determines that the second flag is the moving state flag. At this time, the stationary counter is not modified.

[0233] It can be seen that in step S417, the terminal device keeps the status identification bit unchanged.

[0234] In the two situations shown in step S416 and step S417, since the status flag is in motion when the previous frame image is captured, it is necessary to judge the value of the still counter to determine whether the terminal device has reached a stable state when capturing the current frame image, that is, to determine whether the terminal device has a large jitter when capturing the current frame image, and then determine whether the status flag is a still state flag when capturing the current frame image.

[0235] The lower the brightness of the ambient light (i.e., dark light environment), the longer the exposure time when shooting the image, and the larger the counting threshold corresponding to the still counter needs to be, so that the process of steps S416-S417 is not easy to reach a stable state (i.e., stillness), and avoid the terminal device shooting unclear images. Therefore, it is necessary to determine the second preset counting threshold of the current frame image in real time according to the first exposure time of the current frame image.

[0236] The higher the brightness of the ambient light (i.e., bright light environment), the shorter the exposure time when shooting the image, and the smaller the counting threshold corresponding to the still counter needs to be, so that the process of steps S416-S417 can easily reach a stable state (i.e., stillness). Therefore, it is necessary to determine the second preset counting threshold of the current frame image in real time according to the first exposure time of the current frame image.

[0237] S418: When the state flag at the second moment is the second flag, and the second flag is the static state flag, the terminal device performs a snapshot process on the current frame image; wherein the second moment is the moment of capturing the current frame image.

[0238] In one example, step S418 includes: the terminal device determines an image parameter of the current frame image; when the image parameter is greater than or equal to a preset parameter threshold, the terminal device performs a snapshot process on the current frame image.

[0239] In one example, the image parameters include one or more of the following: parameters obtained by an image processing method based on a spatial domain, parameters obtained by an image processing method based on a frequency domain, and parameters obtained by an image processing method based on a deep learning model.

[0240] Exemplarily, after step S404, or after step S411, or after step S412, or after step S416, or after step S417, step S418 or step S419 is performed.

[0241] After step S404, or after step S411, or after step S412, or after step S416, or after step S417, the terminal device determines the state identification bit at the second moment.

[0242] The terminal device determines that the state flag at the second moment is a stationary state flag (is_stable); that is, the second flag is determined to be a stationary state flag (is_stable). The terminal device determines that the current frame image collected may be clear. Thus, the state flag is used as a new clarity parameter.

[0243] Then, the terminal device determines the image parameters of the current frame image based on the preset image processing method. If the terminal device determines that the image parameters meet the preset conditions (for example, the image parameters are greater than or equal to the preset parameter threshold), it further determines that the current frame image is clear. Then, the terminal device completes the capture processing of the current frame image, for example, displays or stores the current frame image.

[0244] In one example, the terminal device determines that the state flag at the second moment is a static state flag, and then the terminal device determines the neighborhood contrast of the current frame image based on the spatial image processing method, that is, obtains the gradient difference of the grayscale features between adjacent pixels. Then, the terminal device calculates the gradient difference based on probability theory and statistical methods to obtain the first clarity parameter of the current frame image. If the terminal device determines that the first clarity value of the current frame image is greater than or equal to the first preset clarity, the capture processing of the current frame image is completed.

[0245] In one example, the terminal device determines that the state flag at the second moment is a static state flag, and the terminal device determines the frequency component of the current frame image based on the image processing method in the frequency domain; wherein, if the image is relatively clear, the image is in focus and has more high-frequency components; if the image is relatively blurred, the image is in focus and has more low-frequency components. Then, the terminal device calculates the frequency component based on probability theory and statistical methods to obtain the second clarity value of the current frame image. If the terminal device determines that the second clarity value of the current frame image is greater than or equal to the second preset clarity, the capture processing of the current frame image is completed.

[0246] In one example, the terminal device determines that the state flag at the second moment is a static state flag, and the terminal device identifies the third clarity value of the current frame image based on the image processing method of the deep learning model. If the terminal device determines that the third clarity value of the current frame image is greater than or equal to the third preset clarity, the capture processing of the current frame image is completed.

[0247] One or more of the above-mentioned image processing methods may be adopted.

[0248] S419: When the state flag at the second moment is the second flag, and the second flag is the motion state flag, the terminal device captures the next frame of image.

[0249] Exemplarily, after step S404, or after step S411, or after step S412, or after step S416, or after step S417, the terminal device determines the state identification bit at the second moment.

[0250] The terminal device determines that the state flag at the second moment is the motion state flag (is_moving); that is, the second flag is determined to be the motion state flag (is_moving). The terminal device determines that the current frame image collected is not clear. Thus, the state flag is used as a new clarity parameter.

[0251] Then, the terminal device does not perform snapshot processing on the current frame image, and collects the next frame image, and executes the process of this embodiment again.

[0252] For the next frame of image, the terminal device acquires the second gyroscope data and the second exposure time when acquiring the next frame of image; wherein the second gyroscope data is the data acquired by the gyroscope of the terminal device when acquiring the next frame of image, and the second exposure time is the exposure time when acquiring the next frame of image. Then, referring to steps S403-S417, the clarity of the next image is pre-judged, and then the state flag is updated; if the state flag is a stationary state flag, step S418 is executed, and if the state flag is a moving state flag, step S419 is executed.

[0253] Through the above steps S401-S417, a state identification bit is added as a new clarity parameter. When the terminal device is capturing, it first determines whether the state identification bit when the current frame image is captured is a static state identification bit or a motion state identification bit. If the state identification bit when the current frame image is captured is a static state identification bit, other clarity parameters are judged to determine whether the capture of the current frame image is completed; thus, the state identification bit is added as a new clarity parameter to pre-judge the clarity of the image to avoid obtaining unclear images. If the state identification bit when the current frame image is captured is a motion state identification bit, it is pre-determined that the captured current frame image is unclear, and there is no need to judge other clarity parameters, and then it is directly determined not to capture the current frame image; thereby reducing the amount of calculation.

[0254] Moreover, in the present application, since the shaking of the terminal device is an important factor leading to the generation of blurred images, the state identification bit is updated based on the gyroscope data and exposure time of the terminal device when the terminal device collects the current frame image, and it is determined whether the state identification bit when collecting the current frame image is a static state identification or a motion state identification. The state identification bit is used as a new clarity parameter; before generating an image, if the state identification bit when collecting the current frame image is a static state identification, it is determined that the image is clear to a certain extent, and then the current frame image is captured; before generating an image, if the state identification bit when collecting the current frame image is a motion state identification, it is determined in advance that the collected current frame image is unclear, and the next frame image is directly analyzed.

[0255] Figure 5 A block diagram of the software layer of a terminal device provided in an embodiment of the present application, such as Figure 5 As shown, the terminal device includes an application layer (app), an application framework layer (Framwork, FW), a system runtime layer (Native), a hardware abstraction layer (Hardware Abstraction Layer, HAL), and a Linux kernel layer (Kenrel).

[0256] The camera application is deployed in the application layer.

[0257] The above steps S401-S419 may be an image clarity determination module, and the image clarity determination module is deployed in the hardware abstraction layer of the terminal device.

[0258] Automatically capture the scene: when the user opens the terminal device camera preview, the terminal device triggers the camera application to enter the preview mode; the terminal device determines whether the state identification bit when acquiring the current frame image is a static state identification bit or a motion state identification bit according to the solution of the present application; if the terminal device determines that the state identification bit when acquiring the current frame image is a static state identification bit, it is considered that the current frame image meets a certain clarity; then, the terminal device obtains other clarity parameters according to one or more methods of spatial domain image processing, frequency domain image processing, and deep learning model; if the terminal device determines that other image clarity parameters meet the preset conditions, the capture of the current frame image is completed.

[0259] Manual snapshot scenario: when the user opens the terminal device camera preview, the terminal device triggers the camera application to enter the preview mode; then the user is required to press the photo button, so that the terminal device determines, based on the user's trigger and the solution of the present application, whether the state identification bit when acquiring the current frame image is a static state identification bit or a motion state identification bit; if the terminal device determines that the state identification bit when acquiring the current frame image is a static state identification bit, it is considered that the current frame image meets a certain clarity; then, the terminal device obtains other clarity parameters according to one or more of the spatial domain image processing method, the frequency domain image processing method, and the deep learning model; if the terminal device determines that other image clarity parameters meet the preset conditions, the capture of the current frame image is completed.

[0260] In the process of this application, the terminal device writes the above processing process into a log; the terminal device stores the generated log. The terminal device can also send the generated log to the cloud device for storage.

[0261] In the present application, according to the first gyroscope data and the first exposure time when the current frame image is collected, the state identification bit when the current frame image is collected is output, and then the clarity parameter of the current frame image is obtained; the state identification bit is used as a new clarity parameter. If the state identification bit when the current frame image is collected is a static state identification bit, it is considered that the current frame image meets a certain clarity, and then other clarity parameters are obtained according to other image processing methods to further determine whether to display or store the current frame image. If the state identification bit when the current frame image is collected is a motion state identification bit, it is considered that the current frame image does not meet a certain clarity, and there is no need to calculate other clarity parameters of the current image, and the next frame image is directly processed; thereby, the amount of calculation of the image processing method is reduced.

[0262] Furthermore, for the first gyroscope data and the first exposure time of the current frame image, a dynamic threshold value corresponding to the current frame image is calculated in real time and dynamically. The dynamic threshold value matching the current frame image is a threshold value for determining the first gyroscope data of the current frame image. It is determined whether the first gyroscope data of the current frame image is greater than or equal to the dynamic threshold value corresponding to the current frame image. Different dynamic threshold values ​​are obtained according to the exposure time under different lighting environments; thus, it is possible to adapt to the image clarity determination under different lighting environments.

[0263] Furthermore, according to the value range of the exposure time, a plurality of first time range segments are quantified; according to the plurality of first time range segments, the value range of the gyroscope threshold is quantified into a plurality of first threshold range segments; the first threshold range segment is a value range segment of the gyroscope threshold used to distinguish the gyroscope data. Then, according to the first exposure time corresponding to the current frame image, the first time range segment corresponding to the exposure time of the current frame image, and the first threshold range segment corresponding to the first time range segment, the dynamic threshold matching the current frame image (i.e., the dynamic threshold corresponding to the current frame image) is determined. The dynamic threshold matching the current frame image is the threshold value for distinguishing the first gyroscope data of the current frame image. Thus, the gyroscope threshold used for clarity judgment is finely adjusted. The number of interval segments of the value range of the exposure time can also be adjusted to achieve algorithm effect debugging of different fineness.

[0264] Furthermore, a dynamic threshold value matching the current frame image (the dynamic threshold value matching the current frame image is the threshold value for determining the first gyroscope data of the current frame image) can be determined in real time, and a second preset count threshold value matching the current frame image (the second preset count threshold value matching the current frame image is the threshold value for determining the value of the static counter) can be determined in real time, thereby using a dual dynamic threshold value. Furthermore, according to the first exposure time of the current frame image, a dynamic adjustment mechanism is used for the gyroscope threshold value of the terminal device and the buffer threshold value from motion to stability (i.e., the second preset count threshold value).

[0265] The method for sorting the device list in the embodiment of the present application has been described above, and the device for performing the method for sorting the list in the embodiment of the present application is described below. Those skilled in the art can understand that the method and the device can be combined and referenced with each other, and the relevant device provided in the embodiment of the present application can perform the steps in the method for sorting the list in the embodiment of the present application.

[0266] The embodiment of the present application can divide the functional modules of the device of the above method according to the above method example. For example, each functional module can be divided according to each function, or two or more functions can be integrated into one processing module. The above integrated module can be implemented in the form of hardware or in the form of software functional modules. It should be noted that the division of modules in the embodiment of the present application is schematic and is only a logical function division. There may be other division methods in actual implementation.

[0267] like Figure 6 The schematic diagram of the structure of a chip provided by an embodiment of the present application is shown in FIG.

[0268] In some implementations, the memory 604 stores the following elements: executable modules or data structures, or a subset thereof, or an extended set thereof.

[0269] The method described in the above embodiment of the present application can be applied to the processor 601, or implemented by the processor 601. The processor 601 may be an integrated circuit chip with signal processing capabilities. In the implementation process, the steps of the above terminal device execution method can be completed by the hardware integrated logic circuit or software instructions in the processor 601. The above processor 601 can be a general processor (for example, a microprocessor or a conventional processor), a digital signal processor (digital signal processing, DSP), an application specific integrated circuit (application specific integrated circuit, ASIC), a field-programmable gate array (field-programmable gate array, FPGA) or other programmable logic devices, discrete gates, transistor logic devices or discrete hardware components. The processor 601 can implement or execute the disclosed methods, steps and logic block diagrams in the embodiments of the present application.

[0270] The steps of the method disclosed in the embodiment of the present application can be directly embodied as being executed by a hardware decoding processor, or being executed by a combination of hardware and software modules in the decoding processor. Among them, the software module can be located in a mature storage medium in the field such as a random access memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable read only memory (EEPROM). The storage medium is located in the memory 604, and the processor 601 reads the information in the memory 604 and completes the steps of the above method in combination with its hardware.

[0271] The processor 601 , the memory 604 , and the communication interface 603 may communicate with each other via the communication line 602 .

[0272] Figure 7 A schematic diagram of the structure of a terminal device provided in an embodiment of the present application is shown in FIG. Figure 7 As shown, the terminal device 700 includes the above chip and a display unit. The display unit is provided with an integrated circuit panel, which is used to issue periodic interrupt events. The integrated circuit panel removes the integrated circuit unit used to calculate the coordinate information corresponding to the touch operation.

[0273] The physical sensor-based capture method provided in the embodiment of the present application can be applied to electronic devices with communication functions. The electronic devices include terminal devices, and the specific device form of the terminal devices can refer to the above related descriptions, which will not be repeated here.

[0274] An embodiment of the present application provides a terminal device, which includes: a processor and a memory; the memory stores computer-executable instructions; the processor executes the computer-executable instructions stored in the memory, so that the terminal device executes the above method.

[0275] The embodiment of the present application provides a chip. The chip includes a processor, and the processor is used to call a computer program in a memory to execute the technical solution in the above embodiment. Its implementation principle and technical effect are similar to those of the above related embodiments, and will not be repeated here.

[0276] The embodiments of the present application also provide a computer-readable storage medium. The computer-readable storage medium stores a computer program. The above method is implemented when the computer program is executed by the processor. The method described in the above embodiment can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. If implemented in software, the function can be stored as one or more instructions or codes on a computer-readable medium or transmitted on a computer-readable medium. Computer-readable media can include computer storage media and communication media, and can also include any medium that can transfer a computer program from one place to another. The storage medium can be any target medium that can be accessed by a computer.

[0277] In one possible implementation, a computer-readable medium may include RAM, ROM, compact disc read-only memory (CD-ROM) or other optical disk storage, disk storage or other magnetic storage devices, or any other medium that is intended to carry or store the required program code in the form of instructions or data structures and can be accessed by a computer. Moreover, any connection is appropriately referred to as a computer-readable medium. For example, if a coaxial cable, fiber optic cable, twisted pair, digital subscriber line (DSL) or wireless technology (such as infrared, radio and microwave) is used to transmit software from a website, server or other remote source, the coaxial cable, fiber optic cable, twisted pair, DSL or wireless technology such as infrared, radio and microwave are included in the definition of medium. Disks and optical disks as used herein include optical disks, laser disks, optical disks, digital versatile disks (DVD), floppy disks and Blu-ray disks, where disks usually reproduce data magnetically, while optical disks reproduce data optically using lasers. Combinations of the above should also be included in the scope of computer-readable media.

[0278] An embodiment of the present application provides a computer program product, which includes a computer program. When the computer program is executed, the computer executes the above method.

[0279] The embodiments of the present application are described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processing unit of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable device to generate a machine, so that the instructions executed by the processing unit of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0280] The above specific implementation methods further illustrate the purpose, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above are only specific implementation methods of the present invention and are not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made on the basis of the technical solutions of the present invention should be included in the scope of protection of the present invention.

Claims

1. A capture method based on a physical sensor, characterized in that: The method is applied to a terminal device, and the method comprises: When the terminal device captures an image based on the preview stream, the state flag at the first moment is a first flag; wherein the first moment is the moment of capturing the previous frame of the current frame; the state flag represents the degree of jitter of the terminal device when capturing the image, and the first flag is a motion state flag or a static state flag; The terminal device acquires first gyroscope data and a first exposure time; wherein the first gyroscope data is data collected by the gyroscope of the terminal device when collecting the current frame image, and the first exposure time is the exposure time when collecting the current frame image; the first gyroscope data and the first exposure time are used to update the status flag; When the state flag at the second moment is the second flag, and the second flag is the static state flag, the terminal device performs a snapshot process on the current frame image; wherein the second moment is the moment of capturing the current frame image; The method further comprises: When the first identifier is a stationary state identifier and the motion counter is greater than or equal to a first preset counting threshold, the terminal device determines that the second identifier is a motion state identifier and clears the motion counter; when the first identifier is a stationary state identifier and the motion counter is less than the first preset counting threshold, the terminal device determines that the second identifier is a stationary state identifier; wherein the motion counter represents the continuous number of images whose gyroscope data is greater than or equal to a dynamic threshold of the image, the dynamic threshold is a threshold for distinguishing gyroscope data, and the first exposure time is used to determine the dynamic threshold of the previous frame image; When the first identifier is a motion state identifier and the still counter is greater than or equal to a second preset counting threshold, the terminal device determines that the second identifier is a still state identifier and clears the still counter; when the first identifier is a motion state identifier and the still counter is less than the second preset counting threshold, the terminal device determines that the second identifier is a motion state identifier; wherein the still counter represents the continuous number of images whose gyroscope data is less than the dynamic threshold of the image.

2. The method according to claim 1, characterized in that The method further comprises: When the first gyroscope data is greater than or equal to the dynamic threshold of the current frame image, the terminal device determines that the motion counter is added with a preset value; The state flag at the first moment and the motion counter are used to determine the state flag at the second moment.

3. The method according to claim 1 or 2, characterized in that: The first exposure time corresponds to a first time range segment, the first time range segment corresponds to a first threshold range segment, the first time range segment is a value range segment of the exposure time, and the first threshold range segment is a value range segment of a gyroscope threshold for determining gyroscope data; The exposure time in the first time range segment is positively correlated with the gyroscope threshold in the first threshold range segment; The method further comprises: The terminal device performs mapping calculation on the first exposure time, the first time range segment, and the first threshold range segment to obtain a dynamic threshold of the current frame image.

4. The method according to claim 1 or 2, characterized in that: The method further comprises: When the first gyroscope data is less than the dynamic threshold of the current frame image, the terminal device determines that a static counter is added with a preset value; The state flag at the first moment and the static counter are used to determine the state flag at the second moment.

5. The method according to claim 1 or 2, characterized in that: The first exposure time corresponds to a second time range, the second time range corresponds to a second threshold range, the second time range is a value range of the exposure time, and the second threshold range is a value range for determining a count threshold of a still counter; The exposure time in the second time range segment is positively correlated with the gyroscope threshold in the second threshold range segment; The method further comprises: The terminal device performs mapping calculation on the first exposure time, the second time range segment, and the second threshold range segment to obtain the second preset counting threshold.

6. The method according to claim 1 or 2, characterized in that: The method further comprises: When the state flag at the second moment is a second flag, and the second flag is a motion state flag, the terminal device captures a next frame of image.

7. The method according to claim 1 or 2, characterized in that: When the state flag at the second moment is the second flag, and the second flag is the static state flag, before the terminal device performs snapshot processing on the current frame image, the method further includes: When the first gyroscope data is greater than or equal to a preset limit value, the terminal device determines that the state identification bit at the second moment is a second identification, and the second identification is the same as the first identification; When the first gyroscope data is less than the preset limit value, the terminal device determines that when the state identification bit at the second moment is the second identification bit and the second identification bit is the static state identification bit, the terminal device performs a snapshot process on the current frame image.

8. The method according to claim 1 or 2, characterized in that: The terminal device performs a capture process on the current frame image, including: The terminal device determines the image parameters of the current frame image; When the image parameter is greater than or equal to a preset parameter threshold, the terminal device captures the current frame image.

9. The method according to claim 8, characterized in that The image parameters include one or more of the following: parameters obtained based on a spatial domain image processing method, parameters obtained based on a frequency domain image processing method, and parameters obtained based on a deep learning model image processing method.

10. A terminal device, characterized in that: include: Processor and memory; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory, so that the terminal device executes the method according to any one of claims 1 to 9.

11. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 9 is implemented.

12. A computer program product, characterized in that The method comprises a computer program, which, when being executed, enables a computer to execute the method according to any one of claims 1 to 9.

Citation Information

Patent Citations

  • Camera anti-shake method and device, electronic equipment and computer readable storage medium

    CN110166697A

  • Electronic device and method for providing notification related to image displayed through display and image stored in memory based on image analysis

    US20200053288A1