Graph conversion method and device, computer equipment and storage medium

CN119648815APending Publication Date: 2025-03-18PING AN TECH (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411550873.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-31
Publication Date
2025-03-18

AI Technical Summary

Technical Problem

When converting bitmaps to SVG in the prior art, the model is large in size, high in computational volume and complexity, making it difficult to achieve efficient conversion.

Method used

By obtaining the pixel graphics to be converted, identifying and extracting the target hidden spatial information of the target graphics component, decoding the vector feature parameters, combining and generating the target vector graphics, and directly performing graphic conversion without requiring model training under vector graphics supervision.

Benefits of technology

The calculation amount and complexity of converting pixel graphics into vector graphics is reduced, the graphics conversion efficiency is improved, and the difficulty of model training is avoided.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119648815A_ABST
    Figure CN119648815A_ABST
Patent Text Reader

Abstract

The invention relates to the field of graph processing, and provides a graph conversion method and device, equipment and a computer storage medium, and the method comprises the steps: obtaining a to-be-converted pixel graph; identifying a target graph component in the pixel graph, and extracting target hidden space information of the target graph component; decoding the target hidden space information to obtain vector feature parameters used for describing the target graphic component; and combining the at least one target graph component according to the vector characteristic parameters to obtain a target vector graph corresponding to the pixel graph. Through the graph conversion method provided by the invention, a conversion model does not need to be trained under the supervision of the vector graph, and the complexity of converting the pixel image into the target vector graph is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of graphics processing, and in particular to a graphics conversion method, device, computer equipment and storage medium. Background Art

[0002] Bitmaps (such as images in JPEG, PNG and other formats) rely on a fixed pixel grid. When enlarged to a certain extent, they will become pixelated and lose clarity. However, the vector format of Scalable Vector Graphics (SVG) can be infinitely scaled without affecting clarity. Therefore, SVG is becoming more and more popular in occasions that require high-quality, scalable, editable and interactive graphics. However, in order to convert bitmaps to SVG, the conversion model needs to be trained through SVG, which results in a large model size. A more efficient method is urgently needed to convert bitmaps to SVG. Summary of the invention

[0003] The main purpose of the present application is to provide a graphics conversion method, device, equipment and computer storage medium, aiming to reduce the amount of calculation for converting pixel graphics into vector graphics and improve the efficiency of graphics conversion.

[0004] In a first aspect, the present application provides a graphics conversion method, the graphics conversion method comprising the following steps:

[0005] Get the pixel graphics to be converted;

[0006] Identifying a target graphic component in the pixel graphic and extracting target hidden space information of the target graphic component;

[0007] Decoding the target hidden space information to obtain vector feature parameters for describing the target graphic component;

[0008] At least one of the target graphic components is combined according to the vector feature parameters to obtain a target vector graphic corresponding to the pixel graphic.

[0009] In a second aspect, the present application further provides a graphics conversion device, the graphics conversion device comprising:

[0010] A pixel graphics acquisition module, used to acquire pixel graphics to be converted;

[0011] A graphic component extraction module, used to identify a target graphic component in the pixel graphic and extract target hidden space information of the target graphic component;

[0012] A vector feature determination module, used for decoding the target hidden space information to obtain vector feature parameters for describing the target graphic component;

[0013] The vector graphics generation module is used to combine at least one of the target graphics components according to the vector feature parameters to obtain a target vector graphics corresponding to the pixel graphics.

[0014] In a third aspect, the present application also provides a computer device, comprising a processor, a memory, and a computer program stored in the memory and executable by the processor, wherein when the computer program is executed by the processor, the graphics conversion method as described above is implemented.

[0015] In a fourth aspect, the present application further provides a computer-readable storage medium, on which a computer program is stored, wherein when the computer program is executed by a processor, the above-mentioned graphics conversion method is implemented.

[0016] The present application provides a graphics conversion method, device, equipment and computer storage medium. The present application obtains a pixel graphic to be converted; identifies a target graphic component in the pixel graphic and extracts target hidden space information of the target graphic component; decodes the target hidden space information to obtain vector feature parameters for describing the target graphic component; combines at least one of the target graphic components according to the vector feature parameters to obtain a target vector graphic corresponding to the pixel graphic. Through the graphics conversion method provided by the present application, by directly identifying the pixel graphic, the vector feature parameters for generating the target graphic component are obtained, and there is no need to train a conversion model under the supervision of the vector graphic, which reduces the amount of calculation and complexity of converting the pixel graphic into the target vector graphic, and improves the efficiency of graphics conversion. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0018] Figure 1 A flowchart of a graphics conversion method provided in one embodiment of the present application;

