Method, device and medium for generating cover picture

By automating the processing of multi-layered images, extracting and labeling material tags, and utilizing the matching relationship between candidate materials and content to be recommended, the problem of low efficiency in cover image generation has been solved, achieving more efficient and accurate cover image generation.

CN116521919BActive Publication Date: 2026-05-01TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
TENCENT TECHNOLOGY (SHENZHEN) CO LTD
Filing Date
2022-07-18
Publication Date
2026-05-01

AI Technical Summary

Technical Problem

Current technologies require extensive manual design for cover image generation, resulting in low efficiency.

Method used

By acquiring multi-layered images, extracting content elements and labeling them with material tags, and utilizing the matching relationship between candidate materials and the content to be recommended, the target material is automatically replaced to generate a cover image.

Benefits of technology

It improves the efficiency of cover image generation and makes the generated cover images more relevant to the content to be recommended, thereby increasing the accuracy of the generation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116521919B_ABST
    Figure CN116521919B_ABST
Patent Text Reader

Abstract

The application discloses a cover picture generation method and device, equipment and a medium, and relates to the technical field of computers. The method comprises the following steps: obtaining a first candidate picture, the first candidate picture being a picture obtained by superimposing a plurality of layers; performing content element extraction on at least one layer of the plurality of layers, labeling the extracted content elements with material tags to obtain candidate materials, and storing the candidate materials in a material library; obtaining a target picture associated with to-be-recommended content, the target picture comprising a to-be-replaced element; determining target materials matching the to-be-recommended content from the material library based on a matching relationship between the content tags of the to-be-recommended content and the material tags of the candidate materials; and replacing the to-be-replaced element with the target materials in the target picture to obtain a cover picture corresponding to the to-be-recommended content. The elements in the image are replaced by the pre-generated materials, thereby improving the generation efficiency of the cover picture.
Need to check novelty before this filing date? Find Prior Art

Description

Methods, apparatus, equipment and media for generating cover images Technical Field

[0001] This application relates to the field of computer technology, and in particular to a method, apparatus, device and medium for generating a cover image. Background Technology

[0002] On most common content platforms, after uploading the main content, content publishers usually need to upload a cover image for use when the content is displayed in a list. A good cover image can help increase click-through rates and readership.

[0003] In related technologies, content publishers typically need to manually create cover images for uploading. A good cover image often requires professional design skills, consuming significant human resources.

[0004] When obtaining the cover image of the content in the above manner, the efficiency of cover generation is low due to the large amount of manual resources required. Summary of the Invention

[0005] This application provides a method, apparatus, device, and medium for generating cover images, which can improve the efficiency of cover image generation. The technical solution is as follows:

[0006] On the one hand, a method for generating a cover image is provided, the method comprising:

[0007] Obtain the first candidate image, which is an image obtained by superimposing multiple layers;

[0008] Content elements are extracted from at least one of the multiple layers, and the extracted content elements are labeled with material tags to obtain candidate materials. The candidate materials are then stored in a material library, and the candidate materials in the material library are marked with material tags used to indicate the recommendation domain.

[0009] Obtain a target image associated with the content to be recommended, wherein the target image includes the element to be replaced, and the content to be recommended is labeled with content tags, wherein the content tags represent the recommendation domain corresponding to the content to be recommended.

[0010] Based on the matching relationship between the content tags of the content to be recommended and the material tags of the candidate materials, target materials that match the content to be recommended are determined from the material library;

[0011] The element to be replaced in the target image is replaced with the target material to obtain the cover image corresponding to the content to be recommended.

[0012] On the other hand, an apparatus for generating a cover image is provided, the apparatus comprising:

[0013] The acquisition module is used to acquire a first candidate image, which is an image obtained by superimposing multiple layers.

[0014] The first generation module is used to extract content elements from at least one of the multiple layers, label the extracted content elements with material tags to obtain candidate materials, and store the candidate materials in the material library. The candidate materials in the material library are marked with material tags used to indicate the recommendation domain.

[0015] The acquisition module is further configured to acquire a target image associated with the content to be recommended, the target image including the element to be replaced, the content to be recommended being labeled with content tags, and the content tags representing the recommendation domain corresponding to the content to be recommended;

[0016] The determination module is used to determine the target material that matches the content to be recommended from the material library based on the matching relationship between the content tags of the content to be recommended and the material tags of the candidate materials;

[0017] The second generation module is used to replace the element to be replaced with the target material in the target image to obtain the cover image corresponding to the content to be recommended.

[0018] On the other hand, a computer device is provided, the terminal including a processor and a memory, the memory storing at least one instruction, at least one program, code set or instruction set, the at least one instruction, the at least one program, the code set or instruction set being loaded and executed by the processor to implement any of the cover image generation methods described in the embodiments of this application.

[0019] On the other hand, a computer-readable storage medium is provided, wherein at least one piece of program code is stored in the computer-readable storage medium, the program code being loaded and executed by a processor to implement the cover image generation method described in any of the embodiments of this application.

[0020] On the other hand, a computer program product or computer program is provided, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the cover image generation method described in any of the above embodiments.

[0021] The technical solution provided in this application includes at least the following beneficial effects:

[0022] When generating cover images for content to be recommended, the elements to be replaced in the target image are replaced using target materials, which are selected from candidate materials extracted from content elements. In other words, replacing elements in the image with pre-generated materials improves the efficiency of cover image generation. Furthermore, matching candidate materials with the target image within a specified domain ensures that the generated cover content better matches the content to be recommended, thus improving the accuracy of cover image generation. Attached Figure Description

[0023] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0024] Figure 1 is a schematic diagram of an implementation environment provided by an exemplary embodiment of this application;

[0025] Figure 2 is a flowchart of a method for generating a cover image provided in an exemplary embodiment of this application;

[0026] Figure 3 is a schematic diagram of a cover image generation method provided in an exemplary embodiment of this application;

[0027] Figure 4 is a flowchart of a cover image generation method provided in an exemplary embodiment of this application;

[0028] Figure 5 is a flowchart of a method for generating a cover image provided in an exemplary embodiment of this application;

[0029] Figure 6 is a flowchart of structured data generation provided in an exemplary embodiment of this application;

[0030] Figure 7 is a flowchart illustrating the identification of key content provided in an exemplary embodiment of this application;

[0031] Figure 8 is a flowchart of contour extraction provided in an exemplary embodiment of this application;

[0032] Figure 9 is a schematic diagram of the visualization effect of contour extraction provided by an exemplary embodiment of this application;

[0033] Figure 10 is a schematic diagram of the editing interface of the cover image provided in an exemplary embodiment of this application;

[0034] Figure 11 is a structural block diagram of a cover image generation apparatus provided in an exemplary embodiment of this application;

[0035] Figure 12 is a structural block diagram of a cover image generation apparatus provided in an exemplary embodiment of this application;

[0036] Figure 13 is a schematic diagram of the structure of a server provided in an exemplary embodiment of this application. Detailed Implementation

[0037] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described in further detail below with reference to the accompanying drawings.

[0038] First, a brief introduction to the terms used in the embodiments of this application:

[0039] Artificial intelligence (AI) is the theory, methods, technology, and application systems that use digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use that knowledge to achieve optimal results. In other words, AI is a comprehensive technology within computer science that attempts to understand the essence of intelligence and produce new intelligent machines that can react in a way similar to human intelligence. AI studies the design principles and implementation methods of various intelligent machines, enabling them to possess perception, reasoning, and decision-making capabilities.

