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

Automatically obtaining the target image elements collection and processing image elements through computer equipment, solving the problem of low degree of image processing automation and achieving efficient generation of images that meet user needs.

CN113393556BActive Publication Date: 2025-08-19TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110150949.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-02-03
Publication Date
2025-08-19
Estimated Expiration
2041-02-03

AI Technical Summary

Technical Problem

In the prior art, the image processing process has low degree of automation, consumes a lot of time, and it is difficult to generate design drawings that meet user needs.

Method used

The target keywords of the target theme are obtained through the computer device, and the target image element collection is automatically matched from the image element library, and processed according to the configuration information of the image element in the first image, replace or overwrite the original image elements, and generate a new image that meets the user's needs.

Benefits of technology

It realizes automatic acquisition and efficient processing of image elements, shortens the time for generating new images, and meets users' design needs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113393556B_ABST
    Figure CN113393556B_ABST
Patent Text Reader

Abstract

The embodiments of the present application provide an image processing method, apparatus, computer device and readable storage medium, which are applied to the field of image processing technology, wherein the method includes: obtaining target keywords corresponding to a target subject; obtaining a target picture element set corresponding to the target subject based on the target keywords; obtaining a first image and configuration information of picture elements in the first image; processing the first image according to the configuration information of picture elements in the first image and the target picture element set to obtain a second image, which can realize automation and efficiency of picture element acquisition; and automatically replacing the original image to shorten the time of generating a new image.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

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

[0002] With the development of network technology, users can access a variety of data online and then process the data to obtain the desired results. For example, users can obtain a variety of images and text online, then edit these images and text using design software to create a design that meets their needs. As can be seen, most of the design drawings currently required by users must be manually generated using design software and self-searched image materials. This image processing process has a low degree of automation and is very time-consuming. Therefore, in the field of image processing, how to generate images that meet user needs has become a hot topic of discussion. Summary of the Invention

[0003] The embodiments of the present application provide an image processing method, apparatus, computer device, and readable storage medium, which can realize the automation and efficiency of image element acquisition; and automatically replace the original image to shorten the time of generating a new image.

[0004] An embodiment of the present application provides an image processing method, including:

[0005] Get the target keywords corresponding to the target topic;

[0006] Acquire a target picture element set corresponding to the target theme according to the target keyword;

[0007] Obtaining a first image and configuration information of picture elements in the first image;

[0008] The first image is processed according to the configuration information of the picture elements in the first image and the target picture element set to obtain a second image.

[0009] A second aspect of the present application provides an image processing device, including:

[0010] An acquisition module is used to obtain target keywords corresponding to the target topic;

[0011] The acquisition module is further configured to acquire a target image element set corresponding to the target theme according to the target keyword;

[0012] The acquisition module is further configured to acquire the first image and configuration information of picture elements in the first image;

[0013] A processing module is used to process the first image according to the configuration information of the picture elements in the first image and the target picture element set to obtain a second image.

[0014] On the one hand, an embodiment of the present application provides a computer device, including a processor and a memory, wherein the processor and the memory are interconnected, wherein the memory is used to store a computer program, the computer program includes program instructions, and the processor is configured to call the program instructions to execute the image processing method described above.

[0015] On one hand, an embodiment of the present application provides a computer-readable storage medium, in which program instructions are stored. When the program instructions are executed, they are used to implement the above-mentioned image processing method.

[0016] On the one hand, an embodiment of the present application provides a computer program product or a computer program, which includes computer instructions stored in a computer-readable storage medium. When the computer instructions are executed by a processor of a computer device, the image processing method described above is executed.

[0017] In an embodiment of the present application, a computer device obtains a target subject and extracts target keywords corresponding to the target subject; then, a target picture element set corresponding to the target subject is obtained based on the target keywords, without the need to manually select the target picture element set corresponding to the target subject, thereby achieving automation and efficiency in picture element acquisition; further, the computer device can process the first image based on the configuration information of the picture elements in the first image and the target picture element set to obtain a second image, and can automatically replace the original image to obtain a new image that meets user needs, while also shortening the time to generate a new image. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0019] Figure 1 This is a flowchart of an image processing method provided by an embodiment of the present application;

[0020] Figure 2a Schematic diagram of the target subject input interface provided in an embodiment of the present application;

[0021] Figure 2bThe embodiment of the present application provides a selection control and modification options for selecting a first image in a target theme input interface;

[0022] Figure 2c is a schematic diagram of displaying multiple candidate images in a target theme input interface provided by an embodiment of the present application;

[0023] Figure 2d is a schematic diagram of a picture element of a first image provided in an embodiment of the present application;

[0024] Figure 2e is a schematic diagram of generating a second image provided by an embodiment of the present application;

[0025] Figure 3 This is a flowchart of an image processing method provided by an embodiment of the present application;

[0026] Figure 4 This is a schematic diagram of a picture element library provided in an embodiment of the present application;

[0027] Figure 5 This is a flowchart of an image processing solution provided by an embodiment of the present application;

[0028] Figure 6 is a structural diagram of an image processing device provided in an embodiment of the present application;

[0029] Figure 7 It is a structural diagram of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0030] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.

[0031] Artificial Intelligence (AI) refers to the theories, methods, techniques, and application systems that use digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, to 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 seeks to understand the essence of intelligence and produce new intelligent machines that can respond in a manner similar to human intelligence. AI also involves studying the design principles and implementation methods of various intelligent machines, enabling them to possess the capabilities of perception, reasoning, and decision-making.

[0032] Artificial intelligence (AI) technology is a comprehensive discipline encompassing a wide range of fields, encompassing both hardware and software technologies. Foundational AI technologies generally include sensors, specialized AI chips, cloud computing, distributed storage, big data processing, operating / interaction systems, and mechatronics. AI software technologies primarily encompass computer vision, speech processing, natural language processing, and machine learning / deep learning.

[0033] Computer vision (CV) is the science of making machines "see." Specifically, it refers to machine vision, where cameras and computers replace the human eye in identifying, tracking, and measuring objects. This involves further processing the images, transforming them into 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, three-dimensional object reconstruction, 3D technology, virtual reality, augmented reality, simultaneous localization and mapping, and common biometric recognition technologies such as facial recognition and fingerprint recognition.

[0034] The image processing method provided in the embodiments of this application involves artificial intelligence computer vision technology. A computer device can automatically obtain a target image element set corresponding to the required theme based on the target keywords in the required theme, and replace or overwrite the target image elements in the obtained target image element set with the image elements in the original image to obtain the required image. This is specifically illustrated by the following embodiments:

[0035] It should be noted that the image processing method involved in the embodiments of the present application can be executed by a computer device, which can be a terminal device or a server, wherein the terminal device can be a mobile phone, tablet computer, laptop computer, PDA, mobile Internet device, etc.; the server can be an independent physical server, or it can be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDN), and big data and artificial intelligence platforms.

[0036] See also Figure 1 , Figure 1The following is a flow chart of an image processing method provided by an embodiment of the present invention. The method can be executed by a computer device. The image processing method described in this embodiment may include the following steps S101-S104:

[0037] S101: Obtain target keywords corresponding to the target topic.

[0038] The target theme may be a fruit theme, a Japanese food theme, a dance theme, etc. The target theme may be a text or several separate keywords, which is not limited in the embodiment of the present application.

[0039] In one embodiment, the computer device may obtain a target topic (i.e., a speech segment) inputted by voice; or the computer device may obtain a target topic (i.e., a text segment) inputted by text. In a specific implementation, the computer device may provide a user interface for inputting a target topic, and the user may input the target topic through the user interface. For example, see Figure 2a A schematic diagram of inputting a target topic provided in an embodiment of the present invention is shown in FIG. Figure 2a 200 represents a user interface, 201 represents a text input area, and 202 represents a submit button. If a user can enter a text in the text input area 201, such as "Japanese food season, great value", and clicks the submit button 202, the computer device will use "Japanese food season, great value" as the target theme.