[0019] Figure 2 A diagram of a usage scenario of a graphics conversion method provided in one embodiment of the present application;

[0020] Figure 3 A schematic block diagram of a graphics conversion device provided in one embodiment of the present application;

[0021] Figure 4The present invention is a block diagram showing the structure of a computer device according to an embodiment of the present application. DETAILED DESCRIPTION

[0022] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0023] The flowcharts shown in the accompanying drawings are only examples and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps may also be decomposed, combined or partially merged, so the actual execution order may change according to actual conditions.

[0024] Embodiments of the present application provide a graphics conversion method, apparatus, computer equipment, and computer-readable storage medium.

[0025] In conjunction with the accompanying drawings, some embodiments of the present application are described in detail below. In the absence of conflict, the following embodiments and features in the embodiments can be combined with each other.

[0026] Please refer to Figure 1 , Figure 1 A flow chart of a graphics conversion method provided for an embodiment of the present application. The graphics conversion method can be used in a terminal or a server to realize the conversion of pixel graphics into vector graphics. Among them, the terminal can be an electronic device such as a mobile phone, a tablet computer, a laptop computer, a desktop computer, a personal digital assistant, and a wearable device; the server can be an independent server, or a server cluster, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (Content Delivery Network, CDN), and big data and artificial intelligence platforms.

[0027] Specifically, Figure 1 The method can be used to convert medical images. By converting medical images based on pixel graphic formats into vector image formats, it is ensured that medical images such as human anatomy diagrams and organ structure diagrams can remain clear at different sizes, so that medical images can maintain a consistent appearance on different devices and resolutions, thereby improving the adaptability of medical images in different scenarios.

[0028] like Figure 1 As shown, the graphic conversion method includes steps S101 to S104.

[0029] Step S101: Obtain a pixel graphic to be converted.

[0030] Pixel graphics, also known as bitmaps, usually refer to graphics composed of pixel arrays. For example, JPG, JPEG, PNG and other image formats used for photos, image scanning and other scenes are all pixel graphics. Due to the characteristics of pixel graphics, pixelation will appear after enlargement, resulting in image distortion. In contrast to pixel graphics, vector graphics (Scalable Vector Graphics, SVG for short) are graphics defined by paths based on mathematical equations (composed of points, lines and curves). They can be infinitely scaled without distortion and are suitable for storing icons, fonts and other scenes. Therefore, in order to ensure infinite scaling, editability and compatibility of graphics, there is often a need to convert pixel graphics into vector graphics.

[0031] In related technologies, pixel graphics can be split into multiple components through image processing technology, and the components can be converted into SVG commands by applying rule-based or optimization methods, or data can be collected to train SVG generation models. However, due to the incompleteness of the rules, the vectorization quality of rule-based methods is poor when facing various complex images, while the optimization method has many optimization steps and is time-consuming, making it difficult to deploy and apply in practice; the SVG generation model requires pixel graphics and vector graphics as samples for supervised training of the model, making it difficult to build a large-scale training data set.

[0032] In order to solve the above two problems, this application proposes a graphics conversion method, which realizes the conversion of pixel images into target vector graphics through a conversion model that does not require vector graphics supervision. First, the pixel graphics to be converted are obtained so as to convert the pixel graphics. Indicates that w and h correspond to the width and height of the image respectively, w×h represents the number of pixels in the image, and each pixel stores three values ​​representing the colors of the three RGB channels respectively.

[0033] Step S102: Identify a target graphic component in the pixel graphic, and extract target hidden space information of the target graphic component.

