Image processing method, electronic device and computer readable storage medium

By identifying and processing fixed materials and changing materials in images in electronic devices, dynamic space images with Hitchcock zoom effects are generated, which solves the problem of users having difficulty in shooting high-quality dynamic space images, and improves the display effect and User convenience.

CN118012319BActive Publication Date: 2024-10-25HONOR DEVICE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410414637.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-04-08
Publication Date
2024-10-25
Estimated Expiration
2044-04-08

AI Technical Summary

Technical Problem

It is difficult for users to use electronic equipment to shoot dynamic spatial images with Hitchcock zoom effects. The lack of professional shooting techniques and equipment results in poor image effects.

Method used

By implementing image processing methods in electronic devices, we can automatically identify fixed materials and changing materials in images to be processed, and generate dynamic space images with Hitchcock zoom effects based on user operations. We can generate multiple consecutive frames through zoom processing and splicing technology. Image, enhance the spatial sense and display effect of the image.

Benefits of technology

It improves the spatial sense and display effect of images, simplifies user operation steps, and enhances the professionalism and effect of electronic devices when shooting dynamic spatial images.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118012319B_ABST
    Figure CN118012319B_ABST
Patent Text Reader

Abstract

The present application provides an image processing method, an electronic device, and a computer-readable storage medium, which relate to the field of terminal technology. The method is applied to an electronic device, including: displaying a first interface, the first interface including a first thumbnail, the first thumbnail being a thumbnail of a first image in the electronic device, the first image including a first content element and a second content element; in response to a first operation on the first thumbnail, displaying a second interface, the second interface including a plurality of dynamic space images, each dynamic space image including a first content element and a second content element, the size of the first content element in the plurality of dynamic space images being the same, and the size of the second content element in the plurality of dynamic space images being different. The above method can improve the spatial effect of an image, so as to improve the display effect of the image.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of terminal technology, and in particular to an image processing method, an electronic device, and a computer-readable storage medium. Background Art

[0002] With the development of technology, electronic devices have played an irreplaceable role in people's daily lives. For example, people are more accustomed to using portable electronic devices to take pictures or videos to record the wonderful moments in life. In addition, electronic devices have powerful communication and computing capabilities, which can process the images or videos taken by users, greatly enriching the user's shooting experience.

[0003] However, since most users of electronic devices have little knowledge of professional shooting techniques, it is difficult for electronic devices to capture images with good effects. For example, it is difficult for users to use electronic devices to capture dynamic spatial images with Hitchcock zoom effects. Summary of the invention

[0004] In view of this, the present application provides an image processing method, an electronic device and a computer-readable storage medium, which can improve the spatial effect of an image to enhance the display effect of the image.

[0005] In a first aspect, the present application provides an image processing method, which is applied to an electronic device. The method includes: displaying a first interface, the first interface includes a first thumbnail, the first thumbnail is a thumbnail of a first image in the electronic device, and the first image includes a first content element and a second content element. Among them, the first interface can be a shooting preview interface corresponding to a scene of shooting a dynamic space image. At this time, the first interface can also include a shooting control, then the first image can be an image to be processed acquired by the electronic device in response to the user's operation on the shooting control. The first interface can also be an album display interface corresponding to a scene where an image has been shot. At this time, the album display interface displays thumbnails of all images, all images include an image to be processed, and the image to be processed is the first image. The image to be processed can be an image corresponding to the selected thumbnail. In response to the first operation on the first thumbnail, a second interface is displayed, the second interface includes multiple dynamic space images, each dynamic space image includes a first content element and a second content element, the size of the first content element in the multiple dynamic space images is the same, and the size of the second content element in the multiple dynamic space images is different. Among them, the first thumbnail is a thumbnail of the first image, and the first operation on the first thumbnail can be a click, a long press, a double click, etc., and its specific operation method is not limited here. The second interface can be an interface for displaying multiple dynamic space images. Since each dynamic space image includes a first content element and a second content element, and the size of the first content element in the multiple dynamic space images is the same, and the size of the second content element in the multiple dynamic space images is different, then the multiple dynamic space images have a Hitchcock zoom effect, the spatial sense of the multiple dynamic space images will be enhanced, and the display effect of the image will be improved.

[0006] In addition, the first content element included in the first image is a fixed material described below, and the second content element is a fixed material described below. The multiple dynamic space images can be a file of a dynamic space image or a video. For ease of understanding, in the description of the embodiments below, the multiple dynamic space images are referred to as dynamic space images.

[0007] In the above implementation, the electronic device may perform multiple scaling processes on the second content element to obtain multiple scaled second content elements, wherein the size of the scaled second content elements changes. Afterwards, the electronic device may combine the first content element with the multiple scaled second content elements into one of the multiple dynamic space images. The electronic device may combine the first content element and the second content element into multiple dynamic space images by splicing or superimposing.

[0008] In a possible implementation of the first aspect, the first image is a picture, the first content element and the second content element are content elements included in the picture of the first image; in response to a first operation on the first thumbnail, a second interface is displayed, including: in response to the first operation on the first thumbnail, a third interface is displayed, the third interface includes the first image and the first control; in response to a second operation on the first control, the second interface is displayed. Among them, the third interface can be an interface for displaying the first image, and the user can view the image details of the first image through the third interface. When the user confirms that a dynamic space image needs to be generated based on the first image, the user can perform a second operation on the first control in the third interface, so that the electronic device displays the second interface in response to the second operation. In this way, it can be ensured that the electronic device can provide the user with a more detailed image display interface, so as to ensure that the electronic device can accurately display multiple dynamic space images with Hitchcock effect.

[0009] The first content element and the second content element may be all the content elements included in the first image. For example, the electronic device may directly determine the first content element from all the content elements of the first image, and determine the other content elements in all the content elements except the first content element as the second content element. For another example, the electronic device may first determine the second content element from all the content elements of the first image, and then determine the other content elements in all the content elements except the second content element as the first content element. In this way, it can be ensured that the multiple dynamic spatial images include all the content elements in the first image.

[0010] In addition, the first content element and the second content element may be part of the content elements included in the first image, and the electronic device may directly determine the required first content element from all the content elements of the first image, and then determine the required second content element from all the content elements except the first content element. In this process, there are redundant content elements in all the content elements of the first image that are not determined by the electronic device as the first content element or the second content element. In this way, it can be ensured that the multiple dynamic spatial images only include the content elements that need to be displayed.

[0011] In the above implementation, the electronic device can automatically identify the first content element and the second content element from the first image, thereby simplifying the user's operation steps and improving the convenience of user operation.

[0012] In another possible implementation of the first aspect, there are multiple first images, and the first content element and the second content element are content elements included in the multiple first images; in response to the first operation on the first thumbnail, the second interface is displayed, including: in response to the first operation on the multiple first thumbnails, multiple first thumbnails are selected, and the multiple first thumbnails correspond to the multiple first images one by one; in response to the third operation on the second control in the first interface, the second interface is displayed. Wherein, in the case where the first interface includes multiple thumbnails, the user's first operation on the multiple first thumbnails can be an operation for selecting the multiple first thumbnails, and then, in response to the third operation on the second control in the first interface, the electronic device can display the second interface, and the multiple dynamic space images included in the second interface are generated by the electronic device based on the multiple first images corresponding to the selected multiple first thumbnails.

[0013] In response to the first operation on the multiple first thumbnails, after the multiple first thumbnails are selected, the electronic device can display the second control in the first interface. For example, in response to the user's long press operation on the thumbnails in the first interface, the electronic device can display the first interface including the selectable thumbnails, and then the user's first operation on the multiple first thumbnails can be a selection operation. In this way, it can be ensured that the user can be provided with an operation interface for selecting multiple first images.

[0014] In the above process, the electronic device can provide the user with an interface for selecting multiple first thumbnails, so that the user can select multiple first images that he wants to select, and the electronic device generates and displays a dynamic space image according to the multiple first images selected by the user, thereby ensuring the richness of the dynamic space image content and the flexibility of the image content.

[0015] In a possible implementation of the first aspect, in response to a first operation on a first thumbnail, a second interface is displayed, including: in response to the first operation on the first thumbnail, a fourth interface is displayed, the fourth interface includes multiple first options, and the multiple first options correspond one-to-one to the content elements included in the first image; in response to a selection operation on a first content option among the multiple first options, a second interface is displayed, and the first content element is a content element corresponding to the first content option. Among them, operating the first content option means selecting the first content element as a fixed content element in multiple dynamic space images. In this way, the user can select the first content element he wants through the fourth interface, thereby ensuring that the content elements with unchanged size in multiple dynamic space images are content elements specified by the user, meeting the needs of the user and improving the flexibility of the content of multiple dynamic space images.

[0016] In some examples, the electronic device may use the remaining elements of all content elements included in the first image except the content element corresponding to the first content option as the second content element. In other examples, the electronic device may also select a portion of content elements from the remaining elements of all content elements included in the first image except the content element corresponding to the first content option as the second content element.

[0017] In a possible implementation manner of the first aspect, the second content element is a content element other than the first content element in the first image. The electronic device may use the content element other than the first content element in the first image as the second content element to ensure accuracy of dynamic spatial image content.

[0018] In a possible implementation of the first aspect, in response to a selection operation on a first content option, displaying a second interface includes: in response to a selection operation on the first content option, displaying a fifth interface, the fifth interface including a plurality of second options, the plurality of second options corresponding one-to-one to content elements included in the first image other than the first content element; in response to a selection operation on a second content option among the plurality of second options, displaying a second interface, the second content element being a content element corresponding to the second content option. In this way, the user can first select the first content element he wants through the fourth interface, and then select the second content element he wants through the fifth interface, thereby ensuring that all content elements in the plurality of dynamic space images are content elements specified by the user, and improving the accuracy and personalization of the plurality of dynamic space images.

[0019] In some examples, in response to the first operation on the first thumbnail, the electronic device may first display the fifth interface. Thereafter, in response to the selection operation of the second content option among the plurality of second options, the fourth interface is displayed. Next, in response to the selection operation of the first content option among the plurality of first options in the fourth interface, the second interface is displayed. In the above examples, the electronic device may first provide the user with an interface for selecting the second content element, and then provide an interface for selecting the first content element.

[0020] In some examples, in response to a first operation on a first thumbnail in a first interface, the electronic device may select a plurality of the first thumbnails. Afterwards, in response to a third operation on a second control in the first interface, the fourth interface is displayed, or the fourth interface and the fifth interface are displayed successively. In the case of displaying the fourth interface, in response to a selection operation on a first content option in a plurality of first options in the fourth interface, the electronic device may display the second interface. In the case of displaying the fourth interface first and then the fifth interface, in response to a selection operation on a second content option in a plurality of second options in the fifth interface, the electronic device may display the second interface. In the case of displaying the fifth interface first and then the fourth interface, in response to a selection operation on a first content option in a plurality of first options in the fourth interface, the electronic device may display the second interface. In this way, after providing the user with an interface for selecting a plurality of first images, the electronic device provides the user with an interface for selecting a first content element, or an interface for selecting a first content element and a second content element. Thus, the electronic device can generate personalized multiple dynamic space images for the user's selection.

