Video generation method, apparatus, and device

By acquiring information from salient and final images, the target camera movement method of the terminal device is determined, solving the problem of poor video display effect and achieving higher image matching accuracy and video display effect.

CN116347155BActive Publication Date: 2026-03-20FACE CUTE CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-22
Publication Date
2026-03-20

AI Technical Summary

Technical Problem

In existing technologies, when terminal devices generate videos, they use a fixed camera movement method to process multiple images, resulting in a low degree of matching between the camera movement method and the images, leading to poor video display quality.

Method used

By acquiring image information from the salient and final images of the initial image in the video generation request, the matching degree between multiple preset camera movement methods is determined, and the most matching target camera movement method is selected to generate the video.

Benefits of technology

This improves the video display effect and ensures the matching degree between camera movement and image features, thereby enhancing the video display quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116347155B_ABST
    Figure CN116347155B_ABST
Patent Text Reader

Abstract

The present disclosure provides a video generation method, device and equipment, the method comprising: obtaining a video generation request, the video generation request comprising at least one initial image; obtaining a saliency image and a fall range image of the initial image; obtaining first image information of the saliency image and second image information of the fall range image; determining a target camera operation mode of the initial image according to the first image information and the second image information, and generating the video according to the target camera operation mode of the initial image. Improve the display effect of the video.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present disclosure relates to the technical field of image processing, and particularly relates to a video generation method, device and equipment. BACKGROUND

[0002] When a terminal device generates a video with images, the terminal device can perform panning display on the images to improve the image display effect in the video.

[0003] At present, when the terminal device generates a video with panning images, the terminal device can process the images in the video according to a pre-set panning mode. For example, if the pre-set panning mode is from left to right, the panning mode of the images in the video generated by the terminal device is from left to right. However, multiple images are usually added in the video, and the images can only be displayed according to the fixed panning mode, so that the matching degree of the panning mode of the images in the video and the images is low, and thus the display effect of the video is poor. SUMMARY

[0004] The present disclosure provides a video generation method, device and equipment, which are used to solve the technical problem of poor display effect of the video in the prior art.

[0005] In a first aspect, the present disclosure provides a video generation method, which comprises the following steps:

[0006] obtaining a video generation request, wherein the video generation request comprises at least one initial image;

[0007] obtaining a saliency image and a fall range image of the initial image;

[0008] obtaining first image information of the saliency image and second image information of the fall range image;

[0009] determining a target panning mode of the initial image according to the first image information and the second image information, and generating the video according to the target panning mode of the initial image.

[0010] In a second aspect, the present disclosure provides a video generation device, which comprises a first obtaining module, a second obtaining module, a third obtaining module and a determining module, and wherein:

[0011] The first obtaining module is configured to obtain a video generation request, wherein the video generation request comprises at least one initial image;

[0012] The second obtaining module is configured to obtain a saliency image and a fall range image of the initial image;

[0013] The third obtaining module is configured to obtain first image information of the saliency image and second image information of the fall range image;

[0014] The determining module is configured to determine a target panning mode of the initial image according to the first image information and the second image information, and generate the video according to the target panning mode of the initial image.

[0015] In a third aspect, an electronic device is provided, including a processor and a memory.

[0016] The memory stores computer-executable instructions.

[0017] The processor executes the computer-executable instructions stored in the memory, so that the at least one processor executes the video generation method according to the first aspect and various possible designs of the first aspect.

[0018] In a fourth aspect, a computer-readable storage medium is provided, and the computer-readable storage medium stores computer-executable instructions. When a processor executes the computer-executable instructions, the video generation method according to the first aspect and various possible designs of the first aspect is implemented.

[0019] In a fifth aspect, a computer program product is provided, including a computer program. When a processor executes the computer program, the video generation method according to the first aspect and various possible designs of the first aspect is implemented.

[0020] The present disclosure provides a video generation method, device and equipment. A video generation request is obtained, and the video generation request includes at least one initial image. A saliency image and a fall range image of the initial image are obtained. First image information of the saliency image and second image information of the fall range image are obtained. A target panning mode of the initial image is determined according to the first image information and the second image information. A video is generated according to the target panning mode of the initial image. According to the above method, a terminal device can determine a panning mode of an initial image according to first image information of a saliency image of the initial image and second image information of a fall range image. Since the first image information and the second image information can accurately reflect the characteristics of the initial image, the terminal device can accurately determine the panning mode of the initial image, thereby improving the display effect of the video. BRIEF DESCRIPTION OF DRAWINGS

[0021] Figure 1 An application scenario diagram is provided for the embodiments of the present disclosure.

[0022] Figure 2 A flowchart of a video generation method is provided for the embodiments of the present disclosure.

[0023] Figure 3 A saliency image diagram is provided for the embodiments of the present disclosure.

[0024] Figure 4 A schematic diagram of a boundary distance is provided for an embodiment of the present disclosure.

[0025] Figure 5 A flowchart of another video generation method is provided for an embodiment of the present disclosure.

[0026] Figure 6 A spread image diagram is provided for an embodiment of the present disclosure.

[0027] Figure 7 Another spread image diagram is provided for an embodiment of the present disclosure.

[0028] Figure 8 A process diagram of a video generation method is provided for an embodiment of the present disclosure.

[0029] Figure 9 A structural diagram of a video generation apparatus is provided for an embodiment of the present disclosure.

[0030] Figure 10 A structural diagram of an electronic device is provided for an embodiment of the present disclosure. DETAILED DESCRIPTION

[0031] The exemplary embodiments will be described in detail herein with reference to the attached drawings. The following description is made with reference to the accompanying drawings in which like reference numerals refer to like elements, and the term "exemplary" is used herein to mean "serving as an example, instance, or illustration." Thus, the exemplary embodiments are not intended to be limited to the disclosed embodiments, but are intended to be as broad as possible consistent with the specification and claims. The following detailed description includes specific details for the purpose of providing a thorough understanding of the exemplary embodiments. However, it will be apparent to those skilled in the art that the exemplary embodiments can be practiced without these specific details. In some instances, well-known structures and components are shown in block diagram form in order to avoid obscuring the concepts of the exemplary embodiments.

[0032] It should be noted that, in the present document, the terms "comprises", "comprising", or any other variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but can include other elements not expressly listed or inherent to such process, method, article, or apparatus. An element proceeded by "comprises a", "comprising", or "includes a" does not, without more constraints, preclude the existence of additional identical elements in the process, method, article, or apparatus that comprises the element.

[0033] In the related art, when a terminal device generates a video with images, the terminal device can perform a dolly display on the images to improve the display effect of the images in the video. For example, the images in the video can be displayed from left to right, from top to bottom, and the like. Currently, when the terminal device generates a video with dolly images, the terminal device can process the images in the video according to a pre-set dolly manner. For example, if the terminal device pre-sets the dolly manner as from top to bottom, all the images in the video generated by the terminal device are displayed according to the dolly manner from top to bottom. However, multiple images are usually added in the video, and the image features of each image are different. When the terminal device generates the video, only processing the images according to the fixed dolly manner makes the matching degree of the dolly manner corresponding to the images and the images low, and thus the display effect of the video is poor.

[0034] To solve the technical problem of poor display effect of the video in the related art, the embodiments of the present disclosure provide a video generation method, obtaining a video generation request, the video generation request including at least one initial image, obtaining a salient image and a fall range image of the initial image, obtaining first image information of the salient image and second image information of the fall range image, determining a matching degree between the initial image and a plurality of preset dolly manners according to the first image information and the second image information, determining a target dolly manner in the plurality of preset dolly manners according to the matching degree between the initial image and the plurality of preset dolly manners, and generating a video according to the target dolly manner of the initial image. In this way, the terminal device can determine the dolly manner of the initial image according to the first image information of the salient image and the second image information of the fall range image of the initial image. Since the first image information and the second image information can accurately reflect the features of the initial image, the terminal device can accurately determine the dolly manner of the initial image, and thus improve the display effect of the video.

[0035] In the following, the application scenarios of the embodiments of the present disclosure are introduced. Figure 1 The application scenarios of the embodiments of the present disclosure are introduced.

[0036] Figure 1 An application scenario diagram of the embodiments of the present disclosure is provided. Please refer to Figure 1 , including a video generation request and a terminal device. The video generation request includes an image A. When the terminal device receives the video generation request, the terminal device can determine the information of the salient image and the information of the fall range image of the image A according to the image A in the video generation request, and determine the dolly manner of the image A as from left to right according to the information of the salient image and the information of the fall range image, and then generate a target video, wherein the target video includes the image A, and the display manner of the image A is from left to right. In this way, since the salient image information and the fall range image information can accurately reflect the features of the image A, the terminal device can accurately determine the dolly manner of the image A, and thus improve the display effect of the target video.

[0037] The technical solutions of the present disclosure and how the technical solutions solve the above technical problems will be described in detail below with specific examples. The following specific examples can be combined with each other, and the same or similar concepts or processes can not be described again in some examples. The embodiments of the present disclosure will be described below with reference to the accompanying drawings.

[0038] Figure 2 A flowchart of a video generation method according to an embodiment of the present disclosure is shown in FIG. 2. As shown in FIG. 2, the method can include the following steps. Figure 2 The method can include the following steps.

[0039] S201, obtaining a video generation request.

[0040] The execution subject of the embodiments of the present disclosure can be a terminal device, or a video generation apparatus provided in the terminal device. The video generation apparatus can be implemented by software, or by a combination of software and hardware. Optionally, the terminal device is any device with video processing function and / or display function. For example, the terminal device can be a mobile phone, a notebook computer, a desktop computer, etc.