[0034] In SVG, almost everything is path-based, i.e., <path>Elements are used to draw various shapes in SVG, such as simple geometric shapes (such as circles, rectangles, ellipses) and complex icons and symbols. <path>Combined, they form the SVG displayed to the user. In order to form the final target vector image, it is necessary to <path>The element defines one or more path-based graphic components. These paths can be straight lines, curves, arcs, etc. In short, <path>In SVG, a path of a vector graphics component is represented, which is a sequence of path commands and parameters that together define the outline of the graphics. The graphics conversion method provided in the embodiment of the present application identifies the target graphics component in the pixel graphics through an encoder so as to generate a target vector graphics according to the target graphics component.

[0035] In some implementations, identifying the target graphic component in the pixel graphic and extracting target hidden space information of the target graphic component includes:

[0036] Identify the pixel pattern by a first encoder to extract first hidden space information of the pixel pattern;

[0037] Identifying an existing graphic component by using the first encoder, and extracting second hidden space information of the existing graphic component;

[0038] The first hidden space information and the second hidden space information are input into a second encoder for identification, and when the first hidden space information and the second hidden space information do not meet a preset condition, target hidden space information of the target graphic component is extracted.

[0039] Exemplarily, the latent is used to represent the hidden spatial information. Based on the two-layer encoder, the latent of the i-th target graphic component is identified and output. First, the pixel graphic and the existing image component identified in the i-1th step need to be input into the first encoder. The latent E(I) of the pixel graphic and the latent of the existing image component are obtained. Then E(I) and Input the second encoder, the second encoder pairs E(I) and A comparison is performed to determine the latent of the target graphics component that exists in the pixel graphics but does not exist in the existing graphics components.

[0040] In some implementations, inputting the first hidden space information and the second hidden space information into a second encoder for identification, and extracting target hidden space information of the target graphic component when the first hidden space information and the second hidden space information do not satisfy a preset condition, includes:

[0041] The first hidden space information and the second hidden space information are input into a second encoder for identification, and when the second hidden space information does not match the first hidden space information, target hidden space information and color parameters of the target graphic component are extracted.

[0042] For example, if the second hidden space information If the target image components in the pixel image are matched with the first hidden space information E(I), for example, the similarity is greater than a preset threshold, it means that all target image components in the pixel image have been identified and there is no need to continue to output the target image components. At this time, a preset mark indicating that the identification is complete is output. If the preset mark is not detected, the target image components in the pixel image are continuously identified.

[0043] For example, existing methods for converting pixel graphics into vector graphics usually predict the number of graphic components contained in the target vector graphics through an additionally trained auxiliary network, while the graphics conversion method provided in the present application does not need to process the number of graphic components, but only needs to input the pixel graphics and the existing graphic components into the encoder multiple times until the existing graphic components match the pixel graphics, thereby reducing the computational complexity and complexity of the graphics conversion and improving the accuracy of the graphics conversion.

[0044] Exemplarily, when it is necessary to output a colored target vector graphic, or to vectorize a colored pixel graphic, the output of the second encoder also includes a color parameter for representing the color of a target graphic component.

[0045] Specifically, the network structure of the first encoder contains 5 layers of 2D residual convolution layers and one fully connected layer. The structure of the residual convolution layer refers to the structure of ResNet. Each convolution layer contains [32, 64, 128, 256, 512] convolution kernels. All convolution kernels are 3×3 in size with a stride of 2. A row and a column of pixels with a value of 0 are filled in the width and height. After each convolution layer, the input w and h are reduced to half of the original, and the number of channels is the same as the number of convolution kernels in this layer. After the above five convolution layers, the output dimension is w / 32×h / 32×512. After flattening the output, it is input into 4 fully connected layers in sequence. The output dimensions of each fully connected layer are [4096, 2048, 1024, 512], and the output of the last fully connected layer is resized to obtain E(I) and Where D = 128 represents the dimension of the hidden layer. The second encoder uses the Transformer module, which consists of a self-attention layer (Self-Attention), a residual connection (Add), a layer normalization (Layer Normalization), a cross-attention layer (Cross-Attention) and a feedforward network (FeedForward). Generate query vector through self-attention layer, residual connection and layer normalization

[0046]

[0047] Then, E(I) is used as the key and value in the attention mechanism to generate the target hidden space information z of the i-th target graph component through the cross attention layer and the feedforward network. i :

[0048]

[0049] Step S103: Decode the target hidden space information to obtain vector feature parameters for describing the target graphic component.