[0021] In a possible implementation of the first aspect, the plurality of dynamic spatial images are arranged in sequence, and the size of the second content element in two adjacent dynamic spatial images in the plurality of dynamic spatial images changes according to a zoom ratio. The plurality of dynamic spatial images may be arranged in the order in which each dynamic spatial image is generated.

[0022] The order of generating each dynamic space image in the multiple dynamic space images can be determined according to the processing process. For example, when the second content element in the first image is not scaled according to the scaling ratio, the electronic device uses the image composed of the second content element and the first content element as the first dynamic space image in the multiple dynamic space images. Afterwards, the electronic device performs the first scaling process on the second content element in the first image without scaling according to the scaling ratio, and uses the image composed of the second content element and the first content element after the first scaling process as the second dynamic space image in the multiple dynamic space images. Afterwards, the electronic device performs the second scaling process on the second content element after the first scaling process again according to the scaling ratio, and uses the image composed of the second content element and the first content element after the second scaling process as the third dynamic space image in the multiple dynamic space images. In this way, the second content element after each scaling process is scaled again according to the scaling ratio, and the obtained second content element is the next dynamic space image. In this way, it can be ensured that the size of the second content element in two adjacent dynamic space images changes according to the scaling ratio.

[0023] In some examples, the zoom ratio may be a fixed value, that is, the electronic device zooms the second content element that needs to be zoomed in and out at the same zoom ratio each time. For example, when the electronic device defaults to a fixed zoom ratio or the user specifies a default zoom ratio, the second element may be zoomed in and out at the same zoom ratio. Among them, the zoom ratios corresponding to different second content elements may be different. For example, the zoom ratio corresponding to one second content element is the second zoom ratio, and the zoom ratio corresponding to another content element is the third zoom ratio. For another example, the electronic device may determine the zoom ratio corresponding to each second content element based on the distance between the second content element and the lens. For example, the second content element that is closer to the lens has a smaller zoom ratio, while the second content element that is farther from the lens has a larger zoom ratio. In this way, the distance between different content elements and the lens in the same image can be reflected.

[0024] In some other examples, when the zoom ratio is a set of numbers, the set of numbers includes multiple values, and the electronic device can perform zoom processing on the second content element included in the first image according to each value in the set of numbers, thereby obtaining the zoomed second content element. Thereafter, the multiple dynamic space images generated based on the zoomed second content element are arranged according to the arrangement order of the values ​​in the set of numbers.

[0025] In a possible implementation of the first aspect, in response to a first operation on a first thumbnail, a second interface is displayed, including: in response to the first operation on the first thumbnail, a sixth interface is displayed, the sixth interface including a zoom ratio editing area and a third control; receiving a first zoom ratio input by a user through the zoom ratio editing area; in response to a fourth operation on the third control, the second interface is displayed, and the size of the second content element in two adjacent dynamic space images in the multiple dynamic space images changes according to the first zoom ratio. Through the sixth interface, the user can specify the zoom ratio of the second content element, so that the electronic device can generate personalized multiple dynamic space images for the zoom ratio specified by the user.

[0026] In some examples, the electronic device may also display the sixth interface at other times. For example, the electronic device may display the sixth interface after displaying the third interface, so that the user can view the first image first and then select the first zoom ratio. For another example, the electronic device may display the sixth interface after displaying the fourth interface, so that the user can first select the first content element in the first image and then select the first zoom ratio. For another example, the electronic device may display the sixth interface after displaying the fifth interface, so that the user can first select the second content element in the first image and then select the first zoom ratio. In this way, the user can first select the first content element and the second content element, and then specify the first zoom ratio of the second content element, thereby ensuring that the user can clearly specify the zoom ratio of each second content element and ensure accurate changes in the second content elements in multiple dynamic space images.

[0027] Among them, the zoom ratio editing area included in the sixth interface can have multiple forms, and the first zoom ratios corresponding to zoom ratio editing areas of different forms are different. For example, when the zoom ratio editing area presented in the sixth interface is in the input form of a text box, the first zoom ratio is a fixed value. When multiple zoom ratios can be edited arbitrarily in the zoom ratio editing area presented in the sixth interface, the first zoom ratio is a variable value. For example, the zoom ratio curve can be edited in the zoom ratio editing area presented in the sixth interface.

[0028] In a possible implementation of the first aspect, in response to a first operation on a first thumbnail, a second interface is displayed, including: in response to the first operation on the first thumbnail, a seventh interface is displayed, the seventh interface includes a moving speed editing area and a fourth control; receiving a moving speed input by a user through the moving speed editing area; in response to a fifth operation on the fourth control, a second interface is displayed, and a zoom ratio is calculated based on the moving speed. Through the seventh interface, a user can specify a zoom ratio of a second content element through a moving speed, so that the electronic device can calculate the zoom ratio for the moving speed specified by the user and generate multiple personalized dynamic space images.

[0029] After the user specifies the moving speed, the electronic device can calculate the zoom ratio based on the depth of the first content element and the second content element and the moving speed. The depth of the first content element and the second content element can be a default value, a user-specified value, or a value carried in the first image.

[0030] In some examples, the electronic device may also display the seventh interface at other times. For example, the electronic device may display the seventh interface after displaying the third interface, so that the user can view the first image first and then specify the moving speed. For another example, the electronic device may display the seventh interface after displaying the fourth interface, so that the user can first select the first content element in the first image and then specify the moving speed. For another example, the electronic device may display the seventh interface after displaying the fifth interface, so that the user can first select the second content element in the first image and then specify the moving speed. In this way, the user can first select the first content element and the second content element, and then specify the moving speed, thereby ensuring that the electronic device can calculate the first zoom ratio corresponding to each second content element according to the moving speed, ensuring that the second content element in multiple dynamic space images can accurately change according to the moving speed, so that the multiple dynamic space images are closer to the actual shooting effect.

[0031] Among them, the moving speed editing area included in the seventh interface can have multiple forms, and different forms of moving speed editing areas correspond to different moving speeds. For example, when the moving speed editing area presented in the seventh interface is in the input form of a text box, the moving speed is a fixed value. When multiple moving speeds can be edited arbitrarily in the moving speed editing area presented in the seventh interface, the moving speed is a variable value. For example, the zoom ratio curve can be edited in the moving speed area presented in the seventh interface.

[0032] In addition, the moving speed may also be the actual moving speed of the electronic device, so that the changing effect of the generated multiple dynamic spatial images is closer to the effect of mobile shooting of the electronic device, which can give users a more realistic shooting experience.

[0033] In a possible implementation of the first aspect, in response to a first operation on a first thumbnail, a second interface is displayed, including: in response to the first operation on the first thumbnail, an eighth interface is displayed; the eighth interface includes a first depth editing area and a fifth control; a first depth input by a user through the first depth editing area is received; in response to a sixth operation on the fifth control, a ninth interface is displayed; the ninth interface includes a second depth editing area and a sixth control; a second depth input by a user through the second depth editing area is received; in response to a seventh operation on the sixth control, a second interface is displayed; the zoom ratio is calculated based on the first depth and the second depth. Through the eighth interface, the user can specify the zoom ratio of the second content element through the depth information, so that the electronic device can calculate the zoom ratio for the depth specified by the user and generate multiple personalized dynamic space images.

[0034] After the user specifies the first depth and the second depth, the electronic device can calculate the zoom ratio based on the first depth of the first content element, the second depth of the second content element, and the moving speed. The moving speed can be a default value, a user-specified value, or a moving speed of the electronic device.

[0035] In some examples, the electronic device may also display the eighth interface at other times. For example, the electronic device may display the eighth interface after displaying the third interface, so that the user can view the first image first, and then specify the first depth and the second depth. For another example, the electronic device may display the eighth interface after displaying the fourth interface, so that the user can first select the first content element in the first image, and then specify the first depth and the second depth. For another example, the electronic device may display the eighth interface after displaying the fifth interface, so that the user can first select the second content element in the first image, and then specify the first depth and the second depth. In this way, the user can first select the first content element and the second content element, and then specify the first depth and the second depth, so as to ensure that the electronic device can calculate the first zoom ratio corresponding to each second content element according to the first depth and the second depth, and ensure that the second content element in multiple dynamic space images can accurately change according to the first depth and the second depth, so that the multiple dynamic space images are closer to the actual shooting effect.

[0036] The first depth editing area and the second depth editing area included in the eighth interface may have multiple forms, and the forms of the first depth editing area and the second depth editing area in different forms may be different or the same.

[0037] In a possible implementation of the first aspect, in response to a first operation on a first thumbnail, a second interface is displayed, including: in response to the first operation on the first thumbnail, a tenth interface is displayed; the tenth interface includes a second thumbnail and a seventh control, the second thumbnail is a thumbnail of a second image in the electronic device, the second image includes a third content element, and the third content element is used to generate a second content element in a plurality of dynamic space images based on the second content element in the first image; in response to a selection operation on the second thumbnail and an eighth operation on the seventh control, the second interface is displayed. Through the tenth interface, a user can select the second image to ensure that the electronic device can fill in the missing content in the second content element when generating a plurality of dynamic space images based on the second content element in the first image, thereby ensuring the accuracy of the plurality of dynamic space images.

[0038] In a possible implementation of the first aspect, after displaying the second interface, the method further includes: displaying a twelfth interface, the twelfth interface including a shooting preview area, the shooting preview area including a viewfinder; in response to a shooting operation on the twelfth interface, a third image is captured by a camera of the electronic device, and a third thumbnail of multiple dynamic space images is displayed on the twelfth interface; the third image includes a fourth content element and a fifth content element, each dynamic space image includes the fourth content element and the fifth content element, the size of the fourth content element in the multiple dynamic space images is the same, and the size of the fifth content element in the multiple dynamic space images is different. In response to a ninth operation on the third thumbnail, a thirteenth interface is displayed, the thirteenth interface includes multiple dynamic space images.

[0039] In the above implementation, when the user performs a shooting operation on the twelfth interface, the electronic device can directly generate multiple dynamic space images based on the third image captured by the camera, and display the thumbnails of the multiple dynamic space images on the twelfth interface, so that the user can perform a more convenient operation, so that after the user performs a shooting operation on the twelfth interface, the electronic device can directly generate multiple dynamic space images. Afterwards, the user can directly view the multiple dynamic space images through the third thumbnails.

