Media data generation method and device, equipment, medium and product

By receiving and adjusting images, extracting and matching preset object positions in the image, the problem of images not aligning in special effects videos is solved, achieving a more coordinated video picture and better transition effects.

CN119967258APending Publication Date: 2025-05-09BEIJING ZITIAO NETWORK TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510120978.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-24
Publication Date
2025-05-09

AI Technical Summary

Technical Problem

In the special effects video generated in the prior art, some positions or parts of the image are not aligned, resulting in distortion of media data and poor transition effects.

Method used

By in response to the media data configuration operation, the first image is received and the second image is determined based on the first image and the image adjustment data. A third image including a preset object in the first image is extracted, and a fourth image related to the third image in the second image is determined based on the information of the third image. Media data to be displayed is generated based on the first image, the third image and the fourth image to ensure the alignment of the image positions.

Benefits of technology

It realizes the alignment of image positions when displaying the original image and generating the image, thereby improving the effect of video picture coordination and enhancing the screen display effect of media data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119967258A_ABST
    Figure CN119967258A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a media data generation method and device, electronic equipment, a storage medium and a program product. The method comprises the following steps: in response to a media data configuration operation, receiving a configured first image; determining a second image based on the first image and the image adjustment data; extracting a third image including a preset object in the first image, and determining a fourth image related to the third image in the second image based on first information of the third image; and generating media data to be displayed based on the first image, the third image and the fourth image. According to the technical scheme provided by the embodiment of the invention, when the image extracted from the original image is displayed and the image extracted from the generated image is displayed, some positions in the images are aligned, so that when the video is generated based on the images, the effect of improving the video picture coordination degree can be achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present disclosure relate to the field of computer processing technology, and in particular, to a method, apparatus, device, medium, and product for generating media data. Background Art

[0002] With the development of network technology, more and more applications have entered the lives of users, especially props that can generate special effects videos or short videos.

[0003] Currently, an expanded image can be generated based on an image uploaded by a user, and a special effects video can be generated based on the expanded image and the uploaded image. The two images may have inconsistent aspect ratios, resulting in some positions or parts in the generated image not being aligned, causing the generated media data to be distorted and the transition effect to be poor. Summary of the invention

[0004] The present disclosure provides a media data generation method, apparatus, device, medium and product to achieve that when an image extracted from an original image and an image extracted from a generated image are displayed, certain positions in the image are aligned, and when a video is generated based on such images, the coordination effect of the video picture can be improved.

[0005] In a first aspect, an embodiment of the present disclosure provides a method for generating media data, the method comprising:

[0006] In response to the media data configuration operation, receiving a configured first image;

[0007] Determine a second image based on the first image and the image adjustment data, wherein the first image is related to the screen content of the second image, and the first size data of the second image is related to the image adjustment data;

[0008] Extracting a third image including a preset object from the first image, and determining a fourth image related to the third image from the second image based on first information of the third image;

[0009] Generate media data to be displayed based on the first image, the third image, and the fourth image;

[0010] Wherein, the position information of the preset object in the third image is related to the position information of the preset object in the fourth image.

[0011] In a second aspect, an embodiment of the present disclosure further provides a media data generating device, the device comprising:

[0012] An image receiving module, configured to receive a configured first image in response to a media data configuration operation;

[0013] An image adjustment module, configured to determine a second image based on the first image and image adjustment data, wherein the first image is related to screen content of the second image, and first size data of the second image is related to the image adjustment data;

[0014] an image extraction module, configured to extract a third image including a preset object from the first image, and determine a fourth image related to the third image from the second image based on first information of the third image;

[0015] A media data generation module is used to generate media data to be displayed based on the first image, the third image and the fourth image; wherein the position information of the preset object in the third image is related to the position information of the preset object in the fourth image.

[0016] In a third aspect, an embodiment of the present disclosure further provides an electronic device, the electronic device comprising:

[0017] one or more processors;

[0018] a storage device for storing one or more programs,

[0019] When the one or more programs are executed by the one or more processors, the one or more processors implement the media data generation method as described in any one of the embodiments of the present disclosure.

[0020] In a fourth aspect, the embodiments of the present disclosure further provide a storage medium comprising computer executable instructions, which, when executed by a computer processor, are used to execute the media data generation method as described in any one of the embodiments of the present disclosure.

[0021] In a fifth aspect, the embodiments of the present disclosure further provide a computer program product, including a computer program, which, when executed by a processor, implements the media data generation method as described in any one of the embodiments of the present disclosure.

[0022] The technical solution of the disclosed embodiment provides a data basis for the subsequent generation of media data by receiving the configured first image in response to the media data configuration operation; further, based on the first image and the image adjustment data, a second image is determined, wherein the first image is related to the screen content of the second image, and the first size data of the second image is related to the image adjustment data, thereby achieving an effect of generating a second image whose screen content is related to the first image and whose size data is related to the image adjustment data based on the first image and the image adjustment data, and further, achieving an effect of adjusting the image size to generate a new image based on the existing image, thereby enhancing the richness of the generated image; further, extracting a third image including a preset object from the first image, and determining a fourth image related to the third image in the second image based on the first information of the third image, thereby achieving image extraction for any acquired image, and extracting an image related to the extracted image from a generated image related to the any acquired image based on the extracted image, thereby achieving an effect of extracting an image related to the extracted image for any acquired image. Image extraction is performed to ensure the effect of image extraction while meeting the image extraction requirements, and provides a data basis for the subsequent extraction of related images; further, based on the first image, the third image and the fourth image, media data to be displayed is generated; wherein, the position information of the preset object in the third image is related to the position information of the preset object in the fourth image, which solves the problem that some positions or parts in the images generated in the related technology are not aligned, thereby causing the generated media data to be distorted and the transition effect to be poor, and realizes the effect of extracting images related to the generated image according to the position information of the image extracted from the original image, and generating media data adapted to the original image, the image extracted from the original image and the image extracted from the generated image, thereby achieving that when the image extracted from the original image and the image extracted from the generated image are displayed, some positions in the image are aligned, and then when a video is generated based on such images, the coordination of the video picture can be improved, thereby improving the picture display effect of the media data. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the accompanying drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and the originals and elements are not necessarily drawn to scale.

[0024] Figure 1 A flowchart of a method for generating media data provided by an embodiment of the present disclosure;

[0025] Figure 2 A flowchart of another method for generating media data provided by an embodiment of the present disclosure;

[0026] Figure 3 A schematic diagram of a method for generating a second image provided by an embodiment of the present disclosure;

[0027] Figure 4 A schematic diagram of a method for generating a fourth image provided by an embodiment of the present disclosure;

[0028] Figure 5 A schematic diagram of an image effect of a fourth image provided by an embodiment of the present disclosure;

[0029] Figure 6 A flowchart of another method for generating media data provided by an embodiment of the present disclosure;

[0030] Figure 7 A schematic diagram of a first coordinate system provided by an embodiment of the present disclosure;

[0031] Figure 8 A schematic diagram of a process for deriving a target scaling ratio provided in an embodiment of the present disclosure;

[0032] Fig. 9 A schematic diagram of the structure of a media data generating device provided by an embodiment of the present disclosure;

[0033] Fig.10 A schematic diagram of the structure of an electronic device provided by the embodiment of the present disclosure for implementing the embodiment of the present disclosure. DETAILED DESCRIPTION

[0034] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments described herein, which are instead provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.

[0035] It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.

[0036] The term "including" and its variations used herein are open inclusions, i.e., "including but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". The relevant definitions of other terms will be given in the following description.

[0037] It should be noted that the concepts such as "first" and "second" mentioned in the present disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.

[0038] It should be noted that the modifications of "one" and "plurality" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".

[0039] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.

[0040] It is understandable that before using the technical solutions disclosed in the embodiments of the present disclosure, the types, scope of use, usage scenarios, etc. of the personal information involved in the present disclosure should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations.

[0041] For example, in response to receiving an active request from a user, a prompt message is sent to the user to clearly prompt the user that the operation requested to be performed will require obtaining and using the user's personal information. Thus, the user can autonomously choose whether to provide personal information to software or hardware such as an electronic device, application, server, or storage medium that performs the operation of the technical solution of the present disclosure according to the prompt message.

[0042] As an optional but non-limiting implementation, in response to receiving an active request from the user, the prompt information may be sent to the user in the form of a pop-up window, in which the prompt information may be presented in text form. In addition, the pop-up window may also carry a selection control for the user to choose "agree" or "disagree" to provide personal information to the electronic device.

[0043] It is understandable that the above notification and the process of obtaining user authorization are merely illustrative and do not constitute a limitation on the implementation of the present disclosure. Other methods that meet the relevant laws and regulations may also be applied to the implementation of the present disclosure.

[0044] It is understandable that the data involved in this technical solution (including but not limited to the data itself, the acquisition or use of the data) shall comply with the requirements of relevant laws, regulations and relevant provisions.

[0045] Before introducing the technical solution, an exemplary description of the application scenario can be given. The solution provided by the embodiment of the present disclosure can be applied in any scenario where at least two images required for a transition video need to be determined based on uploaded images, and at least two images required for a transition video can be determined based on the solution provided by the embodiment of the present disclosure, and media data can be generated.

[0046] For example, image A uploaded by a user can be cropped to obtain image B, and image A can be expanded to generate image C. Furthermore, image D related to image B can be determined from image C based on image B. Afterwards, media data to be displayed can be generated based on image A, image B, and image D.

[0047] Figure 1 The present invention provides a flow chart of a method for generating media data in an embodiment of the present invention. The present invention is applicable to a scenario where at least two images required for a transition video are determined based on uploaded images. The method can be executed by a media data generating device, which can be implemented in the form of software and / or hardware. Optionally, it can be implemented by an electronic device, which can be a mobile terminal, a PC, or a server. Figure 1 As shown, the method of this embodiment may specifically include:

[0048] S110 . In response to a media data configuration operation, receive a configured first image.

[0049] Among them, the solution provided based on the embodiment of the present disclosure can integrate corresponding special effects props and apply them in existing applications. When a trigger operation for a special effects prop is detected, the background can receive the trigger operation, that is, call the special effects prop that generates media data. At this time, the special effects prop is integrated with the special effects data that generates media data. In other words, when a trigger operation for the special effects prop is received, it is considered that the media data configuration operation is triggered. The first image can be understood as the image of the first display of the generated media data. The first image can be an image uploaded by the user; or, it can also be an image taken by a camera device called after the media data configuration operation is triggered; or, it can also be a template image assigned by the system. Accordingly, the first image can be the original image in the generated media data. The media data can be data that is about to be generated.