[0041] The video generation request includes at least one initial image. Optionally, the initial image can be any type of image. For example, the initial image can be a landscape image, a portrait image, a realistic image, etc. Optionally, the resolution of the initial image can be any resolution. Optionally, the video generation request can include one initial image, or can include multiple initial images. When the video generation request includes multiple initial images, the formats of any two initial images can be the same or different. For example, if the video generation request includes initial image A and initial image B, the aspect ratios of initial image A and initial image B can both be 4:3, or the aspect ratio of initial image A is 4:3 and the aspect ratio of initial image B is 16:9.

[0042] Optionally, the terminal device can receive a video generation request input by a user. For example, the user can add multiple initial images in a video software, and click a video generation control on the page of the video software. The terminal device can receive the video generation request according to the operation of the user. For example, if the user adds initial image A and initial image B in the video software, and clicks the video generation control, the terminal device can receive the video generation request, wherein the video generation request includes initial image A and initial image B.

[0043] S202, obtaining a salient image and a fall range image of the initial image.

[0044] The salient image of the initial image is used to indicate the salientity of the initial image. Specifically, the salient image reflects the degree of importance the human eye places on a region within the initial image. For example, if an image includes swans and lake water, the region containing the swans is the salient image. In practical applications, images typically include primary and secondary features (e.g., swans are the primary feature, while lake water and sky are secondary features). The terminal device needs to acquire the primary feature, i.e., the salient image corresponding to that feature.

[0045] Optionally, the terminal device can obtain a salient image of the initial image using a preset algorithm. For example, the terminal device can obtain a salient image corresponding to the initial image using a saliency analysis algorithm based on low-level visual features.

[0046] Below, in conjunction with Figure 3 Provide a detailed description of the salient image corresponding to the initial image.

[0047] Figure 3 This is a schematic diagram illustrating a significant image provided for an embodiment of this disclosure. Please refer to [link / reference]. Figure 3 The dataset includes image A and image B. Image A is the initial image, and image B is the salient image corresponding to the initial image. The initial image includes a narrow alley and houses on both sides of the alley. The main area displayed in this initial image is the region in the middle of image A, including the alley and houses. Therefore, the salient image corresponding to this initial image is as follows: Figure 3 As shown, the white area in image B is the salient image corresponding to image A.

[0048] The final image is the portion of the image displayed at the end of the initial image's camera movement. For example, when processing the initial image's camera movement, the terminal device's display screen will not show the complete initial image. If the camera movement corresponding to the initial image is from left to right, the terminal device's display screen will first show the left portion of the initial image and finally show the right portion. The right portion of the initial image displayed last by the terminal device is the final image corresponding to the initial image.

[0049] Optionally, the terminal device can determine the final image based on the initial image. For example, the initial image and the final image have the same center, and the size of the final image is 80% of the size of the initial image. For example, in a coordinate system, if the center coordinate of the initial image is (1, 1), and the length and width of the initial image are both 1, then the center coordinate of the corresponding final image is (1, 1), and the length and width of the final image are both 0.8. Optionally, the size of the final image can also be any size set by the user, and this embodiment of the disclosure does not limit this. For example, the center of the final image can be different from the center of the initial image, and the size of the final image can be any value such as 60% or 70% of the size of the initial image.

[0050] S203. Obtain the first image information of the salient image and the second image information of the partial image.

[0051] Optionally, the first image information of the salient image includes the first size of the salient image and the first position of the salient image in the initial image. The first size is the length and width of the minimum envelope rectangle corresponding to the salient image. For example, the first size can be the aspect ratio of the salient image. For instance, if the salient image has a width of 4 and a length of 3, then the first size of the salient image is its aspect ratio of 4:3.

[0052] Optionally, when the terminal device acquires the salient image of the initial image, a first size of the salient image can be determined. For example, in practical applications, when the terminal device obtains the salient image through a preset algorithm, the salient image is usually an irregular shape. The terminal device can obtain the minimum envelope rectangle corresponding to the salient image, and then determine the aspect ratio of the minimum envelope rectangle corresponding to the salient image as the first size of the salient image.

[0053] The first position can be the location of the salient image within the initial image. Specifically, the first position can be the coordinates of the salient image within the initial image. Optionally, when the terminal device determines the salient image corresponding to the initial image, the terminal device can determine the position of that salient image within the initial image. For example, the salient image of the terminal device may be located on the left, right, top, bottom, or center of the terminal device. The terminal device can establish a coordinate system within the initial image and then determine the position of the minimum envelope rectangle corresponding to the salient image as the first position of the salient image within the initial image.

[0054] The second image information of the final image includes the second size of the final image and the second position of the final image within the initial image. The second size refers to the length and width of the final image. For example, the second size can be the aspect ratio of the final image. For instance, if the width of the final image is 4 and the length is 3, then the second size of the final image is its aspect ratio of 4:3.

[0055] The second position can be the location of the final image within the initial image. Specifically, the second position can be the coordinates of the final image within the initial image. Optionally, when the terminal device determines the final image corresponding to the initial image, the terminal device can determine the position of the final image within the initial image. For example, the terminal device can establish a coordinate system within the initial image to determine the second position of the final image within the initial image.

[0056] Optionally, the second size and the second position of the fall-in image can be determined according to the initial image. For example, the terminal device can determine that the initial image is the same as the center of the fall-in image, and the size of the fall-in image is 80% of the size of the initial image, and then obtain the second size of the fall-in image and the second position of the fall-in image in the initial image.

[0057] S204, determining a target panning mode of the initial image according to the first image information and the second image information.

[0058] The panning mode is a method of shooting a video motion lens. For example, the image in the video shot by the user can be an image displayed by the motion lens.

[0059] The target panning mode of the initial image can be determined according to the following possible implementation manners: determining the matching degree between the initial image and a plurality of preset panning modes according to the first image information and the second image information, and determining the target panning mode from the plurality of preset panning modes according to the matching degree between the initial image and the plurality of preset panning modes. Optionally, the preset panning mode can include at least one of the following: left-right panning mode, right-left panning mode, up-down panning mode, down-up panning mode, far-near panning mode, near-far panning mode, etc. Among them, the left-right panning mode is a panning mode in which the initial image is displayed from left to right in the video, the right-left panning mode is a panning mode in which the initial image is displayed from right to left in the video, the up-down panning mode is a panning mode in which the initial image is displayed from top to bottom in the video, the down-up panning mode is a panning mode in which the initial image is displayed from bottom to top in the video, the far-near panning mode is a panning mode in which the initial image is displayed from far to near in the video, and the near-far panning mode is a panning mode in which the initial image is displayed from near to far in the video.

[0060] Optionally, the matching degree between the initial image and the plurality of preset lens movement modes is determined according to the first image information and the second image information. Specifically, the height ratio, the width ratio and the aspect ratio between the fall range image and the saliency image are determined according to the first size and the second size. Optionally, the height ratio is the ratio of the height of the fall range image to the height of the saliency image. For example, if the height of the fall range image is 10 and the height of the saliency image is 5, the ratio of the height of the fall range image to the height of the saliency image is 2:1. Optionally, the ratio of the longest height of the fall range image to the longest height of the saliency image can be determined as the height ratio of the fall range image to the saliency image. Optionally, the width ratio is the ratio of the width of the fall range image to the width of the saliency image. For example, if the width of the fall range image is 10 and the width of the saliency image is 5, the ratio of the width of the fall range image to the width of the saliency image is 2:1. Optionally, the ratio of the longest width of the fall range image to the longest width of the saliency image can be determined as the width ratio of the fall range image to the saliency image. Optionally, the aspect ratio is the ratio of the aspect ratio of the fall range image to the aspect ratio of the saliency image. For example, if the aspect ratio of the fall range image is 2 and the aspect ratio of the saliency image is 1, the ratio of the aspect ratio of the fall range image to the aspect ratio of the saliency image is 2:1.

[0061] Optionally, each lens movement mode has a corresponding preset aspect ratio. For example, the aspect ratio of 4:3 includes 6 lens movement modes, and the aspect ratio of 16:9 includes 6 lens movement modes. The 6 lens movement modes corresponding to the aspect ratio of 4:3 are the same as the 6 lens movement modes corresponding to the aspect ratio of 16:9. Optionally, in actual application, if the aspect ratio of the saliency image is closest to a preset aspect ratio, the matching degree between the initial image and the 6 lens movement modes corresponding to the preset aspect ratio is increased by 1. For example, if the aspect ratio of the saliency image is 4:3, the matching degree between the initial image and the 6 lens movement modes included in the aspect ratio of 4:3 is increased by 1.

[0062] Based on the first and second positions, the boundary distances between the final image and the salient image are determined. Optionally, the boundary distances include upper boundary distance, lower boundary distance, left boundary distance, and right boundary distance. The upper boundary distance is the dimension between the upper boundary of the final image and the upper boundary of the salient image. For example, if the upper boundary of the final image is at position 10 and the upper boundary of the salient image is at position 8, then the upper boundary distance is 2. The lower boundary distance is the dimension between the lower boundary of the final image and the lower boundary of the salient image. For example, if the lower boundary of the final image is at position 10 and the lower boundary of the salient image is at position 8, then the lower boundary distance is 2. The left boundary distance is the dimension between the left boundary of the final image and the left boundary of the salient image. For example, if the left boundary of the final image is at position 5 and the left boundary of the salient image is at position 4, then the left boundary distance is 1. The right boundary distance is the dimension between the right boundary of the final image and the right boundary of the salient image. For example, if the right boundary of the final image is at position 5 and the right boundary of the salient image is at position 3, then the right boundary distance is 2.

[0063] Below, in conjunction with Figure 4 This section explains the boundary distance between the salient image and the salient image.

