Fast photographing method, electronic device and computer-readable storage medium
By directly sending a photo command to the hardware abstraction layer and ending the focusing process when the camera application detects a photo operation, the problem of slow photo taking speed in the existing technology is solved, fast capture is achieved, and the user experience is improved.
Patent Information
- Application Number
- CN202111180066.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-09
- Publication Date
- 2025-09-12
- Estimated Expiration
- 2041-10-09
AI Technical Summary
Existing photo-taking methods require waiting for focus to be completed after detecting a photo-taking operation, resulting in a slow photo-taking speed and affecting user experience.
When the camera application detects a photo operation, it directly sends a photo command to the hardware abstraction layer to obtain the first image captured by the camera, and sends a focus lock command after the focus lock operation to end the focusing process. The HAL determines the final captured image based on the photo command and the first image.
It effectively reduces the focusing time during the photo-taking process, increases the photo-taking speed, enables quick capture, and improves the user experience.
Smart Images

Figure CN115967851B_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of terminal technology, and in particular relates to a fast photographing method, an electronic device, and a computer-readable storage medium. Background Art
[0002] With existing camera methods, after detecting a capture operation, the camera application needs to check the current focus state and wait for focus to complete. Specifically, the camera application needs to send a capture command to the hardware abstraction layer (HAL) only after receiving a successful focus command from the HAL. This ensures a clearer image. The focus process typically takes a long time, resulting in slower capture speeds and a poor user experience. Summary of the Invention
[0003] The embodiments of the present application provide a fast photographing method, an electronic device, and a computer-readable storage medium, which can solve the current problem of slow photographing speed and poor user experience.
[0004] In a first aspect, an embodiment of the present application provides a quick photo taking method, which is applied to an electronic device, wherein the electronic device includes a camera. The method may include:
[0005] In response to a photographing operation, the camera application of the electronic device sends a photographing command to the hardware abstraction layer of the electronic device;
[0006] In response to the photo-taking command, the hardware abstraction layer determines a captured image according to a first image, where the first image is an image captured by the camera and obtained by the hardware abstraction layer after the camera application is started.
[0007] Through the above-mentioned fast photo taking method, after the camera application of the electronic device is started, the HAL can obtain the first image captured by the camera. When the camera application detects the photo taking operation, the camera application can directly send a photo taking command to the HAL. After the HAL receives the photo taking command, it can determine the final photo taking image based on the photo taking command and the first image. That is, in an embodiment of the present application, when the camera application detects the photo taking operation, the camera application will not detect the current focus state, and will not wait for the HAL to report the focus completion state, that is, regardless of whether the current preview image is clear, the camera application directly sends a photo taking command to the HAL, and the HAL can directly determine the final photo taking image based on the photo taking command and the first image, which can effectively reduce the focus time during the photo taking process and increase the photo taking speed, thereby achieving the purpose of fast capture and improving the user experience.
[0008] In a possible implementation, before the camera application sends a photo-taking command to the hardware abstraction layer, the following steps may also be included:
[0009] The camera application sends a focus lock command to the hardware abstraction layer;
[0010] In response to the focus lock command, the hardware abstraction layer performs a focus lock operation.
[0011] In the fast photo-taking method provided in this implementation, the camera application can also send a focus lock command to the HAL before sending a photo-taking command to the HAL. The HAL can execute the focus lock command in response to the received focus lock command to terminate the focusing process, thereby allowing the camera to capture a stable and clear first image. This allows subsequent clear captured images to be obtained based on the first image, improving the image capture quality.
[0012] It is understood that in the fast photo-taking method provided in this implementation, after the camera application sends the focus lock command to the HAL, it can wait a preset time before sending the photo-taking command to the HAL again. For example, the preset time can be determined based on the time required for the focus lock command to reach the HAL, the time required for the photo-taking command to reach the HAL, and the time required for the HAL to execute the focus lock operation.
[0013] Specifically, the photographing command includes a first moment, where the first moment is a moment when the camera application detects the photographing operation;
[0014] The hardware abstraction layer determining the captured image according to the first image may include:
[0015] The hardware abstraction layer determines a second moment, and determines a preset image queue according to the first moment, the second moment, and the first image, where the second moment is the moment when the hardware abstraction layer receives the photographing command;
[0016] The hardware abstraction layer determines the captured image according to the preset image queue.
[0017] In the fast photo-taking method provided by this implementation, when the camera application detects a photo-taking operation, it can obtain a first moment. The first moment can be the moment when the camera application detects the photo-taking operation. When a photo-taking command is sent to the HAL, the first moment can be included in the photo-taking command. When a focus lock command is sent to the HAL, the first moment can be included in the focus lock command. When the HAL receives the photo-taking command, it can determine the second moment when the photo-taking command is received. It can also determine a preset image queue based on the first moment, the second moment, and the first image. Thus, the final captured image can be determined based on the preset image queue, thereby ensuring the capture speed while improving the clarity of the captured image and the image capture effect.
[0018] In an example, the hardware abstraction layer determining the preset image queue according to the first time, the second time, and the first image may include:
[0019] The hardware abstraction layer determines a second image in the first image that is between the first moment and the second moment, where the second image is at least one of the first images;
[0020] The hardware abstraction layer determines the second image as an image in the preset image queue.
[0021] In the fast photography method provided by this implementation, the HAL can obtain R second images between the first moment and the second moment from the first image captured by the camera, and can determine these R second images as images in the preset image queue, where R ≥ 1.
[0022] In another example, the hardware abstraction layer determining the preset image queue according to the first time, the second time, and the first image may include:
[0023] The hardware abstraction layer determines a second image in the first image that is between the first moment and the second moment, where the second image is at least one of the first images;
[0024] The hardware abstraction layer obtains the definition of the second image and determines the preset image queue according to the definition of the second image.
[0025] In the fast photographing method provided by this implementation, after acquiring R second images between the first moment and the second moment, the HAL can determine the clarity of the second image, and can determine a preset image sequence based on the clarity of the second image, that is, ensure that the images in the preset image sequence are all images with higher clarity, so that when the target image is subsequently determined from the preset image sequence, the number of image comparisons can be effectively reduced, thereby increasing the speed of determining the target image, thereby increasing the photographing speed and enhancing the user experience.
[0026] Exemplarily, the hardware abstraction layer determining the preset image queue according to the definition of the second image may include:
[0027] The hardware abstraction layer obtains a third image whose definition is greater than a preset definition threshold, and determines the third image as an image in the preset image queue, wherein the third image is at least one of the second images; or
[0028] The hardware abstraction layer obtains N fourth images with the highest definition from the second image, and determines the N fourth images as images in the preset image queue, where N≥1.
[0029] In the fast photography method provided by this implementation, the HAL can determine a preset image sequence based on the clarity of the second image and a preset clarity threshold. Specifically, after determining the clarity of the second image, the HAL can obtain a third image whose clarity is greater than the preset clarity threshold, that is, obtain an image whose clarity is greater than the preset clarity threshold from the second image as an image in the preset image queue. Among them, the number of third images S≥1. The preset clarity threshold can be specifically set by a technician according to actual conditions, or it can be set by default by the HAL. Exemplarily, the HAL can set the preset clarity threshold by default based on the clarity of the second image. For example, after determining the clarity of the second image, the HAL can calculate the average clarity of the second image based on the clarity of the second image, and can set the average clarity by default to the preset clarity threshold. For example, after determining the clarity of the second image, the HAL can determine the moment when the HAL completes the focus lock operation, and can set the clarity of the second image corresponding to that moment by default to the preset clarity threshold.
[0030] Alternatively, after determining the clarity of the second image, the HAL may obtain N fourth images with the highest clarity and determine these N fourth images as images in the preset image sequence. Where N is an integer greater than or equal to 1, and the specific value of N can be set by a technician based on actual conditions or by default by the HAL.
[0031] In another example, the hardware abstraction layer determining the preset image queue according to the first time, the second time, and the first image may include:
[0032] The hardware abstraction layer determines a second image in the first image that is between the first moment and the second moment, where the second image is at least one of the first images;
[0033] The hardware abstraction layer obtains a third moment when the motor is started and a fourth moment when the motor is in a stable state;
[0034] The hardware abstraction layer obtains a fifth image located between the third moment and the fourth moment in the second image;
[0035] The hardware abstraction layer determines the preset image queue according to the second image and the fifth image.
[0036] In the fast photography method provided by this implementation, the electronic device generally performs autofocus before the focus lock operation is completed. During the autofocus process, the electronic device can activate the motor to push the lens. It generally takes some time for the motor to start and reach a stable state. During this time, the unstable motor movement can cause poor focus, resulting in a blurry image captured by the camera. In this embodiment of the present application, the HAL can obtain a third moment when the motor is started and a fourth moment when the motor is in a stable state. Therefore, after acquiring R second images, the HAL can determine the fifth image located between the third and fourth moments, that is, determine which images in the second image were captured by the camera between the third and fourth moments. Subsequently, the HAL can determine the images in the second image except the fifth image as images in a preset image sequence to ensure that the images in the preset image sequence are all images with high clarity. When the target image is subsequently determined from the preset image sequence, the number of image comparisons can be effectively reduced, thereby increasing the speed of determining the target image, thereby increasing the speed of taking pictures and improving the user experience.
[0037] It should be understood that the HAL can also delete the fifth image based on the third or fourth image to obtain a preset image sequence. That is, after determining the third or fourth image based on the clarity of the second image, the HAL can determine the fifth image located between the third and fourth moments, that is, determine which images in the third or fourth image were captured by the camera between the third and fourth moments. Subsequently, the HAL can determine the images in the third or fourth image, excluding the fifth image, as images in the preset image sequence to ensure the clarity of the images in the preset image sequence, improve the speed of determining the target image, and increase the capture speed.
[0038] In a possible implementation, the hardware abstraction layer determining the captured image according to the preset image queue may include:
[0039] The hardware abstraction layer obtains the target image with the highest definition in the preset image queue, and determines the target image as the captured image; or
[0040] The hardware abstraction layer obtains a target image in the preset image queue that is closest to the first moment and has the highest definition, and determines the target image as the captured image.
[0041] In the fast photography method provided by this implementation, the HAL can determine the target image with the highest definition in the preset image sequence as the final captured image to ensure the clarity of the captured image and improve the image capture quality. Alternatively, the HAL can determine the target image with the highest definition closest to the first moment in the preset image queue as the final captured image, where the first moment is the actual capture moment, that is, the first moment is the moment when the user triggers the capture, to reduce capture delay and improve image capture quality.
[0042] In another possible implementation, the hardware abstraction layer determining the captured image according to the preset image queue may include:
[0043] The hardware abstraction layer obtains M target images with the highest definition in the preset image queue, where M>1;
[0044] The hardware abstraction layer performs synthesis processing on the M target images and determines the synthesized image as the captured image; or
[0045] The hardware abstraction layer obtains M target images in the preset image queue that are closest to the first moment and have the highest definition;
[0046] The hardware abstraction layer performs synthesis processing on the M target images and determines the synthesized image as the captured image.
[0047] In the rapid photography method provided by this implementation, the HAL can obtain M target images with the highest clarity from a preset image sequence, synthesize these M target images, and determine the synthesized image as the final captured image. For example, the HAL can perform multi-frame noise reduction on these M target images. Specifically, the HAL can identify noisy pixels in different target images and then, through weighted synthesis, replace these noisy pixels with noise-free pixels at the same locations in other target images, resulting in a clearer, cleaner captured image and improving the image capture quality.
[0048] It should be understood that the specific value of M can be set by a technician according to actual conditions, or can also be set by default by the electronic device. For example, the electronic device can set M by default according to the current ambient brightness.
[0049] In another possible implementation, the hardware abstraction layer determining the captured image according to the preset image queue may include:
[0050] The hardware abstraction layer obtains the current ambient brightness and determines the captured image according to the ambient brightness and the preset image queue.
[0051] Exemplarily, the hardware abstraction layer determining the captured image according to the ambient brightness and the preset image queue may include:
[0052] When the ambient brightness is greater than a preset brightness threshold, the hardware abstraction layer obtains a target image with the highest definition in the preset image queue, and determines the target image as the captured image.
[0053] When the ambient brightness is less than or equal to a preset brightness threshold, the hardware abstraction layer obtains M target images with the highest definition in the preset image queue, where M>1;
[0054] The hardware abstraction layer performs synthesis processing on the M target images, and determines the photographed image as the synthesized image.
[0055] In the fast photographing method provided by this implementation, after starting the camera application, the electronic device can obtain the current ambient brightness so that the HAL can determine the final captured image based on the current ambient brightness. Exemplarily, when the current ambient brightness is low, the HAL can obtain M target images, and can determine the image synthesized from these M target images as the final captured image, that is, the HAL can obtain the M target images with the highest clarity from the preset image queue, and can perform multi-frame noise reduction processing on these M target images to obtain the final captured image, so as to improve the image capturing effect in a darker environment. When the current ambient brightness is medium to high, the HAL can directly determine a single-frame target image as the final captured image, that is, the HAL can obtain a target image with the highest clarity from the preset image queue, and can determine this target image as the final captured image, so as to increase the photographing speed.
[0056] It should be understood that low brightness and medium-high brightness can be determined based on a preset brightness threshold. That is, when the ambient brightness is less than or equal to the preset brightness threshold, the ambient brightness can be determined to be low brightness; when the ambient brightness is greater than the preset brightness threshold, the ambient brightness can be determined to be medium-high brightness. The preset brightness threshold can be determined by technicians based on actual conditions.
[0057] In one possible implementation, the quick photo taking method provided in the embodiment of the present application can be an optional mode (e.g., snapshot mode) of a camera application, and the user can determine whether to activate the snapshot mode to take photos based on actual needs. That is, when the user selects the snapshot mode, the electronic device can take photos according to the quick photo taking method provided in the embodiment of the present application. When the user does not select the snapshot mode, the electronic device takes photos according to the normal photo taking method.
[0058] In another possible implementation, the quick photo taking method provided in the embodiment of the present application can also be directly integrated into the photo taking mode of the camera application. That is, after starting the camera application, the electronic device can determine whether the camera application has the quick photo taking function. If it is determined that the camera application has the quick photo taking function, the electronic device can directly take a photo according to the quick photo taking method provided in the embodiment of the present application.
[0059] In another possible implementation, the quick photo taking method provided in the embodiment of the present application may also be a photo taking function that is only applicable to preset application scenarios (such as snapshot scenes). Specifically, after starting the camera application, the electronic device may determine whether the current photo taking scene is a snapshot scene. When it is determined that the current photo taking scene is a snapshot scene, the electronic device may take a quick photo according to the quick photo taking method provided in the embodiment of the present application to meet the user's snapshot needs, thereby improving the user experience. When it is determined that the current photo taking scene is not a snapshot scene, the electronic device may take a photo based on an ordinary photo taking method.
[0060] For example, the electronic device can determine whether the current photo scene is a snapshot scene based on the launch time and launch method of the camera application. Specifically, when the electronic device displays a first application, if it detects that the camera application is launched via a shortcut, the electronic device can determine that the current photo scene is a snapshot scene. The first application is any application in the electronic device other than the camera application.
[0061] For example, the electronic device may also directly determine whether the current photo scene is a snapshot scene based on the camera application startup method. Specifically, the electronic device may pre-set a preset startup method corresponding to the snapshot scene. When the camera application is launched, the electronic device may determine the current startup method. If the current startup method is the preset startup method, the electronic device may determine that the current photo scene is a snapshot scene.
[0062] In a second aspect, an embodiment of the present application provides an electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the electronic device implements the quick photo taking method described in any one of the first aspects above.
[0063] 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 computer, the computer implements the fast photographing method described in any one of the first aspects above.
[0064] In a fourth aspect, an embodiment of the present application provides a computer program product. When the computer program product is run on an electronic device, the electronic device executes the quick photographing method described in any one of the first aspects above.
[0065] It can be understood that the beneficial effects of the second to fourth aspects mentioned above can be found in the relevant description of the first aspect mentioned above, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0066] Figure 1 Schematic diagram of the structure of an electronic device to which the rapid photographing method provided in an embodiment of the present application is applicable;
[0067] Figure 2 Schematic diagram of the software architecture to which the quick photo taking method provided in the embodiment of the present application is applicable;
[0068] Figure 3 is a schematic flow chart of a photographing method;
[0069] Figure 4 It is a schematic diagram of the time required for a photographic method;
[0070] Figure 5 is a schematic flow chart of a quick photographing method provided in an embodiment of the present application;
[0071] Figure 6 This is a schematic diagram of the time required for the fast photographing method provided in an embodiment of the present application;
[0072] Figure 7 This is an interface diagram of the quick photo taking method provided in the embodiment of the present application. Figure 1 ;
[0073] Figure 8 This is an interface diagram of the quick photo taking method provided in the embodiment of the present application. Figure 2 . DETAILED DESCRIPTION
[0074] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, integers, steps, operations, elements and / or components, but does not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or collections thereof.
[0075] It will also be understood that the term "and / or" used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
[0076] As used in this specification and the appended claims, the term "if" can be interpreted as "when" or "upon" or "in response to determining" or "in response to detecting," depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" can be interpreted as meaning "upon determination" or "in response to determining" or "upon detection of [described condition or event]" or "in response to detecting [described condition or event]," depending on the context.
[0077] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.
[0078] References to "one embodiment" or "some embodiments" in this specification mean that a particular feature, structure, or characteristic described in conjunction with that embodiment is included in one or more embodiments of the present application. Thus, phrases such as "in one embodiment," "in some embodiments," "in other embodiments," and "in other embodiments" appearing in various places in this specification do not necessarily refer to the same embodiment, but rather mean "one or more but not all embodiments," unless otherwise specifically emphasized. The terms "including," "comprising," "having," and variations thereof all mean "including but not limited to," unless otherwise specifically emphasized.
[0079] In addition, the “plurality” mentioned in the embodiments of the present application should be interpreted as two or more.
[0080] The steps involved in the quick photo taking method provided in the embodiments of the present application are merely examples. Not all steps are mandatory, nor are all information or messages required. These steps can be added or removed as needed during use. The same step or steps or messages with the same function in different embodiments of the present application can be referenced and used in conjunction with each other.
[0081] The business scenarios described in the embodiments of the present application are intended to more clearly illustrate the technical solutions provided by the embodiments of the present application, and do not constitute a limitation on the technical solutions provided by the embodiments of the present application. A person skilled in the art will appreciate that, with the evolution of network architecture and the emergence of new business scenarios, the technical solutions provided by the embodiments of the present application may also be applicable to similar technical problems.
[0082] In general photo-taking methods, after the camera application detects the photo-taking operation, the camera application needs to detect the current focus state and wait until the focus is completed. That is, it needs to send a photo-taking command to the HAL after receiving the focus success command reported by the HAL, so as to obtain a clearer image according to the photo-taking command. Among them, electronic devices generally integrate autofocus sensors and pixel sensors together. Focusing is to take out the left and right opposite pairs of pixels from the pixel sensor, and detect the amount of light entering the objects in the scene respectively. By comparing the relevant values of the pixels on the left and right sides, the focus point is accurately found, and then the motor will push the lens to the corresponding position at one time to complete the focus. That is, the focusing process generally takes a long time, resulting in a slow photo-taking speed, which cannot meet the user's photo-taking needs, especially the user's photo-taking needs when they need to take quick snapshots, affecting the user experience.
[0083] To solve the above problems, an embodiment of the present application provides a fast photo taking method, in which, after the camera application of the electronic device is started, the HAL of the electronic device can start to obtain the first image captured by the camera. Particularly, when the camera application detects a photo taking operation, the camera application can directly send a photo taking command to the HAL. After the HAL receives the photo taking command, it can determine the final captured image based on the photo taking command and the first image. That is, in an embodiment of the present application, when the camera application detects a photo taking operation, the camera application will not detect the current focus state, and will not wait for the HAL to report the focus completion state, that is, regardless of whether the current preview image is clear, the camera application directly sends a photo taking command to the HAL, and the HAL can directly determine the final captured image based on the photo taking command, which can effectively reduce the focus time during the photo taking process and increase the photo taking speed, thereby achieving the purpose of fast capture, improving the user experience, and having strong ease of use and practicality.
[0084] The quick photo taking method provided in the embodiment of the present application can be applied to electronic devices with photo taking functions such as mobile phones, tablet computers, wearable devices, etc. The embodiment of the present application does not impose any restrictions on the specific type of electronic device. Among them, the mobile phone can be a mobile phone with a folding screen. It is understandable that when the mobile phone is in a folded state, the folding screen may include a main screen and a sub-screen. The main screen can be set on one side of the mobile phone, and the sub-screen can be set on the other side of the mobile phone. The main screen is the main display device and is the most frequently used screen, while the sub-screen is an auxiliary screen and is used less frequently.
[0085] The following first introduces the electronic device involved in the embodiment of this application. Figure 1 , Figure 1 A structural diagram of the electronic device 100 is shown.
[0086] like Figure 1As shown, the electronic 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. Among them, the sensor module 180 can 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.
[0087] It should be understood that the structures illustrated in the embodiments of the present application do not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown, or may combine or separate certain components, or arrange the components differently. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0088] 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 processing unit (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). The different processing units may be independent devices or integrated into one or more processors.
[0089] 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.
[0090] Processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in processor 110 is a cache memory. This memory can store instructions or data that have just been used or are being recycled by processor 110. If processor 110 needs to use the same instruction or data again, it can directly access the memory. This avoids duplicate accesses, reduces processor 110 latency, and thus improves system efficiency.
[0091] In some embodiments, the processor 110 may include one or more interfaces. The interfaces may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface.
[0092] The I2C interface is a bidirectional synchronous serial bus that includes a serial data line (SDA) and a serial clock line (SCL). In some embodiments, the processor 110 may include multiple I2C bus lines. The processor 110 may be coupled to the touch sensor 180K, the charger, the flash, the camera 193, and the like via different I2C bus interfaces. For example, the processor 110 may be coupled to the touch sensor 180K via the I2C interface, enabling communication between the processor 110 and the touch sensor 180K via the I2C bus interface, thereby implementing the touch function of the electronic device 100.
[0093] The I2S interface can be used for audio communication. In some embodiments, the processor 110 can include multiple I2S buses. The processor 110 can be coupled to the audio module 170 via the I2S bus to enable communication between the processor 110 and the audio module 170. In some embodiments, the audio module 170 can transmit audio signals to the wireless communication module 160 via the I2S interface, enabling the function of answering calls through a Bluetooth headset.
[0094] The PCM interface can also be used for audio communication, sampling, quantizing, and encoding analog signals. In some embodiments, the audio module 170 and the wireless communication module 160 can be coupled via a PCM bus interface. In some embodiments, the audio module 170 can also transmit audio signals to the wireless communication module 160 via the PCM interface, enabling the function of answering calls via a Bluetooth headset. Both the I2S interface and the PCM interface can be used for audio communication.
[0095] The UART interface is a universal serial data bus used for asynchronous communication. This bus can be a bidirectional communication bus. It converts the data to be transmitted between serial communication and parallel communication. In some embodiments, the UART interface is typically used to connect the processor 110 and the wireless communication module 160. For example, the processor 110 communicates with the Bluetooth module in the wireless communication module 160 via the UART interface to implement Bluetooth functionality. In some embodiments, the audio module 170 can transmit audio signals to the wireless communication module 160 via the UART interface, enabling the function of playing music through Bluetooth headphones.
[0096] The MIPI interface can be used to connect the processor 110 to peripheral devices such as the display 194 and the camera 193. MIPI interfaces include the camera serial interface (CSI) and the display serial interface (DSI). In some embodiments, the processor 110 and the camera 193 communicate via the CSI interface to implement the camera function of the electronic device 100. The processor 110 and the display 194 communicate via the DSI interface to implement the display function of the electronic device 100.
[0097] The GPIO interface can be configured via software. The GPIO interface can be configured as either a control signal or a data signal. In some embodiments, the GPIO interface can be used to connect the processor 110 to the camera 193, display 194, wireless communication module 160, audio module 170, sensor module 180, etc. The GPIO interface can also be configured as an I2C interface, an I2S interface, a UART interface, a MIPI interface, etc.
[0098] The USB interface 130 is an interface that complies with USB standards and may be a Mini USB interface, a Micro USB interface, a USB Type-C interface, or the like. The USB interface 130 can be used to connect a charger to charge the electronic device 100, or to transfer data between the electronic device 100 and peripheral devices. It can also be used to connect headphones to play audio. This interface can also be used to connect other electronic devices, such as augmented reality devices.
[0099] It is understood that the interface connection relationship between the modules illustrated in the embodiments of the present application is merely an illustrative illustration and does not constitute a structural limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may also adopt different interface connection methods from the above embodiments, or a combination of multiple interface connection methods.
[0100] The charging management module 140 is configured to receive charging input from a charger. The charger can be either a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 can receive charging input from the wired charger via the USB interface 130. In some wireless charging embodiments, the charging management module 140 can receive wireless charging input via the wireless charging coil of the electronic device 100. While charging the battery 142, the charging management module 140 can also provide power to the electronic device via the power management module 141.
[0101] The power management module 141 is used to connect the battery 142, the charging management module 140, and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140, and provides power to the processor 110, the internal memory 121, the display 194, the camera 193, and the wireless communication module 160. The power management module 141 can also be used to monitor parameters such as battery capacity, battery cycle count, and battery health status (leakage, impedance). In some other embodiments, the power management module 141 can also be set in the processor 110. In other embodiments, the power management module 141 and the charging management module 140 can also be set in the same device.
[0102] The wireless communication function of the electronic 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.
[0103] Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In other embodiments, the antennas can be used in conjunction with a tuning switch.
[0104] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G applied to the electronic device 100. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves from the antenna 1, and filter, amplify, and process the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 1. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the same device as at least some of the modules of the processor 110.
[0105] The modem processor may include a modulator and a demodulator. The modulator is used to modulate the low-frequency baseband signal to be transmitted into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After being processed by the baseband processor, the low-frequency baseband signal is passed to the application processor. The application processor outputs a sound signal through an audio device (not limited to the speaker 170A, the receiver 170B, etc.) or displays an image or video through the display screen 194. In some embodiments, the modem processor may be an independent device. In other embodiments, the modem processor may be independent of the processor 110 and be set in the same device as the mobile communication module 150 or other functional modules.
[0106] The wireless communication module 160 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to the electronic device 100. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, frequency modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 110. The wireless communication module 160 can also receive the signal to be sent from the processor 110, frequency modulate it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.
[0107] In some embodiments, the antenna 1 of the electronic device 100 is coupled to the mobile communication module 150, and the antenna 2 is coupled to the wireless communication module 160, so that the electronic device 100 can communicate with the network and other devices through wireless communication technology. The wireless communication technology may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technology. The GNSS may include a global positioning system (GPS), a global navigation satellite system (GLONASS), a Beidou navigation satellite system (BDS), a quasi-zenith satellite system (QZSS) and / or a satellite based augmentation system (SBAS).
[0108] Electronic device 100 implements display functionality through a GPU, display screen 194, and an application processor. A GPU is a microprocessor for image processing that connects display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. Processor 110 may include one or more GPUs that execute program instructions to generate or modify display information.
[0109] Display screen 194 is used to display images, videos, and the like. 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 (AMOLED), a flexible light-emitting diode (FLED), a MiniLED, a MicroLED, a Micro-oLed, or a quantum dot light-emitting diode (QLED). In some embodiments, electronic device 100 may include one or N display screens 194, where N is a positive integer greater than one.
[0110] In some embodiments, when the display panel adopts materials such as OLED, AMOLED, FLED, etc., the above-mentioned display screen can be bent. The above-mentioned display screen can be bent, which means that the display screen can be bent to any angle along any axis at any part and can be maintained at the angle. For example, the display screen can be folded in half from the left and right in the middle, or folded in half from the top and bottom in the middle. In the embodiment of the present application, the bent display screen can be referred to as a folding screen. Among them, the folding screen can be a single screen, or a display screen composed of multiple screens pieced together, which is not limited here. The display screen can also be a flexible screen with strong flexibility and bendability, which can provide users with a new interaction method based on the bendable characteristics, and can meet users' more needs for folding screen mobile phones. For electronic devices equipped with folding screens, the folding screen on the electronic device can switch between a small screen in a folded state and a large screen in an unfolded state at any time.
[0111] The electronic device 100 can implement a shooting function through an ISP, a camera 193, a video codec, a GPU, a display screen 194, and an application processor.
[0112] The ISP processes data fed back by camera 193. For example, when taking a photo, the shutter is opened, and light is transmitted through the lens to the camera's photosensitive element. The light signal is converted into an electrical signal, which is then passed to the ISP for processing and converted into a visible image. The ISP can also perform algorithmic optimization on image noise, brightness, and skin tone. It can also optimize parameters such as exposure and color temperature of the captured scene. In some embodiments, the ISP can be located within camera 193.
[0113] 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 light signal into an electrical signal, and then passes the electrical signal to the ISP for conversion 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 electronic device 100 may include 1 or N cameras 193, where N is a positive integer greater than 1.
[0114] The digital signal processor is used to process digital signals. In addition to processing digital image signals, it can also process other digital signals. For example, when the electronic device 100 selects a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy.
[0115] Video codecs are used to compress or decompress digital video. Electronic device 100 may support one or more video codecs. This allows electronic device 100 to play or record videos in various encoding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, and MPEG4.
[0116] The NPU is a neural network (NN) computing processor. Drawing on the structure of biological neural networks, such as the transmission patterns between neurons in the human brain, it rapidly processes input information and can continuously self-learn. The NPU can enable intelligent cognitive applications in electronic device 100, such as image recognition, face recognition, speech recognition, and text comprehension.
[0117] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 via the external memory interface 120 to implement data storage functions. For example, files such as music and videos can be stored on the external memory card.
[0118] The internal memory 121 can be used to store computer executable program codes, which include instructions. The internal memory 121 may include a program storage area and a data storage area. Among them, the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area may store data created during the use of the electronic device 100 (such as audio data, a phone book, etc.), etc. In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc. The processor 110 executes various functional applications and data processing of the electronic device 100 by running instructions stored in the internal memory 121 and / or instructions stored in a memory provided in the processor.
[0119] The electronic device 100 can implement audio functions such as music playback and recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the application processor.
[0120] The audio module 170 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signals. The audio module 170 can also be used to encode and decode audio signals. In some embodiments, the audio module 170 can be provided in the processor 110, or some functional modules of the audio module 170 can be provided in the processor 110.
[0121] The speaker 170A, also called a "speaker", is used to convert audio electrical signals into sound signals. The electronic device 100 can listen to music or listen to hands-free calls through the speaker 170A.
[0122] The receiver 170B, also called a "handset", is used to convert audio electrical signals into sound signals. When the electronic device 100 receives a call or a voice message, the user can place the receiver 170B close to the ear to hear the voice.
[0123] Microphone 170C, also known as "microphone" or "microphone", is used to convert sound signals into electrical signals. When making a call or sending a voice message, the user can speak by putting their mouth close to the microphone 170C to input the sound signal into the microphone 170C. The electronic device 100 can be provided with at least one microphone 170C. In other embodiments, the electronic device 100 can be provided with two microphones 170C, which can not only collect sound signals but also realize noise reduction function. In other embodiments, the electronic device 100 can also be provided with three, four or more microphones 170C to collect sound signals, reduce noise, identify the source of sound, realize directional recording function, etc.
[0124] The headphone jack 170D is used to connect a wired headphone and can be the USB interface 130 or a 3.5mm open mobile terminal platform (OMTP) standard interface or a cellular telecommunications industry association of the USA (CTIA) standard interface.
[0125] Pressure sensor 180A is used to sense pressure signals and convert them into electrical signals. In some embodiments, pressure sensor 180A can be located on display screen 194. There are many types of pressure sensors 180A, such as resistive, inductive, and capacitive. A capacitive pressure sensor can include at least two parallel plates made of conductive material. When force acts on pressure sensor 180A, the capacitance between the electrodes changes. Electronic device 100 determines the intensity of the pressure based on this change in capacitance. When a touch operation is applied to display screen 194, electronic device 100 detects the touch intensity based on pressure sensor 180A. Electronic device 100 can also calculate the touch location based on the detection signal from pressure sensor 180A. In some embodiments, touch operations applied to the same touch location but with different touch intensities can correspond to different operation instructions. For example, when a touch operation with an intensity less than a first pressure threshold is applied to a short message application icon, a command to view short messages is executed. When a touch operation with an intensity greater than or equal to the first pressure threshold is applied to a short message application icon, a command to create a new short message is executed.
[0126] The gyroscope sensor 180B can be used to determine the motion posture of the electronic device 100. In some embodiments, the angular velocity of the electronic 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 electronic 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 electronic device 100 through reverse movement to achieve anti-shake. The gyroscope sensor 180B can also be used for navigation and somatosensory game scenes.
[0127] The air pressure sensor 180C is used to measure air pressure. In some embodiments, the electronic device 100 calculates the altitude using the air pressure value measured by the air pressure sensor 180C to assist in positioning and navigation.
[0128] The magnetic sensor 180D includes a Hall sensor. The electronic device 100 can use the magnetic sensor 180D to detect the opening and closing of the flip case. In some embodiments, when the electronic device 100 is a flip phone, the electronic device 100 can detect the opening and closing of the flip cover based on the magnetic sensor 180D. Based on the detected opening and closing status of the case or flip cover, features such as automatic unlocking of the flip cover can be configured.
[0129] Accelerometer 180E can detect the magnitude of acceleration of electronic device 100 in all directions (generally three axes). It can also detect the magnitude and direction of gravity when electronic device 100 is stationary. It can also be used to identify the electronic device's posture, enabling applications such as switching between landscape and portrait modes and pedometers.
[0130] The distance sensor 180F is used to measure distance. The electronic device 100 can measure distance using infrared or laser. In some embodiments, when shooting a scene, the electronic device 100 can use the distance sensor 180F to measure distance to achieve fast focusing.
[0131] The proximity light sensor 180G may include, for example, a light emitting diode (LED) and a light detector, such as a photodiode. The light emitting diode may be an infrared light emitting diode. The electronic device 100 emits infrared light outward through the light emitting diode. The electronic device 100 uses a photodiode to detect infrared reflected light from nearby objects. When sufficient reflected light is detected, it can be determined that there is an object near the electronic device 100. When insufficient reflected light is detected, the electronic device 100 can determine that there is no object near the electronic device 100. The electronic device 100 can use the proximity light sensor 180G to detect that the user is holding the electronic device 100 close to the ear to talk, so as to automatically turn off the screen to save power. The proximity light sensor 180G can also be used in leather case mode and pocket mode to automatically unlock and lock the screen.
[0132] Ambient light sensor 180L is used to sense ambient light brightness. Electronic device 100 can adaptively adjust the brightness of display screen 194 based on the perceived ambient light. Ambient light sensor 180L can also be used to automatically adjust white balance when taking photos. Ambient light sensor 180L can also work with proximity light sensor 180G to detect whether electronic device 100 is in a pocket to prevent accidental touches.
[0133] The fingerprint sensor 180H is used to collect fingerprints. The electronic device 100 can use the collected fingerprint characteristics to implement fingerprint unlocking, access application locks, fingerprint photography, fingerprint call answering, etc.
[0134] The temperature sensor 180J is used to detect temperature. In some embodiments, the electronic device 100 uses the temperature detected by the temperature sensor 180J to execute a temperature processing strategy. For example, when the temperature reported by the temperature sensor 180J exceeds a threshold, the electronic device 100 reduces the performance of the processor located near the temperature sensor 180J to reduce power consumption and implement thermal protection. In other embodiments, when the temperature is lower than another threshold, the electronic device 100 heats the battery 142 to prevent the electronic device 100 from shutting down abnormally due to low temperature. In other embodiments, when the temperature is lower than another threshold, the electronic device 100 boosts the output voltage of the battery 142 to prevent abnormal shutdown due to low temperature.
[0135] The touch sensor 180K is also called a "touch-sensitive device." The touch sensor 180K can be disposed on the display screen 194. The touch sensor 180K and the display screen 194 form a touch screen, also called a "touch screen." The touch sensor 180K is used to detect touch operations applied thereto or in the vicinity thereof. The touch sensor can transmit the detected touch operations to the application processor to determine the type of touch event. Visual output related to the touch operations can be provided via the display screen 194. In other embodiments, the touch sensor 180K can also be disposed on the surface of the electronic device 100, at a location different from that of the display screen 194.
[0136] The bone conduction sensor 180M can obtain vibration signals. In some embodiments, the bone conduction sensor 180M can obtain vibration signals from the vibrating bones of the human body. The bone conduction sensor 180M can also contact the human pulse to receive blood pressure pulse signals. In some embodiments, the bone conduction sensor 180M can also be set in headphones to form bone conduction headphones. The audio module 170 can parse out voice signals based on the vibration signals of the vibrating bones of the human body obtained by the bone conduction sensor 180M to implement voice functions. The application processor can parse heart rate information based on the blood pressure pulse signals obtained by the bone conduction sensor 180M to implement heart rate detection functions.
[0137] The buttons 190 include a power button, a volume button, and the like. The buttons 190 may be mechanical buttons or touch buttons. The electronic device 100 may receive key inputs and generate key signal inputs related to user settings and function control of the electronic device 100.
[0138] Motor 191 can generate vibration prompts. Motor 191 can be used for incoming call vibration prompts, and can also be used for touch vibration feedback. For example, touch operations acting on different applications (such as taking pictures, audio playback, etc.) can correspond to different vibration feedback effects. For touch operations acting on different areas of the display screen 194, motor 191 can also correspond to different vibration feedback effects. Different application scenarios (for example: time reminders, receiving messages, alarm clocks, games, etc.) can also correspond to different vibration feedback effects. The touch vibration feedback effect can also support customization.
[0139] The indicator 192 may be an indicator light, which may be used to indicate the charging status, power level changes, messages, missed calls, notifications, etc.
[0140] The SIM card interface 195 is used to connect a SIM card. The SIM card can be connected to or disconnected from the electronic device 100 by inserting it into or removing it from the SIM card interface 195. The electronic device 100 can support 1 or N SIM card interfaces, where N is a positive integer greater than 1. The SIM card interface 195 can support Nano SIM cards, Micro SIM cards, SIM cards, and the like. Multiple cards can be inserted into the same SIM card interface 195 at the same time. The types of the multiple cards can be the same or different. The SIM card interface 195 can also be compatible with different types of SIM cards. The SIM card interface 195 can also be compatible with external memory cards. The electronic device 100 interacts with the network through the SIM card to implement functions such as calls and data communications. In some embodiments, the electronic device 100 uses an eSIM, i.e., an embedded SIM card. The eSIM card can be embedded in the electronic device 100 and cannot be separated from the electronic device 100.
[0141] The software system of the electronic device 100 can adopt a layered architecture, an event-driven architecture, a micro-kernel architecture, a micro-service architecture, or a cloud architecture. In the embodiment of the present application, the Android system with a layered architecture is used as an example to illustrate the software structure of the electronic device 100.
[0142] Figure 2 It is a software structure block diagram of the electronic device 100 according to an embodiment of the present application.
[0143] A layered architecture divides software into several layers, each with distinct roles and responsibilities. Layers communicate with each other through software interfaces. In some embodiments, the Android system is divided from top to bottom into the application layer, the application framework layer, the Android runtime and system libraries, the hardware abstraction layer (HAL), and the kernel layer.
[0144] The application layer can include a series of application packages.
[0145] like Figure 2 As shown, the application package may include applications such as camera, calculator, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, short message, etc.
[0146] In an embodiment of the present application, when a camera application is applicable to an electronic device with a foldable screen, developers can use plug-in technology to add a secondary screen camera application suitable for the foldable state to the camera application package when developing the camera application. That is, the camera application can include a main screen camera application in an unfolded or semi-folded state, and a secondary screen camera application in a folded state. The main screen camera application can include a large aperture mode, a portrait mode, a night scene mode, a photo mode, a video mode, a quick shot mode, and the like. The secondary screen camera application can include a photo mode and a video mode, and the like. In one example, the photo mode of the secondary screen camera application can be directly integrated with a quick photo function, that is, the user can quickly capture a photo by directly starting the photo mode of the secondary screen camera application.
[0147] It should be understood that when the electronic device is in a folded state, the user can use the secondary screen camera application to take pictures. Specifically, the user can call up the secondary screen camera application by swiping left or right on the secondary screen, and can exit the secondary screen camera application by swiping right or left, and can also switch the mode of the secondary screen camera application by swiping up or down. In the secondary screen camera application, the user can also take pictures or videos by clicking on the preview, or by using preset gestures, voice containing preset keywords, touching the volume down button, etc. Among them, the images or videos taken by the secondary screen camera application can be viewed from the gallery, or by clicking on the thumbnail of the secondary screen camera application or the main screen camera application.
[0148] It should be noted that when the electronic device is in the unfolded state or semi-folded state, the secondary screen camera application can be hidden, and the user can use the main screen camera application to take pictures.
[0149] The application framework layer provides an application programming interface (API) and programming framework for the applications in the application layer. The application framework layer includes some predefined functions.
[0150] like Figure 2 As shown, the application framework layer may include a window manager, a content provider, a view system, a phone manager, a resource manager, a notification manager, and the like.
[0151] 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, take screenshots, etc.
[0152] Content providers are used to store and retrieve data and make it accessible to applications. The data may include videos, images, audio, calls made and received, browsing history and bookmarks, phone books, etc.
[0153] The view system includes visual controls, such as those for displaying text and images. The view system is used to build applications. A display interface can consist of one or more views. For example, a display interface containing a text notification icon might include a view for displaying text and a view for displaying images.
[0154] The phone manager is used to provide communication functions of the electronic device 100, such as management of call status (including answering, hanging up, etc.).
[0155] The resource manager provides various resources for applications, such as localized strings, icons, images, layout files, video files, and so on.
[0156] The Notification Manager allows applications to display notifications in the status bar. These messages can be displayed briefly and then disappear automatically without user interaction. For example, the Notification Manager is used to notify users of completed downloads and message reminders. The Notification Manager can also display notifications in the top status bar of the system as icons or scrolling text, such as notifications from background applications, or as dialog windows on the screen. Examples include text messages in the status bar, beeps, vibrations on electronic devices, and flashing indicator lights.
[0157] Android Runtime includes core libraries and a virtual machine. Android runtime is responsible for scheduling and management of the Android system.
[0158] The core library consists of two parts: one is the function that needs to be called by the Java language, and the other is the Android core library.
[0159] The application layer and application framework layer run in a virtual machine. The virtual machine executes Java files in the application layer and application framework layer as binary files. The virtual machine manages object lifecycles, stack management, thread management, security and exception management, and garbage collection.
[0160] The system library can 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.
[0161] The surface manager is used to manage the display subsystem and provide fusion of 2D and 3D layers for multiple applications.
[0162] The media library supports playback and recording of a variety of common audio and video formats, as well as static image files. The media library can support a variety of audio and video encoding formats, such as MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.
[0163] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.
[0164] A 2D graphics engine is a drawing engine for 2D drawings.
[0165] The HAL and kernel layers form the interface between hardware and software. The HAL encapsulates kernel drivers, providing an interface to the upper layers, shielding them from underlying implementation details. The kernel layer includes at least the display driver, camera driver, audio driver, and sensor driver. In other words, the Android system divides hardware support into two layers: one in user space and one in kernel space. The HAL runs in user space, while the kernel drivers run in kernel space.
[0166] The following describes the workflow of the software and hardware of the electronic device 100 in conjunction with a photo-taking scenario.
[0167] 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 a raw input event (including touch coordinates, touch operation timestamp, and other information). The raw input event is stored in the kernel layer. The application framework layer obtains the raw input event from the kernel layer and identifies the control corresponding to the raw 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 camera application icon, the camera application calls the interface of the application framework layer to start the camera application, and then starts the camera driver by calling the kernel layer to capture a still image or video through the camera 193.
[0168] See also Figure 3 , Figure 3 A schematic flow chart of a photographing method is shown. Among them, the zero-shutter lag (ZSL) photographing method is a technology for reducing the delay in photographing so that photographing and echoing can be completed instantly. Specifically, after starting the preview, the electronic device can obtain each frame of image captured by the camera, and store each frame of image obtained in the image queue buffer respectively. After the focus is successful, the electronic device deletes the image before the focus is successful from the buffer, so that the image stored in the image sequence is the image after the focus is successful. When the photo is triggered, the electronic device calculates the actual photo moment, and finds the image corresponding to the photo moment in the buffer as the current captured image.
[0169] like Figure 3 As shown in the figure, when the camera application detects a photo operation, it needs to query the current focus status to determine whether the current focus is complete. In other words, it queries whether the HAL has reported a focus success command to determine whether the current focus is complete. If it is determined that the focus is not complete, the camera application needs to send a focus command to the HAL. After receiving the focus command, the HAL can send a focus command to the ISP. After receiving the focus command, the ISP can use the motor to move the lens to focus. After focusing is complete, the ISP can return a focus success command to the HAL. After receiving the focus success command returned by the ISP, the HAL can send a focus success command to the camera application. After receiving the focus success command returned by the HAL, the camera application can determine that the focus is complete. At this point, the camera application can send a photo command to the HAL. After receiving the photo command, the HAL can start executing the photo request, such as locking the image sequence (that is, stopping adding new images to the image sequence and deleting images before the focus is successful) and allocating memory (to store the last captured image). Subsequently, the HAL can perform ZSL frame selection, i.e., obtain a frame in the image queue (i.e., the image corresponding to the photo moment) as the final captured image. It is understood that the photo operation can be a user clicking, touching, or pressing a photo button, or a user performing a preset gesture, or a user inputting a voice message containing preset keywords, etc.
[0170] See also Figure 4 , Figure 4 A schematic diagram of the time required for a photographing method is shown. Figure 4As shown, after the user performs a photo-taking operation (for example, pressing the photo button), the time required for the HAL to receive the focus command sent by the camera application is approximately 15ms. The time required for the ISP to receive the focus command sent by the HAL is approximately 45ms. The time required for the HAL to receive the focus success command returned by the ISP is approximately 133ms. The time required for the camera application to receive the focus success command sent by the HAL is approximately 15ms. The time required for the camera application to send the photo-taking command is approximately 1ms. The time required for the HAL to receive the photo-taking command sent by the camera application is approximately 45ms. The time required for the HAL to apply for memory is approximately 50ms. The time required for the HAL to perform ZSL frame selection is approximately 30ms. Therefore, the time required for this photo-taking method is approximately (15+45+133+15+1+45+50+30)=334ms. In this photo-taking method, since the ISP takes a long time to perform the focus operation, the time required for taking a photo is greatly increased, affecting the photo-taking speed.
[0171] From the above description, it can be seen that although the zero-delay shooting method can reduce the shooting delay, it still requires a long focusing operation, resulting in a slow shooting speed and cannot meet the user's shooting needs, especially when the user needs to take a quick snapshot.
[0172] The following will describe in detail the quick photo taking method provided in the embodiment of the present application in combination with the accompanying drawings and specific application scenarios.
[0173] See also Figure 5 , Figure 5 FIG1 shows a schematic flow chart of a fast photographing method provided by an embodiment of the present application. Figure 5 As shown, in an embodiment of the present application, after the camera application is started, the HAL can start to obtain the first image captured by the camera. When the camera application detects a photo operation, the camera application can directly send a photo command to the HAL. After receiving the photo command, the HAL can apply for memory and determine the final captured image based on the first image. That is, in an embodiment of the present application, when the camera application detects a photo operation, the camera application will not detect the current focus state, and will not wait for the HAL to report the focus completion state, that is, regardless of whether the current preview image is clear or not, the camera application directly sends a photo command to the HAL, and the HAL can directly determine the final captured image based on the photo command and the first image, which can effectively reduce the focus time during the photo process and increase the photo speed, thereby achieving the purpose of fast capture and improving the user experience.
[0174] In one possible implementation, the camera application may first send a focus lock command to the HAL before sending a take a picture command to the HAL. The HAL may execute the focus lock based on the received focus lock command to terminate the focusing process, allowing the camera to capture a stable and clear first image, thereby improving the image capture quality. Specifically, after the camera application detects a take a picture operation, the camera application may send a focus lock command to the HAL. After receiving the focus lock command, the HAL may execute the focus lock operation. In addition, after sending the focus lock command, the camera application may also send a take a picture command to the HAL at preset intervals. After receiving the take a picture command, the HAL may request memory and determine the final captured image based on the first image. That is, in this embodiment of the present application, when the camera application detects a take a picture operation, the camera application does not detect the current focus state and does not wait for the HAL to report the focus completion status. That is, regardless of whether the current preview image is clear, the camera application directly sends a focus lock command to the HAL to terminate the current focus process, allowing the camera to capture a stable and clear first image. Therefore, after HAL receives the photo command, HAL can determine the final captured image based on the photo command and the stable and clear first image. On the basis of ensuring a good photo effect, it can effectively reduce the focusing time during the photo shooting process and increase the photo shooting speed, thereby achieving the purpose of fast capture and improving the user experience.
[0175] The preset time can be determined based on the time it takes for the focus lock command to reach the HAL, the time it takes for the capture command to reach the HAL, and the time it takes for the HAL to execute the focus lock operation. For example, the preset time is ≥ (T1 + T3 - T2), where T1 is the time it takes for the focus lock command to reach the HAL, T2 is the time it takes for the capture command to reach the HAL, and T3 is the time it takes for the HAL to execute the focus lock operation.
[0176] See also Figure 6 , Figure 6 The time required for the quick photo taking method provided by the embodiment of the present application is shown in FIG. Figure 6 As shown in (a), in this embodiment of the present application, after the user performs a photo-taking operation (e.g., pressing the photo button), the time required for the HAL to receive the photo-taking command sent by the camera application is approximately 15ms. The time required for the HAL to request memory is approximately 50ms. The time required for the HAL to determine the captured image is approximately 10ms-30ms. Therefore, the time required for the fast photo-taking process in this embodiment of the present application is approximately 75ms (i.e., 15+50+10) to 95ms (i.e., 15+50+30).
[0177] Or, as Figure 6As shown in (b), in the embodiment of the present application, after the user performs a photo operation (such as pressing the photo button), the time required for the HAL to receive the focus lock command sent by the camera application is approximately 15ms. The time required for the HAL to perform the focus lock operation and receive the photo command is approximately 45ms. The time required for the HAL to apply for memory is approximately 50ms. The time required for the HAL to determine that the image is taken is approximately 10ms-30ms. Therefore, the time required for the fast photo process in the embodiment of the present application is approximately 120ms (i.e., 15+45+50+10) to 140ms (i.e., 15+45+50+30). That is, the time required for the fast photo method provided in the embodiment of the present application is much less than the 334ms required by the aforementioned photo method, which greatly improves the speed of fast photo taking and reduces the time required for photo taking.
[0178] In an embodiment of the present application, the camera application may include a first moment in the take a picture command sent to the HAL, or the camera may include a first moment in the focus lock command sent to the HAL. The first moment may be the moment when the camera application detects the take a picture operation. When the HAL receives the take a picture command, it may determine a second moment when the HAL receives the take a picture command. Therefore, after receiving the take a picture command, the HAL may determine a preset image queue based on the first moment, the second moment, and the first image, and may determine a target image with higher definition from the preset image queue, and may determine a final captured image based on the target image.
[0179] The following describes in detail the process of the HAL determining the preset image queue according to the first moment, the second moment and the first image.
[0180] In one example, the HAL can obtain R second images between the first moment and the second moment from the first image captured by the camera, and can determine these R second images as images in the preset image queue. Wherein, R≥1. That is, the preset image queue can be the first image captured by the camera during the period from the first moment when the camera application detects the photo operation to the second moment when the HAL receives the photo command. For example, when the camera application detects the photo operation at moment T1 and the HAL receives the photo command sent by the camera application at moment T2, the preset image sequence can be the first image captured by the camera during the period from T1 to T2. It can be understood that the frequency of image capture by the camera can be determined based on actual conditions, and the embodiments of the present application do not specifically limit this.
[0181] In another example, after acquiring R second images between the first moment and the second moment, the HAL can determine the clarity of the second image, and can determine a preset image sequence based on the clarity of the second image, that is, ensure that the images in the preset image sequence are all images with higher clarity, so that when the target image is subsequently determined from the preset image sequence, the number of image comparisons can be reduced, the speed of determining the target image can be increased, and thus the shooting speed can be increased.
[0182] In image processing, it is generally believed that a sharply focused image has sharper edges, i.e., a larger gradient, than a blurred image. In other words, a higher gradient indicates a higher image clarity, and a lower gradient indicates a lower image clarity. Therefore, in an embodiment of the present application, the electronic device can determine the clarity of the second image based on the gradient of the second image. Specifically, the electronic device can determine the clarity of the second image based on a Tenengrad gradient method, or based on a Laplacian gradient method or other methods.
[0183] The Tenengrad gradient method uses the Sobel operator to calculate the horizontal and vertical gradients of an image, then calculates the average gradient of the image based on these horizontal and vertical gradients. The image's clarity is then determined based on the average gradient. For example, the image's clarity can be directly determined from the average gradient; alternatively, a correspondence between the average gradient and clarity can be pre-set, and the image's clarity can then be determined based on the average gradient and this correspondence.
[0184] The Laplacian gradient method is similar to the Tenengrad gradient method in that it also determines the image clarity by calculating the gradient of the image. The Laplacian gradient method uses the Laplacian operator to replace the Sobel operator to calculate the gradient.
[0185] In probability theory, variance is a measurement method used to examine the degree of dispersion between a set of discrete data and its expectation (for example, the average value of this set of data). Among them, the larger the variance, the greater the deviation between this set of data, indicating that the distribution of this set of data is more uneven, that is, some data are larger and some data are smaller; the smaller the variance, the smaller the deviation between this set of data, indicating that the distribution of this set of data is more even, that is, the size of each data is similar. It should be understood that a clearly focused image has a greater grayscale difference than a blurred image, that is, it has a greater grayscale variance (that is, the variance in grayscale). In other words, the larger the grayscale variance, the higher the image clarity. Therefore, in an embodiment of the present application, the electronic device can also use the variance method to determine the clarity of the image. Specifically, the electronic device can calculate the grayscale variance of the image and determine the clarity of the image based on the grayscale variance. For example, the grayscale variance can be directly determined as the clarity of the image; or, a correspondence between the grayscale variance and the clarity can be set in advance, and then the clarity of the image can be determined based on the grayscale variance of the image and the correspondence.
[0186] It should be noted that the above-mentioned determination of the clarity of the second image using the Tenengrad gradient method, the Laplacian gradient method, or the variance method is merely exemplary and should not be construed as limiting the embodiments of the present application. Other methods may also be used in the embodiments of the present application to determine the clarity of the second image. It should be understood that the specific method used to determine the clarity of the second image can be determined by a skilled person based on actual circumstances.
[0187] In one possible implementation, the HAL may determine a preset image sequence based on the clarity of the second image and a preset clarity threshold. Specifically, after determining the clarity of the second image, the HAL may obtain a third image having a clarity greater than the preset clarity threshold, that is, obtain an image having a clarity greater than the preset clarity threshold from the second image as an image in the preset image queue. The number of third images S≥1. The preset clarity threshold may be specifically set by a technician according to actual conditions, or may be set by default by the electronic device. Exemplarily, the HAL may set the preset clarity threshold by default based on the clarity of the second image. For example, after determining the clarity of the second image, the HAL may calculate the average clarity of the second image based on the clarity of the second image, and may set the average clarity by default to the preset clarity threshold. For example, after determining the clarity of the second image, the HAL may determine the moment when the HAL completes the focus lock operation, and may set the clarity of the second image corresponding to that moment by default to the preset clarity threshold.
[0188] In another possible implementation, after determining the clarity of the second image, the HAL may obtain N fourth images with the highest clarity and may determine these N fourth images as images in a preset image sequence. N is an integer greater than or equal to 1. The specific value of N can be set by a technician based on actual circumstances or by default by the HAL. For example, the HAL may set N by default based on the number of second images R, where N ≤ R. For example, when the number of second images R is 3, the HAL may set N by default to 3. That is, after obtaining three second images captured by the camera, the HAL may not determine the clarity of these three second images and may directly determine all three second images as images in the preset image sequence. For example, when the number of second images R is 7, the HAL may set N by default to 4. That is, after obtaining seven second images captured by the camera, the electronic device may determine the clarity of each of the seven second images and may sort the seven second images in descending order based on their clarity, i.e., second images with higher clarity are ranked closer to the front, and second images with lower clarity are ranked closer to the back. Subsequently, the HAL may select the top four second images as images in the preset image sequence. Assuming that, among these seven second images, the clarity of second image A is less than the clarity of second image C, less than the clarity of second image E, less than the clarity of second image B, less than the clarity of second image F, less than the clarity of second image D, and less than the clarity of second image G, after arranging them in descending order, the result is {second image G, second image D, second image F, second image B, second image E, second image C, second image A}. Therefore, the HAL may determine {second image G, second image D, second image F, second image B} as images in the preset image sequence.
[0189] In another example, before the focus lock operation is completed, the electronic device generally performs autofocus. During the autofocus process, the electronic device can push the lens by starting the motor. It generally takes a while for the motor to reach a stable state from startup. During this period, the unstable movement of the motor will cause the focus state to be poor, resulting in a blurry image captured by the camera. Therefore, in an embodiment of the present application, the electronic device can obtain the third moment when the motor is started and the fourth moment when the motor is in a stable state. After obtaining R second images captured by the camera, HAL can determine the fifth image between the third moment and the second fourth moment, that is, determine which images in the second image are captured by the camera between the third moment and the fourth moment. Subsequently, HAL can obtain images other than the fifth image in the second image, and can determine these second images other than the fifth image as images in the preset image sequence. For example, when the second image acquired by HAL includes {second image A, second image B, second image C, second image D, second image E, second image F, second image G}, and at the same time, HAL determines that the fifth image acquired between the third moment and the fourth moment includes {second image C, second image D}, HAL can determine that the images in the preset image sequence include {second image A, second image B, second image E, second image F, second image G}.
[0190] In an embodiment of the present application, the HAL may also eliminate the fifth image based on the third image or the fourth image to obtain a preset image sequence. That is, after determining the third image or the fourth image based on the clarity of the second image, the HAL may determine the fifth image located between the third moment and the fourth moment, that is, determine which images in the third image or the fourth image were captured by the camera between the third moment and the fourth moment. Subsequently, the HAL may determine the images other than the fifth image in the third image or the fourth image as images in the preset image sequence to ensure the clarity of the images in the preset image sequence, improve the speed of determining the target image, and increase the speed of taking pictures.
[0191] The following describes in detail the process of HAL determining the target image from the preset image queue and determining the captured image based on the target image.
[0192] In an embodiment of the present application, the target image can be the M images with the highest definition in a preset image sequence. Alternatively, the target image can be the M images with the highest definition that are closest to a first moment in the preset image sequence, where the first moment is the actual photo-taking moment, i.e., the moment when the user triggers the photo-taking action, to reduce photo-taking delay and improve the photo-taking effect. M is an integer greater than or equal to 1. The specific value of M can be set by a technician based on actual conditions, or it can be set by default by the electronic device. For example, the electronic device can set M by default based on the current ambient brightness. For example, when the current ambient brightness is medium-high, the electronic device can set M by default to 1; when the current ambient brightness is low, the electronic device can set M by default to any value greater than 2. It should be understood that low brightness and medium-high brightness can be determined based on a preset brightness threshold. That is, when the ambient brightness is less than or equal to the preset brightness threshold, the ambient brightness can be determined to be low; when the ambient brightness is greater than the preset brightness threshold, the ambient brightness can be determined to be medium-high. Among them, the preset brightness threshold can be determined by technical personnel according to actual conditions. For example, the preset brightness threshold can be set to 35 candelas / square meter (lv), that is, low brightness refers to brightness ≤35lv, and medium and high brightness refers to brightness >35lv.
[0193] In one example, the HAL can directly determine any target image as the final captured image. For example, when M is 1, i.e., when there is only one target image, the HAL can directly determine that target image as the final captured image. For example, when M is greater than or equal to 2, i.e., when there are multiple target images, if the clarity of these M target images is the same, the HAL can directly determine any target image as the final captured image; if the clarity of these M target images is different, the HAL can determine the target image with the highest clarity as the final captured image.
[0194] In another example, when M is greater than or equal to 2, the HAL may synthesize the M target images and determine the synthesized image as the final captured image. Exemplarily, the HAL may perform multi-frame noise reduction on the M target images, i.e., the HAL may find noisy pixels in different target images and then, through weighted synthesis, replace the noisy pixels with noise-free pixels at the same locations in other target images, thereby obtaining a clearer and cleaner captured image.
[0195] Specifically, after starting the camera application, the electronic device can obtain the current ambient brightness so that the HAL can determine the final captured image based on the current ambient brightness and the target image. Exemplarily, when the current ambient brightness is low, that is, when the current ambient brightness is less than or equal to 35lv, the HAL can determine the image synthesized from the M target images as the final captured image, that is, the HAL can obtain the M target images with the highest clarity from the preset image queue, and can perform multi-frame noise reduction processing on these M target images to obtain the final captured image, so as to improve the image capture effect in a darker environment. When the current ambient brightness is medium to high, that is, when the current ambient brightness is greater than 35lv, the HAL can directly determine the single-frame target image as the final captured image, that is, the HAL can obtain the M target images with the highest clarity from the preset image queue, and can determine one of these M target images as the final captured image, so as to increase the shooting speed.
[0196] In a possible implementation, the quick photo taking method provided in the embodiment of the present application can be an optional mode of the camera application (such as snapshot mode), and the user can determine whether to start the snapshot mode to take photos according to actual needs. Figure 7 , Figure 7 The interface diagram of the quick photo taking method provided by the embodiment of the present application is shown Figure 1 .like Figure 7 As shown, after the user starts the camera application, the preview interface of the camera application can display modes such as large aperture mode, portrait mode, night mode, photo mode, video mode, and quick shot mode for the user to select. When the user selects the quick shot mode, the electronic device can take pictures according to the quick shot method provided in the embodiment of the present application. If the user does not select the quick shot mode, the electronic device takes pictures according to the current common shooting method.
[0197] In another possible implementation, the quick photo taking method provided in the embodiment of the present application can also be directly integrated into the photo taking mode of the camera application, that is, after starting the camera application, the electronic device can determine whether the camera application has the function of quick photo taking. If it is determined that the camera application has the function of quick photo taking, the electronic device can take pictures according to the quick photo taking method provided in the embodiment of the present application. It should be understood that the quick photo taking method provided in the embodiment of the present application can also be directly integrated into the various modes of the camera application, that is, when the camera application has the function of quick photo taking, in the large aperture mode, portrait mode, night scene mode, photo mode, video recording mode and other modes of the camera application, the electronic device can take pictures according to the quick photo taking method provided in the embodiment of the present application.
[0198] In another possible implementation, the quick photo taking method provided in the embodiment of the present application may also be a photo taking function that is only applicable to preset application scenarios (such as snapshot scenes). Specifically, after starting the camera application, the electronic device may determine whether the current photo taking scene is a snapshot scene. When it is determined that the current photo taking scene is a snapshot scene, the electronic device may take a quick photo according to the quick photo taking method provided in the embodiment of the present application to meet the user's snapshot needs, thereby improving the user experience. When it is determined that the current photo taking scene is not a snapshot scene, the electronic device may take a photo based on the current ordinary photo taking method.
[0199] For example, the electronic device can determine whether the current photo scene is a snapshot scene based on the launch time and launch method of the camera application. Specifically, when the electronic device displays a first application, if it detects that the camera application is launched via a shortcut, the electronic device can determine that the current photo scene is a snapshot scene. The first application is any application in the electronic device other than the camera application.
[0200] For example, when an electronic device is displaying an instant messaging application, if the user swipes left to bring up a shortcut menu and taps the camera icon or camera card in the shortcut menu to launch the camera application, the electronic device can determine that the current photo-taking scene is a snapshot. For example, when an electronic device is displaying a smart life application, if the user launches the camera application through a voice command containing a preset keyword or a preset gesture, the electronic device can determine that the current photo-taking scene is a snapshot.
[0201] For example, the electronic device may also directly determine whether the current photo scene is a snapshot scene based on the camera application startup method. Specifically, the electronic device may pre-set a preset startup method corresponding to the snapshot scene. When the camera application is launched, the electronic device may determine the current startup method. If the current startup method is the preset startup method, the electronic device may determine that the current photo scene is a snapshot scene.
[0202] For example, the electronic device may pre-set a startup method as a voice startup method containing the keyword "snapshot" or a "five-finger pinch" gesture startup method. When launching the camera application, the electronic device may determine whether the camera application is launched by a voice startup containing the keyword "snapshot" or by a "five-finger pinch" gesture. If it is determined that the camera application is launched by a voice startup containing the keyword "snapshot" or by a "five-finger pinch" gesture, the electronic device may determine that the current photo scene is a snapshot scene.
[0203] It should be noted that the above-mentioned determination of whether the current photographing scene is a preset application scene based on the startup time and startup method of the camera application, or directly based on the startup method of the camera application, is only for illustrative purposes and should not be construed as limiting the embodiments of the present application. In the embodiments of the present application, other methods can also be used to determine whether the current photographing scene is a preset application scene. The specific determination method can be set by technicians based on actual scenarios.
[0204] In an embodiment of the present application, when taking quick photos, the electronic device can turn off the artificial intelligence (AI) algorithm in the camera application to reduce the occupation of resources such as the processor of the electronic device by the execution of the AI algorithm, ensure that quick photos can be effectively executed, increase the photo taking speed, and enhance the user experience.
[0205] The following uses a mobile phone with a foldable screen as an example to illustrate the quick photo taking method provided by the embodiment of the present application. The quick photo taking function provided by the quick photo taking method provided by the embodiment of the present application can be directly integrated into the secondary screen camera application of the mobile phone. That is, when the mobile phone is in the folded state, the user can use the secondary screen camera application of the mobile phone to take quick photos.
[0206] See also Figure 8 , Figure 8 The interface diagram of the quick photo taking method provided by the embodiment of the present application is shown Figure 2 Specifically, when the phone is in the folded state, the user can swipe left or right on the secondary screen interface to bring up the icon or card of the secondary screen camera application. Subsequently, the user can click or touch the icon or card to start the secondary screen camera application. After the secondary screen camera application is started, HAL can obtain the first image captured by the camera. At the same time, Figure 8As shown, the secondary screen camera app can display a preview screen on the secondary screen interface, which can display modes such as photo mode and video mode. After detecting a photo operation, the secondary screen camera app can directly send a focus lock command to the HAL. Upon receiving the focus lock command, the HAL can execute the focus lock operation. Subsequently, the secondary screen camera app can send a photo command to the HAL, which can include a first time, the moment the secondary screen camera app detected the photo operation. After receiving the photo command, the HAL can obtain a second time at which the HAL received the photo command. Based on the first and second times, and the first image, the HAL can determine a preset image sequence and request memory. Furthermore, after the secondary screen camera app is launched, the phone can use the ambient light sensor to detect the current ambient brightness and set the number of target images, M, by default based on the current ambient brightness. For example, if the current ambient brightness is 56 lv, the phone can determine that the current ambient brightness is medium-high. In this case, the phone can set M to 1 by default. The HAL can then identify the highest-resolution image in the preset image queue as the target image and store it in the requested memory. Assuming the current ambient brightness is 23 lv, the phone can determine that the current ambient brightness is low. In this case, the phone can set M to 4 by default. Subsequently, the HAL can determine the four highest-resolution images in the preset image queue as target images, and perform multi-frame noise reduction on these four target images to determine the image obtained from the multi-frame noise reduction process as the final captured image and store it in the requested memory.
[0207] Later, the user can view the captured image from the gallery, or click on the thumbnail of the secondary screen camera application to view the captured image.
[0208] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.
[0209] Corresponding to the quick photographing method described in the above embodiment, the embodiment of the present application further provides a quick photographing device, and each module of the device can correspond to implement each step of the quick photographing method.
[0210] It should be noted that the information interaction, execution process, etc. between the above-mentioned devices / units are based on the same concept as the method embodiment of this application. Their specific functions and technical effects can be found in the method embodiment section and will not be repeated here.
[0211] Those skilled in the art can clearly understand that, for the convenience and brevity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In actual applications, the above-mentioned functions can be distributed and completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated into one processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.
[0212] The embodiment of the present application also provides an electronic device, the electronic device comprising at least one memory, at least one processor, and a computer program stored in the at least one memory and executable on the at least one processor, wherein when the processor executes the computer program, the electronic device implements the steps of any of the above-mentioned method embodiments. For example, the structure of the electronic device can be as follows: Figure 1 shown.
[0213] An embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program. When the computer program is executed by a computer, the computer is enabled to implement the steps of any of the above method embodiments.
[0214] An embodiment of the present application provides a computer program product. When the computer program product is run on an electronic device, the electronic device implements the steps of any of the above method embodiments.
[0215] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, which can be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program, when executed by the processor, can implement the steps of the above-mentioned various method embodiments. Wherein, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable storage medium may include at least: any entity or device that can carry the computer program code to the device / electronic device, a recording medium, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electric carrier signal, a telecommunication signal and a software distribution medium. For example, a USB flash drive, a mobile hard disk, a magnetic disk or an optical disk. In some jurisdictions, according to legislation and patent practice, a computer-readable storage medium cannot be an electric carrier signal or a telecommunication signal.
[0216] In the above embodiments, the description of each embodiment has its own focus. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant description of other embodiments.
[0217] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0218] In the embodiments provided in the present application, it should be understood that the disclosed devices / electronic devices and methods can be implemented in other ways. For example, the device / electronic device embodiments described above are merely schematic. For example, the division of the modules or units is merely a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0219] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.
[0220] The above-described embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present application, and should all be included in the scope of protection of the present application.
Claims
1. A quick photo taking method, applied to an electronic device, wherein the electronic device includes a camera, characterized in that: The method comprises: In response to a photographing operation, the camera application of the electronic device sends a photographing command to the hardware abstraction layer of the electronic device, where the photographing command includes a first moment, where the first moment is a moment when the camera application detects the photographing operation, where the photographing operation is an operation performed by a user to take a photograph; In response to the photo-taking command, the hardware abstraction layer determines a second moment, determines a preset image queue based on the first moment, the second moment and the first image, and determines a captured image based on the preset image queue, wherein the first image is an image captured by the camera acquired by the hardware abstraction layer after the camera application is started, and the second moment is the moment when the hardware abstraction layer receives the photo-taking command.
2. The method according to claim 1, characterized in that Before the camera application sends a photo taking command to the hardware abstraction layer, the method further includes: The camera application sends a focus lock command to the hardware abstraction layer; In response to the focus lock command, the hardware abstraction layer performs a focus lock operation.
3. The method according to claim 1, characterized in that The hardware abstraction layer determines a preset image queue according to the first moment, the second moment, and the first image, including: The hardware abstraction layer determines a second image in the first image that is between the first moment and the second moment, where the second image is at least one of the first images; The hardware abstraction layer determines the second image as an image in the preset image queue.
4. The method according to claim 1, wherein The hardware abstraction layer determines a preset image queue according to the first moment, the second moment, and the first image, including: The hardware abstraction layer determines a second image in the first image that is between the first moment and the second moment, where the second image is at least one of the first images; The hardware abstraction layer obtains the definition of the second image and determines the preset image queue according to the definition of the second image.
5. The method according to claim 4, characterized in that The hardware abstraction layer determines the preset image queue according to the definition of the second image, including: The hardware abstraction layer obtains a third image whose definition is greater than a preset definition threshold, and determines the third image as an image in the preset image queue, wherein the third image is at least one of the second images; or The hardware abstraction layer obtains N fourth images with the highest definition from the second image, and determines the N fourth images as images in the preset image queue, where N≥1.
6. The method according to claim 1, characterized in that The hardware abstraction layer determines a preset image queue according to the first moment, the second moment, and the first image, including: The hardware abstraction layer determines a second image in the first image that is between the first moment and the second moment, where the second image is at least one of the first images; The hardware abstraction layer obtains a third moment when the motor is started and a fourth moment when the motor is in a stable state; The hardware abstraction layer obtains a fifth image located between the third moment and the fourth moment in the second image; The hardware abstraction layer determines the preset image queue according to the second image and the fifth image.
7. The method according to any one of claims 1 to 6, characterized in that The hardware abstraction layer determines the captured image according to the preset image queue, including: The hardware abstraction layer obtains a target image with the highest definition in the preset image queue, and determines the target image as the captured image.
8. The method according to any one of claims 1 to 6, characterized in that The hardware abstraction layer determines the captured image according to the preset image queue, including: The hardware abstraction layer obtains a target image in the preset image queue that is closest to the first moment and has the highest definition, and determines the target image as the captured image.
9. The method according to any one of claims 1 to 6, characterized in that The hardware abstraction layer determines the captured image according to the preset image queue, including: The hardware abstraction layer obtains M target images with the highest definition in the preset image queue, where M>1; The hardware abstraction layer performs synthesis processing on the M target images and determines the synthesized image as the captured image.
10. The method according to any one of claims 1 to 6, characterized in that The hardware abstraction layer determines the captured image according to the preset image queue, including: The hardware abstraction layer obtains M target images in the preset image queue that are closest to the first moment and have the highest definition, where M>1; The hardware abstraction layer performs synthesis processing on the M target images and determines the synthesized image as the captured image.
11. The method according to any one of claims 1 to 6, characterized in that The hardware abstraction layer determines the captured image according to the preset image queue, including: The hardware abstraction layer obtains the current ambient brightness and determines the captured image according to the ambient brightness and the preset image queue.
12. The method according to claim 11, characterized in that The hardware abstraction layer determines the captured image according to the ambient brightness and the preset image queue, including: When the ambient brightness is greater than a preset brightness threshold, the hardware abstraction layer obtains a target image with the highest definition in the preset image queue, and determines the target image as the captured image.
13. The method according to claim 11, characterized in that The hardware abstraction layer determines the captured image according to the ambient brightness and the preset image queue, including: When the ambient brightness is less than or equal to a preset brightness threshold, the hardware abstraction layer obtains M target images with the highest definition in the preset image queue, where M>1; The hardware abstraction layer performs synthesis processing on the M target images, and determines the photographed image as the synthesized image.
14. The method according to claim 12, characterized in that The hardware abstraction layer determines the captured image according to the ambient brightness and the preset image queue, including: When the ambient brightness is less than or equal to a preset brightness threshold, the hardware abstraction layer obtains M target images with the highest definition in the preset image queue, where M>1; The hardware abstraction layer performs synthesis processing on the M target images, and determines the photographed image as the synthesized image.
15. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the electronic device implements the fast photographing method according to any one of claims 1 to 14.
16. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a computer, the computer is enabled to implement the rapid photographing method according to any one of claims 1 to 14.
Citation Information
Patent Citations
Rapid shooting method and device for mobile communication terminal
CN104994277A
Camera access method and device, terminal equipment and readable storage medium
CN111447370A