[0040] In the above implementation, before the electronic device displays the twelfth interface, the electronic device may display an interface similar to the third interface for displaying the first image, or may display an interface similar to the fourth interface for selecting the first content element, or may display an interface similar to the fifth interface for selecting the second content element, or may display an interface similar to the sixth interface for specifying the zoom ratio of the second content element, or may display an interface similar to the seventh interface for specifying the moving speed, or may display an interface similar to the eighth interface and the ninth interface for specifying the depth, or may display an interface similar to the tenth interface for selecting the second image. For details, please refer to the above related description, which will not be repeated here.

[0041] In the above implementation, the thirteenth interface is similar to the second interface, both of which are interfaces for displaying multiple dynamic spatial images.

[0042] In a second aspect, the present application provides an electronic device, comprising a display screen, a memory and one or more processors; the display screen, the memory and the processor are coupled; the display screen is used to display an image generated by the processor, and the memory is used to store computer program code, and the computer program code includes computer instructions; when the processor executes the computer instructions, the electronic device executes the method described in the first aspect and any possible design method thereof.

[0043] In a third aspect, the present application provides a computer-readable storage medium, comprising computer instructions, which, when executed on an electronic device, enables the electronic device to execute the method described in the first aspect and any possible design thereof.

[0044] In a fourth aspect, the present application provides a computer program product, including a computer program / instruction, which, when executed by a processor, enables the electronic device to execute the method described in the first aspect and any possible design thereof.

[0045] In a fifth aspect, the present application provides a device, which is included in an electronic device, and the device has the function of implementing the behavior of the electronic device in any of the above aspects and possible implementation methods. The function can be implemented by hardware, or by hardware executing corresponding software. The hardware or software includes at least one module or unit corresponding to the above function. For example, a display module or unit, a computing module or unit, and a storage module or unit, etc.

[0046] In a sixth aspect, an embodiment of the present application provides a chip system, which includes a processor and may also include a memory, for implementing any one of the methods provided in the first aspect. The chip system may be composed of a chip, or may include a chip and other discrete devices.

[0047] It can be understood that the electronic device described in the second aspect and any possible design thereof provided above, the computer-readable storage medium described in the third aspect, and the computer program product described in the fourth aspect are all used to execute the corresponding methods provided above. Therefore, the beneficial effects that can be achieved can be referred to the beneficial effects in the corresponding methods provided above, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] Figure 1 A schematic diagram of a dynamic spatial image change provided in an embodiment of the present application;

[0049] Figure 2 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application;

[0050] Figure 3 A software schematic diagram of an electronic device provided in an embodiment of the present application;

[0051] Figure 4 A flowchart of an image processing method provided in an embodiment of the present application;

[0052] Figure 5 A schematic diagram of a scene for obtaining an image to be processed provided in an embodiment of the present application Figure 1 ;

[0053] Figure 6 A schematic diagram of a scene for obtaining an image to be processed provided in an embodiment of the present application Figure 2 ;

[0054] Figure 7 A schematic diagram of a scene for obtaining an image to be processed provided in an embodiment of the present application Figure 3 ;

[0055] Figure 8 A schematic diagram of a fixed material selection interface provided in an embodiment of the present application;

[0056] Fig. 9 A schematic diagram of a fixed material and a variable material selection interface provided in an embodiment of the present application;

[0057] Fig.10 A schematic diagram of a scene of a zoom ratio input interface provided in an embodiment of the present application;

[0058] Fig.11 A schematic diagram of a principle of zoom ratio calculation provided in an embodiment of the present application;

[0059] Fig.12 A schematic diagram of a material selection and depth specification interface provided in an embodiment of the present application;

[0060] Fig.13 A schematic diagram of a setting interface of a speed input interface provided in an embodiment of the present application;

[0061] Fig.14 A schematic diagram of an auxiliary image selection interface provided in an embodiment of the present application. DETAILED DESCRIPTION

[0062] In the following, the terms "first" and "second" are used only for descriptive purposes and cannot be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of this embodiment, "at least one" refers to one or more, and "multiple" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural. The character " / " generally indicates that the associated objects before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single items or plural items. For example, at least one of a, b, or c can represent: a, b, c, ab, ac, bc, or abc, where a, b, c can be single or multiple.

[0063] It should be noted that in the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.

[0064] Before introducing the embodiments of the present application, the technologies involved in the embodiments of the present application are first introduced in detail.

[0065] Hitchcock zoom, also known as sliding zoom, is a shooting method. Specifically, during the shooting process, while moving the lens, the focal length of the lens is changed in the opposite direction of the moving direction. For example, moving the lens toward the object will reduce the focal length of the lens; moving the lens away from the object will increase the focal length of the lens. In this way, the area ratio of the target object in the shooting picture remains unchanged, while other objects in the shooting picture change, resulting in a visual effect of space distortion. Videos shot with Hitchcock zoom are usually used to create a tense atmosphere.

[0066] like Figure 1 As shown, Figure 1 The four frames of images shown are selected from the dynamic images or videos shot using the Hitchcock zoom shooting method. It can be seen that in the four frames of images, the area ratio of the shooting screen occupied by the user in each frame of the image remains unchanged, that is, the user is the target object being photographed. In the four frames of images, the area ratio of the shooting screen occupied by the buildings and trees behind the user in each frame of the image decreases successively, that is, the buildings and trees are other objects being photographed. Figure 1 The dynamic image or video with the image change characteristics shown can be considered to have the Hitchcock zoom effect. The dynamic spatial image described below refers to the image or video with the Hitchcock zoom effect.

[0067] It should be noted that, in a continuous multi-frame image, if the area ratio of the target object in the shooting picture remains unchanged, and the area ratios of the other objects in the shooting picture increase or decrease successively, then the video or dynamic image in which the continuous multi-frame image is located also has the Hitchcock zoom effect. Among them, the change ratio of the other objects behind the target object is opposite to that of the other objects in front of the target object. For example, the area ratio of the building behind the target object in the shooting picture increases successively, and the area ratio of the trees in front of the target object in the shooting picture decreases successively.

[0068] The crew used the Hitchcock zoom to shoot Figure 1 In the process of capturing multiple frames of images shown in FIG. 1 , the lens needs to be moved and the focal length of the lens needs to be changed at the same time. Generally, when the photographer moves the lens, he needs to hold the camera and move it. During the movement of the photographer, shaking is likely to occur. Therefore, the photographer generally needs to use a stabilizer that can ensure the stability of the camera during movement. In addition, during the shooting process, the photographer needs to ensure that the speed of moving the lens matches the speed of changing the focal length of the lens, so as to ensure that the area ratio of the target object being photographed in the shooting picture remains unchanged, while other objects being photographed change in the shooting picture.

[0069] As can be seen from the above, the current method of shooting using the Hitchcock zoom method has high requirements on the equipment required for shooting and the shooting process of the shooting personnel. Non-professional shooting personnel cannot shoot dynamic spatial images with the Hitchcock zoom effect without professional shooting equipment. Moreover, even if non-professional shooting personnel have professional shooting equipment, they cannot shoot dynamic spatial images with the Hitchcock zoom effect because they do not have the ability to master and use professional shooting techniques.

[0070] To this end, an embodiment of the present application provides an image processing method. When executing the image processing method, the electronic device can process the acquired image to be processed to determine the changing material and the fixed material therein. Afterwards, the electronic device can generate a dynamic space image including multiple frames of continuous images by scaling the changing material. The same changing material in two adjacent frames of the multiple frames of continuous images of the dynamic space image is enlarged or reduced according to the zoom ratio. In other words, the electronic device can directly process the image to obtain a dynamic space image with a Hitchcock zoom effect, so that the spatial sense of the image can be improved and the display effect of the image can be enhanced.

[0071] In order to better understand the embodiments of the present application, the terminal device provided in the embodiments of the present application is first introduced.

[0072] The image processing method provided in the embodiment of the present application can be applied to the electronic device 100. For example, the electronic device 100 can be a mobile phone, a tablet computer, a smart screen, a laptop computer, a vehicle-mounted device, a wearable device (such as a smart watch), an ultra-mobile personal computer (UMPC), a netbook, a personal digital assistant (PDA), an artificial intelligence device, and other terminal devices with image processing functions. The embodiment of the present application does not limit the specific type of the electronic device 100 and the installed operating system.

[0073] Figure 2 A schematic structural diagram of an electronic device 100 is shown.

[0074] The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a sensor module 180, a button 190, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc.

[0075] It is to be understood that the structure illustrated in the embodiment of the present invention does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown in the figure, or combine some components, or separate some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.

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

[0077] The controller may be the nerve center and command center of the electronic device 100. The controller may generate an operation control signal according to the instruction operation code and the timing signal to complete the control of fetching and executing instructions.

[0078] The processor 110 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may store instructions or data that the processor 110 has just used or cyclically used. If the processor 110 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.

[0079] In some embodiments, the processor 110 may include one or more interfaces. The interface may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.

[0080] The USB interface 130 is an interface that complies with the USB standard specification, and specifically can be a Mini USB interface, a Micro USB interface, a USB Type C interface, etc. The USB interface 130 can be used to connect a charger to charge the electronic device 100, and can also be used to transfer data between the electronic device 100 and a peripheral device. It can also be used to connect headphones to play audio through the headphones. The interface can also be used to connect other electronic devices, such as AR devices, etc.

[0081] The charging management module 140 is used to receive charging input from a charger. The charger can be a wireless charger or a wired charger. While the charging management module 140 charges the battery 142, it can also power the electronic device through the power management module 141.

[0082] The power management module 141 is used to connect to the battery 142. The power management module 141 receives input from the battery 142 and / or the charging management module 140 to power the processor 110, the internal memory 121, the external memory, the display screen 194, the camera 193, and the wireless communication module 160. The power management module 141 can also be used to monitor parameters such as battery capacity, battery cycle number, and battery health status (leakage, impedance).

[0083] The wireless communication function of the electronic device 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor. In some embodiments, the antenna 1 of the electronic device 100 is coupled with the mobile communication module 150, and the antenna 2 is coupled with the wireless communication module 160, so that the electronic device 100 can communicate with the network and other devices through wireless communication technology.

[0084] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve the utilization of antennas. For example, antenna 1 can be reused 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.

[0085] The mobile communication module 150 may provide solutions for wireless communications including 2G / 3G / 4G / 5G, etc., applied to the electronic device 100. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc.

[0086] The wireless communication module 160 can provide wireless communication solutions for application in the electronic device 100, including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication technology (NFC), infrared technology (IR), etc.

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

[0088] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. In some embodiments, the electronic device 100 may include 1 or N display screens 194, where N is a positive integer greater than 1.

[0089] The electronic device 100 can realize the shooting function through ISP, camera 193, video codec, GPU, display screen 194 and application processor.