[0040] Optional, Figure 2a The user interface shown may also include a voice input area 203, and the user can trigger the voice input area 203 to input a voice as the target topic. It should be understood that the user interface provided in the embodiment of the present invention is only a schematic diagram. In actual application, those skilled in the art can use different methods according to different needs. Figure 2a Based on this, we enrich and expand the user interface.

[0041] In one embodiment, the user interface may be displayed after a user triggers a target application on a computer device. For example, the target application may be an image processing tool. Alternatively, the user interface may be displayed after a user inputs an image conversion operation in the target application. In other embodiments, the user interface may also be displayed after a user inputs an image conversion operation on a computer device.

[0042] In one embodiment, the target keywords corresponding to the target theme can be obtained by parsing the target theme. For example, if the target theme is a speech input, the target theme input can be parsed to obtain the target keywords. For another example, if the target theme is obtained through text input, the computer device can use text feature recognition to process the target theme inputted in text and extract the target keywords therefrom. For example, if the target theme is a text message "Japanese food season, great value", the computer device can perform text feature recognition on the target theme and obtain the target keywords of the target theme as Japanese food.

[0043] S102: Obtain a target picture element set corresponding to a target theme according to the target keyword.

[0044] In a specific implementation, the computer device may match one or more target picture elements corresponding to the target keyword from the picture element library according to the target keyword, and the one or more target picture elements constitute a target picture element set.

[0045] As an optional implementation, if the picture element library is stored in a server and the computer device is a terminal, then obtaining a target picture element set corresponding to a target theme based on a target keyword includes: sending the target keyword to the server, and the server matching the keyword with each picture element in the picture element library to obtain the target picture element corresponding to the keyword; and sending the picture element to the terminal.

[0046] As another optional implementation, if the picture element library is stored in a terminal and the computing device is also a terminal, then obtaining the target picture element set corresponding to the target theme based on the target keyword can be obtained by the terminal matching the keyword with the picture element library.

[0047] In one embodiment, the image element library includes multiple image elements, each of which includes one or more tags, each of which is used to indicate the element category to which the image element belongs. For example, if an image element includes three tags: sushi, Japanese food, and salmon, then the image element belongs to three categories: sushi, Japanese food, and salmon.

[0048] In one embodiment, when a computer device obtains a target picture element set corresponding to a target theme based on a target keyword, it can match the target keyword with the label of each picture element in the picture element library, and use the picture element corresponding to the matched label as the target picture element. For example, assuming the target keyword is Japanese food, the computer device can match one or more labels corresponding to each picture element from the picture element library based on the target keyword "Japanese food". When the target keyword "Japanese food" successfully matches the "Japanese food" label of any picture element in the picture element library, the computer device can use that picture element as the target picture element.

[0049] S103: Acquire the first image and configuration information of the picture elements in the first image.

[0050] In one embodiment, the first image may be the highest-rated image selected by the computer device from an image library. In a specific implementation, the image library may store multiple images, each of which may be assigned a rating, and each image's rating may be determined based on user evaluations of the image. After obtaining the target theme and the target image element set corresponding to the target theme, the computer device may select the highest-rated image from the image library as the first image.

[0051] In another embodiment, the first image may be an image selected locally by the user from the computer device. Figure 2a When the user clicks the submit button 202, the computer device may display a selection control for selecting the first image in the user interface, such as Figure 2b As shown in 21; the user can select any image from the local as the first image by triggering 21. In addition, optionally, Figure 2b In , the target topic input by the user can be displayed in the user interface in a target display manner, such as Figure 2b As shown in the figure, "Selected theme: Japanese food season, continuous super value" and there is a modification option 22 corresponding to this part; if the modification option 22 is triggered, the user can delete, modify, etc. the selected theme.

[0052] In another embodiment, the first image may be a candidate image selected by the user from among several candidate images recommended by the computer device according to the target theme. Figure 2a When the user clicks the submit button 202, the computer device can filter several candidate images suitable for the target theme from the image library, such as Figure 2c As shown in FIG22 , the user can select any one of several candidate images as the first image.

[0053] Optionally, the first image can be a design drawing, poster, etc. of various themes, and image editing software (for example, Photoshop or Sketch) can be used to place multiple types of elements on different layers in a front-to-back order, and stack the layers one by one in a front-to-back order to form a combination. The multiple types of elements may include text, graphics, pictures, or tables. Among them, the configuration information of the picture element includes the layer where the picture element in the first image is located, and the size information and position information of the picture element in the corresponding layer in the first image. The size information is used to indicate the size of the picture element in the corresponding layer, and the position information is used to indicate the position of the picture element in the corresponding layer. For example, Figure 2d In the first image shown, each layer included in the first image and the picture elements and text elements corresponding to each layer can be seen on the right side of the first image.

[0054] In one embodiment, after acquiring the first image, the computer device may read and analyze the first image using a built-in plug-in or code to ultimately obtain configuration information for image elements in the first image. For example, if the first image is a fruit-themed poster, the computer device may use a built-in plug-in to obtain configuration information for image elements related to fruit in the first image.

[0055] S104: Process the first image according to the configuration information of the picture elements in the first image and the target picture element set to obtain a second image.

[0056] In a specific implementation, the computer device may replace or overwrite the first image according to the configuration information of the picture elements in the first image and the target picture element set to obtain the second image.

[0057] In one embodiment, if there are multiple target picture elements in the target picture element set and only one picture element in the first image, the computer device may replace or overwrite the picture element in the first image with the multiple target picture elements in the target picture element set based on the configuration information of the picture element in the first image, thereby obtaining multiple second images. In a specific implementation, the computer device may resize each target picture element in the target picture element set to the size of the picture element in the first image and place each resized target picture element at the location of the picture element in the first image, thereby obtaining at least one second image.

[0058] In another embodiment, if there are multiple target picture elements in the target picture element set, there are also multiple picture elements in the first image. Since some picture elements in the first image are related to the target theme, the picture elements related to the target theme can be retained, so the computer device can only replace or overwrite the picture elements that are not related to the target theme. In a specific implementation, the computer device can process the first image according to the configuration information of the picture elements that are not related to the target theme and the multiple target picture elements in the target picture element set to obtain at least one second image. Among them, the multiple target picture elements replacing or replacing the picture elements in the first image that are not related to the target theme can refer to the above-mentioned target picture element set having multiple target picture elements, there is only one picture element in the first image, and the implementation process of obtaining multiple second images is not repeated here.

[0059] In another embodiment, if the number of target picture elements included in the target picture element set is the same as the number of picture elements in the first image, then processing the first image according to the configuration information of the picture elements in the first image and the target picture element set to obtain the second image may include: for any picture element in the first image, the computer device selects a target picture element from multiple target picture elements whose size information is similar to that of the picture element, or whose size difference does not exceed a certain threshold, to replace the picture element in the first image; specifically, the size of the target picture element can be adjusted to the size of a picture element with a similar size, and the corresponding picture element is replaced with the adjusted target picture element. Similarly, multiple target picture elements are used to replace each picture element in the first image to obtain one or more second images.

[0060] For example, there are two target picture elements in the target picture element set, namely target picture element 1 and target picture element 2; there are two picture elements in the first image, namely picture element 1 and picture element 2; if the size of target picture element 1 is similar to the size of picture element 2 in the first image, and the size of target picture element 2 is similar to the size of picture element 1 in the first image, then target picture element 1 can be used to replace picture element 2 in the first image, and target picture element 1 can be used to replace picture element 2 in the first image, and the replaced first image becomes the second image.

