Image frame storage method, photographing method, and electronic device

By acquiring and filtering image frames in electronic devices, and storing image frames according to differences in image quality and content, the problem of storage space being quickly filled up is solved, and the long-term preservation and effective utilization of high-quality images are achieved.

CN114528422BActive Publication Date: 2026-01-02HUAWEI TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202011574651.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Priority Date
2020-10-31
Filing Date
2020-12-25
Publication Date
2026-01-02
Estimated Expiration
2040-12-25

AI Technical Summary

Technical Problem

When electronic devices capture images in real time, their storage space fills up quickly, making it impossible to save high-quality image frames for a long time, and users cannot view images captured earlier.

Method used

By acquiring image frames within a preset time period and filtering them based on image quality and content differences, the system stores image frames that are of high quality and highly diverse, while covering low-quality frames and optimizing storage space utilization.

Benefits of technology

It extends the time span of stored image frames, improves the quality of stored images, reduces redundant storage, and effectively utilizes storage space.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114528422B_ABST
    Figure CN114528422B_ABST
Patent Text Reader

Abstract

The embodiment of the application provides an image frame storage method, applied to an electronic device, the maximum number of image frames allowed to be stored in the first storage space of the electronic device is N, N is a positive integer, and the method comprises the following steps: collecting first image frames within a first time length, m first image frames collected continuously within the first time length are a group of image frames; and saving second image frames meeting an image quality condition in the first image frames into the first storage space. The embodiment of the application is beneficial to improving the time span and image quality of the stored image frames.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of electronics, and particularly relates to an image frame storage method, a photographing method and an electronic device. BACKGROUND

[0002] With the progress of camera technology, the specifications of cameras are getting higher and higher, the image quality of the photographed images is getting higher and higher, and the storage space occupied by the images is getting larger and larger. In some scenarios, the electronic device needs to start the camera in real time and store the photographed images in real time, so that the storage space of the electronic device will be occupied for a period of time. If the electronic device wants to continue photographing and storing images, the images stored earlier in the electronic device need to be deleted, which causes the user to be unable to view the images photographed earlier. SUMMARY

[0003] In a first aspect, the present application provides an image frame storage method applied to an electronic device, a maximum frame number of image frames allowed to be stored in a first storage space of the electronic device is N, N is a positive integer, and the method comprises: collecting first image frames in a first time length, m consecutive first image frames collected in the first time length form a group of image frames; saving second image frames meeting an image quality condition in the first image frames to the first storage space, the image quality condition comprises: the image quality of the second image frames is higher than a first image quality, and the difference value of image content between adjacent second image frames is greater than a first value; K is a positive integer, when K is equal to 1, the number of second image frames belonging to the Kth group of image frames is equal to 1; when K is greater than or equal to 2, the number of second image frames belonging to the Kth group of image frames is less than or equal to (K-1); or, the image quality of the second image frames is the highest in the group of image frames where the first image frames are located; wherein m is determined according to a total number F of image frames collected in the first time length and the maximum frame number N, the total number F is the number of image frames that can be collected by the electronic device in the first time length at a first frame rate; the total number F is greater than the maximum frame number N.

[0004] Among them, the electronic device can determine the maximum storage capacity occupied by a frame of image frame according to the actual parameter configuration in the photographing process, and then calculate the maximum frame number N according to the maximum storage capacity occupied by a frame of image frame and the size of the first storage space.

[0005] Among them, the first time length can be a pre-set time length value, for example, the first time length can be 1 second, 1 minute, 1 hour, etc.

[0006] The first value is a preset numerical value. The electronic device can calculate the difference between two image frames based on the degree of difference between their image content, and then determine whether the difference value is greater than the first value. The first image quality can be a preset image quality evaluation standard / the numerical values ​​of various parameters of the image frame (such as resolution, color saturation, color dynamic range, noise level, etc.). The electronic device can determine the image quality of the image frame based on preset dimensions (such as resolution, color saturation, dynamic range, noise level, etc.), and then determine whether the image quality of the image frame is greater than the first image quality. The Kth group of image frames refers to the group of image frames that are in the Kth order in time within the first duration.

[0007] In this process, the electronic device acquires the first image frame at a first frame rate within a first duration.

[0008] It is evident that electronic devices can store image frames that meet the image quality requirements within a first time period into the first storage space, which also helps to extend the time span of the stored image frames.

[0009] In conjunction with the first aspect, in one possible implementation, saving the second image frame that meets the image quality conditions in the first image frame to the first storage space specifically includes: when image frame f1 in each group of image frames is acquired, storing the image frame f1 in the first storage space, wherein the image frame f1 is the earliest acquired image frame in each group of image frames.

[0010] In conjunction with the first aspect, in one possible implementation, the third image frame is one of the image frames in each group that has been stored in the first storage space, and is related to image frame f. h For images belonging to the same group of image frames; after acquiring image frame f1 in each group of image frames, the method further includes: when acquiring image frame f1 in each group of image frames... h When, if the image frame f h If the image quality of the first image frame is higher than that of the third image frame, then the image frame f is used. h Overwrite the storage of the third image frame; if the image frame f h If the image quality of the image frame is lower than that of the third image frame, no operation is performed; the image frame f h It is the image frame in the h-th order of acquisition time in each group of image frames, where 2≤h≤m.

[0011] Overwrite storage can refer to deleting the original third image frame and storing the image frame f. h Store it in the first storage space.

[0012] It is understandable that if image frame f hAfter the third image frame is overwritten and stored, the third image frame corresponding to this group of image frames is updated to image frame f. h As can be seen, the above method can compare the quality of each acquired image frame with the already stored image frames in the same group, and then store the image frames with relatively higher image quality in the first storage space; so that when all the image frames in the group have been acquired, the image frame with the highest image quality in the group is stored in the first storage space.

[0013] In conjunction with the first aspect, in one possible implementation, the image frame f kh Let f represent the h-th image frame in the K-th image frame group, where K is a positive integer, h is a positive integer and h≤m; the K-th image frame group refers to a group of image frames whose acquisition time order is Kth sequentially within the first duration; the h-th image frame refers to the image frame whose acquisition time order is hth sequentially within the K-th image frame group; △ represents the image frame f. kh The difference value between the first image frame and the fourth image frame, where the fourth image frame represents the last image frame stored in the first storage space within the first time duration, and the larger the value of △, the more significant the difference between the first and fourth image frames. kh The greater the difference between the image content presented and the fourth image frame, the better; △ thrd Q is the first value; fkh The image frame f represents kh Image quality; Q thrd Q represents the quality of the first image; last The image quality of the fourth image frame is indicated; the initial value of the integer value X is w, where w is an integer.

[0014] In conjunction with the first aspect, in one possible implementation, the method of saving the second image frame that meets the image quality conditions in the first image frame to the first storage space specifically includes: when image frame f is acquired... 11 At that time, the image frame f 11 Stored in the first storage space.

[0015] In conjunction with the first aspect, in one possible implementation, the acquired image frame f 11 Subsequently, the method further includes: when the image frame f is acquired... kh When: If the image frame f kh The fourth image frame does not belong to the same group of image frames, and the △ is greater than the △. thrd The Q fkh >The Q thrd The image frame f kh Store in the first storage space.

[0016] It can be seen that in image frame fkh the difference value of the fourth image frame reaches a preset first value Δ thrd , and the image quality Q kh of the image frame f fkh is greater than the first image quality Q thrd , the electronic device stores the image frame f kh to the first storage space; while extending the time span of the stored image frames, it is beneficial to improve the image quality of the stored image frames and the difference degree between the stored image frames, avoiding repeated storage of image frames with small or no difference in image content, and effectively utilizing the storage capacity of the first storage space.

[0017] In combination with the first aspect, in a possible implementation manner, after the image frame f 11 is collected, the method further includes: when the image frame f kh is collected: if the image frame f kh and the fourth image frame do not belong to the same group of image frames, h = m, Δ ≤ Δ thrd , or Q fkh ≤ Q thrd , updating X = X + 1.

[0018] In combination with the first aspect, in a possible implementation manner, after the image frame f 11 is collected, the method further includes: when the image frame f kh is collected, if the image frame f kh and the fourth image frame belong to the same group of image frames, and Δ > Δ thrd , Q fkh > Q thrd , X > w, updating X = X - 1; and storing the image frame f kh to the first storage space.

[0019] It can be understood that when the image frame f kh is collected, in the case of X > w, it means that the number of currently stored image frames is less than K, that is, there is at least one group of image frames that has not stored image frames before the Kth group of image frames, and the storage space originally occupied by the at least one group of image frames is not occupied by other image frames; in the above case, the image frame f kh that meets the image quality condition in terms of both the difference value and the image quality is stored to the first storage space.

[0020] In combination with the first aspect, in a possible implementation manner, after the image frame f 11 is collected, the method further includes: when the image frame f kh is collected, if the image frame f kh and the fourth image frame belong to the same group of image frames, and Δ ≤ Δthrd , Q fkh > Q last , X = w, then the fourth image frame is stored in the first storage space by covering the image frame f kh .

[0021] It can be seen that in the case that the difference value between image frames is small, the image frame with the highest image quality between image frames is stored in the first storage space.

[0022] With reference to the first aspect, in a possible implementation manner, after the image frame f 11 is collected, the method further includes: when the image frame f kh is collected, if the image frame f kh and the fourth image frame belong to the same group of image frames, and X = w, Q fkh > Q last , the fourth image frame is stored in the first storage space by covering the image frame f kh .

[0023] It can be seen that in the case that X = w, the electronic device can compare the image quality between image frames in the same group of image frames, and store the image frame with higher image quality in the first storage space.

[0024] In a second aspect, the present application provides another photographing method, applied to a wireless communication system, the wireless communication system comprising a first electronic device and a second electronic device, the first electronic device and the second electronic device being communicatively connected, the first electronic device being provided with a camera; the maximum number of image frames that the first storage space of the first electronic device can store is N, N being a positive integer, the method comprising: collecting first image frames within a first time length, m consecutive first image frames collected within the first time length being a group of image frames; saving second image frames in the first image frames that meet an image quality condition to the first storage space, the image quality condition comprising: the image quality of the second image frames being higher than a first image quality, and the difference value of image content between adjacent second image frames being greater than a first value; K being a positive integer, when K is equal to 1, the number of second image frames belonging to the Kth group of image frames being equal to 1; when K is greater than or equal to 2, the number of second image frames belonging to the Kth group of image frames being less than or equal to (K-1); or, the image quality of the second image frames being the highest in the group of image frames in which the first image frames are located; wherein m is determined according to the total number F of image frames collected within the first time length and the maximum number of frames N, the total number F being the number of image frames that the first electronic device can collect within the first time length using a first frame rate; the total number F being greater than the maximum number of frames N; the second electronic device detecting a first operation, and generating a photographing instruction in response to the first operation; the second electronic device sending a first data packet to the first electronic device, the first data packet comprising the photographing instruction; the first electronic device receiving the first data packet sent by the second electronic device; the first electronic device determining Z second image frames from the second image frames saved to the first storage space according to the photographing instruction, Z being a positive integer; the first electronic device sending the Z second image frames to the second electronic device; the second electronic device receiving the Z second image frames; and the second electronic device displaying and / or storing the Z second image frames.