[0064] Figure 4 This is a schematic diagram illustrating a boundary distance provided for an embodiment of this disclosure. Please refer to [link / reference]. Figure 4 Image A includes a partial image and a salient image. The partial image includes an upper boundary A, a lower boundary A, a left boundary A, and a bounded boundary A. The salient image includes an upper boundary a, a lower boundary a, a left boundary a, and a bounded boundary a. The distance between the upper boundary A and the upper boundary a is the upper boundary distance; the distance between the upper boundary A and the lower boundary a is the lower boundary distance; the distance between the left boundary A and the left boundary a is the left boundary distance; and the distance between the right boundary A and the right boundary a is the right boundary distance.

[0065] The matching degree between the initial image and multiple preset camera movement methods is determined based on the height ratio, width ratio, aspect ratio, and boundary distance. Optionally, the matching degree between the initial image and multiple preset camera movement methods can be determined according to the following feasible implementation: A first matching degree between the initial image and each camera movement method is determined based on the height ratio. Optionally, when determining the first matching degree, the initial image is matched with each camera movement method separately based on its corresponding height ratio to determine the first matching degree between the initial image and each camera movement method. For example, the first matching degree between the initial image and camera movement method 1 is matching degree 1, and the first matching degree between the initial image and camera movement method 2 is matching degree 2.

[0066] According to the width ratio, a second matching degree between the initial image and each preset lens movement mode is determined. Optionally, when the second matching degree is determined, according to the width ratio corresponding to the initial image, the initial image is matched with each lens movement mode respectively, and the second matching degree between the initial image and each lens movement mode is determined. For example, the second matching degree between the initial image and the lens movement mode 1 is matching degree 1, and the second matching degree between the initial image and the lens movement mode 2 is matching degree 2.

[0067] According to the aspect ratio, a third matching degree between the initial image and each preset lens movement mode is determined. Optionally, when the third matching degree is determined, according to the aspect ratio corresponding to the initial image, the initial image is matched with each lens movement mode respectively, and the third matching degree between the initial image and each lens movement mode is determined. For example, the third matching degree between the initial image and the lens movement mode 1 is matching degree 1, and the third matching degree between the initial image and the lens movement mode 2 is matching degree 2.

[0068] According to the boundary distance, a fourth matching degree between the initial image and each preset lens movement mode is determined. Optionally, when the fourth matching degree is determined, according to the boundary distance corresponding to the initial image, the initial image is matched with each lens movement mode respectively, and the fourth matching degree between the initial image and each lens movement mode is determined. For example, the fourth matching degree between the initial image and the lens movement mode 1 is matching degree 1, and the fourth matching degree between the initial image and the lens movement mode 2 is matching degree 2.

[0069] According to at least one of the first matching degree, the second matching degree, the third matching degree and the fourth matching degree, a matching degree between the initial image and the plurality of preset lens movement modes is determined. Optionally, the terminal device can determine the sum of at least two of the first matching degree, the second matching degree, the third matching degree and the fourth matching degree corresponding to the preset lens movement mode as the matching degree between the initial image and the preset lens movement mode. For example, if the first matching degree between the initial image and the lens movement mode 1 is matching degree 1, the second matching degree is matching degree 2, the third matching degree is matching degree 3, and the fourth matching degree is matching degree 4, then the matching degree between the initial image and the lens movement mode 1 is the sum of matching degree 1, matching degree 2, matching degree 3 and matching degree 4.

[0070] Optionally, the target panning mode is determined from the matching degrees between the initial image and the plurality of preset panning modes, specifically, the preset panning mode with the highest matching degree with the initial image is determined as the target panning mode. For example, the matching degree between the initial image and the panning mode from left to right is matching degree 1, the matching degree between the initial image and the panning mode from right to left is matching degree 2, the matching degree between the initial image and the panning mode from top to bottom is matching degree 3, the matching degree between the initial image and the panning mode from bottom to top is matching degree 4, the matching degree between the initial image and the panning mode from far to near is matching degree 5, and the matching degree between the initial image and the panning mode from near to far is matching degree 6. If matching degree 2 is the highest matching degree, the terminal device determines that the target panning mode corresponding to the initial image is the panning mode from right to left.

[0071] S205, generating a video according to the target panning mode of the initial image.

[0072] Optionally, the display mode of the initial image included in the video is the target panning mode corresponding to the initial image. For example, the video generation request includes initial image A, initial image B, and initial image C. If the target panning mode of initial image A is from left to right, the target panning of initial image B is from top to bottom, and the target panning mode of initial image C is from far to near, the initial image A in the generated video is displayed from left to right, the initial image B is displayed from top to bottom, and the initial image C is displayed from far to near.

[0073] The embodiments of the present disclosure provide a video generation method, obtaining a video generation request, the video generation request including at least one initial image, obtaining a salient image and a fall range image of the initial image, obtaining first image information of the salient image and second image information of the fall range image, determining matching degrees between the initial image and a plurality of preset panning modes according to the first image information and the second image information, and determining a preset panning mode with the highest matching degree with the initial image as a target panning mode, and generating a video according to the target panning mode of the initial image. In this way, the terminal device can determine the panning mode of the initial image according to the first image information of the salient image and the second image information of the fall range image of the initial image. Since the first image information and the second image information can accurately reflect the characteristics of the initial image, the terminal device can accurately determine the panning mode of the initial image, thereby improving the display effect of the video.

[0074] In Figure 2 Based on the embodiments shown in the above, the following will be combined Figure 5 The video generation method is described in detail.

[0075] Figure 5 Another flowchart of a video generation method provided by the embodiments of the present disclosure is shown. Please refer toFigure 5 The method flow comprises:

[0076] S501, acquire a video generation request.

[0077] The video generation request comprises at least one initial image.

[0078] It should be noted that the execution process of step S501 can refer to step S201, and the embodiments of the present disclosure will not be described again.

[0079] S502, acquire the saliency image and the fall range image of the initial image, and the first image information of the saliency image and the second image information of the fall range image.

[0080] It should be noted that the execution process of step S502 can refer to steps S201 and S202, and the embodiments of the present disclosure will not be described again.

[0081] S503, determine the matching degree between the initial image and the plurality of preset camera movements according to the first image information and the second image information.

[0082] Optionally, the terminal device can determine the first matching degree, the second matching degree, the third matching degree and the fourth matching degree between the initial image and each preset camera movement, and then determine the matching degree between the initial image and the preset camera movement according to at least one of the first matching degree, the second matching degree, the third matching degree and the fourth matching degree.

[0083] Next, there are four kinds of matching degrees between the initial image and the preset camera movement, and the determination methods of the four kinds of matching degrees are introduced in detail.

[0084] The first matching degree: the first matching degree between the initial image and the preset camera movement.

[0085] Optionally, the first matching degree between the initial image and each preset panning mode is determined according to the height ratio. Optionally, the first matching degree can be determined according to the following possible implementation manners: if the height ratio is less than or equal to a first threshold value, it is determined that the first matching degree between the initial image and the up-down panning mode is a first value, and the first matching degree between the initial image and the down-up panning mode is the first value, and the first matching degree between the initial image and other preset panning modes except the up-down panning mode and the down-up panning mode is 0, and the first value is greater than 0. For example, if the height ratio between the longest height of the drop range image and the longest height of the salient image is less than or equal to 0.9, it is determined that the matching degrees between the initial image and the up-down panning mode and the down-up panning mode are 10, and the matching degrees between the initial image and other panning modes are 0. For example, in actual application, if the height ratio between the drop range image and the salient image is less than or equal to the first threshold value, it indicates that the drop range cannot completely display the salient image, and the salient image corresponding to the initial image needs a vertical display mode to display more information, and therefore, it can be determined that the first matching degrees between the initial image and the up-down panning mode and the down-up panning mode are higher, and the first matching degrees between the initial image and other panning modes are 0.

[0086] The second matching degree is a second matching degree between the initial image and the preset panning mode.

[0087] Optionally, the second matching degree between the initial image and each preset panning mode is determined according to the width ratio. Optionally, the second matching degree can be determined according to the following possible implementation manners: if the width ratio is less than or equal to a second threshold value, it is determined that the second matching degree between the initial image and the left-right panning mode is a second value, and the second matching degree between the initial image and the right-left panning mode is the second value, and the second matching degree between the initial image and other preset panning modes except the left-right panning mode and the right-left panning mode is 0, and the second value is greater than 0. For example, if the width ratio between the longest width of the drop range image and the longest width of the salient image is less than or equal to 0.9, it is determined that the matching degrees between the initial image and the left-right panning mode and the right-left panning mode are 10, and the matching degrees between the initial image and other panning modes are 0. For example, in actual application, if the width ratio between the drop range image and the salient image is less than or equal to the second threshold value, it indicates that the drop range cannot completely display the salient image, and the salient image corresponding to the initial image needs a horizontal display mode to display more information, and therefore, it can be determined that the second matching degrees between the initial image and the left-right panning mode and the right-left panning mode are higher, and the second matching degrees between the initial image and other panning modes are 0.

[0088] The third matching degree is a third matching degree between the initial image and the preset panning mode.

[0089] Optionally, the third matching degree between the initial image and each camera movement mode is determined according to the aspect ratio ratio. Optionally, the third matching degree can be determined according to the following possible implementation manners: if the aspect ratio ratio is less than or equal to a third threshold value, the third matching degree between the initial image and the zoom-in-out camera movement mode is determined as a third value, and the third matching degree between the initial image and other camera movement modes except the zoom-in-out camera movement mode is determined as 0, and the third value is greater than 0. For example, if the ratio between the aspect ratio of the fall range image and the aspect ratio of the salient image is less than or equal to 0.8, the matching degree between the initial image and the zoom-in-out camera movement mode is determined as 2, and the matching degree between the initial image and other camera movement modes is determined as 0. For example, in actual application, if the ratio of the aspect ratios between the fall range image and the salient image is less than or equal to the third threshold value, it indicates that the fall range cannot fully display the salient image, and the salient image corresponding to the initial image needs to be displayed in a zoomed-out manner to display more information, so it can be determined that the third matching degree between the initial image and the zoom-in-out camera movement mode (i.e., the zoom-out lens) is higher, and the third matching degree between the initial image and other camera movement modes is 0.