[0050] In the embodiment of the present disclosure, the first image may include at least the following three acquisition methods:

[0051] The first type: the first image may be an image captured in real time. When the user triggers the control for configuring media data, a camera device integrated in the terminal device may be called to capture the first image based on the camera device.

[0052] Second: The first image may be a pre-captured image, that is, an image in an image library. After detecting an operation that triggers configuration of media data, an application that caches images or an application in a gallery may be called to display the image library, so as to determine the first image based on a selection operation of the user in the image library.

[0053] The third type: the first image may be an image downloaded from the cloud. For example, after detecting an operation that triggers the configuration of media data, the image stored in the cloud may be automatically displayed and displayed on the display interface, and the first image may be determined based on the user's selection operation of the displayed image.

[0054] S120. Determine a second image based on the first image and the image adjustment data, wherein the first image is related to screen contents of the second image, and the first size data of the second image is related to the image adjustment data.

[0055] Among them, the image adjustment data can be understood as the basis for adjusting the image to generate the image adjustment of the second image. In the embodiment of the present disclosure, the image content of the second image generated after adjustment according to the image adjustment data is related to the screen content of the first image, and the first size data of the second image is related to the image adjustment data, that is, the screen content of the second image is similar to that of the first image, and the first size data of the second image is determined according to the image adjustment data. At this time, the image adjustment data may include image size adjustment data, and the image size adjustment data can be used to adjust the size data of the image to generate the second image. Optionally, the image size adjustment data includes height adjustment data and / or width adjustment data. The second image may be an image obtained after adjustment according to the image adjustment data. The first size data includes at least target height data and / or target width data. In the case where the screen content of the first image is related to that of the second image, the second image may be an image obtained after the size of the first image is adjusted according to the image adjustment data. Alternatively, the second image may also be an image obtained by processing the first image based on an existing image generation model to obtain a generated image, and resizing the generated image according to the image adjustment data; the image generation model may be a pre-trained model for generating a certain style type, and optionally, the style type may be a type displayed by a simulated round fan. Alternatively, the second image may also be an image obtained by, upon receiving the first image, the system searches for an image to be adjusted related to the content of the first image from all open source image libraries based on the content of the first image, and resizing the image to be adjusted according to the image adjustment data. In relation to the content of the first image, it is usually possible to calculate the content similarity between each image and the first image, and use the image with the highest similarity as the image to be adjusted. At this time, the content of the second image may be similar to that of the first image, or the image style type of the second image may be similar to that of the first image, or both the content and style type of the second image may be similar to those of the first image. Exemplarily, the second image may be an image obtained by stylizing the first image and expanding it according to the image adjustment data, that is, the second image may be an expanded stylized effect image obtained by stylizing the first image.

[0056] Specifically, when a special effect prop that triggers the configuration of media data is detected, that is, the configuration of media data operation is triggered, at this time, the user can select a first image and upload the first image. At the same time, loading information is displayed on the display interface, and the background can determine a second image related to the first image based on the first image and the image adjustment data.

[0057] In a specific implementation, when a first image is received, the first image can be stylized based on the stylization processing model to obtain an image to be adjusted, wherein the size data of the image to be adjusted is related to the size data of the first image, and the screen content of the image to be adjusted is related to the screen content of the first image. Further, the image size of the image to be adjusted is adjusted according to the image adjustment data, and the image after the size adjustment is used as the second image.

[0058] S130: extracting a third image including a preset object from the first image, and determining a fourth image related to the third image from the second image based on the first information of the third image.

[0059] It should be noted that, in the specific implementation process, the two steps S120 and S130 may be executed in parallel or sequentially, and the embodiment of the present disclosure does not specifically limit the execution order of the two steps.

[0060] Among them, the preset object may be a preset object that needs to be extracted from the image area where it is located. The preset object may include preset objects such as portraits, pets, buildings, etc. In the embodiment of the present disclosure, the first image may include a target object. In this case, the preset object may be the target object or a preset part of the target object. The target object may be an object such as a person, a pet, a building, etc. Exemplarily, assuming that the target object included in the first image is a person, the preset object may be the face of the person. The third image may be an image area including the preset object extracted from the first image. The third image may be an image cropped from the first image, which includes the preset object. Accordingly, the third image may be an image of a partial area in the first image.

[0061] It should be noted that the image size of the third image can be any size smaller than the image size of the first image, and the display area ratio of the preset object in the third image can be any ratio smaller than the display area ratio of the preset object in the first image. In order to make the display effect of the third image finally cropped better, the image size ratio of the third image can be made to meet the first preset ratio, and the display area ratio of the preset object in the third image can meet the second preset ratio. In other words, when extracting the third image including the preset object from the first image, the first image can be processed according to the preset image extraction condition to obtain the third image. The preset image extraction condition can include that the image size ratio meets the first preset ratio, the object display area ratio meets the second preset ratio, and the image size data is smaller than the image size data of the first image.

[0062] In a specific implementation, when a first image is received and it is detected that the first image includes a preset object, a preconfigured image extraction condition can be called up. Further, the first image can be processed according to the image extraction condition to obtain a third image including the preset object.

[0063] Among them, the first information may be information characterizing the image size and / or image position of the third image. The first information may be information based on any form of representation. Optionally, the first information may be coordinate information of at least one key information in the third image in any coordinate system. The at least one key information may include at least one of the first target position of the preset object, the center position of the third image, the first edge point on the first upper edge of the third image, the second edge point on the first right edge, the third edge point on the first lower edge, and the fourth edge point on the first left edge. The fourth image may be an image area extracted from the second image and related to the third image. Exemplarily, in the case where the second image is an expanded stylized rendering, the fourth image may be an image extracted from the expanded stylized rendering. In the embodiment of the present disclosure, the fourth image is an image area extracted from the second image based on the first information of the third image, and the first information is information characterizing the image size and / or image position of the third image. Furthermore, the fourth image is related to the image size and / or image position of the third image. Optionally, the image size of the fourth image may be consistent with the image size of the third image; and / or, the position information of some pixels in the fourth image is related to the position information of some pixels in the third image.

[0064] It should be noted that the first image includes a preset object, the second image is determined based on the first image, and further, the second image may also include a preset object; the third image includes a preset object, the fourth image is extracted from the second image based on the third image, and further, the fourth image includes the preset object. Moreover, the fourth image is an image extracted from the second image and related to the third image, and accordingly, the position information of the preset object in the third image is related to the position information of the preset object in the fourth image. That is to say, the position information of at least part of the key points of the preset object in the third image is the same as the position information of the same key point of the preset object in the fourth image. Optionally, in the case where the preset object is a preset part of the target object, the position information of the preset object is the center point of the preset part, and the position information of the center point of the preset part is the same as that of the third image and the fourth image during the display process. Exemplarily, assuming that the preset object is a person's face, the position information of the preset object is the center point of the face. Further, in the process of displaying the third image and the fourth image, the center points of the faces of the two images are aligned.

[0065] In a specific implementation, when the third image is obtained, the first information of the third image can be determined based on the image-related information of the third image. Further, the second image can be image extracted based on the first information, and a fourth image related to the third image can be extracted from the second image.

[0066] S140: Generate media data to be displayed based on the first image, the third image, and the fourth image.

[0067] The media data may be data including the order of image display and the display method corresponding to each image. In the embodiment of the present disclosure, the generated media data may present a display effect of smooth transition between the first image, the third image and the fourth image when displayed.

[0068] In a specific implementation, when the first image, the third image, and the fourth image are determined, the display order of the three images and the display method corresponding to each image can be determined. Further, the media data to be displayed can be generated according to the display method corresponding to the first image, the display method corresponding to the third image, the display method corresponding to the fourth image, and the image display order.

[0069] Optionally, based on the first image, the third image and the fourth image, the media data to be displayed is generated, including: displaying the first image according to the first preset animation special effect; displaying the third image in the target prop presented in the display screen when it is detected that the first image meets the preset stop display condition; displaying the fourth image after detecting that the target prop rotates to the target angle. The advantage of such a setting is that it improves the coordination of the screen content of the media data and the smooth transition between images, improves the adaptability between the media data and the target prop, and improves the display effect of the media data and the user experience of the special effect props.

[0070] Among them, the first preset animation special effect can be a special effect preset for displaying the first frame of the video frame. Optionally, the first preset animation special effect can be a static display, a dynamic display from bottom to top, or a dynamic display from top to bottom. The preset stop display condition may include the display time reaching a preset time threshold or receiving a stop display instruction input by the user. The target prop can be an image display area in the special effect prop for displaying a special effect image. Exemplarily, assuming that the special effect prop is a round fan special effect, its corresponding target prop can be a round fan. The target angle can be any angle, optionally, 180 degrees.

[0071] In a specific implementation, the first image can be displayed according to the first preset animation special effect. Further, when it is detected that the display time of the first image reaches the preset time threshold, the third image can be displayed in the target prop presented in the display interface, and the target prop can be rotated according to the preset rotation direction. Further, when it is detected that the rotation angle of the target prop reaches the target angle, the fourth image is displayed in the area where the target prop is presented in the display interface.

[0072] Exemplarily, the process of displaying media data is described by taking the round fan special effect as the target prop. The round fan includes two fan surfaces, front and back. The round fan special effect is used to display the media data, and the third image and the fourth image can be displayed based on the two fan surfaces. Among them, the third image can be displayed in one of the fan surfaces, and the fourth image can be displayed in the other fan surface. Further, when the round fan special effect is triggered, the first image can be displayed first. When the display time of the first image reaches the preset time, the third image can be displayed in the round fan presented in the display interface, and the round fan can be rotated during the display process. Further, after the round fan is rotated 180 degrees, when the other fan surface is displayed in the display interface, the fourth image can be displayed on the fan surface. Based on the technical solution provided by the embodiment of the present disclosure, it can be ensured that the preset positions in the two images displayed in the two fan surfaces of the round fan are aligned. Furthermore, when the round fan displays the third image and the fourth image, the picture coordination degree can be higher, and the special effect display effect is improved.

