Scoring Method, Device, Computer-Readable Storage Medium, and Equipment for Design Drawings
The computer equipment automatically parses the source files of the design drawings, extracts layer color information and scores according to the color matching conditions, solving the problem of low manual scoring efficiency and insufficient accuracy, and achieving efficient and accurate design drawing scoring.
Patent Information
- Application Number
- CN202010122805.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-02-27
- Publication Date
- 2025-07-08
- Estimated Expiration
- 2040-02-27
AI Technical Summary
In the prior art, the scoring of design drawings mainly relies on manual methods, is inefficient and subjective deviations, resulting in insufficient scoring accuracy.
The computer equipment analyzes the source files of the design drawing, extracts the color information of each layer, and automatically scores the design drawing based on the preset color matching conditions and weights.
It improves the efficiency of design drawing scoring, reduces repetitive labor, ensures the accuracy and consistency of scores, and establishes a unified design drawing output standard.
Smart Images

Figure CN111369633B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technologies, and particularly to a method and apparatus for scoring design drawings, a computer-readable storage medium, and a computer device. Background Art
[0002] In the context of intelligent design and automated design, many design drawings are generated in batches by computer devices. These design drawings generated in batches vary in quality and are numerous in quantity. Before being put into use, they need to be reviewed and screened.
[0003] Currently, it is usually the case that manual methods are used to conduct color reviews and scoring of design drawings in order to screen out the design drawings that meet the requirements and then put them into use. However, manual review not only requires a large amount of time and is inefficient, but also, due to the different color perception abilities and different understandings of review rules of each person, the review and scoring processes vary from person to person, subjective biases are likely to occur, and the scoring accuracy is relatively low. Summary of the Invention
[0004] Based on this, in view of the technical problems of low efficiency and insufficient accuracy in the prior art of using manual methods to review and score design drawings, it is necessary to provide a method and apparatus for scoring design drawings, a computer-readable storage medium, and a computer device.
[0005] A method for scoring a design drawing includes:
[0006] Obtaining a design drawing to be scored, where the design drawing includes a plurality of layers;
[0007] Extracting color information corresponding to each layer from the source file of the design drawing;
[0008] Determining scores of the design drawing corresponding to each color matching condition according to the color information corresponding to each layer;
[0009] Fusing the corresponding scores according to the weights corresponding to each color matching condition to obtain a color score corresponding to the design drawing.
[0010] A device for scoring a design drawing, the device includes:
[0011] An obtaining module, configured to obtain a design drawing to be scored, where the design drawing includes a plurality of layers;
[0012] An extracting module, configured to extract color information corresponding to each layer from the source file of the design drawing;
[0013] A determining module, configured to determine scores of the design drawing corresponding to each color matching condition according to the color information corresponding to each layer;
[0014] A fusion module, configured to fuse the corresponding scores according to the weights corresponding to each color - matching condition, and obtain the color score corresponding to the design drawing.
[0015] A computer - readable storage medium stores a computer program. When the computer program is executed by a processor, the processor is caused to execute the steps of the above - mentioned design - drawing scoring method.
[0016] A computer device includes a memory and a processor. The memory stores a computer program. When the computer program is executed by the processor, the processor is caused to execute the steps of the above - mentioned design - drawing scoring method.
[0017] The above - mentioned design - drawing scoring method, device, computer - readable storage medium, and computer device obtain each layer of the design drawing by parsing the source file of the design drawing, extract the color information corresponding to each layer, score the color information of each layer according to the preset color - matching conditions, obtain the scores corresponding to each color - matching condition of the design drawing, and finally fuse the corresponding scores according to the weights corresponding to each color - matching condition to obtain the color score corresponding to the design drawing. On the one hand, compared with the manual method of scoring design drawings, the method of using a computer device for scoring reduces a large amount of repetitive labor and improves the efficiency of reviewing design drawings. On the other hand, the computer device can score a large number of design drawings through unified color - matching conditions, can establish a unified design - drawing output standard, and makes the scoring more accurate. Description of the Drawings
[0018] To more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the following - described drawings are only some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0019] Figure 1 It is an application - environment diagram of the design - drawing scoring method in an embodiment;
[0020] Figure 2 It is a flowchart of the design - drawing scoring method in an embodiment;
[0021] Figure 3 It is a flowchart of the process of extracting the color of a layer in an embodiment;
[0022] Figure 4 It is a flowchart of the steps of calculating the occlusion relationship of elements in each layer in an embodiment;
[0023] Figure 5 It is a schematic diagram of determining the position information by contour detection of elements in a layer in an embodiment;
[0024] Figure 6 It is a schematic flow chart for determining scores corresponding to each color matching condition of a design drawing in an embodiment;
[0025] Figure 7 It is a schematic flow chart for the training steps of a color matching condition checker in an embodiment;
[0026] Figure 8 It is a schematic technical architecture diagram for scoring a design drawing in an embodiment;
[0027] Figure 9 It is a structural block diagram of a scoring device for a design drawing in an embodiment;
[0028] Figure 10 It is a structural block diagram of a computer device in an embodiment. Specific embodiments
[0029] In order to make the objectives, technical solutions and advantages of the present application clearer, the present application will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0030] Figure 1 It is an application environment diagram of a scoring method for a design drawing in an embodiment. Refer to Figure 1 , this application environment may include at least one computer device. The scoring method for the design drawing in the embodiments of the present application may be executed by at least one computer device, and this computer device may be a terminal 110 or a server. The scoring method for the design drawing may also be jointly executed by the terminal 110 and the server 120, and the terminal 110 and the server 120 are connected through a network. The terminal 110 may specifically be a desktop terminal or a mobile terminal, and the mobile terminal may specifically be at least one of a mobile phone, a tablet computer, a laptop computer, etc. The server 120 may be implemented by an independent server or a server cluster composed of multiple servers.
[0031] In the embodiments of the present application, the computer device may obtain a design drawing to be scored, and the design drawing includes multiple layers; extract the color information corresponding to each layer from the source file of the design drawing; determine the scores corresponding to each color matching condition of the design drawing according to the color information corresponding to each layer; fuse the corresponding scores according to the weights corresponding to each color matching condition to obtain the color score corresponding to the design drawing. In a possible implementation manner, the color matching condition is a color matching rule that meets aesthetic requirements, and preset color matching conditions may be stored in the computer device, and the computer device may score the color information of each layer based on the stored multiple color matching conditions to implement the scoring process of the design drawing.
[0032] In another possible implementation, the computer device may also store a color matching condition checker based on machine learning. After extracting the color features of the design drawing based on the stored color matching condition checker, the design drawing is scored to implement the scoring process of the design drawing. The color matching condition checker can be trained on this computer device or on other computer devices. The embodiments of the present application do not limit the training device of the color matching condition checker.
[0033] In some embodiments, the terminal 110 obtains a batch of generated design drawings and sends the generated design drawings to the server 120. After receiving the design drawings, the server 120 extracts the color information corresponding to each layer from the source file of the design drawing; according to the color information corresponding to each layer, determines the scores of the design drawing corresponding to each color matching condition; fuses the corresponding scores according to the weights corresponding to each color matching condition to obtain the color score corresponding to the design drawing, and after screening out the target design drawings whose scores meet the specified conditions from a large number of generated design drawings according to the high and low scores, returns the target design drawings to the terminal 110.
[0034] As Figure 2 shown, in one embodiment, a method for scoring a design drawing is provided. In this embodiment, it is mainly illustrated by applying this method to be executed by the computer device in the above Figure 1 The computer device may be the terminal 110 or the server 120 in Figure 1 Referring to Figure 2 , the method for scoring the design drawing specifically includes the following steps:
[0035] S202, obtain the design drawing to be scored, and the design drawing includes multiple layers.
[0036] Among them, the design drawing may be a picture designed using design software, for example, a picture designed using Photoshop or Sketch. The design drawing may be a static picture or a dynamic picture spliced by multiple frames of images. The design drawing includes multiple layers, and each layer may include at least one element. The elements in the layer may be text, graphics, etc. In one embodiment, each layer only includes one element. The design drawing can be used to make website pages and can also be used to make banner ads inside websites or APPs. Scoring refers to the process of checking the design drawing according to the preset color matching conditions to determine the matching degree between the design drawing and the color matching conditions.
[0037] In the embodiments of the present application, the computer device may obtain the design drawing to be scored. In one application scenario, when the computer device needs to screen out the design drawings that meet the requirements from a large number of generated design drawings, it can score each design drawing in the large number of generated design drawings respectively, and screen out the design drawings that meet the requirements according to the scores.
[0038] In a possible implementation, the design drawing can be stored in a computer device. When the computer device needs to score the design drawing, it can directly obtain the design drawing to be scored from the local storage. In another possible implementation, the design drawing can also be stored on other computer devices. When the computer device needs to score the design drawing, it obtains the design drawing from other computer devices. For example, the computer device can obtain the design drawing from a terminal that generates design drawings in batches or a database that stores design drawings. The embodiments of the present application do not limit the manner of obtaining the design drawing.
[0039] S204. Extract the color information corresponding to each layer from the source file of the design drawing.
[0040] Among them, the source file of the design drawing is a file that includes all materials, layers, and other resources used in the design process of the design drawing. After the computer device obtains the design drawing, it can parse the source file of the design drawing to obtain the color information of each layer of the design drawing. In some embodiments, the computer device can parse the source file of the design drawing through a parsing plugin or a parsing program of the design drawing to extract the color information corresponding to each layer of the design drawing.
[0041] The color information of a layer can include the color of the layer, the color area, the color distribution, etc. The color can be quantified into a three-dimensional value including lightness, chroma (i.e., color saturation), and hue (i.e., the overall tendency of the color) through the LCH color space. Of course, the RGB color space or other color spaces can also be used to represent the color. Each layer has corresponding color information. The computer device needs to extract the color information of each layer of the design drawing so as to determine the overall color design information of the design drawing according to the color information of each layer in the subsequent processing process, and check and score according to the preset color matching conditions to obtain the score corresponding to each color matching condition.
[0042] In this embodiment, a layer includes one element. The elements in the layer can be, for example, text or graphics, etc. The computer device can obtain the elements in each layer and extract the color of the elements in the layer to obtain the color information of the layer. The elements in the layer can be elements with a single color, that is, monochromatic elements, or elements including multiple similar colors, that is, similar color elements, or elements including multiple colors with large differences, that is, multicolor elements. The computer device can extract the color information respectively for the above different types of elements to obtain the corresponding color information of the layer.
[0043] As Figure 3 shown, it is a schematic flowchart of extracting the color of a layer in an embodiment. Refer to Figure 3, the color information includes the color of the layer, and the color of the layer is determined through the following steps: When the element in the layer is a monochromatic element, the color of the monochromatic element is taken as the color of the layer; when the element in the layer is a similar-color element, the color of the layer is determined according to the number of pixels occupied by each similar color in the element; when the element in the layer is a multi-color element, the dominant color of the element is extracted and taken as the color of the layer.
[0044] Specifically, when the element extracted in the layer is a monochromatic element, the computer device can directly take the color of the monochromatic element as the color of the layer. When the element extracted in the layer includes multiple different colors, the computer device can determine whether the differences in lightness, chroma, and hue of the multiple colors are less than a preset threshold. If so, it is determined that the element is a similar-color element including a series of similar colors. In this case, the color of the layer can be determined according to the number of pixels occupied by each similar color in the element. In a possible implementation, the computer device can perform weighted averaging according to the number of pixels occupied by each similar color in the element to obtain the color of the layer. For example, the element in the layer includes 3 similar colors, namely Color1: hue A1, saturation B1, lightness C1, occupying M pixels; Color2: hue A2, saturation B2, lightness C2, occupying N pixels; Color3: hue A3, saturation B3, lightness C3, occupying K pixels. Then the color of the layer determined by the computer according to the color of the element is: hue: (M * A1 + N * A2 + K * A3) / (M + N + K), saturation: (M * B1 + N * B2 + K * B3) / (M + N + K), lightness: (M * C1 + N * C2 + K * C3) / (M + N + K).
[0045] Further, when the computer device determines that the differences in lightness, chroma, and hue of the multiple colors are greater than the preset threshold, it is determined that the element is a multi-color element including a series of colors with large differences. In this case, a dominant color extraction algorithm can be used to determine a representative dominant color from the multiple colors, and the determined dominant color is taken as the color of the layer. The dominant color extraction algorithm can be, for example, a clustering algorithm, an octree algorithm, etc.
[0046] In one embodiment, before extracting the color information of the layer, the computer device can first compress the design drawing to a preset size and then extract the color information of each layer to reduce the amount of computation. For example, the computer device can compress the length and width of the design drawing to a size with a pixel size of 100 * 100.
[0047] In one embodiment, when an element in a layer is a multi-color element, the color information of the layer also includes color area, that is, the area occupied by different colors included in the element. The color area of each color can be represented by the number of pixels occupied by the color in the element. The computer device can determine the color area through the following steps: traverse each pixel of the element in each layer pixel by pixel; count the number of pixels of the same color in the element; and obtain the color area of each color in the layer according to the number of pixels of the same color.
[0048] In one possible implementation, for similar color elements in a layer, a computer device can determine the merged color according to the number of pixels occupied by each similar color in the element, and then obtain the color area of the merged color. For other colors with larger differences in the element, the color area is directly determined according to the number of pixels occupied by the color.
[0049] In one embodiment, when the elements in a layer are multi-color elements, the color information includes color distribution, and the color distribution is determined by the following steps: traversing each pixel point of the elements in each layer pixel by pixel; counting the degree of discreteness between pixel points of the same color in the elements; and determining the color distribution of the same color in the layer based on the degree of discreteness.
[0050] Specifically, when the elements in the layer are multi-color elements, the color information of the layer also includes color distribution, and the color distribution can be represented by the degree of discreteness of the same color in the element, and the degree of discreteness of the same color can be represented by the distance between pixels of the same color. In another possible implementation, the computer device can traverse each pixel of the element pixel by pixel to determine non-adjacent pixels of the same color. Non-adjacent pixels of the same color refer to pixels of other colors between two pixels. The computer device can count the distances between non-adjacent pixels and use the distance sum or distance mean of non-adjacent pixels as the color distribution of the same color in the element. When the color distribution is too dispersed or too concentrated, it will affect the score of the design drawing.
[0051] In one embodiment, when the element in the layer is a multi-color element, the color distribution also includes the proportion of the color area. The computer device can count the color areas of different colors in the element and the total area of the element, and determine the proportion of the color areas of different colors in the element according to the proportion of the color area to the total area.
[0052] It can be understood that although the elements in some layers are large in size, they may be blocked or covered by the elements in other layers, resulting in a smaller color area of the element in the overall effect presented by the design drawing. Further, in addition to obtaining the color information of the elements in the layer, the computer device can also extract the position information of the elements in each layer according to the source file of the design drawing to calculate the occlusion relationship between the elements in different layers, so as to facilitate understanding the design effect presented by the entire design drawing and thus score the overall design effect.
[0053] As Figure 4 shown, in one embodiment, the method for scoring the above design drawing further includes the step of calculating the occlusion relationship between the elements in each layer, specifically including the following steps S402 to step S408:
[0054] S402, obtain the layer numbers of each layer.
[0055] S404, determine the covering relationship between each layer according to the layer numbers.
[0056] Specifically, the computer device can obtain the layer numbers of each layer by parsing the source file of the design drawing, and the layer numbers can be used to determine the covering relationship between each layer. The covering relationship is the upper and lower covering relationship between layers. For example, layer A is above layer B, and layer C is below layer B. In one embodiment, the smaller the layer number, the closer the layer is to the bottom layer, and the larger the layer number, the closer the layer is to the top layer.
[0057] S406, determine the positions of the elements in each layer.
[0058] In addition to the covering relationship between layers affecting the color presentation effect of the design drawing, the positions of the elements in the layer also affect the color presentation effect of the design drawing. Therefore, the computer device can also obtain the elements in each layer by parsing the source file of the design drawing and extract the positions of the elements in the layer.
[0059] In a possible implementation manner, for the elements in each layer, the computer device can detect the rectangular bounding box of the element through a contour detection algorithm, and the position of the pixel points covered by the rectangular bounding box is the position occupied by the element in the layer. In addition, the computer device can also determine the rotation angle of the element according to the angle between the long side or the short side of the rectangular bounding box and the horizontal direction. The rotation angle is used to describe the placement effect of the element in the layer, and the overall effect presented by the rotation angles of the elements in the design drawing can also be used as a scoring dimension of the design drawing. As Figure 5 shown, it is a schematic diagram of determining the position information of the elements in the layer through contour detection in one embodiment. Referring to Figure 5 , the position information of each element can be determined by the minimum bounding rectangle.
[0060] S408. Determine the occlusion relationship of the elements in each layer according to the covering relationship between the layers and the positions of the elements.
[0061] Specifically, after obtaining the covering relationship between the layers and the positions of the elements in each layer, the occlusion relationship between the elements in the layer can be determined, so as to determine the design effect presented by the entire design drawing. After that, combined with the color information of the elements in each layer, the color design effect presented by the entire design drawing can be obtained, and then the computer device can score the design drawing based on the above information.
[0062] In this embodiment, the source file of the design drawing is parsed to obtain the positional relationship of the elements in the design drawing, and the positional relationship is also used as a factor affecting the scoring of the design drawing, making the scoring process of the design drawing more detailed and reasonable.
[0063] S206. Determine the scores of the design drawing corresponding to each color matching condition according to the color information corresponding to each layer.
[0064] Among them, the color matching condition is a pre-set color scoring rule that conforms to aesthetics, and the color matching condition can be set through the professional experience of the designer. For example, the color matching condition can be that the differences in chroma, contrast, and brightness between various colors in the design drawing need to be controlled within a preset threshold to ensure the unity of the style. Another example is that there should also be a certain difference between the color information of the text elements and the color information of other elements to ensure that the text of the text elements can be clearly seen in the color effect presented by the design drawing. In other embodiments, the color matching condition can be obtained by training a machine learning model. By training the machine learning model with a large number of design drawings, the machine learning model learns the ability to reasonably score the design drawings corresponding to different dimensions of color matching conditions. At this time, the internal machine learning model obtained also has implicit color matching conditions for scoring the design drawings.
[0065] In a possible implementation manner, the computer device takes each layer as an object, uses the colors, color areas, and color distributions corresponding to each layer as input data. After obtaining the design information of the entire design drawing, it checks the design information according to each color matching condition in turn to obtain the scores of the design drawing corresponding to each color matching condition.
[0066] In other embodiments, the computer device takes each layer as an object, uses the colors, color areas, color distributions, and the occlusion relationship between the elements in the layer as input data. After obtaining the design information of the entire design drawing, it checks the design information according to each color matching condition in turn to obtain the scores of the design drawing corresponding to each color matching condition.
[0067] Such as Figure 6As shown, in one embodiment, determining the scores of the design drawing corresponding to each color matching condition according to the color information corresponding to each layer includes:
[0068] S602, input the color information corresponding to each layer into the color matching condition checker.
[0069] Among them, the color matching condition checker can be a color matching scoring plugin generated according to multiple color matching conditions, or a model obtained by training a machine learning model with a large number of design drawing samples and having the ability to score design drawings. After the computer device can parse the source file of the design drawing to obtain the color information of each layer of the design drawing, it inputs the color information of each layer into the color matching condition checker together. In other embodiments, the computer device can also extract the occlusion relationship between elements in each layer and input the color information of each layer and the occlusion relationship between layers into the color matching condition checker together.
[0070] S604, through the color matching condition checker, obtain the color design information of the design drawing according to the color information corresponding to each layer and the occlusion relationship between elements in each layer, and after checking the color design information according to the color matching conditions, output the scores of the design drawing corresponding to each color matching condition.
[0071] Among them, the color matching conditions include at least one of the following conditions: the difference in chromaticity between the colors of the design drawing is less than the first threshold; the difference in contrast between the colors of the design drawing is less than the second threshold; the difference in lightness between the colors of the design drawing is less than the third threshold.
[0072] Specifically, based on the color information of each layer and the occlusion relationship between elements in each layer, the computer device can determine the overall color design information of the design drawing, and after checking the overall color design information of the design drawing according to the color matching conditions inside the color matching checker, output the score of the design drawing corresponding to each color matching condition.
[0073] In this embodiment, using the color matching condition checker to score the color of the design drawing reduces the repetitive labor cost generated by manual review of the design drawing, improves the output efficiency of the design drawing, and can also establish a unified design drawing output standard, making the scoring more accurate, which helps to screen out design drawings with consistent standards according to the score.
[0074] In one embodiment, as Figure 7 shown, the color matching condition checker is obtained by training a machine learning model, and the training steps of the color matching condition checker include:
[0075] S702, obtain sample design drawings, and the annotation information of the sample design drawings includes the scores corresponding to each color matching condition.
[0076] S704. For each sample design drawing, extract the corresponding color features through a machine learning model, and obtain the predicted scores of each color matching condition in the sample design drawing based on the color features.
[0077] Specifically, by training the machine learning model, extract the color features of a large number of design drawings, so as to predict the scores of each color matching condition corresponding to the design drawings based on the color features, enabling the model to learn the scoring methods for different color matching conditions.
[0078] S706. According to the differences between the scores corresponding to each color matching condition in the annotation information and the predicted scores, adjust the model parameters of the machine learning model until a color matching condition checker for scoring design drawings is obtained.
[0079] It should be noted that the training process of this color matching condition checker can use the supervised learning method to train the initial machine learning model. The computer device can obtain a large number of sample design drawings, including positive sample design drawings with reasonable designs and negative sample design drawings with less reasonable designs. The computer device can complete the training process of the model based on a large number of sample design drawings to obtain the color matching condition checker. The annotation information of the sample design drawings includes the scores corresponding to each color matching condition, and this score can be obtained by professional designers evaluating the design drawings according to each color matching condition.
[0080] S208. Integrate the corresponding scores according to the weights corresponding to each color matching condition to obtain the color score corresponding to the design drawing.
[0081] Specifically, before scoring, the computer device can obtain the weights set for each color matching condition to achieve integration according to the importance of different color matching conditions for scoring and obtain a more reasonable and accurate color score. The weights can be set by professionals according to empirical knowledge, or the weights corresponding to each color matching condition can be deduced after manually scoring each design drawing sample, or the machine learning model can be trained with sampled design drawing samples so that the machine learning model automatically learns the weights corresponding to each color matching condition. The embodiments of the present application do not limit the acquisition methods of the weights corresponding to each color matching condition. After obtaining the scores corresponding to each color matching condition, the computer device can integrate the scores of each color matching condition corresponding to the design drawing according to the weights corresponding to each color matching condition to obtain the color score corresponding to the design drawing.
[0082] The scoring method for the above design drawings obtains each layer of the design drawings by parsing the source files of the design drawings, extracts the color information corresponding to each layer, scores the color information of each layer according to the preset color matching conditions, obtains the scores of the design drawings corresponding to each color matching condition, and finally fuses the corresponding scores according to the weights of each color matching condition to obtain the color score corresponding to the design drawings. On the one hand, compared with the manual scoring method for design drawings, the computer device scoring method reduces a large amount of repetitive labor and improves the efficiency of reviewing design drawings; on the other hand, the computer device can score a large number of design drawings through unified color matching conditions, and can establish a unified design drawing output standard, making the scoring more accurate.
[0083] In one embodiment, fusing the corresponding scores according to the weights of each color matching condition to obtain the color score corresponding to the design drawings includes: obtaining the weights corresponding to each color matching condition; performing weighted average on each score according to the weights to obtain the color score corresponding to the design drawings.
[0084] In some other possible implementation manners, in addition to using the weighted average method to fuse the scores corresponding to each color matching condition, the geometric average or harmonic average method can also be used to fuse the scores corresponding to each color matching condition to obtain the color score corresponding to the design drawings.
[0085] In one embodiment, the above method further includes: obtaining the color scores corresponding to each design drawing in the design drawing set; screening out the target design drawings whose color scores meet the preset conditions from the design drawing set.
[0086] In this embodiment, the computer device can obtain a large number of generated design drawing sets, obtain the color scores corresponding to each design drawing in the design drawing set according to the design drawing scoring method provided in this application, and screen out the target design drawings that can be put into use or meet the usage requirements from the design drawing set according to the level of the color scores.
[0087] As Figure 8 shown, it is a schematic diagram of the technical architecture for scoring design drawings in one embodiment. Referring to Figure 8 , the computer device first obtains the design drawings, parses the source files of the design drawings to obtain the elements in each layer, then extracts the color information and position information of the elements, inputs the extracted color information and position information into the color matching condition checker, and uses the internal color matching conditions of the color matching condition checker to check the design drawings, obtains the scores of the design drawings corresponding to each color matching condition, and then performs weighted average on the scores corresponding to each color matching condition according to the weights corresponding to each color matching condition, and outputs the color score corresponding to the design drawings.
[0088] In a specific embodiment, the design drawing scoring method includes the following steps:
[0089] Obtain the design drawing to be scored, where the design drawing includes multiple layers;
[0090] Obtain the elements in each layer according to the source file of the design drawing;
[0091] When the element in the layer is a single-color element, use the color of the single-color element as the color of the layer;
[0092] When the element in the layer is a similar-color element, determine the color of the layer according to the number of pixels occupied by each similar color in the element;
[0093] When the element in the layer is a multi-color element, extract the dominant color of the element and use the dominant color as the color of the layer;
[0094] Traverse each pixel of the elements in each layer pixel by pixel; count the number of pixels of the same color in the element; obtain the color area of each color in the layer according to the number of pixels of the same color; count the distance between the pixels of the same color in the element; determine the color distribution of the same color in the layer according to the distance;
[0095] Obtain the layer numbers of each layer; determine the covering relationship between each layer according to the layer numbers; determine the positions of the elements in each layer; determine the occlusion relationship of the elements in each layer according to the covering relationship between the layers and the positions of the elements;
[0096] Input the color information and occlusion relationship corresponding to each layer into the color matching condition checker, where the color information includes color, color area, and color distribution;
[0097] Through the color matching condition checker, obtain the color design information of the design drawing according to the color information corresponding to each layer and the occlusion relationship of the elements in each layer, and after checking the color design information according to the color matching conditions, output the scores of each color matching condition corresponding to the design drawing;
[0098] Determine the scores of each color matching condition corresponding to the design drawing according to the color information corresponding to each layer;
[0099] Obtain the weights corresponding to each color matching condition;
[0100] Perform a weighted average on each score according to the weights to obtain the color score corresponding to the design drawing;
[0101] Obtain the color scores corresponding to each design drawing in the design drawing set;
[0102] Screen out the target design drawings from the design drawing set whose color scores meet the preset conditions.
[0103] It should be understood that the above-mentioned various steps are not necessarily executed in sequence according to the order of the steps. Unless there is a clear description in this article, there is no strict order limit for the execution of these steps, and these steps can be in other orders. Moreover, at least a part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed alternately or in turn with at least a part of other steps or sub-steps or stages of other steps. Sequential execution
[0104] In one embodiment, as Figure 9 shown, a scoring device 900 for a design drawing is provided. This device can be implemented as all or part of a computer device through software, hardware, or a combination of both. The device includes an acquisition module 902, an extraction module 904, a determination module 906, and a fusion module 908, where:
[0105] The acquisition module 902 is configured to acquire a design drawing to be scored, and the design drawing includes multiple layers;
[0106] The extraction module 904 is configured to extract the color information corresponding to each layer from the source file of the design drawing;
[0107] The determination module 906 is configured to determine the scores of the design drawing corresponding to each color matching condition according to the color information corresponding to each layer;
[0108] The fusion module 908 is configured to fuse the corresponding scores according to the weights corresponding to each color matching condition to obtain the color score corresponding to the design drawing.
[0109] In one embodiment, the color information includes the color of the layer. The extraction module 904 is further configured to, when the element in the layer is a single-color element, use the color of the single-color element as the color of the layer; when the element in the layer is a similar-color element, determine the color of the layer according to the number of pixel points occupied by each similar color in the element; when the element in the layer is a multi-color element, extract the theme color of the element and use the theme color as the color of the layer.
[0110] In one embodiment, the color information includes the color area. The extraction module 904 is further configured to traverse each pixel point of the element in each layer pixel by pixel; count the number of pixel points of the same color in the element; and obtain the color area of each color in the layer according to the number of pixel points of the same color.
[0111] In one embodiment, the color information includes the color distribution. The extraction module 904 is further configured to traverse each pixel point of the element in each layer pixel by pixel; count the distance between the pixel points of the same color in the element; and determine the color distribution of the same color in the layer according to the distance.
[0112] In one embodiment, the extraction module 904 is further configured to obtain the layer numbers of each layer; determine the covering relationship between each layer according to the layer numbers; determine the positions of the elements in each layer; and determine the occlusion relationship of the elements in each layer according to the covering relationship between the layers and the positions of the elements.
[0113] In one embodiment, the determination module 906 is further configured to input the color information corresponding to each layer into a color matching condition checker; through the color matching condition checker, obtain the color design information of the design drawing according to the color information corresponding to each layer and the occlusion relationship of the elements in each layer, and after checking the color design information according to the color matching conditions, output the scores of each color matching condition corresponding to the design drawing; wherein, the color matching conditions include at least one of the following conditions: the difference in chromaticity between the colors of the design drawing is less than a first threshold; the difference in contrast between the colors of the design drawing is less than a second threshold; the difference in lightness between the colors of the design drawing is less than a third threshold.
[0114] In one embodiment, the color matching condition checker is obtained by training a machine learning model. The scoring device 900 for the design drawing further includes a training module, configured to obtain a sample design drawing, and the annotation information of the sample design drawing includes the scores corresponding to each color matching condition; for each sample design drawing, extract the corresponding color features through the machine learning model, and obtain the predicted scores of each color matching condition in the sample design drawing according to the color features; adjust the model parameters of the machine learning model according to the difference between the scores corresponding to each color matching condition in the annotation information and the predicted scores until a color matching condition checker for scoring the design drawing is obtained.
[0115] In one embodiment, the fusion module 908 is further configured to obtain the weights corresponding to each color matching condition; perform a weighted average on each score according to the weights to obtain the color score corresponding to the design drawing.
[0116] In one embodiment, the scoring device 900 for the design drawing further includes a screening module, configured to obtain the color scores corresponding to each design drawing in the design drawing set; and screen out the target design drawings whose color scores meet the preset conditions from the design drawing set.
[0117] The scoring device 900 for the above design drawings obtains each layer of the design drawings by parsing the source files of the design drawings, extracts the color information corresponding to each layer, scores the color information of each layer according to preset color matching conditions, obtains the scores of the design drawings corresponding to each color matching condition, and finally fuses each of the scores according to the corresponding weights of each color matching condition to obtain the color score corresponding to the design drawings. On the one hand, compared with the manual method of scoring design drawings, the method of using computer equipment for scoring reduces a large amount of repetitive labor and improves the efficiency of reviewing design drawings; on the other hand, computer equipment can score a large number of design drawings through unified color matching conditions, and can establish a unified output standard for design drawings, making the scoring more accurate.
[0118] Figure 10 shows the internal structure diagram of a computer device in an embodiment. The computer device can specifically be Figure 1 the terminal 110 or the server 120 in Figure 10 As shown, the computer device includes a processor, a memory, and a network interface connected through a system bus. Among them, the memory includes a non-volatile storage medium and an internal memory. The non-volatile storage medium of the computer device stores an operating system and can also store a computer program. When the computer program is executed by the processor, the processor can implement the scoring method of the design drawings. The internal memory can also store a computer program. When the computer program is executed by the processor, the processor can execute the scoring method of the design drawings.
[0119] Those skilled in the art can understand that Figure 10 the structure shown in
[0120] is only a block diagram of some structures 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 some components, or have different component arrangements.
[0120] In one embodiment, the scoring device 900 for the design drawings provided by the present application can be implemented in the form of a computer program, and the computer program can run on a computer device such as Figure 10 shown. The memory of the computer device can store each program module that composes the scoring device 900 for the design drawings. For example, Figure 9 the acquisition module 902, the extraction module 904, the determination module 906, and the fusion module 908 shown in
[0121] For example, Figure 10 the computer device shown in Figure 9The obtaining module 902 in the scoring device 900 of the design drawing shown executes step S202. The computer device may execute step S204 through the extraction module 904. The computer device may execute step S206 through the determination module 906. The computer device may execute step S208 through the fusion module 908.
[0122] In one embodiment, a computer device is provided, including a memory and a processor. The memory stores a computer program. When the computer program is executed by the processor, the processor is caused to execute the steps of the above-mentioned design drawing scoring method. The steps of the design drawing scoring method here may be the steps in the design drawing scoring methods of the above-mentioned various embodiments.
[0123] In one embodiment, a computer-readable storage medium is provided, storing a computer program. When the computer program is executed by the processor, the processor is caused to execute the steps of the above-mentioned design drawing scoring method. The steps of the design drawing scoring method here may be the steps in the design drawing scoring methods of the above-mentioned various embodiments.
[0124] Those of ordinary skill in the art can understand that all or part of the processes of implementing the methods in the above embodiments can be completed by instructing relevant hardware through a computer program. The program can be stored in a non-volatile computer-readable storage medium. When the program is executed, it may include the processes of the embodiments of the above methods. Among them, any reference to the memory, storage, database, or other media used in the various embodiments provided in this application may include non-volatile and / or volatile memories. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0125] The technical features of the above embodiments can be combined arbitrarily. For the sake of concise description, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, it should be considered as the scope described in this specification.
[0126] The above-described embodiments merely represent several implementation manners of the present application. The description thereof is relatively specific and detailed, but it should not be construed as a limitation on the scope of the patent of the present application. It should be noted that for those of ordinary skill in the art, without departing from the concept of the present application, several deformations and improvements can still be made, and these all fall within the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the appended claims.
Claims
1. A method for scoring a design drawing, comprising: Obtaining a design drawing to be scored, where the design drawing includes multiple layers; Extracting color information corresponding to each layer from the source file of the design drawing; Inputting the color information corresponding to each layer into a color matching condition checker; Through the color matching condition checker, obtaining color design information of the design drawing according to the color information corresponding to each layer and the occlusion relationship of elements in each layer, and after checking the color design information according to the color matching conditions, outputting scores for each color matching condition corresponding to the design drawing; Wherein, the color matching conditions include at least one of the following conditions: The difference in chromaticity between the colors of the design drawing is less than a first threshold; The difference in contrast between the colors of the design drawing is less than a second threshold; The difference in lightness between the colors of the design drawing is less than a third threshold; Fusing the corresponding scores according to the weights corresponding to each color matching condition to obtain a color score corresponding to the design drawing.
2. The method according to claim 1, wherein The color information includes the color of the layer, and the color of the layer is determined through the following steps: When the element in the layer is a single-color element, then Taking the color of the single-color element as the color of the layer; When the element in the layer is a similar-color element, then Determining the color of the layer according to the number of pixel points occupied by each similar color in the element; When the element in the layer is a multi-color element, then Extracting the theme color of the element and taking the theme color as the color of the layer.
3. The method according to claim 1, characterized in that The color information includes color area, and the color area is determined through the following steps: Traversing each pixel point of the element in each layer pixel by pixel; Counting the number of pixel points with the same color in the element; Obtaining the color area of each color in the layer according to the number of pixel points with the same color.
4. The method according to claim 1, wherein The color information includes color distribution, and the color distribution is determined through the following steps: Traversing each pixel point of the element in each layer pixel by pixel; Counting the distances between pixel points with the same color in the element; Determining the color distribution of the same color in the layer according to the distance.
5. The method according to claim 1, wherein The method further includes: Obtaining the layer numbers of each layer; Determining the covering relationship between each layer according to the layer numbers; Determining the positions of elements in each layer; Determining the occlusion relationship of elements in each layer according to the covering relationship between the layers and the positions of the elements.
6. The method according to claim 1, wherein The color matching condition checker is obtained by training a machine learning model, and the training steps of the color matching condition checker include: Obtaining a sample design drawing, where the annotation information of the sample design drawing includes scores corresponding to each color matching condition; For each sample design drawing, extracting corresponding color features through the machine learning model and obtaining predicted scores for each color matching condition in the sample design drawing according to the color features; Adjusting the model parameters of the machine learning model according to the difference between the scores corresponding to each color matching condition in the annotation information and the predicted scores until a color matching condition checker for scoring the design drawing is obtained.
7. The method according to claim 1, characterized in that, The fusing the corresponding scores according to the weights corresponding to each color matching condition to obtain a color score corresponding to the design drawing includes: Obtain the weights corresponding to each color matching condition; Perform weighted averaging on each of the scores according to the weights to obtain the color score corresponding to the design drawing.
8. The method according to any one of claims 1 to 7, characterized in that, The method further includes: Obtain the color scores corresponding to each design drawing in the design drawing set; Screen out the target design drawings from the design drawing set whose color scores meet the preset conditions.
9. A scoring device for a design drawing, the device includes: An acquisition module, configured to acquire a design drawing to be scored, where the design drawing includes multiple layers; An extraction module, configured to extract the color information corresponding to each layer from the source file of the design drawing; A determination module, configured to input the color information corresponding to each layer into a color matching condition checker; Through the color matching condition checker, according to the color information corresponding to each layer and the occlusion relationship of the elements in each layer, obtain the color design information of the design drawing, and after checking the color design information according to the color matching conditions, output the scores of each color matching condition corresponding to the design drawing; wherein, the color matching conditions include at least one of the following conditions: the difference in chromaticity between the colors of the design drawing is less than a first threshold; the difference in contrast between the colors of the design drawing is less than a second threshold; the difference in lightness between the colors of the design drawing is less than a third threshold; A fusion module, configured to fuse the corresponding scores according to the weights corresponding to each color matching condition to obtain the color score corresponding to the design drawing.
10. The device according to claim 9, wherein The color information includes the color of the layer, and the extraction module is further configured to, when the element in the layer is a single-color element, use the color of the single-color element as the color of the layer; when the element in the layer is a similar-color element, determine the color of the layer according to the number of pixels occupied by each similar color in the element; when the element in the layer is a multi-color element, extract the theme color of the element and use the theme color as the color of the layer.
11. The device according to claim 9, characterized in that, The color information includes the color area, and the extraction module is further configured to traverse each pixel point of the elements in each layer pixel by pixel; count the number of pixel points of the same color in the element; obtain the color area of each color in the layer according to the number of pixel points of the same color.
12. The device according to claim 9, characterized in that, The color information includes the color distribution, and the extraction module is further configured to traverse each pixel point of the elements in each layer pixel by pixel; count the distance between the pixel points of the same color in the element; determine the color distribution of the same color in the layer according to the distance.
13. The device according to claim 9, wherein The extraction module is further configured to obtain the layer numbers of each layer; determine the covering relationship between each layer according to the layer numbers; determine the positions of the elements in each layer; determine the occlusion relationship of the elements in each layer according to the covering relationship between the layers and the positions of the elements.
14. The device according to claim 9, characterized in that, The color matching condition checker is obtained by training a machine learning model, and the device further includes: A training module, configured to obtain sample design drawings, wherein the annotation information of the sample design drawings includes scores corresponding to respective color matching conditions; for each sample design drawing, extract corresponding color features through a machine learning model, and obtain predicted scores of respective color matching conditions in the sample design drawing according to the color features; adjust model parameters of the machine learning model according to the differences between the scores corresponding to respective color matching conditions in the annotation information and the predicted scores until a color matching condition checker for scoring design drawings is obtained.
15. The device according to claim 9, characterized in that, The fusion module is further configured to obtain weights corresponding to respective color matching conditions; perform weighted averaging on the respective scores according to the weights to obtain a color score corresponding to the design drawing.
16. The device according to any one of claims 9 to 15, characterized in that The apparatus further includes: A screening module, configured to obtain color scores corresponding to respective design drawings in a design drawing set; screen out target design drawings in the design drawing set whose color scores meet a preset condition.
17. A computer-readable storage medium storing a computer program, which when executed by a processor, causes the processor to execute the steps of the method according to any one of claims 1 to 8.
18. A computer device including a memory and a processor, where the memory stores a computer program, which when executed by the processor, causes the processor to execute the steps of the method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Color correction objective assessment method consistent with subjective perception
CN105046708A
Automatic color matching method for poster, medium, computer equipment and device
CN109584326A