[0090] If the aspect ratio ratio is greater than or equal to the third threshold value, the third matching degree between the initial image and the zoom-in-out camera movement mode is determined as a third value, and the third matching degree between the initial image and other camera movement modes except the zoom-in-out camera movement mode is determined as 0, and the third value is greater than 0. For example, if the ratio between the aspect ratio of the fall range image and the aspect ratio of the salient image is greater than or equal to 0.8, the matching degree between the initial image and the zoom-in-out camera movement mode is determined as 2, and the matching degree between the initial image and other camera movement modes is determined as 0. For example, in actual application, if the ratio of the aspect ratios between the fall range image and the salient image is greater than or equal to the third threshold value, it indicates that the fall range can fully display the salient image, and in order to improve the image display effect, the salient image corresponding to the initial image needs to be displayed in a zoomed-in manner to clearly display the image information, so it can be determined that the third matching degree between the initial image and the zoom-in-out camera movement mode (i.e., the zoom-in lens) is higher, and the third matching degree between the initial image and other camera movement modes is 0.

[0091] The fourth matching degree is a fourth matching degree between the initial image and a preset camera movement mode.

[0092] Optionally, the fourth matching degree between the initial image and each camera movement mode is determined according to the boundary distance. Optionally, the fourth matching degree can be determined according to the following possible implementation manners: a first distance ratio of the upper boundary distance and the lower boundary distance and a second distance ratio of the left boundary distance and the right boundary distance are obtained, a first sub-matching degree between the initial image and each camera movement mode is determined according to the first distance ratio, a second sub-matching degree between the initial image and each camera movement mode is determined according to the second distance ratio, and the fourth matching degree is determined according to the first sub-matching degree and the second sub-matching degree.

[0093] Optionally, for any one preset panning mode, the fourth matching degree of the initial image and the preset panning mode is determined as the sum of the corresponding first sub-matching degree and the corresponding second sub-matching degree. For example, if the first sub-matching degree of the initial image and the preset panning mode 1 is matching degree 1, and the second sub-matching degree of the initial image and the preset panning mode 1 is matching degree 2, then the fourth matching degree of the initial image and the preset panning mode 1 is the sum of matching degree 1 and matching degree 2.

[0094] Optionally, the first sub-matching degree can be determined according to the following possible implementation manner: if the first distance ratio is greater than or equal to the fourth threshold value, then the first sub-matching degree between the initial image and the up-down panning mode is determined as a fourth value, and the first sub-matching degree between the initial image and other panning modes except the up-down panning mode is determined as 0, and the fourth value is greater than 0. For example, if the first distance ratio of the upper boundary distance and the lower boundary distance is greater than or equal to the fourth threshold value, then the first sub-matching degree between the initial image and the up-down panning mode is determined as 1, and the sub-matching degree between the initial image and other panning modes is 0. For example, in actual application, if the upper boundary distance is 2 times the lower boundary distance, then it is indicated that the upper side of the fall range is far away from the upper side of the salient image, and thus the panning mode needs to be panned from up to down, so as to more display the image information of the initial image, and thus it can be determined that the first sub-matching degree between the initial image and the up-down panning mode is higher, and the first sub-matching degree between the initial image and other panning modes is 0.

[0095] If the first distance ratio is less than the fourth threshold value, then the first sub-matching degree between the initial image and the down-up panning mode is determined as a fourth value, and the first sub-matching degree between the initial image and other panning modes except the down-up panning mode is determined as 0, and the fourth value is greater than 0. For example, if the first distance ratio of the upper boundary distance and the lower boundary distance is less than the fourth threshold value, then the first sub-matching degree between the initial image and the down-up panning mode is determined as 1, and the sub-matching degree between the initial image and other panning modes is 0. For example, in actual application, if the upper boundary distance is less than 2 times the lower boundary distance, then it is indicated that the lower side of the fall range is far away from the lower side of the salient image, and thus the panning mode needs to be panned from down to up, so as to more display the image information of the initial image, and thus it can be determined that the first sub-matching degree between the initial image and the down-up panning mode is higher, and the first sub-matching degree between the initial image and other panning modes is 0.

[0096] Optionally, the second sub-matching degree can be determined according to the following feasible implementation: if the second distance ratio is greater than or equal to the fifth threshold, then the second sub-matching degree between the initial image and the left / right camera movement is determined to be the fourth value, and the second sub-matching degree between the initial image and other camera movements besides the left / right camera movement is determined to be 0, with the fourth value being greater than 0. For example, if the second distance ratio between the left boundary distance and the right boundary distance is greater than or equal to the fifth threshold, then the second sub-matching degree between the initial image and the left / right camera movement is determined to be 1, and the sub-matching degree between the initial image and other camera movements is determined to be 0. For example, in practical applications, if the left boundary distance is twice the right boundary distance, it indicates that the left side of the final shot is far from the left side of the prominent image. Therefore, the camera movement needs to be from left to right to display more image information from the initial image. Thus, the second sub-matching degree between the initial image and the left / right camera movement can be determined to be high, and the second sub-matching degree between the initial image and other camera movements can be determined to be 0.

[0097] If the second distance ratio is less than the fifth threshold, the second sub-matching degree between the initial image and the right-left camera movement is determined to be the fourth value, and the second sub-matching degree between the initial image and other camera movements is determined to be 0. For example, if the second distance ratio between the left boundary distance and the right boundary distance is less than the fifth threshold, the second sub-matching degree between the initial image and the right-left camera movement is determined to be 1, and the sub-matching degree between the initial image and other camera movements is 0. For example, in practical applications, if the left boundary distance is less than twice the right boundary distance, it indicates that the right side of the final shot is far from the right side of the prominent image. Therefore, the camera movement needs to be from right to left to display more image information from the initial image. Thus, the second sub-matching degree between the initial image and the right-left camera movement can be determined to be high, and the second sub-matching degree between the initial image and other camera movements is 0.

[0098] S504. Based on the matching degree between the initial image and multiple preset camera movement methods, determine the target camera movement method among the multiple preset camera movement methods.

[0099] It should be noted that the execution process of step S504 can refer to step S204, and this embodiment will not be described in detail here.

[0100] S505. Generate video based on the target camera movement method of the initial image.

[0101] Optionally, the video generation request further comprises a duration and a panning speed of each initial image. Optionally, the duration is a display duration of the initial image in the video. For example, if the duration of the initial image is 1 second, the display duration of the initial image in the video is 1 second. The panning speed is a speed of the target panning mode corresponding to the initial image. For example, if the target panning mode corresponding to the initial image is a left-right panning mode, and the panning speed of the initial image is 1 cm per second, the initial image is displayed from left to right at a speed of 1 cm per second in the video.

[0102] Optionally, the video can be generated according to the following possible implementation manners: determining a start image corresponding to the initial image according to the target panning mode of the initial image, the end image, the duration and the panning speed, determining a video segment corresponding to the initial image according to the duration, the panning speed, the target panning mode, the start image and the end image of the initial image, and generating the video according to the video segment corresponding to each initial image.

[0103] Optionally, the end image is an image displayed by the terminal device when the panning of the initial image starts. For example, when the initial image is panned, a complete initial image is not displayed on the display screen of the terminal device. If the panning mode corresponding to the initial image is from left to right, the left part of the initial image is displayed first on the display screen of the terminal device, and the right part of the initial image is displayed last on the display screen of the terminal device. The left part of the initial image displayed first on the display screen of the terminal device is the start image corresponding to the initial image.

[0104] Optionally, the start image can be determined according to the following possible implementation manners: determining a position direction of the start image relative to the end image according to the target panning mode. For example, if the target panning mode is a left-right panning mode, the start image is located on the left side of the end image. The start image is determined according to the coordinates of the end image, the panning speed and the duration. For example, if the panning speed is 1 cm per second, the duration is 1 second, and the start image is located on the left side of the end image, the size of the end image is shifted to the left by 1 cm to obtain the position of the start image.

[0105] Optionally, if the size of the obtained start image exceeds the range of the initial image, it is determined that the initial image cannot be panned and displayed, and the initial image is directly displayed in the video without adding a panning mode.

[0106] Optionally, determining the starting image corresponding to the initial image based on the target camera movement, ending image, duration, and camera movement speed of the initial image further includes: if the target camera movement of the initial image is a vertical camera movement or a bottom-up camera movement, then determining that the width of the starting sub-image and ending image corresponding to the initial image is the same as the width of the initial image. For example, since the size of the ending image is smaller than the size of the initial image, if the camera movement is a vertical camera movement, the width of the starting sub-image and ending image can be expanded to the same size as the initial image. This allows more image information from the initial image to be displayed, thereby improving the video display effect.

[0107] Below, in conjunction with Figures 6-7 Please explain in detail how the image is expanded.

[0108] Figure 6 This is a schematic diagram illustrating an image extension method provided in an embodiment of this disclosure. Please refer to [link / reference]. Figure 6 This includes image A and its corresponding closing image. Image A is shot horizontally, and the height of the closing image is less than the height of image A. Therefore, when image A is shot horizontally, the height of the closing image can be expanded to the same value as the height of image A, allowing the closing image to display more information about image A.

[0109] Figure 7 This is another schematic diagram illustrating the image extension provided in an embodiment of this disclosure. Please refer to... Figure 7 This includes image A and its corresponding closing image. Image A is shot vertically, and the length of the closing image is less than the length of image A. Therefore, when image A is shot vertically, the width of the closing image can be expanded to the same value as the width of image A, allowing the closing image to display more information about image A.