[0090] ISP is used to process the data fed back by camera 193. For example, when taking a photo, the shutter is opened, and 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 ISP for processing and converts it into an image visible to the naked eye. ISP can also perform algorithm optimization on the noise, brightness, and skin color of the image. ISP can also optimize the exposure, color temperature and other parameters of the shooting scene. In some embodiments, ISP can be set in camera 193.

[0091] The camera 193 is used to capture still images or videos. The object generates an optical image through the lens and projects it onto the photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, and then transmits the electrical signal to the ISP to be converted into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV or other format. In some embodiments, the ISP can also perform signal format conversion. In other embodiments, the ISP can also output the digital image signal to a GPU, NPU, etc. for processing. In some embodiments, the electronic device 100 may include 1 or N cameras 193, where N is a positive integer greater than 1.

[0092] In some embodiments, the camera 193 may be an ordinary camera. In this case, the electronic device uses the ordinary photo taken by the camera 193 as the image to be processed. Afterwards, the electronic device may generate a dynamic spatial image based on the image to be processed according to the zoom ratio set by the user. In other embodiments, when the electronic device has multiple cameras 193, or has a depth camera 193 such as ToF or structured light, the electronic device obtains the image to be processed with depth information. Afterwards, the electronic device may generate a dynamic spatial image based on the image to be processed according to the depth information of the image to be processed or the zoom ratio set by the user. For specific embodiments, please refer to the subsequent Fig.11 , Fig.12 The detailed introduction and context will not be repeated here.

[0093] In some embodiments, the image processing method provided in the embodiments of the present application can also be applied to electronic devices without cameras.

[0094] The digital signal processor is used to process digital signals, and can process not only digital image signals but also other digital signals. For example, when the electronic device 100 is selecting a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy.

[0095] Video codecs are used to compress or decompress digital videos. The electronic device 100 may support one or more video codecs. Thus, the electronic device 100 may play or record videos in a variety of coding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4, etc.

[0096] NPU is a neural-network (NN) computing processor. It can quickly process input information by drawing on the structure of biological neural networks, such as the transmission mode between neurons in the human brain, and can also continuously self-learn.

[0097] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 through the external memory interface 120 to implement a data storage function, such as storing music, video and other files in the external memory card.

[0098] The internal memory 121 can be used to store computer executable program codes, which include instructions. The processor 110 executes various functional applications and data processing of the electronic device 100 by running the instructions stored in the internal memory 121. The internal memory 121 may include a program storage area and a data storage area. Among them, the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area may store data created during the use of the electronic device 100 (such as audio data, a phone book, etc.), etc. In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc.

[0099] The electronic device 100 can implement audio functions through the audio module 170, speakers, receivers, microphones, headphone interfaces, and application processors, such as music playback and recording. Among them, the headphone interface is used to connect wired headphones. The headphone interface can be a USB interface 130. For details, please refer to the relevant technology, which will not be repeated here.

[0100] The sensor module 180 may include a pressure sensor, a gyro sensor, an air pressure sensor, a magnetic sensor, an acceleration sensor, a distance sensor, a proximity light sensor, a fingerprint sensor, a temperature sensor, a touch sensor 180K, an ambient light sensor, a bone conduction sensor, and the like.

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

[0102] The key 190 includes a power key, a volume key, etc. The key 190 may be a mechanical key or a touch key. The electronic device 100 may receive key input and generate key signal input related to user settings and function control of the electronic device 100.

[0103] The SIM card interface 195 is used to connect a SIM card. The SIM card can be connected to or disconnected from the electronic device 100 by inserting the SIM card interface 195 or removing the SIM card interface 195. The electronic device 100 can support 1 or N SIM card interfaces, where N is a positive integer greater than 1. The SIM card interface 195 can be compatible with different types of SIM cards. The SIM card interface 195 can also be compatible with an external memory card. The electronic device 100 interacts with the network through the SIM card to implement functions such as calls and data communications.

[0104] The software system of the electronic device 100 may adopt a layered architecture, an event-driven architecture, a micro-kernel architecture, a micro-service architecture, or a cloud architecture. In the embodiment of the present invention, an operating system of a layered architecture is used as an example to exemplify the software structure of the electronic device 100.

[0105] The layered architecture divides the software into several layers, each with clear roles and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the operating system is divided into four layers, from top to bottom: application layer, application framework layer, hardware abstraction layer (HAL), and kernel layer. Figure 3 FIG. 1 is a software structure diagram of the electronic device 100 according to an embodiment of the present invention. Figure 3 The hardware layer is also shown in FIG.

[0106] It should be noted that the embodiment of the present application is illustrated by taking a common operating system as an example. In other operating systems, as long as the functions implemented by each functional module are similar to those of the embodiment of the present application, the solution of the present application can also be implemented.

[0107] The application layer can include a series of application packages. Figure 3 As shown, the application package may include applications such as a camera, an image editing application, etc.

[0108] The camera is used to provide a shooting function. The image editing application is used to provide an image editing function. For example, common image editing applications include photo albums, photo galleries, image editors, etc. In an embodiment of the present application, in response to a user's operation, the electronic device can generate a dynamic spatial image based on the image to be processed through the image editing application.

[0109] The application framework layer provides an application programming interface (API) and a programming framework for the applications in the application layer. The application framework layer includes some predefined functions.

[0110] like Figure 3 As shown, the application framework layer may include a camera service. The camera service is used to connect the camera application and the related hardware of the hardware layer. In some embodiments, the camera service can realize the connection between the camera application and the hardware layer by calling the hardware interface.

[0111] It can be understood that the application framework layer can also include a window manager, a content provider, a view system, a phone manager, a resource manager, a notification manager, etc.

[0112] The HAL layer is located above the kernel layer. The HAL layer can abstract the hardware of the hardware layer, hide the differences between different hardware, and provide a unified hardware interface for the upper layer.

[0113] like Figure 3 As shown, the HAL layer includes a camera HAL and an image processing module.

[0114] The camera HAL is used to connect the camera service to the underlying camera driver and camera.

[0115] The image processing module is used to perform processing operations such as scaling and splicing on images.

[0116] In some embodiments, the image processing module can scale the material in the image to be processed, and then splice the scaled material to generate a dynamic space image. The specific implementation method can be found in the subsequent embodiments, which will not be repeated here.

[0117] The kernel layer is the layer between the hardware layer and the software layer. Figure 3 As shown, the kernel layer includes a camera driver, and the camera driver is used to control the camera of the hardware layer to perform shooting actions.

[0118] It can be understood that the kernel layer may also include display drivers, audio drivers, sensor drivers, etc., and these drivers will not be described in detail here.

[0119] The following is an illustrative description of the workflow of the software and hardware of the electronic device 100 in conjunction with scenes of captured images and photo taking scenes.

[0120] In the scene where the image has been captured, the image editing application located in the application layer displays an image editing interface in the electronic device, and the image editing interface includes the image to be processed and the control for generating dynamic space images. When the touch sensor receives a touch operation, the corresponding hardware interrupt is sent to the kernel layer. The kernel layer processes the touch operation into an original input event (including touch coordinates, timestamp of the touch operation and other information). The original input event is stored in the kernel layer. The framework layer obtains the original input event from the kernel layer, and can identify that the control corresponding to the input event is a control for generating dynamic space images. Then, the image editing application calls the interface provided by the camera service of the framework layer. After the interface provided by the camera service is called, the image processing module in the HAL layer can process the original image into a dynamic space image with a Hitchcock zoom effect. After that, the image processing module can send the generated dynamic space image to the image editing application so that the image editing application can display the dynamic space image to the user.

[0121] In the photo-taking scenario, the camera application located in the application layer displays the shooting interface in the electronic device, and the user can operate the shooting control in the shooting interface. Similar to the above scenario, the touch sensor receives the touch operation, and after a series of processing in the kernel layer and the application framework layer, it can identify the control corresponding to the touch operation as a shooting control. Then, the camera calls the interface provided by the camera service of the framework layer. After the interface provided by the camera service is called, the camera HAL in the HAL layer can call the camera driver of the kernel layer, and the camera driver can capture the original image through the camera. After that, the camera sends the original image to the image processing module of the HAL layer through the camera driver. The image processing module can process the original image into a dynamic space image with a Hitchcock zoom effect. The image processing module can send the generated dynamic space image to the gallery application for display, or store the generated dynamic space image in the memory of the electronic device.

[0122] The following describes an image processing method provided by an embodiment of the present application.

[0123] like Figure 4 A schematic diagram of a flow chart of an image processing method provided in an embodiment of the present application, the method is executed by an electronic device, and includes the following steps:

[0124] S401: Obtain an image to be processed.

[0125] The way to obtain the image to be processed corresponds to different application scenarios. For example, in the scene of shooting dynamic space images, in response to the user's operation on the shooting control, the electronic device can use the image obtained at the moment when the user operates the shooting control as the image to be processed. For another example, in the scene where the image has been shot, in response to the user's selection operation on the image, the electronic device can use the image corresponding to the selection operation as the image to be processed.

[0126] The following describes the specific implementation of S401 in the scenario of shooting a dynamic spatial image.

[0127] In some embodiments, in a scene of shooting a dynamic spatial image, the electronic device may use the image captured by the camera when the user operates the shooting control as the image to be processed. Alternatively, in a scene of taking a photo, if the electronic device turns on the dynamic spatial image processing image shooting mode, the electronic device may use the image captured by the camera when the user operates the shooting control as the image to be processed.

[0128] Among them, the electronic device turning on the dynamic space image processing image shooting mode may mean that the electronic device can execute the image processing method provided in the embodiment of the present application to generate a dynamic space image based on the image to be processed.

[0129] For example, taking the electronic device as a mobile phone, in a photo-taking scene, and the mobile phone turns on the dynamic spatial image processing image shooting mode, the display screen of the mobile phone displays the following: Figure 5 The shooting preview interface shown. The shooting preview interface includes a viewfinder, a shooting control 501, a thumbnail icon 502 for opening the gallery, etc. The image displayed in the viewfinder is a preview image captured by the current camera in real time. When the user operates the shooting control 501, the mobile phone will obtain the image captured by the camera at the time when the user operates the shooting control 501 as the image to be processed.

[0130] In some examples, the electronic device displays Figure 5 After that, in response to the user's operation on the shooting control 501, the electronic device may display the same Figure 5 A similar shooting preview interface is shown, and the thumbnail icon 502 for opening the gallery in the interface is a thumbnail of the image to be processed. In this example, in response to the user's operation on the shooting control 501, the electronic device displays a thumbnail similar to the image to be processed. Figure 5 A similar shooting preview interface may be the first interface in this application, in which the thumbnail icon 502 for opening the gallery is the thumbnail of the image to be processed, which is the first thumbnail in this application, and the image to be processed is the first image in this application.