[0025] The first operation can be a voice operation, a touch operation, or a gesture operation.

[0026] In combination with the second aspect, in a possible implementation manner, the saving of the second image frames in the first image frames that meet the image quality condition to the first storage space specifically comprises: when an image frame f1 in each group of image frames is collected, storing the image frame f1 to the first storage space, the image frame f1 being the earliest collected image frame in the each group of image frames.

[0027] In combination with the second aspect, in a possible implementation manner, a third image frame is an image frame that has been stored to the first storage space in the each group of image frames, and is closest to the image frame f hare the same group of image frames; after the image frame f1 in each group of image frames is collected, the method further comprises: when the image frame f h is collected, if the image quality of the image frame f h is higher than that of the third image frame, the third image frame is overwritten and stored with the image frame f h ; if the image quality of the image frame f h is lower than that of the third image frame, no operation is performed; the image frame f h is an image frame sequentially collected in the hth position in each group of image frames, 2≤h≤m.

[0028] In combination with the second aspect, in a possible implementation manner, the image frame f kh represents the hth image frame in the Kth group of image frames, K is a positive integer, h is a positive integer and h≤m; the Kth group of image frames refers to a group of image frames sequentially collected in the Kth position in the first time length; the hth image frame refers to an image frame sequentially collected in the hth position in the Kth group of image frames; △ represents a difference value between the image frame f kh and a fourth image frame, the fourth image frame represents an image frame last stored in the first storage space in the first time length, the larger the value of the △ is, the greater the difference between the image frame f kh and the image content represented by the fourth image frame is; △ thrd is the first value; Q fkh represents the image quality of the image frame f kh ; Q thrd is the first image quality; Q last represents the image quality of the fourth image frame; the initialization value of the integer value X is w, and w is an integer.

[0029] In combination with the second aspect, in a possible implementation manner, the saving of the second image frame in the first image frame that meets the image quality condition to the first storage space specifically comprises: when the image frame f 11 is collected, the image frame f 11 is stored to the first storage space.

[0030] In combination with the second aspect, in a possible implementation manner, after the image frame f 11 is collected, the method further comprises: when the image frame f kh is collected: if the image frame f kh and the fourth image frame do not belong to the same group of image frames, and the △>△ thrd , the Q fkh >Q thrdstore the image frame f kh to the first storage space.

[0031] With reference to the second aspect, in a possible implementation manner, the image frame f 11 After that, the method further includes: when the image frame f kh is collected, if the image frame f kh and the fourth image frame do not belong to the same group of image frames, h = m, △ thrd or Q fkh ≤ Q thrd , the X is updated as X = X + 1.

[0032] With reference to the second aspect, in a possible implementation manner, the image frame f 11 After that, the method further includes: when the image frame f kh is collected, if the image frame f kh and the fourth image frame belong to the same group of image frames, and △ > △ thrd , Q fkh > Q thrd , X > w, the X is updated as X = X - 1; and the image frame f kh is stored to the first storage space.

[0033] With reference to the second aspect, in a possible implementation manner, the image frame f 11 After that, the method further includes: when the image frame f kh is collected, if the image frame f kh and the fourth image frame belong to the same group of image frames, and △ thrd ≤ △ fkh , Q last > Q kh , X > w, the fourth image frame is stored in the first storage space by being overwritten by the image frame f 11 .

[0034] With reference to the second aspect, in a possible implementation manner, the image frame f 11 After that, the method further includes: when the image frame f kh is collected, if the image frame f kh and the fourth image frame belong to the same group of image frames, and X = w, Q fkh > Q last , the fourth image frame is stored in the first storage space by being overwritten by the image frame f kh .

[0035] With reference to the second aspect, in a possible implementation manner, the method further includes: performing image processing on the first image frames collected in the first time length by the first electronic device to obtain fifth image frames, the storage capacity occupied by the fifth image frames being lower than the storage capacity occupied by the first image frames; at least one parameter of the fifth image frames being lower than the first image frames.

[0036] The at least one parameter can include one or more of the following: resolution, color saturation, image dynamic range, and the like. Optionally, the number of noise points of the fifth image frames is greater than that of the first image frames.

[0037] It can be seen that the first electronic device can send the fifth image frames occupying lower storage capacity to the second electronic device for preview, thereby saving data transmission amount and reducing power consumption of the first electronic device and the second electronic device.

[0038] With reference to the second aspect, in a possible implementation manner, before the first operation is detected by the second electronic device, the method further includes: sending, by the first electronic device, the fifth image frames to the second electronic device; and displaying, by the second electronic device, an image according to the received fifth image frames.

[0039] With reference to the second aspect, in a possible implementation manner, the photographing instruction includes a first time point, and the Z-frame second image frame is the Z-frame image frame closest to the first time point in the image frames stored by the first electronic device in terms of the time point of acquisition.

[0040] The first time point is calculated by the second electronic device according to a first time delay, and the first time delay includes a second time delay and / or a third time delay; the second time delay refers to a data transmission time delay between the second electronic device and the first electronic device; the third time delay refers to a time delay between a second time point and a third time point, the second time point being a time point of initiating the first operation, and the third time point being a time point of detecting the first operation by the second electronic device. The first time point is equal to the third time point minus the second time delay and the third time delay. Optionally, the third time delay can not be considered in an actual scenario, and the first time point is equal to the second time point minus the second time delay, and the second time point is both the time point of initiating the first operation and the time point of detecting the first operation.

[0041] With reference to the second aspect, in a possible implementation manner, the first time delay is included in the photographing instruction, and the first time delay is composed of a second time delay and / or a third time delay; the second time delay refers to a data transmission time delay between the second electronic device and the first electronic device; and the third time delay refers to a time delay between a second time point and a third time point, the second time point being a time point at which the first operation is initiated, and the third time point being a time point at which the second electronic device detects the first operation.

[0042] In this way, the third time delay can be preset according to data statistics. For example, the first operation is a touch operation, and the user performs the first operation. According to data statistics, it can be determined that the time from when the user initiates the touch operation to when the electronic device detects the touch operation of the user is 0.3 seconds with a high probability. Therefore, the third time delay can be set to 0.3 seconds.

[0043] With reference to the second aspect, in a possible implementation manner, the first time length T is greater than or equal to 2*T2, or T is greater than or equal to 2*T2+T3, T2 representing the second time delay and T3 representing the third time delay.

[0044] It can be seen that the electronic device can associate the first time length with the second time delay and the third time delay, and then determine the first time length.

[0045] In a third aspect, the present application provides another photographing method, applied to a second electronic device. The method comprises the following steps: detecting a first operation, and generating a photographing instruction in response to the first operation; sending a first data packet to the first electronic device, the first data packet including the photographing instruction; receiving Z frames of second image frames sent by the first electronic device, the Z frames of second image frames being determined by the first electronic device according to the photographing instruction, Z being a positive integer; displaying and / or storing the Z frames of second image frames; wherein, a time point at which the second electronic device detects the first operation is a third time point; a sixth image frame is included in the Z frames of second image frames, first time stamp is included in data of the sixth image frame, and the first time stamp includes a first time point; a time length between the first time point and the third time point is greater than or equal to a first time delay, the first time delay being equal to a second time delay, or the first time delay being equal to a sum of the second time delay and a third time delay; the second time delay refers to a data transmission time delay between the first electronic device and the second electronic device; and the third time delay refers to a time delay between a second time point and the third time point, the second time point being a time point at which the first operation is initiated.

[0046] The storage method of the image frame adopted by the first electronic device is the image frame storage method provided in the first aspect. As can be seen, the sixth image frame is included in the Z-frame second image frame received by the second electronic device, and the time length between the first time point and the third time point of the sixth image frame is greater than or equal to the first time delay. As can be seen, the time span of the image frame stored by the first electronic device is large, and can be greater than or equal to the first time delay.

[0047] In a fourth aspect, an electronic device is provided, and the electronic device includes one or more processors and a memory. The memory is coupled to the one or more processors, and the memory is configured to store computer program codes including computer instructions. The one or more processors invoke the computer instructions to cause the electronic device to perform the method in the first aspect and any possible implementation manner thereof, or the method in the second aspect and any possible implementation manner thereof, or the method in the third aspect and any possible implementation manner thereof.

[0048] In a fifth aspect, a computer program product is provided. When the computer program product is run on an electronic device, the electronic device is caused to perform the method in the first aspect and any possible implementation manner thereof, or the method in the second aspect and any possible implementation manner thereof, or the method in the third aspect and any possible implementation manner thereof.

[0049] In a sixth aspect, a computer readable storage medium is provided. The computer readable storage medium includes computer instructions. When the computer instructions are run on an electronic device, the electronic device is caused to perform the method in the first aspect and any possible implementation manner thereof, or the method in the second aspect and any possible implementation manner thereof, or the method in the third aspect and any possible implementation manner thereof. BRIEF DESCRIPTION OF DRAWINGS

[0050] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the embodiments of the present application will be described below.

[0051] Figures 1A-1B is a schematic diagram of a group of photographing scenes provided by the embodiments of the present application;

[0052] Figure 2 is a schematic diagram of a hardware structure of an electronic device provided by the embodiments of the present application;

[0053] Figure 3A is a flowchart of an image frame storage method provided by the embodiments of the present application;

[0054] Figures 3B-3C is a schematic diagram of a group of image frame storage processes provided by the embodiments of the present application;

[0055] Figure 3Dis a flowchart of another image frame storage method provided by an embodiment of the present application;

[0056] Figures 3E-3G is a schematic diagram of another set of image frame storage processes provided by an embodiment of the present application;

[0057] Figures 4A-4B is a set of possible scenario example diagrams provided by an embodiment of the present application;

[0058] Figures 5A-5B is an interaction intent of a set of photographing processes provided by an embodiment of the present application;

[0059] Figure 5C is a flowchart of a photographing method provided by an embodiment of the present application;

[0060] Figures 5D-5E is a set of possible photographing scenario example diagrams provided by an embodiment of the present application;

[0061] Figure 5F is an interaction intent of a photographing process provided by an embodiment of the present application;

[0062] Figures 5G-5I is a set of possible scenario example diagrams provided by an embodiment of the present application;

[0063] Figure 6 is a flowchart of a photographing method provided by an embodiment of the present application;

[0064] Figure 7 is a modularized schematic diagram of an electronic device provided by an embodiment of the present application. DETAILED DESCRIPTION

[0065] The terms used in the following embodiments of the present application are only for the purpose of describing particular embodiments and are not intended to be limiting of the present application. As used in the specification and the appended claims of the application, the singular forms "a," "an" and "the" are intended to include both singular and plural forms, unless the context clearly indicates otherwise. It will be further understood that the terms "and / or," as used in the specification and in the claims, are used to mean any one of the items listed or all possible combinations of the items.