[0110] If the target camera movement for the initial image is a left-right or right-left camera movement, then the image heights of the opening and closing images corresponding to the initial image are determined to be the same as the image height of the initial image. For example, since the size of the closing image is smaller than the size of the initial image, if the camera movement is a horizontal camera movement, the heights of the opening and closing images can be expanded to the same size as the initial image. This allows more image information from the initial image to be displayed, thereby improving the video display effect.

[0111] Optionally, according to the duration of the initial image, the panning speed, the target panning mode, the start image and the end image, the video segment corresponding to the initial image is determined, specifically: if the target panning modes of at least two adjacent initial images are the same, then the aspect ratios of the start images corresponding to the at least two initial images are the same, and the aspect ratios of the end images corresponding to the at least two initial images are the same. For example, if the panning modes of the two initial images in the video are both left-right panning modes, the aspect ratio of the initial image A is 4:3, and the aspect ratio of the initial image B is 16:9, then the aspect ratios of the initial image A and the initial image B can be unified to eliminate the discontinuity error and improve the video display effect.

[0112] The embodiment of the present disclosure provides a video generation method, obtaining a video generation request, the video generation request comprising at least one initial image, obtaining a salient image and an end image of the initial image, obtaining first image information of the salient image and second image information of the end image, determining a matching degree between the initial image and a plurality of preset panning modes according to the first image information and the second image information, and determining a preset panning mode with the highest matching degree with the initial image as a target panning mode, and generating a video according to the target panning mode of the initial image. In this way, the terminal device can determine the panning mode of the initial image according to the first image information of the salient image and the second image information of the end image of the initial image. Since the first image information and the second image information can accurately reflect the characteristics of the initial image, the terminal device can accurately determine the panning mode of the initial image, thereby improving the display effect of the video.

[0113] On the basis of any one of the above embodiments, the following will be combined with Figure 8 The process of the above video generation method is described.

[0114] Figure 8 A process diagram of a video generation method provided by the embodiment of the present disclosure is provided. Please refer to Figure 8 , which comprises a video generation request and a terminal device. The video generation request comprises an image A, a duration of the image A: 1 second, and a panning speed of the image A: 1 cm per second. The terminal device determines the salient image and the end image corresponding to the image A according to the image A, and determines the panning mode corresponding to the image A as a left-right panning mode according to the end image and the salient image.

[0115] Please refer to Figure 8The terminal device determines that the zooming mode of the image A is the left-right zooming mode, determines that the starting image of the image A is the image 1 centimeter to the left of the falling image according to the falling image, and expands the height of the starting image and the falling image to the same value as the height of the image A. The terminal device displays the image A from left to right in the display screen, and the display duration of the image A is 1 second. In this way, the terminal device can determine the zooming mode of the initial image according to the first image information of the salient image of the initial image and the second image information of the falling image. Since the first image information and the second image information can accurately reflect the characteristics of the initial image, the terminal device can accurately determine the zooming mode of the initial image, thereby improving the display effect of the video.

[0116] Figure 9 A structural schematic diagram of a video generation apparatus provided by the embodiment of the present disclosure is provided. Please refer to Figure 9 The video generation apparatus 10 comprises a first acquisition module 11, a second acquisition module 12, a third acquisition module 13 and a determination module 14, wherein:

[0117] The first acquisition module 11 is configured to acquire a video generation request, wherein the video generation request comprises at least one initial image.

[0118] The second acquisition module 12 is configured to acquire a salient image and a falling image of the initial image.

[0119] The third acquisition module 13 is configured to acquire first image information of the salient image and second image information of the falling image.

[0120] The determination module 14 is configured to determine a target zooming mode of the initial image according to the first image information and the second image information, and generate the video according to the target zooming mode of the initial image.

[0121] In a possible implementation, the determination module 14 is specifically configured to:

[0122] determine a matching degree between the initial image and a plurality of preset zooming modes according to the first image information and the second image information.

[0123] determine the target zooming mode from the plurality of preset zooming modes according to the matching degree between the initial image and the plurality of preset zooming modes.

[0124] In a possible implementation, the determination module 14 is specifically configured to:

[0125] determine a height ratio, a width ratio and an aspect ratio between the falling image and the salient image according to the first size and the second size.

[0126] According to the first position and the second position, a boundary distance between the fall range image and the saliency image is determined, the boundary distance comprising: an upper boundary distance, a lower boundary distance, a left boundary distance and a right boundary distance.

[0127] According to the height ratio, a first matching degree between the initial image and each preset panning mode is determined.

[0128] In a possible implementation, the determining module 14 is specifically configured to:

[0129] According to the height ratio, a first matching degree between the initial image and each preset panning mode is determined.

[0130] According to the width ratio, a second matching degree between the initial image and each preset panning mode is determined.

[0131] According to the aspect ratio, a third matching degree between the initial image and each preset panning mode is determined.

[0132] According to the boundary distance, a fourth matching degree between the initial image and each preset panning mode is determined.

[0133] According to at least one of the first matching degree, the second matching degree, the third matching degree and the fourth matching degree, a matching degree between the initial image and the plurality of preset panning modes is determined.

[0134] In a possible implementation, the determining module 14 is specifically configured to:

[0135] If the height ratio is less than or equal to a first threshold value, a first matching degree between the initial image and an up-down panning mode is determined as a first value, and

[0136] a first matching degree between the initial image and a down-up panning mode is determined as the first value, and

[0137] a first matching degree between the initial image and other preset panning modes except the up-down panning mode and the down-up panning mode is determined as 0, and the first value is greater than 0.

[0138] In a possible implementation, the determining module 14 is specifically configured to:

[0139] If the width ratio is less than or equal to a second threshold value, a second matching degree between the initial image and a left-right panning mode is determined as a second value, and

[0140] a second matching degree between the initial image and a right-left panning mode is determined as the second value, and

[0141] determining that a second matching degree between the initial image and other preset camera movements other than the left-right camera movement and the right-left camera movement is 0, the second value being greater than 0.

[0142] In a possible implementation, the determining module 14 is specifically configured to:

[0143] if the aspect ratio ratio is less than or equal to a third threshold value, determining that a third matching degree between the initial image and a near-far camera movement is a third value, and determining that a third matching degree between the initial image and other camera movements other than the near-far camera movement is 0, the third value being greater than 0;

[0144] if the aspect ratio ratio is greater than the third threshold value, determining that a matching degree between the initial image and a far-near camera movement is the third value, and determining that a third matching degree between the initial image and other camera movements other than the far-near camera movement is 0.

[0145] In a possible implementation, the determining module 14 is specifically configured to:

[0146] obtaining a first distance ratio of the upper boundary distance and the lower boundary distance, and a second distance ratio between the left boundary distance and the right boundary distance;

[0147] determining, according to the first distance ratio, a first sub-matching degree between the initial image and each preset camera movement;

[0148] determining, according to the second distance ratio, a second sub-matching degree between the initial image and each preset camera movement;

[0149] for any one preset camera movement, determining that a fourth matching degree between the initial image and the preset camera movement is a sum of the corresponding first sub-matching degree and the corresponding second sub-matching degree.

[0150] In a possible implementation, the determining module 14 is specifically configured to:

[0151] if the first distance ratio is greater than or equal to a fourth threshold value, determining that the first sub-matching degree between the initial image and an up-down camera movement is a fourth value, and determining that the first sub-matching degree between the initial image and other camera movements other than the up-down camera movement is 0, the fourth value being greater than 0;

[0152] if the first distance ratio is less than the fourth threshold value, determining that the first sub-matching degree between the initial image and a down-up camera movement is the fourth value, and determining that the first sub-matching degree between the initial image and other camera movements other than the down-up camera movement is 0.

[0153] In a possible implementation, the determining module 14 is specifically configured to:

[0154] if the second distance ratio is greater than or equal to a fifth threshold value, determining that the initial image has a second sub-matching degree with the left-right panning mode as a fourth value, and determining that the initial image has a second sub-matching degree with other panning modes except the left-right panning mode as 0, the fourth value being greater than 0;

[0155] if the second distance ratio is less than the fifth threshold value, determining that the initial image has a second sub-matching degree with the right-left panning mode as the fourth value, and determining that the initial image has a second sub-matching degree with other panning modes except the right-left panning mode as 0.

[0156] In a possible implementation, the determining module 14 is specifically configured to:

[0157] determining a sum of at least two of the first matching degree, the second matching degree, the third matching degree and the fourth matching degree corresponding to the preset panning mode as a matching degree between the initial image and the preset panning mode.

[0158] In a possible implementation, the determining module 14 is specifically configured to:

[0159] determining, according to the target panning mode of the initial image, the falling amplitude image, the duration and the panning speed, a starting amplitude image corresponding to the initial image;

[0160] determining, according to the duration, the panning speed, the target panning mode of the initial image, the starting amplitude image and the falling amplitude image, a video segment corresponding to the initial image;

[0161] generating the video according to the video segment corresponding to each initial image.

[0162] In a possible implementation, the determining module 14 is specifically configured to:

[0163] if the target panning mode of the initial image is the up-down panning mode or the down-up panning mode, determining that the image width of the starting amplitude image and the falling amplitude image corresponding to the initial image is the same as the image width of the initial image;

[0164] if the target panning mode of the initial image is the left-right panning mode or the right-left panning mode, determining that the image height of the starting amplitude image and the falling amplitude image corresponding to the initial image is the same as the image height of the initial image.

[0165] In a possible implementation, the determining module 14 is specifically configured to:

[0166] If the target panning modes of the at least two adjacent initial images are the same, the aspect ratios of the starting images corresponding to the at least two initial images are the same, and the aspect ratios of the ending images corresponding to the at least two initial images are the same.

[0167] The video generation apparatus provided by the embodiment can be used to execute the technical solutions of the method embodiments, and has similar implementation principles and technical effects. Details are not described herein again.