[0073] The technical solution of the disclosed embodiment provides a data basis for the subsequent generation of media data by receiving the configured first image in response to the media data configuration operation; further, based on the first image and the image adjustment data, a second image is determined, wherein the first image is related to the screen content of the second image, and the first size data of the second image is related to the image adjustment data, thereby achieving an effect of generating a second image whose screen content is related to the first image and whose size data is related to the image adjustment data based on the first image and the image adjustment data, and further, achieving an effect of adjusting the image size to generate a new image based on the existing image, thereby enhancing the richness of the generated image; further, extracting a third image including a preset object from the first image, and determining a fourth image related to the third image in the second image based on the first information of the third image, thereby achieving image extraction for any acquired image, and extracting an image related to the extracted image from a generated image related to the any acquired image based on the extracted image, thereby achieving an effect of extracting an image related to the extracted image for any acquired image. Image extraction is performed to ensure the effect of image extraction while meeting the image extraction requirements, and provides a data basis for the subsequent extraction of related images; further, based on the first image, the third image and the fourth image, media data to be displayed is generated; wherein, the position information of the preset object in the third image is related to the position information of the preset object in the fourth image, which solves the problem that some positions or parts in the images generated in the related technology are not aligned, thereby causing the generated media data to be distorted and the transition effect to be poor, and realizes the effect of extracting images related to the generated image according to the position information of the image extracted from the original image, and generating media data adapted to the original image, the image extracted from the original image and the image extracted from the generated image, thereby achieving that when the image extracted from the original image and the image extracted from the generated image are displayed, some positions in the image are aligned, and then when a video is generated based on such images, the coordination of the video picture can be improved, thereby improving the picture display effect of the media data.

[0074] Figure 2 A flowchart of another method for generating media data provided by an embodiment of the present disclosure. The technical solution of this embodiment, based on the above embodiment, describes in detail the specific implementation process of determining the second image based on the first image and the image adjustment data. For the specific implementation method, please refer to the description of this embodiment. Among them, the technical features that are the same or similar to the above embodiment are not repeated here.

[0075] like Figure 2 As shown, the method of this embodiment may specifically include:

[0076] S210: In response to a media data configuration operation, receive a configured first image.

[0077] S220: Input the first image into a style image generation model to obtain a fifth image; wherein the second size data of the fifth image is related to the third size data of the first image.

[0078] Among them, the style image generation model can be a pre-trained model for generating images of a preset style type. The style image generation model can be encapsulated in a special effect prop as a resource data, so that when the special effect prop is triggered, the first image can be processed based on the style image generation model to obtain a fifth image. Correspondingly, the fifth image is the image obtained after stylizing the first image. There is a certain difference between the style type of the fifth image and the style type of the first image, and the second size data of the fifth image is related to the third size data of the first image. The second size data is the size data that characterizes the image size of the fifth image, and the third size data is the size data that characterizes the image size of the first image. The size data may include image width data and / or image height data.

[0079] In a specific implementation, when the first image is received, the first image can be input into a pre-trained style image generation model. Further, the first image is stylized based on the style image generation model, the stylized image is output, and the image output by the model is used as the fifth image.

[0080] S230: Acquire pre-configured image adjustment data to adjust the second size data of the fifth image to obtain a second image.

[0081] The image adjustment data is the basis for adjusting the size data of the image. Generally, the size data of the image usually includes the image height and / or the image width. Furthermore, the image adjustment data at least includes the height adjustment data and / or the width adjustment data. Correspondingly, the second size data at least includes the first height data and / or the first width data.

[0082] In a specific implementation, when the fifth image is obtained, the pre-configured image adjustment data can be retrieved. Further, the second size data of the fifth image can be adjusted according to the image adjustment data, and the adjusted size data can be obtained. Then, the fifth image can be updated based on the adjusted size data, and the updated image can be used as the second image.

[0083] Optionally, the image adjustment data includes at least height adjustment data and / or width adjustment data, and the pre-configured image adjustment data is obtained to adjust the second size data of the fifth image to obtain the second image, including: determining the target height data after the height of the fifth image is expanded according to the height adjustment data and the first height data in the second size data; and / or determining the target width data after the width of the fifth image is expanded according to the width adjustment data and the first width data in the second size data; and generating the second image based on the target height data, the target width data and the fifth image. The advantage of such a setting is that, when the fifth image is adjusted according to the pre-configured image adjustment data to generate the second image, the effect of generating an image whose image content is related to the fifth image and whose image size is related to the image adjustment data is achieved based on the image adjustment data and the fifth image, thereby improving the image generation efficiency and ensuring the image generation effect under the premise of meeting the image adjustment requirements.

[0084] In the disclosed embodiment, expanding the size of an image may include expanding the height of the image and / or expanding the width of the image. Expanding the height of the image may also include expanding the image height along a first direction and / or expanding the image height along a direction opposite to the first direction. The first direction is a direction corresponding to the image height, for example, it may be a bottom-to-top direction. Correspondingly, expanding the width of the image may include expanding the image width along a second direction and / or expanding the image width along a direction opposite to the second direction. The second direction may be a direction corresponding to the image width, for example, it may be a left-to-right direction.

[0085] The height adjustment data is the adjustment basis for adjusting the image height. Optionally, the height adjustment data may include a first expansion ratio of the image in a first direction and / or a second expansion ratio of the image in a direction opposite to the first direction. The width adjustment data is the adjustment basis for adjusting the image width. Optionally, the width adjustment data may include a third expansion ratio of the image in a second direction and / or a fourth expansion ratio of the image in a direction opposite to the second direction.

[0086] In a specific implementation, the image adjustment data includes at least height adjustment data and width adjustment data. Further, the first product between the first expansion ratio and the first height data in the height adjustment data, and the second product between the second expansion ratio and the first height data can be determined. Afterwards, the first height data, the first product, and the second product can be added, and the data obtained after the addition can be used as the target height data. And, the third product between the third expansion ratio and the first width data in the width adjustment data, and the fourth product between the fourth expansion ratio and the first width data are determined. Afterwards, the first width data, the third product, and the fourth product can be added, and the data obtained after the addition can be used as the target width data. Further, the fifth image can be image expanded based on the target height data and the target width data by a preset image expansion method, and the image obtained after the expansion can be used as the second image, at which time, the first size data of the second image is the target width data and the target height data. It should be noted that expanding an image can be a process of expanding the image content of an existing image to generate new content outside the existing image. Optionally, the preset image expansion method includes generating an expanded image based on an image expansion model; or generating an expanded image based on an image expansion algorithm, etc. For example, Figure 3 As shown, Figure 3 The image a in the figure is the fifth image, and the fifth image can be expanded in four directions to obtain the second image, such as Figure 3 As shown in Figure b.

[0087] Exemplarily, assuming that the first width data of the fifth image is W t , the first height data is H t , the first expansion ratio, the second expansion ratio, the third expansion ratio and the fourth expansion ratio are E b ,E l ,E t ,E r , then the target width data of the second image is W t ′ =W t (1+E l +E r ), the target height data is H t ′ =H t (1+E t +E b ).

[0088] S240: Extract a third image including a preset object from the first image, and determine a fourth image related to the third image from the second image based on the first information of the third image.

[0089] S250: Generate media data to be displayed based on the first image, the third image, and the fourth image.

[0090] For example, Figure 4 As shown, assuming Figure 4 Figure 41 is the first image, Figure 42 is the third image, and Figure 43 is the second image. Figures 41, 42, and 43 can be placed in an image space determined based on Figure 43. Then, based on the information of Figure 42 in the image space, a fourth image related to Figure 43 can be extracted from Figure 43. The extracted fourth image can be as follows: Figure 5 As shown, Figure 5 FIG51 in FIG42 is the image area corresponding to the fourth image. It can be seen from FIG42 and FIG51 that the image size data of FIG51 is consistent with that of FIG42, the head area ratio in FIG51 is smaller than that in FIG42, and the center point of the head in FIG51 is aligned with the center point of the head in FIG42.

[0091] The technical solution of the embodiment of the present disclosure obtains a fifth image by inputting a first image into a style image generation model; wherein the second size data of the fifth image is related to the third size data of the first image; further, obtaining pre-configured image adjustment data to adjust the second size data of the fifth image to obtain a second image, thereby achieving generation of a stylized image based on the uploaded image, and adjusting the stylized image based on the pre-configured image adjustment data to obtain the desired image effect, thereby improving the image display effect.

[0092] The technical solution of this embodiment is based on the above embodiment, and the extraction process of the third image in S130 is described in detail. The specific implementation method can refer to the description of this embodiment. Among them, the technical features that are the same or similar to the above embodiment are not repeated here.

[0093] Optionally, extracting the third image including the preset object from the first image includes: cropping the first image based on a preset first condition to obtain the third image including the preset object.

[0094] Among them, the first condition can be a condition referred to when cropping the first image. Or, the first condition can also be understood as a condition for limiting the image cropping process of the first image. Optionally, the first condition at least includes that the third image is a partial area image in the first image, the fourth size data of the third image satisfies the first preset ratio, and the display area of ​​the preset object displayed in the third image and the fourth size data of the third image meet the second preset ratio. The first preset ratio can be used to limit the ratio between the image width and the image height. The first preset ratio can be any ratio, optionally, 1:1. The second preset ratio can be used to limit the ratio between the display area size of the preset object in the third image and the fourth size data of the third image. The second preset ratio can be any ratio, optionally, 10%, 20% or 30%, etc.

[0095] It should be noted that the third image is an image obtained by cropping the first image, and further, the ratio between the display area size of the preset object in the first image and the third size data of the first image is smaller than the ratio between the display area size of the preset object in the third image and the fourth size data of the third image. In other words, compared with the preset object in the first image, the preset object in the third image will visually appear to be enlarged in size.

[0096] In a specific implementation, when the first image is received, the preset first condition can be called. Then, the first image can be cropped according to the first condition, so that the third image obtained after cropping is a partial area image in the first image, the fourth size data of the third image satisfies the first preset ratio, and the display area of ​​the preset object displayed in the third image and the fourth size data of the third image are not less than the second preset ratio.

[0097] The technical solution of the disclosed embodiment, by cropping the first image based on a preset first condition, obtains a third image including a preset object, thereby achieving the effect of cropping any acquired image, improving the universality of the image cropping function, and, under the premise of meeting the cropping requirements, ensuring the image cropping effect.

[0098] Figure 6 This is a flow chart of another method for generating media data provided by an embodiment of the present disclosure. The technical solution of this embodiment is based on the above embodiment, and the process of determining the fourth image in S130 is described in detail. For specific implementation methods, please refer to the description of this embodiment. Among them, the technical features that are the same or similar to the above embodiment are not repeated here. Figure 6 As shown, the method of this embodiment may specifically include:

[0099] S310: In response to a media data configuration operation, receive a configured first image.

[0100] S320: Determine a second image based on the first image and the image adjustment data, wherein the first image is related to screen contents of the second image, and the first size data of the second image is related to the image adjustment data.