[0131] It should be noted that the display on the mobile phone shows Figure 5In the case of the shooting preview interface shown, it means that the camera application is running. At this time, the camera starts to capture images continuously and outputs these images in the order of capturing images. These images are sent to the preview stream processing module and the data stream processing module respectively, wherein the image sequence processed by the preview stream processing module is displayed in sequence on the display screen of the mobile phone, providing the user with a preview screen during the shooting process. The mobile phone selects the image corresponding to the user's operation of the shooting control 501 from the image sequence processed by the data stream processing module as the captured image, that is, the image to be processed. In the above process, only the preview stream processing process and the data stream processing process during the shooting process are briefly introduced. For more detailed processing process, please refer to the relevant technology, which will not be repeated here.

[0132] The following describes the specific implementation of S401 in a scene where an image has been captured.

[0133] The scene where an image has been captured refers to a scene where the electronic device has captured an image by shooting, communicating with other electronic devices, etc., and the image has been stored in the electronic device. In this scene, the user selects an image by long pressing, clicking, or other selection operations, and the electronic device can use the image selected by the user as an image to be processed. Still taking the electronic device as a mobile phone as an example, the following describes various implementation methods in this scene in conjunction with the accompanying drawings.

[0134] In some embodiments, Figure 6 As shown, the mobile phone displays an album display interface, which includes zoom icons of multiple stored images. After the user operates the zoom icon 503 of one of the images, the electronic device can display an image display interface corresponding to the zoom icon 503, such as Figure 6 As shown, the image display interface includes a dynamic space image generation control 504. In response to the user's operation on the dynamic space image generation control 504, the electronic device can use the image as an image to be processed.

[0135] In the above embodiment, Figure 6 The album display interface shown can be the first interface in the present application. The zoom icons of the multiple stored images included in the album display interface are thumbnails of the images. The zoom icon 503 operated by the user is the first thumbnail in the present application. The user's operation on the zoom icon 503 is the first operation in the present application, and the image corresponding to the zoom icon 503 is the first image in the present application.

[0136] In addition, if Figure 6 The image display interface shown may be the third interface in the present application, the image displayed on the image display interface may be the first image in the present application, and the dynamic spatial image generation control 504 in the image display interface may be the first control in the present application.

[0137] In some embodiments, Figure 7 As shown, the mobile phone displays an album display interface, and the album display interface includes zoom icons of multiple stored images. In response to the user's operation of selecting the zoom icon of at least one of the images and then generating a dynamic spatial image control 505 in the album display interface, the electronic device can use the at least one image selected by the user as an image to be processed.

[0138] In the above embodiment, Figure 7 The album display interface shown may be the first interface in the present application. The zoom icons of the multiple stored images included in the album display interface are thumbnails of the images. The zoom icon with a check mark is the first thumbnail in the present application. The user's operation on the zoom icon is the first operation in the present application. The image corresponding to the zoom icon with a check mark is the first image in the present application. In this scenario, there are multiple first images. Figure 7 The dynamic space image generation control 505 is the second control in this application. In the case where there is only one zoom icon with a check mark, the image corresponding to the zoom icon is the first image in this application. In this case, there is one first image.

[0139] In response to the user's Figure 5 In response to the user's operation on the icon of the gallery application displayed on the mobile phone, the mobile phone may display the thumbnail icon 502 for opening the gallery in the shooting preview interface of the mobile phone as shown in the figure, or in response to the user's operation on the icon of the gallery application displayed on the mobile phone, the mobile phone may display the thumbnail icon 502 as shown in the figure in the figure in the figure Figure 6 ,or Figure 7 The album display interface shown.