[0168] Figure 10 A structural schematic diagram of an electronic device is provided for the embodiments of the present disclosure. Please refer to Figure 10 , which shows a structural schematic diagram of an electronic device 900 suitable for implementing the embodiments of the present disclosure. The electronic device 900 can be a terminal device or a server. The terminal device can include, but is not limited to, mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, personal digital assistants (PDA), tablet computers (PAD), portable multimedia players (PMP), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), and the like, and fixed terminals such as digital TVs, desktop computers, and the like. Figure 10 The electronic device shown is only an example, and should not bring any limitation to the functions and use range of the embodiments of the present disclosure.

[0169] As shown in Figure 10 , the electronic device 900 can include a processing device (such as a central processor, a graphics processor, etc.) 901, which can perform various appropriate actions and processes according to programs stored in a read-only memory (ROM) 902 or loaded into a random access memory (RAM) 903 from a storage device 908. Various programs and data required for the operation of the electronic device 900 are also stored in the RAM 903. The processing device 901, the ROM 902, and the RAM 903 are connected to each other through a bus 904. An input / output (I / O) interface 905 is also connected to the bus 904.

[0170] In general, the following devices can be connected to the I / O interface 905: input devices 906, including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, and the like; output devices 907, including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage devices 908, including, for example, a magnetic tape, a hard disk, and the like; and communication devices 909. The communication devices 909 can allow the electronic device 900 to communicate wirelessly or via a wire with other devices to exchange data. Although Figure 10 The electronic device 900 is shown with various devices, but it is understood that all of the illustrated devices are not required to implement or be present. More or fewer devices can alternatively be implemented or present.

[0171] In particular, the processes described above with reference to the flowcharts can be implemented as a computer software program according to embodiments of the present disclosure. For example, embodiments of the present disclosure include a computer program product comprising a computer program carried on a computer readable medium, the computer program containing program code for executing the methods illustrated by the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via the communication devices 909, or installed from the storage devices 908, or installed from the ROM 902. When the computer program is executed by the processing devices 901, the above-mentioned functions defined in the methods of the embodiments of the present disclosure are performed.

[0172] It should be noted that the computer-readable medium in the above disclosure can be a computer-readable signal medium or a computer-readable storage medium or any combination of the two. The computer-readable storage medium may, for example, but is not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or apparatus, or any combination of the above. More specific examples of the computer-readable storage medium can include, but are not limited to, an electrical connection having one or more wires, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, the computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, device or apparatus. In the present disclosure, the computer-readable signal medium can include a data signal carried in a baseband or as a part of a carrier wave, which carries computer-readable program code. Such a propagated data signal can take many forms, including but not limited to an electromagnetic signal, an optical signal or any suitable combination of the above. The computer-readable signal medium can also be any computer-readable medium other than the computer-readable storage medium, which can send, propagate or transmit a program for use by or in conjunction with an instruction execution system, device or apparatus. The program code contained in the computer-readable medium can be transmitted by any suitable medium, including but not limited to a wire, a cable, an RF (radio frequency) or the like, or any suitable combination of the above.

[0173] The computer-readable medium described above can be contained in the electronic device described above; or can exist separately and not be assembled into the electronic device.

[0174] The computer-readable medium described above carries one or more programs, which, when executed by the electronic device, cause the electronic device to perform the methods shown in the above embodiments.

[0175] Computer program code for carrying out operations of the present disclosure can be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C++ or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code can execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the latter scenario, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or the connection can be made to an external computer (for example, through the Internet using an Internet Service Provider).

[0176] The flow diagrams and the block diagrams in the drawings are meant as possible implementations of systems, methods, and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flow diagrams and the block diagrams can represent a module, a segment, or a portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that in some alternative implementations, the functions noted in the blocks can occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently or the blocks can sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and / or flow diagrams, and combinations thereof, can be implemented by special purpose hardware-based systems that perform the specified functions or operations, or combinations of special purpose hardware and computer instructions.

[0177] The units described in the embodiments of the present disclosure can be implemented by software, or by hardware. In some cases, the name of the unit does not constitute a limitation on the unit itself. For example, the first obtaining unit can also be described as a unit for obtaining at least two Internet protocol addresses.

[0178] The functions described above in the embodiments of the present disclosure can be performed at least in part by one or more hardware logic components. For example, and without limitation, illustrative types of hardware logic components that can be used include Field-programmable Gate Arrays (FPGAs), Program-specific Integrated Circuits (ASICs), Program-specific Standard Products (ASSPs), System-on-a-chip systems (SOCs), Complex Programmable Logic Devices (CPLDs), etc.

[0179] In the context of this disclosure, a machine-readable medium can be a tangible medium that contains or stores a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include but is not limited to an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of the machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0180] In a first aspect, according to one or more embodiments of the present disclosure, a video generation method is provided, comprising:

[0181] obtaining a video generation request, the video generation request comprising at least one initial image;

[0182] obtaining a saliency image and a fall range image of the initial image;

[0183] obtaining first image information of the saliency image and second image information of the fall range image;

[0184] determining a target dolly mode of the initial image according to the first image information and the second image information, and generating the video according to the target dolly mode of the initial image.

[0185] According to one or more embodiments of the present disclosure, determining the target dolly mode of the initial image according to the first image information and the second image information comprises:

[0186] determining a matching degree between the initial image and a plurality of preset dolly modes according to the first image information and the second image information;

[0187] determining the target dolly mode from the plurality of preset dolly modes according to the matching degree between the initial image and the plurality of preset dolly modes.

[0188] According to one or more embodiments of the present disclosure, the first image information comprises a first size of the saliency image and a first position of the saliency image in the initial image; and the second image information comprises a second size of the fall range image and a second position of the fall range image in the initial image.

[0189] According to the first image information and the second image information, a matching degree between the initial image and a plurality of preset lens movement modes is determined, including:

[0190] According to the first size and the second size, a height ratio, a width ratio and an aspect ratio between the falling range image and the saliency image are determined;

[0191] According to the first position and the second position, a boundary distance between the falling range image and the saliency image is determined, the boundary distance including: an upper boundary distance, a lower boundary distance, a left boundary distance and a right boundary distance;

[0192] According to the height ratio, the width ratio, the aspect ratio and the boundary distance, the matching degree between the initial image and the plurality of preset lens movement modes is determined.

[0193] According to one or more embodiments of the present disclosure, according to the height ratio, the width ratio, the aspect ratio and the boundary distance, the matching degree between the initial image and the plurality of preset lens movement modes is determined, including:

[0194] According to the height ratio, a first matching degree between the initial image and each preset lens movement mode is determined;

[0195] According to the width ratio, a second matching degree between the initial image and each preset lens movement mode is determined;

[0196] According to the aspect ratio, a third matching degree between the initial image and each preset lens movement mode is determined;

[0197] According to the boundary distance, a fourth matching degree between the initial image and each preset lens movement mode is determined;

[0198] According to at least one of the first matching degree, the second matching degree, the third matching degree and the fourth matching degree, the matching degree between the initial image and the plurality of preset lens movement modes is determined.

[0199] According to one or more embodiments of the present disclosure, according to the height ratio, a first matching degree between the initial image and each preset lens movement mode is determined, including:

[0200] If the height ratio is less than or equal to a first threshold value, it is determined that the first matching degree between the initial image and an up-down lens movement mode is a first value, and

[0201] It is determined that the first matching degree between the initial image and a down-up lens movement mode is the first value, and

[0202] determining that a first matching degree between the initial image and other preset panning modes except the up-down panning mode and the down-up panning mode is 0, the first value being greater than 0.

[0203] According to one or more embodiments of the present disclosure, the second matching degree between the initial image and each preset panning mode is determined according to the width ratio value, including:

[0204] if the width ratio value is less than or equal to a second threshold value, determining that the second matching degree between the initial image and the left-right panning mode is a second value, and

[0205] determining that the second matching degree between the initial image and the right-left panning mode is the second value, and

[0206] determining that the second matching degree between the initial image and other preset panning modes except the left-right panning mode and the right-left panning mode is 0, the second value being greater than 0.

[0207] According to one or more embodiments of the present disclosure, the third matching degree between the initial image and each preset panning mode is determined according to the aspect ratio value, including:

[0208] if the aspect ratio value is less than or equal to a third threshold value, determining that the third matching degree between the initial image and the near-far panning mode is a third value, and determining that the third matching degree between the initial image and other panning modes except the near-far panning mode is 0, the third value being greater than 0;

[0209] if the aspect ratio value is greater than the third threshold value, determining that the matching degree between the initial image and the far-near panning mode is the third value, and determining that the third matching degree between the initial image and other panning modes except the far-near panning mode is 0.

[0210] According to one or more embodiments of the present disclosure, the fourth matching degree between the initial image and each preset panning mode is determined according to the boundary distance, including:

[0211] obtaining a first distance ratio value of the upper boundary distance and the lower boundary distance, and a second distance ratio value of the left boundary distance and the right boundary distance;

[0212] determining a first sub-matching degree between the initial image and each preset panning mode according to the first distance ratio value;

[0213] determining a second sub-matching degree between the initial image and each preset panning mode according to the second distance ratio value;

[0214] The fourth matching degree between the initial image and the preset panning mode is determined as the sum of the corresponding first sub-matching degree and the corresponding second sub-matching degree.

[0215] According to one or more embodiments of the present disclosure, the first sub-matching degree between the initial image and each preset panning mode is determined according to the first distance ratio, including:

[0216] If the first distance ratio is greater than or equal to a fourth threshold value, the first sub-matching degree between the initial image and the up-down panning mode is determined as a fourth value, and the first sub-matching degree between the initial image and other panning modes except the up-down panning mode is determined as 0, the fourth value being greater than 0.

[0217] If the first distance ratio is less than the fourth threshold value, the first sub-matching degree between the initial image and the down-up panning mode is determined as the fourth value, and the first sub-matching degree between the initial image and other panning modes except the down-up panning mode is determined as 0.