[0061] For another example, the computer device determines the target picture element set corresponding to the target theme "Japanese food" according to steps S101-S103. The target picture element set includes 7 target picture elements. These 7 target picture elements are similar in size to the 7 "fruit" picture elements in the first image. The 7 target picture elements can be adjusted according to the size of the 7 "fruit" picture elements, and the adjusted 7 target picture elements are placed at the positions of the corresponding 7 "fruit" picture elements to obtain a second image. The effect of placing the adjusted 7 target picture elements at the positions of the corresponding 7 "fruit" picture elements to obtain the second image is as follows: Figure 2e shown.

[0062] In one embodiment, to ensure a higher quality second image, the computer device may process the first image based on the configuration information of the picture elements in the first image and the target picture element set, and use the resulting image as an intermediate image. Furthermore, the computer device may adjust each of the at least one intermediate image based on the brightness difference between the picture elements in the first image and each target picture element, to obtain at least one second image. Adjusting each intermediate image includes adjusting the background color, font color, etc. of the intermediate image.

[0063] In one embodiment, when multiple second images are obtained, they can be scored and the second image with the highest score can be selected as the final second image. In a specific implementation, each second image can be scored manually, and then a computer device can obtain the score for each second image and output the second image with the highest score. Alternatively, each second image can be directly scored through an image quality analysis interface, and the second image with the highest score can be output.

[0064] In an embodiment of the present application, a computer device obtains a target subject and extracts target keywords corresponding to the target subject; then, a target picture element set corresponding to the target subject is obtained based on the target keywords, without the need to manually select the target picture element set corresponding to the target subject, thereby achieving automation and efficiency in picture element acquisition; further, the computer device can process the first image based on the configuration information of the picture elements in the first image and the target picture element set to obtain a second image, and can automatically replace the original image to obtain a new image that meets user needs, while also shortening the time to generate a new image.

[0065] See also Figure 3 , Figure 3 This is a flow chart of an image processing method provided by an embodiment of the present invention. The method can be executed by a computer device. The image processing method described in this embodiment includes the following steps S301-S305:

[0066] S301: Obtain target keywords corresponding to the target topic.

[0067] In one embodiment, some feasible implementations of step S301 can be found in Figure 1 The description of the relevant steps in the embodiment will not be repeated here.

[0068] S302: Search the word vector library for target associated words that match the target keyword.

[0069] In one embodiment, in order to obtain more target picture elements that match the target theme, the computer device can, after determining the target keyword corresponding to the target theme, search for target associated words that match the target keyword from the word vector library through step S302, and then obtain the target picture element set from the picture element library based on the target associated words and target keywords through step S303.

[0070] In one embodiment, the computer device may use a cosine similarity algorithm to calculate the similarity between each associated word in the word vector library and the target keyword. Specifically, the target keyword is encoded to obtain a target vector, and each associated word in at least one associated word is encoded to obtain a reference vector corresponding to the associated word; the similarity between the target vector and the reference vector corresponding to each associated word is calculated; and the associated words corresponding to the reference vectors whose similarity exceeds a similarity threshold are selected as target associated words that match the target keyword.

[0071] Among them, the similarity threshold can be set according to actual needs, and the similarity threshold can control the number of target associated words determined, and then the number of target associated words can control the number of target image elements in the determined target image element set. Specifically, the smaller the similarity threshold is set, the more target associated words are determined from the word vector library, and the more target image elements may be determined based on the target associated words and target keywords; conversely, the larger the similarity threshold is set, the fewer target associated words are determined from the word vector library, and the fewer target image elements may be determined based on the target associated words and target keywords.

[0072] For example, the target keywords are jubilant, running wildly, and natural language processing. The computer device can calculate the similarity between these three target keywords and each associated word in the word vector library, and finally select the target associated words that match these three / target keywords as shown in Table 1.

[0073] Table 1

[0074]

[0075] S303: Acquire a target picture element set corresponding to the target theme according to the target associated words and the target keywords.

[0076] In a specific implementation, the computer device can use the target associated words and target keywords to obtain the target image elements corresponding to the target theme from the image element library. The image element library can be stored locally on the computer device or obtained by the computer device from other devices. The image element library includes multiple image elements, each of which corresponds to one or more tags. Figure 4 , which is a schematic diagram of a picture element library provided by an embodiment of the present invention.

[0077] After obtaining the target image elements, since the same target image elements may be obtained based on the target associated words and the target keywords, the computer device can deduplicate the obtained target image elements and then store the deduplicated target image elements in the target image element set.

[0078] In one embodiment, the image element library may be generated by any one or more of the following methods:

[0079] (1) The image element library can be obtained by manually classifying and arranging multiple image elements, and setting labels for each image element according to the classification results of the multiple image elements. Among them, the label corresponding to each image element indicates the category to which the corresponding image element belongs. The label can also be understood as the content contained in the image element. In a specific implementation, when classifying the multiple image elements, since each of the multiple image elements can belong to a different element category, one or more labels can be manually set for each image element. For example, the content included in a picture element is salmon sushi, and salmon sushi can belong to sushi, Japanese food, and salmon. Then the picture element can be set with three labels, namely sushi, Japanese food, and salmon.

[0080] (2) In order to reduce the time required to manually label multiple image elements, machine learning can be used to label each of the multiple image elements. In a specific implementation, a large number of samples can be obtained, each of which is a picture element and a corresponding annotated label. A neural network is then pre-trained based on the large number of samples, and the image elements can then be labeled based on the trained neural network.

[0081] (3) The computer device can call the image tag interface (Application Programming Interface, API), and then obtain all labels and classifications for the image element, and perform deduplication processing on all labels of the image element to obtain the deduplication label of the image element as the label of the image element. The return result of the computer device calling the image tag interface to obtain all labels for the image element is:

[0082]

[0083] In one embodiment, after obtaining one or more tags for each image element, a confidence level can be set for each tag included in the image element. The confidence level corresponding to the tag indicates the probability that the image element belongs to the element category indicated by the tag. For example, when the computer device calls the image tag interface to obtain all tags for the image element, the returned result also includes the confidence level corresponding to each tag.

[0084] Furthermore, the specific implementation method of the computer device using the target associated words and target keywords to obtain the target picture element set corresponding to the target theme from the target picture material library is as follows: (1) The computer device obtains the picture element library, wherein the picture element library includes at least one picture element, each picture element in the at least one picture element corresponds to a label set, and the label set includes at least one label. Each label corresponds to a confidence level. The computer device matches the target associated words and target keywords with the label set corresponding to each picture element, and in at least one picture element, the picture element with a matching label in the label set is used as a candidate picture element, and the candidate picture element is stored in the candidate picture element set. It should be noted that the matching picture element is any one in the picture element library. Method (1) means that the computer device first determines a picture element, and then determines whether the label of the picture element matches at least one of the target associated words and target keywords.

[0085] (2) The computer device determines a target tag set that matches at least one of the target associated words and the target keywords; wherein the target tag set includes one or more matching tags; the image element corresponding to each matching tag in the target tag set is used as a candidate image element and stored in the candidate image element set; it should be noted that method (2) means that the computer device first finds the target tag set that matches at least one of the target associated words and the target keywords, and then determines the candidate image elements based on the matching tags.