[0040] Artificial intelligence (AI) is a comprehensive discipline encompassing a wide range of fields, including both hardware and software technologies. Fundamental AI technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing, operating / interactive systems, and mechatronics. AI software technologies primarily include computer vision, speech processing, natural language processing, as well as machine learning / deep learning, autonomous driving, and intelligent transportation.

[0041] Machine Learning (ML) is a multidisciplinary field involving probability theory, statistics, approximation theory, convex analysis, and algorithm complexity theory. It specifically studies how computers can simulate or implement human learning behavior to acquire new knowledge or skills and reorganize existing knowledge structures to continuously improve their performance. Machine learning is the core of artificial intelligence and the fundamental way to endow computers with intelligence; its applications span all areas of artificial intelligence. Machine learning and deep learning typically include techniques such as artificial neural networks, belief networks, reinforcement learning, transfer learning, inductive learning, and instruction-based learning.

[0042] Computer vision (CV) is the science that studies how to enable machines to "see." More specifically, it refers to machine vision, which uses cameras and computers to replace human eyes in recognizing and measuring targets, and then performs image processing to create images more suitable for human observation or transmission to instruments. As a scientific discipline, computer vision studies related theories and technologies, attempting to build artificial intelligence systems capable of extracting information from images or multidimensional data. Computer vision technologies typically include image processing, image recognition, image semantic understanding, image retrieval, optical character recognition (OCR), video processing, video semantic understanding, video content / behavior recognition, 3D object reconstruction, 3D technology, virtual reality, augmented reality, map building, autonomous driving, and intelligent transportation technologies.

[0043] Please refer to Figure 1, which shows a schematic diagram of an implementation environment provided by an exemplary embodiment of this application. The computer system of this implementation environment includes: terminal devices, server 120 and communication network 130, wherein the terminal devices include a first terminal 111 and a second terminal 112.

[0044] Terminal devices include various forms of equipment such as mobile phones, tablets, desktop computers, portable laptops, intelligent voice interaction devices, smart home appliances, vehicle terminals, and aircraft.

[0045] The first terminal 111 is the device used by the content publisher. For illustrative purposes, the first application is logged into the first terminal 111, and the content publisher can publish content through the first application. The second terminal 112 is the device used by the content receiver. For illustrative purposes, the second application is logged into the second terminal 112, and the content receiver can browse recommended content through the second application.

[0046] Optionally, the first application and the second application mentioned above can be the same application or different applications provided by the same platform. Optionally, the first application and the second application can be traditional application software, cloud application software, or implemented as a mini-program or application module in a host application, or a web platform; no limitation is imposed here. Optionally, the first application and the second application mentioned above can be e-commerce applications, short video applications, audio applications, novel applications, map applications, etc.; no specific restrictions are imposed here.

[0047] Server 120 provides backend services for the first and second applications. Illustratively, server 120 extracts content elements from the acquired first candidate image to generate candidate materials within the recommendation domain. When the first terminal 111 publishes content to be recommended, it needs to configure a cover image for the content. The first application provides the first terminal 111 with a cover image generation function. Specifically, server 120 obtains a target image associated with the content to be recommended, which includes elements to be replaced. Based on the matching relationship between the content tags of the content to be recommended and the material tags of the candidate materials, server 120 determines the target material from multiple candidate materials, replaces the elements to be replaced in the target image with the target material, and obtains the cover image corresponding to the content to be recommended. Server 120 sends the cover image back to the first terminal 111. After the content publisher confirms the cover image, it publishes the content along with the content to be recommended. Alternatively, server 120 can directly publish the content to be recommended and the cover image to the content recommendation platform.

[0048] When the second terminal 112 requests content recommendation, the second application pulls a certain number of recommended contents from the content recommendation platform and displays the recommended contents in a list format, which will show the cover image generated by the server 120 mentioned above.

[0049] It is worth noting that the aforementioned server 120 can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud security, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDN), and big data and artificial intelligence platforms.

[0050] Cloud technology refers to a hosting technology that unifies hardware, software, and network resources within a wide area network (WAN) or local area network (LAN) to achieve data computation, storage, processing, and sharing. Based on the cloud computing business model, cloud technology encompasses network technology, information technology, integration technology, management platform technology, and application technology. It can form resource pools, providing flexible and convenient on-demand access. Cloud computing technology will become a crucial support. Backend services of technical network systems require substantial computing and storage resources, such as video websites, image websites, and many portal websites. With the rapid development and application of the internet industry, every item may have its own identification mark in the future, requiring transmission to backend systems for logical processing. Data at different levels will be processed separately, and various industry data will require robust system support, which can only be achieved through cloud computing.

[0051] In some embodiments, the server 120 can also be implemented as a node in a blockchain system. Blockchain is a new application model of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanisms, and encryption algorithms.

[0052] Indicatively, terminal device 110 and server 120 are connected via communication network 130, which can be a wired network or a wireless network, and is not limited here.

[0053] Please refer to Figure 2, which illustrates a method for generating a cover image according to an embodiment of this application. In this embodiment, the method is applied to the server shown in Figure 1. The method includes:

[0054] Step 201: Obtain the first candidate image, which is an image obtained by overlaying multiple layers.

[0055] For illustrative purposes, the aforementioned first candidate image can be an image in an editable format. That is, the first candidate image stored in an editable format includes image editing information in addition to image content data. Optionally, the image editing information includes at least one type of information such as layer information, channel information, guide information, annotation information, and color mode information corresponding to the first candidate image. In one example, the editable format can be PSD (Photoshop Document) format or PSB (Photoshop Big) format.

[0056] To illustrate, the first candidate image comprises multiple layers, which are stacked vertically.

[0057] In some embodiments, when the first candidate image is an editable image, layer information such as layer position, layer size, and layer dimensions corresponding to multiple layers can be determined by parsing the first candidate image. The layer position indicates the vertical stacking relationship between a layer and other layers; the layer size indicates the storage resource usage of a single layer; and the layer dimensions indicate the shape and size of a single layer. For example, when the layer shape is rectangular, the graphic dimensions include the length and width of the graphic.

[0058] Optionally, the first candidate image can be a historical cover image used in the content recommendation platform, or it can be a content image from historical content delivered by the content recommendation platform, or it can be an image uploaded by a designated account for material generation. In some embodiments, after obtaining authorization from the content delivery party to use the image, the image content from the content delivery party's historically delivered content is obtained as the aforementioned first candidate image.

[0059] Step 202: Extract content elements from at least one of the multiple layers, label the extracted content elements with material tags to obtain candidate materials, and store the candidate materials in the material library.

[0060] As an illustration, the candidate materials in the material library are tagged with material labels that indicate the recommendation domain. The candidate materials in the material library are used as materials when generating the cover.

[0061] In some embodiments, content elements are extracted from multiple layers of the first candidate image to obtain the content elements corresponding to each layer; in other embodiments, multiple layers of the first candidate image are filtered to determine at least one layer, and content elements are extracted from the at least one layer to obtain the content elements corresponding to the layer.

[0062] Optionally, when filtering multiple layers, the layers can be identified based on their content. If the content of a layer is suitable as material, that layer can be selected as the layer for content element extraction.