[0066] Hereinafter, the terms "first", "second", etc. are used only for the purpose of description and should not be understood as suggesting or implying relative importance or implicitly indicating the number of the technical features indicated. Therefore, the features defined with "first", "second", etc. can explicitly or implicitly include one or more of the features, and in the description of the embodiments of the present application, the meaning of "a plurality of" is two or more, unless otherwise specified.

[0067] An application scenario to which embodiments of the present application can be applied is introduced below.

[0068] Please refer to Figure 1A , Figure 1A is a schematic diagram of a photographing scene provided by an embodiment of the present application. Figure 1A The electronic device 101 and the camera 102 are communicatively connected. After the camera 102 captures the first image frame, the camera 102 can process the first image frame to obtain a fifth image frame and send the fifth image frame to the electronic device 101. The electronic device 101 can display the image captured by the camera 102 on the display screen according to the fifth image frame.

[0069] In an embodiment of the present application, the storage capacity occupied by the fifth image frame is lower than the storage capacity occupied by the first image frame; at least one parameter of the fifth image frame is lower than the first image frame; the at least one parameter can be one or more of the following: resolution, color saturation, image dynamic range. Optionally, the number of noise points of the fifth image frame is greater than that of the first image frame.

[0070] In some embodiments, when the user views the image that the user wants to capture on the electronic device 101, the user can click the photographing button on the electronic device 101, and then store the corresponding image frame locally. The camera 102 transmits to the electronic device 101 in real time is the fifth image frame after image processing. Since at least one parameter of the fifth image frame is lower than the first image frame, the image quality presented by the fifth image frame is lower than that of the first image frame; therefore, when the user clicks the photographing button, the electronic device 101 needs to send a photographing instruction to the camera 102, and the camera 102 sends the second image frame to the electronic device 101 according to the photographing instruction, so that the electronic device 101 stores the second image frame, so that the image frame finally stored by the electronic device 101 is the image frame with higher image quality; the second image frame is the first image frame that meets the image quality condition selected and saved by the camera 102 from the first image frame collected by the camera 102. However, there is a communication delay between the electronic device 101 and the camera 102; there is also a certain time difference between the time when the user sees the image that the user wants to store and the time when the user clicks the photographing button, so the camera 102 needs to store and retain a certain number of image frames in advance. For example, the communication delay can be referred to in Figure 1B ; it can be seen that the screen displayed by the electronic device 101 is not synchronized with the camera 102, and the screen displayed by the electronic device 101 lags behind the screen captured by the camera 102. Figure 1B

[0071] ​In some embodiments, the main function of the camera 102 is to shoot high-definition images, the storage space of the camera 102 is configured to be small, and the frame rate of the camera 102 is high during shooting (for example, 60 frames of image frames are shot per second). If each frame of image frame is stored in the storage space, the storage space of the camera 102 will be quickly occupied, resulting in that when the camera 102 receives the shooting instruction of the electronic device 101, the image frame meeting the condition may have been deleted due to the full storage space, and the camera 102 cannot send the image frame meeting the condition to the electronic device 101. To solve the above problem, the camera 102 can store one frame of image frame every several frames of image frames, but the image frame stored every several frames of image frames may be an image frame with poor image quality or an image frame with repeated scene pictures, resulting in that the storage space cannot be effectively utilized.

[0072] The embodiment of the present application provides a kind of storage method of image frame, can effectively improve the quality of image frame stored by camera 102. Meanwhile, in some embodiments, camera 102 can reduce the storage frequency of image frame when scene picture changes little;Increase the storage frequency of image frame when scene picture changes greatly;So that the image frame finally stored in camera 102 is the image frame with large difference value between each other. It can be seen that, using the method provided by the embodiment of the present application, in the case where the storage space of camera 102 is small, the image quality stored in the storage space can be improved, and the probability of repeatedly storing the image frame of the same scene picture is reduced.

[0073] Below, the electronic device provided by the embodiment of the present application is introduced.

[0074] The electronic device can be a mobile phone, a tablet computer, a wearable device, a vehicle-mounted device, an augmented reality (AR) / virtual reality (VR) device, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, a personal digital assistant (PDA) or a dedicated camera (such as a single-lens reflex camera, a card camera), etc. The specific type of the electronic device is not limited in the present application.

[0075] Figure 2 The structure of the electronic device 100 is exemplarily shown. It should be noted that the electronic device 100 can specifically refer to Figure 1A the electronic device 101 described in the above embodiments, or Figure 1A the camera 102 described in the above embodiments. As Figure 2As shown, the electronic device 100 can have at least one camera 193, such as a front-facing camera, a wide-angle camera, an ultra-wide-angle camera, a telephoto camera, and the like. In addition, the electronic device 100 can further include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, a headset jack 170D, a sensor module 180, a key 190, a motor 191, an indicator 192, a display screen 194, and a subscriber identification module (SIM) card interface 195, and the like.

[0076] The sensor module 180 can include a pressure sensor 180A, a gyroscope sensor 180B, a barometric sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, and the like.

[0077] It can be understood that the structure shown in the embodiments of the present application does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 can include more or fewer components than shown, or combine certain components, or split certain components, or different component arrangements. The components shown can be implemented in hardware, software, or a combination of software and hardware.

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

[0079] In some embodiments, the processor 110, such as a controller or a GPU, can be configured to generate a second image frame based on data collected by the at least one camera 193 in a photographing scenario, and process the second image frame, and send a fifth image frame after image processing to another electronic device in communication connection with the electronic device 100, thereby reducing the data transmission amount and enabling the user to view the image taken by the electronic device 100 in real time on the other electronic device.

[0080] In some embodiments, the processor 110, such as a controller or a GPU, can be configured to generate a second image frame based on data collected by the at least one camera 193 in a photographing scenario, and process the second image frame, and send a fifth image frame after image processing to another electronic device in communication connection with the electronic device 100, thereby reducing the data transmission amount and enabling the user to view the image taken by the electronic device 100 in real time on the other electronic device.

[0081] In some embodiments, the processor 110, such as a controller or a GPU, can be configured to generate a second image frame based on data collected by the at least one camera 193 in a photographing scenario, and process the second image frame, and send a fifth image frame after image processing to another electronic device in communication connection with the electronic device 100, thereby reducing the data transmission amount and enabling the user to view the image taken by the electronic device 100 in real time on the other electronic device.

[0082] The controller can be the nerve center and command center of the electronic device 100. The controller can generate operation control signals according to instruction operation codes and timing signals to complete the control of instruction fetching and instruction execution.

[0083] The processor 110 can also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory can store instructions or data that have just been used or are repeatedly used by the processor 110. If the processor 110 needs to use the instructions or data again, it can directly call them from the memory. This avoids repeated access and reduces the waiting time of the processor 110, thereby improving the efficiency of the system. In a photographing scenario, the electronic device 100 is a photographing device, and the image frames obtained by the electronic device 100 are stored in the cache memory, so that when the electronic device 100 receives a photographing instruction from a second electronic device in communication connection therewith, the electronic device 100 can quickly read the image frames from the cache memory and send the image frames to the second electronic device.

[0084] The wireless communication function of the electronic device 100 can be realized by the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor, and the baseband processor, etc.

[0085] The antenna 1 and the antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in the electronic device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be multiplexed to improve the utilization rate of the antennas. For example, the antenna 1 can be multiplexed as a diversity antenna for a wireless local area network. In some other embodiments, the antenna can be used in combination with a tuning switch.

[0086] The mobile communication module 150 can provide a solution for wireless communication including 2G / 3G / 4G / 5G, etc. applied to the electronic device 100. The mobile communication module 150 can include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 150 can receive an electromagnetic wave by the antenna 1, and perform filtering, amplification, etc. on the received electromagnetic wave, and transfer the processed signal to the modem processor to be demodulated. The mobile communication module 150 can also amplify a signal modulated by the modem processor, and radiate the signal as an electromagnetic wave through the antenna 1.

[0087] The wireless communication module 160 can provide a solution for wireless communication including wireless local area networks (WLAN) (e.g., wireless fidelity (Wi-Fi) network), bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR) technology, etc. applied to the electronic device 100. The wireless communication module 160 can be one or more devices integrated with at least one communication processing module. The wireless communication module 160 receives an electromagnetic wave via the antenna 2, performs frequency modulation and filtering on the electromagnetic wave signal, and transmits the processed signal to the processor 110. The wireless communication module 160 can also receive a signal to be transmitted from the processor 110, perform frequency modulation and amplification thereon, and radiate the signal as an electromagnetic wave through the antenna 2.

[0088] In some embodiments, the antenna 1 and the mobile communication module 150 of the electronic device 100 are coupled, and the antenna 2 and the wireless communication module 160 are coupled, so that the electronic device 100 can communicate with a network and other devices through wireless communication technology. The wireless communication technology can include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technology, etc. The GNSS can include a global positioning system (GPS), a global navigation satellite system (GLONASS), a beidu navigation satellite system (BDS), a quasi-zenith satellite system (QZSS), and / or a satellite based augmentation systems (SBAS).

[0089] The internal memory 121 can include one or more random access memories (RAMs) and one or more non-volatile memories (NVMs).

[0090] The random access memory can include static random-access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM, such as the fifth generation of DDR SDRAM commonly referred to as DDR5 SDRAM), and the like.

[0091] The non-volatile memory can include a magnetic disk storage device, flash memory.

[0092] The flash memory can include NOR FLASH, NAND FLASH, 3D NAND FLASH, and the like according to the operating principle, single-level cell (SLC), multi-level cell (MLC), triple-level cell (TLC), quad-level cell (QLC), and the like according to the storage unit potential order, and universal flash storage (UFS), embedded multi media Card (eMMC), and the like according to the storage specification.

[0093] The random access memory can be directly read and written by the processor 110, and can be used to store executable programs (such as machine instructions) of an operating system or other programs running, and can also be used to store data of users and application programs, and the like.

[0094] The non-volatile memory can also store executable programs and store data of users and application programs, and the like, which can be loaded in advance into the random access memory for direct reading and writing by the processor 110.

[0095] The external memory interface 120 can be used to connect an external non-volatile memory to realize the expansion of the storage capacity of the electronic device 100. The external non-volatile memory communicates with the processor 110 through the external memory interface 120 to realize the data storage function. For example, files such as music and videos are saved in the external non-volatile memory.

[0096] In some embodiments, the internal memory 121 can be used to store image frames, the electronic device 100 can mark a plurality of storage bits in the internal memory 121, and then determine the maximum frame storage amount according to the storage bits, so as to reasonably configure the storage strategy of the electronic device 100, store the image frames meeting the conditions, and then meet the user's viewing and browsing requirements for images in different scenarios.

[0097] The pressure sensor 180A is used to sense a pressure signal, and can convert the pressure signal into an electrical signal. In some embodiments, the pressure sensor 180A can be disposed on the display screen 194. There are many types of pressure sensors 180A, such as resistive pressure sensors, inductive pressure sensors, capacitive pressure sensors, etc. The capacitive pressure sensor can include at least two parallel plates made of conductive material. When a force acts on the pressure sensor 180A, the capacitance between the electrodes changes. The electronic device 100 determines the intensity of the pressure according to the change of the capacitance. When a touch operation acts on the display screen 194, the electronic device 100 detects the intensity of the touch operation according to the pressure sensor 180A. The electronic device 100 can also calculate the position of the touch according to the detection signal of the pressure sensor 180A.