[0086] Wherein, a matching tag refers to a tag that matches the target associated word and has a confidence greater than a first confidence threshold, or a matching tag refers to a tag that matches the target keyword and has a confidence greater than a second confidence threshold; or a matching tag refers to a tag that matches the target associated word and has a confidence greater than a first confidence threshold, and a tag that matches the target keyword and has a confidence greater than a second confidence threshold; then the computer device obtains a target image element set corresponding to the target theme from the candidate image element set. Wherein, the first confidence and the second confidence can be set as required, and the first confidence and the second confidence can be the same or different.

[0087] The specific implementation method in which the computer device can select the target picture element set corresponding to the target theme from the candidate picture element set is as follows:

[0088] (1) The computer device can directly use the candidate image element set as the target image set corresponding to the target theme.

[0089] (2) The computer device may obtain the number of labels of matching labels corresponding to each candidate picture element in the candidate picture element set. In one embodiment, the computer device selects a candidate picture element in the candidate picture element set whose number of labels of matching labels corresponding to each candidate picture element is greater than a quantity threshold as a target picture element, and determines the target picture element as a target picture element set corresponding to the target theme. In another embodiment, when there are many candidate picture elements in the candidate picture element set, the computer device may sort at least one candidate picture element in the candidate picture element set from high to low according to the number of labels of matching labels corresponding to each candidate picture element, and select the first N candidate picture elements from the sorted candidate picture element set as target picture elements, and obtain a target picture element set corresponding to the target theme based on the target picture element, where N is an integer greater than or equal to 1.

[0090] (3) The computer device may obtain a target picture element set corresponding to the target theme from the candidate picture element set based on any one or more of the number of labels and the confidence of the matching label of each candidate picture element. In a specific implementation, the computer device may compare the matching labels corresponding to each candidate picture element in the candidate picture element set. If the matching label corresponding to any candidate picture element is different from the matching labels of other candidate picture elements in the candidate picture element set, then any candidate picture element is selected as a target picture element, and any candidate picture element is deleted from the candidate picture element set to update the candidate picture element set. If the updated candidate picture element set is empty, then each of the selected target picture elements is stored in the target picture element set corresponding to the target theme, so that a picture element with relatively novelty can be selected as the target picture element.

[0091] For example, the candidate picture element set includes three candidate picture elements, namely candidate picture element 1, candidate picture element 2, and candidate picture element 3; among them, the matching labels of candidate picture element 1 are apple and pear; the matching labels of candidate picture element 2 are fruit and banana; the matching label of candidate picture element 3 is fruit; the computer device compares the matching labels of candidate picture element 1 as apple and pear with the matching labels of candidate picture element 2 as fruit and banana, and then the computer device compares the matching labels of candidate picture element 1 as apple and pear with the matching label of candidate picture element 3 as apple. The computer device can determine that the matching label of candidate picture element 1 is different from the matching labels of candidate picture element 2 and candidate picture element 3, and then takes candidate picture 1 as a target picture element, and deletes candidate picture element 1 from the candidate picture element set to update the candidate picture element set.

[0092] The computer device then compares the matching labels of candidate image element 2, fruit and banana, with the matching label of candidate image element 3, fruit. The computer device can determine that there is an overlapping label in candidate image element 2 and candidate image element 3, so the candidate image element 2 cannot be used as a target image element.

[0093] It should be noted that the above example only shows that the candidate picture element set includes three candidate picture elements. When the candidate picture element set includes multiple candidate picture elements, the computer device can compare each candidate picture element in the candidate picture element set with the remaining candidate picture elements. When the matching label of a candidate picture element is different from the matching labels of the remaining candidate picture elements, the candidate picture element is used as a target picture element, and the computer device deletes the candidate picture element from the candidate picture elements to obtain an updated candidate picture element set. The computer device then compares the matching label of each candidate picture element in the updated candidate picture element set with the matching labels of the remaining candidate picture elements in the updated candidate picture. This process continues until all candidate picture elements in the candidate picture element set have been compared, at which point the comparison of the matching labels of each candidate picture element stops.

[0094] (4) Further, after (3), when the number of target picture elements may be insufficient, or when the computer device detects that the updated candidate picture element set is not yet empty, the computer device selects a first picture element and a second picture element from the updated candidate picture element set. The first picture element and the second picture element have at least one overlapping matching tag, and determines whether the confidence of each overlapping matching tag in the at least one overlapping matching tag in the first picture element is the same as the confidence of the corresponding overlapping matching tag in the second picture element.

[0095] A. If the confidence of each overlapping matching tag in the first picture element of at least one overlapping matching tag is the same as the confidence of the corresponding overlapping matching tag in the second picture element, then the picture element with a larger number of matching tags is taken as a target picture element, and the updated candidate picture element set is updated. At this time, the updated candidate picture element set does not include the first picture element or the second picture element.

[0096] In a specific implementation, if the confidence level of each overlapping matching tag in the first image element of at least one overlapping matching tag is the same as the confidence level of the corresponding overlapping matching tag in the second image element, then it is determined whether the number of tags of the matching tags of the first image element is greater than the number of tags of the matching tags of the second image element. If the number of tags of the matching tags of the first image element is greater than the number of tags of the matching tags of the second image element, the first image element is used as the target image element and the first image is deleted from the updated candidate image element set, thereby achieving another update of the updated candidate image element set. If the number of tags of the matching tags of the first image element is less than the number of tags of the matching tags of the second image element, the second image element is used as the target image element and the second image is deleted from the updated candidate image element set, thereby achieving another update of the updated candidate image element set.

[0097] For example, in the above (3), the updated candidate picture element set is not empty, wherein candidate picture element 2 (i.e., the first picture element) and candidate picture element 3 (i.e., the second picture element) have an overlapping matching label of fruit; assuming that the confidence of the matching label of fruit in candidate picture element 2 is 85, and the confidence of the matching label of fruit in candidate picture element 3 is 85. Then the computer device can determine that the confidence of the matching label of fruit in candidate picture element 2 and candidate picture element 3 is the same, and the computer device further determines that the number of matching labels of candidate picture element 2 is 2, and the number of matching labels of candidate picture element 3 is 1. The computer device determines that the number of matching labels of candidate picture element 2 is greater than the number of matching labels of candidate picture element 3, and selects candidate picture element 2 as the target picture element, and then deletes candidate picture element 2 from the updated candidate picture element set to update the updated candidate picture element set again.

[0098] B. If, among at least one overlapping matching tag, the first confidence of any overlapping matching tag in the first picture element and the second confidence of any overlapping matching tag in the second picture element are different, the candidate picture element corresponding to the one with the larger confidence is used as the target picture element. In a specific implementation, if the first confidence is greater than the second confidence, the first picture element is used as a target picture element and is deleted from the updated candidate picture element set, thereby achieving another update of the updated candidate picture element set; if the first confidence is less than the second confidence, the second picture element is used as a target picture element and is deleted from the updated candidate picture element set, thereby achieving another update of the updated candidate picture element set, and each of the above-selected target picture elements is stored in the target picture element set corresponding to the target theme.

[0099] For example, in (3) above, candidate picture element 2 (i.e., the first picture element) and candidate picture element 3 (i.e., the second picture element) have an overlapping matching label of fruit; assuming that the first confidence level of the matching label of fruit in candidate picture element 2 is 80, and the second confidence level of the matching label of fruit in candidate picture element 3 is 85. The computer device determines that the first confidence level is less than the second confidence level, and selects candidate picture element 3 as the target picture element, and then deletes candidate picture element 3 from the updated candidate picture element set to update the updated candidate picture element set again.

