Photographing method and electronic equipment
By acquiring the P-frame candidate image and determining the time difference, selecting the reference image closest to the moment the user wants to take, solving the problem of taking a photo delay in traditional photography solutions, and achieving the effect of what is taken is obtained.
Patent Information
- Application Number
- CN202411290402.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-25
- Publication Date
- 2025-02-25
AI Technical Summary
In traditional photography solutions, after the electronic device detects that the user presses the shutter, it needs to perform a series of configurations (such as focus, exposure, white balance, etc.), resulting in delayed shooting and the inability to achieve what is taken is what is taken.
By acquiring the P frame candidate image associated with the start time of the shooting operation, determining the P time difference, selecting the reference image closest to the time the user wants to capture, and generating the target image through image signal processing, the function of displaying the target image in the preview interface is realized.
Reduces the delay in taking photos, shortens the time from the time the user determines to the time when the photo can be viewed, and achieves the effect of what you take is what you get.
Smart Images

Figure CN119520964A_ABST
Abstract
Description
[0001] This application is a divisional application. The application number of the original application is 202311085446.4, and the original application date is August 25, 2023. The entire contents of the original application are incorporated into this application by reference. Technical Field
[0002] The present application relates to the field of image processing technology, and in particular to a photographing method and electronic equipment. Background Art
[0003] In traditional photo-taking solutions, when the user presses the shutter, electronic devices such as mobile phones need to perform a series of configurations (e.g., focus, exposure, white balance, etc.) and then encode to finally generate a photo. Since the electronic device needs to perform the above-mentioned related configurations after detecting that the user has pressed the shutter, it will inevitably cause a photo delay (shutter lag), resulting in the photo generated by the electronic device not necessarily being the image that the user wants to take when pressing the shutter. For example, when the electronic device transmits 30 frames per second (FPS) of an image, the user presses the shutter corresponding to the first frame of the image, while the photo actually generated is the eighth frame of the image. How to reduce the photo delay and achieve what you shoot is what you get (the picture displayed by the photo obtained by the user pressing the shutter is the picture the user sees at the moment the shutter is pressed) is an issue that technicians are increasingly concerned about. Summary of the invention
[0004] The embodiments of the present application provide a photographing method and an electronic device, which can reduce the delay in photographing and achieve what you shoot is what you get.
[0005] In a first aspect, an embodiment of the present application provides a photographing method, which can be executed by an electronic device, or by a device matched with the electronic device, such as a processor, a chip, or a chip system. The method may include: acquiring a P-frame candidate image associated with a first moment; determining P time differences based on the first moment and the shooting moment of the P-frame candidate image; determining a reference image from the P-frame candidate image based on the P time differences; determining a target image based on the reference image; and displaying the target image on a preview interface in response to a shooting operation; wherein the first moment is the starting moment of the shooting operation for the shooting control; the time difference between the shooting moment of the P-frame candidate image and the first moment is within a preset time range; P is an integer greater than or equal to 3; the time difference p in the P time differences is the time difference between the shooting moment of the candidate image p and the first moment, and the candidate image p is any frame candidate image in the P-frame candidate image.
[0006] It can be seen that starting to acquire candidate images at the start of the shooting operation is conducive to reducing the delay in shooting, and can shorten the time from detecting the shooting operation to displaying the target image in the preview interface; acquiring the P frame candidate image associated with the first moment can expand the frame selection range, which is conducive to determining the reference image whose shooting time is close to the first moment, thereby reducing the delay in shooting and achieving what you shoot is what you get.
[0007] In one possible implementation, a method for determining a reference image from P frame candidate images based on P time differences may include: in response to the P time differences including a time difference less than a delay threshold, determining a reference image from the P frame candidate images based on a minimum time difference among the P time differences, the reference image being the candidate image corresponding to the minimum time difference.
[0008] It can be seen that selecting the reference image corresponding to the minimum time difference is conducive to determining that the reference image is the same as the scene that the user wants to shoot, so as to achieve what you shoot is what you get.
[0009] In a possible implementation, the method further includes: determining an auxiliary image from P frame candidate images based on P time differences; the time difference corresponding to the auxiliary image is greater than the time difference corresponding to the reference image, and the time difference corresponding to the auxiliary image is less than other time differences among the P time differences except the minimum time difference; based on this, the method for determining the target image based on the reference image may include: performing fusion processing and image signal processing on the reference image and the auxiliary image to obtain the target image.
[0010] It can be seen that based on the time difference, an auxiliary image with a small time difference is selected, and multi-frame fusion can be achieved based on the reference image and the auxiliary image, which reduces the shooting delay of the target image determined based on the auxiliary image and the reference image, and is conducive to achieving what you shoot is what you get.
[0011] In one possible implementation, a method for determining a reference image from P frame candidate images based on P time differences may include: in response to the P time differences being greater than or equal to a delay threshold, determining a reference image from the P frame candidate images based on the clarity of the P frame candidate images, the reference image being the candidate image corresponding to the maximum clarity.
[0012] It can be seen that based on the clarity of the image, determining the candidate image with the highest clarity among the P frame candidate images as the reference image is conducive to improving the image quality of the target image. In addition, since the shooting time of the P frame candidate image is within the preset time range, the shooting delay of the reference image determined from the P frame candidate image is also small, which is conducive to achieving what you shoot is what you get.
[0013] In a possible implementation, the above method also includes: based on the clarity of the P frame candidate image, determining an auxiliary image from the P frame candidate image, the clarity of the auxiliary image is less than the maximum clarity, and the clarity of the auxiliary image is greater than the clarity of other candidate images in the P frame candidate image except the reference image; based on this, the above method for determining the target image based on the reference image may include: performing fusion processing and image signal processing on the reference image and the auxiliary image to obtain the target image.
[0014] It can be seen that by selecting an auxiliary image with high definition, multi-frame fusion can be achieved based on the reference image and the auxiliary image, which is beneficial to improving the image quality of the target image.
[0015] In a possible implementation, the image signal processing includes one or more of noise removal processing, black level correction processing, automatic white balance processing, color correction processing, and nonlinear gamma correction processing.
[0016] In a possible implementation, the above method may also include: in response to a click operation on a camera control, calling the camera to collect N frame cache images from a second moment to a first moment; the second moment is the moment when the click operation is detected; N is an integer greater than P; based on this, the above method of obtaining a P frame candidate image associated with the first moment may include: obtaining a P frame candidate image associated with the first moment from the N frame cache images.
[0017] It can be seen that the electronic device can call the camera to generate multi-frame cache images, which is conducive to capturing the pictures that the user wants to shoot, so that a suitable reference image can be determined from the cache images to achieve what you shoot is what you get.
[0018] In a second aspect, an embodiment of the present application provides an electronic device, comprising: one or more processors and a memory; the memory is coupled to the one or more processors, the memory is used to store computer program code, the computer program code includes computer instructions, and the one or more processors call the computer instructions to enable the electronic device to execute the method described in the first aspect or any one of the implementation methods of the first aspect.
[0019] In a third aspect, an embodiment of the present application provides a computer program product comprising instructions, which, when executed on an electronic device, enables the electronic device to execute the method described in the first aspect or any one of the implementations of the first aspect.
[0020] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, comprising instructions, which, when executed on an electronic device, causes the electronic device to execute the method described in the first aspect or any one of the implementations of the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] Figure 1 This is a schematic diagram of a photo taking interface provided in an embodiment of the present application;
[0022] Figure 2A This is a flow chart of a photographing solution provided by an embodiment of the present application;
[0023] Figure 2B is a flow chart of another photographing solution provided by an embodiment of the present application;
[0024] Figure 3 It is a flowchart of a photographing method provided in an embodiment of the present application;
[0025] Figure 4 This is a flow chart of another photographing solution provided by an embodiment of the present application;
[0026] Figure 5 This is a schematic diagram of the interaction between various modules of an electronic device provided in an embodiment of the present application;
[0027] Figure 6 It is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application;
[0028] Figure 7 It is a schematic diagram of a software framework of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0029] The embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application.
[0030] The terms "first", "second", "third" and "fourth" etc. in the specification and claims of the present application and the drawings are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but optionally includes steps or units that are not listed, or optionally includes other steps or units inherent to these processes, methods, products or devices.
[0031] It should be understood that in the present application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.
[0032] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0033] The terms "component", "module", "system", etc. used in this specification are used to represent computer-related entities, hardware, firmware, a combination of hardware and software, software, or software in execution. For example, a component can be, but is not limited to, a process running on a processor, a processor, an object, an executable file, an execution thread, a program and / or a computer. By way of illustration, both applications running on a computing device and a computing device can be components. One or more components may reside in a process and / or an execution thread, and a component may be located on a computer and / or distributed between two or more computers. In addition, these components may be executed from various computer-readable media having various data structures stored thereon. Components may, for example, communicate through local and / or remote processes according to signals having one or more data packets (e.g., data from two components interacting with another component between a local system, a distributed system and / or a network, such as the Internet interacting with other systems through signals).
[0034] First, an image processing method involved in an embodiment of the present application is introduced in combination with an application scenario.
[0035] like Figure 1As shown in Figure 1, the electronic device 100 can display a home screen interface 1110, which displays a page with application icons, including multiple application icons (e.g., a weather application icon, a video application icon, a settings application icon, and a camera application icon 1111). The camera application icon 1111 is used to represent a camera application, and the electronic device 100 can detect an operation on the camera application icon 1111. For example, the electronic device can detect an operation in which a user clicks the camera application icon 1111. In response to the operation, the electronic device 100 can display the following information: Figure 1 The shooting interface 1120 is shown in FIG.
[0036] like Figure 1 As shown in Figure B, the shooting interface 1120 can display a camera switching control 1121, a shooting control 1122, an image echo control 1123, and a scene display area 1124. The image echo control 1123 can be used to display the captured image; the shooting control 1122 is used to trigger the camera to shoot and save the image; the camera switching control 1121 can be used to switch the camera for shooting, such as switching from the rear camera to the front camera; the scene display area 1124 can display a preview image of the current scene in real time, such as Figure 1 When the electronic device 100 detects the user's operation on the shooting control 1122 (for example, a single click), the electronic device 100 can call the camera to shoot and display the following image: Figure 1 The shooting interface 1130 shown in C. Figure 1 As shown in Figure C, the image display control 1123 in the shooting interface 1130 can display a preview photo taken in response to the user's operation on the shooting control 1122. Figure 1 As shown in D, when the electronic device 100 detects an operation on the image echo control 1123, such as a single click operation, the following may be displayed: Figure 1 The photo preview interface 1140 shown in FIG. Figure 1 As shown in E, the photo preview interface 1140 displays photos generated by the camera application.
[0037] The camera application in the electronic device 100 may support multiple shooting modes, for example, high dynamic range (HDR) mode (including bright front-lit scenes and bright back-lit scenes, etc.), bokeh mode (also known as large aperture mode), portrait mode, and dark vision mode. The camera application may adaptively determine the shooting mode applicable to the current shooting scene and use the corresponding shooting mode for shooting.
[0038] Commonly used photography solutions include traditional photography solutions and zero shutter lag (ZSL) photography solutions. Traditional photography is also called ordinary photography and non-ZSL photography. For electronic devices with photography functions, such as the camera function of smartphones, camera applications (APPs) generally support both non-ZSL and ZSL photography solutions.
[0039] See also Figure 2A , is a flow chart of a photographing solution provided in an embodiment of the present application. Figure 2A As shown, the horizontal axis of the coordinate represents the shooting time of the cached image, such as t0 to t 11 When a user opens a camera application in an electronic device, the camera in the camera application can capture the current scene image, generate a cache image, and cache it in a buffer. The generated cache image is an image frame in the form of a thumbnail. The current scene can be displayed on the display screen of the electronic device, and the user can take a photo at any time. For example, the user can click a camera button or touch the screen (such as Figure 1 The photo taking icon (such as Figure 1 The camera application can send a photo request to the electronic device by means of the shooting control 1122 shown in FIG. B. Accordingly, when the electronic device receives the photo request, the camera application can take a photo. The buffer area can be a double data rate (DDR) synchronous dynamic random access memory. Figure 2A Boxes 1 to 12 in the figure may represent a multi-frame buffer image. Figure 2A (a) in the figure shows the process of the traditional photo-taking solution. Figure 2A (b) in the figure shows the process of the zero-time delay (ZSL) photography solution.
[0040] like Figure 2A As shown in (a), in a traditional photo-taking solution, the camera application in the electronic device can re-initialize the hardware of the sensor and the photo-taking pipeline (also called a process) upon receiving a photo-taking request from the user, which may include parameter configuration (such as focusing, setting exposure, setting white balance, etc.). After the configuration is completed, the latest frame of cached image generated at the current moment is taken out, and the cached image is processed, such as JPEG encoding, to generate a photo for the user to view. Exemplarily, after the hardware initialization is completed, the latest frame of cached image is cached image 12 (the image format of cached image 12 can be YUV format at this time), and after image processing of cached image 12, a photo can be obtained (the format of the photo can be JPG format). The time required from starting to output the photo is the total photo-taking time ①.
[0041] In this process, image processing and photo generation only begin after receiving a photo request from the user. It takes a certain amount of time to reconfigure the sensor and process, resulting in a certain delay between the user pressing the photo button and the photo being viewed. The photo generated is usually not the image at the moment the user presses the photo button, but the image at the moment the electronic device receives the photo request and responds. In some cases where the captured scene is changing, it is impossible for the user to get what he or she has captured. For example, Figure 2A As shown in (a) in FIG. 1 , when the user presses the camera button, the scene the user sees should be the cache image 3 , and the photo finally generated by the camera application is the image after image processing is performed on the cache image 12 .
[0042] like Figure 2A As shown in (b) in the figure, in the zero-delay photo-taking solution, when the user opens the camera application, the camera starts to capture the current scene image and generates multiple frames of cached images. Usually, the latest frames in the cached image are stored in the cache area as snapshot frames. The latest frames can be set to a few frames (for example, 5 frames or 8 frames) of cached images generated within the time range from a certain moment before the current moment to the current moment. When a photo-taking request from the user is received, a cached image frame with a generation time closest to the reception time of the photo-taking request can be obtained from the cache area, and image processing is performed to generate a photo that can be viewed by the user. In this process, the camera and the snapshot channel start working synchronously after the camera application is started. After receiving the photo-taking request, the cached image can be processed immediately without reconfiguring the sensor, that is, the photo-taking pipeline flow, which can reduce the photo-taking delay and help the user achieve what he shoots is what he gets. For example, Figure 2A As shown in (b), when the user presses the camera button, the cached image 3 is the same as the image the user wants to shoot. In the zero-delay camera solution, the electronic device can directly take out the cached image 3 (in YUV format at this time) from the cache area and perform image processing on the cached image 3 to obtain a JPG format image. The time required from starting to output the photo is the total photo shooting time ②. It can be seen that the total photo shooting time ② is significantly less than the total photo shooting time ①.
[0043] The process of the user sending a photo request to the electronic device can be realized by pressing a photo button or touching a photo icon. For example, the user can click on Figure 1The shooting control 1122 in B sends a photo request to the electronic device. This process can be divided into two steps. The first step is to press the camera button or touch the camera icon, which can be called pressing (click down); the second step is to release the camera button or stop touching the camera icon, which can be called lifting (click up). For electronic devices, the moment when the electronic device detects the click operation on the shooting control 1122 can be called the starting moment of the operation; the operation has a certain duration; when the duration is over, the electronic device can detect that the click operation on the shooting control 1122 has ended, and this moment can be called the end moment of the operation. In some cases, after the user presses the camera button, he or she may cancel the photo taking by long pressing or other operations. Therefore, in cases such as Figure 2A In the two photographing schemes shown, the moment when the electronic device receives the user's photographing request and takes the photograph is the moment when it detects that the click operation on the photographing control 1122 ends, that is, the termination moment.
[0044] In such Figure 2A In the zero-delay photography scheme shown in (b), the hardware abstract layer (HAL) in the electronic device is responsible for determining the photo from the cached image based on the termination time. Specifically, after receiving the photo request, the camera application immediately sends an indication message to the HAL, which includes the termination time information; accordingly, after receiving the indication message, the HAL can estimate the start time based on the termination time, the time taken by the camera application to transmit data to the HAL, and other factors, and determine a frame of reference image from the cache based on the estimated start time, and perform image processing on the reference image to generate a photo. Since there may be errors in the estimation process, there is a large error between the estimated start time and the actual clickdown time, so the generated photo may not be the picture the user really wants to take. For example, if the scene the user wants to take is a high-speed moving object such as a person parachuting or a moving car, the photo finally generated by the camera application may not be the scene at the same time as the scene the user wants to take.
[0045] For example, Figure 2B As shown in , the camera application detects that the user presses the camera button at time t3 (which can be represented as T1), and releases the camera button at time t5 (which can be represented as T2). After detecting T2, the camera application instructs the hardware abstract layer (HAL) in the electronic device to determine the photo from the cached image. Since there is a certain amount of time required to send data from the camera application to the HAL, the time when the HAL receives the instruction information can be between time t5 and time t6. At this time, the HAL will estimate the time corresponding to T1 based on the received time corresponding to T2. For example, the time corresponding to T1 can be estimated as follows: Figure 2B T o In this case, the HAL can select the same o The cache image closest to the time shown is processed, such as selecting cache image 4. In fact, the scene that the user wants to shoot should be the scene at the time when the user presses the camera button, such as cache image 3 generated at time t3. In this case, the image obtained is different from the scene that the user actually wants to shoot, that is, what you shoot is what you get.
[0046] In order to realize that what the user takes is what he gets when taking photos, the embodiment of the present application makes improvements based on the zero-delay photo taking solution and provides a photo taking method, which can realize the same result as much as possible and shorten the time from the user confirming to take a photo to the time when the photo can be viewed.
[0047] Next, combine Figure 3 , the specific process of the photographing method provided in the embodiment of the present application is described. Figure 3 As shown, the photographing method may include but is not limited to the following steps:
[0048] S301, displaying a main screen interface including a camera application control, in response to a click operation on the camera application control, starting the camera application, and displaying a shooting interface including a shooting control.
[0049] The click operation on the camera application control is used to indicate the start of the camera application. The camera application control is a control displayed on an electronic device and is used to represent the camera application; the camera application is an application with a camera function in an electronic device; this click operation refers to the operation of clicking the camera application control. Among them, the main screen interface can be as follows Figure 1 In the main screen interface 1110 shown in A, the camera application control may be the camera application icon 1111 in the main screen interface 1110, and the first operation for the camera application control may be clicking the camera application icon 1111; the shooting interface may be as shown in FIG. Figure 1 The shooting interface 1120 is shown in FIG.
[0050] After the camera application is started, the camera can be called to capture images in real time and generate multiple frame cache images, such as generating N frame cache images, where N is an integer greater than 0. The moment when the electronic device detects a click operation on the camera application control can be called the second moment. After startup, the camera application can maintain a certain frame rate (frames per second, FPS) to generate cache images until the camera application is closed. Assuming that the FPS of the camera application to generate cache images is 30FPS, the camera application can generate a frame cache image every 33 milliseconds (millisecond, ms), and 30 frames of cache images can be generated within one second after the camera application is started. The cached image generated by the camera application can be cached in a buffer in the electronic device.
[0051] S302, in response to a shooting operation on a shooting control, obtaining a P frame candidate image associated with a first moment, where the first moment is a start moment of the shooting operation.
[0052] The electronic device can detect the shooting operation on the shooting control in real time. The shooting operation can be a single click or touch operation on the shooting control. The shooting control can be Figure 1 The shooting control 1122 in the shooting interface 1120 shown in FIG. Figure 1 As shown in B, the shooting operation may be an operation on the shooting control 1122, such as clicking the shooting control 1122. The moment when the electronic device detects the start of the shooting operation may be recorded as the first moment; the shooting operation has a certain duration, and the moment when the electronic device detects the end of the duration of the shooting operation may be recorded as the end moment.
[0053] The P-frame candidate image is a cached image determined from the N-frame cached images generated by the camera application, where P is an integer greater than or equal to 3 and less than . Among them, the N-frame cached images can be cached images collected by the camera in the electronic device from the second moment to the first moment. The shooting time corresponding to any candidate image refers to the time information accurate to milliseconds for generating this frame of candidate image, such as 10:12:36:123 milliseconds. The shooting time corresponding to any candidate image in the P-frame candidate image is within a preset time range. Among them, the preset time range is determined based on the first moment (which can be expressed as t1) and is used to represent a time range that is very close to the first moment. Exemplarily, the preset time range can be expressed as [t1-Δt, t1], or, it can also be expressed as [t1-Δt1, t1+Δt2]. Among them, Δt, Δt1, Δt2 represent the time intervals set by the electronic device, in milliseconds. The electronic device can set different preset time ranges according to different application scenario requirements. For example, assuming that the preset time difference is 66ms, the first moment is represented as t=t1, and the preset moment can be represented as t=t1-66, then the shooting moment of any candidate image should be included in the interval [t1-66, t1]. Optionally, assuming that the shooting moment corresponding to a frame buffer image is t=t1+5, that is, the generation time of the buffer image is very close to the first moment, then this frame buffer image can also be used as a candidate image.
[0054] Normally, P can be set to 3. Selecting 3 cached images as candidate images can expand the frame selection range to a certain extent, which is conducive to determining the image that is closest to the picture the user wants to shoot. For example, assuming that the frame rate of the camera application is 30FPS, the time when the camera application is started is 10:12:36:0 milliseconds, and the first moment is 10:12:36:132 milliseconds, the electronic device can select the 3 cached images closest to 132 milliseconds as candidate images based on the first moment, and the millisecond times corresponding to the selected 3 candidate images are 66 milliseconds, 99 milliseconds and 133 milliseconds respectively.
[0055] It should be noted that when the camera application detects the start of the shooting operation, it can immediately instruct the hardware abstraction layer (HAL) to respond to the shooting operation. Since there is a certain amount of time required to transmit data from the camera application to the hardware abstraction layer, usually, the time when the hardware abstraction layer actually responds to the shooting operation will be slightly later than the first time by a few milliseconds. For example, Figure 2B As shown, there is a small delay between the T2 moment recorded by the camera application and the T2 moment in the hardware abstraction layer. Therefore, in the above example, the first moment corresponds to 132 milliseconds, and the moment when the hardware abstraction layer responds to the shooting operation may correspond to 135 milliseconds. When determining the candidate image, the cached image corresponding to 133 milliseconds can be selected as one of the candidate images.
[0056] S303: Obtain P time differences based on the first moment and the shooting moments of the P candidate frames.
[0057] The shooting time of the P-frame candidate images includes a total of P shooting time, that is, including the shooting time of each candidate image in the P-frame candidate images; the obtained P time differences include the time difference of each candidate image in the P-frame candidate images.
[0058] Specifically, the i-th time difference corresponding to the i-th candidate image in the P-frame candidate images can be determined in sequence; the i-th time difference is the time difference between the shooting moment corresponding to the i-th candidate image and the first moment. Based on the i-th time difference, P time differences corresponding to the P-frame candidate images can be obtained, where the i-th candidate image corresponds to the i-th time difference in the P time differences. Wherein, i is an integer greater than 0 and less than or equal to N. Exemplarily, assuming that the first moment is represented by t c , among the P frame candidate images, the shooting time corresponding to the i-th cache image is represented as t i , then the i-th time difference can be obtained by t c With t i The absolute value of the difference between i -t c |. The i-th time difference can be used to represent the shutter lag from the photo triggering moment to the generation of the i-th frame candidate image. The smaller the i-th time difference is, the closer the i-th candidate image is to the scene that the user actually wants to shoot.
[0059] S304, determining whether the P time differences include a time difference smaller than the delay threshold, if so, executing S305, otherwise executing S306.
[0060] Among them, the delay threshold is used to indicate the maximum shutter lag acceptable to the electronic device or user. For example, the delay threshold can be set to 15ms. In this case, if the shooting time corresponding to a frame cache image is less than the delay threshold, it can be said that the shutter lag of this frame cache image is within an acceptable range, and the image content of this frame cache image is the same or almost the same as the scene the user wants to shoot. If the shooting time corresponding to a frame cache image is greater than or equal to the delay threshold, it can be said that the image content of this frame cache image may be significantly different from the scene the user wants to shoot.
[0061] S305: Determine the candidate image corresponding to the minimum time difference among the P time differences as the reference image.
[0062] After determining the P time differences, the P time differences may be sorted in ascending order to obtain a sorting result. The minimum time difference is the time difference ranked first in the sorting result. The candidate image corresponding to the minimum time difference may be an image in the P frame candidate images that is closest to the scene that the user wants to shoot, or may be an image that is the same as the scene that the user wants to shoot.
[0063] For example, Figure 4 As shown in , the user presses the camera button at time t3 (which can be represented as T1), and releases the camera button at time t5 (which can be represented as T2). After detecting T1, the camera application sends a camera command to the HAL in the electronic device. Since the path from the camera application to the HAL is time-consuming, the time when the HAL receives the camera command may be between time t3 and time t4. At this time, a reference image can be determined from the cache area, for example, the reference image can be candidate image 3. In this case, it can help users achieve what they get when taking photos.
[0064] In a possible implementation, if the number of frames of the candidate image corresponding to the minimum time difference is greater than 1, for example, the minimum time difference corresponds to two frames of candidate images, then the frame of candidate image with the highest clarity among the two frames of candidate images can be determined as the reference image. Optionally, if the clarity of the two frames of candidate images is also the same, the electronic device can randomly select a frame of candidate image as the reference image. Among them, clarity is an important indicator for measuring the quality of an image. The higher the clarity, the better the image quality. Clarity can correspond well to people's subjective feelings. For example, if the image clarity is low, the user can intuitively feel the blurriness of the image. Exemplarily, the clarity of each frame of the candidate image can be determined by a gradient function, such as a Brenner gradient function, a Tenengrad gradient function, and the like.
[0065] S306: Determine the candidate image with the highest definition among the candidate images of the P frame as the reference image.
[0066] When the time differences corresponding to the P-frame candidate images are all greater than or equal to the delay threshold, the reference image can be determined by the clarity of the candidate images. Before executing S306, the clarity of each candidate image in the P-frame candidate images can be determined. Optionally, in the process of generating a cached image, the clarity of each cached image is determined for each cached image generated.
[0067] In a possible implementation, if the number of frames of the candidate image with the highest definition among the P-frame candidate images is greater than 1, for example, if there are two candidate images with the same definition and they are the candidate images with the highest definition among the P-frame candidate images, then the candidate image corresponding to the smallest time difference between the two candidate images can be selected as the reference image. Optionally, if the two candidate images have the same definition and the same time difference, the electronic device can randomly select one frame as the reference image.
[0068] S307, determining a target image based on the reference image.
[0069] Specifically, the electronic device can retrieve the image data of the reference image from the buffer area, and perform image processing on the reference image, such as JPEG encoding, to obtain the target image. The target image in the buffer area is an image in thumbnail form, and its image format can be YUV format; the image format of the target image can be JPG format.
[0070] Among them, when the camera application is started, the camera and snapshot channel start working synchronously. After detecting the shooting operation for the shooting control, the target image can be determined immediately, thereby improving the efficiency of determining the target image without reconfiguring the sensor, that is, the shooting pipeline flow, which can reduce the shooting delay and help users achieve what they shoot is what they get.
[0071] In a possible implementation, when an electronic device needs to perform multi-frame fusion, optionally, if the P time differences include a time difference less than a delay threshold, a candidate image can be determined from the P frame candidate images based on the P time differences, and the time difference corresponding to the candidate image is greater than the minimum time difference and less than the time difference corresponding to other candidate images in the P frame candidate images except the reference image. Optionally, if each of the P time differences is greater than or equal to the delay threshold, an auxiliary image can be determined from the P frame candidate images, and the clarity of the auxiliary image is less than the clarity of the reference image and greater than the clarity of the candidate images in the P frame candidate images except the reference image. Further, the reference image and the candidate image are fused and the image signal is processed to obtain the target image. Among them, the electronic device can adaptively select whether to perform multi-frame fusion according to the actual application scenario. For example, when the camera application's photo mode is HDR mode, the electronic device will perform multi-frame fusion.
[0072] S308, displaying the target image on the preview interface.
[0073] In response to the shooting operation, the electronic device can display the target image on a preview interface after determining the target image. The preview interface can be as follows: Figure 1 The photo preview interface 1140 shown in FIG. E. Optionally, the preview interface may also be as follows: Figure 1 The image echo control 1123 shown in C may display the target image in the photo preview interface 1140 when the electronic device detects a click operation, such as a single click, on the image echo control 1123 .
[0074] In a possible implementation, after determining the target image, the electronic device detects the first operation on the shooting control again, for example, detecting the first operation on the shooting control again. Figure 1If the single click operation of the shooting control 1122 shown in B is performed, S302 can be executed at this time. In this case, the acquired P frame candidate image is associated with the third moment. The third moment is the starting moment of the first operation.
[0075] In a possible implementation, in response to a second operation from the user, the N frames of cached images cached in the cache area may be deleted, and optionally, the determined target image may also be deleted. The second operation is used to instruct the camera application to cancel the photo shooting. Exemplarily, the second operation may be a user long pressing the Figure 1 The shooting control 1122 shown in B in the figure is slid right or left to an area that does not belong to the shooting control 1122, such as Figure 1 The blank area in B.
[0076] It can be seen that through the embodiments of the present application, the electronic device can immediately start to determine the candidate image from the cached image at the start of the shooting operation, and further determine the target image that is close to the real scene from the candidate image, so as to quickly generate photos and shorten the time from the user clicking to take a photo to the user being able to view the target image in the preview interface, thereby achieving low-latency photography and taking pictures is what you get.
[0077] Above Figure 3 The embodiment describes the process of taking photos by an electronic device. Figure 5 , for the above Figure 3 In the embodiment, the flowchart of the interaction between the modules of the electronic device is described. Figure 5 , Figure 5 This is a flowchart of the interaction between modules of an electronic device provided in an embodiment of the present application. When the electronic device is taking a photo, the interaction process of the modules in the electronic device is as follows:
[0078] S501, the camera application receives the start indication information and sends the call indication information to the camera. Correspondingly, the camera receives the call indication information.
[0079] In response to a click operation on a camera application control in the main screen interface, the electronic device may display a shooting interface including a shooting control and send a startup indication message to the camera application, the startup indication message being used to instruct the camera application to start. The call indication message is used to call the camera to shoot.
[0080] Among them, the main screen interface can be as follows Figure 1 In the main screen interface 1110 shown in A, the camera application may be the camera application displayed in the main screen interface 1110. After the camera application is started, a shooting interface may be displayed, such as Figure 1 The shooting interface 1120 shown in FIG. B includes a shooting control, which can be as follows: Figure 1 The shooting control 1122 shown in B.
[0081] The camera application is started, which can trigger the camera to start. Optionally, it can also trigger the image processing module to start. After the image processing module is started, the focus, exposure, white balance and other parameters can be set, and the reference image can be processed to generate the target image.
[0082] Specifically, the process of starting the camera application of the electronic device can refer to Figure 3 The S301 shown is not described in detail here.
[0083] S502, the camera collects images, generates N frames of cached images, and caches the N frames of cached images into a cache area.
[0084] Specifically, the camera may collect N frames of cached images starting from the moment when the camera application is started (which may be referred to as the second moment) to the first moment, and store the N frames of cached images in the cache area.
[0085] The camera can be the front camera of the electronic device or the rear camera of the electronic device. The user can also click Figure 1 The camera switching control 1121 shown in FIG. B switches between the front camera and the rear camera. The description of generating the cache image can be found in S301.
[0086] It should be noted that after the camera application is started, the camera will continuously generate cached images at a certain frame rate and store the cached images in the cache area until the camera application is closed. Since the storage space of the cache area of the electronic device is limited, when the number of cached images stored in the cache area exceeds its upper limit threshold, the electronic device will start to clear the cached images first stored in the cache area to ensure that the cache area can cache the latest cached images. Exemplarily, it is assumed that the maximum number of cached images stored in the cache area is 20 frames, and the cache area has stored the 1st frame image to the 20th frame image in sequence. If the 21st frame image is to be stored in the cache area, the cache area will delete the first stored frame image before storing the 21st frame image, and reserve storage space for the 21st frame image. After deleting the 1st frame image, the 21st frame image is cached again.
[0087] S503: The camera application receives the shooting instruction information associated with the first moment, and sends the processing instruction information to the image processing module. Accordingly, the image processing module receives the processing instruction information.
[0088] In response to a shooting operation on a shooting control, the electronic device may generate shooting instruction information at the start time of the shooting operation and send the shooting instruction information to the camera application. The start time of the shooting operation may be referred to as the first moment. After receiving the shooting instruction information, the camera application may immediately send processing instruction information to the image processing module, and the image processing instruction information may include information of the first moment, which is used to instruct the image processing module to determine the target image based on the first moment.
[0089] For example, Figure 1 As shown in FIG. 1B , the shooting operation may be an operation on the shooting control 1122 , such as single-clicking the shooting control 1122 .
[0090] Specifically, the detailed description of the first moment can be found in Figure 3 S302 shown.
[0091] S504: The image processing module obtains the P frame candidate image associated with the first moment from the buffer area.
[0092] The shooting moment corresponding to any candidate image in the P-frame candidate images is within a preset time range, and the preset time range is determined based on the first moment.
[0093] The image processing module may be a module corresponding to the camera application in the hardware abstraction layer described above. Specifically, the step of obtaining the P frame candidate image may refer to the description in S302.
[0094] S505: The image processing module determines a reference image based on the first moment and the P frame candidate image.
[0095] The image processing module may determine the time difference of each candidate image in the P candidate images to obtain P time differences. Specifically, the specific steps of determining the P time differences may refer to the description in S303.
[0096] If the P time differences include the target time difference, the candidate image corresponding to the minimum time difference among the P time differences is determined as the reference image. The target time difference refers to the time difference less than the delay threshold. The specific implementation steps of determining the reference image can be referred to in S305.
[0097] If the P time differences do not include the target time difference, the candidate image with the highest definition among the P frame candidate images is determined as the reference image. The specific implementation steps of determining the reference image can be referred to in S306.
[0098] S506: The image processing module determines a target image based on the reference image.
[0099] Specifically, the implementation process of determining the target image may refer to S307.
[0100] S507, the image processing module transmits the target image to the display screen. Accordingly, the display screen displays the target image.
[0101] Exemplarily, after determining the target image, the Figure 1 The preview image of the target image is displayed in the image echo control 1123 shown in C. When the electronic device detects a click operation on the image echo control 1123, such as a single click, a photo preview interface 1140 may be displayed, and the photo preview interface 1140 includes the target image.
[0102] See also Figure 6 , Figure 6 A schematic diagram of the hardware structure of an electronic device 100 provided in an embodiment of the present application.
[0103] See also Figure 6 , Figure 6 FIG. 1 is a schematic diagram of the structure of the electronic device 100 provided in an embodiment of the present application. It should be understood that the electronic device 100 may have Figure 6 More or fewer components may be shown, two or more components may be combined, or there may be a different configuration of components. Figure 6 The various components shown in the EMBODIMENTS 2000 may be implemented in hardware, software, or a combination of hardware and software, including one or more signal processing and / or application specific integrated circuits.
[0104] 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. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.
[0105] It is to be understood that the structure shown in the embodiment of the present application does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include Figure 6 More or fewer components may be shown, or some components may be combined or separated, or the components may be arranged differently. Figure 6 The components shown may be implemented in hardware, software or a combination of software and hardware.
[0106] The processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.
[0107] The controller may be the nerve center and command center of the electronic device 100. The controller may generate an operation control signal according to the instruction operation code and the timing signal to complete the control of fetching and executing instructions.
[0108] The processor 110 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may store instructions or data that the processor 110 has just used or cyclically used. If the processor 110 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.
[0109] In some embodiments, the processor 110 may include one or more interfaces. The interface 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, etc.
[0110] It is understandable that the interface connection relationship between the modules illustrated in the embodiment of the present application is only a schematic 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 in the above embodiments, or a combination of multiple interface connection methods.
[0111] The electronic device 100 implements the display function through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs that execute program instructions to generate or change display information.
[0112] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light emitting diode or an active-matrix organic light emitting diode (AMOLED), a flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-oLed, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the electronic device 100 may include 1 or N display screens 194, where N is a positive integer greater than 1. In the embodiment of the present application, the display screen 194 can be used to display, for example, Figure 1 The main screen interface shown in A includes a shooting interface for shooting controls and a target image.
[0113] The electronic device 100 can realize the shooting function through ISP, camera 193, video codec, GPU, display screen 194 and application processor.
[0114] The ISP is used to process data fed back by the camera 193. For example, when taking a photo, the shutter is opened, light is transmitted to the camera photosensitive element through the lens, and the light signal is converted into an electrical signal. The camera photosensitive element transmits the electrical signal to the ISP for processing and converts it into an image visible to the naked eye.
[0115] The camera 193 is used to capture static 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. In an embodiment of the present application, the camera 193 can capture static images and generate multi-frame cache images.
[0116] The digital signal processor is used to process digital signals, and can process not only digital image signals but also other digital signals. For example, when the electronic device 100 is selecting a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy.
[0117] Video codecs are used to compress or decompress digital videos. The electronic device 100 may support one or more video codecs. Thus, the electronic device 100 may play or record videos in a variety of coding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4, etc.
[0118] NPU is a neural network (NN) computing processor. By drawing on the structure of biological neural networks, such as the transmission mode between neurons in the human brain, it can quickly process input information and can also continuously self-learn. Through NPU, applications such as intelligent cognition of electronic device 100 can be realized, such as image recognition, face recognition, voice recognition, text understanding, etc.
[0119] 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 through the external memory interface 120 to implement a data storage function, such as storing compressed driver files and other files in the external memory card.
[0120] The internal memory 121 can be used to store computer executable program codes, which include instructions. The processor 110 executes various functional applications and data processing of the electronic device 100 by running the instructions stored in the internal memory 121. 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, applications required for at least one function (such as face recognition function, fingerprint recognition function, mobile payment function, etc.), etc. The data storage area may store data created during the use of the electronic device 100 (such as face information template data, fingerprint information template, 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 (universal flash storage, UFS), etc. In an embodiment of the present application, the internal memory 121 may include a buffer. The buffer area can be used to cache the cached image generated by the camera 193.
[0121] The electronic device 100 can implement audio functions such as music playing and recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the application processor.
[0122] The pressure sensor 180A is used to sense the pressure signal and can convert the pressure signal into an electrical signal. In some embodiments, the pressure sensor 180A can be disposed on the display screen 194 .
[0123] The gyro 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 gyro sensor 180B. The gyro sensor 180B can be used for anti-shake shooting. The gyro sensor 180B can also be used for navigation and somatosensory game scenes.
[0124] The distance sensor 180F is used to measure the distance. The electronic device 100 can measure the distance by infrared or laser. In some embodiments, in a shooting scene, the electronic device 100 can use the distance sensor 180F to measure the distance to achieve fast focusing.
[0125] The ambient light sensor 180L is used to sense the ambient light brightness. The electronic device 100 can adaptively adjust the brightness of the display screen 194 according to the perceived ambient light brightness. The ambient light sensor 180L can also be used to automatically adjust the white balance when taking pictures. The ambient light sensor 180L can also cooperate with the proximity light sensor 180G to detect whether the electronic device 100 is in a pocket to prevent accidental touches.
[0126] The touch sensor 180K is also called a "touch panel". The touch sensor 180K can be set on the display screen 194, and the touch sensor 180K and the display screen 194 form a touch screen, also called a "touch screen". The touch sensor 180K is used to detect touch operations acting on or near it. The touch sensor can pass the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through the display screen 194. In other embodiments, the touch sensor 180K can also be set on the surface of the electronic device 100, which is different from the position of the display screen 194. In an embodiment of the present application, the touch screen composed of the touch sensor 180K and the display screen 194 is used to detect touch operations on shooting controls, and pass the detected touch operations to the application processor in the camera application to determine that this touch operation is the starting action in the shooting operation.
[0127] The key 190 includes a power key, a volume key, etc. The key 190 may be a mechanical key or a touch key. The electronic device 100 may receive key input and generate key signal input related to user settings and function control of the electronic device 100.
[0128] In the embodiment of the present application, the software system of the electronic device 100 can adopt a layered architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture. The embodiment of the present application takes the Android system of the layered architecture as an example to illustrate the software structure of the electronic device 100.
[0129] like Figure 7 As shown, the electronic device may include: an application layer, an application framework layer, a system runtime layer, a hardware abstraction layer (HAL) and a kernel layer. Among them:
[0130] The application layer can include a series of application packages. Figure 7 As shown, the application package may include camera applications, calendars, maps, gallery applications, music applications, short messages, calls and other applications. Optionally, the application package may also include navigation, WLAN, Bluetooth, video and other applications. 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. Figure 7 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.
[0131] The window manager is used to manage window programs. The window manager can obtain the display screen size, determine whether there is a status bar, lock the screen, capture the screen, etc.
[0132] 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.
[0133] The view system includes visual controls, such as controls for displaying text, controls for displaying pictures, etc. The view system can be used to build applications. The display interface can be composed of one or more views. For example, a display interface including a text notification icon can include a view for displaying text and a view for displaying pictures. For another example, the display interface can be used to display images of a camera application located at the application layer.
[0134] The phone manager is used to provide communication functions of the electronic device 100, such as management of call status (including connecting, hanging up, etc.).
[0135] The resource manager provides various resources for applications, such as localized strings, icons, images, layout files, video files, and so on.
[0136] The notification manager enables applications to display notification information in the status bar. It can be used to convey notification-type messages and can disappear automatically after a short stay without user interaction. For example, the notification manager is used to notify download completion, message reminders, etc. The notification manager can also be a notification that appears in the system top status bar in the form of a chart or scroll bar text, such as notifications of applications running in the background, or a notification that appears on the screen in the form of a dialog window. For example, a text message is displayed in the status bar, a prompt sound is emitted, an electronic device vibrates, an indicator light flashes, etc.
[0137] The system runtime layer is divided into two parts, namely C / C++ program library and Android runtime library. C / C++ program library mainly includes browser engine (Webkit), multimedia library (media framework), embedded database (SQLite), C system function library (Libc), font engine (FreeType), etc. Android runtime library mainly includes runtime environment (Androidrontime, ART) and core libraries (core libraries).
[0138] The hardware abstraction layer is used to isolate the application framework layer from the kernel layer to prevent the Android system from being overly dependent on the kernel layer, so that the development of the application framework layer can be carried out without considering the driver. The hardware abstraction layer can include multiple functional modules. For example, the camera module (i.e., image processing module), GPS module, sensor module, etc.
[0139] In an embodiment of the present application, the image processing module can be used to determine the time difference of the cached image, determine the candidate image from multiple frames of cached images, determine the reference image from the candidate images, and perform image processing on the reference image to obtain the target image.
[0140] The kernel layer is the layer between hardware and software. The kernel layer contains at least display driver, camera driver, audio driver, sensor driver, and shared memory driver.
[0141] In the embodiment of the present application, the camera driver is used to trigger the camera to turn on when receiving a trigger command sent by a camera application at the application layer. The camera driver is also used to call the camera to shoot and generate a multi-frame buffer image.
[0142] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in this application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) mode. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid state drive solid statedisk), etc.
[0143] Those skilled in the art can understand that to implement all or part of the processes in the above-mentioned embodiments, the processes can be completed by computer programs to instruct related hardware, and the programs can be stored in computer-readable storage media. When the programs are executed, they can include the processes of the above-mentioned method embodiments. The aforementioned storage media include: ROM or random access memory RAM, magnetic disk or optical disk and other media that can store program codes.
[0144] In short, the above is only an embodiment of the technical solution of this application, and is not intended to limit the protection scope of this application. Any modification, equivalent replacement, improvement, etc. made according to the disclosure of this application shall be included in the protection scope of this application.
Claims
1. A photographing method, characterized in that: The method comprises: In response to a click operation on a camera application control, calling a camera to collect N frames of cached images from a second moment to a first moment; the first moment is a start moment of the shooting operation on the shooting control; the second moment is a moment when the click operation is detected, and N is an integer; From the N frame buffer images, a P frame candidate image associated with a first moment is obtained; the first moment is a start moment of a shooting operation for a shooting control; a time difference between a shooting moment of the P frame candidate image and the first moment is within a preset time range; P is an integer greater than or equal to 3, and P is less than N; Based on the first moment and the shooting moment of the P frame candidate images, P time differences are determined; the time difference p among the P time differences is the time difference between the shooting moment of the candidate image p and the first moment, and the candidate image p is any frame candidate image among the P frame candidate images; Based on the P time differences, determining a reference image from the P frame candidate images, including: when the P time differences include a time difference less than a delay threshold, based on the minimum time difference among the P time differences, determining a reference image from the P frame candidate images, the reference image being the candidate image corresponding to the minimum time difference; and determining a target image based on the reference image.
2. The method according to claim 1, characterized in that When the P time differences include a time difference less than the delay threshold, determining a reference image from the P frame candidate images based on a minimum time difference among the P time differences, the reference image being a candidate image corresponding to the minimum time difference, including: When the number of frames of the candidate image corresponding to the minimum time difference among the P time differences is equal to 1, based on the minimum time difference among the P time differences, determining a reference image from the P frame candidate images, the reference image being the candidate image corresponding to the minimum time difference; When the number of frames of the candidate image corresponding to the minimum time difference among the P time differences is greater than 1, a reference image is determined from the candidate images corresponding to the minimum time difference, and the reference image is the candidate image with the highest clarity among the candidate images corresponding to the minimum time difference.
3. The method according to claim 1 or 2, characterized in that: The method further comprises: Based on the P time differences, determining an auxiliary image from the P frame candidate images; the time difference corresponding to the auxiliary image is greater than the time difference corresponding to the reference image, and the time difference corresponding to the auxiliary image is less than other time differences among the P time differences except the minimum time difference; The step of determining a target image based on the reference image comprises: The reference image and the auxiliary image are subjected to fusion processing and image signal processing to obtain a target image.
4. The method according to any one of claims 1 to 3, characterized in that Determining a reference image from the P frame candidate images based on the P time differences, further comprising: When the P time differences are all greater than or equal to the delay threshold, a reference image is determined from the P frame candidate images based on the clarity of the P frame candidate images, and the reference image is a candidate image corresponding to the maximum clarity.
5. The method according to claim 4, characterized in that The method further comprises: Based on the definition of the P frame candidate image, determine an auxiliary image from the P frame candidate image, wherein the definition of the auxiliary image is less than the maximum definition, and the definition of the auxiliary image is greater than the definition of other candidate images among the P frame candidate images except the reference image; The step of determining a target image based on the reference image comprises: The reference image and the auxiliary image are subjected to fusion processing and image signal processing to obtain a target image.
6. The method according to any one of claims 1 to 5, characterized in that In response to the shooting operation, the target image is displayed on a preview interface.
7. The method according to claim 3 or 5, characterized in that: The image signal processing includes one or more of noise removal processing, black level correction processing, automatic white balance processing, color correction processing, and non-linear gamma correction processing.
8. An electronic device, characterized in that: include: Memory, processor; wherein: The memory is used to store a computer program, wherein the computer program includes program instructions; The processor is used to call the program instructions so that the electronic device executes the method according to any one of claims 1 to 7.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.
10. A computer program product comprising instructions, characterized in that When the computer program product runs on an electronic device, the electronic device is enabled to execute the method according to any one of claims 1 to 7.