[0101] S330, extracting a third image including a preset object from the first image, and obtaining first information of at least one key information in the third image in a first coordinate system; wherein the first coordinate system is determined based on the first image.

[0102] Among them, at least one key information may be information characterizing the image size, image position and / or position information of the key points of the image of the third image. At least one key point information may include multiple pieces of information associated with the third image, optionally including at least the first target position of the preset object, the center position of the third image, the first edge point on the first upper edge of the third image, the second edge point on the first right edge, the third edge point on the first lower edge and the fourth edge point on the first left edge. The first target position may be the position information of the preset object in the third image. Optionally, when the preset object is a preset part of the target object, the first target position may be the center point of the preset part. The first target position may be represented by any form of position information, and optionally, the first target position may be represented based on the coordinate information of the preset object in the third image. The center position is the position where the center of the image is located. The first upper edge is the upper image edge in the third image. The first edge point may be any point on the first upper edge, and optionally, it may be the left end point of the edge, the right end point of the edge and / or the center point of the edge. The first right edge is the right image edge in the third image. The second edge point may be any point on the first right edge, and optionally, it may be the upper end point of the edge, the lower end point of the edge and / or the center point of the edge. The first lower edge is the lower image edge in the third image. The third edge point can be any point on the first lower edge, and optionally, it can be the left end point of the edge, the right end point of the edge and / or the center point of the edge. The first left edge is the left image edge of the third image. The fourth edge point can be any point on the first left edge, and optionally, it can be the upper end point of the edge, the lower end point of the edge and / or the center point of the edge. The first coordinate system is an image coordinate system constructed based on the first image, that is, the coordinate system is constructed with the upper left end point of the first image as the origin of the coordinate system, the straight line where the upper edge of the first image is located as the x-axis, and the straight line where the left edge of the first image is located as the y-axis. At this time, the constructed coordinate system can be used as the first coordinate system.

[0103] In a specific implementation, when the third image is obtained, at least one key information in the third image can be obtained. Further, a first coordinate system can be constructed based on the first image, and information of each key information in the first coordinate system can be determined, and the determined at least one information can be used as the first information.

[0104] Optionally, obtaining the first information of at least one key information in the third image in the first coordinate system includes: determining the first position information of the first target position in the first coordinate system; determining the second position information of the center position in the first coordinate system; determining the first distance information from the position information of the first edge point to the second upper edge of the first image, the second distance information from the position information of the second edge point to the second left edge of the first image, the third distance information from the position information of the third edge point to the second upper edge of the first image, and the fourth distance information from the position information of the fourth edge point to the second left edge of the first image in the first coordinate system; using the first position information, the second position information and the first distance array as the first information. The advantage of such a setting is that it realizes the effect of determining the coordinate information of the key information in the third image in the first coordinate system, realizes the mapping between the third image and the first coordinate system, and provides a data basis for the subsequent determination of the required target information.

[0105] Among them, the first position information may be the coordinate information of the first target position in the first coordinate system. The second position information is the coordinate information of the center position in the first coordinate system. The first distance information may be the relative distance between the position information of the first edge point and the second upper edge. The second distance information may be the relative distance between the position information of the second edge point and the second right edge. The third distance information may be the relative distance between the position information of the third edge point and the second upper edge. The fourth distance information may be the relative distance between the position information of the fourth edge point and the second edge. The first distance array includes the first distance information, the second distance information, the third distance information and the fourth distance information.

[0106] In a specific implementation, a first coordinate system can be established based on the first image, and the third image can be placed in the first coordinate system according to the pixel matching rule. Further, the first target position can be mapped to the first coordinate system to obtain the first position information of the first target position in the first coordinate system. And, the center position is mapped to the first coordinate system to obtain the second position information of the center position in the first coordinate. And, in the first coordinate system, the position information of the first edge point is mapped to the first coordinate system to obtain the first position information to be processed of the first edge point, and the relative distance between the first edge point and the second upper edge is determined according to the first position information to be processed and the coordinate information of the second upper edge to obtain the first distance information. Similarly, the second distance information, the third distance information and the fourth distance information can be determined. Further, the first distance information, the second distance information, the third distance information and the fourth distance information can be used as the first distance array, and the first position information, the second position information and the first distance array can be used as the first information.

[0107] In order to explain the determination process of the first information more clearly and intuitively, Figure 7 The above process is explained below. Figure 7 As shown, Figure 7 The coordinate system in is the first coordinate system, region A is the first image, and the second upper edge, second right edge, second lower edge and second left edge of the first image are t o ,r o ,b o ,l o ; Region B is the third image, and the first upper edge, the first right edge, the first lower edge and the first left edge of the third image are t c ,r c ,b c ,l c , the first target position is P f , the center position is P c The first distance information, the second distance information, the third distance information and the fourth distance information are L1, L2, L3 and L4 respectively.

[0108] S340, determining second information of the first information in a target coordinate system; wherein the target coordinate system is determined based on the second image.

[0109] It should be noted that the expected effect that the technical solution provided by the embodiment of the present disclosure ultimately aims to achieve is: the fourth size data of the third image is related to the fifth size data of the fourth image, and when the third image and the fourth image are rendered on the same canvas, the position information of the preset objects in the two objects overlap. In order to achieve the above expected effect, when determining the fourth image related to the third image from the second image, all parameter information used to determine the fourth image can be placed in a target coordinate system determined based on the second image. Furthermore, the fourth image can be determined based on the information corresponding to the parameter information in the target coordinate system.

[0110] Among them, the second information can be the information of the first information in the target coordinate system. Optionally, the second information includes the information of the first position information in the target coordinate system, the information of the second position information in the target coordinate system and the information of the first distance array in the target coordinate system. The target coordinate system is an image coordinate system constructed based on the second image, that is, the upper left endpoint of the second image is used as the origin of the coordinate system, the straight line where the upper edge of the second image is located is used as the x-axis, and the straight line where the left edge of the second image is located is used as the y-axis to construct the coordinate system. At this time, the constructed coordinate system can be used as the target coordinate system.

[0111] In a specific implementation, a target coordinate system may be constructed based on the second image, and when the first information is obtained, the first information is mapped and placed in the target coordinate system to determine the information of the first information in the target coordinate system, and the determined information is used as the second information.

[0112] Optionally, determining the second information of the first information in the target coordinate system includes: determining the image edge position information of each image edge of the first image in the target coordinate system based on the second size data and image adjustment data of the fifth image; updating the distance information in the first distance array of the third image based on the edge position information corresponding to each image edge and the first distance array of the third image; determining the third position information of the first position information in the target coordinate system based on the first position information and the image edge position; determining the fourth position information of the center position in the target coordinate system based on the center position and the updated first distance array; and using the third position information, the fourth position information and the updated first distance array as the second information. The advantage of such a setting is that it realizes the effect of placing all the required information in the same target coordinate system and determining the second information in the target coordinate system, and then realizes the mapping between parameter information in different coordinate systems, and ensures that when image extraction is performed based on the second information, the extracted image can meet the expected effect.

[0113] The image edge position information may be understood as the position information of the image edge of the first image in the target coordinate system. Optionally, the image edge position information includes the top edge position, the bottom edge position, the left edge position and the right edge position.

[0114] In a specific implementation, the fifth image may be placed in the target coordinate system, and the top edge position and the bottom edge position in the image edge position information may be determined based on the height data in the second size data and the height adjustment data in the image adjustment data. Also, the left edge position and the right edge position in the image edge position information may be determined based on the width data in the second size data and the width adjustment data in the image adjustment data.

[0115] Optionally, the image adjustment data includes a height expansion ratio and / or a width expansion ratio, wherein the height expansion ratio includes a first ratio for height expansion in a first direction and a second ratio for height expansion in a direction opposite to the first direction, and the width expansion ratio includes a third ratio for width expansion in a second direction and a fourth ratio for width expansion in a direction opposite to the second direction. The direction vectors corresponding to the first direction and the second direction are perpendicular.

[0116] Optionally, based on the second size data and image adjustment data of the fifth image, the image edge position information of each image edge of the first image in the target coordinate system is determined, including: determining the top edge position in the image edge position information based on the height data in the second size data and the first ratio; determining the bottom edge position in the image edge position information based on the height data in the second size data and the third ratio; determining the left edge position in the image edge position information based on the width data in the second size data and the second ratio; determining the right edge position in the image edge position information based on the width data in the second size data and the fourth ratio. The advantage of such a setting is that the effect of expanding the size of the image based on the image expansion ratio is achieved, so that the expanded image can meet the expected image requirements.

[0117] In a specific implementation, the product of the height data and the first ratio may be determined, and the product may be used as the top edge position in the image edge position information. Also, the product of the height data and the third ratio may be determined, and the product may be added to the height data, and the data obtained after the addition may be used as the bottom edge position. Also, the product of the width data and the second ratio may be determined, and the product may be used as the left edge position. Also, the product of the width data and the fourth ratio may be determined, and the product may be added to the width data, and the data obtained after the addition may be used as the right edge position.

[0118] Exemplarily, it is assumed that the top edge position, the right edge position, the bottom edge position and the left edge position of the first image are t o ,r o ,b o ,l o ; The first ratio, the second ratio, the third ratio and the fourth ratio are E t ,E b ,E r ,E l . Further, t o =E t *H t ; r o =(1+E l )*W t ; b o =(1+E t )*H t ; l o =E l *W t .

[0119] In the embodiment of the present disclosure, when the image edge position information of each image edge of the first image in the target coordinate system is obtained, the distance information in the first distance array can also be updated according to the image edge position. Specifically, the first distance information and the top edge position in the first distance array can be added, and the value obtained after the addition is used as the updated first distance information. The right edge position is subtracted from the second distance information in the first distance array, and the value obtained after the subtraction is used as the updated second distance information. The bottom edge position is subtracted from the third distance information in the first distance array, and the value obtained after the subtraction is used as the updated third distance information. The left edge position is added to the fourth distance information in the first distance array, and the value obtained after the addition is used as the updated fourth distance information.

[0120] For example, assuming that the updated first distance array is t c ,r c ,b c ,l c . Furthermore, t c =t c +t o ,r c =r o -r c ,b c =b o -b c ,l c = l o +l c .

[0121] In the disclosed embodiment, the third position information of the first position information in the target coordinate system can also be determined based on the first position information and the image edge position information. Specifically, the abscissa in the third position information is determined based on the abscissa and the left edge position in the first position information, and the ordinate in the third position information is determined based on the ordinate and the top edge position in the first position information. That is, the abscissa in the first position information can be added to the left edge position, and the value obtained by the addition is used as the abscissa in the third position information. The ordinate in the first position information can be added to the top edge position, and the value obtained by the addition is used as the ordinate in the third position information.