[0100] (4) There may be at least one candidate picture element with overlapping matching labels in the candidate picture element set, and there may be no candidate picture elements with overlapping matching labels at all. In this case, the computer device splits the candidate picture element set into a first category candidate picture element subset and a second category candidate picture element subset; wherein, for any first candidate picture element in the first category candidate picture element subset, there is a candidate picture element in the candidate picture element set that overlaps with the matching label of any first candidate picture element, that is, it is understood here that any first candidate picture element can find a candidate picture element with a label that overlaps with the first candidate picture element in the candidate picture element set; for any second candidate picture element in the second category candidate picture element subset, there is no candidate picture element in the candidate picture element set that overlaps with the matching label of any second candidate picture element; that is, it can be understood here that any second candidate picture element cannot find a candidate picture element with at least one overlapping matching label with the second candidate picture element in the candidate picture element set. In a specific implementation, the computer device may compare the matching label of any candidate picture element in the candidate picture element set with the matching labels of the remaining candidate picture elements. When the matching label of any candidate picture element has at least one overlap with the matching label of any candidate picture element, the any candidate picture element is placed in the first category of candidate picture element subset; when the matching label of any candidate picture element is different from the matching label of any candidate picture element, the any candidate picture element is placed in the second category of candidate picture element subset.

[0101] For example, the candidate image element set includes three candidate image elements, namely candidate image element 1, candidate image element 2, and candidate image element 3. The matching labels of candidate image element 1 are apple and pear; the matching labels of candidate image element 2 are fruit and banana; and the matching label of candidate image element 3 is fruit. The computer device compares the matching label of candidate image element 1 with the matching labels of candidate image element 2 and candidate image element 3. Since the matching labels of candidate image element 1 are different from those of candidate image element 2 and candidate image element 3, candidate image element 1 is placed in the second category of candidate image element subset. The matching labels of candidate image element 2 are then compared with the matching labels of candidate image element 3. Since the matching labels of candidate image element 2 and candidate image element 3 overlap at one point, candidate image element 2 is placed in the first category of candidate image element subset.

[0102] Furthermore, the computer device obtains at least one corresponding picture element pair from the first category candidate picture element subset, wherein the two first candidate picture elements included in each picture element pair have at least one overlapping matching label;

[0103] Then, based on the label quantity and confidence of the matching label corresponding to each first candidate picture element, each picture element pair in the at least one picture element pair is screened to obtain the target candidate picture element corresponding to each picture element pair set.

[0104] In a specific implementation, the computer device performs pairwise matching on the label sets corresponding to each first candidate image element in the first category candidate image element subset, and records two first candidate image elements with at least one overlapping matching label in the label set as a picture element pair, and records the two first candidate image elements in a picture element pair as the first picture element and the second picture element, respectively. For example, the first candidate image element subset includes candidate image element 2 and candidate image element 3, and the matching labels of candidate image element 2 are fruit and banana; the matching label of candidate image element 3 is fruit; the computer device matches candidate image element 2 with candidate image element 3, and candidate image element 2 and candidate image element 3 have an overlapping matching label of fruit. The computer device records candidate image element 2 and candidate image element 3 as a picture element pair, that is, candidate image element 2 can be recorded as the first picture element, and candidate image element 3 can be recorded as the second picture element.

[0105] Then, in any pair of picture elements, determine whether the confidence of each overlapping matching tag in the first picture element of at least one overlapping matching tag is the same as the confidence of the corresponding overlapping matching tag in the second picture element; if the confidence of each overlapping matching tag in the first picture element of at least one overlapping matching tag is the same as the confidence of the corresponding overlapping matching tag in the second picture element, compare the number of tags of the matching tags of the first picture element and the number of tags of the matching tags of the second picture element, and take the picture element with the larger number of tags as the target candidate picture element of any picture element pair; if there is any overlapping matching tag in the first picture element where the first confidence of any overlapping matching tag and the second confidence of any overlapping matching tag in the second picture element are different, then take the candidate picture element corresponding to the larger of the first confidence and the second confidence as the target candidate picture element of any picture element pair.

[0106] In a specific implementation, the computer device determines, for picture element pair 1, whether the confidence levels of at least one overlapping matching label of the first picture element and the second picture element in the picture element pair 1 are the same. If the confidence levels of at least one overlapping matching label of the first picture element and the second picture element in the picture element pair 1 are the same, the number of labels of the matching labels of the first picture element and the number of labels of the matching labels of the second picture element may be further compared. If the number of labels of the matching labels of the first picture element is greater than the number of labels of the matching labels of the second picture element, the first picture element is selected as the target candidate picture element of the picture element pair 1; if the number of labels of the matching labels of the first picture element is less than the number of labels of the matching labels of the second picture element, the second picture element is selected as the target candidate picture element of the picture element pair 1.

[0107] For example, picture element pair 1 includes a first picture element and a second picture element; the matching labels of the first picture element are sushi and salmon; the matching label of the second picture element is sushi; wherein the first picture element and the second picture element have an overlapping matching label of sushi, and the confidence level of sushi is 90; at this time, the computer device compares the number of labels of the matching labels of the first picture element with the number of labels of the matching labels of the second picture element. If the number of labels of the matching labels of the first picture element, 2, is greater than the number of labels of the matching labels of the second picture element, 1, the first picture element is selected as the target candidate picture element of picture element pair 1.

[0108] If the confidence levels of at least one of the overlapping matching labels of the first and second image elements in image element pair 1 are different, the candidate image element with the higher confidence level is selected as the target candidate image element for image element pair 1. For example, image element pair 1 includes a first image element and a second image element; the matching labels of the first image element are sushi and salmon; and the matching label of the second image element is sushi; wherein the first and second image elements have one overlapping matching label, sushi, and the confidence level of sushi in the first image element is 90, while the confidence level of sushi in the second image element is 95. In this case, the confidence level of sushi in the first image element is lower than the confidence level of sushi in the second image element, and the computer device selects the second image element as the target candidate image element for image element pair 1.

[0109] It should be noted that the above-mentioned candidate picture element set includes the first picture element and the second picture element for the sake of example only. When the candidate picture element set includes at least three picture elements, it can be implemented according to the specific implementation method of the above-mentioned candidate picture element set including the first picture element and the second picture element.

[0110] Then, after obtaining the target candidate picture elements of each picture element pair, it is necessary to deduplicate the target candidate picture elements of each picture element pair, and obtain the target picture element set based on the deduplication results and the second type of candidate picture element subset, so as to ensure that there are no identical target picture elements in the entire target picture element set, that is, each target picture element is different.

[0111] S304: Acquire the first image and configuration information of the picture elements in the first image;

[0112] S305: Process the first image according to the configuration information of the picture elements in the first image and the target picture element set to obtain a second image.

[0113] The specific implementation of steps S304-S305 can refer to steps S103-S104 of the above embodiment, which will not be repeated here.

[0114] In an embodiment of the present application, the computer device can determine the target associated words that match the target keywords, and obtain a target picture element set corresponding to the target theme based on the target keywords and the target associated words, so that more picture elements corresponding to the target theme can be obtained while shortening the time for selecting picture elements. It can also select higher-quality target picture elements from more picture elements corresponding to the target theme according to needs, so as to ensure the quality of the second image obtained by processing the first image according to the configuration information of the picture elements in the first image and the target picture element set.

[0115] Based on the image processing method provided above, the present application embodiment also provides a more specific image processing solution. The specific process can be found in Figure 5 As shown. The computer device can read the picture elements in the first image, and determine the target keywords of the target theme according to the target theme input by the user, and use the word vector technology to expand the target keywords to obtain target associated words that match the target associated words. The computer device can then match the materials (corresponding to the above-mentioned target picture elements) that are consistent with the target keywords and target associated words from the pre-processed material library (corresponding to the above-mentioned picture element library); and replace the picture elements in the first image with the matched materials to obtain a second image, and output the second image. Among them, an auxiliary process can be set, and the auxiliary process refers to a pre-processed material library: the computer device can organize and classify a large amount of picture materials according to the content of the picture materials, and set labels for the picture materials, and also set confidence for the labels. For example, the label and the confidence of the label can be marked as (label, confidence); for example, a certain picture material can be marked as ((tower, 81), (night, 79)).