[0063] In some embodiments, key content within the recommendation domain is identified, and content elements are extracted from the key content to obtain the content elements corresponding to the key content. Optionally, the key content in the recommendation domain can be pre-defined, or it can be content from the content recommendation platform that reaches a specified popularity threshold when recommending content for that domain. In one example, for a specific game domain, game characters from a specific game can be used as key content, so that the content elements corresponding to the game characters can be used as candidate materials to participate in the generation of a new cover image.

[0064] As an illustration, when identifying key content, a pre-trained neural network model can be used to achieve the identification of key content. Optionally, the aforementioned neural network can be at least one type of network used for image recognition, such as Convolutional Neural Networks (CNN), Visual Geometry Group Network (VGG), or Residual Network (ResNet).

[0065] To illustrate, the neural network model described above is trained using sample images corresponding to key content. For example, if the key content is a game character in a specific game, the sample images corresponding to the game character are input into the neural network model for training. This allows the neural network model to learn the features corresponding to the game character, thereby determining whether the layer includes content elements corresponding to the game character.

[0066] In some embodiments, when the layer used for content element extraction contains only one content element, the layer background type corresponding to that layer is determined. In one example, when the layer background type is transparent, the layer is directly used as the candidate material corresponding to its content element, thereby reducing resource consumption during material generation. In another example, when the layer background type is non-transparent, the content element in the layer is cut out to generate the corresponding candidate material.

[0067] In some embodiments, when the layer used for content element extraction includes multiple content elements, the layer needs to be segmented according to the different content elements before generating candidate materials based on the content elements. In one example, when the layer's background type is transparent, the content elements can be segmented according to a specified shape of a dividing box when segmenting the layer based on content elements, where each dividing box contains only one content element. In another example, when the layer's background type is non-transparent, edge detection can be performed on each content element when segmenting the layer based on content elements. The content elements can then be segmented based on the edge information obtained from the edge detection, thereby obtaining the segmented regions corresponding to each content element, and candidate materials can be generated based on the segmented regions.

[0068] In this embodiment, to improve the screening efficiency of candidate materials during the application stage, it is necessary to set material tags for the candidate materials. Illustratively, the material tags of candidate materials are related to the recommendation domain to which the candidate materials can be applied; that is, the material tags of candidate materials are tags within the corresponding recommendation domain.

[0069] Optionally, a candidate material can correspond to one material tag, or it can correspond to multiple material tags. When a candidate material corresponds to multiple material tags, the multiple material tags can be tags of different category levels. For example, taking a level 3 tag as an example, when the image content corresponding to the candidate material is game character M in game A, the material tags corresponding to the candidate material include the level 1 tag "game", the level 2 tag "game A", and the level 3 tag "game character M".

[0070] In some embodiments, when candidate materials are generated only for key content, the material tags corresponding to the candidate materials can be determined during the key content identification process. For example, when a game character is designated as key content, the material tags corresponding to the candidate materials can include tags for the designated game and tags for the game character.

[0071] In some embodiments, to improve the screening efficiency of target materials, when storing candidate materials to the material library, they can be stored in the corresponding material library according to the category level with the largest division granularity of the material tag. That is, different material libraries are set up for the category level with the largest division granularity.

[0072] Step 203: Obtain the target image associated with the content to be recommended. The target image includes the element to be replaced.

[0073] For illustrative purposes, the content to be recommended is tagged with content tags, which indicate the recommendation domain corresponding to the content. Optionally, the content tags for the content to be recommended can be set by the content publisher, or they can be identified and tagged by the server based on the content to be recommended.

[0074] Optionally, the method of obtaining the target image includes at least one of the following methods:

[0075] First, the receiving terminal uploads content to be recommended, which includes a target image. In some embodiments, when the content to be recommended includes images or videos, the target image can be obtained from the content to be recommended. In one example, when the content to be recommended includes at least one image, the target image is determined from at least one image; in another example, when the content to be recommended includes at least one video, image frames are obtained from at least one video as the target image.

[0076] Second, candidate image templates are retrieved from the stored template library as target images. For illustration, the server provides a template library containing multiple candidate image templates, each with corresponding template tags. The target image can be obtained by extensively selecting from the candidate image templates in the template library based on the tag similarity between the content tags corresponding to the content to be recommended and the template tags.

[0077] Third, the target image is obtained from historical cover images. This is illustrated by identifying the target image from historical cover images used in the content published by the content publisher. In some embodiments, historical content uploaded by the content publisher through its content publishing account is obtained. When a target historical content exists whose content tags match the content tags of the content to be recommended, the historical cover image corresponding to that target historical content is determined as the target image. Optionally, when multiple target historical content pieces with matching tags exist, the target image can be randomly selected from the historical cover images corresponding to these multiple target historical content pieces; alternatively, the cover image of the most recently published target historical content can be selected as the target image.

[0078] In some embodiments, the target image may be an image in an editable format, such as PSD or PSB format.

[0079] Optionally, the elements to be replaced in the target image can be identified through a neural network model. The identification of the elements to be replaced can follow the neural network model for identifying key content indicated above, that is, the key content in the specified domain identified in the target image is taken as the elements to be replaced.

[0080] Optionally, the element to be replaced in the target image can also be specified by the terminal. For example, the content publishing account indicates the element to be replaced to the server via the terminal.

[0081] Step 204: Based on the matching relationship between the content tags of the content to be recommended and the material tags of the candidate materials, determine the target materials that match the content to be recommended from the material library.

[0082] In some embodiments, when the content tags of the content to be recommended include the material tags of candidate materials, the candidate material is determined as the target material. In some embodiments, when the material tags of multiple candidate materials match the content tags of the content to be recommended, all multiple candidate materials can be determined as target materials, or the candidate materials can be filtered to obtain the target material.

[0083] Step 205: Replace the element to be replaced in the target image with the target material to obtain the cover image corresponding to the content to be recommended.

[0084] In some embodiments, a first layer corresponding to the element to be replaced in the target image is determined. In response to the first layer including other elements besides the element to be replaced, the element to be replaced in the first layer is cut out to obtain a second layer after the element to be replaced is cut out. The target material is added to the second layer, and the second layer is image-completed to obtain a complete third layer. The third layer is then replaced in the position of the first layer in the target image to obtain the cover image.

[0085] Alternatively, the other elements mentioned above can be other content elements or background elements.

[0086] In some embodiments, in response to the first layer containing only the element to be replaced, the target material is used to replace the first layer, thereby obtaining the aforementioned cover image.

[0087] In one example, as shown in Figure 3, a schematic diagram of a cover image generation method provided by an exemplary embodiment of this application is illustrated. The target image 310 corresponding to the content to be recommended includes an element 311 to be replaced. The target material 301 is obtained from the material library, and the element 311 to be replaced in the target image 310 is replaced with the target material 301, thereby obtaining the cover image 320.

[0088] In summary, the cover image generation method provided in this application, when generating a cover image for content to be recommended, replaces the elements to be replaced in the target image with target materials to obtain the cover image. The target materials are selected from candidate materials extracted through content element extraction. That is, by replacing elements in the image with pre-generated materials, the efficiency of cover image generation is improved. Furthermore, by matching candidate materials with the target image within a specified domain, the generated cover content is made more closely aligned with the content to be recommended, thus improving the accuracy of cover image generation.

[0089] Please refer to Figure 4, which illustrates a cover image generation method provided in an exemplary embodiment of this application. In this embodiment, the process of determining the target material from candidate materials is illustrated, wherein steps 403 to 405 are performed after step 202. The method includes:

[0090] Step 403: Obtain the target image associated with the content to be recommended.

[0091] For illustrative purposes, the target image mentioned above includes the element to be replaced. The target image can be an editable image, such as PSD or PSB format.

[0092] Optionally, the target image can be a content image from the content to be recommended; or, the target image can be a candidate image template obtained from a template library; or, the target image can be a target image obtained from historical covers.

[0093] Indicatively, the target image includes at least two layers, wherein the first layer of the at least two layers includes the aforementioned element to be replaced.

[0094] Step 4041: Based on the matching relationship between the content tags of the content to be recommended and the material tags of the candidate materials, at least one target candidate material that matches the content to be recommended is determined from the material library.

[0095] Optionally, the content tags for the content to be recommended can be tags set by the content publishing account, or tags obtained by the server after identifying and classifying the content to be recommended.

[0096] Indicatively, in response to the matching condition between the content tags of the content to be recommended and the material tags of the candidate materials, the aforementioned candidate materials are identified as target candidate materials.

[0097] In some embodiments, when content tags and material tags are from the same tag library, target candidate materials can be determined based on whether the content tags and material tags are the same. Here, the aforementioned tag library is a tag library obtained by standardizing tags according to their semantics; that is, the tag library does not contain different tags indicating the same semantics.

[0098] In other embodiments, at least one target candidate material can be determined from candidate materials based on the semantic similarity between content tags and material tags. Illustratively, in response to the semantic similarity between the content tags of the content to be recommended and the material tags of the candidate materials reaching a specified similarity threshold, the aforementioned candidate material is determined as a target candidate material.

[0099] In one example, features are extracted from content tags and material tags respectively, resulting in content tag feature representations and material tag feature representations. The similarity between content tags and material tags is determined by calculating the feature distance between the content tag feature representations and material tag feature representations. Optionally, the aforementioned content tag feature representations and material tag feature representations can be embedding vectors. Optionally, the aforementioned feature distance can be at least one of Euclidean distance, cosine distance, Mahalanobis distance, Hamming distance, etc.

[0100] Step 4042: Based on the color matching degree between the content to be recommended and at least one target candidate material, determine the target material from at least one target candidate material.

[0101] In this embodiment of the application, in order to make the generated cover image more suitable for the content to be recommended, the target candidate material is further filtered according to the color matching degree between the content to be recommended and the target candidate material.

[0102] In some embodiments, in response to the number of target candidate materials reaching a specified material threshold, the target material is determined from at least one target candidate material based on the color matching degree between the content to be recommended and at least one target candidate material. Optionally, the specified material threshold may be preset or indicated by the terminal.

[0103] In some embodiments, when filtering target candidate materials based on the color matching degree between the content to be recommended and the candidate materials, at least one of the following filtering methods can be selected:

[0104] First, the target candidate materials are screened based on the color matching of the target image.

[0105] In a schematic manner, the process involves: obtaining the color scheme information of the target image; obtaining the color scheme information of the corresponding candidate materials; determining the color matching data between the image color scheme information and the material color scheme information based on a color matching network; and determining the target material from at least one candidate material based on the color matching data corresponding to at least one candidate material.

[0106] Schematic illustration: The color scheme information of the target image is used to indicate the color matching of the target image, and the color matching network is used to determine the matching degree when different colors are matched. Optionally, when determining the matching degree between the target image and the target candidate material, it can be determined based on at least one dimension of hue and contrast between the target image and the target candidate material.

[0107] In terms of color tone, based on color matching principles, it's crucial to ensure that candidate materials maintain color tone consistency when used as target materials to replace the target image, avoiding color mismatches between the target material's tone and other image content in the resulting cover image. In terms of contrast, based on color matching principles, it's essential to avoid oversaturated visual effects caused by excessive color contrast in the resulting cover image.

[0108] In some embodiments, color matching data can also be determined using color matching algorithms. Taking the hue dimension as an example, the aforementioned image color information can be obtained by statistically analyzing the pixel values ​​corresponding to each pixel in the target image, and the color information of the target image can be indicated based on the statistical results of the pixel values ​​corresponding to the target image. In one example, the hue is pre-classified according to the color corresponding to the pixel value. For example, different pixel values ​​are classified into red, yellow, green, and purple tones according to hue, or into warm, cool, and neutral tones according to the warmth or coolness of the color. The pixels of the target image are classified according to the hue corresponding to the pixel value, and the image color information of the target image is determined based on the hue classification results.

[0109] Optionally, the hue classification result can be used as the image color information of the target image; or, the hue classification result with the highest proportion of at least one hue type can be used as the image color information of the target image. For example, if the hue classification result of the target image indicates that the pixel value of the target image belongs to the warm hue the most, then the image color information of the target image is determined to indicate that the target image is a warm hue image.

[0110] As an illustration, the color scheme information corresponding to the candidate materials can be pre-calculated and stored accordingly. When it is necessary to determine the color matching data between the image color scheme information and the material color scheme information, the material color scheme information corresponding to the target candidate material can be directly obtained. The method for determining the material color scheme information corresponding to the candidate material is the same as the method for determining the color scheme information of the target image, and will not be elaborated upon here.

[0111] As an illustration, the color matching data mentioned above can be determined based on the similarity between the color scheme information of the image and the color scheme information of the source material. In one example, when the color scheme information indicates the classification result of the hue, it can be determined based on the similarity of the proportion of different hue types between the target image and the target candidate material. In response to the proportion similarity reaching the hue similarity threshold, the target candidate material is determined as the target material.

[0112] Specifically, the aforementioned similarity ratio can be calculated using Formula 1, where x i The i-th sub-result in the tone classification results of the target image, y i Indicates the i-th sub-result in the tone classification results of the target candidate material.

[0113] Formula 1:

[0114] For example, if the target image's color tone classification result is 86% warm, 11% cool, and 3% neutral, and the target candidate material's color tone classification result is 78% warm, 7% cool, and 15% neutral, the color tone similarity between the two can be calculated based on the minimum value of each color tone. That is, if the color tone similarity is 88%, and the color tone similarity threshold is 75%, then the above target material's color scheme meets the color tone similarity threshold and can be used as the target material.

[0115] In other embodiments, the color matching network described above can be learned from the color combinations in sample images. Optionally, the neural network that learns the color combinations in the image can be at least one of CNN, Recurrent Neural Network (RNN), AlexNet, VGG, etc. The sample images can be images created by professional designers that possess suitable color matching features, enabling the neural network to learn color matching principles. For example, the input sample images include images that satisfy at least one color matching principle such as monochromatic matching, adjacent color matching, complementary color matching, split complementary color matching, ternary color matching, quaternary color matching, etc.

[0116] The illustrations illustrate the principles of color matching as follows: Monochromatic color matching involves selecting a primary color on the color wheel and then changing its saturation and brightness to obtain multiple sub-colors. The resulting image conforms to color matching principles. Adjacent color matching involves selecting at least two adjacent colors on the color wheel. The resulting image conforms to color matching principles. Complementary color matching involves selecting two opposing colors on the color wheel to create a color group. The resulting image conforms to color matching principles. Split complementary color matching involves selecting three colors on the color wheel based on a narrow triangular color selection area. The resulting image conforms to color matching principles. Ternary color matching involves selecting three colors on the color wheel based on an equilateral triangular color selection area. The resulting image conforms to color matching principles. Quadrilateral color matching involves selecting four colors on the color wheel based on a rectangular color selection area. The resulting image conforms to color matching principles. The color wheel mentioned above is the result of color mixing by superimposing and mixing the three primary colors to form new colors, and so on.