[0122] Exemplarily, the third position information may be: f =[x f +l o ,y f +t o ]. Among them, x f is the horizontal coordinate in the first position information; f is the vertical coordinate in the first position information.

[0123] In the embodiment of the present disclosure, the fourth position information of the center position in the target coordinate system can also be determined based on the center position and the updated first distance array. Specifically, the horizontal coordinate in the fourth position information is determined based on the second distance information and the fourth distance information in the updated distance array, and the vertical coordinate in the fourth position information is determined based on the first distance information and the third distance information in the updated distance array. That is, the second distance information and the fourth distance information are added, the ratio between the information obtained after the addition and the preset value is determined, and the ratio is used as the horizontal coordinate in the fourth position information. The first distance information and the third distance information are added, the ratio between the information obtained after the addition and the preset value is determined, and the ratio is used as the vertical coordinate in the fourth position information. Optionally, the preset value can be 2.

[0124] Exemplarily, the fourth position information may be: c =[(l c +r c ) / 2,(t c +b c ) / 2].

[0125] S350, determining an image extraction range according to the second information, a target zoom ratio corresponding to the third image, and fourth size data of the third image; wherein the target zoom ratio is determined based on the second information and the first size data of the second image.

[0126] Among them, the target scaling ratio can be a parameter based on which the third image is scaled. In the embodiment of the present disclosure, a fourth image related to the third image is extracted from the second image based on the first information of the third image. Furthermore, when the third image and the second image are placed in a target coordinate system determined based on the second image, and the second information of the first information in the target coordinate system is determined, the image extraction range corresponding to the fourth image can be determined by scaling the third image in the target coordinate system. Because the image extraction range finally determined is a partial image area in the second image. Furthermore, the target scaling ratio can be determined based on the second information and the first size data of the second image, so that when the third image is scaled according to the target scaling ratio, the image range obtained by the final scaling is always processed within the second image. The image extraction range can be the extraction basis based on which the region of interest is extracted from the second image. The image extraction range is a region extraction parameter in the target coordinate system, and further, the image extraction range can be expressed based on the relative distance between the edge of the extracted region and the corresponding coordinate axis in the target coordinate system. Optionally, the image extraction range includes top distance information from the top edge of the image extraction area to the top edge of the second image, right edge distance information from the right edge of the image extraction area to the left edge of the second image, bottom distance information corresponding to the bottom edge of the image extraction area to the top edge of the second image, and left edge distance information from the left edge of the image extraction area to the left edge of the second image.

[0127] It should be noted that scaling the third image according to the target scaling ratio may be adjusting the position information of each pixel in the third image according to the target scaling ratio. Furthermore, the fifth size data of the fourth image may be determined based on the fourth size data of the third image according to the target scaling ratio.

[0128] In a specific implementation, the target scaling ratio corresponding to the third image can be determined based on the second information and the first size data of the second image. Further, the fifth size data of the fourth image can be determined based on the fourth size data of the third image according to the target scaling ratio. Thereafter, the image extraction range can be determined based on the fifth size data, the target scaling ratio, and the second information.

[0129] S360: Sample and process the second image based on the image extraction range to obtain a fourth image.

[0130] In the embodiment of the present disclosure, when the image extraction range is obtained, the second image can be sampled based on the image extraction range, and the sampled image is used as the fourth image.

[0131] S370: Generate media data to be displayed based on the first image, the third image, and the fourth image.

[0132] The technical solution of the embodiment of the present disclosure is to obtain first information of at least one key information in the third image in a first coordinate system; wherein the first coordinate system is determined based on the first image; further, determine second information of the first information in a target coordinate system; wherein the target coordinate system is determined based on the second image; further, determine an image extraction range according to the second information, a target zoom ratio corresponding to the third image, and fourth size data of the third image; wherein the target zoom ratio is determined based on the second information and the first size data of the second image; further, sample and process the second image based on the image extraction range to obtain a fourth image, thereby achieving the effect of determining the second information of at least one key information in the third image in the target coordinate system and determining the image extraction range according to the second information and the target zoom ratio, achieving the effect of extracting a fourth image related to the second image from the second image based on the third image, and ensuring that the position information of the preset object in the third image is related to the position information of the preset object in the fourth image.

[0133] The technical solution of this embodiment can specifically describe the process of determining the target scaling ratio based on the above embodiment. The specific implementation method can refer to the description of this embodiment. Among them, the technical features that are the same or similar to the above embodiment are not repeated here.

[0134] It should be noted that the expected effect ultimately achieved by the technical solution provided by the embodiment of the present disclosure includes that the fourth size data of the third image is related to the fifth size data of the fourth image, and when the third image and the fourth image are rendered on the same canvas, the position information of the preset objects in the two images overlap. In order to achieve the expected effect, the following reasoning process can be used, and combined with Figure 8 Explain the reasoning process:

[0135] First, if the corresponding image is directly extracted from the cropped area of ​​the first image on the second image, the extracted image will naturally meet this goal. However, in this case, it is meaningless to expand the image. The ultimate desired effect of this technical solution is that the position information of the preset objects in the third and fourth images does not change on the basis of the expansion. In order to achieve the ultimate desired effect, a configuration can be constructed first, and it is assumed that the configuration meets the expected effect. The configuration that meets the expected effect is as follows: Figure 8 As shown in Figure a, from the center position P of the third image c Start from the preset object location information P f Construct a vector and move the center position P of the fourth image in the opposite direction of this vector c ′ ;

[0136] At the same time, the enlargement ratio of the width and height of the cropped area in the current second image (ie, the fourth image) relative to the width and height of the third image is:

[0137]

[0138] For convenience, we can define n = distance (P c ′ ,P f ),m=distance(P c ,P f ), where s, m are known quantities, n = sm; at the same time, in order to facilitate the subsequent description, define The unit vector in the opposite direction of is is also a known quantity. Further, Figure 8 As shown in Figure b, the third image and the fourth image can be placed on the same display area. According to the scaling rule, the third image and the fourth image can be placed on the same display area. c ′ When scaling is performed with P as the center, the P f and P in the fourth image f Alignment.

[0139] Based on the above description, along Go to the sliding center point P c To the center point P of the final fourth image c ′ , and with The final expected effect can be achieved by setting the scaling ratio corresponding to the third image.

[0140] Based on the above description, the target scaling ratio corresponding to the third image can be determined. The process of determining the target scaling ratio can be specifically described below.

[0141] Based on the above technical solution, it also includes: determining the target zoom ratio corresponding to the third image according to the first size data of the second image, the fourth position information and the third position information in the second information, and the fourth size data of the third image.

[0142] The target scaling ratio may be a ratio used when scaling the third image.

[0143] In a specific implementation, in order to make the position of the preset object in the final fourth image consistent with that in the third image, according to the above-mentioned reasoning process, the target scaling ratio corresponding to the third image can be determined based on the first size data of the second image, the fourth position information and the third position information in the second information, and the fourth size data of the third image.

[0144] Optionally, the target scaling ratio corresponding to the third image is determined according to the first size data of the second image, the fourth position information and the third position information in the second information, and the fourth size data of the third image, including: determining the unit offset vector and the offset distance information according to the fourth position information and the third position information; substituting the unit offset vector, the offset distance information, the second size data of the fifth image, and the fourth size data into at least four predetermined scaling ratio determination models to obtain the scaling ratio to be selected output by each scaling ratio determination model; determining the target scaling ratio based on the scaling ratio to be selected and the preset scaling ratio. The advantage of such a setting is that it realizes the effect of determining the target scaling ratio by means of edge touch detection and pre-configured scaling ratio, and thus, ensures the image scaling effect under the premise of meeting the image scaling requirements.

[0145] The unit offset vector may be a unit vector of an offset vector pointing from the third position information to the fourth position information, that is, The offset distance information may be the relative distance information between the position information of the preset object and the center position of the third image, that is, m=distance(P c ,P f ). The scaling ratio determination model is a function corresponding to when the edge of the third image touches the image edge of the second image after the third image is magnified. Generally, in the process of magnifying the third image in the target coordinate system constructed based on the second image, the image edge of the third image will touch the image edge of the second image. In order to ensure that the image size of the enlarged third image is not larger than the image size of the second image, the function corresponding to when the edge of the third image touches the image edge of the second image after the third image is magnified can be simulated to obtain the scaling ratio determination model, so as to detect the situation that the edge of the enlarged third image touches the image edge of the second image based on the scaling ratio determination model, and determine the maximum croppable range. The image edges of the second image include an upper image edge, a right image edge, a lower image edge, and a left image edge. Accordingly, the scaling ratio determination model may include a ratio determination model corresponding to the upper image edge, a ratio determination model corresponding to the right image edge, a ratio determination model corresponding to the lower image edge, and a ratio determination model corresponding to the left image edge.

[0146] Exemplarily, the expressions of the four scaling ratio determination models can be described respectively in combination with the above derivation process:

[0147] First, define P c ′ =[x c ′ ,y c ′ ],Pc =[x c ,y c ],P f =[x f ,y f ], the width and height of the third image are (according to the updated first distance array t c ,r c ,b c ,l c ) is w=r c -l c ,h=b c -t c , the scaling ratio is s, and the width and height of the third image after enlargement are w ′ =sw,h ′ =sh;P c ′ is the center position of the third image after enlargement; P c is the center position of the third image; P f is the position information of the preset object in the third image.

[0148] For the scaling ratio determination model corresponding to the edge of the upper image: when the upper edge of the third image touches the upper edge of the second image after zooming in, it can be indicated that the current state is y c ′ =h ′ / 2; Based on the above derivation process, it can be determined so, Furthermore, c ′ =h ′ / 2, which can be expanded to Furthermore, we can solve You can The model is determined as the scaling ratio corresponding to the upper image edge. express The component vector in the x-axis direction, express The component vector in the y-axis direction.

[0149] For the scaling ratio determination model corresponding to the right image edge: when the right edge of the enlarged third image touches the right edge of the second image, it can be indicated that the current state is x c ′ +w ′ / 2=W t ′ Based on the above derivation process, it can be determined that so, Furthermore, xc ′ +w ′ / 2=W t ′ , which can be expanded to Then, we can solve You can The model is determined as a scale corresponding to the right image edge.

[0150] For the scaling ratio determination model corresponding to the edge of the lower image: when the lower edge of the enlarged third image touches the lower edge of the second image, it can be indicated that the current state is y c ′ +h ′ / 2=H t ′ Based on the above derivation process, it can be determined that so, Furthermore, c ′ +h ′ / 2=H t ′ , which can be expanded to Then, we can solve You can The model is determined as a scale corresponding to the lower image edge.