[0116] The above-mentioned image processing method and solution can eliminate the need for designers to repeatedly design images for different themes, significantly reducing design costs. Furthermore, automatically replacing the materials on the design drawing according to the theme effectively utilizes the materials in the library, significantly reducing the time and cost of selecting materials and increasing the reuse rate of materials. By reducing the need to switch themes on the design drawing, the efficiency of operators can also be greatly improved.

[0117] For further information, see Figure 6 , which is a structural diagram of an image processing device provided by an embodiment of the present application. Figure 6 As shown, the image processing device can be applied to the above Figure 1 or Figure 3 The computer device in the corresponding embodiment, specifically, the image processing device can be a computer program (including program code) running in the computer device, for example, the image processing device is an application software; the image processing device can be used to execute the corresponding steps in the method provided in the embodiment of the present application.

[0118] An acquisition module 601 is used to acquire target keywords corresponding to a target topic;

[0119] The acquisition module 601 is further configured to acquire a target image element set corresponding to the target theme according to the target keyword;

[0120] The acquisition module 601 is further configured to acquire the first image and configuration information of picture elements in the first image;

[0121] The processing module 602 is configured to process the first image according to the configuration information of the picture elements in the first image and the target picture element set to obtain a second image.

[0122] In one embodiment, the processing module 602 is configured to search a word vector library for a target associated word that matches the target keyword;

[0123] The acquisition module 601 is configured to acquire a target picture element set corresponding to the target theme according to the target associated word and the target keyword.

[0124] In one embodiment, the word vector library includes at least one associated word; the processing module 602 is specifically configured to:

[0125] encoding the target keyword to obtain a target vector, and encoding each of the at least one associated word to obtain a reference vector corresponding to the associated word;

[0126] Calculating the similarity between the target vector and the reference vector corresponding to each associated word;

[0127] The associated words corresponding to the reference vectors whose similarity is greater than the similarity threshold are used as target associated words that match the target keyword.

[0128] In one embodiment, the acquisition module 601 is specifically configured to:

[0129] Obtaining a picture element library; the picture element library includes at least one picture element, each picture element in the at least one picture element corresponds to a label set, each label set includes at least one label, and each label corresponds to a confidence level; any label of any picture element is used to indicate the element category to which the picture element belongs, and the confidence level corresponding to any label is used to indicate the probability that the picture element belongs to the element category indicated by the label;

[0130] Matching the target associated words and the target keywords with the tag sets corresponding to each image element;

[0131] Among the at least one picture element, taking a picture element having a matching tag in the tag set as a candidate picture element, and storing the candidate picture element in the candidate picture element set;

[0132] Acquire a target picture element set corresponding to the target theme from the candidate picture element set;

[0133] The matching tag refers to at least one of the following: a tag that matches the target associated word and has a confidence greater than a first confidence threshold; and a tag that matches the target keyword and has a confidence greater than a second confidence threshold.

[0134] In one embodiment, the acquisition module 601 is specifically configured to:

[0135] Obtain the number of matching labels corresponding to each candidate image element in the candidate image element set;

[0136] Based on any one or more of the number of tags and the confidence of the matching tags corresponding to each candidate picture element, a target picture element set corresponding to the target theme is obtained from the candidate picture element set.

[0137] In one embodiment, the acquisition module 601 is specifically configured to:

[0138] The number of labels of matching labels corresponding to each candidate image element, selecting a candidate image element in the candidate image element set whose number of labels of matching labels is greater than a quantity threshold as a target image element, and obtaining a target image element set corresponding to the target theme based on the target image element;

[0139] or

[0140] Sort at least one candidate picture element in the candidate picture element set according to the number of matching tags corresponding to each candidate picture element from high to low, select the first N candidate picture elements from the sorted candidate picture element set as target picture elements, and obtain the target picture element set corresponding to the target theme based on the target picture elements, where N is an integer greater than or equal to 1.

[0141] In one embodiment, the acquisition module 601 is specifically configured to:

[0142] Splitting the candidate picture element set into a first category candidate picture element subset and a second category candidate picture element subset; for any first candidate picture element in the first category candidate picture element subset, there exists a candidate picture element in the candidate picture element set that has a matching label that overlaps with that of any first candidate picture element; and for any second candidate picture element in the second category candidate picture element subset, there exists no candidate picture element in the candidate picture element set that has a matching label that overlaps with that of any second candidate picture element;

[0143] Obtaining at least one picture element pair corresponding to the first category candidate picture element subset, where two first candidate picture elements included in each picture element pair have at least one overlapping matching label;

[0144] Based on the number and confidence of the matching labels corresponding to each first candidate picture element, screening each picture element pair in the at least one picture element pair to obtain a target candidate picture element for each picture element pair;

[0145] Deduplication processing is performed on the target candidate picture elements of each picture element pair, and a target picture element set is obtained according to the deduplication processing result and the second type of candidate picture element subset.

[0146] In one embodiment, the processing module 602 is further configured to:

[0147] performing pairwise matching on the label sets corresponding to each first candidate picture element in the first category of candidate picture element subset, recording two first candidate picture elements having at least one overlapping matching label in the label sets as a picture element pair, and recording the two first candidate picture elements in a picture element pair as a first picture element and a second picture element, respectively;

[0148] The processing module 602 is specifically configured to: in any picture element pair, if the confidence of each of the at least one overlapping matching labels in the first picture element is the same as the confidence of the corresponding overlapping matching label in the second picture element, select the picture element with the larger number of matching labels as the target candidate picture element of the any picture element pair;

[0149] If the first confidence of any overlapping matching tag in the first picture element and the second confidence of any overlapping matching tag in the second picture element are different among the at least one overlapping matching tag, the candidate picture element corresponding to the larger of the first confidence and the second confidence is used as the target candidate picture element of any picture element pair.

[0150] In one embodiment, the number of the second image is at least one, and the configuration information of the picture element in the first image includes the layer where the picture element in the first image is located, and the size information and position information of the picture element in the first image in the layer; the processing module 602 is specifically configured to:

[0151] Adjusting the size of each target picture element in the target picture element set to the size indicated by the size information;

[0152] Each adjusted target image element is placed at the position indicated by the position information to obtain at least one second image.

[0153] In one embodiment, the processing module 602 is specifically configured to:

[0154] placing any adjusted target image element at the position indicated by the position information to obtain at least one intermediate image;

[0155] Each of the at least one intermediate image is adjusted according to the brightness difference between the picture element in the first image and each of the target picture elements to obtain at least one second image.

[0156] It is understandable that the functions of the functional modules of the image processing device of this embodiment can be specifically implemented according to the method in the above method embodiment, and the specific implementation process can refer to the above method embodiment. Figure 1 or Figure 3 The relevant description will not be repeated here.

[0157] Further, see Figure 7 , Figure 7 This is a schematic diagram of the structure of a computer device provided in an embodiment of the present application. Figure 1 or Figure 3The computer device in the corresponding embodiment can be Figure 7 The computer equipment shown. Figure 7 As shown, the computer device may include: a processor 701, an input device 702, an output device 703, and a memory 704. The processor 701, input device 702, output device 703, and memory 704 are connected via a bus 705. The memory 704 is used to store a computer program, which includes program instructions. The processor 701 is used to execute the program instructions stored in the memory 704.