[0218] According to one or more embodiments of the present disclosure, the second sub-matching degree between the initial image and each preset panning mode is determined according to the second distance ratio, including:

[0219] If the second distance ratio is greater than or equal to a fifth threshold value, the second sub-matching degree between the initial image and the left-right panning mode is determined as a fourth value, and the second sub-matching degree between the initial image and other panning modes except the left-right panning mode is determined as 0, the fourth value being greater than 0.

[0220] If the second distance ratio is less than the fifth threshold value, the second sub-matching degree between the initial image and the right-left panning mode is determined as the fourth value, and the second sub-matching degree between the initial image and other panning modes except the right-left panning mode is determined as 0.

[0221] According to one or more embodiments of the present disclosure, for any one of the preset panning modes, the matching degree between the initial image and the preset panning mode is determined according to at least one of the first matching degree, the second matching degree, the third matching degree and the fourth matching degree, including:

[0222] The sum of at least two of the first matching degree, the second matching degree, the third matching degree and the fourth matching degree corresponding to the preset panning mode is determined as the matching degree between the initial image and the preset panning mode.

[0223] According to one or more embodiments of the present disclosure, the video generation request further includes the duration and the panning speed of each initial image, and the video is generated according to the target panning mode of the initial image, including:

[0224] determine, according to the target panning mode of the initial image, the duration, the panning speed, the start image and the end image of the initial image, a video segment corresponding to the initial image.

[0225] determine, according to the target panning mode of the initial image, the duration, the panning speed, the start image and the end image of the initial image, a video segment corresponding to the initial image.

[0226] generate the video according to the video segment corresponding to each initial image.

[0227] According to one or more embodiments of the present disclosure, the determination of the start image corresponding to the initial image according to the target panning mode of the initial image, the end image, the duration and the panning speed includes:

[0228] if the target panning mode of the initial image is the up-down panning mode or the down-up panning mode, the image width of the start image and the end image corresponding to the initial image is determined to be the same as the image width of the initial image;

[0229] if the target panning mode of the initial image is the left-right panning mode or the right-left panning mode, the image height of the start image and the end image corresponding to the initial image is determined to be the same as the image height of the initial image.

[0230] According to one or more embodiments of the present disclosure, the determination of the video segment corresponding to the initial image according to the duration, the panning speed, the target panning mode, the start image and the end image of the initial image includes:

[0231] if the target panning modes of at least two adjacent initial images are the same, the aspect ratio of the start image corresponding to the at least two initial images is updated to be the same, and the aspect ratio of the end image corresponding to the at least two initial images is updated to be the same.

[0232] In a second aspect, according to one or more embodiments of the present disclosure, a video generation apparatus is provided, which includes a first acquisition module, a second acquisition module, a third acquisition module and a determination module, wherein:

[0233] The first acquisition module is configured to acquire a video generation request, wherein the video generation request includes at least one initial image.

[0234] The second acquisition module is configured to acquire a salient image and an end image of the initial image.

[0235] The third acquisition module is configured to acquire first image information of the salient image and second image information of the end image.

[0236] The determining module is configured to determine a target panning mode of the initial image according to the first image information and the second image information, and generate the video according to the target panning mode of the initial image.

[0237] In a possible implementation, the determining module 14 is specifically configured to:

[0238] determine a matching degree between the initial image and a plurality of preset panning modes according to the first image information and the second image information;

[0239] determine the target panning mode from the plurality of preset panning modes according to the matching degree between the initial image and the plurality of preset panning modes.

[0240] In a possible implementation, the determining module is specifically configured to:

[0241] determine a height ratio, a width ratio and an aspect ratio between the falling range image and the saliency image according to the first size and the second size;

[0242] determine a boundary distance between the falling range image and the saliency image according to the first position and the second position, the boundary distance including an upper boundary distance, a lower boundary distance, a left boundary distance and a right boundary distance;

[0243] determine a matching degree between the initial image and a plurality of preset panning modes according to the height ratio, the width ratio, the aspect ratio and the boundary distance.

[0244] In a possible implementation, the determining module is specifically configured to:

[0245] determine a first matching degree between the initial image and each preset panning mode according to the height ratio;

[0246] determine a second matching degree between the initial image and each preset panning mode according to the width ratio;

[0247] determine a third matching degree between the initial image and each preset panning mode according to the aspect ratio;

[0248] determine a fourth matching degree between the initial image and each preset panning mode according to the boundary distance;

[0249] determine a matching degree between the initial image and a plurality of preset panning modes according to at least one of the first matching degree, the second matching degree, the third matching degree and the fourth matching degree.

[0250] In a possible implementation, the determining module is specifically configured to:

[0251] if the height ratio is less than or equal to a first threshold value, determining a first matching degree between the initial image and the up-down dolly mode as a first value, and

[0252] determining a first matching degree between the initial image and the down-up dolly mode as the first value, and

[0253] determining a first matching degree between the initial image and other preset dollies except the up-down dolly mode and the down-up dolly mode as 0, the first value being greater than 0.

[0254] In a possible implementation, the determining module is specifically configured to:

[0255] if the width ratio is less than or equal to a second threshold value, determining a second matching degree between the initial image and the left-right dolly mode as a second value, and

[0256] determining a second matching degree between the initial image and the right-left dolly mode as the second value, and

[0257] determining a second matching degree between the initial image and other preset dollies except the left-right dolly mode and the right-left dolly mode as 0, the second value being greater than 0.

[0258] In a possible implementation, the determining module is specifically configured to:

[0259] if the aspect ratio ratio is less than or equal to a third threshold value, determining a third matching degree between the initial image and the near-far dolly mode as a third value, and determining a third matching degree between the initial image and other dolly modes except the near-far dolly mode as 0, the third value being greater than 0;

[0260] if the aspect ratio ratio is greater than the third threshold value, determining a matching degree between the initial image and the far-near dolly mode as the third value, and determining a third matching degree between the initial image and other dolly modes except the far-near dolly mode as 0.

[0261] In a possible implementation, the determining module is specifically configured to:

[0262] obtaining a first distance ratio of the upper boundary distance and the lower boundary distance, and a second distance ratio between the left boundary distance and the right boundary distance;

[0263] determining a first sub-matching degree between the initial image and each preset dolly mode according to the first distance ratio;

[0264] determining a second sub-matching degree between the initial image and each preset dolly mode according to the second distance ratio.

[0265] The fourth matching degree between the initial image and the preset motion mode is determined as the sum of the corresponding first sub-matching degree and the corresponding second sub-matching degree.

[0266] In a possible implementation, the determining module is specifically configured to:

[0267] If the first distance ratio is greater than or equal to a fourth threshold value, the first sub-matching degree between the initial image and the up-down motion mode is determined as a fourth value, and the first sub-matching degree between the initial image and other motion modes except the up-down motion mode is determined as 0, the fourth value being greater than 0.

[0268] If the first distance ratio is less than the fourth threshold value, the first sub-matching degree between the initial image and the down-up motion mode is determined as the fourth value, and the first sub-matching degree between the initial image and other motion modes except the down-up motion mode is determined as 0.

[0269] In a possible implementation, the determining module is specifically configured to:

[0270] If the second distance ratio is greater than or equal to a fifth threshold value, the second sub-matching degree between the initial image and the left-right motion mode is determined as a fourth value, and the second sub-matching degree between the initial image and other motion modes except the left-right motion mode is determined as 0, the fourth value being greater than 0.

[0271] If the second distance ratio is less than the fifth threshold value, the second sub-matching degree between the initial image and the right-left motion mode is determined as the fourth value, and the second sub-matching degree between the initial image and other motion modes except the right-left motion mode is determined as 0.

[0272] In a possible implementation, the determining module is specifically configured to:

[0273] The sum of at least two of the first matching degree, the second matching degree, the third matching degree and the fourth matching degree corresponding to the preset motion mode is determined as the matching degree between the initial image and the preset motion mode.

[0274] In a possible implementation, the determining module is specifically configured to:

[0275] The starting image corresponding to the initial image is determined according to the target motion mode of the initial image, the falling amplitude image, the duration and the motion speed.

[0276] determine the video segment corresponding to the initial image according to a duration of the initial image, a camera movement speed, a target camera movement mode, the start image and the end image;

[0277] generate the video according to the video segment corresponding to each initial image.

[0278] In a possible implementation, the determining module is specifically configured to:

[0279] if the target camera movement mode of the initial image is the up-down camera movement mode or the down-up camera movement mode, determine that the image width of the start image and the end image corresponding to the initial image is the same as the image width of the initial image;

[0280] if the target camera movement mode of the initial image is the left-right camera movement mode or the right-left camera movement mode, determine that the image height of the start image and the end image corresponding to the initial image is the same as the image height of the initial image.

[0281] In a possible implementation, the determining module is specifically configured to:

[0282] if the target camera movement modes of at least two adjacent initial images are the same, update the aspect ratios of the start images corresponding to the at least two initial images to be the same, and update the aspect ratios of the end images corresponding to the at least two initial images to be the same.

[0283] In a third aspect, an electronic device is provided, including a processor and a memory.

[0284] The memory stores computer-executable instructions.

[0285] The processor executes the computer-executable instructions stored in the memory, so that the at least one processor executes the video generation method in the first aspect and various possible designs of the first aspect.

[0286] In a fourth aspect, a computer-readable storage medium is provided, and the computer-readable storage medium stores computer-executable instructions. When a processor executes the computer-executable instructions, the video generation method in the first aspect and various possible designs of the first aspect is implemented.

[0287] In a fifth aspect, a computer program product is provided, and the computer program product includes a computer program. When a processor executes the computer program, the video generation method in the first aspect and various possible designs of the first aspect is implemented.

