Intelligent drawing method and system, electronic equipment and storage medium
By constructing image reference vectors and receiving user pixel ratio instructions, an intelligent drawing method has been developed, which solves the problem that existing technologies cannot meet the diverse needs of users and achieves accurate generation of images with diverse styles.
Patent Information
- Application Number
- CN202411091439.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-09
- Publication Date
- 2024-11-22
AI Technical Summary
Existing intelligent drawing methods struggle to adapt to users' diverse image style requirements, resulting in low accuracy of the drawn images.
By acquiring image information input by the user, determining image style features and visual features, constructing image reference vectors, matching reference images in a preset image template library, and receiving user-defined pixel ratio instructions, image fusion processing is performed to generate the target image.
It enables the generation of images in diverse styles according to user needs, improving the accuracy of intelligent drawing and dynamically adapting to users' diverse image style requirements.
Smart Images

Figure CN119006631A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image processing technology, and in particular to an intelligent drawing method, system, electronic device and storage medium. Background Art
[0002] With the rapid development of information technology and artificial intelligence, smart drawing technology has become a key tool to promote innovation and efficiency, especially in industries such as high-tech, architecture, animation and game development. These technologies quickly transform ideas into visual images through digital means, accelerating the development cycle from concept to final product. In this process, smart drawing not only provides designers and engineers with powerful visual expression tools, but also makes complex project management more efficient.
[0003] At present, the existing intelligent drawing methods provide users with a single style of image for reference, and then draw images of the corresponding style. However, in practical applications, due to the ever-changing needs of users, more and more users pay more attention to diversified image styles. Only generating images with a single style is difficult to adapt to the diverse needs of users, and the drawn images have deviations, resulting in low accuracy of intelligent drawing. Summary of the invention
[0004] The present application provides an intelligent drawing method, system, electronic device and storage medium, which have the effect of improving the accuracy of intelligent drawing.
[0005] In a first aspect, the present application provides an intelligent drawing method, comprising: Obtaining the image information to be generated input by the user; Based on the image information to be generated, determine image style features and image visual features corresponding to a plurality of images to be generated, and determine an image reference vector of each of the images to be generated according to each of the image style features and the image visual features; Determining a reference image corresponding to each of the image reference vectors in a preset image template library; receiving an image fusion instruction input by the user, wherein the image fusion instruction includes pixel ratios corresponding to a plurality of images of different styles; According to each of the pixel ratios, drawing processing is performed on each of the reference images to obtain a target image.
[0006] In a second aspect of the present application, an intelligent mapping system is provided, the system comprising: An information acquisition module, used to acquire the image information to be generated input by the user; An image recognition module, used to determine image style features and image visual features corresponding to a plurality of images to be generated based on the image information to be generated, and determine an image reference vector of each image to be generated according to each of the image style features and the image visual features; An image matching module, used to determine a reference image corresponding to each of the image reference vectors in a preset image template library; The target image drawing module receives the image fusion instruction input by the user, wherein the image fusion instruction includes the pixel ratios corresponding to multiple images of different styles; and is used to perform drawing processing on each of the reference images according to each of the pixel ratios to obtain a target image. In a third aspect of the present application, an electronic device is provided, comprising a memory, a processor, and a program stored in the memory and executable on the processor, wherein the program can implement an intelligent drawing method when loaded and executed by the processor.
[0007] In a fourth aspect of the present application, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the processor implements an intelligent drawing method.
[0008] In summary, one or more technical solutions provided in the embodiments of the present application have at least the following technical effects or advantages: By adopting the above technical solution, the image generation requirements input by the user are obtained, the style features and visual features of the image to be generated are determined, and the image reference vector is constructed to accurately express the features of each image. In the preset image template library, the reference image that best matches the input vector can be searched to provide a visual template for generating pictures. At the same time, the pixel ratio configuration of multiple style images defined by the user is received as a guiding parameter for generating pictures. Finally, the reference images are processed and style fused according to the set pixel ratio, so that the final target image meets the visual effect requirements and realizes the user's diverse needs for style proportions.
[0009] This technical solution constructs image feature vectors, obtains optimal templates, determines user proportion configurations, and performs controlled style fusion drawing. It is possible to efficiently generate personalized images that meet both visual effect requirements and customized style proportions. It is able to intelligently draw images of various styles, dynamically adapt to users' diverse image style requirements, avoid deviations in the drawing of multi-style images, and thus improve the accuracy of intelligent drawing. BRIEF DESCRIPTION OF THE DRAWINGS
[0010] Figure 1 It is a flowchart of an intelligent drawing method provided by an embodiment of the present application; Figure 2is a structural schematic diagram of an intelligent drawing system provided in an embodiment of the present application; Figure 3 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application.
[0011] Description of reference numerals: 300, electronic device; 301, processor; 302, communication bus; 303, user interface; 304, network interface; 305, memory. DETAILED DESCRIPTION
[0012] In order to enable technicians in this field to better understand the technical solutions in this specification, the technical solutions in the embodiments of this specification will be clearly and completely described below in conjunction with the drawings in the embodiments of this specification. Obviously, the described embodiments are only part of the embodiments of this application, not all of the embodiments.
[0013] In the description of the embodiments of the present application, words such as "for example" or "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design described as "for example" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "for example" or "for example" is intended to present related concepts in a specific way.
[0014] In the description of the embodiments of the present application, the meaning of the term "multiple" refers to two or more. For example, multiple systems refer to two or more systems, and multiple screen terminals refer to two or more screen terminals. In addition, the terms "first" and "second" are used for descriptive purposes only and cannot be understood as indicating or implying relative importance or implicitly indicating the indicated technical features. Thus, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. The terms "include", "comprise", "have" and their variations all mean "including but not limited to", unless otherwise specifically emphasized.
[0015] The present application embodiment provides an intelligent drawing method. In one embodiment, please refer to Figure 1 , Figure 1 : is a flowchart of the intelligent drawing method provided by the embodiment of the present application. The method can be implemented by a computer program, which can be integrated into an application or run as an independent tool application. The method can also be implemented by a single-chip microcomputer or run on an intelligent drawing system based on the von Neumann system. Specifically, the method can include the following steps: Step 101: Obtain image information to be generated input by a user.
[0016] Among them, the data submitted by the user to the system through the image information input interface, which represents the user's demand information for generating an image, can be understood in the embodiment of the present application as data containing image classification labels, visual feature descriptions, objects or scenes included, and other information, which is used to guide the system to determine the style and visual features of the image to be generated, and ultimately determine the reference image for drawing.
[0017] Specifically, obtaining the image information to be generated input by the user is the first step of the present invention. The purpose of this step is to enable the system to obtain the user's personalized description of the image to be generated to determine the style and content requirements of the image. The image information input interface prompts the user to input information such as the classification of the image, the visual features contained, the object or scene, etc. For example, the user can select the "landscape" classification, and describe the visual features containing "distant mountains, sea, sunset", as well as objects such as "coast" and "ship". The image information acquisition module of the system will receive the image information to be generated submitted by the user and store it in the database. The effect of obtaining the image information to be generated input by the user is to clarify the user's personalized expectations for the overall style and visual effects of the generated image, and also limit the specific content that the image needs to contain, which provides reference information for the subsequent determination of the style features, visual features and corresponding reference images of each image to be generated.
[0018] Step 102: Based on the information of the image to be generated, determine the image style features and image visual features corresponding to the multiple images to be generated, and determine the image reference vector of each image to be generated according to each image style feature and image visual feature.
[0019] Among them, image style features refer to data features that describe the overall style attributes of an image. In the embodiment of the present application, it can be understood as data representing a painting style, such as watercolor, realism, etc., determined by comparing image pixel values with a preset style image. It is used to represent the style attributes of the image to be generated and provide a basis for determining a reference image that matches the image style.
[0020] Image visual features refer to data that describes the visual effects of an image from a specific perspective. In the embodiments of the present application, they can be understood as data reflecting the main visual elements of the image extracted from the image to be generated based on the visual angle specified by the user. They are used to represent the visual composition and appearance effects required for the image to be generated, and provide a basis for determining a reference image that matches the visual effects of the image.
[0021] The image reference vector refers to the comprehensive feature expression obtained by vectorizing and digitalizing the style features and visual features of the image. In the embodiment of the present application, it can be understood as a digital feature vector formed after mapping the style attributes and visual effects of the image to be generated to the vector space for fusion processing, which is used for matching in a preset image template library to find the reference image that is closest to the input image in style and visual effect.
[0022] Specifically, after obtaining the image information to be generated input by the user, the system needs to determine the corresponding image style features and image visual features, and determine the image reference vector based on these features. This is a key step in realizing intelligent drawing. Its purpose is to obtain the digital feature representation of each image to be generated, and provide a basis for finding a matching reference image in the future. According to the image classification selected by the user, multiple related images to be generated are searched in the database. Then, these images are subjected to noise reduction processing to obtain the processed target pixel value. The target pixel value is compared with the pixel value of the preset style image to determine the painting style features of each image to be generated, such as realism or watercolor. At the same time, according to the visual angle described by the user, the visual features of each image to be generated at this angle are extracted. Then, the system determines the digital image reference vector corresponding to each image to be generated by vectorizing and fusing these style features and visual features. Through this process, the vector representation of the style attributes and visual effects of each image to be generated can be accurately obtained, which contains both style information and visual composition information. The image reference vector provides a digital feature basis for finding the best matching reference image in the image library in the future.
[0023] Based on the above embodiment, as an optional embodiment, in step 102: based on the image information to be generated, determining the image style features and image visual features corresponding to the multiple images to be generated, this step may also include the following steps: Step 201: Determine the classification labels in the image information to be generated, and match multiple images to be generated corresponding to the classification labels in a database.
[0024] Among them, the classification label refers to the image category information specified by the user when submitting the image information to be generated. In the embodiment of the present application, it can be understood as the classification selected by the user to represent the overall style of the image, such as "landscape painting", "realistic style", etc., which is used to query the image database for pictures related to the image category selected by the user and match them as a set of candidate target images for subsequent generation processing.
[0025] The database refers to a storage system that stores a large number of classified and annotated images. In the embodiment of the present application, it can be understood as a data set or image library connected to the system that stores a large number of pre-classified images. It is used to provide an image classification module to match candidate target images related to the classification labels input by the user, and provide the original image source for the system to generate user-defined images.
[0026] The image to be generated refers to a group of source images related to the image information input by the user selected from the database. In the embodiment of the present application, it can be understood that the system matches a group of source images related to the classification from the database according to the classification label input by the user, which is used for subsequent image processing and feature analysis, and finally determines the corresponding image reference vector for generating a user-defined target image.
[0027] Specifically, after obtaining the image information to be generated input by the user, the system needs to determine the image classification label in the information and match the corresponding multiple images to be generated in the database. This is the first step in obtaining the target image set. The purpose is to find a set of candidate source images related to the user-specified classification from the database that stores images.
[0028] Parse the image information submitted by the user and identify the image classification provided therein, such as "landscape painting". The image classification module in the system will search for all images labeled as "landscape painting" in the connected database, and match a quantitative number of related images as the image set to be generated, such as 50 pictures of the landscape category in the database. Through this process, multiple candidate source images related to the information classification provided by the user can be quickly matched from the image resources in the database. This step establishes the correspondence between the user input instructions and the related image set, providing a target data set for subsequent image processing and feature analysis. This process relies on the database image resources and the system's classification technology, and can efficiently realize the matching conversion from user intention to image set.
[0029] Step 202: performing noise reduction processing on the pixel values of each image to be generated to obtain the target pixel values of each image to be generated after processing.
[0030] Among them, the pixel value refers to the brightness value corresponding to each pixel in the digital image. In the embodiment of the present application, it can be understood as a digital representation of the chromaticity or brightness corresponding to the pixel points that make up each digital image to be generated. It is used to represent the color or brightness of the image at each point and is the basic data for image processing and feature extraction.
[0031] Noise reduction refers to a processing technology used to improve the quality of digital images. In the embodiments of the present application, it can be understood as using an algorithm to process the pixel values of an image to eliminate or reduce the noise in the image, thereby improving the clarity and visual quality of the image and providing high-quality input source data for subsequent image style feature extraction.
[0032] The target pixel value refers to the pixel brightness value of the digital image after noise reduction processing. In the embodiment of the present application, it can be understood as a clearer and more realistic pixel-level value obtained after noise reduction optimization of each image to be generated. It is used to represent the processed high-quality image data and is the target input value for subsequent image style feature analysis.
[0033] Specifically, after obtaining the set of images to be generated, each image needs to be denoised to obtain the processed target pixel value. The purpose of this step is to improve the image quality and provide high-quality input data for the subsequent accurate extraction of image style features. Each image in the set of images to be generated is obtained in turn, and each pixel value is denoised using algorithms such as Gaussian filtering and median filtering to filter image noise and optimize the clarity of the pixel value. After the processing is completed, the system obtains a set of target pixel values corresponding to each denoised image to be generated, which serves as the input data for subsequent style feature analysis. The effect of this is that the original image to be generated may have varying degrees of noise. Noise reduction can improve the quality of the basic image, obtain more realistic and clear target pixel values, and make the subsequent image-based style feature analysis more accurate, thereby improving the quality of the generated image.
[0034] Step 203: Compare each target pixel value with pixel values corresponding to a plurality of preset style images to obtain image style features of each image to be generated.
[0035] Among them, the preset style image refers to a pre-stored style picture with clear style attributes. In the embodiment of the present application, it can be understood as different types of style pictures with clear style attributes marked as style judgment references in the system. It is used to judge the image style category to which the image to be generated belongs by comparing with the pixel values of the image to be generated, and extract the style features of the image to be generated.
[0036] Specifically, after obtaining the target pixel value of the image to be generated, the system needs to determine the image style of each image to be generated by comparing it with the pixel value of the preset style image, and obtain the image style features. The purpose of this step is to analyze the style attributes of the image and provide a basis for the subsequent style matching. Preset multiple types of style sample images, such as abstract, realistic and other different style paintings, each with representative pixel value characteristics. The target pixel values of the images to be generated will be obtained one by one, and compared with the pixel values of different style sample images to determine which type of style pixel value the target pixel value is closest to, so as to determine the image style category of the image to be generated, such as abstract style or realistic style, and form the corresponding style features. The effect of this is that through comparative analysis with different style samples, the style of each image to be generated can be effectively determined, and the style feature information of the image can be extracted, providing data support for the subsequent realization of images that match the style expected by the user.
[0037] Step 204: Determine the visual angle in the image information to be generated, and extract the visual image of each image to be generated under the visual angle as the image visual feature.
[0038] Among them, the visual angle refers to the viewpoint orientation from which the user expects to view the image. In the embodiment of the present application, it can be understood as the viewing angle direction for appreciating the image specified by the user in the image information to be generated submitted, such as looking down, looking up, etc., which is used to perform image visual composition analysis from the specified viewpoint and obtain the image visual features based on the viewpoint.
[0039] Specifically, after obtaining the image information to be generated input by the user, the system needs to confirm the visual angle specified in the information, and perform visual feature analysis on each image to be generated from this angle to obtain the image visual features based on the perspective. The purpose of this step is to analyze the image visual effect from the user's desired viewpoint. Parse the image information provided by the user and determine the viewing angle of the image specified by the user, such as the upward viewing angle. Then the system will analyze the visual components of each image to be generated from the specified upward viewing angle, extract the lines, layout, color combination and other visual information of the image at this angle, and form features representing the visual effect of the image at the corresponding viewing angle. The effect of this is that the image can be observed from the user's expected viewpoint, the visual composition of the image to be generated can be analyzed, and the image visual features based on this viewing angle can be obtained, so as to realize intelligent drawing generation that satisfies the user's visual experience.
[0040] Based on the above embodiment, as an optional embodiment, in step 102: determining the image reference vector of each image to be generated according to the style features and visual features of each image, this step may also include the following steps: Step 205: quantizing the image style features of each image to be generated to obtain a corresponding style feature vector, and quantizing the image visual features of each image to be generated to obtain a corresponding visual feature vector.
[0041] Among them, quantization processing refers to the processing technology of converting the style features and visual features of an image into digital vectors. In the embodiments of the present application, it can be understood as using a coding algorithm to digitize and vectorize the extracted image style features and visual features, which is used to represent the image attributes as a structured digital vector, which is convenient for subsequent computer analysis and processing, and realizes the standardization of feature expressions.
[0042] A style feature vector refers to a digital vector representing the style features of an image obtained through quantization encoding. In the embodiments of the present application, it can be understood as a digitized vector obtained through quantization processing of style attributes extracted from an image, such as "realism", etc. It is used to represent the corresponding image style features in a computer for subsequent feature matching and reference image selection.
[0043] A visual feature vector refers to a digital vector representing the visual features of an image obtained through quantization encoding. In the embodiments of the present application, it can be understood as a digitized vector obtained through quantization processing of visual effect elements extracted from the image, such as lines, layouts, etc. It is used to represent the corresponding image visual feature information in a computer for subsequent feature matching and reference image selection.
[0044] Specifically, after obtaining the image style features and image visual features corresponding to each image to be generated, the system needs to further perform quantization processing to convert these features into computable vector representations to establish the structured data required for matching analysis. By using the encoding algorithm, the extracted image style features, such as "realistic style", are quantified and converted into style feature vectors representing style attributes, such as numerical vectors of "0.2, 0.7, 0.5". At the same time, similar quantization processing is also performed on the image visual features, which are converted into visual feature vectors representing visual components. In the end, each image to be generated will obtain a style feature vector and a visual feature vector. The effect of this is to achieve a standardized digital expression of image features, express the style and visual characteristics of the image in a vector format, and retain the feature information. This process realizes feature vectorization through the encoding algorithm, and establishes standardized data input for the subsequent computer matching analysis algorithm.
[0045] Based on the above embodiment, as an optional embodiment, in step 205: performing quantization processing on the image style features of each image to be generated to obtain a corresponding style feature vector, and performing quantization processing on the image visual features of each image to be generated to obtain a corresponding visual feature vector, this step may also include the following steps: Step 215: Mapping each image style feature into a preset first multi-dimensional feature space, where each dimension in the preset first multi-dimensional feature space corresponds to a preset style attribute.
[0046] Among them, the preset first multidimensional feature space refers to a pre-established multidimensional vector space for representing image style features. In the embodiment of the present application, it can be understood as a data space in which each dimension defined by the system corresponds to a style attribute, which is used to realize the quantitative expression and mapping of various image style features, obtain the style multidimensional feature vector, and provide data input for the subsequent selection of images according to style matching.
[0047] Preset style attributes refer to different attribute categories pre-defined to represent image styles. In the embodiments of the present application, they can be understood as attribute items set by the system to reflect different image styles, such as abstract, realistic, romantic, etc., which are used to establish dimensions corresponding to each style attribute in the preset multi-dimensional style feature space, thereby realizing the quantitative expression of image style attributes.
[0048] Specifically, after obtaining the image style features of each image to be generated, it is necessary to map these style features to a pre-established multi-dimensional style feature space to achieve vector representation of the style features. The purpose of this step is to achieve quantification of style features. A multi-dimensional style feature space is pre-defined, and each dimension corresponds to a preset style attribute, such as abstract, realism, etc. The system will parse out the various style attribute components contained in the style features of each image to be generated, and then map them to the dimensions corresponding to the style feature space, and convert them into a multi-dimensional vector representing the style features. The effect of this is to achieve a standardized numerical vector expression of the image style features. The abstract style, realistic style, etc. of the image can be mapped to a standard style feature vector, creating conditions for subsequent precise matching of images according to style. This process achieves standardization of style features by presetting a multi-dimensional style space.
[0049] Step 225: assigning a corresponding preset attribute value in the database to each preset style attribute to obtain a corresponding N-dimensional numerical vector, where N is the number of preset style attributes, and using each N-dimensional numerical vector as a style feature vector of each image to be generated.
[0050] Among them, the database refers to a structured data set that stores preset data. In the embodiment of the present application, it can be understood as a database that stores the numerical mapping information corresponding to each preset style attribute in the system, which is used to provide preset attribute values for the generation of style feature vectors and convert abstract style feature coordinates into specific multi-dimensional style feature vectors.
[0051] The preset attribute value refers to the pre-set numerical value corresponding to each preset style attribute in the database. In the embodiment of the present application, it can be understood as a predefined numerical value associated with different style attribute options in the database, such as 0.7 for the abstract style, 0.3 for the realistic style, etc., which is used to obtain the preset numerical value of the corresponding style attribute according to the coordinates of the image style feature and generate a multi-dimensional vector of the style feature.
[0052] Specifically, after obtaining the coordinates of each image to be generated mapped in the multi-dimensional style feature space, the system needs to take the corresponding preset values in the database for each preset style attribute to generate an N-dimensional style feature vector to further quantify the style features. Query the pre-built database to obtain the preset values of each preset style attribute, such as 0.7 for the abstract style. Then the system takes the corresponding preset values according to the coordinate values of each image in the style attribute dimension, and finally forms an N-dimensional style feature vector, where N is the number of style attributes. The effect of this is that the abstract style coordinates can be converted into clear style feature vectors based on the preset database, realizing the quantitative digital expression of style features, and providing the normalized feature vector input after quantization processing for the subsequent selection of images according to style matching. This process realizes the generation of feature vectors through the preset database.
[0053] Step 235: Mapping the visual features of each image into a preset second multi-dimensional feature space, where each dimension in the preset second multi-dimensional feature space corresponds to a visual angle.
[0054] Among them, the preset second multidimensional feature space refers to a pre-established multidimensional vector space for representing the visual features of an image. In the embodiment of the present application, it can be understood as a data space in which each dimension defined by the system corresponds to a visual angle, which is used to realize the quantitative expression and mapping of various image visual features, obtain a visual multidimensional feature vector, and provide data input for subsequent image selection based on visual effect matching.
[0055] Visual angle refers to the way of reflecting the visual effects formed by observing an image from different directions. In the embodiments of the present application, it can be understood as the visual experience formed by different image shooting angles such as looking down and looking up. It is used to establish dimensions corresponding to various visual angles in a preset multi-dimensional visual feature space, thereby realizing the quantitative expression of the visual features of the image.
[0056] Specifically, after obtaining the image visual features of each image to be generated, the system needs to map these visual features to a pre-established multi-dimensional visual feature space to achieve vector representation of the visual features. The purpose of this step is to achieve quantitative processing of visual features. A multi-dimensional visual feature space is pre-defined, and each dimension corresponds to a visual angle, such as looking down, looking up, etc. The system will parse out the various perspective components contained in the visual features of each image to be generated, and then map them to the corresponding dimensions of the visual feature space, and convert them into multi-dimensional vectors representing the visual features. The effect of this is that a standardized numerical vector expression of the visual features of the image is achieved, and the image's overlooking components, upward components, etc. can all be mapped to standard visual feature vectors, creating conditions for subsequent precise matching of images based on visual effects. This process achieves standardization of visual features by presetting a multi-dimensional visual space.
[0057] Step 245: assigning a corresponding preset attribute value in the database to each visual angle to obtain a corresponding M-dimensional numerical vector, where M is the number of visual angles, and using each M-dimensional numerical vector as a visual feature vector of each image to be generated.
[0058] Specifically, after obtaining the coordinates of each image to be generated mapped in the multi-dimensional visual feature space, the system needs to take the corresponding preset values in the database for each preset visual angle to generate an M-dimensional visual feature vector to achieve further quantification of the visual features. Query the pre-built database to obtain the preset values for each preset visual angle, such as 0.6 for the top view. Then the system takes the corresponding preset values according to the coordinate values of each image in the visual angle dimension, and finally forms an M-dimensional visual feature vector, where M is the number of visual angles. The effect of this is that the abstract visual coordinates can be converted into clear visual feature vectors based on the preset database, realizing the quantitative digital expression of visual features, and providing the normalized feature vector input after quantization processing for the subsequent selection of images according to visual effect matching. This process realizes the generation of feature vectors through the preset database.
[0059] Step 206: fusing the style feature vector and the visual feature vector corresponding to each image to be generated to obtain an image reference vector of each image to be generated.
[0060] Specifically, after obtaining the style feature vector and visual feature vector of each image to be generated, the system needs to perform fusion processing to merge the two vectors to generate a corresponding image reference vector for each image. The purpose of this step is to combine the style features and visual features of the image to establish a comprehensive feature description for subsequent matching selection. For each image to be generated, the extracted style feature vector and visual feature vector are fused and combined, and the algorithm is used to weight different feature dimensions to form an image reference vector that comprehensively considers the image style attributes and visual effects. The effect of this is that the image reference vector provides an overall description of the style features and visual features of each image to be generated, including the image style and perspective effect information expected by the user, which can be used as a basis for finding the most matching reference image in the future. This process uses a feature fusion algorithm to achieve comprehensive consideration of the features of each dimension of the image and improve the effect of matching analysis.
[0061] Based on the above embodiment, as an optional embodiment, in step 206: fusing the style feature vector and the visual feature vector corresponding to each image to be generated to obtain the image reference vector of each image to be generated, this step may also include the following steps: Step 216: weighting the style feature vector and the visual feature vector of each image to be generated to obtain a target style feature vector and a target visual feature vector of each image to be generated.
[0062] Among them, the target style feature vector refers to the image style feature vector that has been weighted and adjusted for matching. In the embodiment of the present application, it can be understood as a style feature vector optimized for matching requirements generated after weighted processing of the original style feature vector according to user-specified requirements. It is used to compare with the style feature vector in the image database in the subsequent matching process to select the image that best matches the user's requirements for style effects.
[0063] The target visual feature vector refers to the image visual feature vector that has been weighted and adjusted for matching. In the embodiment of the present application, it can be understood as a visual feature vector optimized for matching requirements that is generated after weighting the original visual feature vector according to user-specified requirements. It is used to compare with the visual feature vector in the image database in the subsequent matching process to select the image that best matches the user's requirements for visual effects.
[0064] Specifically, after obtaining the style feature vector and visual feature vector of each image to be generated, the system needs to perform weighted processing on the two vectors to generate a target style feature vector and a target visual feature vector to optimize the matching feature expression. Different weight coefficients are set according to the priority of the image style and visual effect specified by the user. For example, if the user pays more attention to the visual effect, the visual feature vector has a greater weight. The system performs a weighted algorithm calculation on the two original feature vectors to obtain a target style feature vector and a target visual feature vector that strengthen the user's focus. The effect of this is that the image features that the user is concerned about can be highlighted through weighted adjustment, so that subsequent matching is more in line with the user's expectations of style and vision. This process realizes the personalized optimization combination of feature vectors to meet the personalized generation needs of different users.
[0065] Step 226: concatenate the target style feature vector and the target visual feature vector to obtain image reference vectors of each image to be generated.
[0066] Specifically, after obtaining the target style feature vector and target visual feature vector of each image to be generated, the system needs to concatenate the two vectors to form an image reference vector corresponding to each image. The purpose of this step is to express the style features and visual features in combination to establish a unified feature description for subsequent matching. The two vectors are concatenated in sequence to eventually generate an image reference vector that combines the target style features and the target visual features. This vector contains both style information and visual information. The effect of this is that by combining the two types of image features into a comprehensive vector, conditions are created for subsequent overall matching of images according to user needs. This process realizes the combined expression of style features and visual features, supports subsequent overall feature matching, and comprehensively meets the user's requirements for image style and visual effects.
[0067] Step 103: Determine a reference image corresponding to each image reference vector in a preset image template library; receive an image fusion instruction input by a user, where the image fusion instruction includes pixel ratios corresponding to multiple images of different styles.
[0068] Among them, the preset image template library refers to a pre-stored database containing various image templates. In the embodiment of the present application, it can be understood as a set of image samples containing different scenes and styles collected in advance by the system, which is used to match the input image reference vector and select the most similar image as the template for generating the target image.
[0069] The reference image refers to a template image that matches the image reference vector in a preset image template library. In the embodiment of the present application, it can be understood as a sample image in the image template library that is closest to the style and visual characteristics of the input image feature vector. It is used to provide visual information such as scene and layout, and serves as a basic template for generating the target image.
[0070] The image fusion instruction refers to a command input by the user to indicate how to perform image style fusion. In the embodiment of the present application, it can be understood as multiple images of different styles specified by the user and the fusion ratio in the final generated image, which is used to guide the system to fuse different styles according to the ratio and generate a user-defined image effect.
[0071] The pixel ratio refers to the proportion of the number of pixels occupied by each different style image specified in the image fusion instruction in the final generated image. In the embodiment of the present application, it can be understood as the pixel ratio parameter corresponding to the different style template images set by the user, which is used to guide the subsequent generation process to fuse different style images according to the set ratio.
[0072] Specifically, after obtaining the image reference vector of each image to be generated, the system needs to find the most matching reference image in the preset image template library. The purpose of this step is to obtain a visual template for the generated image. At the same time, the system receives the image fusion instruction input by the user, that is, the pixel ratio parameters of multiple style images, to obtain the style fusion configuration. Calculate the similarity between the image reference vector and each image vector in the template library, and select the image closest to it as the reference image. At the same time, obtain two or more styles set by the user and their respective pixel ratios. The effect of this is that a reference image template with similar features and a user-defined style fusion ratio parameter are obtained, which lays the foundation for the subsequent image generation to meet the user's personalized needs. This process provides templates and ratio configurations to support personalized image generation.
[0073] Based on the above embodiment, as an optional embodiment, in step 103: determining the reference image corresponding to each image reference vector in the preset image template library, this step may also include the following steps: Step 301: For each image reference vector, calculate the similarity between the image reference vector and a plurality of template images in a preset image template library.
[0074] Among them, the template image refers to various types of sample images stored in the preset image template library. In the embodiment of the present application, it can be understood as picture samples with different scene styles collected in the template library, which are used for feature matching with the input image reference vector and selecting the most similar template image as the visual basis for generating a new image.
[0075] Specifically, after obtaining the image reference vector of each image to be generated, the system needs to calculate the similarity between the vector and all template vectors in the template library to find the best matching template. The purpose of this step is to obtain the visual template that best meets the user's requirements. Traverse all template images and corresponding feature vectors stored in the template library, and calculate the similarity between the input reference vector and each template vector one by one. The vector cosine similarity algorithm can be used. The effect of this is that the similarity ranking of the input vector and all template vectors can be obtained. According to the principle of maximum similarity, the highest ranking, that is, the most similar template image is selected. Its features are closest to the input vector and most meet the image requirements. This process realizes the determination of the best matching template through similarity calculation.
[0076] Step 302: Based on the similarities, a template image with the highest similarity to the image reference vector is selected from a preset image template library as a corresponding reference image.
[0077] Specifically, after obtaining the similarity between the input image reference vector and each template vector in the template library, the system needs to select the template image that is most similar to the input vector as the corresponding reference image based on the similarity result. The purpose of this step is to obtain the template with the most matching features. The template images are ranked in the order of the calculated similarity, and the template image with the highest similarity, that is, the one that best matches the input vector, is selected as the reference image. This has the effect of obtaining a reference image that is closest to the input feature vector in terms of image style and visual effect. This image is used as a visual template for generating the target image, which can maximize the guarantee that the generated effect meets the user's expectations. This process achieves the selection of the best template through similarity sorting.
[0078] Step 104: performing drawing processing on each reference image according to each pixel ratio to obtain a target image.
[0079] Specifically, after obtaining the pixel ratios of each different style image set by the user, the system needs to draw the reference image according to these ratios to generate a target image. The purpose of this step is to achieve the style fusion effect defined by the user. Read multiple style images, extract pixel information of different styles according to the ratio set by the user, and then fill each style pixel in the corresponding area in the reference image in order according to the ratio, and finally generate a target image that combines multiple styles. The effect of this is that a target image that combines the style selected by the user and meets the defined ratio can be obtained. The image meets the user's personalized expectations for style fusion and proportion. This process realizes the generation of multi-style images through proportional drawing.
[0080] Based on the above embodiment, as an optional embodiment, in step 104: performing drawing processing on each reference image according to each pixel ratio to obtain a target image, this step may also include the following steps: Step 401: construct an initial image canvas; calculate the number of pixels occupied by each reference image in the initial image canvas according to each pixel ratio, and determine the drawing area of each reference image in the initial image canvas.
[0081] Among them, the initial image canvas refers to a blank image base map used to draw and generate the target image. In the embodiment of the present application, it can be understood as a blank canvas template that is not filled with pixel information during the image generation process, and is used to draw images of different styles on it according to the pixel ratio, and finally form a target image that combines multiple styles.
[0082] The number of pixels refers to the number of pixels that each reference image can occupy in the final generated image, calculated based on the pixel ratio set by the user. In the embodiment of the present application, it can be understood as determining the number of pixels that can be filled in the target image based on the fusion ratio of images of different styles, which is used to guide the subsequent image drawing and style fusion process.
[0083] The drawing area refers to the specific position range where each reference image can be drawn in the initial image canvas calculated based on the number of pixels. In the embodiment of the present application, it can be understood as the corresponding segmented area on the canvas determined according to the number of pixels that different style images can occupy, which is used to guide the subsequent drawing of each template image to achieve style fusion.
[0084] Specifically, after obtaining the pixel ratio of each style image set by the user, the system needs to first construct an initial blank image canvas, and calculate the number of pixels that each reference image can occupy and the corresponding canvas drawing area based on the ratio. The purpose of this step is to make spatial planning for style fusion. Construct an initial blank canvas of specified size, calculate the number of pixels that can be placed in the canvas for each template image according to the pixel ratio of each style image set by the user, and determine its specific drawing position range in the canvas. The effect of this is to determine the drawing area of each style image template on the canvas, and make good space allocation for the subsequent filling of different style pixel information, which will be conducive to the splicing and combination of template images. This process realizes the spatial layout of multi-style fusion through regional pre-planning.
[0085] Step 402: Based on the drawing area and the number of pixels of each reference image in the initial image canvas, each reference image is filled into the initial image canvas to obtain a target image.
[0086] Specifically, after obtaining the drawing area of each reference image in the canvas and the number of pixels that can be placed, the system needs to fill each reference image into the corresponding area of the canvas based on this information to generate the final target image. The purpose of this step is to achieve user-defined multi-style image fusion. Read multiple reference images, and fill the pixel information of different style images into the divided areas of the canvas one by one according to the predetermined area and pixel number requirements, control the drawing within the limited number of pixels, and finally form a target image that integrates multiple styles. The effect of this is to obtain a target image with style fusion and pixel ratios that meet user requirements. This image realizes the user's personalized expectations for style combinations and weight distribution. This process realizes proportional multi-style fusion through controlled drawing.
[0087] Reference Figure 2 , is an intelligent drawing system provided by an embodiment of the present application, the system comprises: an information acquisition module, an image recognition module, an image matching module, and a target image drawing module, wherein: An information acquisition module, used to acquire the image information to be generated input by the user; An image recognition module, used to determine image style features and image visual features corresponding to a plurality of images to be generated based on the image information to be generated, and determine an image reference vector of each image to be generated according to each image style feature and image visual feature; An image matching module is used to determine the reference image corresponding to each image reference vector in a preset image template library; The target image drawing module receives an image fusion instruction input by a user, wherein the image fusion instruction includes pixel ratios corresponding to multiple images of different styles; and is used to perform drawing processing on each reference image according to each pixel ratio to obtain a target image.
[0088] On the basis of the above embodiments, the image recognition module is also used to determine the classification labels in the image information to be generated, and match multiple images to be generated corresponding to the classification labels in the database; perform noise reduction processing on the pixel values of each image to be generated to obtain the target pixel values of each image to be generated after processing; compare each target pixel value with the pixel values corresponding to multiple preset style images to obtain the image style features of each image to be generated; determine the visual angle in the image information to be generated, and extract the visual image of each image to be generated at the visual angle as the image visual feature.
[0089] On the basis of the above-mentioned embodiment, the image recognition module is also used to quantify the image style features of each image to be generated to obtain a corresponding style feature vector, and to quantify the image visual features of each image to be generated to obtain a corresponding visual feature vector; the style feature vector and the visual feature vector corresponding to each image to be generated are fused to obtain an image reference vector of each image to be generated.
[0090] On the basis of the above embodiments, the image recognition module is also used to map the style features of each image into a preset first multidimensional feature space, where each dimension in the preset first multidimensional feature space corresponds to a preset style attribute; assign a corresponding preset attribute value in the database to each preset style attribute, and obtain a corresponding N-dimensional numerical vector, where N is the number of preset style attributes, and each N-dimensional numerical vector is used as the style feature vector of each image to be generated; map the visual features of each image into a preset second multidimensional feature space, where each dimension in the preset second multidimensional feature space corresponds to a visual angle; assign a corresponding preset attribute value in the database to each visual angle, and obtain a corresponding M-dimensional numerical vector, where M is the number of visual angles, and each M-dimensional numerical vector is used as the visual feature vector of each image to be generated.
[0091] On the basis of the above embodiment, the image recognition module is also used to perform weighted processing on the style feature vector and visual feature vector of each image to be generated, respectively, to obtain the target style feature vector and target visual feature vector of each image to be generated; and to splice the target style feature vector and the target visual feature vector to obtain the image reference vector of each image to be generated.
[0092] Based on the above embodiment, the image matching module is also used to calculate the similarity between each image reference vector and multiple template images in a preset image template library; based on each similarity, the template image with the highest similarity to the image reference vector is selected from the preset image template library as the corresponding reference image.
[0093] On the basis of the above embodiment, the target image drawing module is also used to construct an initial image canvas; according to each pixel ratio, the number of pixels occupied by each reference image in the initial image canvas is calculated, and the drawing area of each reference image in the initial image canvas is determined; based on the drawing area and the number of pixels of each reference image in the initial image canvas, each reference image is filled into the initial image canvas to obtain the target image.
[0094] It should be noted that: when the device provided in the above embodiment realizes its function, only the division of the above functional modules is used as an example. In actual application, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the device and method embodiments provided in the above embodiment belong to the same concept, and the specific implementation process is detailed in the method embodiment, which will not be repeated here.
[0095] The present application also discloses an electronic device. Figure 3 , Figure 3 The electronic device 300 may include: at least one processor 301 , at least one network interface 304 , a user interface 303 , a memory 305 , and at least one communication bus 302 .
[0096] The communication bus 302 is used to realize the connection and communication between these components.
[0097] The user interface 303 may include a display interface and a camera interface. Optionally, the user interface 303 may also include a standard wired interface and a wireless interface.
[0098] The network interface 304 may optionally include a standard wired interface or a wireless interface (such as a WI-FI interface).
[0099] Among them, the processor 301 may include one or more processing cores. The processor 301 uses various interfaces and lines to connect various parts in the entire server, and executes various functions of the server and processes data by running or executing instructions, programs, code sets or instruction sets stored in the memory 305, and calling data stored in the memory 305. Optionally, the processor 301 can be implemented in at least one hardware form of digital signal processing (Digital Signal Processing, DSP), field programmable gate array (Field-Programmable Gate Array, FPGA), and programmable logic array (Programmable Logic Array, PLA). The processor 301 can integrate one or a combination of a central processing unit (Central Processing Unit, CPU), a graphics processing unit (Graphics Processing Unit, GPU) and a modem. Among them, the CPU mainly processes the operating system, user interface diagrams and applications, etc.; the GPU is responsible for rendering and drawing the content to be displayed on the display screen; the modem is used to process wireless communications. It can be understood that the above-mentioned modem may not be integrated into the processor 301, and it can be implemented separately through a chip.
[0100] Among them, the memory 305 may include a random access memory (Random Access Memory, RAM) and may also include a read-only memory (Read-Only Memory). Optionally, the memory 305 includes a non-transitory computer-readable storage medium. The memory 305 can be used to store instructions, programs, codes, code sets or instruction sets. The memory 305 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the above-mentioned various method embodiments, etc.; the data storage area may store data involved in the above-mentioned various method embodiments, etc. The memory 305 may optionally also be at least one storage device located away from the aforementioned processor 301. Refer to Figure 3 , the memory 305 as a computer storage medium may include an operating system, a network communication module, a user interface module and an application program of an intelligent drawing method.
[0101] exist Figure 3In the electronic device 300 shown, the user interface 303 is mainly used to provide an input interface for the user and obtain the data input by the user; and the processor 301 can be used to call an application program storing an intelligent drawing method in the memory 305, and when executed by one or more processors 301, the electronic device 300 executes one or more methods in the above-mentioned embodiments. It should be noted that for the aforementioned method embodiments, for the sake of simple description, they are all expressed as a series of action combinations, but those skilled in the art should know that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required for the present application.
[0102] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0103] In the several embodiments provided in this application, it should be understood that the disclosed devices can be implemented in other ways. For example, the device embodiments described above are only schematic, such as the division of units, which is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some service interfaces, and the indirect coupling or communication connection of devices or units can be electrical or other forms.
[0104] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0105] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0106] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable memory. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a memory and includes several instructions for a computer device (which can be a personal computer, server or network device, etc.) to execute all or part of the steps of the various embodiments of the present application. The aforementioned memory includes: various media that can store program codes, such as USB flash drives, mobile hard drives, magnetic disks or optical disks.
[0107] The above are only exemplary embodiments of the present disclosure and cannot be used to limit the scope of the present disclosure. That is, any equivalent changes and modifications made according to the teachings of the present disclosure are still within the scope of the present disclosure. After considering the disclosure of the specification and the truth of practice, those skilled in the art will easily think of other embodiments of the present disclosure.
[0108] This application is intended to cover any variation, use or adaptation of the present disclosure, which follows the general principles of the present disclosure and includes common knowledge or customary technical means in the art not recorded in the present disclosure. The description and examples are to be regarded as exemplary only.
Claims
1. An intelligent drawing method, characterized in that: include: Obtaining the image information to be generated input by the user; Based on the image information to be generated, determine image style features and image visual features corresponding to a plurality of images to be generated, and determine an image reference vector of each of the images to be generated according to each of the image style features and the image visual features; Determining a reference image corresponding to each of the image reference vectors in a preset image template library; receiving an image fusion instruction input by the user, wherein the image fusion instruction includes pixel ratios corresponding to a plurality of images of different styles; According to each of the pixel ratios, drawing processing is performed on each of the reference images to obtain a target image.
2. The intelligent drawing method according to claim 1, characterized in that: The determining, based on the to-be-generated image information, image style features and image visual features corresponding to a plurality of to-be-generated images includes: Determine the classification labels in the image information to be generated, and match multiple images to be generated corresponding to the classification labels in a database; Performing noise reduction processing on the pixel values of each of the to-be-generated images to obtain target pixel values of each of the to-be-generated images after processing; Comparing each of the target pixel values with pixel values corresponding to a plurality of preset style images to obtain image style features of each of the to-be-generated images; The visual angle in the image information to be generated is determined, and the visual image of each image to be generated under the visual angle is extracted as the image visual feature.
3. The intelligent drawing method according to claim 1, characterized in that: The step of determining the image reference vector of each image to be generated according to each image style feature and the image visual feature comprises: Performing quantization processing on the image style features of each of the images to be generated to obtain a corresponding style feature vector, and performing the quantization processing on the image visual features of each of the images to be generated to obtain a corresponding visual feature vector; The style feature vectors and visual feature vectors corresponding to each of the to-be-generated images are fused to obtain image reference vectors of each of the to-be-generated images.
4. The intelligent drawing method according to claim 3, characterized in that: The quantizing process is performed on the image style features of each of the images to be generated to obtain a corresponding style feature vector, and the quantizing process is performed on the image visual features of each of the images to be generated to obtain a corresponding visual feature vector, including: Mapping each of the image style features into a preset first multidimensional feature space, wherein each dimension in the preset first multidimensional feature space corresponds to a preset style attribute; Assigning a corresponding preset attribute value in a database to each of the preset style attributes to obtain a corresponding N-dimensional numerical vector, where N is the number of the preset style attributes, and using each of the N-dimensional numerical vectors as a style feature vector of each of the images to be generated; Mapping each of the image visual features into a preset second multidimensional feature space, wherein each dimension in the preset second multidimensional feature space corresponds to a visual angle; A corresponding preset attribute value in the database is assigned to each visual angle to obtain a corresponding M-dimensional numerical vector, where M is the number of the visual angles, and each of the M-dimensional numerical vectors is used as a visual feature vector of each of the images to be generated.
5. The intelligent drawing method according to claim 3, characterized in that: The fusing the style feature vector and the visual feature vector corresponding to each of the to-be-generated images to obtain the image reference vector of each of the to-be-generated images includes: Performing weighted processing on the style feature vector and the visual feature vector of each of the to-be-generated images respectively, to obtain a target style feature vector and a target visual feature vector of each of the to-be-generated images; The target style feature vector and the target visual feature vector are concatenated to obtain image reference vectors of the images to be generated.
6. The intelligent drawing method according to claim 1, characterized in that: Determining the reference image corresponding to each of the image reference vectors in the preset image template library includes: For each of the image reference vectors, calculating the similarity between the image reference vector and a plurality of template images in the preset image template library; Based on the similarities, a template image with the highest similarity to the image reference vector is selected from the preset image template library as the corresponding reference image.
7. The intelligent drawing method according to claim 1, characterized in that: The step of performing drawing processing on each of the reference images according to each of the pixel ratios to obtain a target image comprises: Construct the initial image canvas; According to each of the pixel ratios, the number of pixels occupied by each of the reference images in the initial image canvas is calculated, and a drawing area of each of the reference images in the initial image canvas is determined; Based on the drawing area and the number of pixels of each reference image in the initial image canvas, each reference image is filled into the initial image canvas to obtain the target image.
8. An intelligent mapping system, characterized in that: The system comprises: An information acquisition module, used to acquire the image information to be generated input by the user; An image recognition module, used to determine image style features and image visual features corresponding to a plurality of images to be generated based on the image information to be generated, and determine an image reference vector of each image to be generated according to each of the image style features and the image visual features; An image matching module, used to determine a reference image corresponding to each of the image reference vectors in a preset image template library; The target image drawing module receives the image fusion instruction input by the user, wherein the image fusion instruction includes pixel ratios corresponding to multiple images of different styles; and is used to perform drawing processing on each of the reference images according to each of the pixel ratios to obtain a target image.
9. An electronic device, characterized in that: It includes a processor, a memory, a user interface and a network interface, the memory is used to store instructions, the user interface and the network interface are used to communicate with other devices, and the processor is used to execute the instructions stored in the memory so that the electronic device executes an intelligent drawing method as described in any one of claims 1-7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores instructions, and when the instructions are executed, an intelligent drawing method as described in any one of claims 1 to 7 is executed.
Citation Information
Patent Citations
Image generation method and device, storage medium and terminal equipment
CN107845072A
Image generation method, device and equipment and storage medium
CN112381707A
Image processing method and device, equipment and storage medium
CN114841853A
Method and device for generating personalized face style graph and electronic equipment
CN114972017A
Image generation method, device and system and computer storage medium
CN117011123A
Cited By
Image processing method and device, electronic equipment and readable storage medium
CN119653248A