[0140] It can be understood that in the above embodiments, Figure 6 The album display interface shown and Figure 7 The album display interfaces shown are different types of album display interfaces, and different types of album display interfaces can be switched between each other. Figure 6 In the case of the album display interface shown in the figure, in response to the user's Figure 6 By long pressing the zoom icon of an image in the album display interface shown in FIG. 1 , the album display interface displayed on the mobile phone can be transformed into the following Figure 7 As shown in the album display interface. Figure 7 In the case of the album display interface shown in the figure, in response to the user's Figure 7 The blank space or exit control ( Figure 7 (not shown) operation, the album display interface displayed by the mobile phone can be transformed into the following Figure 6 The album display interface shown.

[0141] S402: Determine the fixed material and the variable material in the image to be processed.

[0142] The fixed material in the image to be processed refers to the shooting object whose area ratio of the shooting screen of multiple frames of images in the dynamic space image remains unchanged, that is, the target object to be shot mentioned in the above-mentioned technical introduction. Correspondingly, the variable material refers to the shooting object whose area ratio of the shooting screen of multiple frames of images in the dynamic space image changes, that is, the other objects to be shot mentioned in the relevant technical introduction.

[0143] For example, in Figure 1 In the dynamic space image shown, the portrait 101 is a fixed material, and the buildings and trees 102 behind the portrait are variable materials.

[0144] The fixed material in the embodiment of the present application may be the first content element and the fourth content element in the present application, and the variable material may be the second content element and the fifth content element in the present application.

[0145] In some embodiments, the electronic device can automatically identify fixed materials and variable materials in the image to be processed. For example, the electronic device can identify all materials from the image to be processed, and then determine a specific type of material among all the materials as a fixed material.

[0146] For example, the specific type is a person. The electronic device identifies material 1: a portrait, material 2: a building, and material 3: a tree from the image to be processed. Among them, the type of the portrait belongs to a person, so the electronic device can use material 1 as a fixed material.

[0147] Accordingly, the electronic device may use other types of materials that are not people and are identified from the image to be processed as the change material. For example, the electronic device may use material 2 and material 3 as the change material.

[0148] For example, the specific type is a person. Figure 6 As shown, in response to the user's operation on the dynamic space image generation control 504, the electronic device can automatically use the portrait as the fixed material 506 and the remaining buildings and trees as the variable materials 507 to generate a dynamic space image.

[0149] In other examples, the specific type is within a preset depth range. The electronic device can use the material within the preset depth range as a fixed material. Exemplarily, the electronic device identifies material 1: portrait, material 2: building, and material 3: tree from the image to be processed, wherein the depth of material 1 is 3.5 meters, the depth of material 2 is 4.5 meters, and the depth range of material 3 is 5 meters. In the case where the specific type is within a depth range of 3-4 meters, the electronic device can use the material within a depth range of 3-4 meters as a fixed material. Specifically, since the depth of material 1 is 3.5 meters, which is within the range of 3-4 meters, the electronic device can use material 1 as a fixed material. Accordingly, since the depth of material 2 is 4.5 meters and the depth of material 3 is 5 meters, the depths of both are not within the range of 3-4 meters, and therefore, the electronic device can use material 2 and material 3 as variable materials.

[0150] The depth of the material refers to the distance between the material and the camera. It can be understood that since the camera includes a lens, the lens and the camera can be considered to be in the same position, so the depth of the material can also refer to the distance between the material and the lens in the camera.

[0151] It should be noted that, when the image to be processed carries depth information, the electronic device can directly analyze based on the depth information to obtain the depth of each material in the image to be processed. When the image to be processed does not carry depth information, the electronic device can perform depth estimation on the image to be processed to obtain the depth of each material in the image to be processed.

[0152] In some embodiments, the electronic device can determine the fixed material and the variable material according to the user's operation. Specifically, the electronic device can determine the fixed material and the variable material in different ways in different scenarios. The following describes the process through several examples.

[0153] In some examples, in response to the user's designation operation on the fixed material, the electronic device may determine that the user-designated material is the fixed material, and then the electronic device may use the remaining materials as variable materials.

[0154] For example, in response to a user's focus operation, the electronic device may use the image of the person in focus as a fixed material. Figure 5 As shown, in response to the user's operation on the portrait 508 in the viewfinder, the electronic device can focus on the portrait 508 and use the portrait 508 as a fixed material, and the rest of the images as variable materials. Figure 5 As shown, after the electronic device focuses on the portrait 508, the electronic device can display a dotted frame around the portrait 508 to indicate that the current camera focus is on the portrait 508 and the portrait 508 is a fixed material.

[0155] In other examples, when an electronic device obtains an image to be processed, the electronic device can identify multiple materials from the image to be processed. In response to a user's selection operation on one of the materials, the electronic device can use the material selected by the user as a fixed material and the remaining unselected materials as variable materials.

[0156] For example, after the mobile phone obtains an image to be processed, it recognizes multiple materials from the image to be processed and displays them as follows: Figure 8 The fixed material selection interface shown. After the user selects one of the materials, in response to the user's operation on the confirmation control 601, the mobile phone can use the material selected by the user as the fixed material and the other materials not selected by the user as the variable materials.

[0157] In the above example, if Figure 8 The fixed material selection interface shown may be the fourth interface in this application, and the option corresponding to each material displayed in the fixed material selection interface may be the first option in this application. Figure 8 As shown, the material with a check mark is the option selected by the user, and the option selected by the user is the first content option in this application.

[0158] In some other examples, in response to the user's designation operations on the fixed material and the changing material, respectively, the electronic device may determine that the fixed material designated by the user is the fixed material, and determine that the changing material designated by the user is the changing material.

[0159] For example, the electronic device may first determine multiple materials from the image to be processed, and then determine the fixed material and the variable material according to the user's selection operation. Fig. 9 As shown, after the user selects three images to be processed in the album, in response to the user's operation on the control 602 for generating dynamic spatial images, the electronic device can identify all materials from the selected three images to be processed, and display all the identified materials in the fixed material selection interface. After the user selects one of the materials in the fixed material selection interface, in response to the user's operation on the confirmation control 603 in the fixed material selection interface, the electronic device can use the selected material as a fixed material, and display all the materials except the fixed material in the variable material selection interface. After the user selects at least one variable material in the variable material selection interface, in response to the user's operation on the confirmation control 604 in the variable material selection interface, the electronic device can use the material selected by the user from the variable material selection interface as a variable material, and generate a dynamic spatial image based on the fixed material and the variable material.

[0160] In response to the user's operation on generating the dynamic space image control 602, the electronic device may first display Fig. 9 In response to the user's operation of the confirmation control 604 in the change material selection interface, the electronic device displays Fig. 9 Finally, in response to the user's operation on the confirmation control 603 in the fixed material selection interface, the electronic device can generate a dynamic space image based on the fixed material and the changing material, and display a display interface of the dynamic space image.

[0161] In the above example, if Fig. 9 The fixed material selection interface shown may be the fourth interface in this application, and the option corresponding to each material displayed in the fixed material selection interface may be the first option in this application. Fig. 9 The material with a check mark in the fixed material selection interface shown is the option selected by the user, and the option selected by the user is the first content option in this application. Fig. 9 The changing material selection interface shown may be the fifth interface in this application, and the options corresponding to each material displayed in the fixed material selection interface may be the second options in this application. Fig. 9 The material with a check mark in the change material selection interface shown is the option selected by the user, and the option selected by the user is the second content option in this application.

[0162] The variable material may be all materials except the fixed material in the image to be processed, or may be part of the materials except the fixed material in the image to be processed.

[0163] Understandably, Figure 8 as well as Fig. 9 In the scenario shown, the electronic device acquires three images to be processed, then determines all materials from the three images to be processed, and then displays a fixed material selection interface, or displays a fixed material selection interface and a variable material selection interface in sequence. In the scenario where the electronic device acquires only one image to be processed, the electronic device may also first determine all materials from the one image to be processed and display a fixed material selection interface, or display a fixed material selection interface and a variable material selection interface in sequence.

[0164] For example, an electronic device displays Figure 5 In response to the user's operation on the shooting control 501, the electronic device may display the following shooting preview interface: Figure 8 The fixed material selection interface shown can also be Fig. 9 As shown, the fixed material selection interface is displayed first, and then the variable material selection interface is displayed.

[0165] For example, an electronic device displays Figure 6In response to the user's operation on the dynamic spatial image control 504 generated in the image display interface, the electronic device may display the following Figure 8 The fixed material selection interface shown can also be Fig. 9 As shown in the figure, the fixed material selection interface is displayed first, and then the variable material selection interface is displayed. Or, the electronic device displays as shown in the figure. Figure 7 In the album display interface shown in FIG. 1 , in response to the user's operation on the dynamic spatial image control 505 generated in the album display interface, the electronic device may display the following Figure 8 The fixed material selection interface shown can also be Fig. 9 As shown, the fixed material selection interface is displayed first, and then the variable material selection interface is displayed.

[0166] In the above embodiment, the electronic device can use image segmentation technology to segment different materials from the image to be processed. Specifically, any one or a combination of methods such as a threshold-based segmentation method, a region-based segmentation method, an edge-based segmentation method, and a segmentation method based on a specific theory can be used to segment the image to be processed. For details, please refer to the introduction of related technologies, which will not be repeated here.

[0167] In the above embodiment, when the electronic device executes the image processing method, it needs to read the image and other information stored in the memory and identify the content in the image to be processed. That is to say, the image processing method needs to use the user's personal information during execution. Therefore, the electronic device needs to ensure that the personal information it uses is limited to obtaining the user's consent. The way to obtain the user's consent includes but is not limited to notifying and reminding the user to read the relevant user agreement or notice before the user uses this function, and signing an agreement including authorization of relevant user information.

[0168] For example, before the electronic device implements the image processing method provided in the embodiment of the present application, the electronic device may display authorization prompt information, which includes prompt text, an authorization consent option, and a authorization rejection option. The prompt text is used to introduce the personal information that the electronic device needs to use when implementing the above-mentioned image processing method and the scope of use of the personal information.

[0169] In some examples, the electronic device displays a prompt text to notify and remind the user to read the relevant user agreement or notification, and after the user signs the agreement including the authorization of relevant user information, the electronic device can execute the image processing method provided in the embodiment of the present application. For example, if the user reads the prompt text and selects the option to agree to the authorization, the electronic device can execute the image processing method provided in the embodiment of the present application. If the user reads the prompt text and selects the option to refuse authorization, the electronic device cannot execute the image processing method provided in the embodiment of the present application.

[0170] After the electronic device determines the fixed material and the variable material, the following steps (S403-S404) may be performed to generate a dynamic spatial image.

[0171] S403: Determine the zoom ratio of the changed material.

[0172] The electronic device can scale the changing material based on the zoom ratio. Generally, the zoom ratio can be represented by a positive number greater than zero. When the zoom ratio is greater than 1, it means that the changing material will be enlarged; when the zoom ratio is greater than zero and less than 1, it means that the changing material will be reduced; when the zoom ratio is equal to 1, the changing material will not be enlarged or reduced.

[0173] In some embodiments, a default zoom ratio may be pre-configured in the electronic device. Alternatively, a plurality of zoom ratios may be pre-configured in the electronic device, and the electronic device displays a zoom ratio selection interface, wherein the zoom ratio selection interface includes options corresponding to a plurality of zoom ratios, so that the user may select one of the zoom ratios. In response to the user's operation on an option corresponding to a zoom ratio in the zoom ratio selection interface, the electronic device may determine the zoom ratio corresponding to the option as the zoom ratio of the changed material.

[0174] In some other embodiments, the electronic device may determine the zoom ratio according to the user's settings. In response to the user inputting the zoom ratio, the electronic device may determine the zoom ratio. Specifically, the user may input a fixed zoom ratio in the electronic device so that the changing material may present a uniform zoom effect in the dynamic space image; the user may also input a zoom ratio that changes over time in the electronic device so that the changing material may present a more flexible zoom effect in the dynamic space image according to the user's needs.

[0175] In some examples, the electronic device may display different zoom ratio input interfaces so that the user can use different input methods to input a specified zoom ratio in the zoom ratio input interface. For example, the zoom ratio input interface displayed by the electronic device may include a text box, and the user can directly enter the zoom ratio in the text box. For another example, the zoom ratio input interface displayed by the electronic device may include a zoom ratio editing area, and the user can draw the zoom ratio that changes over time in the zoom ratio editing area. Fig.10 As shown, the electronic device includes a coordinate system with the horizontal axis representing time and the vertical axis representing the zoom ratio in the zoom ratio input interface displayed. The first quadrant of the coordinate system is the zoom ratio editing area. Fig.10 As shown, the operation of the user's finger drawing an undulating curve in the zoom ratio editing area is an operation of inputting a zoom ratio that changes over time.

[0176] In the above example, the zoom ratio input interface is the sixth interface in the present application. The zoom ratio editing area included in the sixth interface can have multiple forms. The zoom ratio is the first zoom ratio in the embodiment of the present application.

[0177] The electronic device may display a zoom ratio input interface after acquiring the image to be processed. For example, the electronic device displays Figure 5 In response to the user's operation on the shooting control 501, the electronic device may display the following shooting preview interface: Fig.10 As another example, the electronic device displays the zoom ratio input interface shown in FIG. Figure 6 In response to the user's operation on the dynamic spatial image generation control 504, the electronic device may display the following image display interface: Fig.10 For example, the electronic device displays the zoom ratio input interface as shown in FIG. Figure 7 In the album display interface shown in FIG. 1 , in response to the user's operation on the dynamic spatial image generation control 505, the electronic device may display the following Fig.10 The zoom ratio input interface shown.

[0178] In addition, the electronic device may also display a zoom ratio input interface after determining the fixed material and the variable material. Figure 5 In response to the user's operation on the shooting control 501, the electronic device may display the following shooting preview interface: Figure 8 In response to the user's Figure 8 In the confirmation control 601 operation, the electronic device can display Fig.10 Alternatively, in response to a user inputting a zoom ratio Figure 5 In the operation of the shooting control 501, the electronic device first displays the following Fig. 9 The fixed material selection interface shown in the figure will be displayed. Fig. 9 In response to the user's Fig. 9 The electronic device may display the following information: Fig.10 The zoom ratio input interface shown.

[0179] In some embodiments, when shooting a dynamic spatial image with a Hitchcock zoom effect, the focal length of the lens is actually changed in the direction opposite to the moving direction when the camera is controlled to move forward or backward, so that the area ratio of the fixed material in the image in the shooting screen remains unchanged, and the area ratio of the remaining variable material in the shooting screen decreases or increases in sequence. Therefore, the electronic device can calculate the zoom ratio using the optical principle in the shooting process.

[0180] The following combination Fig.11 This section describes the calculation process of the zoom ratio.

[0181] Fig.11 A shooting scene is shown in FIG. 1 , which includes an object corresponding to a changing material, an object corresponding to a fixed material, and a camera. The distance between the object corresponding to the changing material and the camera is relatively far, and the distance between the object corresponding to the fixed material and the camera is relatively close. In the shooting scene, before the camera moves, the focal length of the camera is f0, and the object distance corresponding to the fixed material is u fg0 , the distance corresponding to the fixed material is v fg0 , the object height corresponding to the fixed material is y ofg , the image height corresponding to the fixed material is y ifg , the object distance corresponding to the changing material is u bg0 , the distance corresponding to the changing material is v bg0 , the height of the object corresponding to the changed material is y obg , the image height corresponding to the changed material is y ibg0 In this scene, the camera moves forward at speed vel while continuously shortening the focal length to keep the foreground image high y ifg unchanged, after a period of time Δt, the focal length of the camera is f1, and the object distance corresponding to the fixed material is u fg1 , the distance corresponding to the fixed material is v fg1 , the object height corresponding to the fixed material is y ofg , the image height corresponding to the fixed material is y ifg , the object distance corresponding to the changing material is u bg1 , the distance corresponding to the changing material is v bg1 , the height of the object corresponding to the changed material is y obg , the image height corresponding to the changed material is y ibg1 .

[0182] Among them, after the camera moves, the object distance corresponding to the fixed material can be expressed as:

[0183]

[0184] After the camera moves, the object distance corresponding to the changed material can be expressed as:

[0185]

[0186] exist Fig.11 In the change process shown, when the camera moves forward, the focal length of the camera is shortened to ensure that the image height corresponding to the fixed material remains unchanged.

[0187] According to the principle of similar triangles, for the state before the camera moves, there is the following relationship:

[0188]

[0189] For the state of the camera after moving, there is the following relationship:

[0190]

[0191] Among them, v fg0 =v bg0 , v fg1 =v bg1 .

[0192] According to the above formula, after the camera moves, the image height corresponding to the changed material is:

[0193]

[0194] Then, the scaling factor of the changing material is:

[0195]

[0196] According to the above-mentioned formula for calculating the zoom ratio of the changing material, the electronic device can obtain the object distance of the changing material and the object distance of the fixed material in the image captured before the camera moves, the speed of movement, and the time interval of movement, and then calculate the zoom ratio of the changing material, and then scale the changing material based on the zoom ratio. The scaled changing material is recombined with the fixed material to obtain the image captured after the camera moves. In other words, the electronic device can generate multiple frames of images based on the changing material and the fixed material, that is, generate a dynamic spatial image with the same effect as the mobile shooting effect.

[0197] In some embodiments, after acquiring the image to be processed, the electronic device determines the fixed material and the variable material from the image to be processed, and the electronic device needs to scale the size of the variable material to generate a dynamic space image. Then, in the case where the electronic device needs to generate a dynamic space image with the same Hitchcock zoom effect as the camera moving at the speed vel, the electronic device can obtain the object distance of the variable material and the object distance of the fixed material in the image to be processed, and calculate the scaling ratio according to the above-mentioned scaling ratio formula of the variable material, and scale the variable material according to the calculated scaling ratio to obtain multiple frames of continuous images, and the multiple frames of continuous images are the dynamic space image.

[0198] In the above embodiment, the electronic device can obtain the object distance of the variable material and the object distance of the fixed material by obtaining the depth information of the image to be processed. The depth information of the image to be processed is used to represent the distance between each material in the image to be processed and the lens, and the focal length of the lens is known when shooting the image to be processed. In this way, the object distance of the variable material and the object distance of the fixed material can be calculated according to the imaging formula of the convex lens. The specific calculation process can be referred to the relevant technology, which will not be repeated here.

[0199] In some examples, when the electronic device has only a single camera, or when the electronic device only obtains an image to be processed without any depth information, the electronic device can estimate the depth information of the image to be processed based on a depth estimation technology based on a traditional algorithm or an artificial intelligence algorithm. For specific depth estimation technology, please refer to the relevant technology, which will not be described in detail here.

[0200] In some scenarios of the above examples, the electronic device can obtain the user's specified depth for each material. After the electronic device obtains the image to be processed, the electronic device can identify all the materials from the image to be processed. Then, the electronic device can display the following information: Fig.12 The fixed material selection and depth specification interface shown in FIG. 1 shows icons and options corresponding to all materials and a text input box 901 for specifying the depth of the fixed material. After the user selects the option corresponding to the fixed material and enters the depth of the fixed material as 5 meters, in response to the user's operation of the confirmation control 902 in the fixed material selection and depth specification interface, the electronic device can confirm the fixed material and the fixed material depth, and display the variable material selection and depth specification interface. In the variable material selection and depth specification interface, icons and options corresponding to all materials except the fixed material and a text input box 903 for specifying the depth of the variable material are displayed. After the user selects the option corresponding to the variable material and enters the depth of the variable material as 50 meters, in response to the user's operation of the confirmation control 904 in the variable material selection and depth specification interface, the electronic device can confirm the variable material and the variable material depth, and generate a dynamic space image based on the fixed material and the depth of the fixed material, the variable material and the depth of the variable material, and display the dynamic space image display interface.

[0201] In the above embodiment, if Fig.12 The fixed material selection and depth specification interface and the variable material selection and depth specification interface shown may be the eighth interface in this application. The text input box 901 for specifying the fixed material depth may be the first depth editing area in this application, and the text input box 903 for specifying the variable material depth may be the second depth editing area in this application. The depth of the fixed material is the first depth, and the depth of the variable material is the second depth.

[0202] In other examples, when the electronic device has multiple cameras, or a depth camera such as ToF or structured light, the electronic device can directly capture the image to be processed with depth information.

[0203] It should be noted that, according to the above-mentioned formula for the zoom ratio, when the moving speed vel remains unchanged, if the depth of the changing material changes, the zoom ratio corresponding to the changing material will change. Therefore, when a default moving speed is pre-configured in the electronic device, the electronic device can determine the zoom ratio of each changing material according to the depth of the changing material. For example, if the depth of the changing material is high, the zoom ratio determined by the electronic device for the changing material is high, and if the depth of the changing material is low, the zoom ratio determined by the electronic device for the changing material is low.

[0204] In addition, when the electronic device determines the zoom ratio according to the user's settings, the electronic device can obtain the zoom ratio specified by the user for each change material. For example, when there are three change materials, the zoom ratio input interface includes a zoom ratio input text box corresponding to each change material, and after the user enters the corresponding zoom ratio in the zoom ratio input text box corresponding to each change material, the electronic device can determine the zoom ratio of each change material.

[0205] In some embodiments, when calculating the zoom ratio according to the above zoom ratio formula, the electronic device can determine Δt according to a preset frame rate pre-stored or set in the electronic device. The frame rate is the number of frames per second (fps) of the image transmitted per second. Then, the time interval between two consecutive frames of the dynamic space image, i.e., Δt, can be calculated according to the frame rate. In addition, since the higher the frame rate, the more frames per second, the smoother the action displayed by the image will be. Therefore, in order to ensure the smoothness of the dynamic space image, the electronic device can determine Δt according to a higher frame rate.

[0206] In some examples, the electronic device may also determine the frame rate according to the user's operation. For example, the user may input a user-specified frame rate in the frame rate setting interface.

[0207] In some embodiments, a default speed vel may be pre-configured in the electronic device, so that the zoom ratio of the changing material can be calculated according to the speed vel. Alternatively, a plurality of speeds vel may be pre-configured in the electronic device, and the electronic device displays a speed vel selection interface, which includes options corresponding to a plurality of speeds vel, so that the user can select one of the speeds vel. In response to the user's operation on an option corresponding to a certain speed vel in the speed vel selection interface, the electronic device may calculate the zoom ratio of the changing material according to the speed vel corresponding to the option.

[0208] In some other embodiments, the electronic device can determine the zoom ratio according to the speed vel set by the user. In response to the user inputting the speed vel, the electronic device can calculate the zoom ratio according to the speed vel. Specifically, the user can input a fixed speed vel in the electronic device; the user can also input a speed vel that changes over time in the electronic device, so that the changing material can present a more flexible zoom effect in the dynamic space image according to the user's needs.

[0209] In some examples, the electronic device may display different speed input interfaces so that the user can use different input methods to input a specified speed in the speed input interface. For example, the speed input interface displayed by the electronic device may include a text box, and the user can directly enter the speed in the text box. For another example, the speed input interface displayed by the electronic device may include a speed editing area, and the user can draw the speed that changes over time in the speed editing area. Fig.13 As shown, the electronic device includes a coordinate system in which the horizontal axis is time and the vertical axis is speed in the displayed speed input interface. The first quadrant and the second quadrant of the coordinate system are speed editing areas, such as Fig.13 As shown, the operation of the user's finger drawing an undulating curve in the speed editing area is an operation of inputting a speed that changes over time.

[0210] In the above example, the speed input interface is the seventh interface in this application. The speed editing area included in the seventh interface can have multiple forms. The speed is the moving speed in the embodiment of this application.

[0211] The electronic device may display the speed input interface after acquiring the image to be processed. Specifically, the electronic device displays the speed input interface in a scene similar to the electronic device displays the speed input interface. Fig.10 The scene of the zoom ratio input interface shown is similar, please refer to Fig.10 The embodiments shown will not be described in detail here.

[0212] After the electronic device determines the zoom ratio of the changed material, S404 may be executed:

[0213] S404: Scaling the changing material according to the scaling factor of the changing material to generate a dynamic space image including multiple frames of continuous target images.

[0214] The same change material in two adjacent target images is enlarged or reduced according to the zoom ratio. The dynamic space image including multiple frames of continuous target images is a plurality of dynamic space images in this application.

[0215] In one implementation of S404, after the electronic device performs scaling based on the changing material determined in the image to be processed, it can perform scaling again based on the changing material after each scaling process. For example, after the electronic device performs scaling on the changing material, it can combine the changing material after scaling with the fixed material into a new target image. Afterwards, the electronic device continues to perform scaling on the scaling changing material, and again combines the obtained new changing material with the fixed material into a new target image, and the aforementioned two new target images are continuous and different target images. Repeating the action of scaling again on the changing material after scaling multiple times, and combining the changing material after each scaling process with the fixed material into a new target image, the electronic device can generate a dynamic spatial image including multiple frames of continuous target images.

[0216] In the above implementation, the zoom factor may be a fixed value or a set of numbers.

[0217] When the zoom ratio is a fixed value, the electronic device uses the same zoom ratio for each zoom process on the changing material that needs to be zoomed. For example, when the electronic device defaults to a fixed zoom ratio, or the user specifies a zoom ratio, the changing material that needs to be zoomed can be zoomed with the same zoom ratio in each zoom process. For example, the first changing material is zoomed 0.9 times to obtain the second changing material, and then the second changing material is zoomed 0.9 times to obtain the third changing material. The third changing material can be obtained by zooming the first changing material 0.9*0.9 times.

[0218] In the case where the zoom ratio is a set of numbers, the set of numbers includes multiple values, and the multiple values ​​are arranged in sequence. In each zoom process, the electronic device can take a value from the set of numbers as the zoom ratio in turn, and zoom the change material that needs to be zoomed. For example, the values ​​included in a set of numbers are 1, 2, and 3 in turn. Then, the electronic device can first zoom the first change material according to the zoom ratio 1 to obtain the second change material, and then the electronic device zooms the second change material according to the zoom ratio 2 to obtain the third change material, and finally, the electronic device zooms the third change material according to the zoom ratio 3 to obtain the fourth change material.

[0219] In another implementation of S404, each scaling process of the electronic device scales the changed material determined based on the image to be processed. For example, the electronic device determines the changed material A from the image to be processed, and the processing object of each scaling process of the electronic device is the changed material A.

[0220] In the above implementation, the zoom ratio can be a set of numbers, and the values ​​in the set of numbers change sequentially, so as to ensure that there are size changes between the obtained changed materials.

[0221] Still taking the example that the values ​​included in a set of numbers are 1, 2 and 3 in sequence, then the electronic device can first scale the change material A according to the scaling factor 1 to obtain the first change material, then scale the change material A according to the scaling factor 2 to obtain the second change material, and finally scale the change material A according to the scaling factor 3 to obtain the third change material.

[0222] The electronic device may combine or superimpose the variable material with the fixed material to obtain a new target image. For example, the variable material and the fixed material may be combined into the same image, or the fixed material may be superimposed on the variable material to obtain the target image.

[0223] In some embodiments, according to Fig.11 It can be seen that if the changing material and the fixed material are at the same depth, then as the camera moves and the focal length changes, the changing material will not change in size, so the changing material and the fixed material must be at different depths. Due to the different depths between the changing material and the fixed material, there is an obstruction between the two. As the changing material is scaled, the originally obstructed part of the changing material may become an unobstructed part, and then there is a problem of missing image content in this part. Alternatively, as the changing material is scaled, there may be a problem of missing image content in the part that originally exceeded the image screen after the original changing material is reduced. Therefore, in the process of scaling the changing material, it is also necessary to use image restoration (inpainting) technology or image content generation technology to fill in the missing image content.

[0224] In some examples, when generating a dynamic spatial image, the electronic device may obtain an auxiliary image for filling the image content.

[0225] The electronic device may display an auxiliary image selection interface after acquiring the image to be processed. For example, the mobile phone displays the following Figure 6 In the album display interface shown in FIG. 1 , in response to a user operating a zoom icon 503 of an image in the album display interface, the electronic device may display an image display interface corresponding to the zoom icon 503. The image display interface includes a dynamic space image generation control 504. In response to a user operating the dynamic space image generation control 504, the electronic device may display the following Fig.14The auxiliary image selection interface shown includes multiple images. After the user selects an image in the auxiliary image selection interface, in response to the user's operation on the confirmation control 1101, the electronic device can fill in the missing content in the process of generating the dynamic space image according to the auxiliary image operated by the user, so that the authenticity of the dynamic space image can be guaranteed.

[0226] In addition, the electronic device may also display an auxiliary image selection interface after determining the fixed material and the variable material. Fig. 9 After the change material selection interface shown, in response to the user's Fig. 9 The electronic device may display the following information: Fig.14 The auxiliary image selection interface shown.

[0227] Fig.14 The auxiliary image selection interface shown may be the tenth interface in the present application. The auxiliary image selection interface includes thumbnails of multiple auxiliary images, wherein the thumbnail marked with a check mark is the selected thumbnail, which is also the second thumbnail in the present application. Fig.14 The determination control 1101 in the auxiliary image selection interface shown is the seventh control in the present application. The image corresponding to each selected thumbnail is the second image, wherein the image is the third content element.

[0228] After generating the dynamic space image, the electronic device can play each frame of the dynamic space image in sequence, so that the user can see that the dynamic space image has a Hitchcock zoom effect. Fig. 9 As shown, in response to the user Fig. 9 In response to the user's operation on the confirmation control 604, the electronic device may display an interface for displaying a dynamic space image. For another example, in response to the user's operation on the confirmation control 601, the electronic device may display an interface for displaying a dynamic space image. Fig.14 As shown, in response to the user's operation on the confirmation control 1101 in the auxiliary image selection interface, the electronic device can display an interface for displaying a dynamic space image.

[0229] In the embodiment of the present application, the interface for displaying the dynamic spatial image may be the second interface in the present application. In other scenarios, in response to the user's operation, the electronic device may generate and display the dynamic spatial image interface as the second interface, and these specific scenarios are not limited here.

[0230] In some embodiments, the electronic device may first display a shooting preview interface. The shooting preview area includes a viewfinder screen and shooting controls. The shooting preview interface here is similar to Figure 5The same. The shooting preview interface here is the twelfth interface. In response to the user's operation on the shooting control 501, the electronic device can capture the image to be processed, and the image to be processed is the third image. Here, the electronic device can directly process the image to be processed to generate a dynamic space image. Afterwards, a thumbnail 502 of the dynamic space image is displayed in the shooting preview interface, and the thumbnail 502 of the dynamic space image is the third thumbnail. The fixed elements included in the image to be processed are the fourth content elements in this application, and the changing elements included in the image to be processed are the fifth content elements in this application. The user's operation on the thumbnail 502 is the ninth operation of this application. In response to the user's operation on the thumbnail 502, the electronic device can directly display a display interface including multiple dynamic space images, that is, directly display the thirteenth interface.

[0231] In other embodiments, the electronic device may also generate and play the dynamic spatial image in real time. In some examples, after the electronic device generates a frame of the dynamic spatial image, the image may be directly displayed on the display screen of the electronic device. It should be noted that in this process, the speed at which the electronic device generates the dynamic spatial image should be greater than or equal to the frame rate of the playback, so as to ensure the smoothness of the playback of the dynamic spatial image.

[0232] In other examples, when the electronic device generates and plays the dynamic space image in real time, the dynamic space image can be generated according to the current moving speed of the electronic device, thereby increasing the user's immersion in watching the dynamic space image. For example, when the electronic device executes S403, the zoom ratio can be calculated in real time according to the current moving speed of the electronic device, and the changing material can be zoomed according to the calculated zoom ratio to obtain a frame of the dynamic space image, and the image is displayed on the display screen. Since the electronic device calculates the zoom ratio according to the current moving speed of the electronic device, the calculated zoom ratio changes with the change of the movement of the electronic device. According to the calculation formula in the above embodiment, if the moving speed of the electronic device is fast, the zoom ratio is large or the change is large, then the change amplitude of the changing material is also large; conversely, if the moving speed of the electronic device is slow, the zoom ratio is small or the change is small, then the change amplitude of the changing material is also small. At this time, when the electronic device plays the dynamic space image, it can achieve that the playback effect changes with the change of the moving speed of the electronic device, so that the playback effect of the dynamic space image can be improved and the user's sense of reality of watching the dynamic space image can be increased.

[0233] When calculating the zoom ratio according to the above formula, the time when the electronic device starts to move can be used as the start of integration, or the time when each image is generated can be used as the start of integration. In this way, the calculated zoom ratios are different. How to calculate the zoom ratio according to the above formula can be determined according to actual application requirements.

[0234] An embodiment of the present application also provides a computer-readable storage medium, which includes computer instructions. When the computer instructions are executed on the above-mentioned electronic device, the electronic device executes each function or step in the above-mentioned method embodiment.

[0235] The embodiment of the present application also provides a computer program product, including a computer program. When the computer program runs on an electronic device, the electronic device executes each function or step in the above method embodiment.

[0236] Through the description of the above implementation methods, technical personnel in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.

[0237] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0238] The units described as separate components may or may not be physically separated, and the components shown as units may be one physical unit or multiple physical units, that is, they may be located in one place or distributed in multiple different places. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0239] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0240] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium, including several instructions to enable a device (which can be a single-chip microcomputer, chip, etc.) or a processor (processor) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program code.

