Design resource layer identification method and device
Automatically identify and classify resource layers in design software through computer vision and image processing technology, solving the problem of difficult manual identification and improving design and development efficiency and user experience.
Patent Information
- Application Number
- CN202410775105.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-17
- Publication Date
- 2024-09-03
AI Technical Summary
In a complexly designed user interface, it becomes difficult to manually identify and manage resource layers, especially when the number of layers is large and the layers are complex, which is time-consuming and error-prone.
Using computer vision and image processing technology, by obtaining layer information in the design file, it identifies vector layers and hierarchical layers that meet preset conditions, excludes non-resource layers, and recursively checks whether sub-layers contain containers, Text and examples, display resource layers as thumbnails, hide sublayers, and highlight with semi-transparent borders.
It greatly reduces the manual operation time and human errors of designers and developers, improves design and development efficiency, improves design quality and user experience, and makes the user interface more beautiful and easier to use.
Smart Images

Figure CN118585166A
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of software design, and in particular to a design resource layer recognition method and device. Background Art
[0002] In design software, the identification of resource layers is crucial for designers and developers. Resource layers are the carriers of various design elements that make up the user interface, including but not limited to icons, buttons, backgrounds, etc. The reasonable organization and management of these resource layers is crucial for design collaboration and development implementation. In design software, layers are usually used to organize and manage these resources for editing, adjustment, and export.
[0003] However, when designing complex interfaces, it can be difficult to identify resource layers. Especially when there are a large number of layers and the hierarchy is complex, manually identifying and selecting resource layers can be very time-consuming and error-prone. In addition, as user interface designs become more complex and diverse, such as mobile applications and web applications, resource layers in design software are also becoming more diverse and complex, further increasing the difficulty of identifying resource layers.
[0004] To solve the above problems, the present invention proposes a method for identifying resource layers in design software. By using computer vision and image processing technology, automatic identification and classification of resource layers in design software are achieved, thereby helping designers and developers to perform design and development work more efficiently. Summary of the invention
[0005] In view of the above problems, a design resource layer identification method and device are proposed to solve the problem that design resource layer identification is difficult.
[0006] According to one aspect of the present invention, a design resource layer identification method is provided, comprising:
[0007] Step S11, obtaining all layer information in the design file, wherein the layer information includes layer type, size, position and content;
[0008] Step S12, identifying vector layers and hierarchical layers that meet preset conditions and using them as resource layers, wherein the preset conditions include that the width and height of a single layer boundary do not exceed preset values;
[0009] Step S13, excluding non-resource layers including straight lines and connecting lines;
[0010] Step S14, for the hierarchical layer, recursively checking whether its sub-layers contain containers, texts and instances according to a resource layer identification algorithm;
[0011] Step S15, displaying the layer identified as the resource layer as a resource thumbnail and hiding its sublayers;
[0012] Step S16, locating the corresponding layer in the canvas by selecting a resource in the resource list and highlighting it with a semi-transparent border.
[0013] In an optional manner, the preset condition also includes:
[0014] Lines and connectors are not recognized as resource layers; and,
[0015] For fills containing images, their size constraints are ignored.
[0016] In an optional manner, the hierarchical layer includes a container, a group and a Boolean group;
[0017] When the sub-layer does not include a container, text, or instance, it is identified as a resource layer.
[0018] In an optional manner, the method further includes:
[0019] Step S41, traversing the sub-layers of the current layer, and identifying the export item layer, resource layer or component layer through the recognition algorithm;
[0020] Step S42, displaying the identified layers on the export items in the right panel for user viewing and management;
[0021] Step S43, displaying the cut-image resources according to the layer type and the export item status.
[0022] In an optional manner, the display result of the slice resource includes instance components, resource and component combinations, resource and instance combinations, and instance components only;
[0023] When the layer is a resource layer, the export item is included; when the layer is a non-resource layer, the export item is not included.
[0024] In an optional manner, the method further includes:
[0025] Step S61, selecting an interactive operation in response to a resource in the resource list;
[0026] Step S62, highlighting the corresponding layer of the resource selected by the user in the canvas with a semi-transparent border, wherein non-component or instance layers are displayed with a blue border, and component or instance layers are displayed with a purple border;
[0027] Step S63, responding to the interactive operation of the layer, and performing corresponding highlighting, editing and exporting operations.
[0028] In an optional manner, the vector layer includes a circle, a star, a polygon, a picture, and a path.
[0029] In an optional manner, the method further includes:
[0030] Step S71, segmenting the design file into a plurality of independent image regions by using an image segmentation algorithm, each of the image regions corresponding to at least one layer;
[0031] Step S72, extracting shape, color and texture features from each of the image regions;
[0032] Step S73, training is performed based on the data sets of known resource layers and non-resource layers;
[0033] Step S74, applying the trained classifier in step S71 to classify the segmented image area into resource layers.
[0034] In an optional manner, in step S71, the design file is segmented into multiple independent image regions by using a U-Net or Mask R-CNN semantic segmentation network model;
[0035] In step S72, shape, color and texture features are extracted by local binary patterns.
[0036] According to another aspect of the present invention, there is provided a design resource layer identification device, comprising:
[0037] A layer information acquisition module is used to acquire all layer information in the design file, wherein the layer information includes layer type, size, position and content;
[0038] A resource layer identification module, used to identify vector layers and hierarchical layers that meet preset conditions and use them as resource layers, wherein the preset conditions include that the width and height of a single layer boundary do not exceed preset values;
[0039] Layer exclusion module, used to exclude non-resource layers including straight lines and connecting lines;
[0040] A sub-layer identification module, for recursively checking, for the hierarchical layer, whether its sub-layer contains a container, text, and an instance according to a resource layer identification algorithm;
[0041] A resource layer display module, used to display a layer identified as a resource layer as a resource thumbnail and hide its sublayers;
[0042] The interactive display module is used to locate the corresponding layer in the canvas by selecting the resource in the resource list and highlighting it with a semi-transparent border.
[0043] The solution provided by the above embodiment of the present invention is as follows: step S11, obtaining all layer information in the design file, the layer information including layer type, size, position and content; step S12, identifying vector layers and hierarchical layers that meet preset conditions and using them as resource layers, wherein the preset conditions include that the width and height of the boundary of a single layer do not exceed preset values; step S13, excluding non-resource layers including straight lines and connecting lines; step S14, for the hierarchical layers, recursively checking whether its sub-layers contain containers, texts and instances according to the resource layer recognition algorithm; step S15, displaying the layer identified as the resource layer as a resource thumbnail and hiding its sub-layers; step S16, locating the corresponding layer in the canvas by selecting the resource in the resource list, and highlighting it with a translucent border. The present invention greatly reduces the manual operation time and human errors of designers and developers by identifying and classifying the resource layers in the design software, improves the design quality and user experience while improving the design and development work efficiency, and makes the user interface more beautiful and easy to use. Specifically, based on the preset conditions and algorithms for layer recognition, designers can more clearly manage the resource layers in the design file. Display resource layers as thumbnails and hide their sublayers to make the user interface neater and more intuitive. Highlight selected resource layers with a translucent border to enhance user experience and interactivity. Display identified resource layers on the export items on the right panel to facilitate user viewing and management. The present invention is applicable to various design software and project types, including but not limited to mobile applications, web applications, etc., has broad application prospects, can be customized and optimized according to different design requirements and project characteristics, and has strong adaptability and flexibility.
[0044] The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention, it can be implemented according to the contents of the specification. In order to make the above description and other purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the detailed description of the preferred embodiments below. The accompanying drawings are only for the purpose of illustrating the preferred embodiments and are not to be considered as limiting the present invention. Moreover, the same reference symbols are used throughout the accompanying drawings to represent the same components. In the accompanying drawings:
[0046] Figure 1 A schematic diagram showing a flow chart of a design resource layer identification method according to an embodiment of the present invention;
[0047] Figure 2 The resource layer diagram of the embodiment of the present invention is shown Figure 1 ;
[0048] Figure 3 The resource layer diagram of the embodiment of the present invention is shown Figure 2 ;
[0049] Figure 4 A schematic diagram of an example component of an embodiment of the present invention is shown;
[0050] Figure 5 The resource + component diagram of the embodiment of the present invention is shown Figure 1 ;
[0051] Figure 6 A schematic diagram of resources + instances in an embodiment of the present invention is shown;
[0052] Figure 7 The resource + component diagram of the embodiment of the present invention is shown Figure 2 ;
[0053] Figure 8 A schematic diagram showing only example components of an embodiment of the present invention;
[0054] Fig. 9 A schematic diagram of layer selection and display according to an embodiment of the present invention is shown;
[0055] Fig.10 A schematic diagram of the structure of a design resource layer identification device according to an embodiment of the present invention is shown. DETAILED DESCRIPTION
[0056] The exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present invention are shown in the accompanying drawings, it should be understood that the present invention can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided in order to enable a more thorough understanding of the present invention and to enable the scope of the present invention to be fully communicated to those skilled in the art.
[0057] Embodiment 1:
[0058] Figure 1 FIG. 1 is a flow chart of a design resource layer identification method according to an embodiment of the present invention. Specifically, Figure 1 As shown, the following steps are included:
[0059] Step S101, obtaining all layer information in the design file, wherein the layer information includes layer type, size, position and content.
[0060] Parse all layers in the design file and extract relevant information of each layer, including layer type (image, text, shape, group, Boolean group, container, instance, etc.), size (width and height), position (such as X and Y coordinates) and content. The content of the layer can be pixel data (for image layers), text strings (for text layers), vector shape data (for shape layers), etc. In addition, it also includes the style information of the layer (such as fill color, stroke, shadow, etc.).
[0061] Step S102, identifying vector layers and hierarchical layers that meet preset conditions and using them as resource layers, wherein the preset conditions include that the width and height of a single layer boundary do not exceed preset values.
[0062] Specifically, for vector layers (including circles, stars, polygons, images, and paths), recursively traverse all layers starting from the top level of the design file, identify whether the layer is a vector layer (such as a circle, star, polygon, path, etc.), obtain the boundary size (width and height) of the layer, and check whether they do not exceed 256. If the layer is a straight line or a connecting line, execute step S103 to exclude non-resource layers including straight lines and connecting lines. If the fill contains an image and is a non-stroked fill, ignore the size limit. If the layer meets all conditions, it is added as a resource layer.
[0063] For hierarchical layers (including containers, groups, and Boolean groups), similarly, traverse from the top level of the design file to identify whether the layer is a hierarchical layer (container / non-automatic layout, group, Boolean group), obtain the boundary dimensions (width and height) of the layer, and check whether they do not exceed 256. Recursively traverse the sub-layers of the hierarchical layer. Execute step S104 to recursively check whether its sub-layers contain containers, text, and instances according to the resource layer identification algorithm. If the sub-layer contains containers, text, or instances, the entire hierarchical layer is ignored. When the sub-layer does not contain containers, text, and instances, it is identified as a resource layer. If the sub-layer contains a group or a Boolean group, and the group / Boolean group itself meets the conditions for being a resource layer (including size restrictions and sub-layer conditions), it is regarded as a resource layer. If the hierarchical layer meets all conditions, it is added as a resource layer.
[0064] In this embodiment, the sublayers of the current layer are traversed, and the export item layer, resource layer or component layer is identified through the recognition algorithm. The identified layer is displayed on the export item of the right panel for user viewing and management. The cut-image resources are displayed according to the layer type and the export item status. When the layer is a resource layer, the export item is included, and when the layer is a non-resource layer, the export item is not included. In addition, if the export item layer, resource layer or component layer is not identified, it will not be displayed, and for resources and instances, the sub-layer search will not be performed. Among them, the display results of the cut-image resources include instance components (such as Figure 4 As shown, including exports), resource and component combinations (such as Figure 5 , Figure 7 As shown in ), resource and instance combinations (such as Figure 6 ) and instance-only components (such as Figure 8 shown, excluding exports).
[0065] Step S105: Display the layer identified as the resource layer as a resource thumbnail and hide its sub-layers.
[0066] When a layer is identified as a resource, its sublayers will not appear in the layer list, and the layer will be displayed as a "resource thumbnail", such as Figure 2 As shown, for non-component and instance layers, the "type icon" will be replaced with the "resource thumbnail" (for example, smiley face). For component and instance layers, the "type icon" is retained and the "resource thumbnail" is added (for example, chicken and pill).
[0067] Step S106, locating a corresponding layer in the canvas by selecting a resource in the resource list, and highlighting it with a semi-transparent border.
[0068] In this embodiment, in response to the resource selection interaction operation in the resource list, the corresponding layer of the resource selected by the user is highlighted with a semi-transparent border in the canvas, where non-component or instance layers are displayed with a blue border, and component or instance layers are displayed with a purple border. In response to the interactive operation of the layer, the corresponding highlighting, editing and exporting operations are performed. Fig. 9 As shown, the layer is highlighted in the canvas through a semi-transparent border (multiple layers can be highlighted). For non-component / instance layers, it is blue; for component / instance layers, it is purple. After clicking, you can select one of the layers (the first in the layer list).
[0069] In an optional embodiment, the method further includes:
[0070] Step S71, segmenting the design file into a plurality of independent image regions by using an image segmentation algorithm, each of the image regions corresponding to at least one layer;
[0071] Step S72, extracting shape, color and texture features from each of the image regions;
[0072] Step S73, training is performed based on the data sets of known resource layers and non-resource layers;
[0073] Step S74, applying the trained classifier in step S71 to classify the segmented image area into resource layers.
[0074] Specifically, the design file is segmented into multiple independent image regions through an image segmentation algorithm, each of which corresponds to at least one layer. The image segmentation algorithm can be implemented based on edge detection, region growing, threshold segmentation and other technologies, which are not limited in this article. For example, the design file contains a background layer, a button layer and an icon layer. Through the image segmentation algorithm, the design file is segmented into three independent image regions: a background region, a button region and an icon region, each of which contains corresponding layer information.
[0075] After the image segmentation is completed, key feature information is extracted from each image region so that the classifier can identify resource layers and non-resource layers. The feature information includes shape features (such as those extracted by contours, boundaries, area, etc.), color features (such as those extracted by color distribution, color histogram, etc.), and texture features (such as those extracted by gray-level co-occurrence matrix, wavelet transform, etc.). For example, for the button area, its shape features (such as circle, rectangle, etc.), color features (such as the main color and gradient effect of the button), and texture features are extracted.
[0076] Use the known resource layer and non-resource layer datasets to train a classifier, which can be a machine learning model such as support vector machine (SVM), random forest, neural network, etc. By training the classifier, learn how to distinguish resource layers from non-resource layers based on the extracted features.
[0077] The segmented image regions are classified into resource layers according to the trained classifier to obtain the classification results of each image region, that is, whether they belong to the resource layer.
[0078] In an optional implementation, in step S71, the design file is segmented into multiple independent image regions by using a U-Net or Mask R-CNN semantic segmentation network model;
[0079] In step S72, shape, color and texture features are extracted by local binary patterns.
[0080] In this embodiment, the design file is segmented into multiple independent image regions through the U-Net or Mask R-CNN semantic segmentation network model. U-Net and Mask R-CNN accept an image as input and output a segmentation mask of the same size as the input image, in which each pixel is marked as belonging to a specific category or region. For the design file, it is converted into an RGB image, and then input into the U-Net or Mask R-CNN model, and a segmentation mask is output, in which each pixel represents an independent image region or layer (such as the background, button, and text area are marked with different colors or labels).
[0081] Shape, color and texture features are extracted from each segmented image region according to the local binary pattern (LBP). Among them, LBP is used to extract the local structural information of the image. It generates binary codes by comparing the gray value relationship between each pixel and its neighboring pixels, and then combines these codes into a histogram to represent the feature information of the image.
[0082] The solution provided by the above embodiment of the present invention is as follows: step S11, obtaining all layer information in the design file, the layer information including layer type, size, position and content; step S12, identifying vector layers and hierarchical layers that meet preset conditions and using them as resource layers, wherein the preset conditions include that the width and height of the boundary of a single layer do not exceed preset values; step S13, excluding non-resource layers including straight lines and connecting lines; step S14, for the hierarchical layers, recursively checking whether its sub-layers contain containers, texts and instances according to the resource layer recognition algorithm; step S15, displaying the layer identified as the resource layer as a resource thumbnail and hiding its sub-layers; step S16, locating the corresponding layer in the canvas by selecting the resource in the resource list, and highlighting it with a translucent border. The present invention greatly reduces the manual operation time and human errors of designers and developers by identifying and classifying the resource layers in the design software, improves the design quality and user experience while improving the design and development work efficiency, and makes the user interface more beautiful and easy to use. Specifically, based on the preset conditions and algorithms for layer recognition, designers can more clearly manage the resource layers in the design file. Display resource layers as thumbnails and hide their sublayers to make the user interface neater and more intuitive. Highlight selected resource layers with a translucent border to enhance user experience and interactivity. Display identified resource layers on the export items on the right panel to facilitate user viewing and management. The present invention is applicable to various design software and project types, including but not limited to mobile applications, web applications, etc., has broad application prospects, can be customized and optimized according to different design requirements and project characteristics, and has strong adaptability and flexibility.
[0083] Embodiment 2:
[0084] Fig.10 The schematic diagram of the structure of the design resource layer recognition device of the embodiment of the present invention is shown. The design resource layer recognition device 10 comprises: a layer information acquisition module 1001, a resource layer recognition module 1002, a layer exclusion module 1003, a sub-layer recognition module 1004, a resource layer display module 1005 and an interactive display module 1004.
[0085] The layer information acquisition module 1001 is used to acquire all layer information in the design file, and the layer information includes layer type, size, position and content;
[0086] The resource layer identification module 1002 is used to identify vector layers and hierarchical layers that meet preset conditions and use them as resource layers, wherein the preset conditions include that the width and height of a single layer boundary do not exceed preset values;
[0087] The layer exclusion module 1003 is used to exclude non-resource layers including straight lines and connecting lines;
[0088] The sub-level layer identification module 1004 is used to recursively check whether the sub-level layer of the hierarchical layer contains a container, text, and instance according to a resource layer identification algorithm;
[0089] The resource layer display module 1005 is used to display the layer identified as the resource layer as a resource thumbnail and hide its sub-layers;
[0090] The interactive display module 1006 is used to locate the corresponding layer in the canvas by selecting a resource in the resource list and highlight it with a semi-transparent border.
[0091] In an optional manner, the preset condition also includes:
[0092] Lines and connectors are not recognized as resource layers; and,
[0093] For fills containing images, their size constraints are ignored.
[0094] In an optional manner, the hierarchical layer includes a container, a group and a Boolean group;
[0095] When the sub-layer does not include a container, text, or instance, it is identified as a resource layer.
[0096] In an optional manner, the method further includes:
[0097] Step S41, traversing the sub-layers of the current layer, and identifying the export item layer, resource layer or component layer through the recognition algorithm;
[0098] Step S42, displaying the identified layers on the export items in the right panel for user viewing and management;
[0099] Step S43, displaying the cut-image resources according to the layer type and the export item status.
[0100] In an optional manner, the display result of the slice resource includes instance components, resource and component combinations, resource and instance combinations, and instance components only;
[0101] When the layer is a resource layer, the export item is included; when the layer is a non-resource layer, the export item is not included.
[0102] In an optional manner, the method further includes:
[0103] Step S61, selecting an interactive operation in response to a resource in the resource list;
[0104] Step S62, highlighting the corresponding layer of the resource selected by the user in the canvas with a semi-transparent border, wherein non-component or instance layers are displayed with a blue border, and component or instance layers are displayed with a purple border;
[0105] Step S63, responding to the interactive operation of the layer, and performing corresponding highlighting, editing and exporting operations.
[0106] In an optional manner, the vector layer includes a circle, a star, a polygon, a picture, and a path.
[0107] In an optional manner, the method further includes:
[0108] Step S71, segmenting the design file into a plurality of independent image regions by using an image segmentation algorithm, each of the image regions corresponding to at least one layer;
[0109] Step S72, extracting shape, color and texture features from each of the image regions;
[0110] Step S73, training is performed based on the data sets of known resource layers and non-resource layers;
[0111] Step S74, applying the trained classifier in step S71 to classify the segmented image area into resource layers.
[0112] In an optional manner, in step S71, the design file is segmented into multiple independent image regions by using a U-Net or Mask R-CNN semantic segmentation network model;
[0113] In step S72, shape, color and texture features are extracted by local binary patterns.
[0114] The solution provided by the above embodiment of the present invention is as follows: step S11, obtaining all layer information in the design file, the layer information including layer type, size, position and content; step S12, identifying vector layers and hierarchical layers that meet preset conditions and using them as resource layers, wherein the preset conditions include that the width and height of the boundary of a single layer do not exceed preset values; step S13, excluding non-resource layers including straight lines and connecting lines; step S14, for the hierarchical layers, recursively checking whether its sub-layers contain containers, texts and instances according to the resource layer recognition algorithm; step S15, displaying the layer identified as the resource layer as a resource thumbnail and hiding its sub-layers; step S16, locating the corresponding layer in the canvas by selecting the resource in the resource list, and highlighting it with a translucent border. The present invention greatly reduces the manual operation time and human errors of designers and developers by identifying and classifying the resource layers in the design software, improves the design quality and user experience while improving the design and development work efficiency, and makes the user interface more beautiful and easy to use. Specifically, based on the preset conditions and algorithms for layer recognition, designers can more clearly manage the resource layers in the design file. Display resource layers as thumbnails and hide their sublayers to make the user interface neater and more intuitive. Highlight selected resource layers with a translucent border to enhance user experience and interactivity. Display identified resource layers on the export items on the right panel to facilitate user viewing and management. The present invention is applicable to various design software and project types, including but not limited to mobile applications, web applications, etc., has broad application prospects, can be customized and optimized according to different design requirements and project characteristics, and has strong adaptability and flexibility.
[0115] The algorithm or display provided herein is not inherently related to any particular computer, virtual system or other equipment. Various general purpose systems can also be used together with the teachings based on this. According to the above description, it is obvious to construct the structure required for this type of system. In addition, the embodiment of the present invention is not directed to any specific programming language yet. It should be understood that various programming languages can be utilized to realize the content of the present invention described herein, and the description made to specific languages above is for disclosing the best mode of the present invention.
[0116] In the description provided herein, a large number of specific details are described. However, it is understood that embodiments of the present invention can be practiced without these specific details. In some instances, well-known methods, structures and techniques are not shown in detail so as not to obscure the understanding of this description.
[0117] Similarly, it should be understood that in order to streamline the present invention and aid in understanding one or more of the various inventive aspects, in the above description of exemplary embodiments of the present invention, the various features of the embodiments of the present invention are sometimes grouped together into a single embodiment, figure, or description thereof. However, this disclosed method should not be interpreted as reflecting the following intention: that the claimed invention requires more features than the features explicitly recited in each claim. More specifically, as reflected in the claims below, inventive aspects lie in less than all the features of the individual embodiments disclosed above. Therefore, the claims that follow the specific embodiment are hereby expressly incorporated into the specific embodiment, with each claim itself serving as a separate embodiment of the present invention.
[0118] Those skilled in the art will appreciate that the modules in the devices in the embodiments may be adaptively changed and arranged in one or more devices different from the embodiments. The modules or units or components in the embodiments may be combined into one module or unit or component, and in addition they may be divided into a plurality of submodules or subunits or subcomponents. Except that at least some of such features and / or processes or units are mutually exclusive, all features disclosed in this specification (including the accompanying claims, abstracts and drawings) and all processes or units of any method or device disclosed in this manner may be combined in any combination. Unless otherwise expressly stated, each feature disclosed in this specification (including the accompanying claims, abstracts and drawings) may be replaced by an alternative feature providing the same, equivalent or similar purpose.
[0119] In addition, those skilled in the art will appreciate that, although some embodiments herein include certain features included in other embodiments but not other features, the combination of features of different embodiments is meant to be within the scope of the present invention and form different embodiments. For example, in the claims below, any one of the claimed embodiments may be used in any combination.
[0120] The various component embodiments of the present invention can be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. It should be understood by those skilled in the art that a microprocessor or digital signal processor (DSP) can be used in practice to implement some or all functions of some or all components according to embodiments of the present invention. The present invention can also be implemented as a device or apparatus program (e.g., computer program and computer program product) for executing part or all of the methods described herein. Such a program implementing the present invention can be stored on a computer-readable medium, or can have the form of one or more signals. Such a signal can be downloaded from an Internet website, or provided on a carrier signal, or provided in any other form.
[0121] It should be noted that the above embodiments illustrate the present invention rather than limit it, and that those skilled in the art may devise alternative embodiments without departing from the scope of the appended claims. In the claims, any reference symbol between brackets shall not be construed as a limitation on the claims. The word "comprising" does not exclude the presence of elements or steps not listed in the claims. The word "one" or "an" preceding an element does not exclude the presence of a plurality of such elements. The present invention may be implemented by means of hardware comprising a number of different elements and by means of a suitably programmed computer. In a unit claim enumerating a number of devices, several of these devices may be embodied by the same hardware item. The use of the words first, second, and third, etc. does not indicate any order. These words may be interpreted as names. The steps in the above embodiments, unless otherwise specified, should not be understood as limitations on the order of execution.
Claims
1. A design resource layer identification method, characterized in that: include: Step S11, obtaining all layer information in the design file, wherein the layer information includes layer type, size, position and content; Step S12, identifying vector layers and hierarchical layers that meet preset conditions and using them as resource layers, wherein the preset conditions include that the width and height of a single layer boundary do not exceed preset values; Step S13, excluding non-resource layers including straight lines and connecting lines; Step S14, for the hierarchical layer, recursively checking whether its sub-layers contain containers, texts and instances according to a resource layer identification algorithm; Step S15, displaying the layer identified as the resource layer as a resource thumbnail and hiding its sublayers; Step S16, locating the corresponding layer in the canvas by selecting a resource in the resource list and highlighting it with a semi-transparent border.
2. The method according to claim 1, characterized in that The preset conditions also include: Lines and connectors are not recognized as resource layers; and, For fills containing images, their size constraints are ignored.
3. The method according to claim 2, characterized in that The hierarchical layers include containers, groups and Boolean groups; When the sub-layer does not include a container, text, or instance, it is identified as a resource layer.
4. The method according to claim 1, characterized in that: The method further comprises: Step S41, traversing the sub-layers of the current layer, and identifying the export item layer, resource layer or component layer through the recognition algorithm; Step S42, displaying the identified layers on the export items in the right panel for user viewing and management; Step S43, displaying the cut-image resources according to the layer type and the export item status.
5. The method according to claim 4, characterized in that The display results of the sliced resources include instance components, resource and component combinations, resource and instance combinations, and instance components only; When the layer is a resource layer, the export item is included; when the layer is a non-resource layer, the export item is not included.
6. The method according to claim 1, characterized in that The method further comprises: Step S61, selecting an interactive operation in response to a resource in the resource list; Step S62, highlighting the corresponding layer of the resource selected by the user in the canvas with a semi-transparent border, wherein non-component or instance layers are displayed with a blue border, and component or instance layers are displayed with a purple border; Step S63, responding to the interactive operation of the layer, and performing corresponding highlighting, editing and exporting operations.
7. The method according to claim 1, characterized in that The vector layers include circles, stars, polygons, pictures and paths.
8. The method according to any one of claims 1 to 7, characterized in that The method further comprises: Step S71, segmenting the design file into a plurality of independent image regions by using an image segmentation algorithm, each of the image regions corresponding to at least one layer; Step S72, extracting shape, color and texture features from each of the image regions; Step S73, training is performed based on the data sets of known resource layers and non-resource layers; Step S74, applying the trained classifier in step S71 to classify the segmented image area into resource layers.
9. The method according to claim 8, characterized in that In step S71, the design file is segmented into multiple independent image regions by using a U-Net or Mask R-CNN semantic segmentation network model; In step S72, shape, color and texture features are extracted by local binary patterns.
10. A design resource layer recognition device, characterized in that: include: A layer information acquisition module is used to acquire all layer information in the design file, wherein the layer information includes layer type, size, position and content; A resource layer identification module, used to identify vector layers and hierarchical layers that meet preset conditions and use them as resource layers, wherein the preset conditions include that the width and height of a single layer boundary do not exceed preset values; Layer exclusion module, used to exclude non-resource layers including straight lines and connecting lines; A sub-layer identification module, for recursively checking, for the hierarchical layer, whether its sub-layer contains a container, text, and an instance according to a resource layer identification algorithm; A resource layer display module, used to display a layer identified as a resource layer as a resource thumbnail and hide its sublayers; The interactive display module is used to locate the corresponding layer in the canvas by selecting the resource in the resource list and highlighting it with a semi-transparent border.
Citation Information
Cited By
Method and system for automatically identifying device
CN118982000A