[0050] Exemplarily, after determining the latent of the target graphic component in step S102, the SVG <path>It is determined that each target graphics component corresponds to a <path>elements, and <path>The elements are described by vector feature parameters command, so the commands of each target graphic component are determined by the decoder to describe each component of the target vector graphics.

[0051] Assume that I represents pixel graphics, G represents target vector graphics, and G contains M SVG Paths. Where P i Represents the i-th SVG Path. Each P i Contains N i An SVG Command and a color attribute R, in represents the jth Command in the i-th Path, where R is represented by the RGB channel. Including Command type and the corresponding coordinate parameters

[0052] For example, at the jth time step, the output of the decoder is a token e j , used to represent the jth Command in Path. The decoder first uses the same three-layer autoregressive Transformer module, including self-attention layer, residual connection, layer normalization, cross attention layer and feedforward network. Due to the decoder-only architecture, the target hidden space information z i It will be concatenated with the output in the previous time step as input, so the output of the Transformer is set to be the embedding of the token, using Indicates that the dimension is related to z i Keep it consistent. The autoregressive Transformer generates the corresponding token embedding v at the jth token position. j When , it depends on the target hidden space information z of the i-th target graphic component i The j-1 token embedding vectors obtained from the previous output The concatenation vector V is:

[0053] V = concat([z i ;v [1:j-1] ]),(3)

[0054] v j =FFN(V+LN(SelfAttn(V,V,V)))(4)

[0055] Then, add a linear layer Linear and Softmax function to output token embedding v j Convert to token e j =Softmax(Linear(v j )). Each generated token e j , can be converted into the parameters of the jth Command in the current SVG Path Until the Nth i +1 token contains <null>Mark, it means that the Decode phase of the Path is over, and all generated tokens are converted and merged into the Command list C i , C i Combined with the color R output by the encoder, we get the i-th SVG Path P i The system will P i With the existing Path list Splice to And converted into an SVG file, using the differentiable renderer DiffVG to render the rendering of step i

[0056] Exemplarily, this application adopts an end-to-end self-supervised training method. The training task is an image reconstruction task. A pixel image I is input, and the SVG file finally obtained after M steps of SVG Path P generation is Rendering of the SVG file Need to be as similar to I as possible. The calculation process of is differentiable, so the system calculates I and The loss between I and In order to obtain stable gradient information when the gap is large and pay attention to the reconstruction accuracy of the details in the later stage of training, the system designs a multi-scale loss. The pixel graph I is downsampled twice to form an image pyramid pyr l (I), where l = 1, 2, ..., L, L = 5 is the number of pyramid levels. Similarly, the system renders G into images of different resolutions and combines them into an image pyramid Resolution and pyr l (I) Corresponding to the training loss L pyr as follows:

[0057]

[0058] Where D is the training dataset, which contains only pixel graphics for training.

[0059] In some implementations, decoding the target hidden space information to obtain vector feature parameters for describing the target graphic component includes:

[0060] The target hidden space information is decoded to obtain a vector feature type and a corresponding vector feature coordinate for describing the target graphic component.

[0061] Exemplarily, the vector feature parameters include the vector feature type and the corresponding vector feature coordinates, wherein the vector feature type is the type of command, and the vector feature coordinates are the coordinate points on which the command acts. For example, the command types include: M, L, H, V, C, S, Q, T, etc. M is used to instruct the brush to move absolutely or relatively to a specified coordinate point, L is used to instruct the brush to draw a straight line absolutely or relatively to a specified coordinate point, H is used to instruct the brush to draw a horizontal line absolutely or relatively to a specified X coordinate, V is used to instruct the brush to draw a vertical line absolutely or relatively to a specified Y coordinate, C is used to instruct the brush to draw a Bezier curve absolutely or relatively, S is used to instruct the brush to draw a smooth Bezier curve absolutely or relatively, Q is used to instruct the brush to draw a quadratic Bezier curve absolutely or relatively, and T is used to instruct the brush to draw a smooth quadratic Bezier curve absolutely or relatively.

[0062] In some implementations, decoding the target hidden space information to obtain a vector feature type and a corresponding vector feature coordinate for describing the target graphic component includes:

[0063] The target hidden space information is decoded to obtain vector feature coordinates corresponding to at least one of a drawing starting point, a straight line vector, and a curve vector of the target graphic component.

[0064] In the related art, the target graphic component is usually described and drawn only through Bezier curves, which limits the graphic conversion method to perform refined vector conversion on more complex pixel graphics. The graphic conversion method provided in the embodiment of the present application describes and draws the target graphic component through three types of commands, namely, the drawing starting point (Move To, indicated by M), the straight line vector (Line To, indicated by L) and the curve vector (Cubic Bezier, indicated by C), thereby improving the accuracy of the target vector graphics.

[0065] Exemplarily, the vector feature coordinates corresponding to the drawing starting point include (x, y), indicating that the brush is moved to the specified point (x, y); the vector feature coordinates corresponding to the straight line vector include (x, y), indicating that a straight line segment is drawn from the brush position to the specified point (x, y); the vector feature coordinates corresponding to the curve vector include (x1, y1), (x2, y2) and (x, y), indicating that a curve is drawn from the brush position through the control points (x1, y1) and (x2, y2).

[0066] In some implementations, the decoding of the target hidden space information to obtain a vector feature type and a corresponding vector feature coordinate for describing the target graphic component includes:

[0067] Mapping the vector feature coordinates based on a row-priority mapping algorithm to obtain a one-dimensional array corresponding to the vector feature coordinates;

[0068] The one-dimensional array and the vector feature type are represented by one-hot encoding to obtain the vector feature parameter.

[0069] Exemplarily, the vector feature coordinates (x, y) in the vector feature parameters are mapped to a one-dimensional x×w+y using row-major order, thereby reducing the length of the tag sequence, where w is the default width of the vector graphics. <eos>, to indicate the completion of the SVG Path sequence. If the default width and height of the vector graphic are set to 100, the one-dimensional position parameter may have 10,000 possible values. Four one-hot vectors are used for representation. Each one-hot vector is 10004-dimensional. The first one-hot vector is used to indicate the type of vector feature and whether it is a special mark. <eos>The following three one-hot vectors are used to indicate the vector feature coordinates required by the vector feature type. If the vector feature type is C, the coordinates of the three control points need to be indicated by the remaining three one-hot vectors. Since other vector feature types only need to use an additional one-hot vector to indicate the position parameter, the special mark <eos>There is no need to use any extra vectors, so for these cases the system discards them when converting the SVGPath to a vector shape.

[0070] Step S104: combining at least one of the target graphic components according to the vector feature parameters to obtain a target vector graphic corresponding to the pixel graphic.

[0071] Exemplarily, the target graphic components are combined according to the positions of the target graphic components in the vector graphics indicated by the vector feature parameters to obtain the target vector graphics.

[0072] In some implementations, combining at least one of the target graphic components according to the vector feature parameters to obtain a target vector graphic corresponding to the pixel graphic includes:

[0073] The vector feature parameters of the target graphic component are input into a preset renderer for differentiable rendering to obtain the target vector graphics.

[0074] Exemplarily, a differentiable DiffVG renderer is used to perform differentiable rendering on each target graphic component based on the input vector feature parameters to obtain a target vector graphic composed of each target graphic component.

[0075] See also Figure 2 , Figure 2 This is a usage scenario diagram of a graphics conversion method provided by an embodiment of the present application. Figure 2 As shown, the pixel graphics and the existing graphic components identified in the i-1th step are used as the input of the first encoder, and the first hidden information of the pixel graphics and the second hidden information of the existing graphic components are compared to determine the target hidden information of the target graphic component. After decoding by the decoder, the vector feature parameters of the target graphic component are output based on the target hidden information. Finally, the target vector graphics are rendered based on the vector feature parameters of each target graphic component, thereby realizing the conversion from pixel graphics to vector graphics.

[0076] The graphics conversion method provided in the above embodiment obtains the pixel graphics to be converted; identifies the target graphics component in the pixel graphics and extracts the target hidden space information of the target graphics component; decodes the target hidden space information to obtain vector feature parameters for describing the target graphics component; combines at least one of the target graphics components according to the vector feature parameters to obtain the target vector graphics corresponding to the pixel graphics. The graphics conversion method provided in this application does not require training the conversion model under the supervision of vector graphics, which reduces the complexity of converting the pixel image into the target vector graphics.

