Image capturing method and electronic equipment
By optimizing the image acquisition queue processing, especially in low-light environments, and quickly responding to photo requests, the problem of delays in smart devices taking photos in specific environments is solved, and the effect of quickly capturing clear images is achieved.
Patent Information
- Application Number
- CN202510899659.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-30
- Publication Date
- 2025-10-03
AI Technical Summary
Existing smart devices require a long exposure time when taking photos in specific environments, resulting in a drop in frame rate and a delay in responding to image acquisition requests, which cannot meet users' needs for quickly capturing clear images.
By creating a cache queue, we prioritize photo requests and replace unprocessed preview requests. We also optimize request processing in low-light environments by combining it with the ambient light sensor, ensuring that photo requests enter the execution queue quickly and improving response speed.
It effectively reduces image blur and delay caused by long exposure, improves user experience, and ensures that high-quality photos can be quickly obtained even in low-light environments.
Smart Images

Figure CN120751244A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of device image capture, and in particular to an image capture method and electronic device. Background Art
[0002] With the continuous advancement of smart device technology, users are increasingly demanding faster camera speeds. They want to capture clear images quickly to instantly share and record important moments. However, current smart device cameras often require long exposure times to capture sufficient light in certain environments, which directly leads to reduced frame rates and delays in responding to image acquisition requests. Summary of the Invention
[0003] An embodiment of the present application provides an image capture method, including displaying and outputting preview images, each preview image being an image captured by an image capture device in response to preview requests arranged sequentially in an execution queue; the preview request being generated based on a first time interval; obtaining a photographing operation; generating a photographing request based on the photographing operation; the photographing request replacing a preview request generated based on the first time interval before the photographing request and not added to the execution queue; obtaining a photographed image in response to the photographing request, the photographed image being an image obtained by the image capture device in response to the photographing request in the execution queue.
[0004] Optionally, before the photo request, the preview request generated based on the first time interval and not added to the execution queue includes: creating a first cache queue to sequentially cache the preview request and the photo request; if the newly added acquisition request to the first cache queue is a shooting request, the photo request will replace the preview request at the head of the first cache queue, so that the time when the photo request is added to the execution queue is advanced.
[0005] Optionally, replacing the preview request at the head of the cache queue with the photo request includes: deleting the preview request that is located before the photo request in the first cache queue.
[0006] Optionally, the method also includes: obtaining a brightness value representing the capture environment corresponding to the image capture device through an ambient light sensor; if the brightness value is less than a target threshold, executing a photo request to replace the preview request generated before the photo request based on the first time interval and not added to the execution queue.
[0007] Optionally, the execution queue includes multiple sequentially arranged and adjacent photo taking requests.
[0008] An embodiment of the present application also provides an image capture method, including creating a first cache queue, wherein the first cache queue sequentially caches acquisition requests for an image acquisition device generated by an application capable of calling the image acquisition device, the acquisition requests including preview requests and photo requests; if the acquisition request newly added to the first cache queue is a photo request, the preview request at the head of the first cache queue is replaced by the photo request, so that the time when the photo request is added to the execution queue is advanced; wherein the image acquisition device obtains a photo image in response to the photo request in the execution queue.
[0009] Optionally, replacing the preview request at the head of the first cache queue with the photo request includes: deleting the preview request before the photo request in the first cache queue.
[0010] An embodiment of the present application also provides an electronic device, including: an image acquisition application layer, used to generate preview requests and photo requests, and send the preview requests and photo requests to an image acquisition service layer; an image acquisition service layer, used to create a first cache queue and an execution queue, the first cache queue sequentially caches preview requests and photo requests; if the acquisition request newly added to the first cache queue is a photo request, the photo request replaces the preview request at the head of the first cache queue, so that the time when the photo request is added to the execution queue is advanced; an image acquisition abstraction layer, used to obtain a photo image in response to the photo request sent by the execution queue.
[0011] An embodiment of the present application also provides an electronic device, including an image acquisition device for acquiring images; a processor for displaying and outputting preview images, each preview image being an image acquired by the image acquisition device in response to preview requests arranged sequentially in an execution queue; the preview request being generated based on a first time interval; obtaining a photographing operation; generating a photographing request based on the photographing operation; the photographing request replacing a preview request generated based on the first time interval before the photographing request and not added to the execution queue; obtaining a photographed image in response to the photographing request, the photographed image being an image acquired by the image acquisition device in response to the photographing request in the execution queue.
[0012] Optionally, the electronic device also includes an ambient light sensor; the ambient light sensor is used to obtain a brightness value representing the capture environment corresponding to the image acquisition device; the processor is also used to determine whether the brightness value is less than the target threshold. If the brightness value is less than the target threshold, the image acquisition device is called to execute a photo request to replace the preview request generated based on the first time interval and not added to the execution queue before the photo request. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] Figure 1 This is a flowchart of an image capturing method according to an embodiment of the present application;
[0014] Figure 2 A flowchart of an image capturing method according to another embodiment of the present application;
[0015] Figure 3 This is a flowchart of an image capturing method according to another embodiment of the present application;
[0016] Figure 4 This is a flowchart of another image capturing method according to an embodiment of the present application;
[0017] Figure 5 Schematic diagram of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0018] Various aspects and features of the present application are described herein with reference to the accompanying drawings.
[0019] It should be understood that various modifications may be made to the embodiments of the present application. Therefore, the above description should not be considered as limiting, but merely as an example of an embodiment. Other modifications within the scope and spirit of the present application will occur to those skilled in the art.
[0020] The accompanying drawings, which are incorporated in and constitute a part of the specification, illustrate embodiments of the present application and, together with the general description of the present application given above and the detailed description of the embodiments given below, serve to explain the principles of the present application.
[0021] These and other characteristics of the present application will become apparent from the following description of a preferred form of embodiment given as a non-limiting example with reference to the accompanying drawings.
[0022] It should also be understood that although the present application has been described with reference to certain specific examples, those skilled in the art will readily be able to implement many other equivalent forms of the present application.
[0023] The above and other aspects, features and advantages of the present application will become more apparent from the following detailed description when taken in conjunction with the accompanying drawings.
[0024] Specific embodiments of the present application will be described hereinafter with reference to the accompanying drawings; however, it should be understood that the embodiments described are merely examples of the present application and may be implemented in a variety of ways. Familiar and / or repetitive functions and structures are not described in detail to avoid obscuring the present application with unnecessary or redundant details. Therefore, the specific structural and functional details described herein are not intended to be limiting, but rather serve merely as a basis and representative basis for the claims to teach those skilled in the art to variously utilize the present application with substantially any suitable detailed structure.
[0025] This specification may use the phrases "in one embodiment," "in another embodiment," "in yet another embodiment," or "in other embodiments," which may all refer to one or more of the same or different embodiments according to the present application.
[0026] The image capturing method of the present application is described in detail below with reference to the accompanying drawings. Figure 1 This is a flow chart of the image capturing method according to an embodiment of the present application, as shown in FIG. Figure 1 As shown, the method includes the following steps:
[0027] S110: Displaying output preview images, each preview image is an image captured by an image capture device in response to preview requests sequentially arranged in an execution queue; the preview requests are generated based on a first time interval.
[0028] Exemplarily, the image acquisition device refers to a device component that can capture images, usually a camera of an electronic device. The camera can be a module built into an electronic device, such as a mobile phone, tablet computer, laptop computer, or desktop computer. When the user starts a camera application on the electronic device (for example, a factory-installed application or a third-party application), preview requests will begin to be generated at a preset first time interval. The frequency of generation of these preview requests can be adjusted according to device performance and user needs to ensure a smooth preview experience when taking pictures. A preview request refers to an instruction requesting the image acquisition device to capture an image of the current scene. These requests are sent to a pre-created first cache queue.
[0029] The first cache queue is a temporary storage area for generated preview requests. This queue adds preview requests to the execution queue in chronological order, ensuring that the image capture device processes them sequentially in the order they were generated. This allows the system to process multiple requests in an orderly manner, avoiding confusion and delays caused by excessive requests. The execution queue is a queue used to manage and schedule image capture requests. The image capture device responds to each preview request and captures the corresponding image, following the order in the execution queue. This allows users to see preview images in real time on the camera application's interface, ensuring they can adjust their composition and settings before taking a photo to achieve the optimal result. For example, images captured by the image capture device in response to the sequentially arranged preview requests in the execution queue are displayed in real time on the camera application's interface. These preview images allow users to observe real-time changes in the current scene, enabling them to make more accurate photo decisions.
[0030] S120: Acquire a photo-taking operation.
[0031] For example, after the camera application is started, the user will see a friendly interface, which usually includes a viewfinder, a shutter button, control options (such as flash, filter, resolution setting, etc.) and other auxiliary functions (such as timer, grid lines, etc.). The user can take pictures by touching the shutter button on the screen. When the user clicks the shutter button on the interface, the camera application can capture this touch event as a trigger signal for the camera operation. For example, the camera application can detect the user's touch event and determine whether it is a "pressed" or "released" state. When the user presses the shutter button, visual or auditory feedback can be provided, such as a change in button color or a shutter sound, to confirm that the operation has been received.
[0032] S130: Generate a photo request based on the photo-taking operation.
[0033] For example, when a user presses the shutter button, a photo request is generated. This photo request records the exact time the user issued the photo request for subsequent processing. It also includes photo parameters such as the current exposure time, ISO value, white balance, and focal length. In this embodiment, the photo request replaces preview requests generated at the first time interval before the photo request and not added to the execution queue. This can shorten the photo response time and improve the user experience.
[0034] For example, preview requests that have not been added to the execution queue are arranged in chronological order as Preview Request 1, Preview Request 2, Preview Request 3, and Preview Request 4. When a photo request is detected, the preview request preceding it can be replaced. That is, the order of adding the preview request to the execution queue after replacement is photo request, preview request 1, preview request 2, preview request 3, and preview request 4. This method can add photo requests to the execution queue in advance, shortening the photo response time.
[0035] S140: In response to the photo request, obtain a photo image, where the photo image is an image obtained by the image acquisition device in response to the photo request in the execution queue.
[0036] For example, when a photo request is detected, other low-priority preview requests can be stopped from being processed to ensure that the photo request is given priority. After receiving the photo request, the image acquisition device automatically adjusts the parameters of the camera according to the settings contained in the photo request (such as exposure time, ISO value, white balance, focus mode, etc.). The image acquisition device focuses on the current scene to ensure that the subject is clearly visible. According to the ambient light conditions, the image acquisition device adjusts the exposure time and ISO sensitivity to obtain the best image brightness and details. According to the type of light source (such as daylight, fluorescent light, etc.), the white balance is adjusted to ensure the accuracy of the image color. After the parameter setting is completed, the image acquisition device captures the image, and the photo image will be saved to the internal storage of the device or the storage location specified by the user. The user can access and manage these images at any time in the photo application.
[0037] The image capture method of this embodiment displays a preview image, allowing users to view the image effect in real time before taking a photo. This preview mechanism enables users to make photo decisions more quickly, thereby reducing wait time and improving the device's response speed to photo requests. By prioritizing photo requests over unexecuted preview requests, users are guaranteed to obtain high-quality photos when they need to quickly capture a moment. This optimized request processing mechanism effectively reduces image blur and delays caused by long exposure times.
[0038] Figure 2 This is a flow chart of an image capturing method according to another embodiment of the present application. Figure 2 As shown, the preview request generated based on the first time interval and not added to the execution queue before the photo request in step S130 includes:
[0039] S210: Create a first cache queue to sequentially cache preview requests and photo-taking requests.
[0040] Exemplarily, the first cache queue is a temporary data structure for storing generated preview requests and photo requests. The first cache queue is arranged in the order in which the requests are generated to ensure that the requests can be processed in an orderly manner. When the user starts the photo application, the first cache queue is initialized. The first cache queue can be implemented using a first-in-first-out (FIFO) data structure to ensure that the requests are processed in the order in which they are generated. When the user uses the photo application, preview requests are generated periodically according to a set first time interval. Whenever a new preview request is generated, the preview request is added to the end of the first cache queue. When the user presses the shutter button to issue a photo request, a new photo request is generated and inserted into the first cache queue. At this time, the priority of the photo request is higher than that of the ordinary preview request. The photo request replaces the preview request generated before and not yet processed, ensuring that the user can quickly obtain the photo image without being delayed by unprocessed preview requests.
[0041] S220: If the acquisition request newly added to the first cache queue is a shooting request, the preview request at the head of the first cache queue is replaced by the shooting request, so that the shooting request is added to the execution queue earlier.
[0042] For example, in the first cache queue, all requests can be divided into two categories: preview requests and photo requests. Preview requests are generated periodically to display a real-time image of the current scene. Photo requests, initiated by the user when deciding to take a photo, have a higher priority. The photo application can identify whether a newly added request is a photo request or a preview request so that it can be handled appropriately. When the user presses the shutter button, a new photo request is generated. This request contains detailed information about the current capture settings and is marked as a high-priority request. After the photo request is added to the first cache queue, the head of the queue (i.e., the first request) is checked. If the head request is a preview request, a replacement mechanism is initiated. This replacement mechanism ensures that the photo request enters the execution queue as quickly as possible, enabling rapid capture and preventing users from missing their photo opportunities due to delays. The newly generated photo request is inserted into the execution queue at an appropriate position, typically at the front, to ensure priority processing. After the preview request is replaced, the execution queue is updated. The image acquisition device prioritizes responding to the new photo request rather than continuing to process the replaced preview request. This replacement mechanism provides users with a smoother photo experience. Even in high-load photo-taking scenarios, it can quickly respond to users' photo-taking needs, ensuring that users can capture important moments.
[0043] By replacing the preview request at the head of the first cache queue with a photo request, the processing speed of the photo request is effectively improved. This substitution mechanism ensures that users can quickly obtain the required image during the photo capture process, avoiding delays caused by the presence of lower-priority requests. This not only optimizes image acquisition efficiency, but also significantly enhances the user experience, making the photo capture operation smoother and more intuitive.
[0044] In some embodiments, replacing the preview request at the head of the cache queue with a photo request includes deleting the preview request that precedes the photo request in the first cache queue. For example, in the first cache queue, all requests are arranged in chronological order of generation. Requests are divided into two categories: preview requests and photo requests. Preview requests are periodically generated by the photo application to display an image of the current scene, while photo requests are commands issued by the user via the shutter button and have a higher priority. After the photo request is added to the queue, the head of the first cache queue (i.e., the first request) is checked. If the head request is a preview request, all preview requests in the first cache queue that precede the photo request are deleted. Specifically, the first cache queue is traversed starting from the head, and all preview requests that precede the photo request are identified and deleted. When the first photo request is found, the traversal stops, and all preview requests that precede it are removed from the queue. This operation can be achieved by adjusting the queue pointer or index to ensure the correct queue order. This approach effectively manages request priority and avoids delays caused by unprocessed preview requests. When a photo request replaces the head preview request, it is added to the execution queue so that the image acquisition device can respond immediately.
[0045] By deleting the preview request before the photo request, the time users wait for the photo image can be effectively shortened. This ensures that users can quickly obtain high-quality images when they need to capture a moment quickly, thereby improving the overall photo-taking experience.
[0046] Figure 3 FIG. 1 is a flowchart of an image capturing method according to another embodiment of the present application. Figure 3 As shown, the above image capturing method further includes:
[0047] S310: Obtaining a brightness value representing a capture environment corresponding to the image capture device through an ambient light sensor.
[0048] For example, an ambient light sensor is a device that detects ambient light intensity and is typically integrated into electronic devices such as smartphones, tablets, and cameras. It monitors lighting changes in real time, providing important environmental information for image capture. When a user launches a camera application, the ambient light sensor is automatically activated. Once activated, the sensor continuously monitors ambient light intensity and periodically updates its output value. The output brightness value of an ambient light sensor typically varies within a range. For example, in bright sunlight, the brightness value may reach tens of thousands of lux, while in a dark room, the brightness value may be less than 10 lux. The acquired brightness value is updated in real time and provides information about the current ambient lighting when the user takes a photo. The acquired brightness value is compared with a preset target threshold. Based on the brightness value, it can be used to determine whether the current environment is suitable for taking photos. For example, if the brightness value is less than the target threshold, the current environment is considered low light. In this embodiment, the user can view the current ambient brightness information on the camera application interface. This real-time feedback helps users understand the shooting conditions and adjust the shooting settings as needed. If the ambient light is insufficient, prompt information can be provided to the user, such as "The light is insufficient, please adjust the ambient light source" or "Automatically adjusting the photo settings" to enhance the user experience.
[0049] By using an ambient light sensor to obtain the brightness value representing the environment corresponding to the image acquisition device, not only can optimal image quality be achieved when taking photos under different lighting conditions, but it also provides users with real-time environmental feedback, enhancing the intelligent and user-friendly photography experience. The implementation of this mechanism enables smart devices to better adapt to various shooting environments, thereby improving user satisfaction and the value of the device.
[0050] S320: If the brightness value is less than the target threshold, executing a photo request to replace a preview request generated based on the first time interval and not added to the execution queue before the photo request.
[0051] Exemplarily, when the user starts a photo-taking application and prepares to take a photo, the brightness value of the current environment is obtained in real time through the ambient light sensor and converted into a digital signal (in lux). The obtained brightness value is compared with the preset target threshold. The target threshold is set according to the photo-taking requirements and environmental conditions, for example, it is usually set to 50Lux. If the brightness value is less than the target threshold, it is determined that the current environment is a low-light environment. At this time, a photo-taking request is executed to replace the preview request generated before the photo-taking request based on the first time interval and not added to the execution queue. In a low-light environment, when a photo-taking request is detected, the status of the first cache queue can be checked to identify the head request (i.e., the request at the head of the queue). If the head request is a preview request, a replacement operation will be performed. The preview request at the head of the queue is removed from the first cache queue. The newly generated photo-taking request is inserted into the appropriate position of the execution queue, usually at the front of the queue, to ensure that it is processed first.
[0052] The method of this embodiment can use the ambient light sensor to obtain the brightness value representing the capture environment corresponding to the image capture device. Based on this value, it can determine whether to execute a capture request to replace an unprocessed preview request. This ensures that users can quickly obtain high-quality images in low-light environments, improving the efficiency and effectiveness of photography. This mechanism not only optimizes the image capture strategy but also significantly enhances the user experience, making the photography operation more intelligent and user-friendly.
[0053] In some embodiments, the execution queue includes multiple sequentially arranged and adjacent photo requests. For example, when a user performs a continuous shooting operation using a photo-taking application, the user may press the shutter button in rapid succession. Each time the shutter button is pressed, the photo-taking application generates a new photo request. Each photo request contains detailed information about the current shooting settings, such as exposure time, ISO value, white balance, and focal length. These requests are marked as high priority to ensure a quick response to user operations. During the continuous shooting operation, the multiple photo requests generated are sequentially added to the end of the first cache queue. During this time, multiple unprocessed preview requests may exist in the first cache queue. Because photo requests are generated based on the order of user operations, their order in the first cache queue should also be consistent with the order in which the user takes photos. After the multiple photo requests are added to the first cache queue, the queue status is checked to identify the head request (i.e., the request at the head of the queue). If the head request is a preview request, a replacement mechanism is implemented. The head preview request is removed from the first cache queue to ensure that it does not block the processing of photo requests. The multiple newly generated photo requests are inserted into the first few positions of the first cache queue, ensuring that they are sequentially arranged and adjacent to each other. After the replacement, multiple photo requests will be added to the execution queue. Multiple photo requests in the execution queue will be executed in the order they were generated.
[0054] By replacing unprocessed preview requests with multiple capture requests and sequentially arranging them in the execution queue, the efficiency of capturing requests is effectively improved. This ensures that users can quickly obtain continuous, high-quality images during continuous shooting, avoiding missing important moments due to request processing delays.
[0055] Figure 4 FIG. 1 is a flow chart of another image capturing method according to an embodiment of the present application. Figure 4 As shown, the above image capturing method further includes:
[0056] S410: Create a first cache queue, which sequentially caches acquisition requests for the image acquisition device generated by an application capable of calling the image acquisition device, the acquisition requests including preview requests and photo taking requests.
[0057] Exemplarily, the first cache queue is a data structure used to sequentially cache acquisition requests generated by an application for an image acquisition device. It serves as a temporary storage area designed to improve request processing efficiency and response speed. The queue utilizes a first-in, first-out (FIFO) principle, ensuring that requests are processed in the order in which they were generated. This queue structure enables orderly management of multiple requests and avoids confusion. The acquisition requests stored in the first cache queue primarily include two types: preview requests and photo requests. Specifically, preview requests are used to display an image of the current scene in real time and are typically generated periodically by the application. Preview requests allow users to view the live view before taking a photo. Photo requests are initiated by the user using the shutter button, instructing the image acquisition device to capture an image of the current scene. These requests typically have a higher priority and are designed to quickly respond to the user's photo needs. As the user performs a photo or preview operation, each generated request is sequentially added to the end of the first cache queue. This ensures the sequential nature of the requests, allowing the application (photography application) to process the requests in the order in which the user performed the operation.
[0058] Creating a first cache queue to sequentially cache acquisition requests generated by applications capable of calling image acquisition devices can effectively manage preview requests and photo requests, improve the efficiency of image acquisition, and ensure that users can quickly obtain the required images when taking photos.
[0059] S420: If the newly added acquisition request to the first cache queue is a photo request, the photo request replaces the preview request at the head of the first cache queue, so that the photo request is added to the execution queue earlier; wherein, the image acquisition device obtains a photo image in response to the photo request in the execution queue.
[0060] Exemplarily, when the user presses the shutter button in the photo-taking application, a new photo-taking request is generated and added to the end of the first cache queue. After adding the request, the type of the newly added request is checked to determine whether it is a photo-taking request. If it is a photo-taking request, the head request of the first cache queue is detected. If the head request is a preview request, an alternative operation is performed. If the head request is a photo-taking request, no operation is performed and the current queue state is maintained. The new photo-taking request will be inserted in front of the first cache queue and become the new head request. The execution queue is a structure for processing image acquisition requests, and the requests in the queue are processed in sequence according to the priority and order of the requests. After the photo-taking request is added to the execution queue, the image acquisition device responds to the request and performs the photo-taking operation. When executing the photo-taking request, the image acquisition device makes adjustments based on the settings in the request (such as exposure time, ISO value, focus mode, etc.) to ensure the best image quality under the current environment.
[0061] By replacing the preview request at the head of the first cache queue with the photo request, users can quickly obtain the desired photo image. This replacement mechanism ensures that the photo request is added to the execution queue as early as possible, thereby improving response speed and shortening photo response time.
[0062] The image capture method of this embodiment effectively manages and optimizes the processing of image acquisition requests by creating a first cache queue. By prioritizing photo capture requests, it enables rapid responses when users take photos, ensuring that users receive high-quality images in a timely manner. This mechanism not only improves photo capture efficiency but also significantly enhances the user experience, making photo capture operations smoother and more intuitive.
[0063] In some embodiments, replacing the preview request at the head of the first cache queue with a photo request includes: deleting the preview request in the first cache queue that is located before the photo request. For example, when the user presses the shutter button, a new photo request is generated and added to the end of the first cache queue. After adding the photo request, the head of the first cache queue (i.e., the first request) is checked. If the request at the head of the queue is a preview request, a replacement operation will be performed. Specifically, all preview requests before the photo request are deleted from the first cache queue, which ensures that the requests in the queue are prioritized by the photo request and reduces unnecessary preview requests. By deleting these unprocessed preview requests, the queue order can be optimized so that the photo request can enter the execution queue faster. After completing the replacement operation, the new photo request will be added to the execution queue. The image acquisition device will respond to this photo request first.
[0064] By replacing the preview request at the head of the first cache queue with the photo request and deleting all unprocessed preview requests before the photo request, the processing efficiency of image acquisition requests is effectively improved, avoiding delays caused by the existence of low-priority requests.
[0065] The present application provides an electronic device, comprising: an image acquisition application layer, configured to generate a preview request and a photo request, and to send the preview request and the photo request to an image acquisition service layer; an image acquisition service layer, configured to create a first cache queue and an execution queue, wherein the first cache queue sequentially caches the preview request and the photo request; if a newly added acquisition request to the first cache queue is a photo request, the preview request at the head of the first cache queue is replaced by the photo request, so that the photo request is added to the execution queue earlier; and an image acquisition abstraction layer, configured to obtain a photo image in response to the photo request sent by the execution queue.
[0066] refer to Figure 5 As shown, preview requests and photo requests can be generated by the image acquisition application layer (Camera App layer). For example, after a user opens the photo application, a preview request is generated according to a first time interval and cached in the first cache queue (Queue A) in the image acquisition service layer (Camera Server layer). The Camera App layer responds to the user pressing the photo button, generates a photo request, and caches it in the first cache queue. After detecting that the user has pressed the photo button, the Camera App layer can send a traversal signal to the Camera Server layer. Based on the traversal signal, the first cache queue can be traversed in a loop to determine the timing for caching the photo request in the first cache queue. Based on the traversal result, the replacement mechanism can be executed in a timely manner, that is, the preview request at the head of the first cache queue is replaced with the photo request. This advances the time for the photo request to be added to the execution queue (request queue B). After the photo request is added to the execution queue, the Camera Server layer sends the photo request to the image acquisition abstraction layer (Camera HAL layer). The Camera HAL layer responds to the photo request sent by the execution queue to obtain the photo image.
[0067] The image capture method of this embodiment uses a replacement mechanism for the first cache queue to advance the time it takes for a photo request to enter the Camera HAL layer. This in turn speeds up the time it takes for the Camera HAL layer to respond to photo requests, improving the device's response speed to photo requests and ensuring that users can obtain high-quality photos in a timely manner when they need to quickly capture a moment. This optimized request processing mechanism effectively reduces image blur and latency caused by long exposure times.
[0068] An embodiment of the present application also provides an electronic device, including an image acquisition device and a processor; the image acquisition device is used to acquire images; the processor is used to display and output preview images, each preview image is an image acquired by the image acquisition device in response to preview requests arranged sequentially in an execution queue; the preview request is generated based on a first time interval; a photo operation is obtained; based on the photo operation, a photo request is generated; the photo request replaces the preview request generated based on the first time interval before the photo request and not added to the execution queue; in response to the photo request, a photo image is obtained, the photo image being an image acquired by the image acquisition device in response to the photo request in the execution queue.
[0069] Exemplarily, an image acquisition device is responsible for capturing image data and can capture images based on preview requests and photo capture requests. In response to preview requests sequentially arranged in an execution queue, the image acquisition device captures an image of the current scene and transmits it to a processor for display and processing. The processor processes the image captured by the image acquisition device (i.e., the preview image) and displays it on a user interface, ensuring that the user can view the current captured image in real time. Preview requests are generated based on a first time interval, typically periodically after a user launches an image capture application. These requests are used to display an image of the current scene, helping the user to review the captured image. Preview requests are arranged in the execution queue in chronological order of generation, ensuring that the user can view the latest image previews. The processor periodically retrieves preview requests from the execution queue and invokes the image acquisition device to capture an image. The user initiates a photo capture request by pressing the shutter button or performing other actions. The processor monitors the user's actions and generates a corresponding photo capture request when the user takes a photo. After generating a photo capture request, the processor checks all unprocessed preview requests in the first cache queue that precede the photo capture request. If the first request in the queue is a preview request, the processor removes it from the execution queue to ensure that the photo capture request is processed first. The new photo request will be inserted into the execution queue to ensure that it can be responded to as soon as possible. After receiving the photo request, the image acquisition device takes a photo according to the settings in the request and generates the final photo image.
[0070] The electronic device of this application achieves an efficient image acquisition and processing process through the effective combination of an image acquisition device and a processor. This electronic device can quickly respond to user photography requests, optimize the image acquisition experience, and ensure that users can obtain high-quality images in various environments. Through a substitution mechanism, it can prioritize photo requests, improving device response speed and user satisfaction.
[0071] For example, an ambient light sensor is a device that measures ambient light intensity in real time and is typically integrated into electronic devices such as smartphones, tablets, and cameras. It monitors changes in ambient brightness and provides the necessary lighting information to the image capture device. When a user launches an image capture application, the ambient light sensor is activated and begins monitoring ambient lighting conditions in real time. A target threshold is set based on the capture requirements and environmental conditions, typically used to determine whether the current environment is suitable for photography. For example, the target threshold can be set to 50 Lux. The processor determines whether the currently acquired brightness value is less than the target threshold. If the brightness value is less than the target threshold, the processor determines that the ambient light is insufficient, potentially affecting the image quality. After determining that the brightness value is less than the target threshold, the processor invokes the image capture device to execute the capture request. This ensures sufficient light for capturing images in low-light environments. The processor checks all unprocessed preview requests in the first cache queue that precede the capture request. If the first request is a preview request, the processor removes it from the first cache queue to ensure that the capture request is processed first. The new capture request is inserted at the front of the execution queue to ensure it is responded to as quickly as possible.
[0072] By integrating an ambient light sensor with a processor's ability to determine brightness, electronic devices can intelligently optimize the image acquisition process. In low-light conditions, they can quickly respond to user photo requests, replacing unprocessed preview requests and ensuring high-quality images. This not only improves device functionality but also enhances user satisfaction, making photo capture smoother and more intuitive.
[0073] Specifically, the processor can be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
[0074] The present application provides a computer program product storing a computer program, which implements the steps in the above method embodiments when the computer program is executed by a processor.
[0075] If the integrated module 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 invention can implement all or part of the processes in the above-mentioned embodiment method, and can also be completed by a computer program to instruct the relevant hardware. The computer program can be stored in a computer-readable storage medium, and when the computer program is executed by a processor, it can implement the steps of each of the above-mentioned method embodiments. The computer program can include computer program code, which can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium can include: any entity or device capable of carrying computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium. It should be noted that the content contained in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media does not include electric carrier signals and telecommunication signals.
[0076] Optionally, the electronic device also includes an ambient light sensor; the ambient light sensor is used to obtain a brightness value representing the capture environment corresponding to the image acquisition device; the processor is also used to determine whether the brightness value is less than the target threshold. If the brightness value is less than the target threshold, the image acquisition device is called to execute a photo request to replace the preview request generated based on the first time interval and not added to the execution queue before the photo request.
[0077] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention 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 invention, and should all be included in the scope of protection of the present invention.
Claims
1. An image capturing method, comprising: Display output preview images, each of the preview images being an image captured by the image capture device in response to preview requests sequentially arranged in the execution queue; The preview request is generated based on a first time interval; Get the photo taking action; generating a photo request based on the photo operation; wherein the photo request replaces a preview request generated before the photo request based on the first time interval and not added to the execution queue; In response to a photographing request, a photographing image is obtained, where the photographing image is an image obtained by the image acquisition device in response to the photographing request in the execution queue.
2. The image capture method according to claim 1, wherein before the photo request, the preview request generated based on the first time interval and not added to the execution queue comprises: Creating a first cache queue to sequentially cache the preview request and the photo request; If the acquisition request newly added to the first cache queue is a shooting request, the shooting request replaces the preview request at the head of the first cache queue, so that the shooting request is added to the execution queue earlier.
3. The image capture method according to claim 2, wherein replacing the preview request at the head of the cache queue with the photo request comprises: The preview request that is located before the photo-taking request in the first cache queue is deleted.
4. The image capturing method according to claim 2, further comprising: Obtaining a brightness value representing a collection environment corresponding to the image collection device through an ambient light sensor; If the brightness value is less than the target threshold, the photographing request is executed to replace the preview request generated before the photographing request based on the first time interval and not added to the execution queue. 5 . The image capturing method according to claim 1 , wherein the execution queue comprises a plurality of sequentially arranged and adjacent photographing requests.
6. An image capturing method comprising: Creating a first cache queue, wherein the first cache queue sequentially caches acquisition requests for the image acquisition device generated by an application capable of calling the image acquisition device, the acquisition requests including preview requests and photo taking requests; If the newly added acquisition request to the first cache queue is a photo request, the photo request replaces the preview request at the head of the first cache queue, so that the time when the photo request is added to the execution queue is advanced; wherein, the image acquisition device obtains a photo image in response to the photo request in the execution queue.
7. The image capture method according to claim 6, wherein replacing the preview request at the head of the first cache queue with the photo request comprises: The preview request that is located before the photo-taking request in the first cache queue is deleted.
8. An electronic device comprising: The image acquisition application layer is used to generate a preview request and a photo request, and send the preview request and the photo request to the image acquisition service layer; An image acquisition service layer, configured to create a first cache queue and an execution queue, wherein the first cache queue sequentially caches the preview request and the photo-taking request; If the newly added acquisition request to the first cache queue is a photo request, the photo request replaces the preview request at the head of the first cache queue, so that the photo request is added to the execution queue earlier; The image acquisition abstraction layer is used to obtain a photographic image in response to the photographing request sent by the execution queue.
9. An electronic device comprising: Image acquisition device, used to acquire images a processor configured to display and output preview images, each of the preview images being an image captured by the image capture device in response to preview requests sequentially arranged in an execution queue; the preview requests being generated based on a first time interval; and obtaining a photographing operation; generating a photo request based on the photo operation; wherein the photo request replaces a preview request generated before the photo request based on the first time interval and not added to the execution queue; In response to a photographing request, a photographing image is obtained, where the photographing image is an image obtained by the image acquisition device in response to the photographing request in the execution queue.
10. The electronic device of claim 9, further comprising an ambient light sensor; The ambient light sensor is used to obtain a brightness value representing the acquisition environment corresponding to the image acquisition device; The processor is further configured to determine whether the brightness value is less than a target threshold value; if the brightness value is less than the target threshold value, call the image acquisition device to execute the photo request instead of the preview request generated based on the first time interval and not added to the execution queue before the photo request.