[0117] Second, target candidate materials are screened based on the sentiment semantics corresponding to the content to be recommended.

[0118] In a schematic manner, the semantic features of the emotional semantics expressed by the content to be recommended are extracted to obtain the semantic feature representation of the content to be recommended; based on the semantic feature representation, the content semantics of the content to be recommended are classified to determine the target emotional category corresponding to the content to be recommended, and the target emotional category has a corresponding relationship with the color scheme of the target material; based on the matching degree between the color scheme of the target material and the color scheme of the target candidate material, the target material is determined from at least one target candidate material.

[0119] As an illustration, when extracting features from the sentiment semantics expressed by the content to be recommended, the text content of the content to be recommended can be determined first, and text sentiment analysis can be performed based on the text content. Optionally, when the content to be recommended includes text content, text sentiment analysis can be performed directly on the text content; when the content to be recommended includes video content, the text content corresponding to the video content can be obtained through subtitle extraction or speech-to-text technology; when the content to be recommended includes audio content, the text content corresponding to the audio content can be obtained through speech-to-text technology; when the content to be recommended includes image content, the image can be identified to determine the text content included in the image, or at least one of the title text and tag text corresponding to the image content can be determined as the text content used for text sentiment analysis.

[0120] In some embodiments, a pre-trained sentiment semantic classification network is used to determine the target sentiment category corresponding to the content to be recommended. This sentiment semantic classification network is trained using sample content labeled with sentiment categories. The network performs sentiment analysis on the input text content and outputs its corresponding sentiment category. Optionally, the sentiment category may include at least one emotion selected from joy, anger, sorrow, happiness, criticism, and praise.

[0121] To illustrate, there is a correspondence between emotion categories and material color schemes. For example, when the emotion category is happiness, the material color scheme can include red and yellow tones, and when the emotion category is sadness, the material color scheme can include black and gray tones.

[0122] In some embodiments, after determining the target emotion category corresponding to the content to be recommended, a list of correspondences between emotion categories and material color schemes is obtained, and at least one target material color scheme that matches the target emotion category is determined based on the correspondence.

[0123] In some embodiments, the color scheme of the candidate material can be stored when the candidate material is stored in the material library. That is, when the candidate material is generated, the color scheme of the content element corresponding to the candidate material is identified, the color scheme of the candidate material is determined, and the above color scheme is stored as a color tag.

[0124] Schematic: In response to the color scheme of the candidate material and the target material reaching a color scheme similarity threshold, the candidate material is identified as the target material. Optionally, the color scheme similarity threshold can be preset or indicated by the terminal.

[0125] Third, target candidate materials are filtered based on their display position when the content to be recommended is recommended.

[0126] This example illustrates obtaining the display position information of the content to be recommended during the recommendation process, and determining the target material from the candidate materials based on the display position information. Optionally, the display position information includes at least two candidate positions, meaning that the content to be recommended will be displayed in at least two candidate positions when it is recommended. When the content to be recommended is displayed in multiple positions, different target materials can be selected based on different positions to generate cover images. For example, the candidate positions include a first candidate position, a second candidate position, and a third candidate position. The first candidate position is the position where the content to be recommended is displayed when it is recommended on the platform's recommendation homepage; the second position is the position where the content to be recommended is displayed when the keywords related to it are searched; and the third position is the position where the content to be recommended is displayed on the homepage of the content publishing account. The first target material is obtained by selecting the first candidate position, and a first cover image corresponding to the first candidate position is generated based on the first target material. The second target material is obtained by selecting the second candidate position, and a second cover image corresponding to the second candidate position is generated based on the second target material. The third target material is obtained by selecting the third candidate position, and a third cover image corresponding to the third candidate position is generated based on the third target material.

[0127] In some embodiments, when the display interface corresponding to the candidate position includes other recommended content, the target candidate material can be filtered based on the cover color scheme of the other recommended content. In one example, the content covers of other recommended content included in the display interface of the candidate position are obtained; the color scheme information corresponding to the content covers of the other recommended content is obtained; and the target material is determined from the target candidate material based on the above color scheme information, wherein the color scheme of the target material is the same as or similar to the color scheme of the content covers of the other recommended content.

[0128] Fourth, target candidate materials are screened based on the cover images of related content associated with the content to be recommended.

[0129] As an illustration, when the content to be recommended has related content, the target candidate materials can be filtered based on the cover images of the related content. Optionally, the related content can be set by the content publishing account or automatically identified by the server. Optionally, the related relationship can be a content collection set by the content publishing account. In one example, the content publishing account has created multiple content collections, and different content collections are used to publish different related content. For example, the content publishing account puts horror movie clips in the first video collection and romance movie clips in the second video collection.

[0130] In a schematic manner, the color scheme information of the cover of the aforementioned related content is obtained; based on the aforementioned color scheme information, the target material is determined from the target candidate materials, wherein the color scheme of the target material is the same as or similar to the color scheme of the cover of the related content.

[0131] Step 405: Replace the element to be replaced in the target image with the target material to obtain the cover image corresponding to the content to be recommended.

[0132] In some embodiments, a first layer corresponding to the element to be replaced in the target image is determined. In response to the first layer including other elements besides the element to be replaced, the element to be replaced in the first layer is cut out to obtain a second layer after the element to be replaced is cut out. The target material is added to the second layer, and the second layer is image-completed to obtain a complete third layer. The third layer is then replaced in the position of the first layer in the target image to obtain the cover image.

[0133] Alternatively, the other elements mentioned above can be other content elements or background elements.

[0134] In some embodiments, in response to the first layer containing only the element to be replaced, the target material is used to replace the first layer, thereby obtaining the aforementioned cover image.

[0135] In some embodiments, when multiple target materials are identified, corresponding cover images can be generated for each target material; that is, the i-th cover image is generated based on the i-th target material. Illustratively, the resulting multiple cover images are sent to the terminal corresponding to the content publisher, who then determines the final cover image to be used. The content publisher can also save multiple cover images for use as covers for other content to be recommended.

[0136] In summary, the cover image generation method provided in this application, when generating a cover image for content to be recommended, replaces the elements to be replaced in the target image with target materials to obtain the cover image. The target materials are selected from candidate materials extracted through content element extraction. That is, by replacing elements in the image with pre-generated materials, the efficiency of cover image generation is improved. Furthermore, by matching candidate materials with the target image within a specified domain, the generated cover content is made more closely aligned with the content to be recommended, thus improving the accuracy of cover image generation.

[0137] In this embodiment, the target candidate material is further filtered by the color matching degree between the content to be recommended and the target candidate material, thereby obtaining the target material. This improves the replacement effect when replacing the elements to be replaced in the target image with the target material, and improves the accuracy of the generated cover image.

[0138] Please refer to Figure 5, which illustrates a cover image generation method provided in an exemplary embodiment of this application. In this embodiment, the method is illustrated by replacing elements in a candidate image template to obtain a cover image. The method includes:

[0139] Step 501: Determine the target image from the candidate image templates in the template library.