[0158] In the embodiment of the present application, the processor 701 performs the following operations by running the executable program code in the memory 704:

[0159] Get the target keywords corresponding to the target topic;

[0160] Acquire a target picture element set corresponding to the target theme according to the target keyword;

[0161] Obtaining a first image and configuration information of picture elements in the first image;

[0162] The first image is processed according to the configuration information of the picture elements in the first image and the target picture element set to obtain a second image.

[0163] In one embodiment, the processor 701 is specifically configured to:

[0164] Searching for a target associated word that matches the target keyword from a word vector library;

[0165] A target picture element set corresponding to the target theme is obtained according to the target associated word and the target keyword.

[0166] In one embodiment, the word vector library includes at least one associated word; the processor 701 is specifically configured to:

[0167] encoding the target keyword to obtain a target vector, and encoding each of the at least one associated word to obtain a reference vector corresponding to the associated word;

[0168] Calculating the similarity between the target vector and the reference vector corresponding to each associated word;

[0169] The associated words corresponding to the reference vectors whose similarity is greater than the similarity threshold are used as target associated words that match the target keyword.

[0170] In one embodiment, the processor 701 is specifically configured to:

[0171] Obtaining a picture element library; the picture element library includes at least one picture element, each picture element in the at least one picture element corresponds to a label set, each label set includes at least one label, and each label corresponds to a confidence level; any label of any picture element is used to indicate the element category to which the picture element belongs, and the confidence level corresponding to any label is used to indicate the probability that the picture element belongs to the element category indicated by the label;

[0172] Matching the target associated words and the target keywords with the tag sets corresponding to each image element;

[0173] Among the at least one picture element, taking a picture element having a matching tag in the tag set as a candidate picture element, and storing the candidate picture element in the candidate picture element set;

[0174] Acquire a target picture element set corresponding to the target theme from the candidate picture element set;

[0175] The matching tag refers to at least one of the following: a tag that matches the target associated word and has a confidence greater than a first confidence threshold; and a tag that matches the target keyword and has a confidence greater than a second confidence threshold.

[0176] In one embodiment, the processor 701 is specifically configured to:

[0177] Obtain the number of matching labels corresponding to each candidate image element in the candidate image element set;

[0178] Based on any one or more of the number of tags and the confidence of the matching tags corresponding to each candidate picture element, a target picture element set corresponding to the target theme is obtained from the candidate picture element set.

[0179] In one embodiment, the processor 701 is specifically configured to:

[0180] According to the number of matching tags corresponding to each candidate image element, select the candidate image elements in the candidate image element set whose number of matching tags is greater than the number threshold as target image elements, and obtain the target image element set corresponding to the target theme based on the target image elements;

[0181] or

[0182] Sort at least one candidate picture element in the candidate picture element set according to the number of matching tags corresponding to each candidate picture element from high to low, select the first N candidate picture elements from the sorted candidate picture element set as target picture elements, and obtain the target picture element set corresponding to the target theme based on the target picture elements, where N is an integer greater than or equal to 1.

[0183] In one embodiment, the processor 701 is specifically configured to:

[0184] Splitting the candidate picture element set into a first category candidate picture element subset and a second category candidate picture element subset; for any first candidate picture element in the first category candidate picture element subset, there exists a candidate picture element in the candidate picture element set that has a matching label that overlaps with that of any first candidate picture element; and for any second candidate picture element in the second category candidate picture element subset, there exists no candidate picture element in the candidate picture element set that has a matching label that overlaps with that of any second candidate picture element;

[0185] Obtaining at least one picture element pair corresponding to the first category candidate picture element subset, where two first candidate picture elements included in each picture element pair have at least one overlapping matching label;

[0186] Based on the number and confidence of the matching labels corresponding to each first candidate picture element, screening each picture element pair in the at least one picture element pair to obtain a target candidate picture element for each picture element pair;

[0187] Deduplication processing is performed on the target candidate picture elements of each picture element pair, and a target picture element set is obtained according to the deduplication processing result and the second type of candidate picture element subset.

[0188] In one embodiment, the processor 701 is specifically configured to:

[0189] performing pairwise matching on the label sets corresponding to each first candidate picture element in the first category of candidate picture element subset, recording two first candidate picture elements having at least one overlapping matching label in the label sets as a picture element pair, and recording the two first candidate picture elements in a picture element pair as a first picture element and a second picture element, respectively;

[0190] In any picture element pair, if the confidence of each of the at least one overlapping matching labels in the first picture element is the same as the confidence of the corresponding overlapping matching label in the second picture element, then the picture element with the larger number of matching labels is selected as the target candidate picture element of the any picture element pair;

[0191] If the first confidence of any overlapping matching tag in the first picture element and the second confidence of any overlapping matching tag in the second picture element are different among the at least one overlapping matching tag, the candidate picture element corresponding to the larger of the first confidence and the second confidence is used as the target candidate picture element of any picture element pair; otherwise, the second picture element is used as the target candidate picture element of any picture element pair.

[0192] In one embodiment, the number of the second image is at least one, and the configuration information of the picture element in the first image includes the layer where the picture element in the first image is located, and size information and position information of the picture element in the first image in the layer; the processor 701 is specifically configured to:

[0193] Adjusting the size of each target picture element in the target picture element set to the size indicated by the size information;

[0194] Each adjusted target image element is placed at the position indicated by the position information to obtain at least one second image.

[0195] In one embodiment, the processor 701 is specifically configured to:

[0196] placing any adjusted target image element at the position indicated by the position information to obtain at least one intermediate image;

[0197] Each of the at least one intermediate image is adjusted according to the brightness difference between the picture element in the first image and each of the target picture elements to obtain at least one second image.

[0198] It should be understood that in the embodiment of the present application, the processor 701 may be a central processing unit (CPU), and the processor 701 may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.

[0199] The memory 704 may include a read-only memory and a random access memory, and provides instructions and data to the processor 701. A portion of the memory 704 may also include a nonvolatile random access memory.

[0200] The input device 702 may include a keyboard, etc., and input target keywords or target topics to the processor 701; the output device 703 may include a display, etc.

[0201] In a specific implementation, the processor 701, input device 702, output device 703 and memory 704 described in the embodiments of the present application can execute the implementation methods described in all the above embodiments, and can also execute the implementation methods described in the above apparatus, which will not be repeated here.

[0202] In an embodiment of the present application, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program. The computer program includes program instructions. When the program instructions are executed by a processor, the steps performed in all the above embodiments can be executed.

[0203] An embodiment of the present application also provides a computer program product or a computer program, which includes computer instructions stored in a computer-readable storage medium. When the computer instructions are executed by a processor of a computer device, the methods in all the above embodiments are executed.

[0204] Those skilled in the art will appreciate that all or part of the processes in the above-described method embodiments can be implemented by instructing related hardware through a computer program. The program can be stored in a computer-readable storage medium, and when executed, the program can include the processes in the above-described method embodiments. The storage medium can be a magnetic disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).

[0205] The above disclosure is only a preferred embodiment of the present invention, and certainly cannot be used to limit the scope of the rights of the present invention. Ordinary technicians in this field can understand that all or part of the processes of the above embodiment and equivalent changes made in accordance with the claims of the present invention are still within the scope of the invention.

Claims