[0151] For the scaling ratio determination model corresponding to the left image edge: when the left edge of the enlarged third image touches the left edge of the second image, it can be indicated that the current state is x c ′ =w ′ / 2; Based on the above derivation process, it can be determined so, Furthermore, x c ′ =w ′ / 2, which can be expanded to Then, we can solve

[0152] The zoom ratio to be selected may be a zoom ratio determined based on a zoom ratio determination model. The preset zoom ratio may be a preset candidate zoom ratio. The preset zoom ratio may be an empirical value set by a user, or may be a value calculated based on a preset calculation logic (such as a preset object occupying a screen space ratio). Optionally, the preset zoom ratio may be 2.

[0153] It should be noted that the advantage of setting a preset zoom ratio is that, in addition to the four image edge constraints, we do not want the display area of ​​the preset object in the final fourth image to be too small. In this case, we can add an empirical constraint to the target zoom ratio, namely the preset zoom ratio.

[0154] In a specific implementation, an offset vector may be determined according to the third position information and the fourth position, and a unit vector of the offset vector may be determined to obtain a unit offset vector. Also, offset distance information may be determined according to the third position information and the fourth position information. Further, the unit offset vector, the offset distance information, the second size data and the fourth size data of the fifth image may be substituted into at least four predetermined scaling ratio determination models to obtain a scaling ratio to be selected output by each scaling ratio determination model.

[0155] It should be noted that, in the process of scaling the third image based on the target scaling ratio, it is necessary to ensure that the maximum capture range is determined when the enlarged third image is a partial region image of the second image.

[0156] Optionally, determining the target zoom ratio based on the zoom ratio to be selected and the preset zoom ratio includes: taking the minimum value of the zoom ratio to be selected and the preset zoom ratio as the target zoom ratio.

[0157] In a specific implementation, when at least four zoom ratios to be selected and a preset zoom ratio are obtained, the zoom ratio to be selected and the preset ratio may be compared to determine a minimum value, and the minimum value is used as the target zoom ratio.

[0158] Exemplarily, the target scaling ratio may be determined based on the following formula:

[0159]

[0160] Among them, s final This is the target zoom ratio.

[0161] It should be noted that if P f ,P c The positions are almost coincident (distance <1e-6). When extracting the fourth image from the second image, it can be determined whether to intercept vertically downward or vertically upward based on the degree of association between the image content of the extracted fourth image and the preset object, or the image richness upward or downward in the image after the fourth image is expanded. For example, the final retained part of the second image (i.e., the extracted fourth image) is a local area of ​​a tree. At this time, it may be desirable to obtain an effect image representing the upward growth trend of the tree. At this time, The direction of is defined as vertically upward, that is Because in this case, we want to see the crown part connected to the tree, rather than the trunk or soil part. Therefore, in order to improve the image display effect, the image can be extracted vertically upward along the direction of the unit offset vector in the second image, so that most of the image area in the final second image is the crown part of the tree.

[0162] The technical solution provided in this embodiment determines the target scaling ratio corresponding to the third image based on the first size data of the second image, the fourth position information and the third position information in the second information, and the fourth size data of the third image, so that when the image is scaled based on the target scaling ratio, the obtained image can meet the expected effect and ensures that the position information of the preset object in the final fourth image is related to the position information of the preset object in the third image.

[0163] The technical solution of this embodiment is based on the above embodiment, and specifically describes the process of determining the image extraction range. The specific implementation method can refer to the description of this embodiment. Among them, the technical features that are the same or similar to the above embodiment are not repeated here.

[0164] Optionally, the image extraction range is determined based on the second information, the target scaling ratio corresponding to the third image, and the fourth size data of the third image, including: determining the fifth size data of the fourth image based on the fourth size data and the target scaling ratio of the third image; determining the image extraction range based on the fifth size data, the target scaling ratio, the fourth position information in the second information, the unit offset vector, and the offset distance information.

[0165] The fifth size data includes width data and height data. Optionally, the image extraction range includes top distance information from the top edge of the fourth image to the top edge of the second image, right edge distance information from the right edge of the fourth image to the left edge of the second image, bottom distance information from the bottom edge of the fourth image to the top edge of the second image, and left edge distance information from the left edge of the fourth image to the left edge of the second image.

[0166] In a specific implementation, when the target scaling ratio is obtained, the product of the height data in the fourth size data and the target scaling ratio can be determined, and the product is used as the height data in the fifth size data. Also, the product of the width data in the fourth size data and the target scaling ratio is determined, and the product is used as the width data in the fifth size data. Further, the top distance information from the top edge of the fourth image to the top edge of the second image can be determined according to the height data in the fifth size data, the target scaling ratio, the ordinate of the fourth position information in the second information, the unit offset vector, and the offset distance information. Also, the right edge distance information from the right edge of the fourth image to the left edge of the second image can be determined according to the width data in the fifth size data, the target scaling ratio, the abscissa of the fourth position information in the second information, the unit offset vector, and the offset distance information. Also, the bottom distance information corresponding to the bottom edge of the fourth image to the top edge of the second image can be determined according to the height data in the fifth size data, the target scaling ratio, the ordinate of the fourth position information in the second information, the unit offset vector, and the offset distance information. And, according to the width data in the fifth size data, the target scaling ratio, the horizontal coordinate of the fourth position information in the second information, the unit offset vector and the offset distance information, the left edge distance information from the left edge of the fourth image to the left edge of the second image is determined. Furthermore, the top distance information, the right edge distance information, the bottom distance information and the left edge distance information can be used as the image extraction range.

[0167] Exemplarily, continuing to refer to the above example, the top distance information can be determined based on the following formula:

[0168]

[0169] Among them, t final Indicates the top distance information; y c a vertical coordinate representing fourth position information; Represents the component vector of the unit offset vector in the y-axis direction; m = distance (P c ,P f ) represents the relative distance between the center position in the third image and the position information of the preset object; s represents the target scaling ratio; sh represents the height data in the fifth size data.

[0170] The right edge distance information can be determined based on the following formula:

[0171]

[0172] Among them, r final Indicates the right edge distance information; x c a horizontal coordinate representing fourth position information; represents the component vector of the unit offset vector in the x-axis direction; sw represents the width data in the fifth dimension data; the meanings of the parameters that are the same as those in the above formula are no longer described in detail.

[0173] The bottom distance information can be determined based on the following formula:

[0174]

[0175] Among them, b final Indicates the bottom distance information. The meanings of parameters that are the same as those in the above formula are not repeated in detail.

[0176] The left edge distance information can be determined based on the following formula:

[0177]

[0178] Among them, l final Represents the left edge distance information; the meanings of parameters that are the same as those in the above formula are not repeated in detail.

[0179] It should be noted that, in order to improve image sampling and rendering efficiency, after obtaining the image extraction range, the image extraction range may be subjected to texture coordinate conversion and / or normalization processing to obtain a texture coordinate range that is convenient for image sampling.

[0180] Optionally, the method further includes: determining a texture coordinate range when sampling the second image based on top distance information, right edge distance information, bottom distance information, left edge distance information and first size data of the second image.

[0181] It can be understood that when UVs are used as texture coordinate points residing on the vertices of the polygonal area, a two-dimensional texture coordinate system can be defined, and this coordinate system is the UV texture space. In this space, U and V are used to define the coordinate axes, which are used to determine how to place a texture image on a two-dimensional plane. Texture coordinates are coordinate information represented by U and V. In the disclosed embodiment, the texture coordinate range is related to the image extraction range, and the texture coordinate range can be the normalized distance from the image extraction range to the edge of the image. That is, the texture coordinate range includes the target top distance information from the top edge of the fourth image to the top edge of the second image, the target right edge distance information from the right edge of the fourth image to the right edge of the second image, the target bottom distance information corresponding to the bottom edge of the fourth image to the bottom edge of the second image, and the target left edge distance information from the left edge of the fourth image to the left edge of the second image.

[0182] In a specific implementation, the ratio between the top distance information and the height data in the first size data can be determined, and the ratio is used as the target top distance information from the top edge of the fourth image to the top edge of the second image. Also, the difference between the width data in the first size data and the right edge distance information is determined, and the ratio between the difference and the width data is determined, and the ratio is used as the first value to be processed. Further, the difference between the preset value and the first value to be processed is determined, and the difference is used as the target right edge distance information from the right edge of the fourth image to the right edge of the second image. Also, the difference between the height data in the first size data and the bottom distance information is determined, and the ratio between the difference and the height data is determined, and the ratio is used as the second value to be processed. Further, the difference between the preset value and the second value to be processed is determined, and the difference is used as the target bottom distance information corresponding to the bottom edge of the fourth image to the bottom edge of the second image. Also, the ratio between the left edge distance information and the width data in the first size data is determined, and the ratio is used as the target left edge distance information from the left edge of the fourth image to the left edge of the second image.

[0183] Exemplarily, the target top distance information, the target right edge distance information, the target bottom distance information, and the target left edge distance information may be determined based on the following formulas, respectively:

[0184]

[0185] Among them, t crop Indicates the target top distance information; H t ′ Represents the height data in the first size data; r crop Indicates the distance information of the right edge of the target; W t ′ Indicates the width data in the first size data; b crop Indicates the target bottom distance information; l crop Indicates the distance information of the left edge of the target.

[0186] Fig. 9 A schematic diagram of the structure of a media data generating device provided by an embodiment of the present disclosure is shown in FIG. Fig. 9 As shown, the device includes: an image receiving module 410, an image adjusting module 420, an image extracting module 430 and a media data generating module 440.

[0187] Among them, the image receiving module 410 is used to receive the configured first image in response to the media data configuration operation; the image adjustment module 420 is used to determine the second image based on the first image and the image adjustment data, wherein the first image is related to the screen content of the second image, and the first size data of the second image is related to the image adjustment data; the image extraction module 430 is used to extract the third image including the preset object in the first image, and determine the fourth image related to the third image in the second image based on the first information of the third image; the media data generation module 440 is used to generate media data to be displayed based on the first image, the third image and the fourth image; wherein the position information of the preset object in the third image is related to the position information of the preset object in the fourth image.