[0098] The ambient light sensor 180L is used to sense the brightness of ambient light. The electronic device 100 can adaptively adjust the brightness of the display screen 194 according to the sensed brightness of the ambient light. The ambient light sensor 180L can also be used to automatically adjust the white balance when taking pictures. The ambient light sensor 180L can also cooperate with the proximity light sensor 180G to detect whether the electronic device 100 is in the pocket to prevent false touch.

[0099] The fingerprint sensor 180H is used to collect fingerprints. The electronic device 100 can use the collected fingerprint characteristics to realize fingerprint unlocking, access application lock, fingerprint photographing, fingerprint answering incoming calls, etc.

[0100] The touch sensor 180K, also known as a "touch panel". The touch sensor 180K can be disposed on the display screen 194, and the touch sensor 180K and the display screen 194 form a touch screen, also known as a "touch screen". The touch sensor 180K is used to detect touch operations acting on or near it. The touch sensor can transmit the detected touch operation to the application processor to determine the type of touch event. The visual output related to the touch operation can be provided through the display screen 194. In other embodiments, the touch sensor 180K can also be disposed on the surface of the electronic device 100, which is different from the position of the display screen 194.

[0101] The key 190 includes a power-on key, a volume key, etc. The key 190 can be a mechanical key. It can also be a touch key. The electronic device 100 can receive key input and generate key signal input related to user settings and function control of the electronic device 100.

[0102] The electronic device 100 can implement the photographing function through an ISP, a camera 193, a video codec, a GPU, a display 194, and an application processor, etc.

[0103] The ISP is used to process the data fed back by the camera 193. For example, when taking a photo, the shutter is opened, the light is transmitted to the camera photosensitive element through the lens, the light signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to the ISP for processing, and the image visible to the naked eye is converted. The ISP can also optimize the algorithm of the noise, brightness, and skin color of the image. The ISP can also optimize the exposure, color temperature, and other parameters of the shooting scene. Not limited to being integrated in the processor 110, the ISP can also be arranged in the camera 193.

[0104] In the embodiment of the present application, the camera 193 transmits the electrical signal to the ISP for processing, and the ISP generates an image frame after optimization processing.

[0105] In some embodiments, the electronic device 100 can specifically refer to a camera 102 in the electronic device 100; the ISP can timestamp the image frame, so that the electronic device 100 sends the fifth image frame after image processing to the electronic device 101, and after the electronic device 101 transmits the photographing instruction containing the above-mentioned timestamp to the electronic device 100, the electronic device 100 can determine at least one second image frame according to the timestamp, and then the electronic device 100 can send the at least one second image frame to the electronic device 101. Figure 1A

[0106] The camera 193 includes a lens and a photosensitive element (also known as an image sensor), which is used to capture a still image or a video. The object generates an optical image through the lens and projects it onto the photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the light signal into an electrical signal, and then transmits the electrical signal to the ISP to convert it into a digital image signal, such as a standard RGB, YUV, etc. image signal, and finally stores or sends it in the form of an image frame.

[0107] The hardware configuration and physical location of the camera 193 can be different, so the size, range, content, or clarity of the image captured by the camera can be different.

[0108] ​The output image size of the camera 193 can be different or the same. The output image size of the camera refers to the length and width of the image captured by the camera. Both the length and the width of the image can be measured in terms of the number of pixels. The output image size of the camera can also be referred to as the image size, the image dimension, the pixel size, or the image resolution. Common output image ratios of the camera can include 4:3, 16:9, or 3:2, and the like. The output image ratio refers to the approximate ratio of the number of pixels in the length and the width of the image captured by the camera.

[0109] The cameras 193 can correspond to the same focal length or different focal lengths. The focal length can include, but is not limited to, a first focal length less than a preset value 1 (for example, 20 mm), a second focal length greater than or equal to the preset value 1 and less than or equal to a preset value 2 (for example, 50 mm), and a third focal length greater than the preset value 2. The camera corresponding to the first focal length can be referred to as a super wide-angle camera, the camera corresponding to the second focal length can be referred to as a wide-angle camera, and the camera corresponding to the third focal length can be referred to as a telephoto camera. The larger the focal length corresponding to the camera, the smaller the field of view (FOV) of the camera. The field of view refers to the angle range that can be imaged by the optical system.

[0110] The cameras 193 can be arranged on both sides of the electronic device. The camera arranged on the same plane as the display 194 of the electronic device can be referred to as a front-facing camera, and the camera arranged on the plane of the back cover of the electronic device can be referred to as a rear-facing camera. The front-facing camera can be used to capture the image of the photographer facing the display 194, and the rear-facing camera can be used to capture the image of the object (such as a person or a landscape) facing the photographer.

[0111] In some embodiments, the camera 193 can be used to capture depth data. For example, the camera 193 can have a time of flight (TOF) 3D sensing module or a structured light 3D sensing module to obtain depth information. The camera used to capture depth data can be a front-facing camera or a rear-facing camera.

[0112] A video codec is used to compress or decompress digital images. The electronic device 100 can support one or more image codecs. In this way, the electronic device 100 can open or save pictures or videos in multiple encoding formats.

[0113] The electronic device 100 can implement a display function through a GPU, a display screen 194, and an application processor, etc. The GPU is a microprocessor for image processing, connecting the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 can include one or more GPUs that execute program instructions to generate or change display information.

[0114] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. The display panel can adopt a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light emitting diode (AMOLED), a flex light-emitting diode (FLED), a Miniled, a MicroLed, a Micro-oLed, a quantum dot light emitting diodes (QLED), etc. In some embodiments, the electronic device 100 can include one or more display screens 194.

[0115] In some embodiments, the electronic device can store a frame of image frames at an interval of a time duration or a certain number of frames, so as to prolong the time span corresponding to all the image frames stored by the electronic device. For example, if the electronic device stores each frame of image frames obtained by shooting in the electronic device, the local storage medium of the electronic device is full in one day, that is, the time span corresponding to all the image frames stored by the electronic device is one day. If the electronic device stores a frame of image frames at an interval of a frame of image frames, the local storage medium of the electronic device is full in two days, that is, the time span corresponding to all the image frames stored by the electronic device is two days. When the electronic device adopts the strategy of storing a frame of image frames at an interval of a certain time duration or a certain number of frames, because the quality of the image frames shot by the electronic device at some time points is poor and the quality of the image frames shot at some time points is good, the electronic device may store the image frames with poor quality into the electronic device without storing the image frames with good quality into the electronic device, so that the quality of the image presented to the user for viewing and browsing according to the image frames is poor, and the user experience is poor.

[0116] The following embodiments introduce an image frame storage method provided by the embodiments of the present application. As shown in Figure 3A the method can include:

[0117] In S101, the electronic device acquires photographing configuration information and available storage capacity of a first storage space of the electronic device.

[0118] The photographing configuration information can include the following information: image resolution, format, and photographing frame rate.

[0119] The first storage space of the electronic device can be a cache, an internal memory, and an external memory. Specifically, the available storage capacity in this embodiment of the present application can represent the capacity that can be used in any one of the above storage media in a specific application scenario. For example, the available storage capacity can represent the capacity that can be used in the cache of the electronic device.

[0120] In S102, the electronic device determines a maximum frame number N according to the photographing configuration information and the available storage capacity.

[0121] The electronic device can calculate an estimated value of the storage capacity occupied by one image frame according to the image resolution and the format in the photographing configuration information. Specifically, the estimated value can be equal to the value of the maximum storage capacity occupied by one image frame. For example, if the electronic device occupies a maximum of 10 MB of capacity for one image frame under the current configuration condition, the electronic device can set the estimated value to be equal to 10 MB. Then, the electronic device determines the maximum frame number N that can be stored in the first storage space according to the estimated value and the available storage capacity. Specifically, the maximum frame number is equal to the available storage capacity divided by the estimated value.

[0122] In S103, the electronic device determines a total number F according to a first frame rate R and a first time length T in the photographing configuration information.

[0123] The first frame rate R can be a pre-set frame rate for collecting image frames.

[0124] The first time length T can be set by a user on the electronic device. For example, the user can set the first time length to be one day, which means that when the user views the images on the electronic device, the user hopes to view the images captured by the electronic device in one day. Therefore, the electronic device stores the image frames in the time length of one day before the current time point when storing the image frames.

[0125] Specifically, the total number F represents the total number of image frames collected and generated by the electronic device in the first time length at the first frame rate. Specifically, the total number F is equal to the product of the first frame rate R and the first time length T, F=T×R. For example, when the electronic device starts the photographing mode, if the first frame rate R of the electronic device is 30 (Frames Per Second, Fps), that is, the number of image frames collected and generated by the electronic device per second is 30, and the current first time length T is 10 seconds, then F=T×R=10×30=300.

[0126] S104, the electronic device determines a first number m according to the maximum frame number N and the total number F.

[0127] Specifically, the specific calculation formula of the first number m can be: m=F÷N, m is an integer greater than or equal to 2.

[0128] S105, the electronic device sets m frames of the first image frames as a group of image frames.

[0129] Specifically, please refer to Figure 3B , Figure 3B is a schematic diagram of an image frame storage process provided by an embodiment of the present application, Figure 3B illustrates a time axis and the storage of image frames in the first storage space over time, for better understanding Figure 3A the image frame storage method shown in the figure, Figure 3B the first storage space is divided into N storage positions, i.e. c1, c2, c3…c (N-1) , c N ; it should be noted that the marking of the storage positions in the first storage space is not necessary when the electronic device executes the image frame storage method of the present application, and the marking in the figure is for better explanation and description of the present application. The number of storage positions in the present application is equal to the maximum frame number N. In the example shown in Figure 3B , m=4, i.e. every 4 frames of the first image frames are a group.

[0130] Optionally, since the photographing frame rate of the electronic device is fixed, the electronic device can set the first image frames in a period of time as a group, such as Figure 3B shown, the electronic device can set the image frames in a period of t j long as a group of first image frames, t j =t N -t (N-1) , N is a positive integer and N is greater than or equal to 1. It can be seen that, in the case where the frame rate of the electronic device is unchanged, the electronic device sets the first image frames in a period of time as a group, which is equivalent to setting m frames of the first image frames as a group of image frames, so the two ways are only different in form, the core idea is the same, and both belong to the scope protected by the present application.

[0131] S106, the electronic device determines a first number m according to the maximum frame number N and the total number F.

[0132] wherein a group of image frames includes m frames of the first image frames, i.e. a group of image frames includes: f1, f2, … f m, m is an integer greater than or equal to 2; the electronic device determines a second image frame in each group of image frames that meets an image quality condition, specifically including: performing a preset operation on each group of image frames to determine the second image frame.