[0288] The above description merely illustrates the preferred embodiments of the disclosure and a principle for applying the technologies. It is understood by those skilled in the art that the disclosed scope of the disclosure is not limited to the technical solutions formed by the specific combinations of the technical features described above, and should also cover other technical solutions formed by the combinations of the technical features described above or their equivalent features without departing from the disclosed concept. For example, the technical solutions formed by the mutual replacement of the above-described features and the technical features with similar functions disclosed in the disclosure (but not limited to) can be formed.

[0289] Further, although operations are depicted in a particular, sequential order, this should not be understood as requiring or implying that the operations are performed in the order illustrated or sequentially. In certain circumstances, multitasking and parallel processing can be advantageous. Likewise, although specific implementation details are included for the purpose of providing a thorough disclosure, these should not be construed as limitations on the scope of the disclosure. Certain features that are described in the context of separate embodiments can also be implemented in combination in a single embodiment. Conversely, various features that are described in the context of a single embodiment can also be implemented in multiple embodiments separately or in any suitable sub-combination.

[0290] Although the subject matter has been described in language specific to structural features and / or methodological acts, it is to be understood that the subject defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are disclosed as example forms of implementing the claims.

Claims

1. A video generation method, characterized in that, include: Obtain a video generation request, which includes at least one initial image; Obtain the salient image and the partial image of the initial image; Obtain the first image information of the salient image and the second image information of the partial image; Based on the first image information and the second image information, determine the matching degree between the initial image and multiple preset camera movement methods; Based on the matching degree between the initial image and multiple preset camera movement methods, a target camera movement method is determined among the multiple preset camera movement methods, and the video is generated based on the target camera movement method of the initial image; The first image information includes a first size of the salient image and a first position of the salient image in the initial image; the second image information includes a second size of the partial image and a second position of the partial image in the initial image; Based on the first image information and the second image information, determine the matching degree between the initial image and multiple preset camera movement methods, including: Based on the first size and the second size, determine the height ratio, width ratio, and aspect ratio between the image and the salient image; Based on the first position and the second position, the boundary distance between the frame image and the salient image is determined, and the boundary distance includes: upper boundary distance, lower boundary distance, left boundary distance and right boundary distance; Based on the height ratio, width ratio, aspect ratio, and boundary distance, the matching degree between the initial image and multiple preset camera movement methods is determined.

2. The method according to claim 1, characterized in that, Based on the height ratio, width ratio, aspect ratio, and boundary distance, the matching degree between the initial image and multiple preset camera movement methods is determined, including: Based on the height ratio, a first degree of matching between the initial image and each preset camera movement method is determined; Based on the width ratio, a second matching degree between the initial image and each preset camera movement method is determined; Based on the aspect ratio, a third matching degree is determined between the initial image and each preset camera movement method; Based on the boundary distance, a fourth matching degree between the initial image and each preset camera movement method is determined; The matching degree between the initial image and multiple preset camera movement methods is determined based on at least one of the first matching degree, the second matching degree, the third matching degree, and the fourth matching degree.

3. The method according to claim 2, characterized in that, Based on the height ratio, a first matching degree between the initial image and each preset camera movement is determined, including: If the height ratio is less than or equal to a first threshold, then the first matching degree between the initial image and the vertical camera movement is determined as a first value, and... The first matching degree between the initial image and the up-down camera movement is determined to be the first value, and, The first matching degree between the initial image and other preset camera movements other than the up-and-down camera movement and the down-and-up camera movement is determined to be 0, and the first value is greater than 0.

4. The method according to claim 2, characterized in that, Based on the width ratio, a second matching degree between the initial image and each preset camera movement is determined, including: If the width ratio is less than or equal to the second threshold, then the second matching degree between the initial image and the left / right camera movement is determined to be the second value. The second matching degree between the initial image and the right-left camera movement is determined to be the second value, and, The second matching degree between the initial image and other preset camera movements besides the left-right camera movement and the right-left camera movement is determined to be 0, and the second value is greater than 0.

5. The method according to claim 2, characterized in that, Based on the aspect ratio, a third matching degree is determined between the initial image and each preset camera movement method, including: If the aspect ratio is less than or equal to the third threshold, then the third matching degree between the initial image and the near-far camera movement mode is determined to be the third value, and the third matching degree between the initial image and other camera movement modes besides the near-far camera movement mode is determined to be 0, wherein the third value is greater than 0. If the aspect ratio is greater than the third threshold, the matching degree between the initial image and the near-far camera movement is determined to be the third value, and the third matching degree between the initial image and other camera movement modes besides the near-far camera movement is determined to be 0.

6. The method according to claim 2, characterized in that, Based on the boundary distance, a fourth matching degree is determined between the initial image and each preset camera movement method, including: Obtain a first distance ratio between the upper boundary distance and the lower boundary distance, and a second distance ratio between the left boundary distance and the right boundary distance; Based on the first distance ratio, determine the first sub-matching degree between the initial image and each preset camera movement method; Based on the second distance ratio, determine the second sub-matching degree between the initial image and each preset camera movement method; For any preset camera movement method, the fourth matching degree between the initial image and the preset camera movement method is determined as the sum of the corresponding first sub-matching degree and the corresponding second sub-matching degree.

7. The method according to claim 6, characterized in that, Based on the first distance ratio, determining the first sub-matching degree between the initial image and each preset camera movement method includes: If the first distance ratio is greater than or equal to the fourth threshold, then the first sub-matching degree between the initial image and the vertical camera movement is determined to be the fourth value, and the first sub-matching degree between the initial image and other camera movements besides the vertical camera movement is determined to be 0, wherein the fourth value is greater than 0. If the first distance ratio is less than the fourth threshold, then the first sub-matching degree between the initial image and the up-down camera movement is determined to be the fourth value, and the first sub-matching degree between the initial image and other camera movements besides the up-down camera movement is determined to be 0.

8. The method according to claim 6, characterized in that, Determining the second sub-matching degree between the initial image and each preset camera movement method based on the second distance ratio includes: If the second distance ratio is greater than or equal to the fifth threshold, then the second sub-matching degree between the initial image and the left and right camera movement is determined to be the fourth value, and the second sub-matching degree between the initial image and other camera movement movements besides the left and right camera movement is determined to be 0, wherein the fourth value is greater than 0; If the second distance ratio is less than the fifth threshold, then the second sub-matching degree between the initial image and the right-left camera movement is determined to be the fourth value, and the second sub-matching degree between the initial image and other camera movements besides the right-left camera movement is determined to be 0.

9. The method according to any one of claims 2-8, characterized in that, Determining the matching degree between the initial image and the plurality of preset camera movement methods based on at least one of the first matching degree, the second matching degree, the third matching degree, and the fourth matching degree includes: For any preset camera movement method, the sum of at least two of the first matching degree, second matching degree, third matching degree and fourth matching degree corresponding to the preset camera movement method is determined as the matching degree between the initial image and the preset camera movement method.

10. The method according to any one of claims 2-8, characterized in that, The video generation request also includes the duration and camera movement speed of each initial image; based on the target camera movement method of the initial images, the video is generated, including: The starting image corresponding to the initial image is determined based on the target camera movement method of the initial image, the ending image, the duration, and the camera movement speed. Based on the duration of the initial image, camera movement speed, target camera movement method, the opening image, and the closing image, determine the video segment corresponding to the initial image; The video is generated based on the video segment corresponding to each initial image.

11. The method according to claim 10, characterized in that, Based on the target camera movement method of the initial image, the final image, the duration, and the camera movement speed, the starting image corresponding to the initial image is determined, including: If the target camera movement of the initial image is a vertical camera movement or a bottom-up camera movement, then the image width of the opening and closing images corresponding to the initial image is determined to be the same as the image width of the initial image. If the target camera movement of the initial image is a left-right camera movement or a right-left camera movement, then the image height of the opening and closing images corresponding to the initial image is determined to be the same as the image height of the initial image.

12. The method according to claim 11, characterized in that, Based on the duration of the initial image, camera movement speed, target camera movement method, the opening image, and the closing image, determine the video segment corresponding to the initial image, including: If at least two adjacent initial images have the same target camera movement, then update the aspect ratio of the starting images corresponding to the at least two initial images to be the same, and update the aspect ratio of the ending images corresponding to the at least two initial images to be the same.

13. A video generation apparatus, characterized in that, It includes a first acquisition module, a second acquisition module, a third acquisition module, and a determination module, wherein: The first acquisition module is used to acquire a video generation request, wherein the video generation request includes at least one initial image; The second acquisition module is used to acquire the salient image and the partial image of the initial image; The third acquisition module is used to acquire first image information of the significant image and second image information of the image with a focal length; The determining module is used for, Based on the first image information and the second image information, determine the matching degree between the initial image and multiple preset camera movement methods; Based on the matching degree between the initial image and multiple preset camera movement methods, a target camera movement method is determined among the multiple preset camera movement methods, and the video is generated based on the target camera movement method of the initial image; The first image information includes a first size of the salient image and a first position of the salient image in the initial image; the second image information includes a second size of the partial image and a second position of the partial image in the initial image; the determining module is specifically used for: Based on the first size and the second size, determine the height ratio, width ratio, and aspect ratio between the image and the salient image; Based on the first position and the second position, the boundary distance between the frame image and the salient image is determined, and the boundary distance includes: upper boundary distance, lower boundary distance, left boundary distance and right boundary distance; Based on the height ratio, width ratio, aspect ratio, and boundary distance, the matching degree between the initial image and multiple preset camera movement methods is determined.

14. An electronic device, characterized in that, include: Processor and memory; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory, causing the processor to perform the video generation method as described in any one of claims 1 to 12.

15. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, implement the video generation method as described in any one of claims 1 to 12.

16. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the video generation method as described in any one of claims 1 to 12.

Citation Information

Patent Citations

  • Image dynamic processing method, device and equipment and computer readable storage medium

    CN110580691A