[0077] See also Figure 3 , Figure 3 It is a schematic diagram of a graphic conversion device provided in one embodiment of the present application. The graphic conversion device can be configured in a server or a terminal to execute the aforementioned graphic conversion method.

[0078] like Figure 3 As shown, the graphic conversion device includes: a pixel graphic acquisition module 110, a graphic component extraction module 120, a vector feature determination module 130, and a vector graphic generation module 140.

[0079] A pixel graphics acquisition module 110 is used to acquire a pixel graphics to be converted;

[0080] A graphic component extraction module 120, configured to identify a target graphic component in the pixel graphic and extract target hidden space information of the target graphic component;

[0081] A vector feature determination module 130, configured to decode the target hidden space information to obtain vector feature parameters for describing the target graphic component;

[0082] The vector graphics generating module 140 is used to combine at least one of the target graphics components according to the vector feature parameters to obtain a target vector graphics corresponding to the pixel graphics.

[0083] In some implementations, when the graphic component extraction module 120 is used to identify the target graphic component in the pixel graphic and extract the target hidden space information of the target graphic component, it is also used to:

[0084] Identify the pixel pattern by a first encoder to extract first hidden space information of the pixel pattern;

[0085] Identifying an existing graphic component by using the first encoder, and extracting second hidden space information of the existing graphic component;

[0086] The first hidden space information and the second hidden space information are input into a second encoder for identification, and when the first hidden space information and the second hidden space information do not meet a preset condition, target hidden space information of the target graphic component is extracted.

[0087] In some embodiments, the graphic component extraction module 120, when inputting the first hidden space information and the second hidden space information into the second encoder for identification, extracting the target hidden space information of the target graphic component when the first hidden space information and the second hidden space information do not meet the preset condition, is further configured to:

[0088] The first hidden space information and the second hidden space information are input into a second encoder for identification, and when the second hidden space information does not match the first hidden space information, target hidden space information and color parameters of the target graphic component are extracted.

[0089] In some implementations, the vector feature determination module 130, when used to decode the target hidden space information to obtain the vector feature parameters for describing the target graphic component, is further used to:

[0090] The target hidden space information is decoded to obtain a vector feature type and a corresponding vector feature coordinate for describing the target graphic component.

[0091] In some implementations, the vector feature determination module 130, when used to decode the target hidden space information to obtain the vector feature type and the corresponding vector feature coordinates for describing the target graphic component, is further used to:

[0092] The target hidden space information is decoded to obtain vector feature coordinates corresponding to at least one of a drawing starting point, a straight line vector, and a curve vector of the target graphic component.

[0093] In some implementations, the vector feature determination module 130, when used to decode the target hidden space information to obtain the vector feature type and the corresponding vector feature coordinates for describing the target graphic component, is further used to:

[0094] Mapping the vector feature coordinates based on a row-priority mapping algorithm to obtain a one-dimensional array corresponding to the vector feature coordinates;

[0095] The one-dimensional array and the vector feature type are represented by one-hot encoding to obtain the vector feature parameter.

[0096] In some implementations, the vector graphics generation module 140, when used to combine at least one of the target graphic components according to the vector feature parameters to obtain the target vector graphic corresponding to the pixel graphic, is further used to:

[0097] The vector feature parameters of the target graphic component are input into a preset renderer for differentiable rendering to obtain the target vector graphics.

[0098] It should be noted that those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described devices and modules and units can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0099] The method and apparatus of the present application can be used in many general or special computing system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronic devices, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, etc. The present application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present application can also be practiced in distributed computing environments, in which tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media including storage devices.

[0100] Exemplarily, the above method and apparatus may be implemented in the form of a computer program. The computer program may be implemented in Figure 4 Runs on the computer device shown.

[0101] See also Figure 4 , Figure 4 A schematic block diagram of the structure of a computer device provided in an embodiment of the present application. The computer device may be a server or a terminal.

[0102] like Figure 4 As shown, the computer device includes a processor, a memory, and a network interface connected via a system bus, wherein the memory may include a storage medium and an internal memory.