[0133] Wherein, the image quality condition is pre-set by the electronic device, or the user inputs the screening condition into the electronic device, specifically, the image quality condition can be: determining the image frame with the highest image quality in each group of image frames.

[0134] Specifically, the preset operation includes the steps of s11-s12:

[0135] s11: store the image frame f1 in each group of image frames to the first storage position.

[0136] Wherein, the first storage position is the storage position corresponding to each group of image frames where the image frame f1 is located. The image frame f1 is the image frame earliest captured by the electronic device in each group of image frames.

[0137] s12: when the electronic device captures the image frame f h , if the image quality of the image frame f h is greater than the image quality of the image frame stored in the first storage position, update the image frame stored in the first storage position to the image frame f h ; wherein, 2≤h≤m; if the image quality of the image frame f h is less than or equal to the image quality of the image frame stored in the first storage position, do not perform any operation.

[0138] Specifically, the electronic device can generate a quality evaluation value of the image frame, and the electronic device can compare the size of the quality evaluation value, the larger the quality evaluation value of the image frame, the higher the image quality; the smaller the quality evaluation value of the image frame, the lower the corresponding image quality. It should be noted that the evaluation standard of image quality needs to be set according to the specific electronic device and the actual use scene from at least one dimension, for example, from the resolution, color saturation, image dynamic range, noise number and other dimensions; Therefore, the evaluation standard of image quality is not limited in the embodiment of the application.

[0139] The following will be illustrated by taking the image frame storage method shown in Figure 3B and Figure 3C for Figure 3A .

[0140] The electronic device first calculates an estimated value of the storage capacity occupied by a frame of image according to the current photographing configuration information, and then calculates the maximum frame storage N according to the estimated value and the size of the first storage space. Specifically, if the estimated value of the storage capacity occupied by a frame of image is 10MB, and the size of the first storage space of the electronic device is 9000MB, then the maximum frame storage N = 9000 ÷ 10 = 900, that is, the electronic device can store a maximum of 900 frames of image; if the frame rate R in the photographing configuration information is 60Fps, and the first time length T is 60s, then the electronic device determines that the total number F = 60 x 60 = 3600; the electronic device calculates m = 3600 ÷ 900 = 4; and the electronic device determines that 4 frames of image form a group of image frames. As shown in Figure 3B , if f1, f2, f3, and f4 are a group of image frames, the electronic device first stores the image frame f1 in the c1 storage bit in the storage medium, when the image frame f2 arrives, the electronic device compares the image quality of the image frame f2 with the image quality of the image frame f1 stored in the c1 storage bit, if the image quality of the image frame f2 is higher than that of the image frame f1 stored in the c1 storage bit, the electronic device updates the image frame stored in the c1 storage bit to the image frame f2, if the image quality of the image frame f2 is lower than that of the image frame f1 stored in the c1 storage bit, the electronic device does not perform any operation; when the image frame f3 arrives, similarly, the image quality of the image frame f3 is compared with the image quality of the image frame stored in the c1 storage bit, and whether the image frame f3 is used to update the image stored in the c1 storage bit is determined according to the comparison result; similarly, when the image frame f4 arrives, the operation as when the image frame f2 arrives and the image frame f3 arrives is repeated; as can be seen, through the above operation, the electronic device can finally store the image frame with the highest image quality in f1, f2, f3, and f4 into the c1 storage bit.

[0141] Please refer to Figure 3C , Figure 3C is Figure 3B a possible schematic diagram of a group of image frames in the storage process when the image frames f1 and f2 arrive; when the image frame f1 arrives, the electronic device stores the image frame f1 in the c1 storage bit in the storage medium, when the image frame f2 arrives, the electronic device can generate the image quality Q f1 corresponding to the image frame f1 and the image quality Q f2 corresponding to the image frame f2, then the electronic device determines whether Q f2 is greater than Q f1 , if Q f2 > Q f1 , the image frame f2 is overwritten and written into the c1 storage bit; if Q f2 ≤ Q f1 , no operation is performed; similarly, the above operation is performed for the image frame f3 and the image frame f4, and the image frame with the highest image quality in the group of image frames can be selected.

[0142] It can be seen that the above operation can screen out the image frame with the highest image quality in each group of image frames, and store the image frame with the highest image quality in the c1 storage bit. By repeating the above operation, the image frame with the highest image quality in each group of image frames can be stored in the storage medium, so that the electronic device can prolong the time span of the stored image frames (specifically, in the above example, if the electronic device stores each frame of the captured image frame in the storage medium, the electronic device can only store the image frames within 15 seconds, and by implementing the method in the present application, the electronic device can store the image frames within 60 seconds), improve the image quality of the stored image frames, and further improve the user's experience of browsing images through the electronic device.

[0143] The following embodiment introduces another image frame storage method provided by the present embodiment. As shown in the following Figure 3D The method can include:

[0144] S201, the electronic device obtains photographing configuration information and the available storage capacity of the first storage space of the electronic device.

[0145] The explanation of the photographing configuration information can refer to the related description of S101, which will not be repeated here.

[0146] S202, the electronic device determines the maximum frame number N according to the photographing configuration information and the available storage capacity.

[0147] The electronic device can be provided with a cache, an internal memory, and an external memory. Specifically, the available storage capacity in the present application can represent the capacity that can be used in any of the above storage media according to the application scenario, for example, the available storage capacity can represent the capacity that can be used in the cache of the electronic device.

[0148] S203, the electronic device determines the total number F according to the first frame rate R and the first time length T in the photographing configuration information.

[0149] The explanation of the total number F can refer to the related description of S103, which will not be repeated here.

[0150] S204, the electronic device determines the first value m according to the maximum frame storage amount N and the total number F.

[0151] The explanation of the first value can refer to S104.

[0152] S205, the electronic device sets every m frames of image frames in the first time length T as a group, obtains N groups of image frames, and marks N storage bits in the first storage space.

[0153] S206, when the electronic device is in the shooting mode, initializing an integer value X = w; updating X = X + 1 when the value of X is not stored in the storage bit in a group of image frames; w can be any integer. Specifically, w can be 0.

[0154] Specifically, "X = X + 1" means that the updated value of X is 1 more than the value of X before the update.

[0155] For example, if the first group of image frames has image frames stored in the storage bit, X remains unchanged, X = w; if the second group of image frames has no image frames stored in the storage bit, X is updated to X = X + 1 = w + 1. The case of decreasing X will be described later.

[0156] S207, the electronic device obtains an image frame f 11 After that, the image frame f 11 is stored in the c1 storage bit, and c last = c1, Q last represents the quality evaluation value of the image frame stored in the c last storage bit.

[0157] Wherein, the image frame f 11 represents the first image frame in the first group of image frames, and the N storage bits are c1, c2, c3…c (N-1) . N

[0158] S208, the electronic device obtains an image frame f kh After that, the quality evaluation value Q fkh of the image frame f kh and the difference value Δ between the image frame f kh and the third image frame are calculated, wherein the difference value Δ is used to represent the difference between the image frame f kh and the third image frame; the third image frame is the image frame stored in the c last storage bit.

[0159] In the embodiment of the application, the greater the difference value Δ between two image frames, the smaller the similarity of the image content of the two image frames.

[0160] Wherein, the image frame f kh represents the hth image frame in the kth group of image frames.

[0161] ​Specifically, the electronic device comprises an image quality evaluation module and an image difference comparison module; when the electronic device inputs an image frame into the image quality evaluation module, the image quality evaluation module can output a quality evaluation value of the image frame, and the higher the quality evaluation value is, the higher the quality of the image presented according to the image frame is; when the electronic device inputs two image frames into the image difference comparison module, the image difference comparison module can output a difference value between the two image frames, and the greater the difference value between the two image frames is, the greater the difference between the two image frames is.

[0162] S209, if the third image frame and the image frame f kh do not belong to the same group of image frames, and △>△ thrd , Q fkh >Q thrd , then update last=last+1, and store the image frame f kh to c last storage bit.

[0163] wherein, △ thrd is a threshold value corresponding to a preset difference value, Q thrd is a threshold value corresponding to a preset image quality value.

[0164] wherein, update last=last+1, that is, the electronic device simultaneously updates c last and Q last , that is, c last =c last+1 , Q last =Q last+1 =Q fkh .

[0165] For example, please refer to Figure 3E , Figure 3E is a schematic diagram of a possible image frame storage process provided by an embodiment of the present application; Figure 3E In the figure, before the image frame f 31 arrives, the c1 storage bit stores the image frame f 13 , at this time, c last =c1, the third image frame is the image frame f 13 , and since none of the group of image frames generated by the electronic device between t1 and t2 is stored into the storage medium, at this time, X=w+1; when the image frame f 31 arrives, the electronic device determines that the image frame f 31 does not belong to the same group as the image frame f 13 stored in c1; then the electronic device calculates the quality evaluation value Q 31 of the image frame f f31 , and the difference value △ between the image frame f 31 and the image frame f 13 ; after that, the electronic device judges △ and Qf31 Does △ > △ thrd Q f31 >Q thrd Under the above conditions, the electronic device updates last = 2, i.e., c. last =c2; Set image frame f 31 Store to memory location c2. See also... Figure 4A , Figure 4A This is one possible scenario example from the examples above. Figure 4A It includes image P1 and image P2, where image P1 can be the aforementioned image frame f. 13 The corresponding image, image P2, can be the aforementioned image frame f. 31 The corresponding image frame; the person in image P2 has moved a larger distance compared to the person in image P1, therefore P2 has a larger difference from P1, and the image quality of image P2 meets the preset image quality standard, so the electronic device will display the image frame f corresponding to image P2. 31 Store in storage location c2.

[0166] S210, if the third image frame and image frame f kh They belong to the same group of image frames, and △ > △ thrd Q fkh >Q thrd If X > w, then update last = last + 1, X = X - 1; change the image frame f. kh Store to c last Storage location.

[0167] Here, "X = X - 1" means that the updated value of X is the value of X before the update minus 1.

[0168] For example, please refer to Figure 3F , Figure 3F This is a schematic diagram of a possible image frame storage process provided in an embodiment of this application; (Continued) Figure 3E The example shown; when image frame f 32 Upon arrival, the electronic device first determines the image frame f 32 Image frame f stored in c2 31 These belong to the same group of image frames; then, the electronic device detects the value of X, at which point X = w + 1 > w, and the electronic device calculates the image frame f. 32 With image frame f 31 The difference value △ and image frame f between them 32 Quality assessment value Q f32 Then, the electronic device determines △ and Q. f32 Does △ > △ thrd Q f32 >Q thrd In △>△thrd , Q f32 > Q thrd , the electronic device updates X = X - 1 = w - 1 = w, last = 3, i.e., c last = c3; meanwhile, the image frame f 32 is stored to the c3 storage position. Please refer to Figure 4A , Figure 4A is a possible scenario in the above example, Figure 4A includes the image P1 and the image P2, the image P1 can correspond to the image frame f 31 , and the image P2 can correspond to the image frame f 32 . The image P2 is quite different from the image P1, and the image quality of the image P2 meets the preset image quality standard. Therefore, in the case of X > w, the image frame f 32 is stored to the c3 storage position.