[0140] In some embodiments, to better utilize designer resources, PSD images related to the designer's history can be obtained for use in generating asset libraries and template libraries.

[0141] To illustrate, the process for generating a media library includes: obtaining a first candidate image in an editable format; extracting content elements from at least one layer among multiple layers, combining the obtained content elements with their respective recommendation domains to generate candidate media; and storing the candidate media in the media library. Here, "editable format" refers to a format that stores image editing information.

[0142] The process for generating the template library includes: obtaining a second candidate image in an editable format; identifying a target layer containing replaceable elements based on the image editing information of the second candidate image; determining the position information of the replaceable elements in the target layer; performing data structuring processing on the second candidate image, the layer information of the target layer, and the position information to obtain candidate image templates; and storing the candidate image templates in the template library.

[0143] Optionally, the first candidate image and the second candidate image mentioned above can be candidate images from different image sets, or they can be candidate images from the same image set.

[0144] In this embodiment, candidate images in PSD format are standardized to obtain structured data. In one example, as shown in Figure 6, a flowchart illustrating structured data generation is provided in an exemplary embodiment of this application. A PSD file 601 is input into a PSD parsing program 610, and PSD structured data 602 is output.

[0145] In one example, the structured data corresponding to the image attributes of the candidate images is shown in Table 1, and the structured data of the text attributes of the candidate images is shown in Table 2.

[0146] Table 1

[0147]

[0148] Table 2

[0149]

[0150] As an illustration, the target image can be determined from the template library based on the content tags of the content to be recommended uploaded by the content publisher. That is, the candidate image templates in the template library correspond to template tags, and the target image is selected from the candidate image templates in the template library based on the tag similarity between the content tags of the content to be recommended and the template tags.

[0151] Step 502: Locate the element to be replaced in the target image.

[0152] In a schematic manner, based on the image editing information of the second candidate image, the second candidate image is split into at least one layer; edge extraction is performed on the i-th layer of the second candidate image to obtain the first contour information corresponding to the i-th layer; in response to the similarity between the first contour information of the i-th layer and the second contour information of the candidate element reaching a specified similarity threshold, the i-th layer is determined to be the target layer with replaceable elements, and the candidate element is a specified element in the recommendation domain corresponding to the content to be recommended.

[0153] Optionally, the specified element may include object elements in the recommendation domain whose popularity reaches a specified popularity threshold. For example, for the recommendation domain corresponding to a specified game, the specified element may be an element corresponding to a popular character in the game whose popularity reaches a certain threshold. Alternatively, the specified element may include object elements of a specified object category in the recommendation domain. For example, for the recommendation domain corresponding to a specified game, the specified element may be a special character in the specified game that players can control.

[0154] In this embodiment, the method is illustrated by taking a game character in a specified game as the key content for determining the element to be replaced. The identification algorithm for the game character is similar to a face recognition algorithm, but its complexity is lower than that of face recognition.

[0155] In one example, as shown in Figure 7, a flowchart of the key content recognition process provided by an exemplary embodiment of this application is illustrated. The process includes: S701, extracting feature vectors of specified elements; S702, training the recognition model; and S703, applying the trained recognition model to online recognition.

[0156] In some embodiments, for the extraction of feature vectors, due to the special nature of the game characters in the specified game, that is, the game characters have standard features, that is, the features corresponding to the game characters can be learned by using the specified elements corresponding to the game characters, thereby recognizing the game characters in the target image, and using the content elements corresponding to the recognized game characters as the elements to be replaced.

[0157] In one example, contour matching is used to identify game characters. That is, the contour information of the image is used as a feature vector. The contour extraction can be performed using OpenCV technology. Specifically, as shown in Figure 8, which illustrates a flowchart of contour extraction provided in an exemplary embodiment of this application, the original input image 801 undergoes thresholding processing 810 to obtain a target binary image 802. This target binary image 802 is an image with a white background and a black foreground. Thresholding processing 810 may include obtaining a binary image 811 through a first function (cv2.threshold(cv2.cvtColor(toGRAY))) and extracting the image edge contours 812 through a second function (cv2.Canny(image,128,256)). Then, the target binary image 802 obtains edge lines 820 through a third function (cv2.findContours()).

[0158] After the above process, a three-dimensional array describing the contour is obtained. This three-dimensional array is the contour feature vector of the extracted target image. Schematic, as shown in Figure 9, illustrates a visualization of the contour extraction effect provided by an exemplary embodiment of this application. The target image 901 is transformed into a contour image 902 after contour extraction.

[0159] In illustrative terms, for training a recognition model, the similarity between features can be determined based on the distance between features. That is, after obtaining a first 3D array of the sample image's contour and a second 3D array of the specified element's contour, the features of the specified element are learned by calculating the feature distance between the first and second 3D arrays, where the image content in the sample image is associated with the specified element. In one example, taking Euclidean distance as the feature distance, the corresponding similarity is calculated as shown in Formula 2, where x... i Indicates the i-th first feature representation, y i Indicates the representation of the i-th second feature.

[0160] Formula 2:

[0161] As an illustration, once the recognition model is trained, it can be used online for real-time recognition to determine whether the content elements expressed by each layer in the target image are the elements to be replaced.

[0162] Step 503: Obtain the coordinate data of the element to be replaced in the target image, as well as the first width and height data of the element to be replaced.

[0163] To illustrate, after identifying the element to be replaced in the target image, it is also necessary to obtain the coordinate data of the element to be replaced in the target image, as well as the first width and height data of the element to be replaced. The coordinate data of the element to be replaced is used to determine the position where the element needs to be replaced, and the first width and height data of the element to be replaced is used to normalize with the size of the target material.

[0164] Step 504: Locate the target material in the material library.

[0165] As an illustration, the target material for replacing the element to be replaced is found in the material library based on the content tags corresponding to the content to be recommended. The specific screening process for the target material is shown in step 204 or steps 4041 to 4042, which will not be elaborated here.

[0166] Step 505: Obtain the second width and height data of the target material.

[0167] In some embodiments, when storing candidate materials in the material library, corresponding size information of the candidate materials is also stored, wherein the size information includes the width and height data of the candidate materials. For example, after determining the target material from the material library, the second width and height data of the target material can be obtained simultaneously.

[0168] Step 506: Based on the first width and height data and coordinate data of the element to be replaced, and the second width and height data of the target element, replace the element to be replaced in the target image to generate a cover image.

[0169] In a schematic way, based on the first width and height data and coordinate data of the element to be replaced, and the second width and height data of the target element, the scaling information of the target material when replacing the element to be replaced in the target image can be calculated. Based on the above scaling information, the target material can replace the element to be replaced in the target image to generate a cover image.

[0170] In some embodiments, the target image is an editable image, wherein the layer corresponding to the element to be replaced is the nth layer in the target image. When replacing the element, the target material is scaled according to the scaling information, and the scaled target material is used as the nth layer to replace the original nth layer, thereby obtaining the cover image.

[0171] In some embodiments, the generated cover image may also be in an editable format. Illustratively, the content publisher can further adjust the generated cover image. Optionally, the adjustment process may include at least one of the following: adjusting element position, adjusting element transparency, adjusting image style, and adjusting layer position relationships. Specifically, adjusting element position can modify the position of elements in the cover image; adjusting element transparency can modify the transparency of elements in the cover image; adjusting image style can modify the overall image style of the cover image, for example, adjusting the cover image to at least one of the following styles: comic style, oil painting style, abstract cartoon style, etc.; adjusting layer position relationships can modify the stacking relationship between different layers in the cover image. Optionally, the aforementioned elements may include elements corresponding to the target material, or other elements in the cover image, without specific limitations.