[0241] The above contents are only specific implementation methods of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions within the technical scope disclosed in the present application shall be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims

1. An image processing method, characterized in that: Applied to electronic equipment, the method comprises: Displaying a first interface, the first interface including a first thumbnail, the first thumbnail being a thumbnail of a first image in the electronic device, the first image including a first content element and a second content element; In response to a first operation on the first thumbnail, displaying a second interface, the second interface including a plurality of dynamic space images, each of the dynamic space images including the first content element and the second content element, the first content elements in the plurality of dynamic space images having the same size, and the second content elements in the plurality of dynamic space images having different sizes; The displaying of the second interface in response to the first operation on the first thumbnail includes: In response to a first operation on the first thumbnail, displaying a fourth interface, the fourth interface including a plurality of first options, the plurality of first options corresponding one-to-one to content elements included in the first image; In response to a selection operation of a first content option among the plurality of first options, a fifth interface is displayed, wherein the fifth interface includes a plurality of second options, wherein the plurality of second options correspond one-to-one to content elements included in the first image except the first content element; the first content element is a content element corresponding to the first content option; In response to a selection operation of a second content option among the plurality of second options, a tenth interface is displayed; the tenth interface includes a second thumbnail and a seventh control, the second thumbnail is a thumbnail of a second image in the electronic device, the second image includes a third content element, and the third content element is used to fill in the missing content of the second content element in the first image, so as to generate the second content element in the plurality of dynamic space images based on the second content element in the first image; In response to a selection operation on the second thumbnail and an eighth operation on the seventh control, the second interface is displayed, and the second content element is a content element corresponding to the second content option.