[0188] The technical solution of the disclosed embodiment provides a data basis for the subsequent generation of media data by receiving the configured first image in response to the media data configuration operation; further, based on the first image and the image adjustment data, a second image is determined, wherein the first image is related to the screen content of the second image, and the first size data of the second image is related to the image adjustment data, thereby achieving an effect of generating a second image whose screen content is related to the first image and whose size data is related to the image adjustment data based on the first image and the image adjustment data, and further, achieving an effect of adjusting the image size to generate a new image based on the existing image, thereby enhancing the richness of the generated image; further, extracting a third image including a preset object from the first image, and determining a fourth image related to the third image in the second image based on the first information of the third image, thereby achieving image extraction for any acquired image, and extracting an image related to the extracted image from a generated image related to the any acquired image based on the extracted image, thereby achieving an effect of extracting an image related to the extracted image for any acquired image. Image extraction is performed to ensure the effect of image extraction while meeting the image extraction requirements, and provides a data basis for the subsequent extraction of related images; further, based on the first image, the third image and the fourth image, media data to be displayed is generated; wherein, the position information of the preset object in the third image is related to the position information of the preset object in the fourth image, which solves the problem that some positions or parts in the images generated in the related technology are not aligned, thereby causing the generated media data to be distorted and the transition effect to be poor, and realizes the effect of extracting images related to the generated image according to the position information of the image extracted from the original image, and generating media data adapted to the original image, the image extracted from the original image and the image extracted from the generated image, thereby achieving that when the image extracted from the original image and the image extracted from the generated image are displayed, some positions in the image are aligned, and then when a video is generated based on such images, the coordination of the video picture can be improved, thereby improving the picture display effect of the media data.

[0189] Based on any optional technical solution in the embodiments of the present disclosure, optionally, the image adjustment module 420 includes: an image generation unit and an image adjustment unit. The image generation unit is used to input the first image into the style image generation model to obtain a fifth image; wherein the second size data of the fifth image is related to the third size data of the first image; and the image adjustment unit is used to obtain pre-configured image adjustment data to adjust the second size data of the fifth image to obtain the second image.

[0190] On the basis of any optional technical solution in the embodiments of the present disclosure, optionally, the image adjustment data includes at least height adjustment data and / or width adjustment data, and the image adjustment unit includes: a width data determination subunit, a height data determination subunit and an image generation subunit. Among them, the width data determination subunit is used to determine the target height data of the fifth image after the height is expanded according to the height adjustment data and the first height data in the second size data; and / or the height data determination subunit is used to determine the target width data of the fifth image after the width is expanded according to the width adjustment data and the first width data in the second size data; the image generation subunit is used to generate the second image based on the target height data, the target width data and the fifth image.

[0191] Based on any optional technical solution in the embodiment of the present disclosure, optionally, the image extraction module 430 includes: an image cropping submodule. The image cropping submodule is used to crop the first image based on a preset first condition to obtain a third image including a preset object; wherein the first condition at least includes that the third image is a partial area image in the first image, the fourth size data of the third image meets a first preset ratio, and the display area of ​​the third image displaying the preset object and the fourth size data of the third image meet a second preset ratio.

[0192] On the basis of any optional technical solution in the embodiment of the present disclosure, optionally, the image extraction module 430 includes: a coordinate information acquisition submodule, a coordinate information determination submodule, an extraction range determination submodule and an image sampling submodule. Among them, the coordinate information acquisition submodule is used to obtain the first information of at least one key information in the third image in the first coordinate system; wherein the first coordinate system is determined based on the first image; the coordinate information determination submodule is used to determine the second information of the first information in the target coordinate system; wherein the target coordinate system is determined based on the second image; the extraction range determination submodule is used to determine the image extraction range according to the second information, the target scaling ratio corresponding to the third image and the fourth size data of the third image; wherein the target scaling ratio is determined based on the second information and the first size data of the second image; the image sampling submodule is used to sample and process the second image based on the image extraction range to obtain the fourth image.

[0193] Based on any optional technical solution in the embodiments of the present disclosure, optionally, the at least one key information includes at least a first target position of the preset object, a center position of the third image, a first edge point on the first upper edge of the third image, a second edge point on the first right edge, a third edge point on the first lower edge, and a fourth edge point on the first left edge.

[0194] The coordinate information acquisition submodule includes: a first position information determination unit, a second position information determination unit, a distance information determination unit and a first information determination unit.

[0195] A first position information determining unit, used to determine first position information of the first target position in the first coordinate system;

[0196] A second position information determining unit, used to determine second position information of the center position in the first coordinate system;

[0197] a distance information determining unit, configured to determine, in the first coordinate system, first distance information from the position information of the first edge point to the second upper edge of the first image, second distance information from the position information of the second edge point to the second left edge of the first image, third distance information from the position information of the third edge point to the second upper edge of the first image, and fourth distance information from the position information of the fourth edge point to the second left edge of the first image;

[0198] The first information determination unit is used to use the first position information, the second position information and a first distance array as the first information; wherein the first distance array includes the first distance information, the second distance information, the third distance information and the fourth distance information.

[0199] On the basis of any optional technical solution in the embodiments of the present disclosure, optionally, the coordinate information determination submodule includes: an edge position information determination unit, a distance information update unit, a third position information determination unit, a fourth position information determination unit and a second information determination unit.

[0200] an edge position information determining unit, configured to determine image edge position information of each image edge of the first image in the target coordinate system according to the second size data of the fifth image and the image adjustment data;

[0201] a distance information updating unit, configured to update the distance information in the first distance array of the third image according to the edge position information corresponding to the edge of each image and the first distance array of the third image;

[0202] A third position information determining unit, configured to determine third position information of the first position information at the target coordinates according to the first position information and the image edge position information;

[0203] a fourth position information determining unit, configured to determine fourth position information of the center position in the target coordinate system according to the center position and the updated first distance array;

[0204] The second information determining unit is configured to use the third position information, the fourth position information, and the updated first distance array as the second information.

[0205] On the basis of any optional technical solution in the embodiments of the present disclosure, optionally, the image adjustment data includes a height expansion ratio and / or a width expansion ratio, the height expansion ratio includes a first ratio for height expansion in a first direction, a second ratio for height expansion in a direction opposite to the first direction, the width expansion ratio includes a third ratio for width expansion in a second direction, and a fourth ratio for width expansion in a direction opposite to the second direction,

[0206] The edge position information determining unit includes: a top edge position determining subunit, a bottom edge position determining subunit, a left edge position determining subunit and a right edge position determining subunit.

[0207] a top edge position determining subunit, configured to determine a top edge position in the image edge position information according to the height data in the second size data and the first ratio;

[0208] A bottom edge position determination subunit, configured to determine the bottom edge position in the image edge position information according to the height data in the second size data and a third ratio;

[0209] a left edge position determining subunit, configured to determine the left edge position in the image edge position information according to the width data in the second size data and the second ratio;

[0210] The right edge position determining subunit is used to determine the right edge position in the image edge position information according to the width data in the second size data and the fourth ratio.

[0211] On the basis of any optional technical solution in the embodiments of the present disclosure, optionally, the device further includes: a target scaling ratio determination module.

[0212] The target zoom ratio determination module is used to determine the target zoom ratio corresponding to the third image according to the first size data of the second image, the fourth position information and the third position information in the second information, and the fourth size data of the third image.

[0213] On the basis of any optional technical solution in the embodiments of the present disclosure, optionally, the target scaling ratio determination module includes: an offset distance information determination unit, a scaling ratio to be selected determination unit and a target scaling ratio determination unit.

[0214] an offset distance information determining unit, configured to determine a unit offset vector and offset distance information according to the fourth position information and the third position information;

[0215] a scaling ratio to be selected determining unit, configured to substitute the unit offset vector, the offset distance information, the second size data of the fifth image, and the fourth size data into at least four predetermined scaling ratio determining models to obtain the scaling ratio to be selected output by each scaling ratio determining model;

[0216] a target zoom ratio determining unit, configured to determine the target zoom ratio based on the zoom ratio to be selected and a preset zoom ratio;

[0217] The scaling ratio determination model is a function corresponding to when the edge of the third image touches the image edge of the second image after the third image is magnified and simulated.

[0218] On the basis of any optional technical solution in the embodiments of the present disclosure, optionally, the target zoom ratio determination unit is specifically configured to use the minimum value between the zoom ratio to be selected and the preset zoom ratio as the target zoom ratio.

[0219] On the basis of any optional technical solution in the embodiments of the present disclosure, optionally, the extraction range determination submodule includes: a size data determination unit and an extraction range determination unit.

[0220] a size data determining unit, configured to determine fifth size data of the fourth image according to the fourth size data of the third image and the target scaling ratio;

[0221] An extraction range determination unit is used to determine the image extraction range according to the fifth size data, the target scaling ratio, the fourth position information in the second information, the unit offset vector and the offset distance information.

[0222] Based on any optional technical solution in the embodiments of the present disclosure, optionally, the image extraction range includes top distance information from the top edge of the fourth image to the top edge of the second image, right edge distance information from the right edge of the fourth image to the left edge of the second image, bottom distance information corresponding to the bottom edge of the fourth image to the top edge of the second image, and left edge distance information from the left edge of the fourth image to the left edge of the second image.

[0223] On the basis of any optional technical solution in the embodiments of the present disclosure, optionally, the device further includes: a texture coordinate range determination module.

[0224] A texture coordinate range determination module is used to determine the texture coordinate range when sampling the second image based on the top distance information, the right edge distance information, the bottom distance information, the left edge distance information and the first size data of the second image; wherein the texture coordinate range is related to the image extraction range.

[0225] On the basis of any optional technical solution in the embodiments of the present disclosure, optionally, the media data generation module 440 includes: a first image display unit, a third image display unit and a fourth image display unit.

[0226] A first image display unit, configured to display the first image according to a first preset animation special effect;

[0227] A third image display unit, configured to display the third image in the target prop presented in the display screen when it is detected that the first image meets a preset stop display condition;

[0228] The fourth image display unit is used to display the fourth image after detecting that the target prop rotates to a target angle.

[0229] On the basis of any optional technical solution in the embodiments of the present disclosure, optionally, the preset object is a preset part of the target object, the position information of the preset object is the center point of the preset part, and during the display of the third image and the fourth image, the position information of the center point of the preset part is the same.

[0230] The media data generating device provided in the embodiments of the present disclosure can execute the media data generating method provided in any embodiment of the present disclosure, and has the corresponding functional modules and beneficial effects for executing the media data generating method.

[0231] It is worth noting that the various units and modules included in the above-mentioned device are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the protection scope of the embodiments of the present disclosure.

[0232] Reference below Fig.10, which shows a schematic diagram of the structure of an electronic device (such as a terminal device or a server) 600 suitable for implementing the embodiment of the present disclosure. The terminal device in the embodiment of the present disclosure may include but is not limited to mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Fig.10 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.

