Photographing method and device and storage medium
By selecting the target cache frame based on the zoom magnification in the smart terminal camera and using dynamic frame acquisition logic, the problem of inconsistent preview images and films when shooting at the smart terminal camera is solved, improving user experience and resolution.
Patent Information
- Application Number
- CN202310713172.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-15
- Publication Date
- 2024-12-17
AI Technical Summary
When the existing smart terminal cameras take images, the frame fetching operation is completed at one time, resulting in a degradation of user experience, and inconsistent field angles in ultra-high resolution scenes, leading to inconsistent preview images with films.
By selecting the target cache frame based on the zoom magnification in the cache area, the dynamic frame acquisition logic of the front frame and the rear frame acquisition is adopted, and the frame number continuity and sensitivity are combined to generate photo pictures to ensure the consistency of the preview image and the film.
It improves the user experience, avoids the problem of inconsistency between preview images and films, and improves the synthetic resolution in ultra-high resolution scenarios.
Smart Images

Figure CN119155542A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of image processing technology, and in particular to a photographing method, device and storage medium. Background Art
[0002] With the continuous development of smart terminals, users have increasingly higher requirements for the image capturing capabilities of mobile terminal camera applications.
[0003] In the related art, when taking images through smart terminals, most of them tend to complete the frame-taking operation at one time, which greatly reduces the user experience. Summary of the invention
[0004] In order to overcome the problems existing in the related art, the present disclosure provides a photographing method, device and storage medium.
[0005] According to a first aspect of an embodiment of the present disclosure, a photographing method is provided, the method comprising: in response to receiving a photographing instruction during a process in which a camera application of a terminal provides a preview screen, determining a cache frame, the cache frame being a preview image frame output and stored in a cache area when the camera application of the terminal provides a preview screen; based on a zoom ratio of the cache frame, selecting a target cache frame, the target cache frame being a preview image frame for generating a photographed picture; and generating a photographed picture based on the target cache frame.
[0006] In one embodiment, selecting a target cache frame based on the zoom ratio of the cache frame includes: determining the i-th cache frame currently locked and selected in the cache area, where i is a positive integer greater than or equal to 1; selecting the target cache frame based on the locked frame number and the zoom ratio of the i-th cache frame; the locked frame number is the number of target cache frames that need to be selected.
[0007] In one embodiment, the selecting the target cache frame based on the locked frame number and the zoom ratio of the i-th cache frame includes: in response to determining that a first condition is satisfied based on the locked frame number and the zoom ratio of the i-th cache frame, selecting the target cache frame from the cache frames cached before receiving the photo-taking instruction; the first condition is used to trigger the selection of the target cache frame from the cache frames cached before receiving the photo-taking instruction.
[0008] In one embodiment, determining that the first condition is satisfied based on the locked frame number and the zoom ratio of the i-th cache frame includes: determining a standard frame in the cache frames corresponding to the locked frame number based on the locked frame number and the zoom ratio of the i-th cache frame, the standard frame being a cache frame whose zoom ratio difference with the previous adjacent cache frame is less than a difference threshold; if the frame number of the determined standard frame exceeds the frame number threshold, determining that the first condition is satisfied.
[0009] In one embodiment, the selecting the target cache frame based on the locked frame number and the zoom ratio of the i-th cache frame includes: in response to determining that a first condition is not satisfied based on the locked frame number and the zoom ratio of the i-th cache frame, selecting the target cache frame from the cache frames cached after receiving the photo-taking instruction; the first condition is used to trigger the selection of the target cache frame from the cache frames cached before receiving the photo-taking instruction.
[0010] In one embodiment, determining that the first condition is not met based on the locked frame number and the zoom ratio of the i-th cache frame includes: determining a standard frame in the cache frames corresponding to the locked frame number based on the locked frame number and the zoom ratio of the i-th cache frame, the standard frame being a cache frame whose zoom ratio difference with the previous adjacent cache frame is less than a difference threshold; if the frame number of the determined standard frame does not exceed the frame number threshold, determining that the first condition is not met.
[0011] In one embodiment, the method of determining a standard frame in the cache frames corresponding to the locked frame number based on the locked frame number and the zoom magnification of the i-th frame cache frame includes: performing a difference comparison between the zoom magnification of the i-th frame cache frame and the zoom magnification of the i-1-th frame cache frame to obtain a j-th zoom magnification difference, wherein j is a positive integer greater than or equal to 1; if the j-th zoom magnification difference is less than a difference threshold, taking the i-th frame cache frame as the standard frame.
[0012] In one embodiment, the method further includes: if the j-th zoom ratio difference is greater than or equal to the difference threshold, setting the number of standard frames accumulated before the i-th frame cache frame to 1, re-accumulating the number of standard frames that satisfy the zoom ratio difference less than the difference threshold, and updating the j-th zoom ratio difference to the difference threshold; obtaining the j+1-th zoom ratio difference between the zoom ratio of the i+1-th frame cache frame and the zoom ratio of the i-th frame cache frame, and performing a difference comparison between the j+1-th zoom ratio difference and the j-th zoom ratio difference; if the j+1-th zoom ratio difference is less than the difference threshold, taking the i+1-th frame cache frame as the standard frame and accumulating the number of standard frames; not meeting the first condition includes: the number of frames of the determined standard frame does not exceed the frame number threshold.
[0013] In one embodiment, before selecting the target cache frame based on the zoom ratio of the cache frame, the method further includes: determining that a second condition is satisfied based on the frame number continuity and sensitivity of the cache frame; satisfying the second condition includes: the frame numbers of the cache frames are continuous, and the frame-by-frame sensitivity difference ratio is less than a threshold.
[0014] In one embodiment, the response to receiving a photo-taking instruction during the process of providing a preview image by the camera application of the terminal includes: in response to the process of providing a preview image by the camera application of the terminal in an ultra-high resolution scenario, being triggered to switch the zoom ratio within less than a first time threshold, and receiving a photo-taking instruction within less than a second time threshold.
[0015] According to a second aspect of an embodiment of the present disclosure, a photographing device is provided, the device comprising: a determination unit, for determining a cache frame in response to receiving a photographing instruction during a process in which a camera application of a terminal provides a preview screen, the cache frame being a preview image frame outputted and stored in a cache area when the camera application of the terminal provides a preview screen; a selection unit, for selecting a target cache frame based on a zoom ratio of the cache frame, the target cache frame being a preview image frame for generating a photographed picture; and a generation unit, for generating a photographed picture based on the target cache frame.
[0016] In one embodiment, the selection unit selects the target cache frame based on the zoom ratio of the cache frame in the following manner: determine the i-th cache frame currently locked and selected in the cache area, where i is a positive integer greater than or equal to 1; select the target cache frame based on the locked frame number and the zoom ratio of the i-th cache frame; the locked frame number is the number of target cache frames that need to be selected.
[0017] In one embodiment, the selection unit selects the target cache frame based on the locked frame number and the zoom ratio of the i-th cache frame in the following manner: in response to determining that a first condition is satisfied based on the locked frame number and the zoom ratio of the i-th cache frame, the target cache frame is selected from the cache frames cached before receiving the photo-taking instruction; the first condition is used to trigger the selection of the target cache frame from the cache frames cached before receiving the photo-taking instruction.
[0018] In one embodiment, the determination unit determines whether the first condition is satisfied based on the locked frame number and the zoom ratio of the i-th cache frame in the following manner: based on the locked frame number and the zoom ratio of the i-th cache frame, a standard frame is determined in the cache frames corresponding to the locked frame number, and the standard frame is a cache frame whose zoom ratio difference with the previous adjacent cache frame is less than a difference threshold; if the frame number of the determined standard frame exceeds the frame number threshold, it is determined that the first condition is satisfied.
[0019] In one embodiment, the selection unit selects the target cache frame based on the locked frame number and the zoom ratio of the i-th cache frame in the following manner: in response to determining that the first condition is not met based on the locked frame number and the zoom ratio of the i-th cache frame, the target cache frame is selected from the cache frames cached after receiving the photo-taking instruction; the first condition is used to trigger the selection of the target cache frame from the cache frames cached before receiving the photo-taking instruction.
[0020] In one embodiment, the determination unit determines that the first condition is not met based on the locked frame number and the zoom ratio of the i-th cache frame in the following manner: based on the locked frame number and the zoom ratio of the i-th cache frame, a standard frame is determined in the cache frames corresponding to the locked frame number, and the standard frame is a cache frame whose zoom ratio difference with the previous adjacent cache frame is less than a difference threshold; if the frame number of the determined standard frame does not exceed the frame number threshold, it is determined that the first condition is not met.
[0021] In one embodiment, the determination unit determines the standard frame in the cache frames corresponding to the locked frame number based on the locked frame number and the zoom ratio of the i-th frame cache frame in the following manner: performing a difference comparison between the zoom ratio of the i-th frame cache frame and the zoom ratio of the i-1-th frame cache frame to obtain the j-th zoom ratio difference, where j is a positive integer greater than or equal to 1; if the j-th zoom ratio difference is less than a difference threshold, the i-th frame cache frame is used as the standard frame.
[0022] In one embodiment, the determination unit is also used for: if the j-th zoom ratio difference is greater than or equal to the difference threshold, setting the number of standard frames accumulated before the i-th frame cache frame to 1, re-accumulating the number of standard frames that satisfy the zoom ratio difference less than the difference threshold, and updating the j-th zoom ratio difference to the difference threshold; obtaining the j+1-th zoom ratio difference between the zoom ratio of the i+1-th frame cache frame and the zoom ratio of the i-th frame cache frame, and performing a difference comparison between the j+1-th zoom ratio difference and the j-th zoom ratio difference; if the j+1-th zoom ratio difference is less than the difference threshold, using the i+1-th frame cache frame as the standard frame and accumulating the number of standard frames; not satisfying the first condition, including: the number of frames of the determined standard frame does not exceed the frame number threshold.
[0023] In one embodiment, the determination unit is also used to: before the selection unit selects the target cache frame based on the zoom ratio of the cache frame, determine that a second condition is satisfied based on the frame number continuity and sensitivity of the cache frame; satisfying the second condition includes: the frame numbers of the cache frames are continuous and the frame-to-frame sensitivity difference ratio is less than a threshold.
[0024] In one embodiment, the determination unit responds to receiving a photo-taking instruction during the process of the camera application of the terminal providing a preview image in the following manner: in response to the camera application of the terminal providing a preview image in an ultra-high resolution scenario, it is triggered to switch the zoom ratio within a first time threshold, and receives a photo-taking instruction within a second time threshold.
[0025] According to a third aspect of an embodiment of the present disclosure, a photographing device is provided, comprising: a processor; and a memory for storing instructions executable by the processor; wherein the processor is configured to: execute the photographing method described in the first aspect or any one of the embodiments of the first aspect.
[0026] According to a fourth aspect of an embodiment of the present disclosure, a storage medium is provided, in which instructions are stored. When the instructions in the storage medium are executed by a processor of a terminal, the terminal is enabled to execute the photographing method described in the first aspect or any one of the embodiments of the first aspect.
[0027] The technical solution provided by the embodiments of the present disclosure may include the following beneficial effects: when receiving a photo command during the preview screen provided by the camera application of the terminal, a preview image frame is output and stored in a cache area, the cache frame is determined, and based on the zoom ratio of the cache frame, a preview image frame for generating a photo is selected. By taking into account the zoom ratio of the frame, the problem of inconsistency between the preview image and the finished image due to the inconsistent field of view of the camera application during the preview image screen is effectively avoided, and the user experience is efficiently improved.
[0028] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.
[0030] Figure 1 The figure is a comparison diagram of the effects of using two judgment indicators, namely, the number of frames and sensitivity, to adapt dynamic framing according to an exemplary embodiment.
[0031] Figure 2 The figure is a flow chart of a photographing method according to an exemplary embodiment.
[0032] Figure 3 The present invention is a camera interface diagram showing a preview screen process of a camera application of a terminal according to an exemplary embodiment.
[0033] Figure 4 The present invention is a flowchart of selecting a target cache frame based on a zoom ratio of the cache frame according to an exemplary embodiment.
[0034] Figure 5 The present invention is a flowchart of selecting a target cache frame based on a zoom ratio of the cache frame according to an exemplary embodiment.
[0035] Figure 6 The flowchart is a flowchart showing a method of determining whether a first condition is satisfied based on a locked frame number and a zoom ratio of an i-th frame buffer according to another exemplary embodiment of the present disclosure.
[0036] Figure 7 The flowchart of selecting a target cache frame based on a locked frame number and a zoom ratio of an i-th cache frame according to another exemplary embodiment of the present disclosure is shown.
[0037] Figure 8 The flowchart is a flowchart showing a method of determining whether a first condition is satisfied based on a locked frame number and a zoom ratio of an i-th frame buffer according to another exemplary embodiment of the present disclosure.
[0038] Fig. 9 The present invention is a flowchart showing a method of determining a standard frame in a cache frame corresponding to a locked frame number based on a locked frame number and a zoom ratio of an i-th cache frame according to another exemplary embodiment of the present disclosure.
[0039] Fig.10 is a flowchart of a photographing method according to another exemplary embodiment of the present disclosure.
[0040] Fig.11is a flowchart of a photographing method according to another exemplary embodiment of the present disclosure.
[0041] Fig.12 is a flowchart of a photographing method according to another exemplary embodiment of the present disclosure.
[0042] Fig.13 It is a comparison diagram of the effect of increasing the zoom ratio judgment index of multiple frame cache frames to adapt to dynamic frame acquisition according to another exemplary embodiment of the present disclosure.
[0043] Fig.14 The figure is a block diagram of a photographing device according to an exemplary embodiment.
[0044] Fig.15 It is a block diagram of a device for taking photos according to an exemplary embodiment. DETAILED DESCRIPTION
[0045] Here, exemplary embodiments will be described in detail, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present disclosure.
[0046] The present disclosure relates to the technical field of image processing, and is applied to the scene of taking pictures with a camera.
[0047] Currently, when cameras are used in super-resolution (SR) scenarios, when users quickly switch zoom and instantly complete the photo-taking action, the logic of dynamic frame acquisition is crucial.
[0048] Figure 1 FIG. 1 is a comparison diagram showing the effect of using two judgment indicators, frame number and sensitivity, to adapt dynamic frame acquisition according to an exemplary embodiment. Figure 1 As shown in the figure, the FOV of the 10X preview image is smaller than that of the 2X preview image. In the 10X preview image, only a clock and a small part of the wall painting can be seen. If the user quickly switches from the current 10X preview image to the 2X preview image and instantly clicks the shutter, the resulting image should be closer to the 2X preview image, but in fact the photo generated in the album is closer to the 10X preview image.
[0049] In current related technologies, most scenarios that support dynamic frame acquisition tend to complete the frame acquisition operation at one time without limiting the selected frame. However, in SR scenarios, specific synthesis standards must be followed, which require that the resolution and sensitivity between frames should meet the standards. Therefore, related technologies use two judgment indicators, frame number and sensitivity, to adapt to dynamic frame acquisition logic.
[0050] Therefore, the dynamic frame-taking logic in the related art, under extreme conditions of fast zoom switching, does not consider the problem of inconsistent field of view (FOV) of the image, which will lead to a deviation between the cache frame selected by the pre-frame action of dynamic photography and the preview image. The inconsistency is visible to the user, and a visual jump will occur when opening the album, such as Figure 1 In the related art, the dynamic frame-taking behavior of the terminal camera is divided into two modes: front-end taking and rear-end taking, which are independent of each other and cannot coexist.
[0051] In view of this, an embodiment of the present disclosure provides a photographing method, in which, based on an instantaneous photographing method in an SR scenario, a multi-frame zoom ratio (zoomratio) standard is added, and a zoomratio data relationship of the selected frames in the cache queue is calculated in a camera application, thereby effectively avoiding the problem of inconsistency between the preview image and the formed film in the album, and improving the synthesis resolution in the SR scenario.
[0052] Figure 2 is a flow chart of a photographing method according to an exemplary embodiment. Figure 2 As shown, the method includes the following steps.
[0053] In step S101, in response to receiving a photo taking instruction during a preview screen provided by a camera application of a terminal, a cache frame is determined.
[0054] In the embodiment of the present disclosure, the cache frame is a preview image frame output and stored in the cache area when the camera application of the terminal provides a preview picture.
[0055] In step S102, a target cache frame is selected based on the zoom ratio of the cache frame.
[0056] In the embodiment of the present disclosure, the target cache frame is a preview image frame used to generate a photographed picture.
[0057] In step S103, a photographed picture is generated based on the target cache frame.
[0058] In one embodiment, when the camera application of the terminal is opened, the preview image page is entered and the switching of the zoom ratio is triggered. During this process, the shutter of the camera application is clicked to trigger a photo command. When the camera receives the photo command, the camera application will output the preview image data to the cache area and save it according to the preview request for generating a photo. Figure 3 is a camera interface diagram of a camera application preview screen process of a terminal according to an exemplary embodiment. Figure 3 As shown, this terminal can zoom in up to 70 times, and in photo mode, the zoom ratio is 0.6 to 70 times.
[0059] When the user opens the camera application in the terminal and enters the SuperResolution (SR) scene, the user can use the terminal camera to take a photo of a scene, and can also switch the camera's zoom ratio to make the preview image displayed on the camera interface meet the user's needs, and can also use the shutter button in the camera interface to complete the photo action. Figure 1 As shown, the camera's zoom ratio is 2 times at this moment, and the preview image displayed on the camera interface is an office scene, with an alarm clock and a mural hanging on the wall. If this preview image meets the user's needs, the shutter button can be clicked to complete the photo-taking action.
[0060] During the photo shooting process, if the current zoom ratio is 10x, but the user wants to take a photo of the scene at 2x, the zoom ratio of 10x needs to be switched to 2x. If the user quickly switches from 10x to 2x during the zoom ratio switching process and instantly completes the photo shooting action, it is necessary to ensure that the image quickly switched to 2x previewed by the user in the camera interface and the final photo generated in the camera album based on the dynamic frame logic should have the same FOV perspective without deviation.
[0061] In one embodiment of the present disclosure, by adding zoom ratio standards of multiple frames, the zoom ratio numerical relationship of the selected frames in the buffer area is calculated in the camera application.
[0062] In another embodiment of the present disclosure, when the camera application of the terminal provides a preview screen, the preview image frames output and stored in the buffer area are cached in the consumer and producer queues in a manner of 9+5, totaling 14 frames.
[0063] By adding multiple-frame zoom ratio standards, the problem of inconsistency between the preview image and the finished image due to inconsistent field of view of the camera application during the preview image process can be effectively avoided, thereby effectively improving the user experience.
[0064] The following embodiments will describe in detail how to select a target cache frame.
[0065] Figure 4 FIG. 1 is a flowchart of selecting a target cache frame based on a zoom ratio of a cache frame according to an exemplary embodiment. Figure 4 As shown, the method includes the following steps.
[0066] In step S201, the i-th cache frame currently locked and selected in the cache area is determined.
[0067] In the embodiment of the present disclosure, i is a positive integer greater than or equal to 1.
[0068] In step S202 , a target cache frame is selected based on the locked frame number and the zoom factor of the i-th cache frame.
[0069] In the disclosed embodiment, the locked frame number is the number of target cache frames that need to be selected.
[0070] In one embodiment, 8 frames are selected in the buffer area, and the sampling rate is increased by calculating a slight offset between the 8 frames of data, and the resolution is improved by fusing multiple frames of low-resolution images, and finally a high-resolution image is output for user use.
[0071] To further explain, the frame downloading action is completed by packaging 8 frame requests in the form of a group and sending them to the bottom layer. When the first frame request among the 8 frames reaches the bottom layer, the dynamic frame fetching work begins.
[0072] In the photographing method provided by the present invention, there are two ways to select the desired target cache frame from the preview image frame in the cache area, that is, the dynamic frame acquisition method includes: selecting the cache frame cached before receiving the photographing instruction or selecting the cache frame cached after receiving the photographing instruction.
[0073] Among them, in the context of the present disclosure, the behavior of selecting the cached frame cached before receiving the photo-taking instruction can be called the front-end frame-taking behavior, and the behavior of selecting the cached frame cached after receiving the photo-taking instruction can be called the back-end frame-taking behavior.
[0074] In an embodiment of the present disclosure, during the process of taking photos with a camera, the dynamic frame-taking behavior is the process of selecting continuous frames. The front frame-taking and the back frame-taking respectively describe the frame selection methods at different stages of the shooting process.
[0075] In one embodiment, at the moment of taking a photo, the camera application selects the frame within a short time before the shutter is pressed from the continuous frames captured by the camera, i.e., the front-fetched frame. The front-fetched frame helps the user capture the desired shot moment, even if the user has a slight delay in shutter reaction. Among them, the front-fetched frame is very helpful for real-time capture of dynamic scenes and ensuring the clarity of photos.
[0076] In one embodiment, the camera application captures continuous frames within a short period of time after the shutter button is pressed, i.e., post-frames. During the camera application shooting process, post-frames may provide better image quality and performance for those moments that occur later, wherein post-frames are suitable for scenes that need to capture continuous actions, such as sports games and animal behaviors.
[0077] In the embodiments of the present disclosure, the front frame and the back frame can be understood as the behavior of dynamically taking frames of the image frames collected by the camera during the process of taking pictures by the camera application. They can help users capture ideal photo effects in different situations. On this basis, the selection of appropriate frame-taking behavior depends on the needs of the actual shooting scene and the user's sensitivity to the capture time point. In the present disclosure, the target cache frame is selected to give priority to the cache frame cached before receiving the photo command, so as to complete the selection and locking of the required number of frames.
[0078] Furthermore, the behavior determination of the previous frame is prioritized, and by adding the zoom magnification standard of the target cache frame, it is determined whether the target cache frame selected by the previous frame meets the behavior requirements of the previous frame. If the behavior determination of the previous frame is not satisfied, the cache frame cached after receiving the photo command is selected to synthesize the photo picture.
[0079] Through the above embodiments, in the extreme case of rapid switching of zoom ratios, the dynamic frame judgment standard can be effectively enhanced, making the dynamic frame logic more rigorous, and accurately performing dynamic post-frame capture when the zoom changes too quickly to satisfy the pre-frame capture. This effectively avoids the problem of inconsistency between the preview image and the finished film due to inconsistent field of view of the camera application during the preview image process, thereby efficiently improving the user experience.
[0080] The following embodiments will describe in detail how to select a target cache frame.
[0081] Figure 5 FIG. 1 is a flowchart of selecting a target cache frame based on a zoom ratio of a cache frame according to an exemplary embodiment. Figure 5 As shown, the method includes the following steps.
[0082] In step S301 , in response to a zoom factor based on a locked frame number and an i-th frame buffer frame, it is determined that a first condition is satisfied.
[0083] In step S302, a target cache frame is selected from the cache frames cached before receiving the photo taking instruction.
[0084] The first condition is used to trigger the selection of a target cache frame from the cache frames cached before receiving the photo taking instruction.
[0085] In the disclosed embodiment, the behavior of the front-fetching frame is determined by outputting and storing the preview image frame in the cache area according to the preview screen provided by the camera application of the terminal, and the first condition is determined by locking the frame number and the zoom ratio of the i-th cache frame. If the first condition is met, the target cache frame is selected from the cache frames cached before the photo instruction to generate the photo picture; if the front-fetching frame condition is not met, the photo picture is generated according to the preview image frame obtained by the back-fetching frame.
[0086] When the user opens the terminal's camera application and enters the ultra-high resolution scene, if the user switches the camera zoom, such as switching from 12X to 2X, the terminal's camera application will output the preview image data in the process according to the preview request and save it to the cache area. It can be understood that if the zoom magnification of the current preview image is 12X, and the zoom magnification is quickly switched to 2X, a photo request is issued. At this time, the terminal's camera application will output and save the image data previewed within 12X~2X to the cache area. Based on the cached frames after the preview request and before the photo request is issued, that is, multiple cached frames are selected from 12X~2X for the behavior determination of the front-fetching frame. If the selected multiple cached frames meet the conditions for the front-fetching frame, the multiple low-resolution cached frames are synthesized into a high-resolution picture, that is, the behavior of the front-fetching frame is a synthetic frame behavior. If the selected multiple cached frames do not meet the conditions for the front-fetching frame, the preview image frame obtained by the back-fetching method is used to generate the photo picture.
[0087] Among them, after the camera sends a photo request, the generated preview image can be output to the consumer queue. The preview image can be cached in the consumer queue in the form of 9+5, a total of 14 frames, for use in the behavior judgment of the previous frame.
[0088] Furthermore, the zoom ratio switching is a gradual process rather than an instantaneous process, and multiple zoom ratio processes are required to reach 2X from 12X. During the period when the zoom ratio decreases sharply, the sensor outputs the corresponding zoom ratio preview image to the cache area according to multiple different zoom ratio preview requests during the zoom sliding process.
[0089] Furthermore, a part of the cached frames are selected from the cache area for the behavior determination of the pre-fetch frame. The locked frame number of the cached frames required for pre-fetching is obtained. If the locked cached frame number is 8 frames, 8 frames with consecutive frame numbers need to be selected from the cache area. Among them, the locked frame number of the cached frames required for pre-fetching can be obtained from the 14 frames in the consumer queue of the cache area. When the obtained cached frame number is 8 frames, the 8 cached frames can be output to the producer queue of the cache area in the form of a group.
[0090] The i-th frame cached frame currently locked and selected in the cache area is obtained, that is, the i-th cached frame in the cache area is determined as the first frame of the cached frames required for executing the front frame fetching. The first frame of the cached frame required for executing the front frame fetching can be the first cached frame or the i-th cached frame in the cache area, i is a positive integer greater than 1, if the locked first frame is the i-th cached frame of the cached frame, the number of frames required for locking is 8 frames, and it can be determined that the cached frames specifically required for executing the front frame fetching include the i-th cached frame and the 7 cached frames with consecutive frame numbers after the i-th cached frame.
[0091] After determining that the cached frame required to be selected for executing the forward frame fetching satisfies the first condition, the forward frame fetching method is executed to merge the cached frame obtained by the forward frame fetching into a photographed image.
[0092] In the scenario of fast switching zoom, in the related art, due to the single consideration of whether the cached frames are continuous and whether the sensitivity meets the preset ratio of dynamic frame taking behavior, the FOV jump is not taken into account, resulting in a serious deviation between the generated photo and the preview image, such as Figure 1 The present disclosure selects the target cache frame whose frame number continuity and sensitivity meet the second condition, and then determines whether the cache frame selected in the current photographing process meets the behavior of the previous frame by increasing the zoom ratio standard of the selected cache frame.
[0093] Through the embodiments of the present disclosure, based on the continuity of the cached frame numbers and the difference in sensitivity, taking into account that the inconsistent zoom ratios of the cached frames will lead to great differences in FOV viewing angles between frames, a fast difference comparison algorithm of multi-frame zoomratio values is added to judge the previous frame-taking behavior, which can more accurately judge the current dynamic frame-taking behavior, improve the synthetic resolution from the perspective of continuity and image similarity, and effectively avoid the situation where the generated photo image has deviations and inconsistencies with the preview image, which in turn leads to poor user experience.
[0094] The following embodiments of the present disclosure will describe in detail how to determine whether the first condition for executing the pre-frame fetch is satisfied based on the locked frame number and the zoom ratio of the i-th frame buffer.
[0095] Figure 6 is a flowchart showing a method of determining a frame that satisfies a first condition based on a locked frame number and a zoom ratio of an i-th frame buffer according to another exemplary embodiment of the present disclosure, such as Figure 6 As shown, the method includes the following steps.
[0096] In step S401, based on the locked frame number and the zoom factor of the i-th buffered frame, a standard frame is determined in the buffered frames corresponding to the locked frame number.
[0097] The standard frame is a cached frame whose zoom magnification difference with the last adjacent cached frame is less than the difference threshold.
[0098] The process of comparing the difference between the zoom magnification of the current cache frame and the zoom magnification of the previous adjacent cache frame with the difference threshold is a difference comparison process, which can also be understood as a difference comparison algorithm. The result of comparing the difference with the difference threshold is a difference comparison result.
[0099] If the difference between the zoom magnification of the current cached frame and the zoom magnification of the previous adjacent cached frame is smaller than the difference threshold, the current cached frame is determined to be a standard frame.
[0100] In step S402, if the number of standard frames determined for the preceding frames exceeds the frame number threshold, it is determined that the first condition is satisfied.
[0101] In the embodiment of the present disclosure, by determining the number of cache frames required to select the previous frame and the zoom ratio of the i-th cache frame, a fast difference comparison algorithm of the zoom ratios of multiple cache frames is performed, and the cache frame that meets the difference comparison result is determined to be the standard frame.
[0102] Furthermore, the last cached frame of the cached frame required for the current frame acquisition also completes the zoom ratio difference comparison algorithm, accumulates the number of standard frames, and determines that the number of standard frames used for the pre-frame acquisition exceeds the frame number threshold. It can be understood that in the ultra-high resolution scenario, the accumulated multiple low-resolution standard frames have reached the number of frames that can synthesize an ultra-high resolution image, and it can be determined that the first condition for executing the pre-frame acquisition is met. The frame number threshold is the number of frames that meet the synthetic resolution of the dynamic pre-frame behavior.
[0103] In the embodiment of the present disclosure, in terms of the ultra-high resolution algorithm, the sampling rate is increased by calculating a slight offset between cached frame data of a locked frame number, and the resolution is increased by synthesizing multiple low-resolution frames, and finally a high-resolution image is output for user use.
[0104] In addition, in ultra-high-resolution scenarios, in order to improve the shooting speed and synthesis resolution, the instantaneous frame download method is adopted. A group of cached frames are sent to the bottom layer for each photo. This group of cached frames is completely continuous and is only sent once. Therefore, the behavior judgment of the previous frame is given priority.
[0105] In the disclosed embodiment, by locking the frame number and the zoom ratio of the i-th cache frame, a standard frame that meets the difference comparison condition in multiple cache frames is determined, the number of standard frames is accumulated, and it is determined whether the dynamic frame-taking behavior of the photo can meet the front frame-taking. Generating a photo picture by front frame-taking helps users capture the desired lens moment, facilitates real-time capture of dynamic scenes and ensures the clarity of photos.
[0106] Figure 7 FIG. 1 is a flowchart showing a method of selecting a target cache frame based on a locked frame number and a zoom ratio of an i-th cache frame according to another exemplary embodiment of the present disclosure. Figure 7 As shown, the method includes the following steps.
[0107] In step S501 , in response to a zoom factor based on the locked frame number and the i-th frame buffer frame, it is determined that the first condition is not satisfied.
[0108] In step S502, a target cache frame is selected from the cache frames cached after receiving the photo taking instruction.
[0109] The first condition is used to trigger the selection of a target cache frame from the cache frames cached before receiving the photo taking instruction.
[0110] In the above embodiment of the present disclosure, the target cache frame is preferentially selected from the cache frames cached before receiving the photo command, and it is determined whether the selected cache frame satisfies the first condition after the difference comparison algorithm of the cache frames with the locked frame number is completed. If the first condition is not satisfied, the target cache frame is selected from the cache frames cached after receiving the photo command, that is, the photo image is generated in a post-taken frame manner.
[0111] Among them, the camera application will capture continuous frames in a short time after pressing the shutter button during the photo-taking process. In addition, the front-fetching frame is to capture continuous frames in a short time before pressing the shutter button. If the zoom ratio of the cache frame selected by the front-fetching frame does not meet the first condition for generating a photo picture, the back-fetching frame can be used to capture continuous frames to generate a photo picture. In particular, during the shooting process, for those moments that occur later, the back-fetching frame may provide better image quality and performance.
[0112] Through the above embodiments, in the extreme case of rapid switching of zoom ratios, the dynamic frame judgment standard can be effectively enhanced, making the dynamic frame logic more rigorous, and accurately performing dynamic post-frame capture when the zoom changes too quickly to satisfy the pre-frame capture. This effectively avoids the problem of inconsistency between the preview image and the finished film due to inconsistent field of view of the camera application during the preview image process, thereby efficiently improving the user experience.
[0113] Figure 8 is a flowchart showing a method of determining whether the first condition is not satisfied based on the locked frame number and the zoom ratio of the i-th frame buffer according to another exemplary embodiment of the present disclosure, such as Figure 8 As shown, the method includes the following steps.
[0114] In step S601 , based on the locked frame number and the zoom factor of the i-th buffered frame, a standard frame is determined in the buffered frames corresponding to the locked frame number.
[0115] In the embodiment of the present disclosure, the standard frame is a cached frame whose zoom magnification difference with the previous adjacent cached frame is less than a difference threshold.
[0116] In step S602, if the number of frames of the determined standard frame does not exceed the frame number threshold, it is determined that the first condition is not satisfied.
[0117] In the above embodiment of the present disclosure, the standard frame of the pre-taken frame is determined by judging the difference comparison result of the zoom magnification between adjacent cached frames. If the number of accumulated standard frames does not exceed the frame number threshold after the difference comparison of the cached frames with the locked frame number is completed, it is determined that the first condition for executing the pre-taken frame is not met, because the accumulated number of frames cannot meet the judgment of the pre-taken frame behavior of this photo shooting, and the accumulated number of standard frames cannot synthesize a high-resolution picture.
[0118] Furthermore, if the frame number of the standard frame of the front frame does not exceed the frame number threshold, it is determined that the first condition for executing the front frame is not met, and the target cache frame is selected from the cache frames cached after receiving the photo-taking instruction, that is, the back frame is executed, and the preview image frame obtained based on the back frame method is used to generate a photo picture.
[0119] In the disclosed embodiment, in the extreme case of rapid zoom switching, when the zoom changes too quickly to meet the pre-frame condition, dynamic post-frame capture is performed accurately to prevent the serious jump problem of inconsistency between the generated photographed image and the preview image.
[0120] Fig. 9 is a flowchart showing a method of determining a standard frame in a cache frame corresponding to a locked frame number based on a locked frame number and a zoom ratio of an i-th cache frame according to another exemplary embodiment of the present disclosure, such as Fig. 9 As shown, the method includes the following steps.
[0121] In step S701, a zoom magnification of the i-th frame buffer is compared with a zoom magnification of the i-1-th frame buffer to obtain a j-th zoom magnification difference.
[0122] Wherein, j is a positive integer greater than or equal to 1.
[0123] The zoom ratio of the i-th frame cache and the zoom ratio of the i-1-th frame cache are obtained, so as to perform a determination using a zoom ratio fast difference comparison algorithm.
[0124] It should be noted that when the i-th cache frame is the first cache frame required to select the cache frame for executing the previous frame fetch, the default historical difference standard of the i-th cache frame is 0, and the zoom magnification of the first frame is compared with 0 by difference, and the j-th zoom magnification difference value obtained is the zoom magnification of the first frame. Among them, the historical difference standard can be understood as the zoom magnification value of the previous adjacent cache frame of the current cache frame.
[0125] The difference between the zoom magnification of the i-th frame buffer and the zoom magnification of the i-1-th frame buffer is determined to obtain the j-th zoom magnification difference, which is compared with the difference threshold.
[0126] In step S702, if the j-th zoom ratio difference is less than the difference threshold, the i-th cache frame is used as the standard frame.
[0127] In the embodiment of the present disclosure, when the j-th zoom magnification difference between the zoom magnification of the i-th frame cache frame and the zoom magnification of the i-1-th frame cache frame is less than the difference threshold, the i-th frame cache frame is determined to be a standard frame for pre-fetching, that is, the i-th frame cache frame meets the condition for pre-fetching. In addition, the smaller the j-th zoom magnification difference is, the more similar the images represented by the two adjacent cache frames are, which is helpful for resolution synthesis.
[0128] Furthermore, the number of standard frames that meet the difference comparison is accumulated, the difference between the zoom magnification of the i+1th cache frame and the zoom magnification of the i-th cache frame is obtained, and the difference comparison process of two adjacent cache frames is repeated until the difference comparison of the cache frames with the locked frame number is completed.
[0129] Among them, when the i-th frame cache frame is the first frame of the cache frame required to perform the front frame fetching, the zoom magnification difference between the zoom magnification of the first frame and 0 is obtained, which is less than the difference threshold by default. Among them, the difference threshold of the first frame can be a preset value of 1e-6, which satisfies the difference comparison algorithm by default. The zoom magnification of the first frame is used as the historical difference standard of the i+1-th frame cache frame, and the zoom magnification difference of its first frame is used as the difference threshold for the difference comparison between the zoom magnification of the i+1-th frame cache frame and the zoom magnification of the i-th frame cache frame.
[0130] By comparing the difference between two adjacent cached frames with the difference threshold, and determining the cached frame with a difference less than the difference threshold as the standard frame, it helps to improve the similarity of dynamic frame images, accurately judge the frame-taking behavior in a wide range of scenarios, and effectively eliminate the problem of deviation and inconsistency between the generated photo image and the preview image.
[0131] In another embodiment of the present disclosure, if during the difference comparison of the cached frames with locked frame numbers, the j-th zoom magnification difference between the zoom magnification of the i-th cached frame and the zoom magnification of the i-1-th cached frame is greater than or equal to the difference threshold, the number of standard frames needs to be accumulated again from the current i-th cached frame. The following embodiment is directed to how to perform the pre-frame behavior of dynamic frame fetching when the j-th zoom magnification difference is greater than or equal to the difference threshold.
[0132] Fig.10 is a flowchart of a photographing method according to another exemplary embodiment of the present disclosure. Fig.10 As shown, the method includes the following steps.
[0133] In step S801, a zoom magnification of the i-th frame buffer is compared with a zoom magnification of the i-1-th frame buffer to obtain a j-th zoom magnification difference.
[0134] In step S802, if the j-th zoom ratio difference is greater than or equal to the difference threshold, the number of standard frames accumulated before the i-th frame cache frame is set to 1, the number of standard frames that satisfy the zoom ratio difference less than the difference threshold is re-accumulated, and the j-th zoom ratio difference is updated to the difference threshold.
[0135] In the embodiment of the present disclosure, when the jth zoom magnification difference between the zoom magnification of the i-th frame cache frame and the zoom magnification of the i-1-th frame cache frame is greater than or equal to the difference threshold, it is necessary to set the number of standard frames accumulated before the current cache frame to 1, that is, to re-accumulate the number of standard frames, and determine the i+1-th frame cache frame as the first cache frame of the remaining locked frame number.
[0136] Furthermore, the j-th zoom magnification difference between the zoom magnification of the i-th frame cache frame and the zoom magnification of the i-1-th frame cache frame is used as a difference threshold, which is used to perform difference comparison with the j-th zoom magnification difference between the zoom magnification of the i+1-th frame cache frame and the zoom magnification of the i-th frame cache frame; if the j-th zoom magnification difference of the current i+1-th frame cache frame is less than the difference threshold, the i+1-th frame cache frame is a standard frame, and the number of standard frames is 1.
[0137] In one embodiment of the present disclosure, when the j-th zoom magnification difference between the zoom magnification of the i-th frame cache frame and the zoom magnification of the i-1-th frame cache frame is greater than or equal to the difference threshold, the difference threshold is updated to the j-th zoom magnification difference, which is used as the difference threshold for performing difference comparison on the i+1-th frame cache frame and the cache frames thereafter. If the j-th zoom magnification difference between the zoom magnification of the i+3-th frame cache frame and the zoom magnification of the i+2-th frame cache frame is greater than or equal to the difference threshold, the difference threshold is updated to the j-th zoom magnification difference obtained by performing difference on the current i+3-th frame cache frame.
[0138] In step S803, the j+1th zoom magnification difference between the zoom magnification of the i+1th frame buffer and the zoom magnification of the i-th frame buffer is obtained, and the difference between the j+1th zoom magnification difference and the j-th zoom magnification difference is compared.
[0139] In step S804, if the j+1th zoom magnification difference is less than the difference threshold, the i+1th frame buffer is used as a standard frame, and the number of standard frames is accumulated.
[0140] Among them, after the difference comparison algorithm of the previous frame is preferentially performed, it is necessary to determine whether the number of accumulated standard frames meets the first condition. If the first condition is not met, the number of frames of the determined standard frames does not exceed the frame number threshold. If the first condition is met, the number of frames of the determined standard frames exceeds the frame number threshold, which can be understood as the accumulated multiple low-resolution standard frames reaching the number of frames that can synthesize an ultra-high-resolution image.
[0141] In the embodiment of the present disclosure, if the j+1th zoom magnification difference between the zoom magnification of the i+1th frame cache frame and the zoom magnification of the i-th frame cache frame is less than the difference threshold, the i+1th frame cache frame is a standard frame, and the number of accumulated standard frames is +1.
[0142] Furthermore, if the j+2th zoom magnification difference between the zoom magnification of the i+2th frame cache frame and the zoom magnification of the i+1th frame cache frame is less than the difference threshold, the i+2th frame cache frame is the standard frame, and the number of standard frames accumulated is +1. This operation is repeated until the difference comparison of the cached frames after the i+1th frame cache frame satisfies the condition that the zoom magnification difference is less than the difference threshold, and the accumulated number of standard frames used for the front-fetched frames exceeds the frame number threshold, that is, the number of standard frames used for the front-fetched frames is the number of standard frames accumulated starting from the i+1th frame cache frame.
[0143] It can be seen from the above embodiments that in the process of sequentially performing the difference comparison between two adjacent cache frames, it is necessary to determine the specific implementation process of the current cache frame based on the comparison relationship between the difference between the two adjacent cache frames and the difference threshold.
[0144] If the difference between two adjacent cache frames is less than the difference threshold until the difference comparison of the locked frame number is completed, the implementation process is as follows Fig. 9 The method for determining a standard frame is executed, and after the standard frame for the preceding frame is determined, a plurality of low-resolution standard frames can be synthesized into an ultra-high-resolution frame.
[0145] If the difference between the two adjacent cache frames is greater than or equal to the threshold value during the difference comparison, the standard frame determined before the current cache frame needs to be cleared. In other words, the number of standard frames accumulated before the current cache frame is set to 1; and the standard frame with a difference less than the difference threshold is re-determined from the current cache frame, and the number of standard frames is re-accumulated; and it is determined whether the number of re-accumulated standard frames can meet the number of frames required to synthesize a high-resolution image. It can be understood that Fig.10 The implementation process of determining the standard frame is shown in Fig. 9 The determination shown is performed on the basis of the standard frame.
[0146] Through the above embodiment, not only the continuity of the cache frames to be selected is taken into consideration, but also the similarity of adjacent cache frame images is determined by comparing the difference in zoom ratios between adjacent cache frames. This makes it possible to more accurately judge whether the behavior of taking frames before taking the photo is correct. While improving the synthesis resolution of the previous frames, it effectively avoids the situation where the generated photo is inconsistent with the preview image, thereby improving the user experience.
[0147] In another embodiment of the present disclosure, until the difference comparison of the cached frames after the i+1th frame cache frame is executed satisfies the condition that the jth zoom ratio difference is less than the difference threshold, but the accumulated number of standard frames used for the previous frame capture does not exceed the frame number threshold, dynamic frame capture and post-frame capture behavior are performed.
[0148] Fig.11 is a flowchart of a photographing method according to another exemplary embodiment of the present disclosure. Fig.11 As shown, the method includes the following steps.
[0149] In step S901, based on the frame number continuity and sensitivity of the cached frames, it is determined that the second condition is met.
[0150] In the embodiment of the present disclosure, satisfying the second condition includes: the frame numbers of the cached frames are continuous, and the sensitivity frame-by-frame difference ratio is less than a threshold.
[0151] In step S902, a target cache frame is selected based on the zoom ratio of the cache frame.
[0152] In an embodiment of the present disclosure, the pre-frame condition includes a first condition and a second condition. The first condition is determined based on the zoom ratio of the cached frame, and the second condition is determined based on the frame number continuity and sensitivity of the cached frame. The cached frame is a preview image frame output and stored in the cache area when the terminal's camera application provides a preview picture.
[0153] The second condition of the previous frame condition includes that the frame numbers of the selected cache frames are continuous, and the frame-by-frame difference ratio of the sensitivities of two adjacent cache frames is less than a threshold.
[0154] In one implementation, the threshold is an experimental value obtained through multiple experiments, for example, the threshold is 10%.
[0155] Furthermore, in the disclosed embodiments, the sensitivity frame-by-frame difference ratio is an image processing technology commonly used in computer vision and video analysis. Moreover, the sensitivity frame-by-frame difference ratio is usually used to measure the degree of difference between adjacent frames in a video sequence. The sensitivity reflects the changes in the image and the richness of dynamic information.
[0156] In one embodiment, the following are general steps for calculating the sensitivity frame-by-frame difference ratio: first, extract consecutive frames in a video sequence (e.g., frame 1 and frame 2, frame 2 and frame 3, and so on); then, calculate the pixel difference between two adjacent frames, which can be achieved by comparing the color value of each pixel (such as grayscale value or RGB value), usually using absolute value difference or square difference and other methods for calculation; then, calculate the sum or average of all pixel differences to obtain a numerical value representing the difference between the two frames, and this numerical value can be regarded as a specific indicator of sensitivity frame-by-frame difference; repeat this process to calculate the sensitivity frame-by-frame difference ratio for all adjacent frame pairs in the entire video sequence; finally, these difference ratios can be analyzed to detect actions, activities or abnormal events in the video. Among them, a higher difference ratio value may indicate that the picture has changed more, while a lower difference ratio value may mean that the picture has changed less.
[0157] Further explanation, the sensitivity frame-by-frame difference ratio has practical applications in many fields, such as motion detection, object tracking, behavior analysis, video compression, and video quality assessment. By studying the sensitivity frame-by-frame difference ratio in video sequences, we can better understand the video content and dynamic changes, thus providing a basis for further processing and analysis.
[0158] In one embodiment, when the camera application of the terminal is opened, the preview image page is entered, and the switching of the zoom ratio is triggered. During this process, the shutter of the camera application is clicked to trigger the photo command. The camera application will output the preview image data to the cache area and save it according to the preview request, which is used for the behavior determination of the pre-frame. Among them, the continuity of the cache frame frame number refers to the determination that each frame of image data after the camera application is triggered to preview is output to the cache area. If the frame number of the selected cache frame is continuous, it helps to improve the synthesis resolution in the ultra-high resolution scene. Among them, sensitivity refers to the sensitivity of the photosensitive element, also known as ISO (sensitivity) value. The higher the ISO value, if the difference ratio of the sensitivity between adjacent cache frames is less than the threshold, it means that in the same scene, the sensitivity between adjacent cache frames is not much different, which helps to improve the synthesis effect of multiple cache frames.
[0159] That is, sensitivity itself is a measure of the ability of a camera's photosensitive element (such as CMOS or CCD) to capture images under specific light conditions. In photography, sensitivity is usually expressed as an ISO value. A higher ISO value means that the camera is more sensitive to light and can be used to shoot in darker environments; a lower ISO value means that the camera is less sensitive to light and is suitable for brighter environments.
[0160] In camera photography technology, the sensitivity ratio refers to the sensitivity of the camera to light changes during continuous shooting. This concept is related to the camera's photosensitive element, photosensitivity and signal-to-noise ratio. The frame-by-frame ratio is used to measure the light changes between two adjacent frames.
[0161] The frame-by-frame difference ratio is a concept related to dynamic range, signal-to-noise ratio and image stability. A larger frame-by-frame difference ratio means that the camera reacts faster to light changes during continuous shooting, thereby capturing more details. A smaller frame-by-frame difference ratio may cause some details to be lost during continuous shooting. In actual applications, the frame-by-frame difference ratio is usually optimized for specific scenes and needs to obtain the best shooting effect.
[0162] In the disclosed embodiment, the behavior judgment of the previous frame can be understood as the process of judging the conditions of the previous frame. By selecting multiple cache frames that meet the second condition of the previous frame from the cache frames in the cache area, that is, judging the second condition, and judging whether the multiple cache frames that meet the second condition meet the first condition, the cache frames that finally meet the conditions of the previous frame are used to generate a photographed picture. On the basis of the sensitivity difference of the cached frames and the continuity of the frame numbers, a difference comparison algorithm for the zoom ratios of multiple cached frames is added to further judge the behavior of the previous frame, which helps to accurately judge whether the current dynamic frame-taking process meets the behavior of the previous frame. Starting from the continuity and image similarity, while improving the synthesis resolution, the problem of deviation between the generated photographed picture and the preview image is effectively avoided.
[0163] In one embodiment of the photographing method provided by the present disclosure, in response to the terminal's camera application providing a preview screen in an ultra-high resolution scenario, it is triggered to quickly switch zoom and instantly complete the photographing operation. The photographing method involved in the above embodiments of the present disclosure is used to take pictures, so as to effectively perform dynamic framing, avoid the problem of inconsistency between the preview image and the formed picture in the album, and improve the synthetic resolution in the SR scenario.
[0164] The camera application is triggered to quickly switch the zoom, which can be understood as the time interval for switching the zoom ratio is less than the time threshold.
[0165] In the embodiment of the present disclosure, instantaneous completion of the photo-taking operation can be understood as receiving a photo-taking instruction within a time threshold. The terminal receives the photo-taking instruction and triggers the camera application to take a photo. For example, the photo-taking instruction may be that the shutter in the camera application is triggered. That is, instantaneous completion of the photo-taking operation can be understood as the user completing the shutter triggering within a time threshold.
[0166] For the convenience of description in the disclosed embodiments, the time threshold for determining the rapid switching of zoom is referred to as the first time threshold. The time threshold for determining the instantaneous completion of the photo-taking operation is referred to as the second time threshold. The first time threshold and the second time threshold may be empirical values, which mainly indicate that the user completes the rapid switching of the zoom ratio in a very short time and issues a photo-taking instruction.
[0167] In one embodiment of the present disclosure, in response to the camera application of the terminal providing a preview image in an ultra-high resolution scenario, it is triggered to switch the zoom ratio within a first time threshold, and when a photo taking instruction is received within a second time threshold, the photo taking method involved in the above-mentioned embodiments of the present disclosure is used to take a photo.
[0168] Among them, the camera application provides a preview screen in an ultra-high resolution scene, which is a process of synthesizing a series of low-resolution images to obtain a high-resolution image and displaying the preview screen. In the process of providing a preview screen display in an ultra-high resolution scene, the present disclosure quickly switches the zoom ratio and instantly completes the photo shooting. Through the dynamic frame-taking method involved in the above-mentioned embodiments, the problem of inconsistency between the preview image and the finished film due to the inconsistent field of view of the camera application during the preview image is effectively avoided, thereby improving the synthesis resolution in the ultra-high resolution scene.
[0169] In one embodiment of the present disclosure, a fast difference comparison algorithm for multiple frames of zoomratio data is added to the dynamic frame acquisition logic. Fig.12 FIG. 1 is a flowchart of a method for photographing according to another exemplary embodiment of the present disclosure. Fig.12 As shown, the process includes the following steps S1001, S1002, S1003, S1004, S1005, S1006, S1007, S1008, S1009, S1010, S1011, S1012, S1013, S1014 and S1015. The above steps will be introduced below respectively.
[0170] In step S1001, the camera is turned on.
[0171] In step S1002, enter the ultra-high resolution scene, preview the data output and cache it.
[0172] When the camera is turned on and enters the SuperResolution scene, the sensor outputs relevant data of the preview image according to the preview request, such as frame number, sensitivity, and zoom ratio, and saves it to the cache.
[0173] In step S1003, the zoom ratio is quickly switched and the photo-taking action is completed instantly.
[0174] In step S1004, the frame is instantaneously framed and dynamic frame determination is performed.
[0175] In step S1005, a pre-selected frame locking operation is performed to determine whether the frame numbers are continuous and whether the sensitivity is consistent.
[0176] Furthermore, a burst method is used to select target cache frames from the cache area. For example, m frames are selected from the cache area, where m is a positive integer greater than or equal to 1, and the m frame requests are packaged in the form of a group and sent to the bottom layer to complete the frame download action. When the first frame request arrives at the bottom layer, dynamic frame fetching begins, and the priority is given to the front-end fetching to complete the selection and locking of the required number of frames.
[0177] Furthermore, the frame number and sensitivity are determined based on the selected frame, and if the conditions are met, the zoomratio data of the selected frame is obtained. Among them, this zoomratio data refers to the zoomratio data of the cached frame, which is different from the zoomratio data sent by the APP when taking pictures. It can be understood that the zoomratio data of the selected frame is the zoomratio data of a cached frame in the output preview image, and the zoomratio data sent by the APP when taking pictures is the data of the current frame after the sensor receives the photo command at a certain frame, which is the zoom ratio data sent by the APP when taking pictures.
[0178] In step S1006, the zoom magnification data of the Nth frame of the selected buffered frame is obtained.
[0179] Wherein, N is a positive integer greater than or equal to 1.
[0180] In step S1007, a difference comparison is performed with the zoom factor data of the previous frame (N is 1 by default).
[0181] Among them, if the current frame is the first cached frame of the selected cached frame, that is, N=1, its corresponding previous frame is 0, and the difference between the first cached frame and 0 is less than the difference threshold, it is assumed that the first cached frame satisfies the difference comparison algorithm.
[0182] In step S1008, the current frame number is removed, the accumulated frame number is set to 1, and the zoom ratio difference data is used as the difference threshold, N++.
[0183] "N++" means that the value of variable N is automatically increased by 1, and the difference comparison algorithm of the next adjacent cache frame is performed. After the difference comparison algorithm of the current Nth cache frame is completed, N++ is executed, the value of variable N is automatically increased by 1, and the difference comparison algorithm of the N+1th cache frame is performed.
[0184] If the difference between the zoom magnification of the selected cache frame and the zoom magnification of the previous frame does not satisfy the difference threshold, step S1008 is executed, and step S1005 is continued.
[0185] In step S1009, the number of frames is accumulated ++, and this zoom factor data is saved as the historical difference standard, N++.
[0186] The symbol "++" can be understood as an increment operator in programming languages. "Number of frames++" means that when it is determined that the current cached frame satisfies the frame required for synthesizing the previous frame to take a photo, the accumulated number of frames is automatically increased by 1.
[0187] If the difference between the zoom magnification of the selected cache frame and the zoom magnification of the previous frame is less than the difference threshold, step S1009 is executed.
[0188] In step S1010, the accumulated number of frames meets the previous frame fetching behavior requirement.
[0189] In step S1011, a frame is dynamically forward-fetched.
[0190] In step S1012, if it is not satisfied, the frame is dynamically taken later.
[0191] Further, according to the above steps S1006 to S1012, by comparing the zoomratio data of the acquired cache frame with the historical difference standard using a fast difference algorithm, the following situations can be classified:
[0192] 1. The selected frame is the first cached frame (i.e., N is 1), and the historical difference standard corresponding to the zoomratio data of the first frame is 0 (the default is 0), then the zoomratio data of the first frame is compared with its historical difference standard 0 by the fast difference algorithm, and the difference result obtained is less than the preset difference threshold, which satisfies the fast difference comparison algorithm by default, and the zoom ratio data of this first frame is updated to the historical difference standard, stored in the fast difference comparison algorithm, and the operation of step S1005 is continued. Among them, the preset difference threshold can be 1e-6.
[0193] 2. Calculate the difference between the zoom ratio data of the current frame and the historical difference standard to determine whether the difference is less than a preset difference threshold. If so, add 1 to the cumulative number of the previous frame and add 1 to the Nth cache frame to obtain the N+1th cache frame, and proceed to step S1005.
[0194] 3. Calculate the difference between the zoom ratio data of the current frame and the historical difference standard to determine whether the value is less than the preset difference threshold standard. If not, set the accumulated value of the previous frame to 1, and update the zoomratio data of the current frame to the historical difference standard, and continue with step S1005.
[0195] In step S1013, the image information processing flow.
[0196] In step S1014, the processed photos are saved in an album.
[0197] Furthermore, the selected image data is processed step by step, the generated image is saved in an album, and after a time interval of one photo shooting, steps S1003 to S1013 are repeated.
[0198] In step S1015, the camera is turned off.
[0199] The present invention, based on the continuity of cached frame numbers and the difference in sensitivity, adds a fast difference comparison algorithm of zoom ratio data of multiple frames to judge the previous frame-taking behavior, which can more accurately judge the dynamic frame-taking behavior, improve the synthesis resolution from the perspective of continuity and image similarity, and effectively avoid the situation where the generated photo image has deviations and inconsistencies with the preview image, resulting in poor user experience.
[0200] Fig.13 This is a comparison diagram of the effect of adding a zoom ratio judgment index of multiple cache frames to adapt to dynamic frame acquisition according to another exemplary embodiment of the present disclosure. In the face of extreme situations where the zoom is switched quickly, by adding a zoom ratio judgment index of multiple cache frames, it is effectively determined whether the image has a FOV jump, so that the serious jump problem of the generated photo being inconsistent with the preview image no longer occurs. Fig.10 As shown, when the user quickly switches from the current 10X preview image to the 2X preview image and instantly clicks the shutter, considering the problem of FOV viewing angle jump, the zoom ratio judgment index of the multi-frame cache frame is increased so that the photo generated in the album is a 2X preview image.
[0201] Through the method disclosed in the present invention, in the extreme case of rapid zoom switching, the dynamic frame judgment standard can be effectively enhanced, making the dynamic frame logic more rigorous, and accurately performing dynamic post-framing behavior when the zoom changes too quickly to meet the pre-framing requirements, and there will no longer be a serious jump problem where the generated photo image is inconsistent with the preview image.
[0202] Based on the same concept, an embodiment of the present disclosure also provides a photographing device.
[0203] It is understandable that the photographing device provided by the embodiment of the present disclosure includes hardware structures and / or software modules corresponding to the execution of each function in order to realize the above functions. In combination with the units and algorithm steps of each example disclosed in the embodiment of the present disclosure, the embodiment of the present disclosure can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art may use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the technical solution of the embodiment of the present disclosure.
[0204] Fig.14 FIG. 1 is a block diagram of a photographing device 100 according to an exemplary embodiment. Fig.14 The device 100 includes a determining unit 101, a selecting unit 102, and a generating unit 103.
[0205] The determination unit 101 is used to determine a cache frame in response to receiving a photo taking instruction during the process of the terminal's camera application providing a preview image, where the cache frame is a preview image frame output and stored in a cache area when the terminal's camera application provides a preview image.
[0206] The selection unit 102 is used to select a target cache frame based on the zoom ratio of the cache frame, where the target cache frame is a preview image frame used to generate a photographed picture.
[0207] The generating unit 103 is used to generate a photographic image based on the target cache frame.
[0208] In one embodiment, the determination unit 101 is used to determine a standard frame in the cache frames corresponding to the locked frame number based on the locked frame number and the zoom ratio of the i-th cache frame, the standard frame being a cache frame whose zoom ratio difference with the previous adjacent cache frame is less than a difference threshold; if the frame number of the determined standard frame exceeds the frame number threshold, it is determined that the first condition is met.
[0209] In one embodiment, the determination unit 101 is used to determine a standard frame in the cache frames corresponding to the locked frame number based on the locked frame number and the zoom ratio of the i-th cache frame, the standard frame being a cache frame whose zoom ratio difference with the previous adjacent cache frame is less than a difference threshold; if the frame number of the determined standard frame does not exceed the frame number threshold, it is determined that the first condition is not met.
[0210] In one embodiment, the determination unit 101 is used to perform a difference comparison between the zoom magnification of the i-th frame cache frame and the zoom magnification of the i-1-th frame cache frame to obtain the j-th zoom magnification difference, where j is a positive integer greater than or equal to 1; if the j-th zoom magnification difference is less than the difference threshold, the i-th frame cache frame is used as the standard frame.
[0211] In one embodiment, the determination unit 101 is used to set the number of standard frames accumulated before the i-th frame cache frame to 1 if the j-th zoom ratio difference is greater than or equal to the difference threshold, re-accumulate the number of standard frames that satisfy the zoom ratio difference less than the difference threshold, and update the j-th zoom ratio difference to the difference threshold; obtain the j+1-th zoom ratio difference between the zoom ratio of the i+1-th frame cache frame and the zoom ratio of the i-th frame cache frame, and compare the difference between the j+1-th zoom ratio difference and the j-th zoom ratio difference; if the j+1-th zoom ratio difference is less than the difference threshold, use the i+1-th frame cache frame as the standard frame and accumulate the number of standard frames; the first condition is not met, including: the number of standard frames determined does not exceed the frame number threshold.
[0212] In one embodiment, the determination unit 101 is also used to determine that a second condition is satisfied based on the frame number continuity and sensitivity of the cached frame before the selection unit 102 selects the target cached frame based on the zoom ratio of the cached frame; satisfying the second condition includes: the frame numbers of the cached frames are continuous and the frame-by-frame sensitivity difference ratio is less than a threshold.
[0213] In one embodiment, the determination unit 101 is used to respond to the terminal's camera application providing a preview image in an ultra-high resolution scenario, being triggered to switch the zoom ratio within a first time threshold, and receiving a photo taking instruction within a second time threshold.
[0214] In one embodiment, the selection unit 102 is used to determine the i-th cache frame currently locked and selected in the cache area, where i is a positive integer greater than or equal to 1; based on the locked frame number and the zoom ratio of the i-th cache frame, select the target cache frame; the locked frame number is the number of target cache frames that need to be selected.
[0215] In one embodiment, the selection unit 102 is used to select a target cache frame from the cache frames cached before receiving a photo command in response to determining that a first condition is satisfied based on the locked frame number and the zoom ratio of the i-th cache frame; the first condition is used to trigger the selection of the target cache frame from the cache frames cached before receiving the photo command.
[0216] In one embodiment, the selection unit 102 is used to select a target cache frame from the cache frames cached after receiving a photo command in response to determining that the first condition is not met based on the locked frame number and the zoom ratio of the i-th cache frame; the first condition is used to trigger the selection of the target cache frame from the cache frames cached before receiving the photo command.
[0217] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0218] Fig.15 2 is a block diagram of a device 200 for taking photos according to an exemplary embodiment. For example, the device 200 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.
[0219] Reference Fig.15 , the device 200 may include one or more of the following components: a processing component 202 , a memory 204 , a power component 206 , a multimedia component 208 , an audio component 210 , an input / output (I / O) interface 212 , a sensor component 214 , and a communication component 216 .
[0220] The processing component 202 generally controls the overall operation of the device 200, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 202 may include one or more processors 220 to execute instructions to perform all or part of the steps of the above-described method. In addition, the processing component 202 may include one or more modules to facilitate interaction between the processing component 202 and other components. For example, the processing component 202 may include a multimedia module to facilitate interaction between the multimedia component 208 and the processing component 202.
[0221] The memory 204 is configured to store various types of data to support operations on the device 200. Examples of such data include instructions for any application or method operating on the device 200, contact data, phone book data, messages, pictures, videos, etc. The memory 204 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.
[0222] The power component 206 provides power to the various components of the device 200. The power component 206 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the device 200.
[0223] The multimedia component 208 includes a screen that provides an output interface between the device 200 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 208 includes a front camera and / or a rear camera. When the device 200 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
[0224] The audio component 210 is configured to output and / or input audio signals. For example, the audio component 210 includes a microphone (MIC), and when the device 200 is in an operation mode, such as a call mode, a recording mode, and a speech recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 204 or sent via the communication component 216. In some embodiments, the audio component 210 also includes a speaker for outputting audio signals.
[0225] I / O interface 212 provides an interface between processing component 202 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include but are not limited to: a home button, a volume button, a start button, and a lock button.
[0226] The sensor assembly 214 includes one or more sensors for providing various aspects of the status assessment of the device 200. For example, the sensor assembly 214 can detect the open / closed state of the device 200, the relative positioning of components, such as the display and keypad of the device 200, the sensor assembly 214 can also detect the position change of the device 200 or a component of the device 200, the presence or absence of user contact with the device 200, the orientation or acceleration / deceleration of the device 200 and the temperature change of the device 200. The sensor assembly 214 can include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 214 can also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 214 can also include an accelerometer, a gyroscope sensor, a magnetic sensor, a pressure sensor or a temperature sensor.
[0227] The communication component 216 is configured to facilitate wired or wireless communication between the device 200 and other devices. The device 200 can access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 216 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 216 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
[0228] In an exemplary embodiment, the apparatus 200 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors or other electronic components to perform the above method.
[0229] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 204 including instructions, and the instructions can be executed by the processor 220 of the device 200 to perform the above method. For example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.
[0230] It is to be understood that in the present disclosure, "plurality" refers to two or more than two, and other quantifiers are similar. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the associated objects before and after are in an "or" relationship. The singular forms "a", "the" and "the" are also intended to include plural forms, unless the context clearly indicates other meanings.
[0231] It is further understood that the terms "first", "second", etc. are used to describe various information, but such information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other, and do not indicate a specific order or degree of importance. In fact, the expressions "first", "second", etc. can be used interchangeably. For example, without departing from the scope of the present disclosure, the first information can also be referred to as the second information, and similarly, the second information can also be referred to as the first information.
[0232] It can be further understood that, unless otherwise specified, “connection” includes a direct connection without other components between the two, and also includes an indirect connection with other components between the two.
[0233] It is further understood that, although the operations are described in a specific order in the drawings in the embodiments of the present disclosure, it should not be understood as requiring the operations to be performed in the specific order shown or in a serial order, or requiring the execution of all the operations shown to obtain the desired results. In certain environments, multitasking and parallel processing may be advantageous.
[0234] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. This application is intended to cover any modifications, uses or adaptations of the present disclosure, which follow the general principles of the present disclosure and include common knowledge or customary technical means in the art that are not disclosed in the present disclosure.
[0235] It should be understood that the present disclosure is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the scope of the appended claims.
Claims
1. A photographing method, characterized in that: The method comprises: In response to receiving a photo taking instruction during the process of providing a preview picture by a camera application of the terminal, determining a cache frame, wherein the cache frame is a preview image frame output and stored in a cache area when the camera application of the terminal provides a preview picture; Based on the zoom ratio of the cache frame, a target cache frame is selected, where the target cache frame is a preview image frame used to generate a photographed picture; Based on the target cache frame, a photographic picture is generated.
2. The photographing method according to claim 1, characterized in that: The step of selecting a target cache frame based on the zoom ratio of the cache frame includes: Determine the i-th frame cached frame currently locked and selected in the cache area, where i is a positive integer greater than or equal to 1; Selecting the target cache frame based on the locked frame number and the zoom ratio of the i-th cache frame; The locked frame number is the number of target cache frames that need to be selected.
3. The photographing method according to claim 2, characterized in that: The selecting the target cache frame based on the locked frame number and the zoom ratio of the i-th cache frame includes: In response to determining that a first condition is satisfied based on the locked frame number and the zoom ratio of the i-th cache frame, selecting the target cache frame from the cache frames cached before receiving the photo taking instruction; The first condition is used to trigger the selection of the target cache frame from the cache frames cached before receiving the photo-taking instruction.
4. The photographing method according to claim 3, characterized in that: The determining, based on the locked frame number and the zoom ratio of the i-th cache frame, that the first condition is satisfied includes: Based on the locked frame number and the zoom magnification of the i-th cached frame, determining a standard frame in the cached frames corresponding to the locked frame number, the standard frame being a cached frame whose zoom magnification difference with the previous adjacent cached frame is less than a difference threshold; If the determined frame number of the standard frame exceeds the frame number threshold, it is determined that the first condition is met.
5. The photographing method according to claim 2, characterized in that: The selecting the target cache frame based on the locked frame number and the zoom ratio of the i-th cache frame includes: In response to determining that the first condition is not satisfied based on the locked frame number and the zoom ratio of the i-th cache frame, selecting the target cache frame from the cache frames cached after receiving the photo taking instruction; The first condition is used to trigger the selection of the target cache frame from the cache frames cached before receiving the photo-taking instruction.
6. The photographing method according to claim 5, characterized in that: The determining that the first condition is not satisfied based on the locked frame number and the zoom magnification of the i-th frame buffer includes: Based on the locked frame number and the zoom magnification of the i-th cached frame, determining a standard frame in the cached frames corresponding to the locked frame number, the standard frame being a cached frame whose zoom magnification difference with the previous adjacent cached frame is less than a difference threshold; If the determined frame number of the standard frame does not exceed the frame number threshold, it is determined that the first condition is not met.
7. The photographing method according to claim 4 or 6, characterized in that: The determining of the standard frame in the cached frames corresponding to the locked frame number based on the locked frame number and the zoom ratio of the i-th cached frame includes: Compare the zoom magnification of the i-th frame buffer with the zoom magnification of the i-1-th frame buffer to obtain the j-th zoom magnification difference, where j is a positive integer greater than or equal to 1; If the j-th zoom ratio difference is less than the difference threshold, the i-th cache frame is used as the standard frame.
8. The photographing method according to claim 7, characterized in that: The method further comprises: If the j-th zoom ratio difference is greater than or equal to the difference threshold, the number of standard frames accumulated before the i-th frame cache is set to 1, the number of standard frames satisfying the zoom ratio difference less than the difference threshold is accumulated again, and the j-th zoom ratio difference is updated to the difference threshold; Obtaining a j+1th zoom magnification difference between the zoom magnification of the i+1th frame buffer and the zoom magnification of the i-th frame buffer, and performing a difference comparison between the j+1th zoom magnification difference and the j-th zoom magnification difference; If the j+1th zoom ratio difference is less than the difference threshold, the i+1th frame cache is used as the standard frame, and the number of frames of the standard frame is accumulated; The first condition is not met, including: the number of frames of the determined standard frame does not exceed the frame number threshold.
9. The photographing method according to claim 1, characterized in that: Before selecting the target cache frame based on the zoom ratio of the cache frame, the method further includes: Determining that a second condition is satisfied based on the frame number continuity and sensitivity of the cached frame; The second condition being satisfied includes: the frame numbers of the cached frames are continuous, and the sensitivity frame-by-frame difference ratio is less than a threshold.
10. The photographing method according to claim 1, characterized in that: The step of responding to a camera application of the terminal receiving a photo taking instruction during the process of providing a preview screen includes: In response to the camera application of the terminal providing a preview image in an ultra-high resolution scenario, it is triggered to switch the zoom ratio within a time period less than a first time threshold, and receives a photo taking instruction within a time period less than a second time threshold.
11. A photographing device, characterized in that: The device comprises: a determining unit, configured to determine a cache frame in response to receiving a photo taking instruction during the process of providing a preview image by a camera application of the terminal, wherein the cache frame is a preview image frame output and stored in a cache area when the camera application of the terminal provides a preview image; A selection unit, configured to select a target cache frame based on a zoom ratio of the cache frame, wherein the target cache frame is a preview image frame used to generate a photographed image; A generating unit is used to generate a photographic image based on the target cache frame.
12. The photographing device according to claim 11, characterized in that: The selection unit selects the target cache frame based on the zoom ratio of the cache frame in the following manner: Determine the i-th frame cached frame currently locked and selected in the cache area, where i is a positive integer greater than or equal to 1; Selecting the target cache frame based on the locked frame number and the zoom ratio of the i-th cache frame; The locked frame number is the number of target cache frames that need to be selected.
13. The photographing device according to claim 12, characterized in that: The selection unit selects the target cache frame based on the locked frame number and the zoom ratio of the i-th cache frame in the following manner: In response to determining that a first condition is satisfied based on the locked frame number and the zoom ratio of the i-th cache frame, selecting the target cache frame from the cache frames cached before receiving the photo taking instruction; The first condition is used to trigger the selection of the target cache frame from the cache frames cached before receiving the photo-taking instruction.
14. The photographing device according to claim 13, characterized in that: The determining unit determines that the first condition is satisfied based on the locked frame number and the zoom ratio of the i-th frame buffer in the following manner: Based on the locked frame number and the zoom magnification of the i-th cached frame, determining a standard frame in the cached frames corresponding to the locked frame number, the standard frame being a cached frame whose zoom magnification difference with the previous adjacent cached frame is less than a difference threshold; If the determined frame number of the standard frame exceeds the frame number threshold, it is determined that the first condition is met.
15. The photographing device according to claim 12, characterized in that: The selection unit selects the target cache frame based on the locked frame number and the zoom ratio of the i-th cache frame in the following manner: In response to determining that the first condition is not satisfied based on the locked frame number and the zoom ratio of the i-th cache frame, selecting the target cache frame from the cache frames cached after receiving the photo taking instruction; The first condition is used to trigger the selection of the target cache frame from the cache frames cached before receiving the photo-taking instruction.
16. The photographing device according to claim 15, characterized in that: The determining unit determines that the first condition is not satisfied based on the locked frame number and the zoom ratio of the i-th frame buffer in the following manner: Based on the locked frame number and the zoom magnification of the i-th cached frame, determining a standard frame in the cached frames corresponding to the locked frame number, the standard frame being a cached frame whose zoom magnification difference with the previous adjacent cached frame is less than a difference threshold; If the determined frame number of the standard frame does not exceed the frame number threshold, it is determined that the first condition is not met.
17. The photographing device according to claim 14 or 16, characterized in that: The determining unit determines the standard frame in the cached frames corresponding to the locked frame number based on the locked frame number and the zoom ratio of the i-th cached frame in the following manner: Compare the zoom magnification of the i-th frame buffer with the zoom magnification of the i-1-th frame buffer to obtain the j-th zoom magnification difference, where j is a positive integer greater than or equal to 1; If the j-th zoom ratio difference is less than the difference threshold, the i-th cache frame is used as the standard frame.
18. The photographing device according to claim 17, characterized in that: The determining unit is further configured to: If the j-th zoom ratio difference is greater than or equal to the difference threshold, the number of standard frames accumulated before the i-th frame cache is set to 1, the number of standard frames satisfying the zoom ratio difference less than the difference threshold is accumulated again, and the j-th zoom ratio difference is updated to the difference threshold; Obtaining a j+1th zoom magnification difference between the zoom magnification of the i+1th frame buffer and the zoom magnification of the i-th frame buffer, and performing a difference comparison between the j+1th zoom magnification difference and the j-th zoom magnification difference; If the j+1th zoom ratio difference is less than the difference threshold, the i+1th frame cache is used as the standard frame, and the number of frames of the standard frame is accumulated; The first condition is not met, including: the number of frames of the determined standard frame does not exceed the frame number threshold.
19. The photographing device according to claim 11, characterized in that: The determining unit is further configured to: Before the selection unit selects the target cache frame based on the zoom magnification of the cache frame, determining that a second condition is satisfied based on the continuity and sensitivity of the frame numbers of the cache frames; The second condition being satisfied includes: the frame numbers of the cached frames are continuous, and the sensitivity frame-by-frame difference ratio is less than a threshold.
20. The photographing device according to claim 11, characterized in that: The determining unit receives a photo taking instruction in response to the camera application of the terminal providing a preview screen in the following manner: In response to the camera application of the terminal providing a preview image in an ultra-high resolution scenario, it is triggered to switch the zoom ratio within a time period less than a first time threshold, and receives a photo taking instruction within a time period less than a second time threshold.
21. A photographing device, characterized in that: include: processor; a memory for storing processor-executable instructions; Wherein, the processor is configured to: execute the photographing method described in any one of claims 1-10.
22. A storage medium, characterized in that: The storage medium stores instructions, and when the instructions in the storage medium are executed by the processor of the terminal, the terminal is enabled to execute the photographing method described in any one of claims 1-10.