2. The method according to claim 1, characterized in that: The first image is one image, and the first content element and the second content element are content elements included in one image; The displaying of the second interface in response to the first operation on the first thumbnail includes: In response to a first operation on the first thumbnail, displaying a third interface, wherein the third interface includes the first image and a first control; In response to a second operation on the first control, the second interface is displayed.

3. The method according to claim 1, characterized in that There are multiple first images, and the first content element and the second content element are content elements included in the multiple first images; The displaying of the second interface in response to the first operation on the first thumbnail includes: In response to a first operation on the plurality of first thumbnails, the plurality of first thumbnails are selected, and the plurality of first thumbnails correspond one-to-one to the plurality of first images; In response to a third operation on a second control in the first interface, the second interface is displayed.

4. The method according to any one of claims 1 to 3, characterized in that The multiple dynamic space images are arranged in sequence, and the sizes of the second content elements in two adjacent dynamic space images among the multiple dynamic space images vary according to a zoom ratio.

5. The method according to claim 4, characterized in that The displaying of the second interface in response to the first operation on the first thumbnail includes: In response to a first operation on the first thumbnail, displaying a sixth interface, the sixth interface including a zoom ratio editing area and a third control; Receiving a first zoom ratio input by a user through the zoom ratio editing area; In response to a fourth operation on the third control, the second interface is displayed, and sizes of the second content elements in two adjacent dynamic space images in the plurality of dynamic space images are changed according to the first zoom ratio.

6. The method according to claim 4, characterized in that The displaying of the second interface in response to the first operation on the first thumbnail includes: In response to a first operation on the first thumbnail, displaying a seventh interface, the seventh interface including a moving speed editing area and a fourth control; receiving a moving speed input by a user through the moving speed editing area; In response to a fifth operation on the fourth control, the second interface is displayed, and the zoom ratio is calculated based on the moving speed.

7. The method according to claim 4, characterized in that The displaying of the second interface in response to the first operation on the first thumbnail includes: In response to a first operation on the first thumbnail, an eighth interface is displayed; the eighth interface includes a first depth editing area and a fifth control; Receiving a first depth input by a user through the first depth editing area; In response to a sixth operation on the fifth control, a ninth interface is displayed; the ninth interface includes a second depth editing area and a sixth control; receiving a second depth input by a user through the second depth editing area; In response to a seventh operation on the sixth control, the second interface is displayed; and the zoom ratio is calculated based on the first depth and the second depth.

8. The method according to any one of claims 1 to 3, characterized in that After displaying the second interface, the method further includes: Displaying a twelfth interface, wherein the twelfth interface includes a shooting preview area, and the shooting preview area includes a viewfinder screen; In response to a shooting operation on the twelfth interface, a third image is captured by the camera of the electronic device, and third thumbnails of multiple dynamic space images are displayed on the twelfth interface; the third image includes a fourth content element and a fifth content element; each dynamic space image includes the fourth content element and the fifth content element, the size of the fourth content element in the multiple dynamic space images is the same, and the size of the fifth content element in the multiple dynamic space images is different; In response to a ninth operation on the third thumbnail, a thirteenth interface is displayed, wherein the thirteenth interface includes a plurality of dynamic space images.

9. An electronic device, characterized in that: The electronic device includes a display screen, a memory and one or more processors; the display screen, the memory and the processor are coupled; the display screen is used to display an image generated by the processor, and the memory is used to store computer program code, and the computer program code includes computer instructions; when the processor executes the computer instructions, the electronic device executes the method described in any one of claims 1-8.

10. A computer-readable storage medium, characterized in that: The method comprises computer instructions, which, when executed on an electronic device, cause the electronic device to execute the method as claimed in any one of claims 1 to 8.

11. A computer program product comprising a computer program or instructions, characterized in that When the computer program or instruction is executed by a processor, the electronic device is caused to perform the method according to any one of claims 1 to 8.