[0172] Schematic illustration: The server transmits the aforementioned editable cover image to the terminal, which displays the cover image through a designated application, wherein the designated application provides the aforementioned adjustment processing functions. In one example, as shown in FIG10, a schematic diagram of an editing interface 1000 for a cover image provided in an exemplary embodiment of this application is shown. In the editing interface 1000, a generated cover image 1010 is displayed, wherein the cover image 1010 includes an element 1011 corresponding to the target material, and the element 1011 is in an editable state, that is, the element 1011 can be adjusted.

[0173] In summary, the cover image generation method provided in this application, when generating a cover image for content to be recommended, replaces the elements to be replaced in the target image with target materials to obtain the cover image. The target materials are selected from candidate materials extracted through content element extraction. That is, by replacing elements in the image with pre-generated materials, the efficiency of cover image generation is improved. Furthermore, by matching candidate materials with the target image within a specified domain, the generated cover content is made more closely aligned with the content to be recommended, thus improving the accuracy of cover image generation.

[0174] In this embodiment of the application, the method can not only reduce the cost for content publishers when producing content, but also empower content publishers with the design creativity of excellent designers, improve the flexibility of cover generation, and improve the smoothness of the cover generation process by providing adjustment and processing functions for the generated cover images.

[0175] Please refer to Figure 11, which shows a structural block diagram of a cover image generation apparatus provided in an exemplary embodiment of this application. The apparatus includes the following modules:

[0176] The acquisition module 1110 is used to acquire a first candidate image, which is an image obtained by superimposing multiple layers.

[0177] The first generation module 1120 is used to extract content elements from at least one of the multiple layers, label the extracted content elements with material tags to obtain candidate materials, and store the candidate materials in a material library. The candidate materials in the material library are marked with material tags used to indicate the recommendation domain.

[0178] The acquisition module 1110 is further configured to acquire a target image associated with the content to be recommended, the target image including elements to be replaced, the content to be recommended being labeled with content tags, and the content tags representing the recommendation domain corresponding to the content to be recommended;

[0179] The determining module 1130 is used to determine the target material that matches the content to be recommended from the material library based on the matching relationship between the content tags of the content to be recommended and the material tags of the candidate material;

[0180] The second generation module 1140 is used to replace the element to be replaced with the target material in the target image to obtain the cover image corresponding to the content to be recommended.

[0181] In some optional embodiments, as shown in FIG12, the determining module 1130 further includes:

[0182] The first determining unit 1131 is used to determine at least one target candidate material from the material library based on the matching relationship between the content tags of the content to be recommended and the material tags of the candidate material;

[0183] The second determining unit 1132 is used to determine the target material from the at least one target candidate material based on the color matching degree between the content to be recommended and the at least one target candidate material.

[0184] In some optional embodiments, the second determining unit 1132 is further configured to extract features of the emotional semantics expressed by the content to be recommended, and obtain a semantic feature representation of the content to be recommended;

[0185] The second determining unit 1132 is further configured to classify the content semantics of the content to be recommended based on the semantic feature representation, and determine the target sentiment category corresponding to the content to be recommended, wherein the target sentiment category has a corresponding relationship with the target material color scheme;

[0186] The second determining unit 1132 is further configured to determine the target material from the at least one target candidate material based on the matching degree between the target material color scheme and the target candidate material color scheme.

[0187] In some optional embodiments, the determining module 1130 further includes:

[0188] The acquisition unit 1133 is used to acquire the color matching information of the target image, wherein the color matching information is used to indicate the color matching of the target image;

[0189] The acquisition unit 1133 is also used to acquire the material color information corresponding to the target candidate material;

[0190] The second determining unit 1132 is further configured to determine color matching data between the image color matching information and the material color matching information based on a color matching network, wherein the color matching network is learned from the color matching situation in the sample image;

[0191] The second determining unit 1132 is further configured to determine the target material from the at least one target candidate material based on the color matching data corresponding to the at least one candidate material.

[0192] In some optional embodiments, the acquisition module 1110 is further configured to acquire a second candidate image in an editable format, wherein the editable format is a format that stores image editing information;

[0193] The device also includes a third generation module 1150;

[0194] The third generation module 1150 includes:

[0195] The recognition unit 1151 is used to identify a target layer in the second candidate image that has replaceable elements based on the image editing information of the second candidate image;

[0196] The third determining unit 1152 is used to determine the position information of the replaceable element in the target layer;

[0197] The third determining unit 1152 is further configured to perform data structuring processing on the second candidate image, the layer information of the target layer, and the position information to obtain a candidate image template;

[0198] Storage unit 1153 is used to store the candidate image templates into a template library.

[0199] In some optional embodiments, the candidate image templates correspond to template tags;

[0200] The acquisition module 1110 is further configured to filter the target image from candidate image templates in the template library based on the tag similarity between the content tag and the template tag.

[0201] In some optional embodiments, the identification unit 1151 is further configured to split the second candidate image into at least one layer based on the image editing information of the second candidate image;

[0202] The recognition unit 1151 is further configured to perform edge extraction on the i-th layer of the second candidate image to obtain the first contour information corresponding to the i-th layer;

[0203] The identification unit 1151 is further configured to determine, in response to the similarity between the first contour information of the i-th layer and the second contour information of the candidate element reaching a specified similarity threshold, that the i-th layer is a target layer with replaceable elements, and the candidate element is a specified element in the recommendation domain corresponding to the content to be recommended.

[0204] Wherein, the specified element includes object elements in the recommendation domain whose object popularity reaches a specified popularity threshold; or, the specified element includes object elements in the recommendation domain that specify an object category.

[0205] In summary, the cover image generation apparatus provided in this application generates a cover image for content to be recommended by replacing elements in a target image with target materials. The target materials are selected from candidate materials extracted from content elements. That is, by replacing elements in an image with pre-generated materials, the efficiency of cover image generation is improved. Furthermore, by matching candidate materials with the target image within a specified domain, the generated cover content is more closely aligned with the content to be recommended, thus improving the accuracy of cover image generation.

[0206] It should be noted that the cover image generation apparatus provided in the above embodiments is only an example of the division of the above functional modules. In practical applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. In addition, the cover image generation apparatus and the cover image generation method embodiments provided in the above embodiments belong to the same concept, and their specific implementation process can be found in the method embodiments, which will not be repeated here.

[0207] Figure 13 shows a schematic diagram of the structure of a server provided in an exemplary embodiment of this application. Specifically, it includes the following structure.

[0208] Server 1300 includes a Central Processing Unit (CPU) 1301, a system memory 1304 including Random Access Memory (RAM) 1302 and Read Only Memory (ROM) 1303, and a system bus 1305 connecting the system memory 1304 and the CPU 1301. Server 1300 also includes a mass storage device 1306 for storing the operating system 1313, application programs 1314, and other program modules 1315.

[0209] Mass storage device 1306 is connected to central processing unit 1301 via a mass storage controller (not shown) connected to system bus 1305. Mass storage device 1306 and its associated computer-readable media provide non-volatile storage for server 1300. That is, mass storage device 1306 may include computer-readable media (not shown) such as hard disk or compact disc read-only memory (CD-ROM) drives.

