An image generation method, device, computer equipment and storage medium
By acquiring the pixel feature differences of the target background image, a thermal image of the target identifier is generated, which solves the problems of high cost and low efficiency of manual design, realizes automated image generation, and improves production efficiency.
Patent Information
- Application Number
- CN202210780244.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-04
- Publication Date
- 2026-01-02
- Estimated Expiration
- 2042-07-04
AI Technical Summary
Existing technologies for creating directional images involve manually designing indicator icons and background images, which are costly and inefficient, and are not suitable for mass production.
By acquiring the target background image, determining the thermal image of the technical differences between its pixels, automatically adding the matching position for the target identifier, generating the target image, generating the target identifier, and generating the target image.
It improves the production efficiency of image generation, realizes automated marker location matching, and generates target images with marker indication function.
Smart Images

Figure CN115147509B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present disclosure relates to the technical field of computer, and in particular, to an image generation method and device, a computer device and a storage medium. BACKGROUND
[0002] In content promotion recommendation such as application recommendation and multimedia content recommendation, an indicative page is usually used to identify and recommend an object to be recommended, so as to instruct a user to perform an operation such as downloading, viewing details, and the like. An indicative page such as an activity or an explanation usually consists of an indication icon and a background image. In the production of such an indicative image, in order to ensure the beauty of the image and strengthen the identification of the indication icon, the style and placement position of the indication icon and the background image usually need to be designed manually. However, the manual design method requires a large amount of manpower, has high cost and low efficiency, and is not suitable for mass production of images. SUMMARY
[0003] The present disclosure provides at least an image generation method and device, a computer device and a storage medium.
[0004] In a first aspect, the present disclosure provides an image generation method, comprising:
[0005] In response to an image generation request, a target background image and a target identifier that can be triggered are obtained.
[0006] A heat map image used to represent feature differences between pixel points of the target background image is determined, and a target placement region in the target background image is determined based on the heat map image.
[0007] The target identifier is added to the target placement region of the target background image to generate a target image, wherein the target identifier is used to perform a preset interactive operation after being triggered in the display process of the target image.
[0008] In a possible implementation, the determination of the heat map image used to represent the feature differences between the pixel points of the target background image comprises:
[0009] Features of the target background image are extracted based on a pre-trained neural network to obtain a feature map corresponding to the target background image.
[0010] The feature values of the feature map are mapped based on a preset mapping method to obtain the heat map image.
[0011] In a possible implementation, the determination of the target placement region in the target background image based on the heat map image comprises:
[0012] determining a mean value and a standard deviation of pixel color values of the thermal image;
[0013] determining a pixel color value interval based on the mean value and the standard deviation;
[0014] determining a non-placement region in the thermal image based on a pixel color value in the thermal image being outside the pixel color value interval;
[0015] determining a target placement region in the target background image based on the non-placement region.
[0016] In a possible implementation, the method further includes:
[0017] determining position information of a target object in the target background image based on a pre-trained target detection model;
[0018] determining a non-placement region in the target background image based on the position information of the target object;
[0019] determining a target placement region in the target background image based on the non-placement region.
[0020] In a possible implementation, the determining the target placement region in the target background image based on the non-placement region includes:
[0021] determining at least one icon placement region in the target background image except the non-placement region;
[0022] determining the target placement region based on attribute information of the at least one icon placement region.
[0023] In a possible implementation, the adding the target identification in the target placement region of the target background image includes:
[0024] determining display feature information of the target identification based on size information of the target placement region;
[0025] adding the target identification in the target placement region of the target background image according to the display feature information.
[0026] In a possible implementation, the obtaining the target background image includes:
[0027] obtaining a historical background image to be screened;
[0028] screening the target background image based on historical feature information of the historical background image.
[0029] In a possible implementation, the obtaining the target background image includes:
[0030] obtain an unused image to be screened;
[0031] predict feature information of the unused image based on a pre-trained effect estimation model;
[0032] screen the target background image based on the feature information of the unused image.
[0033] In a second aspect, the embodiments of the present disclosure further provide an image generation apparatus, comprising:
[0034] an obtaining module configured to obtain a target background image and a target identifier that can be triggered in response to an image generation request;
[0035] a determining module configured to determine a heat map image for representing feature difference between each pixel point of the target background image, and determine a target placement area in the target background image based on the heat map image;
[0036] a generating module configured to add the target identifier to the target placement area of the target background image to generate a target image, wherein the target identifier is configured to perform a preset interactive operation after being triggered in a display process of the target image.
[0037] In a possible implementation, when determining the heat map image for representing the feature difference between each pixel point of the target background image, the determining module is configured to:
[0038] extract features of the target background image based on a pre-trained neural network to obtain a feature map corresponding to the target background image;
[0039] perform mapping processing on feature values of the feature map based on a preset mapping method to obtain the heat map image.
[0040] In a possible implementation, when determining the target placement area in the target background image based on the heat map image, the determining module is configured to:
[0041] determine an average value and a standard deviation of pixel color values of the heat map image;
[0042] determine a pixel color value interval based on the average value and the standard deviation;
[0043] determine a non-placement area in the heat map image in which pixel color values are located outside the pixel color value interval;
[0044] determine the target placement area in the target background image based on the non-placement area.
[0045] In a possible implementation, the determining module is further configured to:
[0046] determine position information of the target object in the target background image based on a pre-trained target detection model;
[0047] determine a non-placement region in the target background image based on the position information of the target object;
[0048] determine a target placement region in the target background image based on the non-placement region.
[0049] In a possible implementation, when determining the target placement region in the target background image based on the non-placement region, the determining module is configured to:
[0050] determine at least one icon placement region in the target background image except the non-placement region;
[0051] determine the target placement region based on attribute information of the at least one icon placement region.
[0052] In a possible implementation, when adding the target identifier to the target placement region of the target background image, the generating module is configured to:
[0053] determine display feature information of the target identifier based on size information of the target placement region;
[0054] add the target identifier to the target placement region of the target background image according to the display feature information.
[0055] In a possible implementation, when obtaining a target background image, the obtaining module is configured to:
[0056] obtain a historical background image to be screened;
[0057] screen the target background image based on historical feature information of the historical background image.
[0058] In a possible implementation, when obtaining a target background image, the obtaining module is configured to:
[0059] obtain an unused image to be screened;
[0060] predict feature information of the unused image based on a pre-trained effect prediction model;
[0061] screen the target background image based on the feature information of the unused image.
[0062] In a third aspect, the embodiments of the present disclosure further provide a computer device, comprising a processor, a memory and a bus, the memory stores machine readable instructions executable by the processor, when the computer device is running, the processor and the memory communicate through the bus, and the machine readable instructions are executed by the processor to perform the steps of the first aspect or any possible implementation manner of the first aspect.
[0063] In a fourth aspect, the embodiments of the present disclosure further provide a computer readable storage medium, the computer readable storage medium stores a computer program, when the computer program is run by a processor, the steps of the first aspect or any possible implementation manner of the first aspect are performed.
[0064] The image generation method, device, computer device and storage medium provided by the embodiments of the present disclosure can respond to an image generation request, obtain a target background image and a target identifier that can be triggered, then determine a heat map image for representing feature differences between each pixel point of the target background image, determine a target placement area in the target background image based on the heat map image, and finally add the target identifier to the target placement area to generate a target image. In this way, the target identifier can be automatically matched with an appropriate addition position in combination with the feature differences between each pixel point, so that a target image with an identifier indicating function can be automatically generated, and the production efficiency is improved.
[0065] In order to make the above objectives, features and advantages of the present disclosure more apparent, clear and easy to understand, the following will specifically describe the preferred embodiments with reference to the accompanying drawings. BRIEF DESCRIPTION OF DRAWINGS
[0066] In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure, the following will briefly introduce the drawings needed to be used in the embodiments, the drawings herein are incorporated into the description and form a part of the description, which show the embodiments consistent with the present disclosure, and are used to explain the technical solutions of the present disclosure together with the description. It should be understood that the following drawings only show some embodiments of the present disclosure, and therefore should not be considered as a limitation to the scope, and for those skilled in the art, other related drawings can also be obtained without creative labor.
[0067] Figure 1 A flow chart of an image generation method provided by the embodiments of the present disclosure is shown;
[0068] Figure 2 A schematic diagram of a heat map image provided by the embodiments of the present disclosure is shown;
[0069] Figure 3A flow chart of a method for determining a target placement area is shown.
[0070] Figure 4a A schematic diagram of a first area and a second area is shown.
[0071] Figure 4b A schematic diagram of a target placement area is shown.
[0072] Figure 5 An architectural schematic diagram of an image generation device is shown.
[0073] Figure 6 A structural schematic diagram of a computer device is shown. DETAILED DESCRIPTION
[0074] To make the objectives, technical solutions and advantages of the embodiments of the present disclosure clearer, the following will be combined with the accompanying drawings for the embodiments of the present disclosure to make a clear and complete description of the technical solutions in the embodiments of the present disclosure. Obviously, the described embodiments are only a part of the embodiments of the present disclosure, rather than all the embodiments. The components of the embodiments of the present disclosure described and shown in the accompanying drawings can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present disclosure provided in the accompanying drawings is not intended to limit the scope of the claimed present disclosure, but only represents selected embodiments of the present disclosure. Based on the embodiments of the present disclosure, all other embodiments obtained by those skilled in the art without creative work belong to the scope of protection of the present disclosure.
[0075] In content promotion recommendation such as application recommendation, multimedia content recommendation, etc., an indicative page is usually used to identify and recommend the object to be recommended, to instruct the user to perform operations such as downloading, viewing details, etc. The indicative page such as an activity, an explanation, etc. is usually composed of an indication icon and a background image. In making such an indicative image, in order to ensure the beauty of the image and to strengthen the identification of the indication icon, the style and placement position of the indication icon and the background image usually need to be designed manually. However, the manual design method needs a large amount of manpower, has high cost and low efficiency, and is not suitable for mass production of images.
[0076] Based on the above research, the present disclosure provides an image generation method, device, computer equipment and storage medium, which can respond to an image generation request, obtain a target background image and a triggerable target identifier, then determine a heat map image for representing feature differences between each pixel point of the target background image, determine a target placement area in the target background image based on the heat map image, and finally add the target identifier to the target placement area to generate a target image. By using this method, the feature differences between each pixel point can be combined, and the target identifier can be automatically matched with an appropriate addition position, so that a target image with an identifier indicating function can be automatically generated, and the production efficiency is improved.
[0077] The defects of the above solutions are the results of the inventors after practice and careful research, therefore, the discovery process of the above problems and the solutions proposed by the present disclosure to solve the above problems in the following should be the contributions of the inventors to the present disclosure in the process of the present disclosure.
[0078] It should be noted that: similar reference numerals and letters represent similar items in the following drawings, therefore, once an item is defined in one drawing, it does not need to be further defined and explained in the subsequent drawings.
[0079] In order to facilitate the understanding of the present embodiment, first, a kind of image generation method disclosed by the present embodiment is introduced in detail, the execution subject of the image generation method provided by the present embodiment is generally a computer equipment with certain computing power, which includes, for example: user end or server, the user end can include, for example: smart phone, tablet computer, personal computer and the like. In some possible implementation ways, the image generation method can be realized by the way that processor calls computer readable instructions stored in memory.
[0080] Referring to Figure 1 The flow chart of the image generation method provided by the present embodiment is shown, and the method includes steps 101-103, wherein:
[0081] Step 101, in response to an image generation request, obtaining a target background image and a triggerable target identifier;
[0082] Step 102, determining a heat map image for representing feature differences between each pixel point of the target background image, and determining a target placement area in the target background image based on the heat map image;
[0083] Step 103, adding the target identifier to the target placement area of the target background image to generate a target image; wherein the target identifier is used to execute a preset interactive operation after being triggered in the display process of the target image.
[0084] The following describes the above steps with the server as the execution subject:
[0085] For step 101,
[0086] Specifically, the image generation request can be generated by the user end and sent to the server. For example, when generating the image generation request, the user end can display an image generation identifier, and after responding to the user's trigger operation on the image generation identifier, the image generation request can be generated. Then, after responding to the image generation request, the server can obtain the target background image and the triggerable target identifier.
[0087] The target identifier can be an icon for identifying user triggering. For example, the target identifier can be a button marked with "click to download", or an identifier marked with the word "slide" and a directional arrow. The trigger operation on the target identifier includes but is not limited to single click, double click, slide, and drag.
[0088] In a possible implementation, the image generation request carries a target category; when obtaining the target background image and the triggerable target identifier, the target category can be obtained.
[0089] The target category can be, for example, a game category, a food category, or a dance category. In a possible implementation, the target category can be selected on the user end. For example, before generating the image generation request, the user end can display multiple target categories, and when any target category is triggered, an image generation request carrying the target category can be generated.
[0090] Specifically, the background image and the instruction icon are classified into multiple target categories. After receiving the target category, the server can initiate a search based on the target category to obtain the target background image and the triggerable target identifier under the target category; or the target background image and the instruction icon can be stored in the target category, and the server can obtain the target background image and the triggerable target identifier from the storage area corresponding to the target category.
[0091] In a possible implementation, the server can store historical background images, unused images, historical feature information of the historical background images, and feature information of the unused images, where the feature information (including the historical feature information) includes at least one of the following: click rate, conversion rate, browsing times, download times, number of publications, and click times.
[0092] The historical background image is used to represent a background image that has been provided to a user for use, and the unused image is used to represent an image that has not been provided to a user for use after production. The unused image can be an image produced automatically by a machine or an image designed manually.
[0093] The publishing quantity is used to represent the number of target images generated and published based on a certain image, the click times are used to represent the number of times the target image is triggered, the browsing times are used to represent the number of times the target image is browsed, and the download times are used to represent the number of times the target content (such as audio and video works, games, software, etc.) corresponding to the target image is downloaded.
[0094] The click rate is used to represent the ratio of the click times to the publishing times or the browsing times, and the conversion rate is used to represent the ratio of the download times to the publishing times or the browsing times.
[0095] Specifically, the server can count and store the historical feature information of the historical background image based on the historical behavior data of the user (the historical behavior is exemplarily publishing a target image generated based on the historical background image and downloading the target content corresponding to the target image). For example, if a target image generated based on an image A is published, the publishing times of the image A are recorded as 1.
[0096] Here, the feature information of the unused image can be predicted information, and the prediction method is described below.
[0097] In a possible implementation, when the target background image is acquired, the historical background image to be screened can be acquired first, and then the target background image is screened based on the historical feature information of the historical background image.
[0098] Specifically, when the target background image is screened, the historical background image whose historical feature information meets a first preset condition can be screened. Exemplarily, the first preset condition can be that the historical feature information (such as the click rate) is greater than a first preset value within a first preset time period (such as one month).
[0099] In a possible implementation, when the target background image is acquired, the unused image to be screened can be acquired first, then the feature information of the unused image is predicted based on a pre-trained effect estimation model, and finally the target background image is screened based on the feature information of the unused image.
[0100] Specifically, the effect estimation model is trained by the following method: inputting a first training image carrying first annotation information into the effect estimation model to be trained, the effect estimation model can output a feature information prediction value, calculating a first loss value based on the first annotation information and the feature information prediction value, and adjusting the parameters of the effect estimation model based on the first loss value. The target object is exemplarily a table, an apple, etc., and the target object can include the target identifier.
[0101] In predicting the feature information of the unused image, the unused image can be input into the effect estimation model, and the effect estimation model can output the feature information of the unused image. Then, in screening the unused image, the unused image whose feature information meets a second preset condition can be screened. Exemplarily, the second preset condition can be that the feature information (such as the number of clicks) is greater than a second preset value within a second preset time period (such as one week).
[0102] Here, in simultaneously acquiring the target background image from the historical background image and the unused image, the first preset condition and the second preset condition can be the same.
[0103] In a possible application scenario, if a color complex target identifier is placed on a color complex target background image, the user can hardly notice the target identifier. If a color simple target identifier is placed on a color simple target background image, the generated target image is too simple and not beautiful. Therefore, in order to solve this problem, target identifiers with different color complexity degrees can be matched for color complex and color simple target background images.
[0104] In a possible implementation, in acquiring the target background image and the triggerable target identifier, the target background image can be acquired first, and the pixel color value of the target background image is identified. When the pixel color value of the target background image meets a third preset condition, a target identifier is screened from a general indication icon. When the pixel color value of the target background image does not meet the third preset condition, the target identifier is screened from a special indication icon. Exemplarily, the third preset condition can be that the number of color categories of the pixel color value is greater than a preset number. Exemplarily, the general indication icon can be an icon with simple color and simple style. Exemplarily, the special indication icon can be an icon with complex color and complex style.
[0105] By using the method, a simple and clear icon can be matched with a complex target background image, which prevents the user from ignoring the target mark to some extent, enables the user to quickly find the target mark in the target background image, and enables a simple target background image to be matched with a more complex and beautiful icon, thereby improving the ornamental value of the image and providing a better visual experience for the user.
[0106] In a possible implementation, after obtaining the at least one target mark and the at least one target background image, each target mark and each target background image can be arranged and combined to obtain a plurality of groups of target background images and target marks, and then the implementation of steps 102-103 is performed for each group of target background images and target marks.
[0107] For step 102,
[0108] Specifically, the thermal image is exemplarily as Figure 2 Since the thermal image can represent the feature difference between the pixel points of the target background image, the region with smaller color difference can be determined as the target placement region according to the thermal image, so that the target mark is more eye-catching and beautiful after placement. The following (step one-step two) is a specific implementation method:
[0109] Step one, extracting features of the target background image based on a pre-trained neural network to obtain a feature map corresponding to the target background image.
[0110] The pre-trained neural network can be a pre-trained target judgment model or a pre-trained click rate estimation model. Here, the target judgment model and the click rate estimation model are introduced respectively.
[0111] For the target judgment model:
[0112] Specifically, the target judgment model is used to judge whether an input image is an indicative image (such as an image indicating a downloaded icon or an image indicating a slidable icon) with a mark function. The target judgment model can be a binary classification model with a ResNet structure and a multi-layer convolution. Each layer of convolution of the target judgment model can output a deeper feature according to the input feature, so that the feature map output by any convolution layer (such as the penultimate convolution layer) in the multi-layer convolution can be used as the feature map corresponding to the target background image.
[0113] In the training of the target judgment model to be trained, the second training image marked with the second annotation information can be input into the target judgment model, the second annotation information is used to indicate whether the second training image is an indicative image, the second training image can exemplarily include machine production or artificial design indicative image, and other images except the indicative image, and then a second loss value is calculated based on the prediction result output by the target judgment model and the second annotation information, in the calculation of the second loss value, the cross entropy loss function can be exemplarily used, and finally the parameters of the target judgment model are adjusted based on the second loss value.
[0114] In a possible implementation, the initial second training image can be subjected to data enhancement processing, the second training image subjected to data enhancement processing is added to the initial second training image to obtain an updated second training image, and then the target judgment model is trained based on the updated second training image. Exemplarily, the data enhancement processing can be up-down flipping and left-right flipping of the second training image. In this way, the number of samples (samples are the second training images) can be increased, and the training effect of the target judgment model can be improved.
[0115] For the click rate estimation model:
[0116] Specifically, the click rate estimation model is used to estimate the click rate of an input image, the click rate estimation model can be the same model as the effect estimation model, and the click rate estimation model can be a target recognition model with a structure of ResNet and multiple layers of convolution. Each layer of convolution of the click rate estimation model can output more deep features according to input features, and therefore, the feature map output by any convolution layer (such as the penultimate convolution layer) in the multiple layers of convolution can be used as the feature map corresponding to the target background image.
[0117] In the training of the click rate estimation model to be trained, the third training image marked with the third annotation information can be input into the click rate estimation model to be trained, the third training image is a machine production or artificial design indicative image, and the third annotation information can include the click rate of the third training image. Then, a third loss value is calculated based on the prediction result of the click rate estimation model and the third annotation information, and in the calculation of the third loss value, the mean square loss function can be exemplarily used. Finally, the parameters of the click rate estimation model are adjusted based on the third loss value.
[0118] Step two, based on a preset mapping method, the feature values of the feature map are subjected to mapping processing to obtain the heat map image.
[0119] Specifically, the feature values of the feature map can be used to represent the features of the corresponding feature points. Exemplarily, the feature values corresponding to each pixel point in the target background image can be mapped into pixel color values (such as numbers between 0 and 255) based on the preset mapping method, and the pixel color values are used to represent the colors of each pixel point in the heat map, so as to obtain the heat map.
[0120] Here, since the feature values of the feature map represent the features of the corresponding pixel points, the closer the feature values are, the closer the features of the corresponding pixel points are. After the feature values of the feature map are mapped according to the preset mapping method, the closer the pixel color values after mapping are, the smaller the feature difference between the pixel points is.
[0121] In a possible implementation, when the target placement area in the target background image is determined based on the heat map, an outlier point recognition method or a community detection method can be exemplarily used.
[0122] The outlier point recognition method will be described below. As shown in FIG. 3, the method can include steps 301 to 304. Figure 3
[0123] Step 301: determining the average value and the standard deviation of the pixel color values of the heat map.
[0124] The pixel color value can be exemplarily an RGB value.
[0125] Step 302: determining a pixel color value interval based on the average value and the standard deviation.
[0126] Exemplarily, the pixel color value interval can be calculated according to the following formula:
[0127] [μ-2×σ,μ+2×σ]
[0128] Wherein, μ is the average value, σ is the standard deviation, μ-2×σ is the lower limit of the pixel color value interval, and μ+2×σ is the upper limit of the pixel color value interval.
[0129] Exemplarily, if the average value of the pixel color values of a heat map is 0.1 and the standard deviation is 1, the pixel color value interval of the heat map is [-1.9, 2.1].
[0130] Step 303: determining a non-placement area in the heat map as the area in which the pixel color values are located outside the pixel color value interval.
[0131] Specifically, pixels in the thermal image whose color values fall outside the specified color value range can be identified as anomalous pixels. The location information of these anomalous pixels can then be determined. Continuing the previous example, if a pixel in the thermal image has a color value of 50, then this pixel is outside the specified color value range and is therefore an anomalous pixel. The area formed by these anomalous pixels is then the non-placement area.
[0132] Step 304: Based on the non-placement area, determine the target placement area in the target background image.
[0133] In one possible implementation, when determining the target placement area in the target background image based on the non-placement area, at least one icon placement area in the target background image other than the non-placement area can be determined first, and then the target placement area can be determined based on the attribute information of the at least one icon placement area.
[0134] Specifically, at least one region in the thermal image other than the non-placement region can be identified as a candidate placement region. Then, the largest inscribed rectangle region among the candidate placement regions can be used as the icon placement region. When determining the target placement region, the at least one icon placement region can be sorted according to its area size, and the icon placement region with the largest area can be used as the target placement region.
[0135] Alternatively, in one possible implementation, such as Figure 4a As shown, after determining the largest icon placement area using the above method, the median of the target background image can be determined first. If the largest icon placement area includes the median, the largest icon placement area is divided into a first region and a second region according to the median. The sizes of the first region and the second region are compared to determine the smaller target region (e.g., ...). Figure 4a The second region in the middle), then as Figure 4b As shown, the smaller target area is flipped around the median line as an axis to obtain a target placement area consisting of two target areas (e.g., Figure 4b (The dark areas in the text).
[0136] Alternatively, in another possible implementation, after determining the icon placement area according to the above method, the median line of the target background image can be determined first, and then the icon placement area closest to the median line can be taken as the target placement area.
[0137] In a possible implementation, after or before the execution of the above-mentioned abnormal point identification method, a pre-trained target detection model can be used to determine the position information of the target object in the target background image, and then based on the position information of the target object, the non-placing region in the target background image is determined, and finally based on the non-placing region, the target placing region in the target background image is determined.
[0138] Specifically, the target detection model can be a model with a structure of Yolo v5, and the target detection model is used to determine the shape, number and position information of the target object in an input image.
[0139] When training the target detection model to be trained, a fourth training image labeled with fourth annotation information can be input into the target detection model, the fourth annotation information can include the position information of the target object, and the position information of the target object can be, for example, the coordinates of the four vertices of a rectangular region containing the target object. Then, a fourth loss value is calculated based on the prediction result of the target detection model and the fourth annotation information. When calculating the fourth loss value, a GIOU loss function can be used. Finally, the parameters of the target detection model are adjusted based on the fourth loss value.
[0140] When determining the non-placing region, the target background image can be input into the target detection model, and the target detection model can output the position information of the target object. The region indicated by the position information of the target object is the non-placing region (such as the above-mentioned rectangular region). For example, after a certain thermal image is input into the target detection model, the target detection model outputs four position point coordinates, such as [{'x':495.47,'y':129.63}, {'x':789.41,'y':129.63}, {'x':789.41,'y':423.58}, {'x':495.47,'y':423.58}]. The region surrounded by the four position point coordinates is the non-placing region. Here, after the non-placing region is determined, the method for determining the target placing region is the same as the above-mentioned abnormal point identification method, which will not be described here.
[0141] The target background image can also include regions such as human faces, trademarks, watermarks, and texts. Obviously, the indicator icon cannot be superimposed on the above-mentioned regions. Therefore, the target placing region can be determined based on the following method:
[0142] In a possible implementation, the optical character recognition (OCR) technology can also be used to detect a text region in the target background image, and a face region, a trademark region, a watermark region, etc. in the target background image are determined based on the object detection technology. The text region, the face region, the trademark region, and the watermark region are also the non-placement regions. After the non-placement regions are determined, the target placement region in the target background image can be determined based on the non-placement regions. Here, the method for determining the target placement region is the same as the above-mentioned abnormal point recognition method, and details are not described herein again.
[0143] It should be noted that, after the target placement region is determined based on the above-mentioned methods (the sequence is not limited), the final target placement region is the intersection region of the target placement regions obtained based on the abnormal point recognition method and the above-mentioned methods, or the target placement region can be determined after the non-placement regions are determined based on the above-mentioned methods.
[0144] For step 103,
[0145] In a possible implementation, when the target identifier is added to the target placement region of the target background image, the display feature information of the target identifier can be determined based on the size information of the target placement region, and then the target identifier is added to the target placement region of the target background image according to the display feature information.
[0146] The display feature information can include a display position and a display size. Specifically, the initial size information of the target identifier can be compared with the size information of the target placement region to determine whether the target identifier exceeds the target placement region.
[0147] In the case where the target identifier does not exceed the target placement region, the target identifier can be displayed according to the initial size information or enlarged to a maximum size that does not exceed the target placement region; in the case where the target identifier exceeds the target placement region, the target identifier can be reduced to a maximum size that does not exceed the target placement region. Then, the display position of the target identifier can be determined according to a preset position determination rule. For example, the position determination rule can be that the display position is a central position in the target placement region.
[0148] In a possible implementation, the preset interaction operation can include downloading target content (such as an application, audio, video, text, etc.) or displaying the target content (such as opening a webpage, opening a video, etc.).
[0149] The image generation method provided by the embodiments of the present disclosure can respond to an image generation request, acquire a target background image and a triggerable target identifier, then determine a heat map image for representing feature differences between pixel points of the target background image, determine a target placement region in the target background image based on the heat map image, and finally add the target identifier to the target placement region to generate a target image. In this way, the target identifier can be automatically matched with an appropriate addition position in combination with the feature differences between the pixel points, so that a target image with an identifier indicating function can be automatically generated, and the production efficiency is improved.
[0150] Those skilled in the art can understand that the writing order of each step in the above method of the specific embodiment does not mean a strict execution order and does not constitute any limitation on the implementation process. The specific execution order of each step should be determined by its function and possible internal logic.
[0151] Based on the same inventive concept, the embodiments of the present disclosure also provide an image generation device corresponding to the image generation method. Since the principle of solving problems of the device in the embodiments of the present disclosure is similar to the above-mentioned image generation method, the implementation of the device can be referred to the implementation of the method, and the repeated parts will not be described here.
[0152] Referring to Figure 5 As shown in the figure, an architecture schematic diagram of an image generation device provided by the embodiments of the present disclosure, the device includes an acquisition module 501, a determination module 502, and a generation module 503.
[0153] The acquisition module 501 is configured to respond to an image generation request, acquire a target background image and a triggerable target identifier.
[0154] The determination module 502 is configured to determine a heat map image for representing feature differences between pixel points of the target background image, and determine a target placement region in the target background image based on the heat map image.
[0155] The generating module 503 is configured to add the target identifier to the target placement region of the target background image to generate a target image, wherein the target identifier is configured to perform a preset interaction operation after being triggered in a display process of the target image.
[0156] In a possible implementation, the determining module 502 is configured to:
[0157] extracting features of the target background image based on a pre-trained neural network to obtain a feature map corresponding to the target background image;
[0158] performing mapping processing on feature values of the feature map based on a preset mapping method to obtain the heat map.
[0159] In a possible implementation, the determining module 502 is configured to:
[0160] determining a mean value and a standard deviation of pixel color values of the heat map;
[0161] determining a pixel color value interval based on the mean value and the standard deviation;
[0162] determining a non-placement region in the heat map, in which pixel color values are located outside the pixel color value interval;
[0163] determining a target placement region in the target background image based on the non-placement region.
[0164] In a possible implementation, the determining module 502 is further configured to:
[0165] determining position information of a target object in the target background image based on a pre-trained target detection model;
[0166] determining a non-placement region in the target background image based on the position information of the target object;
[0167] determining a target placement region in the target background image based on the non-placement region.
[0168] In a possible implementation, the determining module 502 is configured to:
[0169] determining at least one icon placement region in the target background image except the non-placement region;
[0170] Determine the target placement region based on attribute information of the at least one icon placement region.
[0171] In a possible implementation, the generation module 503 is configured to:
[0172] Determine display feature information of the target icon based on size information of the target placement region.
[0173] Add the target icon to the target placement region of the target background image according to the display feature information.
[0174] In a possible implementation, the acquisition module 501 is configured to:
[0175] Acquire a historical background image to be screened.
[0176] Screen the target background image based on historical feature information of the historical background image.
[0177] In a possible implementation, the acquisition module 501 is configured to:
[0178] Acquire an unused image to be screened.
[0179] Predict feature information of the unused image based on a pre-trained effect estimation model.
[0180] Screen the target background image based on the feature information of the unused image.
[0181] The description of the processing procedure of each module in the apparatus and the interaction procedure between the modules can refer to the related description in the foregoing method embodiments, and will not be described in detail here.
[0182] Based on the same technical concept, the present disclosure also provides a computer device. Referring to FIG. 6, Figure 6 The computer device 600 provided by the present disclosure includes a processor 601, a memory 602, and a bus 603. The memory 602 is used to store execution instructions, including an internal memory 6021 and an external memory 6022. The internal memory 6021 is also called an internal memory, which is used to temporarily store operation data in the processor 601 and exchange data with the external memory 6022 such as a hard disk. The processor 601 exchanges data with the external memory 6022 through the internal memory 6021. When the computer device 600 is running, the processor 601 and the memory 602 communicate through the bus 603, so that the processor 601 executes the following instructions:
[0183] In response to an image generation request, a target background image and a target identifier that can be triggered are obtained;
[0184] A heat map image is determined for representing feature differences between pixel points of the target background image, and a target placement region in the target background image is determined based on the heat map image;
[0185] The target identifier is added to the target placement region of the target background image to generate a target image; wherein the target identifier is used to perform a preset interaction operation after being triggered during display of the target image.
[0186] In a possible implementation, in the instructions executed by the processor 601, the determination of the heat map image for representing feature differences between pixel points of the target background image includes:
[0187] Features of the target background image are extracted based on a pre-trained neural network to obtain a feature map corresponding to the target background image;
[0188] The feature values of the feature map are mapped based on a preset mapping method to obtain the heat map image.
[0189] In a possible implementation, in the instructions executed by the processor 601, the determination of the target placement region in the target background image based on the heat map image includes:
[0190] An average value and a standard deviation of pixel color values of the heat map image are determined;
[0191] A pixel color value interval is determined based on the average value and the standard deviation;
[0192] A region in which pixel color values of the heat map image are located outside the pixel color value interval is determined as a non-placement region;
[0193] The target placement region in the target background image is determined based on the non-placement region.
[0194] In a possible implementation, in the instructions executed by the processor 601, the method further includes:
[0195] Position information of a target object in the target background image is determined based on a pre-trained target detection model;
[0196] A non-placement region in the target background image is determined based on the position information of the target object;
[0197] The target placement region in the target background image is determined based on the non-placement region.
[0198] In a possible implementation, the instructions executed by the processor 601 include the following steps.
[0199] determining at least one icon placement region in the target background image except the non-placement region.
[0200] determining the target placement region based on attribute information of the at least one icon placement region.
[0201] In a possible implementation, the instructions executed by the processor 601 include the following steps.
[0202] determining display feature information of the target icon based on size information of the target placement region.
[0203] adding the target icon to the target placement region of the target background image according to the display feature information.
[0204] In a possible implementation, the instructions executed by the processor 601 include the following steps.
[0205] obtaining a historical background image to be screened.
[0206] screening the target background image based on historical feature information of the historical background image.
[0207] In a possible implementation, the instructions executed by the processor 601 include the following steps.
[0208] obtaining an unused image to be screened.
[0209] predicting feature information of the unused image based on a pre-trained effect estimation model.
[0210] screening the target background image based on the feature information of the unused image.
[0211] The embodiment of the present disclosure further provides a computer readable storage medium, which stores a computer program. The computer program is run by a processor to perform the steps of the image generation method described in the above method embodiments. The storage medium can be a volatile or non-volatile computer readable storage medium.
[0212] The embodiment of the present disclosure further provides a computer program product, which carries a program code. The program code includes instructions for performing the steps of the image generation method described in the above method embodiments. For details, refer to the above method embodiments, which will not be described here.
[0213] The computer program product can be implemented by hardware, software or a combination thereof. In an optional embodiment, the computer program product is embodied in a computer storage medium. In another optional embodiment, the computer program product is embodied in a software product, such as a software development kit (SDK) or the like.
[0214] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the system and device described above can refer to the corresponding process in the foregoing method embodiments, which will not be repeated here. In several embodiments provided in the present disclosure, it should be understood that the disclosed system, device and method can be implemented in other ways. The device embodiments described above are only schematic. For example, the division of the units is only a logical function division, and there can be another division manner in actual implementation. For example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the units shown or discussed can be indirect coupling or communication connection through some communication interface, and can be electrical, mechanical or other forms.
[0215] The units described as separate components can or can not be physically separate, and the components shown as units can or can not be physical units, that is, they can be located in one place, or can be distributed on a plurality of network units. According to actual needs, part or all of the units can be selected to achieve the purpose of the embodiment.
[0216] In addition, each functional unit in each embodiment of the present disclosure can be integrated into a processing unit, or each unit can exist physically independently, or two or more units can be integrated into one unit.
[0217] If the functions are implemented in the form of software function units and sold or used as independent products, they can be stored in a nonvolatile computer readable storage medium executable by a processor. Based on this understanding, the technical solutions of the present disclosure essentially or the part that contributes to the prior art or part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes a number of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of the present disclosure. The aforementioned storage medium includes: a U disk, a mobile hard disk, a read-only memory (Read-Only Memory, ROM), a random access memory (Random Access Memory, RAM), a magnetic disk or an optical disk, and various media that can store program codes.
[0218] Finally, it should be noted that: the above-described embodiments are only specific embodiments of the present disclosure, used to illustrate the technical solutions of the present disclosure, and not to limit them. The protection scope of the present disclosure is not limited thereto. Although the present disclosure has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art who is familiar with the technology in the art can still make modifications or easily think of changes to the technical solutions described in the foregoing embodiments, or make equivalent replacements to some of the technical features; and these modifications, changes or replacements do not cause the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present disclosure, and should be covered within the protection scope of the present disclosure. Therefore, the protection scope of the present disclosure should be subject to the protection scope of the claims.
Claims
1. An image generation method characterized by, The method comprises the following steps: in response to an image generation request, obtaining a target background image and a target identifier that can be triggered; determining a heat map image for representing feature differences between pixel points of the target background image, and determining a target placement area in the target background image based on a region with small color difference in pixel color values in the heat map image, wherein the pixel color values are used to represent the colors of the pixel points in the heat map image; adding the target identifier to the target placement area of the target background image to generate a target image; wherein the target identifier is used to perform a preset interaction operation after being triggered during the display of the target image.
2. The method of claim 1, wherein, The method comprises the following steps: extracting features of the target background image based on a pre-trained neural network to obtain a feature map corresponding to the target background image; performing mapping processing on the feature values of the feature map based on a preset mapping method to obtain the heat map image.
3. The method of claim 1, wherein, The method comprises the following steps: determining the average value and the standard deviation of the pixel color values of the heat map image; determining a pixel color value interval based on the average value and the standard deviation; determining a non-placement area in the heat map image where the pixel color values are outside the pixel color value interval; determining the target placement area in the target background image based on the non-placement area.
4. The method according to any one of claims 1 to 3, characterized in that, The method further comprises the following steps: determining the position information of a target object in the target background image based on a pre-trained target detection model; determining a non-placement area in the target background image based on the position information of the target object; determining the target placement area in the target background image based on the non-placement area, and the final target placement area is the intersection of the previously determined target placement areas.
5. The method of claim 4, wherein, The method comprises the following steps: determining at least one icon placement area in the target background image excluding the non-placement area; determining the target placement area based on the attribute information of the at least one icon placement area.
6. The method of claim 1, wherein, The method comprises the following steps: determining the display feature information of the target identifier based on the size information of the target placement area; adding the target identifier to the target placement area of the target background image according to the display feature information.
7. The method of claim 1, wherein, The method comprises the following steps: obtaining a historical background image to be screened; screening the target background image based on the historical feature information of the historical background image.
8. The method of claim 1, wherein, The method comprises the following steps: obtaining an unused image to be screened; predicting the feature information of the unused image based on a pre-trained effect prediction model; screening the target background image based on the feature information of the unused image.
9. An image generation apparatus characterized by comprising: The method comprises the following steps: an acquisition module for obtaining a target background image and a target identifier that can be triggered in response to an image generation request; determining a heat map image for representing feature differences between pixels of the target background image, and determining a target placement region in the target background image based on a region in which color differences of pixel color values in the heat map image are small, wherein the pixel color values represent colors of the pixels in the heat map image; generating a target image by adding the target logo to the target placement region of the target background image, wherein the target logo is configured to perform a preset interaction operation when triggered during display of the target image.
10. A computer device, comprising: comprising: a processor, a memory, and a bus, the memory storing machine-readable instructions executable by the processor, the processor and the memory communicating via the bus when the computer device is running, and the machine-readable instructions being executed by the processor to perform steps of the image generation method according to any one of claims 1 to 8.
11. A computer readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, and the computer program is executed by the processor to perform steps of the image generation method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Method and device for arranging desktop icons
CN105912189A
An icon processing method and a mobile terminal
CN109445653A
Recommended image processing method, apparatus and device, and computer readable storage medium
CN112733044A