Method and device for constructing resource bundle based on existing art resources and medium
By loading the figure to be decomposed and reconstructing and boundary extraction based on the color histogram, the problem of time-consuming and labor-intensive acquisition of traditional resource methods is solved, and the process of artistic resources is achieved automatically, the efficiency and quality of resource integration is improved, and the scope of use of national characteristics is expanded.
Patent Information
- Application Number
- CN202411889276.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-20
- Publication Date
- 2025-05-02
AI Technical Summary
In the fields of artistic creation and UI design, traditional methods of obtaining and managing art resources rely on manual screening and editing, which is time-consuming and labor-intensive and difficult to ensure the accuracy and consistency of resources. Especially in the field of national art resources, due to scarce resources and copyright disputes, it is difficult to effectively utilize and expand.
By loading the to-be-decomposed figures containing the figures in the first resource set, reconstruct the to-be-decomposed figures based on the color histogram, boundary extraction and resource matching are performed, new resource packages are generated, and copyright disputes are avoided.
It realizes automated processing of art resources, improves resource integration efficiency and quality, provides rich interactive functions and path point dragging functions, simplifies the user editing process, and expands the scope of use of national characteristics resources.
Smart Images

Figure CN119919509A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of resource construction, and in particular to a method, device and medium for constructing a resource package based on existing art resources. Background Art
[0002] In the fields of art creation, UI design, etc., the acquisition and management of art resources is a crucial link. Traditional resource acquisition methods often rely on manual screening and editing, which is not only time-consuming and labor-intensive, but also difficult to ensure the accuracy and consistency of resources. Especially when it comes to national art resources, there are not many basic artistic elements and the craftsmanship is complicated. Due to the strength of dissemination, the strength of secondary creation is weak, making this category of resources relatively scarce. In addition, it is also necessary to avoid copyright disputes caused by secondary creation.
[0003] Therefore, it is particularly important to develop a method that can automatically process art resources. The present invention aims to construct a new resource package based on existing platform resources while avoiding copyright disputes. Summary of the invention
[0004] At least one aspect or advantage of the invention will be set forth in part in the following description, or may be obvious from the description, or may be learned by practice of the disclosed subject matter.
[0005] According to a first aspect of the present invention, a method for constructing a resource package based on existing art resources includes:
[0006] Loading the graphics to be decomposed including the graphics in the first resource set;
[0007] Reconstruct the decomposed image based on the color histogram to obtain a reconstructed image;
[0008] Boundary extraction based on the reconstructed image;
[0009] Matching the first resource based on the boundary extraction result;
[0010] Scaling the first resource based on the matching result and forming a second resource;
[0011] obtaining a third resource based on the second resource and the unmatched boundary;
[0012] The first resource includes vectorized graphics.
[0013] According to an embodiment of the present invention, reconstructing the graph to be decomposed includes:
[0014] The red, green and blue pixel values of the pixel points in the to-be-decomposed image are subjected to histogram equalization according to the distribution functions of the red histogram, the green histogram and the blue histogram, respectively, to obtain a first reconstructed image;
[0015] The grayscale image of the first reconstructed figure is subjected to histogram equalization based on a distribution function of a grayscale histogram to obtain a reconstructed image.
[0016] According to one embodiment of the present invention, the boundary extraction includes:
[0017] The grayscale values of the pixels whose grayscale values in the reconstructed image are higher than the first grayscale preset value are set to the second grayscale preset value, and the grayscale values of the pixels whose grayscale values are lower than the first grayscale preset value are set to 0, so as to obtain a binary image;
[0018] The binary image is segmented, and the decomposed image is recognized using a pre-trained convolutional neural network to determine the sub-image containing the boundary;
[0019] The boundary is obtained based on the combination of sub-images containing the boundary.
[0020] According to one embodiment of the present invention, a pre-trained convolutional neural network is used to identify a binary image and determine the type of the first resource contained in the binary image;
[0021] Among them, the training process of the pre-trained convolutional neural network includes:
[0022] Rendering the vectorized graphics contained in the first resource into a canvas to obtain a first image;
[0023] Obtaining a plurality of second images by flipping, distorting, scaling or reversing the graphics in the canvas;
[0024] Segment the first image and the plurality of second images to obtain a plurality of sub-images, and use the sub-images in which the proportion of valid pixels in the sub-images is higher than a first threshold as positive samples, and use the sub-images in which the proportion of valid pixels in the sub-images is not higher than the first threshold as negative samples;
[0025] Construct a convolutional neural network, use positive and negative samples to train the convolutional neural network, and stop training when the recognition rate of positive samples is greater than 90% and the misrecognition rate of negative samples is less than 10%.
[0026] According to an embodiment of the present invention, matching the first resource based on the boundary extraction result includes:
[0027] Obtaining the boundary distribution area based on the result of boundary extraction;
[0028] In response to a user's interactive operation on the graph to be decomposed, obtaining a first boundary distribution area;
[0029] According to the first boundary distribution area, obtaining a type of the first resource corresponding to the first boundary distribution area;
[0030] Drawing a first layer in the user operation area based on the type of the first resource; the first layer contains the first resource, and the first layer includes an interactive area for zooming, translating and rotating, and the interactive area translates, zooms and rotates the first resource in the first layer in response to the user operation;
[0031] In response to the user's confirmation of the graphic in the first layer, a second resource is generated based on the user's operation record and the first resource graphic, wherein the second resource includes a graphic after the first resource graphic is translated, scaled and rotated.
[0032] According to an embodiment of the present invention, the interactive area further includes a drag anchor point of a path point of the first resource; the path point of the first resource is a path point included in a vectorized graphic included in the first resource.
[0033] According to an embodiment of the present invention, the third resource acquisition process includes:
[0034] In response to a user's operation on the first layer, obtaining a second boundary distribution area covered by the first layer;
[0035] The grayscale value of the second boundary distribution area is set to 0 or 255;
[0036] A part or all of the pixels of the second resource are drawn to the second boundary distribution area to obtain a third resource.
[0037] According to one embodiment of the present invention, the negative samples further include sub-images obtained by segmenting images in the FashionMNIST or DeepFashion2 dataset.
[0038] According to a second aspect of the present invention, an electronic device includes a processor and a memory; the memory is used to store programs; the processor executes the program to implement the method for constructing a resource package based on existing art resources as described in any one of claims 1-8.
[0039] According to a third aspect of the present invention, a computer-readable storage medium stores a program, and the program is executed by a processor to implement the method for constructing a resource package based on existing art resources as described in any one of claims 1-8. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] Figure 1 A flowchart of a method for constructing a resource package based on existing art resources is shown. DETAILED DESCRIPTION
[0041] The present disclosure will now be discussed with reference to several exemplary embodiments. It should be understood that these embodiments are discussed only to enable those skilled in the art to better understand and thus implement the present disclosure, rather than implying any limitation on the scope of the present disclosure.
[0042] As used herein, the term "including" and its variants are to be interpreted as open-ended terms meaning "including but not limited to". The term "based on" is to be interpreted as "based at least in part on". The terms "one embodiment" and "an embodiment" are to be interpreted as "at least one embodiment". The term "another embodiment" is to be interpreted as "at least one other embodiment". The orientation or position relationship indicated by the terms "upper", "lower", "left", "right", "front", "back", "top", "bottom", "inner", "outer", "vertical", "horizontal", "lateral", "longitudinal" and the like is based on the orientation or position relationship shown in the accompanying drawings. These terms are mainly for better describing the present application and its embodiments, and are not used to limit the indicated devices, elements or components to have a specific orientation, or to be constructed and operated in a specific orientation. In addition, in addition to being used to indicate an orientation or position relationship, some of the above terms may also be used to indicate other meanings, such as the term "upper" may also be used to indicate a certain dependency or connection relationship in some cases. For those of ordinary skill in the art, the specific meanings of these terms in this application can be understood according to the specific circumstances. In addition, the terms "install", "set", "provided with", "connected" and "connected" should be understood in a broad sense. For example, it can be a fixed connection, a detachable connection, or an integral structure; it can be a mechanical connection, or an electrical connection; it can be directly connected, or indirectly connected through an intermediate medium, or it can be an internal connection between two devices, elements or components. For those of ordinary skill in the art, the specific meanings of the above terms in this application can be understood according to the specific circumstances. In addition, the terms "first", "second", etc. are mainly used to distinguish different devices, elements or components (the specific types and structures may be the same or different), and are not used to indicate or imply the relative importance and quantity of the indicated devices, elements or components. Unless otherwise specified, "plurality" means two or more.
[0043] According to an embodiment of the present invention, a method for constructing a resource package based on existing art resources includes:
[0044] Loading the graphics to be decomposed including the graphics in the first resource set;
[0045] Reconstruct the decomposed image based on the color histogram to obtain a reconstructed image;
[0046] Boundary extraction based on the reconstructed image;
[0047] Matching the first resource based on the boundary extraction result;
[0048] Scaling the first resource based on the matching result and forming a second resource;
[0049] obtaining a third resource based on the second resource and the unmatched boundary;
[0050] The first resource includes vectorized graphics.
[0051] In this embodiment, a method for constructing a resource package based on existing art resources is proposed. First, the graphics to be decomposed that include the graphics in the first resource set are loaded into the system. Secondly, the color distribution and characteristics of the graphics to be decomposed are analyzed using a color histogram, and the graphics to be decomposed are reconstructed according to the results of the color histogram, and the boundaries are extracted on the reconstructed image using an appropriate algorithm. Thirdly, the extracted boundaries are matched with the images in the first resource set to find image resources corresponding to the various parts of the graphics to be decomposed. Finally, for the successfully matched vector resources, they are scaled according to the size and proportion of the corresponding parts in the graphics to be decomposed to obtain the second resource; for the boundary parts that are not successfully matched, they are combined with the second resource to obtain the third resource.
[0052] Specifically, the graphics to be decomposed may be extracted from an existing art resource library or provided by a user, and these graphics may be in vectorized or bitmap format.
[0053] Specifically, according to the result of the color histogram, the decomposed image is reconstructed to obtain a clearer and easier-to-process image, which can effectively eliminate noise in the image and improve the accuracy of subsequent processing.
[0054] Specifically, the purpose of boundary extraction is to identify the contours of each figure in the image in order to reasonably segment the image. The boundary extraction method can be edge extraction algorithm, machine learning algorithm, threshold segmentation method, etc.
[0055] Specifically, the boundary extraction result is matched with the image in the first resource. If the match is successful, the corresponding image is scaled and recorded as the second resource. Compared with the first resource, which is a public resource whose copyright belongs to others, the second resource is a new resource after secondary processing by the user.
[0056] Specifically, if the match fails, it will be further processed together with the second resource to obtain the third resource. Compared with the first resource and the second resource, the third resource is a newly constructed resource package. Through the above method, a new resource package can be constructed based on the existing resources of the platform, which is of great significance for the expansion of some niche resources, especially ethnic resources.
[0057] According to an embodiment of the present invention, reconstructing the graph to be decomposed includes:
[0058] The red, green and blue pixel values of the pixel points in the to-be-decomposed image are subjected to histogram equalization according to the distribution functions of the red histogram, the green histogram and the blue histogram, respectively, to obtain a first reconstructed image;
[0059] The grayscale image of the first reconstructed figure is subjected to histogram equalization based on a distribution function of a grayscale histogram to obtain a reconstructed image.
[0060] In this embodiment, a specific method for reconstructing a decomposed image based on a color histogram is proposed. Based on the RGB color space, the red, green and blue channels of the image are separated; then the pixel values of each channel are histogram equalized according to the distribution function of the red histogram, the green histogram and the blue histogram, and the equalized color channels are merged to form a first reconstructed image. Then, the grayscale image of the first reconstructed image is histogram equalized based on the distribution function of the grayscale histogram, and finally the reconstructed image is obtained.
[0061] Specifically, by reconstructing the graphics to be decomposed based on the color histogram, the contrast of the image can be enhanced, the difference between the bright and dark parts of the image can be more obvious, and the details in the image can be more clearly visible. In addition, the image can maintain a good visual effect under different lighting conditions.
[0062] According to one embodiment of the present invention, the boundary extraction includes:
[0063] The grayscale values of the pixels whose grayscale values in the reconstructed image are higher than the first grayscale preset value are set to the second grayscale preset value, and the grayscale values of the pixels whose grayscale values are lower than the first grayscale preset value are set to 0, so as to obtain a binary image;
[0064] The binary image is segmented, and the decomposed image is recognized using a pre-trained convolutional neural network to determine the sub-image containing the boundary;
[0065] The boundary is obtained based on the combination of sub-images containing the boundary.
[0066] In this embodiment, a specific method for boundary extraction is proposed. First, the reconstructed image is binarized to obtain a binary image; then the binary image is segmented and recognized using a pre-trained convolutional neural network to determine the sub-image containing the boundary; finally, multiple sub-images containing the boundary are combined to obtain the boundary.
[0067] Specifically, when the reconstructed image is binarized, each pixel in the reconstructed image is traversed, and if the grayscale value of the pixel in the image is higher than the first grayscale preset value, its grayscale value is set to the second grayscale preset value, and if it is lower than the first grayscale preset value, its grayscale value is set to 0. For example, the grayscale value of the pixel with a grayscale value greater than 55 is set to 255, that is, it is represented as white, and the grayscale value of the pixel with a grayscale value less than or equal to 55 is 0, that is, it is represented as black, and finally a black and white binary image can be obtained.
[0068] Specifically, the first grayscale preset value may be set according to the distribution of color blocks of the reconstructed image, in order to make the boundary of the image clearer.
[0069] Specifically, the segmentation of a binary image can be achieved through a variety of methods, such as connected region-based segmentation, edge-based segmentation, etc., the purpose of which is to separate different parts of the image.
[0070] Specifically, the decomposed image is recognized using a pre-trained convolutional neural network to obtain sub-images containing boundaries in the decomposed image, and then these sub-images are combined and spliced together to obtain a complete boundary.
[0071] According to one embodiment of the present invention, a pre-trained convolutional neural network is used to identify a binary image and determine the type of the first resource contained in the binary image;
[0072] Among them, the training process of the pre-trained convolutional neural network includes:
[0073] Rendering the vectorized graphics contained in the first resource into a canvas to obtain a first image;
[0074] Obtaining a plurality of second images by flipping, distorting, scaling or reversing the graphics in the canvas;
[0075] Segment the first image and the plurality of second images to obtain a plurality of sub-images, and use the sub-images in which the proportion of valid pixels in the sub-images is higher than a first threshold as positive samples, and use the sub-images in which the proportion of valid pixels in the sub-images is not higher than the first threshold as negative samples;
[0076] Construct a convolutional neural network, use positive and negative samples to train the convolutional neural network, and stop training when the recognition rate of positive samples is greater than 90% and the misrecognition rate of negative samples is less than 10%.
[0077] In this embodiment, it is proposed that the system uses a pre-trained convolutional neural network to identify a binary image, determine the type of the first resource contained in the binary image, and propose a training process of the pre-trained convolutional neural network.
[0078] Specifically, the type of the first resource refers to the type of artwork represented by the image in the first resource, including the brim style of a hat, the pattern style of a carpet, the carvings of a headdress, and the like.
[0079] Specifically, the training process of the pre-trained convolutional neural network is as follows: first, data preparation is performed, that is, a first image and several second images are obtained, wherein the first image is obtained by rendering the vectorized graphics contained in the first resource into the canvas, and the second image is obtained by flipping, twisting, scaling or flipping the first image; then, the image is segmented and sample selection is performed, and the image segmentation can be based on the segmentation of connected regions, the segmentation based on edges, etc., to obtain several sub-images; then, sample selection is performed based on several sub-images, and the sub-images in which the proportion of valid pixels in the sub-image is higher than the first threshold are taken as positive samples, and the sub-images in which the proportion of valid pixels is not higher than the first threshold are taken as negative samples. Finally, a convolutional neural network is constructed and trained, and the data sets used for training are positive samples and negative samples. The training is stopped when the recognition rate of the positive samples is greater than 90% and the misrecognition rate of the negative samples is less than 10%.
[0080] Specifically, the selection of the first threshold determines the quality and quantity of positive samples and negative samples, so the first threshold needs to be set according to the actual situation. For example, if the required image quality is very high, the first threshold can be set to a higher value, such as 80% to 90%; if the number of positive samples required for training is large, the first threshold can be set to a lower value, such as 30% to 50%.
[0081] Specifically, by using a pre-trained convolutional neural network for recognition, the type of the first resource contained in the binary image can be determined.
[0082] According to an embodiment of the present invention, matching the first resource based on the boundary extraction result includes:
[0083] Obtaining the boundary distribution area based on the result of boundary extraction;
[0084] In response to a user's interactive operation on the graph to be decomposed, obtaining a first boundary distribution area;
[0085] According to the first boundary distribution area, obtaining a type of the first resource corresponding to the first boundary distribution area;
[0086] Drawing a first layer in the user operation area based on the type of the first resource; the first layer contains the first resource, and the first layer includes an interactive area for zooming, translating and rotating, and the interactive area translates, zooms and rotates the first resource in the first layer in response to the user operation;
[0087] In response to the user's confirmation of the graphic in the first layer, a second resource is generated based on the user's operation record and the first resource graphic, wherein the second resource includes a graphic after the first resource graphic is translated, scaled and rotated.
[0088] In this embodiment, this embodiment proposes the specific content of matching the first resource based on the boundary extraction result. First, according to the result of boundary extraction, that is, the extracted boundary, the boundary distribution area is determined, and which parts of the graph are surrounded by the boundary are understood. Secondly, through the user's click, drag, zoom, scale, rotate and other operations in the interactive area, the first boundary distribution area is obtained. The first boundary distribution area can be the part that the user is interested in or wants to further understand and process; and the type of the first resource corresponding to it is obtained based on the first boundary distribution area. Thirdly, based on the type of the first resource, the system draws a first layer corresponding to the first resource type in the user operation area. The first layer not only contains the first resource, but also contains interactive areas for translation, scaling and rotation. These interactive areas allow the user to translate, scale and rotate the first resource in the first layer through simple operations. Finally, after the user translates, scales and rotates the graph in the first layer, the changes are submitted through some confirmation operation (such as clicking "OK", "Finish" and other buttons). The system generates a second resource based on the user's operation record and the initial state of the first resource graph. The second resource is a new resource containing the first resource graph after translation, scaling and rotation.
[0089] Specifically, in this embodiment, users are allowed to customize graphics through simple interactive operations to generate graphic resources that meet their needs. At the same time, through boundary extraction and resource matching technology, the system can automatically recommend appropriate resource types to users to improve processing efficiency and accuracy.
[0090] According to an embodiment of the present invention, the interactive area further includes a drag anchor point of a path point of the first resource; the path point of the first resource is a path point included in a vectorized graphic included in the first resource.
[0091] In this embodiment, when the interactive area also includes a drag anchor point of a path point of the first resource, this means that the user has higher flexibility and accuracy when processing vectorized graphics.
[0092] Specifically, these anchor points are key points in the vectorized graphics, which define the shape and outline of the graphics. By dragging these anchor points, users can directly adjust the shape of the graphics, rather than just translating, scaling, and rotating. Path points refer to points on the path that constitute the outline of the first resource (i.e., the vectorized graphics selected by the user or matched by the system). These points are connected by straight lines or curves to form the boundaries of the graphics.
[0093] According to an embodiment of the present invention, the third resource acquisition process includes:
[0094] In response to a user's operation on the first layer, obtaining a second boundary distribution area covered by the first layer;
[0095] The grayscale value of the second boundary distribution area is set to 0 or 255;
[0096] A part or all of the pixels of the second resource are drawn to the second boundary distribution area to obtain a third resource.
[0097] In this embodiment, a process for obtaining a third resource is proposed, including: based on the user's operation, the system identifies a specific area covered by the first layer, namely the second boundary distribution area, which may be the part where the user wants to apply certain changes or effects. Then, the grayscale value of the second boundary distribution area is set to 0 or 255 to make it easier to distinguish and operate the pixels in the area in subsequent processing. Finally, the system copies the pixels of the second resource into the second boundary distribution area, and finally forms the third resource through pixel replacement, mixing or other processing methods. The third resource is a brand new resource package constructed based on the existing resources.
[0098] Specifically, the second boundary distribution area is obtained based on the user's operation, which represents the user's intention or certain effects that he wants to achieve, and can make the final third resource closer to the user.
[0099] Specifically, the third resource is obtained based on further processing of the second resource. The third resource is a brand-new resource obtained based on user operations and belongs to a new resource package. Moreover, since the third resource is obtained based on existing resources, the third resource has a certain correlation with the original resource and belongs to the same field of resources. In this way, the resource package in this field is effectively expanded.
[0100] According to one embodiment of the present invention, the negative samples further include sub-images obtained by segmenting images in the FashionMNIST or DeepFashion2 dataset.
[0101] In this embodiment, FashionMNIST is an image dataset that replaces the MNIST handwritten digit set. It contains 70,000 front images of different products in 10 categories. Each image is a 28x28 grayscale image, divided into 60,000 training samples and 10,000 test samples. It is mainly used to test the performance of machine learning and deep learning algorithms. DeepFashion2 is a large-scale clothing image dataset that contains rich image and annotation information.
[0102] Specifically, using sub-images obtained by image segmentation in the FashionMNIST or DeepFashion2 datasets as negative samples can effectively improve the generalization ability of convolutional neural networks and help improve the model's ability to recognize different types of image features.
[0103] In a second aspect, the present invention provides an electronic device, including a processor and a memory; the memory is used to store programs; the processor executes the program to implement the method of constructing a resource package based on existing art resources described in the first aspect.
[0104] In a third aspect, the present invention proposes a computer-readable storage medium, wherein the storage medium stores a program, and the program is executed by a processor to implement the method of constructing a resource package based on existing art resources as described in the first aspect.
[0105] The beneficial effects of the present invention are as follows: by implementing the method of the present invention, the integration efficiency and quality of art resources can be significantly improved, and art resources can be automatically extracted and reconstructed from the graphics to be decomposed to form a resource package that can be used for subsequent design or development. At the same time, the method also provides rich interactive functions and path point dragging functions, allowing users to edit and adjust resources more conveniently. In addition, by introducing FashionMNIST or DeepFashion2 datasets as negative samples for training, the generalization ability and recognition accuracy of the convolutional neural network are improved.
[0106] Those of ordinary skill in the art will appreciate that the modules and algorithm steps described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0107] 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 equipment can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0108] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the modules is only a logical function division. There may be other division methods in actual implementation, such as multiple modules 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 interfaces, indirect coupling or communication connection of devices or modules, which can be electrical, mechanical or other forms.
[0109] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical modules, that is, they may be located in one place or distributed on multiple network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the embodiments of the present invention.
[0110] In addition, each functional module in the embodiment of the present invention may be integrated into one processing module, or each module may exist physically separately, or two or more modules may be integrated into one module.
[0111] If the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the energy-saving signal sending / receiving method of each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a ROM, a RAM, a magnetic disk, or an optical disk.
[0112] The above description is only a preferred embodiment of the present application and an explanation of the technical principles used. Those skilled in the art should understand that the scope of the invention involved in the present application is not limited to the technical solution formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the inventive concept. For example, the above features are replaced with (but not limited to) technical features with similar functions disclosed in the present application.
[0113] It should be understood that the size of the sequence number of each step in the content of the invention and the embodiments of the present invention does not absolutely mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present invention. For the purpose of example and description, the foregoing description of the implementation of the present disclosure has been given. The foregoing description is not exhaustive and is not intended to limit the present disclosure to the exact form disclosed. Various deformations and modifications may exist according to the above teachings, or various deformations and modifications may be obtained from the practice of the present disclosure. These embodiments are selected and described to illustrate the principles of the present disclosure and its practical application, so that those skilled in the art can use the present disclosure in various embodiments and various modifications suitable for the specific purpose conceived.
Claims
1. A method for constructing a resource package based on existing art resources, characterized in that: include: Loading the graphics to be decomposed including the graphics in the first resource set; Reconstruct the decomposed image based on the color histogram to obtain a reconstructed image; Boundary extraction based on the reconstructed image; Matching the first resource based on the boundary extraction result; Scaling the first resource based on the matching result and forming a second resource; obtaining a third resource based on the second resource and the unmatched boundary; The first resource includes vectorized graphics.
2. The method for constructing a resource package based on existing art resources as claimed in claim 1, characterized in that: The reconstructing of the decomposed graph comprises: The red, green and blue pixel values of the pixel points in the to-be-decomposed image are subjected to histogram equalization according to the distribution functions of the red histogram, the green histogram and the blue histogram, respectively, to obtain a first reconstructed image; The grayscale image of the first reconstructed figure is subjected to histogram equalization based on a distribution function of a grayscale histogram to obtain a reconstructed image.
3. The method for constructing a resource package based on existing art resources as claimed in claim 1, characterized in that: The boundary extraction comprises: The grayscale values of the pixels whose grayscale values in the reconstructed image are higher than the first grayscale preset value are set to the second grayscale preset value, and the grayscale values of the pixels whose grayscale values are lower than the first grayscale preset value are set to 0, so as to obtain a binary image; The binary image is segmented, and the decomposed image is recognized using a pre-trained convolutional neural network to determine the sub-image containing the boundary; The boundary is obtained based on the combination of sub-images containing the boundary.
4. The method for constructing a resource package based on existing art resources as claimed in claim 3, characterized in that: Using a pre-trained convolutional neural network to recognize the binary image, and determining the type of the first resource contained in the binary image; Among them, the training process of the pre-trained convolutional neural network includes: Rendering the vectorized graphics contained in the first resource into a canvas to obtain a first image; Obtaining a plurality of second images by flipping, distorting, scaling or reversing the graphics in the canvas; Segment the first image and the plurality of second images to obtain a plurality of sub-images, and use the sub-images in which the proportion of valid pixels in the sub-images is higher than a first threshold as positive samples, and use the sub-images in which the proportion of valid pixels in the sub-images is not higher than the first threshold as negative samples; Construct a convolutional neural network, use positive and negative samples to train the convolutional neural network, and stop training when the recognition rate of positive samples is greater than 90% and the misrecognition rate of negative samples is less than 10%.
5. The method for constructing a resource package based on existing art resources as claimed in claim 4, characterized in that: Matching the first resource based on the boundary extraction result includes: Obtaining the boundary distribution area based on the result of boundary extraction; In response to a user's interactive operation on the graph to be decomposed, obtaining a first boundary distribution area; According to the first boundary distribution area, obtaining a type of the first resource corresponding to the first boundary distribution area; Drawing a first layer in the user operation area based on the type of the first resource; the first layer contains the first resource, and the first layer includes an interactive area for zooming, translating and rotating, and the interactive area translates, zooms and rotates the first resource in the first layer in response to the user operation; In response to the user's confirmation of the graphic in the first layer, a second resource is generated based on the user's operation record and the first resource graphic, wherein the second resource includes a graphic after the first resource graphic is translated, scaled and rotated.
6. The method for constructing a resource package based on existing art resources as claimed in claim 5, characterized in that: The interactive area also includes a drag anchor point of a path point of the first resource; the path point of the first resource is a path point included in the vectorized graphics included in the first resource.
7. The method for constructing a resource package based on existing art resources as claimed in claim 5, characterized in that: The third resource acquisition process includes: In response to a user's operation on the first layer, obtaining a second boundary distribution area covered by the first layer; The grayscale value of the second boundary distribution area is set to 0 or 255; A part or all of the pixels of the second resource are drawn to the second boundary distribution area to obtain a third resource.
8. The method for constructing a resource package based on existing art resources as claimed in claim 3, characterized in that: The negative samples also include sub-images obtained by segmenting images in the FashionMNIST or DeepFashion2 datasets.
9. An electronic device, characterized in that ,, including a processor and a memory; the memory is used to store programs; the processor executes the program to implement the method for constructing a resource package based on existing art resources as described in any one of claims 1-8.
10. A computer-readable storage medium, characterized in that The storage medium stores a program, and the program is executed by a processor to implement the method for constructing a resource package based on existing art resources as described in any one of claims 1-8.