[0210] Without loss of generality, computer-readable media can include computer storage media and communication media. Computer storage media includes volatile and non-volatile, removable and non-removable media implemented using any method or technology for storing information such as computer-readable instructions, data structures, program modules, or other data. Computer storage media includes RAM, ROM, erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other solid-state memory technologies, CD-ROM, digital versatile disc (DVD) or other optical storage, magnetic tape cassettes, magnetic tape, disk storage, or other magnetic storage devices. Of course, those skilled in the art will recognize that computer storage media are not limited to the above-mentioned types. The system memory 1304 and mass storage device 1306 described above can be collectively referred to as memory.

[0211] According to various embodiments of this application, server 1300 can also be connected to a remote computer on a network, such as the Internet. That is, server 1300 can be connected to network 1312 via network interface unit 1311 connected to system bus 1305, or it can also use network interface unit 1311 to connect to other types of networks or remote computer systems (not shown).

[0212] The aforementioned memory also includes one or more programs, which are stored in the memory and configured to be executed by the CPU.

[0213] Embodiments of this application also provide a computer device including a processor and a memory. The memory stores at least one instruction, at least one program, code set, or instruction set. The processor loads and executes the at least one instruction, at least one program, code set, or instruction set to implement the cover image generation method provided in the above-described method embodiments. Optionally, the computer device may be a terminal or a server.

[0214] Embodiments of this application also provide a computer-readable storage medium storing at least one instruction, at least one program, code set, or instruction set, wherein the at least one instruction, at least one program, code set, or instruction set is loaded and executed by a processor to implement the cover image generation method provided in the above-described method embodiments.

[0215] Embodiments of this application also provide a computer program product or computer program, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform any of the cover image generation methods described in the above embodiments.

[0216] Optionally, the computer-readable storage medium may include: read-only memory (ROM), random access memory (RAM), solid-state drives (SSDs), or optical discs, etc. The random access memory may include resistive random access memory (ReRAM) and dynamic random access memory (DRAM). The sequence numbers of the embodiments in this application are merely descriptive and do not represent the superiority or inferiority of the embodiments.

[0217] Those skilled in the art will understand that all or part of the steps of the above embodiments can be implemented by hardware or by a program instructing related hardware. The program can be stored in a computer-readable storage medium, such as a read-only memory, a disk, or an optical disk.

[0218] The above description is merely an optional embodiment of this application and is not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.

Claims

1. A method for generating a cover image, characterized in that, The method includes: obtaining a first candidate image, which is an image obtained by superimposing multiple layers; extracting content elements from at least one of the multiple layers, labeling the extracted content elements with material tags to obtain candidate materials, and storing the candidate materials in a material library, wherein the candidate materials in the material library are marked with material tags used to indicate the recommendation domain; obtaining a target image associated with the content to be recommended, wherein the target image includes elements to be replaced, the content to be recommended is labeled with content tags, and the content tags indicate the recommendation domain corresponding to the content to be recommended; determining at least one target candidate material from the material library based on the matching relationship between the content tags of the content to be recommended and the material tags of the candidate materials; determining a target material from the at least one target candidate material based on the color matching degree between the content to be recommended and the at least one target candidate material; replacing the elements to be replaced with the target material in the target image to obtain a cover image corresponding to the content to be recommended.

2. The method according to claim 1, characterized in that, The step of determining the target material from the at least one target candidate material based on the color matching degree between the content to be recommended and the at least one target candidate material includes: extracting features of the emotional semantics expressed by the content to be recommended to obtain a semantic feature representation of the content to be recommended; classifying the content semantics of the content to be recommended based on the semantic feature representation to determine the target emotional category corresponding to the content to be recommended, wherein the target emotional category has a corresponding relationship with the color scheme of the target material; and determining the target material from the at least one target candidate material based on the matching degree between the color scheme of the target material and the color scheme of the target candidate material.

3. The method according to claim 1, characterized in that, The step of determining the target material from the at least one target candidate material based on the color matching degree between the content to be recommended and the at least one target candidate material includes: obtaining the image color matching information of the target image, the image color matching information being used to indicate the color matching situation of the target image; obtaining the material color matching information corresponding to the target candidate material; determining the color matching data between the image color matching information and the material color matching information based on a color matching network, the color matching network being learned from the color matching situation between sample images; and determining the target material from the at least one target candidate material based on the color matching data corresponding to the at least one candidate material respectively.

4. The method according to any one of claims 1 to 3, characterized in that, The method further includes: obtaining a second candidate image in an editable format, wherein the editable format is a format that stores image editing information; identifying a target layer in the second candidate image containing replaceable elements based on the image editing information of the second candidate image; determining the position information of the replaceable elements in the target layer; performing data structuring processing on the second candidate image, the layer information of the target layer, and the position information to obtain a candidate image template; and storing the candidate image template in a template library.

5. The method according to claim 4, characterized in that, The candidate image templates correspond to template tags; obtaining the target image associated with the content to be recommended includes: selecting the target image from the candidate image templates in the template library based on the tag similarity between the content tag and the template tag.

6. The method according to claim 4, characterized in that, The step of identifying a target layer containing replaceable elements in the second candidate image based on the image editing information of the second candidate image includes: splitting the second candidate image into at least one layer based on the image editing information of the second candidate image; performing edge extraction on the i-th layer of the second candidate image to obtain first contour information corresponding to the i-th layer; and determining that the i-th layer is a target layer containing replaceable elements in response to the similarity between the first contour information of the i-th layer and the second contour information of the candidate element reaching a specified similarity threshold, wherein the candidate element is a specified element in the recommendation domain corresponding to the content to be recommended; wherein the specified element includes object elements in the recommendation domain whose object popularity reaches a specified popularity threshold; or, the specified element includes object elements of a specified object category in the recommendation domain.

7. A cover image generation device, characterized in that, The apparatus includes: an acquisition module for acquiring a first candidate image, the first candidate image being an image obtained by superimposing multiple layers; a first generation module for extracting content elements from at least one of the multiple layers, labeling the extracted content elements with material tags to obtain candidate materials, and storing the candidate materials in a material library, the candidate materials in the material library being tagged with material tags indicating the recommendation domain; the acquisition module is further configured to acquire a target image associated with the content to be recommended, the target image including elements to be replaced, the content to be recommended being tagged with content tags, the content tags indicating the recommendation domain corresponding to the content to be recommended; a first determination unit for determining at least one target candidate material from the material library based on the matching relationship between the content tags of the content to be recommended and the material tags of the candidate materials; a second determination unit for determining a target material from the at least one target candidate material based on the color matching degree between the content to be recommended and the at least one target candidate material; and a second generation module for replacing the elements to be replaced with the target material in the target image to obtain a cover image corresponding to the content to be recommended.

8. A computer device, characterized in that, The computer device includes a processor and a memory, the memory storing at least one program, which is loaded and executed by the processor to implement the method for generating a cover image as described in any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores at least one piece of program code, which is loaded and executed by a processor to implement the method for generating a cover image as described in any one of claims 1 to 6.

10. A computer program product, characterized in that, The computer program product includes a computer program stored in a computer-readable storage medium, which a processor reads from and executes to implement the method for generating a cover image as described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Slide beautification-based decorative element processing method and device

    CN107590111A

  • Multimedia resource generation method and device, electronic equipment and storage medium

    CN113377971A