[0103] The storage medium can store an operating system and a computer program. The computer program includes program instructions, and when the program instructions are executed, the processor can execute any one of the graphic conversion methods.

[0104] The processor is used to provide computing and control capabilities and support the operation of the entire computer equipment.

[0105] The internal memory provides an environment for the operation of the computer program in the storage medium. When the computer program is executed by the processor, the processor can execute any one of the graphic conversion methods.

[0106] The network interface is used for network communication, such as sending assigned tasks, etc. Those skilled in the art will appreciate that Figure 4 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

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

[0108] In one embodiment, the processor is used to run a computer program stored in the memory to implement the following steps:

[0109] Get the pixel graphics to be converted;

[0110] Identifying a target graphic component in the pixel graphic and extracting target hidden space information of the target graphic component;

[0111] Decoding the target hidden space information to obtain vector feature parameters for describing the target graphic component;

[0112] At least one of the target graphic components is combined according to the vector feature parameters to obtain a target vector graphic corresponding to the pixel graphic.

[0113] In some embodiments, the processor, in the process of realizing identification of a target graphic component in the pixel graphic and extracting target hidden space information of the target graphic component, is used to realize:

[0114] Identify the pixel pattern by a first encoder to extract first hidden space information of the pixel pattern;

[0115] Identifying an existing graphic component by using the first encoder, and extracting second hidden space information of the existing graphic component;

[0116] The first hidden space information and the second hidden space information are input into a second encoder for identification, and when the first hidden space information and the second hidden space information do not meet a preset condition, target hidden space information of the target graphic component is extracted.

[0117] In some embodiments, the processor, in the process of inputting the first hidden space information and the second hidden space information into the second encoder for identification, and extracting the target hidden space information of the target graphic component when the first hidden space information and the second hidden space information do not meet a preset condition, is used to implement:

[0118] The first hidden space information and the second hidden space information are input into a second encoder for identification, and when the second hidden space information does not match the first hidden space information, target hidden space information and color parameters of the target graphic component are extracted.

[0119] In some embodiments, the processor, in the process of decoding the target hidden space information to obtain the vector feature parameters for describing the target graphic component, is used to implement:

[0120] The target hidden space information is decoded to obtain a vector feature type and a corresponding vector feature coordinate for describing the target graphic component.

[0121] In some embodiments, the processor, in the process of decoding the target hidden space information to obtain the vector feature type and the corresponding vector feature coordinates for describing the target graphic component, is used to implement:

[0122] The target hidden space information is decoded to obtain vector feature coordinates corresponding to at least one of a drawing starting point, a straight line vector, and a curve vector of the target graphic component.

[0123] In some embodiments, the processor, in the process of decoding the target hidden space information to obtain the vector feature type and the corresponding vector feature coordinates for describing the target graphic component, is used to implement:

[0124] Mapping the vector feature coordinates based on a row-priority mapping algorithm to obtain a one-dimensional array corresponding to the vector feature coordinates;

[0125] The one-dimensional array and the vector feature type are represented by one-hot encoding to obtain the vector feature parameter.

[0126] In some embodiments, the processor, in implementing the process of combining at least one of the target graphic components according to the vector feature parameters to obtain the target vector graphic corresponding to the pixel graphic, is used to implement:

[0127] The vector feature parameters of the target graphic component are input into a preset renderer for differentiable rendering to obtain the target vector graphics.

[0128] It should be noted that those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the above-described graphic conversion can refer to the corresponding process in the aforementioned graphic conversion control method embodiment, and will not be repeated here.

[0129] An embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored. The computer program includes program instructions. The method implemented when the program instructions are executed can refer to the various embodiments of the graphic conversion method of the present application.