1. An image processing method, characterized in that: include: Get the target keywords corresponding to the target topic; Searching for a target associated word that matches the target keyword from a word vector library; Obtaining a picture element library; the picture element library includes at least one picture element, each picture element in the at least one picture element corresponds to a label set, each label set includes at least one label, and each label corresponds to a confidence level; any label of any picture element is used to indicate the element category to which the picture element belongs, and the confidence level corresponding to any label is used to indicate the probability that the picture element belongs to the element category indicated by the label; Matching the target associated word and the target keyword with the tag set corresponding to each image element, respectively; selecting, among the at least one image element, an image element having a matching tag in the tag set as a candidate image element, and storing the candidate image element in the candidate image element set; the matching tag is at least one of the following: a tag that matches the target associated word and has a confidence level greater than a first confidence threshold; and a tag that matches the target keyword and has a confidence level greater than a second confidence level; Obtain the number of matching labels corresponding to each candidate image element in the candidate image element set; Based on any one or more of the number of tags and the confidence of the matching tags corresponding to each candidate image element, obtaining a target image element set corresponding to the target theme from the candidate image element set; Obtaining a first image and configuration information of picture elements in the first image; Processing the first image according to the configuration information of the picture elements in the first image and the target picture element set to obtain a second image; The acquiring, from the set of candidate picture elements, a set of target picture elements corresponding to the target subject based on any one or more of the number of tags and the confidence of the matching tags corresponding to each candidate picture element, includes: Splitting the candidate picture element set into a first category candidate picture element subset and a second category candidate picture element subset; for any first candidate picture element in the first category candidate picture element subset, there exists a candidate picture element in the candidate picture element set that has a matching label that overlaps with that of any first candidate picture element; and for any second candidate picture element in the second category candidate picture element subset, there exists no candidate picture element in the candidate picture element set that has a matching label that overlaps with that of any second candidate picture element; Obtaining at least one picture element pair corresponding to the first category candidate picture element subset, where two first candidate picture elements included in each picture element pair have at least one overlapping matching label; performing screening processing on each picture element pair in the at least one picture element pair based on the number and confidence of the matching labels corresponding to each first candidate picture element to obtain a target candidate picture element for each picture element pair; Deduplication processing is performed on the target candidate picture elements of each picture element pair, and a target picture element set is obtained according to the deduplication processing result and the second type of candidate picture element subset.

2. The method according to claim 1, characterized in that The acquiring, from the set of candidate picture elements, a set of target picture elements corresponding to the target subject based on any one or more of the number of tags and the confidence of the matching tags corresponding to each candidate picture element, comprises: According to the number of matching tags corresponding to each candidate picture element, select the candidate picture elements in the candidate picture element set whose number of matching tags is greater than the number threshold as target picture elements, and obtain the target picture element set corresponding to the target theme based on the target picture elements; or Sort at least one candidate picture element in the candidate picture element set according to the number of matching tags corresponding to each candidate picture element from high to low, select the first N candidate picture elements from the sorted candidate picture element set as target picture elements, and obtain the target picture element set corresponding to the target theme based on the target picture elements, where N is an integer greater than or equal to 1.

3. The method according to claim 1, characterized in that The method further comprises: performing pairwise matching on the label sets corresponding to each first candidate picture element in the first category of candidate picture element subset, recording two first candidate picture elements having at least one overlapping matching label in the label sets as a picture element pair, and recording the two first candidate picture elements in a picture element pair as a first picture element and a second picture element, respectively; The step of screening the picture element pairs corresponding to each first candidate picture element based on the number of labels and confidence levels of the matching labels corresponding to each first candidate picture element to obtain a target candidate picture element for each picture element pair includes: In any picture element pair, if the confidence of each of the at least one overlapping matching labels in the first picture element is the same as the confidence of the corresponding overlapping matching label in the second picture element, then the picture element with the larger number of matching labels is selected as the target candidate picture element of the any picture element pair; If the first confidence of any overlapping matching tag in the first picture element and the second confidence of any overlapping matching tag in the second picture element are different among the at least one overlapping matching tag, the candidate picture element corresponding to the larger of the first confidence and the second confidence is used as the target candidate picture element of any picture element pair.

4. The method according to claim 1, wherein The number of the second image is at least one, and the configuration information of the picture element in the first image includes the layer where the picture element in the first image is located, and size information and position information of the picture element in the first image in the layer; The processing of the first image according to the configuration information of the picture elements in the first image and the target picture element set to obtain the second image includes: Adjusting the size of each target picture element in the target picture element set to the size indicated by the size information; Each adjusted target image element is placed at the position indicated by the position information to obtain at least one second image.

5. The method according to claim 4, characterized in that Placing each adjusted target image element at the position indicated by the position information to obtain at least one second image includes: placing any adjusted target image element at the position indicated by the position information to obtain at least one intermediate image; Each of the at least one intermediate image is adjusted according to the brightness difference between the picture element in the first image and each of the target picture elements to obtain at least one second image.

6. An image processing device, characterized in that include: An acquisition module is used to obtain target keywords corresponding to the target topic; A processing module, configured to search a word vector library for a target associated word that matches the target keyword; The acquisition module is further configured to acquire a picture element library; the picture element library includes at least one picture element, each picture element in the at least one picture element corresponds to a label set, each label set includes at least one label, and each label corresponds to a confidence level; any label of any picture element is used to indicate the element category to which the picture element belongs, and the confidence level corresponding to any label is used to indicate the probability that the picture element belongs to the element category indicated by the label; Matching the target associated word and the target keyword with the tag set corresponding to each image element, respectively; selecting, among the at least one image element, an image element having a matching tag in the tag set as a candidate image element, and storing the candidate image element in the candidate image element set; the matching tag is at least one of the following: a tag that matches the target associated word and has a confidence level greater than a first confidence threshold; and a tag that matches the target keyword and has a confidence level greater than a second confidence level; obtaining the number of matching tags corresponding to each candidate image element in the candidate image element set; Based on any one or more of the number of tags and the confidence of the matching tags corresponding to each candidate image element, obtaining a target image element set corresponding to the target theme from the candidate image element set; The acquisition module is further configured to acquire the first image and configuration information of picture elements in the first image; The processing module is further configured to process the first image according to the configuration information of the picture elements in the first image and the target picture element set to obtain a second image; The acquisition module is specifically configured to: Splitting the candidate picture element set into a first category candidate picture element subset and a second category candidate picture element subset; for any first candidate picture element in the first category candidate picture element subset, there exists a candidate picture element in the candidate picture element set that has a matching label that overlaps with that of any first candidate picture element; and for any second candidate picture element in the second category candidate picture element subset, there exists no candidate picture element in the candidate picture element set that has a matching label that overlaps with that of any second candidate picture element; Obtaining at least one picture element pair corresponding to the first category candidate picture element subset, where two first candidate picture elements included in each picture element pair have at least one overlapping matching label; performing screening processing on each picture element pair in the at least one picture element pair based on the number and confidence of the matching labels corresponding to each first candidate picture element to obtain a target candidate picture element for each picture element pair; Deduplication processing is performed on the target candidate picture elements of each picture element pair, and a target picture element set is obtained according to the deduplication processing result and the second type of candidate picture element subset.

7. A computer device, characterized in that: The method comprises a processor and a memory, wherein the processor and the memory are connected to each other, wherein the memory is used to store a computer program, the computer program includes program instructions, and the processor is configured to call the program instructions to execute the method according to any one of claims 1 to 5.

8. A computer storage medium, characterized in that The computer storage medium stores a computer program, which includes program instructions. When the program instructions are executed by a processor, the method according to any one of claims 1 to 5 is executed.

9. A computer program product, characterized in that The computer program product comprises a computer program or computer instructions, and when the computer program or computer instructions are executed by a processor, the computer program or computer instructions are used to implement the method according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Picture generation method and system, electronic equipment and storage medium

    CN110750666A

  • Picture label generation method and device, computer equipment and storage medium

    CN111027622A