[0233] like Fig.10 As shown, the electronic device 600 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage device 608 into a random access memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the electronic device 600 are also stored. The processing device 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.

[0234] Typically, the following devices may be connected to the I / O interface 605: an input device 606 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 607 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 608 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 609. The communication device 609 may allow the electronic device 600 to communicate with other devices wirelessly or by wire to exchange data. Although Fig.10 The electronic device 600 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.

[0235] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device 609, or installed from a storage device 608, or installed from a ROM 602. When the computer program is executed by the processing device 601, the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.

[0236] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.

[0237] The electronic device provided in the embodiment of the present disclosure and the media data generation method provided in the above embodiment belong to the same inventive concept. The technical details not fully described in the embodiment of the present disclosure can be referred to the above embodiment, and the present embodiment has the same beneficial effects as the above embodiment.

[0238] The embodiments of the present disclosure provide a computer storage medium on which a computer program is stored. When the program is executed by a processor, the media data generating method provided in the above embodiments is implemented.

[0239] It should be noted that the computer-readable medium disclosed above may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with 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 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, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.

[0240] In some embodiments, the client and the server may communicate using any currently known or future developed network protocol such as HTTP (Hyper Text Transfer Protocol), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or future developed network.

[0241] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.

[0242] The above-mentioned computer-readable medium carries one or more programs. When the above-mentioned one or more programs are executed by the electronic device, the electronic device: receives the configured first image in response to the media data configuration operation; determines the second image based on the first image and the image adjustment data, wherein the first image is related to the screen content of the second image, and the first size data of the second image is related to the image adjustment data; extracts the third image including the preset object in the first image, and determines the fourth image related to the third image in the second image based on the first information of the third image; generates media data to be displayed based on the first image, the third image and the fourth image; wherein the position information of the preset object in the third image is related to the position information of the preset object in the fourth image.

[0243] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages ​​or a combination thereof, including, but not limited to, object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may 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 may be connected to an external computer (e.g., through the Internet using an Internet service provider).

[0244] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0245] The units involved in the embodiments described in the present disclosure may be implemented by software or hardware. The name of a unit does not limit the unit itself in some cases. For example, a special effect processing module may also be described as a "module for obtaining an image to be processed".

[0246] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.

[0247] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, 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 disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0248] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present disclosure (but not limited to) by each other to form a technical solution.

[0249] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details are included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.

[0250] Although the subject matter has been described in language specific to structural features and / or methodological logical actions, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. On the contrary, the specific features and actions described above are merely example forms of implementing the claims.

Claims

1. A method for generating media data, characterized in that: include: In response to the media data configuration operation, receiving a configured first image; Determine a second image based on the first image and the image adjustment data, wherein the first image is related to the screen content of the second image, and the first size data of the second image is related to the image adjustment data; Extracting a third image including a preset object from the first image, and determining a fourth image related to the third image from the second image based on first information of the third image; Generate media data to be displayed based on the first image, the third image, and the fourth image; Wherein, the position information of the preset object in the third image is related to the position information of the preset object in the fourth image.

2. The method according to claim 1, characterized in that The determining the second image based on the first image and the image adjustment parameter comprises: Inputting the first image into a style image generation model to obtain a fifth image; wherein the second size data of the fifth image is related to the third size data of the first image; Pre-configured image adjustment data is acquired to adjust the second size data of the fifth image to obtain the second image.

3. The method according to claim 2, characterized in that The image adjustment data at least includes height adjustment data and / or width adjustment data, and the acquiring of the pre-configured image adjustment data to adjust the second size data of the fifth image to obtain the second image includes: Determining target height data after the height of the fifth image is expanded according to the height adjustment data and the first height data in the second size data; and / or, Determining target width data after the width of the fifth image is expanded according to the width adjustment data and the first width data in the second size data; The second image is generated based on the target height data, the target width data, and the fifth image.

4. The method according to claim 1, characterized in that: The extracting a third image including a preset object from the first image includes: Cropping the first image based on a preset first condition to obtain a third image including a preset object; Among them, the first condition at least includes that the third image is a partial area image of the first image, the fourth size data of the third image satisfies a first preset ratio, and the display area displaying the preset object in the third image and the fourth size data of the third image satisfy a second preset ratio.

5. The method according to claim 1, characterized in that The determining, based on the first information of the third image, a fourth image in the second image corresponding to the third image includes: Acquire first information of at least one key information in the third image in a first coordinate system; wherein the first coordinate system is determined based on the first image; Determine second information of the first information in a target coordinate system; wherein the target coordinate system is determined based on the second image; determining an image extraction range according to the second information, a target scaling ratio corresponding to the third image, and fourth size data of the third image; wherein the target scaling ratio is determined based on the second information and the first size data of the second image; The second image is sampled and processed based on the image extraction range to obtain the fourth image.

6. The method according to claim 5, characterized in that The at least one key information includes at least a first target position of the preset object, a center position of the third image, a first edge point on a first upper edge of the third image, a second edge point on a first right edge, a third edge point on a first lower edge, and a fourth edge point on a first left edge; The acquiring first information of at least one key information in the third image in a first coordinate system includes: Determine first position information of the first target position in the first coordinate system; Determine second position information of the center position in the first coordinate system; In the first coordinate system, determine first distance information from the position information of the first edge point to the second upper edge of the first image, second distance information from the position information of the second edge point to the second left edge of the first image, third distance information from the position information of the third edge point to the second upper edge of the first image, and fourth distance information from the position information of the fourth edge point to the second left edge of the first image; Taking the first position information, the second position information and the first distance array as the first information; The first distance array includes the first distance information, the second distance information, the third distance information and the fourth distance information.

7. The method according to claim 6, characterized in that The determining of second information of the first information in the target coordinate system includes: Determine image edge position information of each image edge of the first image in the target coordinate system according to the second size data of the fifth image and the image adjustment data; updating the distance information in the first distance array of the third image according to the edge position information corresponding to the edge of each image and the first distance array of the third image; Determine third position information of the first position information at the target coordinates according to the first position information and the image edge position information; Determine fourth position information of the center position in the target coordinate system according to the center position and the updated first distance array; The third position information, the fourth position information and the updated first distance array are used as the second information.

8. The method according to claim 7, characterized in that The image adjustment data includes a height expansion ratio and / or a width expansion ratio, wherein the height expansion ratio includes a first ratio for height expansion in a first direction and a second ratio for height expansion in a direction opposite to the first direction, and the width expansion ratio includes a third ratio for width expansion in a second direction and a fourth ratio for width expansion in a direction opposite to the second direction; The step of determining the image edge position information of each image edge of the first image in the target coordinate system according to the second size data of the fifth image and the image adjustment data includes: Determine the top edge position in the image edge position information according to the height data in the second size data and the first ratio; Determine the bottom edge position in the image edge position information according to the height data in the second size data and the third ratio; Determine the left edge position in the image edge position information according to the width data in the second size data and the second ratio; The right edge position in the image edge position information is determined according to the width data in the second size data and the fourth ratio.

9. The method according to claim 5, characterized in that The method further comprises: A target scaling ratio corresponding to the third image is determined according to the first size data of the second image, the fourth position information and the third position information in the second information, and the fourth size data of the third image.

10. The method according to claim 9, characterized in that Determining a target scaling ratio corresponding to the third image according to the first size data of the second image, the fourth position information and the third position information in the second information, and the fourth size data of the third image includes: Determining a unit offset vector and offset distance information according to the fourth position information and the third position information; Substituting the unit offset vector, the offset distance information, the second size data of the fifth image, and the fourth size data into at least four predetermined scaling ratio determination models to obtain a scaling ratio to be selected output by each scaling ratio determination model; Determining the target zoom ratio based on the zoom ratio to be selected and the preset zoom ratio; The scaling ratio determination model is a function corresponding to when the edge of the third image touches the image edge of the second image after the third image is magnified and simulated.

11. The method according to claim 10, characterized in that The determining the target zoom ratio based on the zoom ratio to be selected and the preset zoom ratio includes: The minimum value between the to-be-selected zoom ratio and the preset zoom ratio is used as the target zoom ratio.

12. The method according to claim 5, characterized in that The step of determining the image extraction range according to the second information, the target scaling ratio corresponding to the third image, and the fourth size data of the third image includes: determining fifth size data of the fourth image according to the fourth size data of the third image and the target scaling ratio; The image extraction range is determined according to the fifth size data, the target scaling ratio, the fourth position information in the second information, the unit offset vector, and the offset distance information.

13. The method according to claim 5 or 12, characterized in that: The image extraction range includes top distance information from the top edge of the fourth image to the top edge of the second image, right edge distance information from the right edge of the fourth image to the left edge of the second image, bottom distance information corresponding to the bottom edge of the fourth image to the top edge of the second image, and left edge distance information from the left edge of the fourth image to the left edge of the second image.

14. The method according to claim 13, characterized in that The method further comprises: Determine a texture coordinate range when sampling the second image based on the top distance information, the right edge distance information, the bottom distance information, the left edge distance information, and the first size data of the second image; The texture coordinate range is related to the image extraction range.

15. The method according to claim 1, characterized in that The generating the media data to be displayed based on the first image, the third image, and the fourth image includes: Displaying the first image according to a first preset animation special effect; When it is detected that the first image meets a preset stop display condition, displaying the third image in the target prop presented in the display screen; The fourth image is displayed after detecting that the target prop rotates by a target angle.

16. The method according to claim 1 or 15, characterized in that The preset object is a preset part of the target object, the position information of the preset object is the center point of the preset part, and during the display of the third image and the fourth image, the position information of the center point of the preset part is the same.

17. A media data generating device, characterized in that: include: An image receiving module, configured to receive a configured first image in response to a media data configuration operation; An image adjustment module, configured to determine a second image based on the first image and image adjustment data, wherein the first image is related to screen content of the second image, and first size data of the second image is related to the image adjustment data; an image extraction module, configured to extract a third image including a preset object from the first image, and determine a fourth image related to the third image from the second image based on first information of the third image; A media data generation module is used to generate media data to be displayed based on the first image, the third image and the fourth image; wherein the position information of the preset object in the third image is related to the position information of the preset object in the fourth image.

18. An electronic device, characterized in that: The electronic device comprises: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the media data generating method as described in any one of claims 1-16.

19. A storage medium containing computer executable instructions, characterized in that: When the computer executable instructions are executed by a computer processor, they are used to perform the media data generating method according to any one of claims 1 to 16.

20. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the computer program implements the media data generating method according to any one of claims 1 to 16.