[0169] S211, if the third image frame and the image frame f kh belong to the same group of image frames, and X = w, Q fkh > Q last , the electronic device overwrites the image frame f kh to the c last storage position.

[0170] For example, please refer to Figure 3G , Figure 3G is a possible image frame storage example provided by the embodiment of the application, which continues the example shown in Figure 3F . When the image frame f 33 comes, the electronic device first determines that the image frame f 33 and the image frame f 32 stored in the c3 storage position belong to the same group of image frames, and then the electronic device detects the value of X, which is X = w at this time. The electronic device calculates the quality evaluation value Q 33 of the image frame f f33 and the quality evaluation value Q 32 of the image frame f f32 , and then determines whether Q f33 is greater than Q f32 . If yes, the image frame f 33 is overwritten to the c3 storage position. Please refer to Figure 4B , Figure 4B is a possible scenario in the above example, Figure 4B includes the image P1 and the image P2, the image P1 can be the image presented by the image frame f 32 , and the image P2 can be the image presented by the image frame f 33The presented image, due to the blur of the figure in the image P1, the electronic device can determine that the image quality of the image P2 is higher than that of the image P1, and thus the electronic device can update the image P1 stored in the c3 storage bit to the image P2.

[0171] Optionally, if the third image frame and the image frame f kh belong to the same group of image frames, and △≤△ thrd , Q fkh > Q last , X > w, the electronic device stores the image frame f kh in the c last storage bit.

[0172] It can be seen that Figure 3A the image frame storage method shown in the image frame storage method improves the time span of the image frame stored by the electronic device, and is beneficial to improve the quality of the stored image frame. Figure 3B The image frame storage method shown in the image frame storage method improves the time span of the image frame stored by the electronic device, and is beneficial to improve the quality of the stored image frame. Figure 3A The image frame storage method shown in the image frame storage method improves the time span of the image frame stored by the electronic device, and is beneficial to improve the quality of the stored image frame. The above method can be applied to supermarkets, streets and other electronic devices that need to store captured images. For example, a camera is installed on a remote street. Due to the limitation of conditions, the camera can only store image frames to the local storage. Since the current camera captures high-definition images, if the camera continuously captures image frames and stores them in the storage, the storage will be full in a week. If the user wants to extend the time span of storing image frames and effectively use the storage space of the camera to store more high-quality image frames, the method shown in the image frame storage method can be used according to the specific circumstances. Figure 3A or Figure 3B The method shown in the image frame storage method.

[0173] In some embodiments, the first electronic device can be in communication connection with the second electronic device, and the first electronic device is an electronic device with a camera. The first electronic device can obtain data information through the camera, generate a first image frame, and then perform image processing on the first image frame to obtain a fifth image frame. The fifth image frame is sent to the second electronic device in real time, and the first electronic device stores the first image frame meeting the condition in the local storage space. In the case that the cache is full, the image frame stored in the cache for the longest time is deleted. Figure 5AIt is explained that the user can view the fifth image frame obtained by image processing and transmitted by the first electronic device in real time on the second electronic device; when the user wants to save the first image frame f1 corresponding to the fifth image frame f1 displayed on the display interface at t1 moment, the user can click the photographing key on the second electronic device, the second electronic device generates a photographing instruction in response to the user's click operation, and sends the photographing instruction to the first electronic device; the first electronic device receives the photographing instruction sent by the second electronic device at t2 moment, and then determines the first image frame f1 stored at t0 moment according to the photographing instruction, and sends the first image frame f1 to the second electronic device, so that the second electronic device can store the first image frame f1 without image processing. However, in actual scenarios, the quality of the second electronic device is high, the storage capacity occupied by the image frame obtained by shooting is large, and since the main function of the first electronic device is to shoot images, the storage space is small, which may have deleted the first image frame f1 from the storage space when the first electronic device receives the photographing instruction, so that the first electronic device cannot send the first image frame f1 to the second electronic device, so that the second electronic device cannot receive and save the first image frame without image processing and high quality, which affects the user experience; the following will be described in combination with Figure 5B The interaction process between the second electronic device and the first electronic device is described as follows. Figure 5B As shown in the figure, at t2 moment, the second electronic device displays the image presented by the fifth image frame f1 processed by the first image frame f1 on the display screen, when the second electronic device detects the first operation of the user at t2 moment, the second electronic device sends a photographing instruction to the first electronic device, and the first electronic device receives the photographing instruction at t3 moment; the first electronic device has cached the image frames between t1 moment and t3 moment at t3 moment, and the image frames cached before t1 moment have been deleted due to insufficient available storage capacity in the storage medium; the first image frame f1 is stored in the storage medium by the first electronic device at t0 moment, therefore, the first electronic device cannot send the first image frame f1 to the second electronic device, and the first electronic device can only send the eighth image frame f2 corresponding to t1 moment to the second electronic device, since there is a certain time difference between the second image frame f1 and the eighth image frame f2, therefore, the eighth image frame f2 may not meet the user's viewing and browsing requirements.

[0174] The following embodiment introduces a photographing method provided by the embodiment of the application. Please refer to Figure 5C , Figure 5Cis a flowchart of a photographing method provided by an embodiment of the present application, and is applied to a second electronic device; the second electronic device is in communication connection with a first electronic device; the first electronic device is provided with a camera; the first electronic device obtains a first image frame by photographing in a case where a photographing function is turned on and the first electronic device is in communication connection with the second electronic device; the first electronic device obtains a fifth image frame by processing the first image frame; the fifth image frame is transmitted to the second electronic device in real time; the storage capacity occupied by the fifth image frame is lower than the storage capacity occupied by a second image frame; at least one parameter of the fifth image frame is lower than the second image frame; the at least one parameter can include one or more of the following: resolution, color saturation, and image dynamic range; the first electronic device can store the second image frame in a first storage space of the first electronic device; the second image frame is the first image frame that meets an image quality condition; the method comprises the following steps:

[0175] S301, the second electronic device detects a first operation of a user, and generates a photographing instruction in response to the first operation.

[0176] In the method, the second electronic device displays an image in real time on a display screen according to the compressed image frame sent by the first electronic device; when the user views an image that the user wants to photograph, the user can perform the first operation to make the second electronic device generate the photographing instruction; specifically, the first operation can be touch of the display screen, voice control, or gesture operation; the first operation is used to save the image frame corresponding to the current displayed image.

[0177] S302, the second electronic device sends a first data packet to the first electronic device, and the first data packet includes the photographing instruction.

[0178] In the method, the first electronic device can determine at least one second image frame according to the photographing instruction.

[0179] Optionally, the first data packet can further include a first time delay, the first time delay includes a second time delay and a third time delay; the second time delay represents a time delay of the entire data transmission process between the second electronic device and the first electronic device; specifically, the second time delay represents a data transmission time delay between devices; the third time delay represents a time length between a second time point and a third time point; the second time point represents a time point at which the first operation is initiated; the third time point represents a time point at which the electronic device detects the first operation; the electronic device can subtract the second time delay and the third time delay from the third time point to calculate a first time point; and the electronic device can determine at least one image frame stored in the first storage space and closest to the first time point as the at least one second image frame. Figure 5D , Figure 5D The second time point can represent a time point at which the user initiates the first operation; at this time, the hand on the left side of the figure is at a certain distance from the terminal; please refer to Figure 5E , Figure 5EThe third time point can represent that the left hand in the figure has moved to the display screen of the second electronic device, and the touch operation is realized; specifically, the second time delay needs to be calculated according to the specific situation between the electronic devices, and the specific calculation method can be: the second electronic device sends a data packet with a time stamp to the first electronic device or the first electronic device sends a data packet with a time stamp to the second electronic device, and the first electronic device or the second electronic device determines the data transmission delay between each other according to the time point of receiving the data packet and the time stamp in the data packet; the third time delay needs to be determined according to a large amount of data statistics to determine the experience value corresponding to the first operation. Different types of first operations correspond to different experience values, for example Figure 5D and Figure 5E In the first operation in the first operation is a touch operation, if a large amount of data statistics, the time between the user seeing the image frame that wants to store and the electronic device detecting the touch operation of the user is 0.3 seconds Probability greater than a predetermined probability threshold (the predetermined probability threshold can be set according to the actual situation, for example, the predetermined probability threshold can be set to 0.5), then the experience value corresponding to the touch operation is 0.3 seconds, and the third time delay is equal to 0.3 seconds; in the case of voice control as the first operation, if a large amount of data statistics, the time between the user issuing a voice instruction and the electronic device detecting the voice instruction is 1 second Probability greater than a predetermined probability threshold, then the experience value of the voice control is 1 second, and the third time delay is equal to 1 second. Please refer to Figure 5F , Figure 5FIn the above description, t0 is the first time point, which means the time point at which the first electronic device captures and stores the first image frame (i.e., the second image frame f2) meeting the image quality condition, and t0 can also mean the time point at which the first electronic device performs image processing on the second image frame f2 to obtain the fifth image frame f2 and sends the fifth image frame f2 to the second electronic device; t1 represents the second time point, which means the time point at which the user initiates the first operation; t2 represents the third time point, which means the time point at which the second electronic device detects the first operation; t3 represents the time point at which the first electronic device receives the first data packet and the first electronic device sends at least one second image frame to the second electronic device; it can be understood that, in an actual scenario, the time point at which the first electronic device receives the first data packet and the time point at which the first electronic device sends at least one second image frame to the second electronic device are not the same time point, because the first electronic device needs to process and analyze the first data packet; however, the entire process of analysis and processing takes a very short time, which is ignored in the calculation process in this example, and if the transmission delay of this part is introduced, it should also be within the protection scope of the embodiments of the present application; t4 represents the time point at which the second electronic device receives at least one second image frame; the time length between t0 and t1, the time length between t2 and t3, and the time length between t3 and t4 can be regarded as the second time delay, i.e., the data transmission time delay between the second electronic device and the first electronic device; the time length between t1 and t2 can be regarded as the third time delay, i.e., the time delay from the time point at which the first operation is initiated to the time point at which the second electronic device detects the first operation.

[0180] S303, the second electronic device receives at least one second image frame sent by the first electronic device.

[0181] It should be noted that the first electronic device can determine the fourth image frame according to the first time delay in the first data packet, and at least one second image frame can be composed of the seventh image frame and Y image frames before and / or after the seventh image frame, Y being a positive integer. Please refer to Figure 5F , Figure 5F In the above description, the first electronic device determines that the image frame that the user wants to store is most likely the seventh image frame f2 stored at t0 according to the data in the first data packet; then, the first electronic device determines that the seventh image frame f2 and the image frames f1 and f3 before and after the seventh image frame f2 together constitute three second image frames; then, the first electronic device sends the three second image frames to the second electronic device.

[0182] S304, if the number of image frames of at least one second image frame is equal to one, the second electronic device displays and / or stores at least one second image frame.

[0183] S305, if the number of the at least one second image frame is greater than one, the second electronic device displays the at least one second image frame on the display screen; and detects a second operation of the user, and in response to the second operation, displays and / or stores a ninth image frame in the at least one second image frame.