[0130] The computer-readable storage medium may be an internal storage unit of the computer device described in the foregoing embodiment, such as a hard disk or memory of the computer device. The computer-readable storage medium may also be an external storage device of the computer device, such as a plug-in hard disk, a smart memory card (SmartMedia Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc., equipped on the computer device.

[0131] It should be understood that the terms used in this application specification are only for the purpose of describing specific embodiments and are not intended to limit the application. As used in this application specification and the appended claims, unless the context clearly indicates otherwise, the singular forms of "a", "an" and "the" are intended to include plural forms.

[0132] It should also be understood that the term "and / or" used in the present specification and the appended claims refers to any combination of one or more of the associated listed items and all possible combinations, including these combinations. It should be noted that, in this article, the terms "include", "comprise" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or system. In the absence of further restrictions, an element defined by the sentence "including a..." does not exclude the presence of other identical elements in the process, method, article or system including the element.

[0133] The serial numbers of the embodiments of the present application are for description only and do not represent the advantages and disadvantages of the embodiments. The above description is only a specific implementation mode of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in the present application, and these modifications or replacements should be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.< / eos> < / eos> < / eos> < / null> < / path> < / path> < / path> < / path> < / path> < / path> < / path>

Claims

1. A graphics conversion method, characterized in that: The method comprises: Get the pixel graphics to be converted; Identifying a target graphic component in the pixel graphic and extracting target hidden space information of the target graphic component; Decoding the target hidden space information to obtain vector feature parameters for describing the target graphic component; At least one of the target graphic components is combined according to the vector feature parameters to obtain a target vector graphic corresponding to the pixel graphic.

2. The graphics conversion method according to claim 1, characterized in that: The step of identifying the target graphic component in the pixel graphic and extracting target hidden space information of the target graphic component includes: Identify the pixel pattern by a first encoder to extract first hidden space information of the pixel pattern; Identifying an existing graphic component by using the first encoder, and extracting second hidden space information of the existing graphic component; The first hidden space information and the second hidden space information are input into a second encoder for identification, and when the first hidden space information and the second hidden space information do not meet a preset condition, target hidden space information of the target graphic component is extracted.

3. The graphics conversion method according to claim 2, characterized in that: The step of inputting the first hidden space information and the second hidden space information into a second encoder for identification, and extracting target hidden space information of the target graphic component when the first hidden space information and the second hidden space information do not meet a preset condition, comprises: The first hidden space information and the second hidden space information are input into a second encoder for identification, and when the second hidden space information does not match the first hidden space information, target hidden space information and color parameters of the target graphic component are extracted.

4. The graphics conversion method according to claim 1, characterized in that: The decoding of the target hidden space information to obtain vector feature parameters for describing the target graphic component includes: The target hidden space information is decoded to obtain a vector feature type and a corresponding vector feature coordinate for describing the target graphic component.

5. The graphics conversion method according to claim 4, characterized in that: The decoding of the target hidden space information to obtain a vector feature type and a corresponding vector feature coordinate for describing the target graphic component includes: The target hidden space information is decoded to obtain vector feature coordinates corresponding to at least one of a drawing starting point, a straight line vector, and a curve vector of the target graphic component.

6. The graphics conversion method according to claim 4, characterized in that: The decoding of the target hidden space information to obtain a vector feature type and a corresponding vector feature coordinate for describing the target graphic component includes: Mapping the vector feature coordinates based on a row-priority mapping algorithm to obtain a one-dimensional array corresponding to the vector feature coordinates; The one-dimensional array and the vector feature type are represented by one-hot encoding to obtain the vector feature parameter.

7. The graphics conversion method according to claim 1, characterized in that: The step of combining at least one of the target graphic components according to the vector feature parameters to obtain a target vector graphic corresponding to the pixel graphic includes: The vector feature parameters of the target graphic component are input into a preset renderer for differentiable rendering to obtain the target vector graphics.

8. A graphics conversion device, characterized in that: The graphic conversion device comprises: A pixel graphics acquisition module, used to acquire pixel graphics to be converted; A graphic component extraction module, used to identify a target graphic component in the pixel graphic and extract target hidden space information of the target graphic component; A vector feature determination module, used for decoding the target hidden space information to obtain vector feature parameters for describing the target graphic component; The vector graphics generation module is used to combine at least one of the target graphics components according to the vector feature parameters to obtain a target vector graphics corresponding to the pixel graphics.

9. A computer device, characterized in that: The computer device comprises a processor, a memory, and a computer program stored in the memory and executable by the processor, wherein when the computer program is executed by the processor, the steps of the graphics conversion method according to any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein when the computer program is executed by a processor, the steps of the graphics conversion method according to any one of claims 1 to 7 are implemented.