[0184] The second operation is used to select the ninth image frame from the at least one second image frame. Specifically, the second operation is an interaction operation detected by the electronic device, which can be a gesture operation, a voice control instruction, a touch operation, etc., and is not limited herein.

[0185] For example, refer to Figures 5G-5I , Figures 5G-5I is a set of possible scene schematic diagrams; Figure 5G In S301, the second electronic device receives three image frames sent by the first electronic device, and displays the three image frames on the display screen. Figure 5H In S302, the user touches a ninth image frame in the three image frames. Figure 5I In S303, the second electronic device displays the ninth image frame touched by the user on the display screen.

[0186] The following embodiments introduce another photographing method provided by the present application. Refer to Figure 6 , Figure 6 is a flowchart of another photographing method provided by the present application. The method is applied to a first electronic device, which is in communication connection with a second electronic device. The first electronic device is provided with a camera. When the photographing function is turned on and the first electronic device is in communication connection with the second electronic device, the first electronic device can process a second image frame obtained by photographing to obtain a fifth image frame, and send the fifth image frame to the second electronic device in real time. The storage capacity occupied by the fifth image frame is lower than the storage capacity occupied by the second image frame. At least one parameter of the fifth image frame is lower than that of the second image frame. The at least one parameter can be one or more of the following: resolution, color saturation, and image dynamic range. The first electronic device can store the second image frame in a first storage space of the first electronic device. The second image frame is a first image frame that meets an image quality condition. The method comprises the following steps:

[0187] S401, the first electronic device receives a first data packet sent by the second electronic device, and the first data packet comprises a photographing instruction.

[0188] S402, the first electronic device determines at least one second image frame according to the first data packet.

[0189] Specifically, the first electronic device can be a camera, the first electronic device obtains a fifth image frame by performing image processing on a first image frame obtained by photographing, and sends the fifth image frame to the second electronic device. Meanwhile, the first electronic device can store a second image frame obtained by photographing in a cache, so as to send the second image frame meeting the condition to the second electronic device when receiving a photographing instruction of the second electronic device. Specifically, the storage method of the first electronic device for the second image frame can be the image frame storage method shown in Figure 3A or Figure 3D It should be noted that in the present example, when the first electronic device adopts the image frame storage method shown in Figure 3A or Figure 3D The first time length T can be greater than or equal to the time length between the first time point and the fourth time point. The first time point is the time point at which the first electronic device collects the second image frame, and can be the t0 time point shown in Figure 5F The fourth time point is the time point at which the first electronic device receives the first data packet, and can be the t3 time point shown in Figure 5F .

[0190] The main idea of determining at least one second image frame will be described below in combination with Figure 5F The fifth image frame sent by the first electronic device to the second electronic device includes a time stamp, the fifth image frame is obtained by image processing on the second image frame, and the time stamp represents the first time point at which the second image frame is photographed, which can be the t0 time point shown in Figure 5F The first data packet includes a time stamp and a third time delay. For the explanation of the third time delay, please refer to step S302. The time point at which the first operation is initiated is the second time point, which can be the t1 time point shown in Figure 5F The time point at which the second electronic device detects the first operation of the user is the third time point, which can be the t2 time point shown in Figure 5F The electronic device (the first electronic device or the second electronic device) can calculate the second time point according to the third time point and the third time delay, in combination with Figure 5F t1=t2-L1; wherein L1 represents the third time delay; the electronic device (the first electronic device or the second electronic device) determines the first time point t0 according to the second time point and the time stamp in the fifth image frame received by the second time point; then, the first electronic device determines at least one second image frame according to the first time point t0; specifically, the first electronic device can first determine a seventh image frame closest to the t0 time point in the storage time point; then, the first electronic device determines the seventh image frame and Y image frames before and / or after the seventh image frame to jointly constitute at least one second image frame, Y being a positive integer.

[0191] Optionally, the first data packet comprises a first time delay, and the first time delay comprises a second time delay and a third time delay; the first time delay, the second time delay and the third time delay are explained in step S302; the time point at which the first electronic device collects the second image frame is a first time point, and the first time point can be t0 as shown in FIG. 4A. Figure 5F The time point at which the first electronic device receives the first data packet is a fourth time point, and the fourth time point can be t3 as shown in FIG. 4A. Figure 5F The first electronic device can determine the time point t0 at which the second image frame is collected according to the fourth time point t3, the second time delay and the third time delay, specifically, t0 = t3 - L1 - 2 * L2, wherein L1 represents the third time delay, and L2 represents the second time delay. Figure 5F L1 represents the time length between t1 and t2, and L2 can represent the time length between t0 and t1 or the time length between t2 and t3. Figure 5F

[0192] Optionally, in combination with FIG. 4B, Figure 5F The first data packet comprises the first time delay (the first time delay is composed of the second time delay and the third time delay) and the third time point t2 at which the second electronic device detects the first operation of the user; the first electronic device can determine the time point at which the second electronic device captures the second image frame as the first time point according to the first time delay and the third time point, and the first time point can be t0 as shown in FIG. 4A, specifically, t0 = t2 - L1 - L2, wherein L1 represents the third time delay, and L2 represents the second time delay. Figure 5F

[0193] Optionally, in combination with FIG. 4B, Figure 5F The first data packet comprises the first time point t0 as explained above; that is, the second electronic device calculates the first time point t0 according to the touch time point t2 at which the first operation of the user is detected, the second time delay and the third time delay, and then packs the first time point t0 into the first data packet, so that the first electronic device does not need to further calculate when receiving the first data packet.

[0194] S403, the first electronic device sends at least one frame of the second image frame to the second electronic device.

[0195] It can be seen that in the above example, the first electronic device can determine at least one frame of the second image frame according to one or more of the following data: time delay, touch time point, time point at which the first data packet is received, time point corresponding to the time stamp in the image frame, and send the at least one frame of the second image frame to the second electronic device to meet the demand of viewing high-quality images in the second electronic device.

[0196] The flow of the first electronic device storing the image frame in the above embodiment is described below in combination with FIG. 4A. Figure 7 Figure 7 ​​​As shown, first, the camera of the first electronic device collects data to generate an image frame; then the image frame is output to an image signal processor (ISP), and the ISP processes the image frame, which can specifically include auto exposure, auto white balance, auto focus (3A) processing, and can also perform algorithm optimization on the noise, brightness, and skin color of the image; after the image frame is processed by the ISP, the image quality evaluation module can generate a quality evaluation value of the image frame, and the image difference comparison module can generate a difference value of the image frame compared with another image frame; then, in the case that the image quality evaluation value and the difference value both meet the image quality condition, the image frame is stored in the storage medium; the specific content of the image quality condition is described in the Figure 3A and Figure 3D embodiments, and will not be described here; the storage medium can be the cache of the first electronic device. It should be noted that, in the embodiment shown in Figure 3A , the first electronic device only determines whether to store the image frame in the storage medium according to the quality evaluation value, so in this embodiment, the first electronic device does not set the image difference comparison module.

[0197] It should be noted that, Figure 7 the image quality evaluation module and the image difference comparison module are presented in a parallel form in the embodiment, which is only one possible presentation form. In the specific implementation process of the embodiments of the present application, the image quality evaluation module and the image difference comparison module are used to obtain the quality evaluation value of the image frame and the difference value between the image frames, so that the electronic device can determine whether the image frame meets the storage condition according to the quality evaluation value and the difference value, and then store the image frame when the condition is met. Therefore, the embodiments of the present application do not limit the presentation form of the image quality evaluation module and the image difference comparison module; for example, the image quality evaluation module and the image difference comparison module can exist in the form of series in the circuit.

[0198] Through the above description of the embodiments, those skilled in the art can clearly understand that, for the convenience and brevity of description, only the division of the above functional modules is taken as an example for illustration, and in actual application, the above functions can be completed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. The specific working process of the system, device and unit described above can refer to the corresponding process in the foregoing method embodiments, which will not be described here.

[0199] Each function unit in each embodiment of the embodiments of the present application can be integrated in one processing unit, or each unit can exist independently physically, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware, or in the form of software function unit.

[0200] When the integrated unit is realized in the form of software function unit and sold or used as an independent product, it can be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the embodiments of the present application essentially or partially, or all or part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium, and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor to perform all or part of the steps of the methods described in the embodiments of the present application. The foregoing storage medium includes: a flash memory, a mobile hard disk, a read-only memory, a random access memory, a magnetic disk, or an optical disk, and various other media that can store program codes.

[0201] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited to this. Any person skilled in the art can easily think of changes or replacements within the technical scope disclosed in the present application, which should be covered in the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.

Claims

1. An image frame storage method characterized by, The method is applied to a first electronic device, a maximum number of image frames allowed to be stored in a first storage space of the first electronic device is N, N is a positive integer, and the method comprises the following steps: collecting first image frames in a first time length, m consecutive first image frames collected in the first time length being a group of image frames; saving second image frames meeting an image quality condition in the first image frames into the first storage space, the image quality condition comprising: an image quality of the second image frames being higher than a first image quality; K is a positive integer, when K is equal to 1, a number of the second image frames belonging to a Kth group of image frames is equal to 1; when K is greater than or equal to 2, a number of the second image frames belonging to the Kth group of image frames is less than or equal to (K-1); when K is greater than or equal to 2, if the first image frames in the Kth group of image frames all have a difference less than a first value from the second image frames most recently stored in the first storage space or an image quality lower than the first image quality, the number of the second image frames belonging to the Kth group of image frames is 0, and a number of the second image frames in a group of image frames after the Kth group of image frames is greater than 1; the Kth group of image frames refers to a group of image frames in a time sequence collected in the first time length and located in a Kth order; wherein the first time length is greater than or equal to a time length between a first time point and a fourth time point, the first time point is a time point at which the first electronic device collects the second image frames, the fourth time point is a time point at which the first electronic device receives a first data packet, the first data packet comprises a photographing instruction from a second electronic device, the first electronic device is configured to select Z second image frames from the first storage space and send the Z second image frames to the second electronic device in response to the photographing instruction, Z is a positive integer, and m is determined according to a total number F of image frames collected in the first time length and the maximum number of frames N, the total number F is a number of image frames that can be collected by the first electronic device in the first time length at a first frame rate, and the total number F is greater than the maximum number of frames N.

2. The method of claim 1, wherein, The saving of the second image frames meeting the image quality condition in the first image frames into the first storage space specifically comprises: when an image frame f1 in each group of image frames is collected, the image frame f1 is stored into the first storage space, the image frame f1 being an earliest collected image frame in the each group of image frames.

3. The method of claim 2, wherein, The third image frame is stored in the first storage space and belongs to the same group of image frames as image frame f h The method further comprises, after the image frame f1 in each group of image frames is captured, When the image frame f h in each group of image frames is collected, if the image quality of the image frame f h is higher than that of the third image frame, the third image frame is overwritten and stored by the image frame f h ; if the image quality of the image frame f h is lower than that of the third image frame, no operation is performed; the image frame f h is an image frame sequentially located at the hth position in each group of image frames, and 2≤h≤m.

4. The method of claim 1, wherein, image frame f kh wherein f represents the hth image frame in the Kth group of image frames, K is a positive integer, h is a positive integer and h≤m; the Kth group of image frames refers to a group of image frames which are sequentially captured in time in the Kth order within the first time duration; the hth image frame refers to an image frame which is sequentially captured in time in the hth order in the Kth group of image frames; △ represents a difference value between the image frame f kh and a fourth image frame, the fourth image frame representing an image frame stored last into the first storage space within the first time length, the larger the value of △, the larger the difference of image content represented by the image frame f kh and the fourth image frame; △ thrd is the first value; Q fkh represents the image quality of the image frame f kh ; Q thrd is the first image quality; Q last represents the image quality of the fourth image frame; An initial value of an integer value X is w, w being an integer.

5. The method of claim 4, wherein, The saving of the second image frames meeting the image quality condition in the first image frames into the first storage space specifically comprises: When an image frame f 11 is captured, the image frame f 11 is stored into the first storage space.

6. The method of claim 5, wherein, The image frames f are acquired 11 Afterwards, the method further comprises: When the image frame f kh is collected: If the image frame f kh and the fourth image frame do not belong to the same group of image frames, and the △ > the △ thrd , the Q fkh > the Q thrd , the image frame f kh is stored to the first storage space.

7. The method of claim 5, wherein, The image frames f are acquired 11 Afterwards, the method further comprises: When the image frame f kh is collected: if the image frame f kh and the fourth image frame do not belong to the same group of image frames, h = m, △≤△ thrd or Q fkh ≤ Q thrd , then the X is updated as X = X + 1.

8. The method of claim 5, wherein, The image frames f are acquired 11 Afterwards, the method further comprises: When the image frame f kh is collected, if the image frame f kh belongs to the same group of image frames as the fourth image frame, and Δ>Δ thrd , Q fkh >Q thrd , and X>w, then X=X-1 is updated; the image frame f kh is stored to the first storage space.

9. The method of claim 5, wherein, The image frames f are acquired 11 Afterwards, the method further comprises: When the image frame f kh is collected, if the image frame f kh belongs to the same group of image frames as the fourth image frame, and Δ≤Δ thrd , Q fkh > Q last , and X > w, the fourth image frame is stored in the first storage space by covering the image frame f kh .

10. The method of claim 5, wherein, The image frames f are acquired 11 Afterwards, the method further comprises: When the image frame f kh is collected, if the image frame f kh belongs to the same group of image frames as the fourth image frame, and X = w, Q fkh > Q last , the fourth image frame is stored in the first storage space to cover the image frame f kh .

11. A photographing method, characterized by, The method is applied to a wireless communication system, the wireless communication system comprising a first electronic device and a second electronic device, the first electronic device and the second electronic device being in communication connection, and the first electronic device being provided with a camera; a maximum number of image frames allowed to be stored in a first storage space of the first electronic device is N, N being a positive integer, and the method comprising the following steps: collecting first image frames in a first time length, m first image frames collected continuously in the first time length being a group of image frames; saving a second image frame meeting an image quality condition in the first image frames into the first storage space, the image quality condition including: the image quality of the second image frame being higher than a first image quality; K being a positive integer, when K is equal to 1, the number of the second image frames belonging to the Kth group of image frames being equal to 1; when K is greater than or equal to 2, the number of the second image frames belonging to the Kth group of image frames being less than or equal to (K-1); when K is greater than or equal to 2, if the first image frames in the Kth group of image frames all have a difference less than a first value from the second image frame stored most recently in the first storage space or have an image quality lower than the first image quality, the number of the second image frames belonging to the Kth group of image frames being 0, the number of the second image frames in a group of image frames after the Kth group of image frames being greater than 1; wherein the first time length is greater than or equal to a time length between a first time point and a fourth time point, the first time point being a time point at which the first electronic device collects the second image frame, the fourth time point being a time point at which the first electronic device receives a first data packet, the first data packet including a photographing instruction from the second electronic device, the first electronic device being configured to select Z second image frames from the first storage space and send the Z second image frames to the second electronic device in response to the photographing instruction, Z being a positive integer, m being determined according to a total number F of image frames collected in the first time length and a maximum number N of frames, the total number F being a number of image frames that the first electronic device can collect in the first time length at a first frame rate, the total number F being greater than the maximum number N of frames; the second electronic device detecting a first operation and generating a photographing instruction in response to the first operation; the second electronic device sending the first data packet to the first electronic device, the first data packet including the photographing instruction; the first electronic device receiving the first data packet sent by the second electronic device; the first electronic device determining Z second image frames from the second image frames saved into the first storage space according to the photographing instruction; the first electronic device sending the Z second image frames to the second electronic device; the second electronic device receiving the Z second image frames; the second electronic device displaying and / or storing the Z second image frames.

12. The method of claim 11, wherein, the saving of the second image frame meeting the image quality condition in the first image frames into the first storage space specifically including: when an image frame f1 in each group of image frames is collected, storing the image frame f1 into the first storage space, the image frame f1 being an earliest collected image frame in the each group of image frames.

13. The method of claim 12, wherein, The third image frame is stored in the first storage space and belongs to the same group of image frames as image frame f h The method further comprises, after the image frame f1 in each group of image frames is captured, When the image frame f h in each group of image frames is collected, if the image quality of the image frame f h is higher than that of the third image frame, the third image frame is overwritten and stored by the image frame f h ; if the image quality of the image frame f h is lower than that of the third image frame, no operation is performed; the image frame f h is an image frame sequentially located at the hth position in each group of image frames, 2≤h≤m.

14. The method of claim 13, wherein, image frame f kh wherein f represents the hth image frame in the Kth group of image frames, K is a positive integer, h is a positive integer and h≤m; the Kth group of image frames refers to a group of image frames which are sequentially captured in time in the Kth order within the first time duration; the hth image frame refers to an image frame which is sequentially captured in time in the hth order in the Kth group of image frames; △ represents a difference value between the image frame f kh and a fourth image frame, the fourth image frame representing an image frame stored last into the first storage space within the first time length, the larger the value of △, the larger the difference of image content represented by the image frame f kh and the fourth image frame; △ thrd is the first value; Q fkh denotes the image quality of the image frame f kh ; Q thrd is the first image quality; Q last denotes the image quality of the fourth image frame; an initial value of the integer value X being w, w being an integer.

15. The method of claim 14, wherein, the saving of the second image frame meeting the image quality condition in the first image frames into the first storage space specifically including: When an image frame f 11 is captured, the image frame f 11 is stored into the first storage space.

16. The method of claim 15, wherein, The image frames f are acquired 11 Afterwards, the method further comprises: When the image frame f kh is collected: If the image frame f kh and the fourth image frame do not belong to the same group of image frames, and the △ > the △ thrd , the Q fkh > the Q thrd , the image frame f kh is stored to the first storage space.

17. The method of claim 15, wherein, The image frames f are acquired 11 Afterwards, the method further comprises: When the image frame f kh is collected: if the image frame f kh does not belong to the same group of image frames as the fourth image frame, h = m, △≤△ thrd or Q fkh ≤ Q thrd , then the X is updated = X + 1.

18. The method of claim 15, wherein, The image frames f are acquired 11 Afterwards, the method further comprises: When the image frame f kh is collected, if the image frame f kh belongs to the same group of image frames as the fourth image frame, and Δ>Δ thrd , Q fkh >Q thrd , and X>w, then X=X-1 is updated; the image frame f kh is stored to the first storage space.

19. The method of claim 15, wherein, The image frames f are acquired 11 Afterwards, the method further comprises: When the image frame f kh is collected, if the image frame f kh belongs to the same group of image frames as the fourth image frame, and Δ≤Δ thrd , Q fkh > Q last , and X > w, the fourth image frame is stored in the first storage space by covering the image frame f kh .

20. The method of claim 15, wherein, The image frames f are acquired 11 Afterwards, the method further comprises: When the image frame f kh is collected, if the image frame f kh belongs to the same group of image frames as the fourth image frame, and X = w, Q fkh > Q last , the fourth image frame is stored in the first storage space by covering the image frame f kh .

21. The method according to any one of claims 11-20, characterized in that, the method further including: The first electronic device performs image processing on the first image frames collected in the first time length to obtain fifth image frames, the storage capacity occupied by the fifth image frames being lower than the storage capacity occupied by the first image frames; at least one parameter of the fifth image frames being lower than the first image frames.

22. The method of claim 21, wherein, Before the second electronic device detects the first operation, the method further comprises: The first electronic device sends the fifth image frames to the second electronic device; The second electronic device displays images according to the received fifth image frames.

23. The method of claim 22, wherein, The photographing instruction includes a first time point, and the Z-frame second image frame is the Z-frame image frame closest to the first time point in the image frames stored by the first electronic device.

24. The method of claim 22 or 23, wherein, The photographing instruction includes a first time delay, which is composed of a second time delay and / or a third time delay; The second time delay refers to the data transmission time delay between the second electronic device and the first electronic device; The third time delay refers to the time delay between the second time point and the third time point, the second time point being the time point of initiating the first operation, and the third time point being the time point of the second electronic device detecting the first operation.

25. The method of claim 24, wherein, The first time length T≥2*T2, or, T≥2*T2 +T3, T2 representing the second time delay, and T3 representing the third time delay.

26. A method of taking a picture, the method comprising: Applied to the second electronic device, the method comprises: Detecting a first operation, and generating a photographing instruction in response to the first operation; Sending a first data packet to the first electronic device, the first data packet including the photographing instruction; Receiving Z-frame second image frames sent by the first electronic device, the Z-frame second image frames being determined by the first electronic device according to the photographing instruction, Z being a positive integer; Displaying and / or storing the Z-frame second image frames; The second electronic device detects the first operation at a third time point; the Z-frame second image frames include a sixth image frame, the sixth image frame including a first time stamp in the data, and the first time stamp including a first time point; The time length between the first time point and the third time point is greater than or equal to a first time delay, the first time delay being equal to a second time delay, or the first time delay being equal to the sum of the second time delay and a third time delay; The second time delay refers to the data transmission time delay between the first electronic device and the second electronic device; The third time delay refers to the time delay between the second time point and the third time point, the second time point being the time point of initiating the first operation.

27. An electronic device, comprising: The electronic device comprises one or more processors and a memory; The memory is coupled to the one or more processors, and the memory is configured to store computer program code, the computer program code comprising computer instructions, and the one or more processors invoke the computer instructions to cause the electronic device to perform the method of any one of claims 1-26.

28. A computer program product comprising instructions, wherein: When the computer program product runs on the electronic device, it causes the electronic device to perform the method of any one of claims 1-26.

29. A computer-readable storage medium comprising instructions, wherein: when executed on an electronic device, cause the electronic device to perform a method as claimed in any one of claims 1-26.

Citation Information

Patent Citations

  • Video processing method and device, electronic equipment and computer readable storage medium

    CN110399842A