Picture frame identification method and system and storage medium
By identifying and locating drawing frames in CAD drawings, the problem of low efficiency in drawing frame recognition has been solved, enabling efficient drawing management and permission settings, and improving viewing efficiency and refined management.
Patent Information
- Application Number
- CN202410935636.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-09
- Publication Date
- 2024-11-15
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
In existing CAD drawing files, the recognition and positioning of drawing frames are inefficient, making it difficult to set permissions and implement refined management, resulting in increased workload and the introduction of errors.
By extracting graphic element information, a database of rectangles to be verified is established. The frame is identified using a preset feature set. The frame is located based on world coordinates and a database of frames is generated, enabling fast querying and display.
It improved the efficiency of viewing drawings, optimized drawing management, reduced the error rate, and enabled refined permission management of drawing frames.
Smart Images

Figure CN118964661A_ABST
Abstract
Description
Description of the case
[0001] This application is a divisional application filed for the Chinese application with the application date of April 9, 2024, application number 202410420322.5, and invention name “A drawing information positioning method, system and storage medium”. Technical Field
[0002] The present invention relates to the technical field of electronic drawings, and in particular to a drawing frame recognition method, system and storage medium. Background Art
[0003] CAD drawing files are widely used in the construction engineering, electromechanical manufacturing and other industries to guide production construction and product manufacturing. CAD drawing files contain a large amount of drawing information. The basic unit of this drawing information is the primitive (such as a line segment). Usually, a rectangle with certain characteristics (called a frame) is used to surround multiple primitives with specific meanings to achieve visual grouping of primitives. Groups of primitives with specific meanings usually constitute the smallest unit to guide production construction and product manufacturing, and are used independently. For example, a group of primitives with specific meanings can be a floor plan in the field of construction engineering, a large-scale drawing of a construction node, an engineering design description, a part drawing in the field of electromechanical manufacturing, etc.
[0004] However, CAD drawing files often contain multiple frames with certain characteristics. When processing CAD files containing multiple frames, if specific graphics are grouped according to a single frame, there are often many inconveniences. For example, when printing a blueprint, the frames need to be manually split, which not only increases the workload, but may also introduce errors and undermine the authority of the original CAD drawing file. For another example, when viewing a frame separately on an electronic device, the user usually needs to transfer and load the entire file, and then frequently zoom in, zoom out, drag and drop to find the corresponding frame. This is not only inefficient, but also unable to set permissions for different frames in the CAD drawing file, making it difficult to achieve hierarchical management of frame permissions.
[0005] Therefore, a drawing frame recognition method, system and storage medium are provided, which can intelligently recognize and locate the drawing frame, improve the viewing efficiency of the drawing and optimize the drawing management. Summary of the invention
[0006] In view of this, the embodiments of this specification provide a drawing frame recognition method, system and storage medium, which can intelligently recognize and locate the drawing frame. The user only needs to enter the drawing name information to quickly locate and display the corresponding drawing frame. It not only significantly improves the efficiency of drawing viewing, but also makes drawing management more refined, helps to optimize the workflow and reduce the error rate.
[0007] One of the embodiments of the present specification provides a frame recognition method, the method comprising: extracting all graphics elements in a drawing and graphics element information of the graphics elements, the graphics element information comprising layer information to which the graphics elements belong; determining a rectangle database to be verified based on the graphics elements and the layer information, each group of data to be verified in the rectangle database to be verified comprises four graphics elements; based on a first preset feature set, verifying each group of data to be verified in the rectangle database to be verified to determine a rectangle database; verifying each group of rectangle data in the rectangle database to determine a frame database, each group of rectangle data in the frame database corresponds to a frame.
[0008] One of the embodiments of the present specification provides a frame recognition system, the system comprising: a data preprocessing module, used to extract all graphics elements in a drawing and graphics element information of the graphics elements, the graphics element information including layer information to which the graphics elements belong; based on the graphics elements and the layer information, determining a rectangle database to be verified, each group of data to be verified in the rectangle database to be verified includes 4 graphics elements; a rectangle recognition module, used to verify each group of data to be verified in the rectangle database to be verified based on a first preset feature set, and determine a rectangle database; a frame recognition module, used to verify each group of rectangle data in the rectangle database, and determine a frame database, each group of rectangle data in the frame database corresponds to a frame; a positioning module, used to group the graphics elements based on the world coordinates of the frame, and establish a first grouping database; a query module, used to obtain drawing query information, retrieve the first grouping database based on the drawing query information, and determine target graphics element information to be displayed.
[0009] One of the embodiments of the present specification provides a computer-readable storage medium, wherein the storage medium stores computer instructions. When the computer instructions are executed by a computer, a frame recognition method is implemented.
[0010] The embodiments of this specification include at least the following beneficial effects: the drawing frame can be quickly identified and located by querying the first grouping database; the drawing frame is located and displayed according to the input drawing name information, which helps to improve viewing efficiency, refine drawing management, and help optimize workflow. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] This specification will be further described in the form of exemplary embodiments, which will be described in detail by the accompanying drawings. These embodiments are not restrictive, and in these embodiments, the same number represents the same structure, wherein:
[0012] Figure 1 It is a schematic diagram of an application scenario of a drawing information positioning system according to some embodiments of this specification;
[0013] Figure 2is an exemplary module diagram of a drawing information positioning system according to some embodiments of this specification;
[0014] Figure 3 is an exemplary flow chart of a drawing information locating method according to some embodiments of this specification;
[0015] Figure 4 is an exemplary schematic diagram of determining a frame database according to some embodiments of this specification;
[0016] Figure 5 is an exemplary schematic diagram of determining a first grouping database according to some embodiments of this specification;
[0017] Figure 6 It is an exemplary schematic diagram of determining target primitive information according to some embodiments of this specification.
[0018] Explanation of the accompanying drawings: 100 is an application scenario of the drawing information positioning system; 110, drawing; 120, processor; 130, memory; 140, user terminal; 200 is a drawing information positioning system; 210, data preprocessing module; 220, rectangle recognition module; 230, frame recognition module; 240, positioning module; 250, query module; 410, size range; 420, rectangle database; 430, first sub-database; 440, second preset feature set; 450, second sub-database; 460, frame database; 510, world coordinates; 520, frame; 530, frame element; 540, first association; 550, text information; 560, second association; 570, first group database; 610, drawing query information; 620, target first group; 630, target element information. DETAILED DESCRIPTION
[0019] In order to more clearly illustrate the technical solutions of the embodiments of this specification, the following is a brief introduction to the drawings required for the description of the embodiments. Obviously, the drawings described below are only some examples or embodiments of this specification. For ordinary technicians in this field, this specification can also be applied to other similar scenarios based on these drawings without creative work. Unless it is obvious from the language environment or otherwise explained, the same reference numerals in the figures represent the same structure or operation.
[0020] It should be understood that the "system", "device", "unit" and / or "module" used herein are a method for distinguishing different components, elements, parts, portions or assemblies at different levels. However, if other words can achieve the same purpose, the words can be replaced by other expressions.
[0021] As shown in this specification and claims, unless the context clearly indicates an exception, the words "a", "an", "an" and / or "the" do not refer to the singular and may also include the plural. Generally speaking, the terms "comprise" and "include" only indicate the inclusion of the steps and elements that have been clearly identified, and these steps and elements do not constitute an exclusive list. The method or device may also include other steps or elements.
[0022] Flowcharts are used in this specification to illustrate the operations performed by the system according to the embodiments of this specification. It should be understood that the preceding or following operations are not necessarily performed precisely in order. Instead, the steps may be processed in reverse order or simultaneously. At the same time, other operations may also be added to these processes, or one or more operations may be removed from these processes.
[0023] Figure 1 Schematic diagram of application scenarios of the drawing information positioning system shown in some embodiments of this specification. Figure 1 As shown, the application scenario 100 of the drawing information positioning system may include a drawing 110 , a processor 120 , a memory 130 and a user terminal 140 .
[0024] Drawing 110 refers to a drawing file that needs to be located and processed. In some embodiments, drawing 110 may be an electronic drawing generated by CAD software, or a paper drawing converted into an electronic format by scanning or other means. In some embodiments, drawing 110 includes at least one primitive and primitive information of the primitive. For more information about primitives, see Figure 3 and its related description.
[0025] The processor 120 refers to a device or component that processes data and generates instructions. For example, the processor 120 may include a central processing unit (CPU), a graphics processing unit (GPU), an application-specific integrated circuit (ASIC), etc. or any combination thereof. The data may come from the above-mentioned different components or other data sources. For example, the processor 120 may extract all the primitives and the primitive information of the primitives in the drawing 110. For another example, the processor 120 may determine the target primitive information to be displayed based on the drawing query information. Instructions may be sent to the above-mentioned different components. The processor 120 may also include other components related to the above-mentioned contents, for example, the processor 120 may also refer to a computer, a mobile phone, a server, an industrial computer, a circuit board with computing functions, etc.
[0026] The memory 130 may be used to store data and / or instructions. Data refers to a digital representation of information and may include various types, such as binary data, text data, image data, video data, etc. Instructions refer to programs that can control a device or a device to perform a specific function. The memory 130 may include one or more storage components, each of which may be an independent device or a part of another device. In some embodiments, the memory 130 may include a random access memory (RAM), a read-only memory (ROM), a large-capacity memory, a removable memory, a volatile read-write memory, etc., or any combination thereof. In some embodiments, the memory 130 may store the drawing 110. In some embodiments, the memory 130 may store data information of the processor 120. For example, the memory 130 may store a to-be-checked rectangle database, a rectangle database, a frame database, and a first grouping database, etc., generated by the processor 120.
[0027] The user terminal 140 refers to one or more terminal devices or software used by the user. In some embodiments, the user terminal 140 may be used by one or more users, including users who directly use the service, or other related users. In some embodiments, the user terminal 140 may be one or any combination of other devices with input and / or output functions, such as a mobile device, a tablet computer, a laptop computer, a desktop computer, etc. In some embodiments, the user terminal 140 may be used to display target primitive information. The target primitive information refers to the primitive information of a specific primitive obtained by query.
[0028] For more information about the target element, see Figure 3-Figure 6 and its related description.
[0029] It should be noted that the above description of the application scenario 100 of the drawing information positioning system is only for the convenience of description and cannot limit this specification to the scope of the embodiment. It is understandable that for those skilled in the art, after understanding the principle of the drawing information positioning system, it is possible to arbitrarily combine the various components without deviating from this principle. Such variations are all within the scope of protection of this specification.
[0030] Figure 2 is an exemplary module diagram of a drawing information positioning system according to some embodiments of this specification. Figure 2 As shown, the drawing information positioning system 200 may include a data preprocessing module 210, a rectangle recognition module 220, a frame recognition module 230, a positioning module 240, and a query module 250. In some embodiments, the data preprocessing module 210, the rectangle recognition module 220, the frame recognition module 230, the positioning module 240, and the query module 250 may be configured in a processor (e.g., the processor 120).
[0031] In some embodiments, the data preprocessing module 210 can extract all the primitives and the primitive information of the primitives in the drawing; and determine the rectangle database to be checked based on the primitives and layer information.
[0032] In some embodiments, the primitive information also includes reference information of the primitive, and the layer information includes printing information of the layer; the data preprocessing module 210 can also determine the valid primitives based on the reference information and / or printing information, and establish a second grouping database based on the layer information of the valid primitives; for any second grouping database, any four incompletely repeated primitives are combined into a group of data to be verified, and a rectangular database to be verified is determined.
[0033] In some embodiments, the rectangle recognition module 220 may verify each group of data to be verified in the rectangle database to be verified based on the first preset feature set to determine the rectangle database.
[0034] In some embodiments, the frame recognition module 230 may check each set of rectangle data in the rectangle database to determine the frame database.
[0035] In some embodiments, the frame recognition module 230 can obtain the size range of the standard frame, verify each group of rectangular data in the rectangular database based on the size range, and determine the first sub-database; verify each group of rectangular data in the first sub-database based on the second preset feature set, and determine the second sub-database; verify the overlap of each group of rectangular data in the second sub-database to determine the frame database.
[0036] In some embodiments, the frame recognition module 230 can traverse any two sets of rectangular data in the second sub-database to determine whether there is an overlapping area in the coordinate area of any two sets of rectangular data; in response to the existence of an overlapping area, delete the rectangular data whose area meets the preset conditions to obtain a frame database.
[0037] In some embodiments, the positioning module 240 may group the graphics primitives based on the world coordinates of the graphics frame and establish a first grouping database.
[0038] In some embodiments, the positioning module 240 can locate the frame elements contained in the frame based on the world coordinates, and establish a first association between the frame elements and the world coordinates of the frame; extract text information from the frame elements, and establish a second association between the text information and the frame; and generate a first grouping database based on the first association and the second association.
[0039] In some embodiments, the positioning module 240 may determine the frame primitives contained in the frame based on the world coordinates, extract text information of the frame primitives, and establish a third association between the text information and the world coordinates of the frame; and generate a first grouping database based on the third association.
[0040] In some embodiments, the query module 250 may obtain drawing query information, search the first grouping database based on the drawing query information, and determine the target graphic element information to be displayed.
[0041] In some embodiments, the query module 250 may match the drawing query information with the text information associated with each first group in the first group database to determine the target first group; and determine the graphic element information of the graphic element contained in the target first group as the target graphic element information.
[0042] In some embodiments, the query module 250 can match the drawing query information with the text information associated with each first group in the first group database, determine the target first group, determine the frame in the target first group as the target frame; and determine the target graphic element information based on the world coordinates of the target frame.
[0043] For more information about the data preprocessing module 210, the rectangle recognition module 220, the frame recognition module 230, the positioning module 240 and the query module 250, see Figure 3-Figure 6 and its related description.
[0044] It should be noted that the above description of the drawing information positioning system 200 and its modules is only for the convenience of description and cannot limit the present specification to the scope of the embodiments. It is understandable that for those skilled in the art, after understanding the principle of the system, it is possible to arbitrarily combine the modules or form a subsystem to connect with other modules without deviating from the principle. In some embodiments, Figure 1 The data preprocessing module 210, rectangle recognition module 220, frame recognition module 230, positioning module 240 and query module 250 disclosed in the specification can be different modules in a system, or one module can realize the functions of two or more modules. For example, each module can share a storage module, or each module can have its own storage module. Such variations are all within the protection scope of this specification.
[0045] Figure 3 is an exemplary flow chart of a method for locating drawing information according to some embodiments of this specification. Figure 3 As shown, the drawing information positioning method includes the following steps 310 to 360. In some embodiments, steps 310 to 360 may be executed by a processor.
[0046] Step 310: extract all the graphics elements and their graphics element information in the drawing.
[0047] For instructions on drawings and how to obtain them, see Figure 1and its related description.
[0048] A primitive refers to a basic unit constituting drawing information. A primitive may be a visible graphic entity in the drawing information. For example, a primitive may be a line segment in a CAD drawing. In some embodiments, the processor may extract all primitives and primitive information of the primitives in the drawing through a drawing parsing engine.
[0049] Element information refers to data associated with an element. For example, element information may include one or more of whether an element is referenced, the name of the layer to which the element belongs, whether the layer to which the element belongs contains other elements, whether the layer is printed, and the reference file information of the drawing. Reference files refer to other drawing files associated with the drawing. Reference file information may include element information of each element contained in the reference file, etc.
[0050] In some embodiments, the primitive information includes the layer information to which the primitive belongs. Layers are hierarchical methods used to organize and manage primitives in drawings, and each layer can be independently edited and controlled with its transparency, color, size and other properties. In some embodiments, the layers can be determined by the user by grouping the primitives.
[0051] Layer information refers to the relevant information of the layer to which the primitive belongs. For example, the layer information may include the layer name, outline, dimension, text description, etc. In some embodiments, the layer information may include the printing information of the layer. The printing information refers to the information whether the layer needs to be printed.
[0052] In some embodiments, the primitive information may also include reference information of the primitive. The reference information refers to relevant information on whether the primitive is referenced.
[0053] In some embodiments, the primitive information may also include text information of the primitive. The text information of the primitive refers to text data associated with the primitive. For example, the text information of the primitive may include the logo, name, description, dimension, annotation, etc. of the primitive.
[0054] In some embodiments, the processor may extract the graphic element information of each graphic element in the drawing through the drawing parsing engine.
[0055] Step 320: Determine a rectangle database to be checked based on the primitive and layer information.
[0056] The to-be-verified rectangular database refers to a database used to store the to-be-verified data.
[0057] The data to be verified refers to a group of graphic elements to be verified to see whether they form a rectangle. In some embodiments, each group of data to be verified in the database of rectangles to be verified includes 4 graphic elements.
[0058] In some embodiments, the processor can select 4 primitives from n primitives of any one or more layers for grouping based on primitive and layer information to generate a rectangular database to be verified including C (n, 4) primitive groups. C (n, 4) is a permutation and combination formula, which is used to select 4 different elements from n elements, and the number of all permutations and combinations obtained, wherein the order of selecting elements is not considered in the permutations and combinations. In this embodiment, the 4 primitives in any group of data to be verified included in the rectangular database to be verified are not limited to whether they belong to the same layer.
[0059] In some embodiments, the processor can randomly select 4 primitives from m primitives belonging to the same layer for grouping based on the primitive and layer information to generate C(m, 4) primitive groups; repeat the above steps to group primitives for other layers respectively to obtain a rectangular database to be checked.
[0060] In some embodiments, the processor can determine valid primitives based on reference information and / or printing information, and establish a second grouping database based on the layer information of the valid primitives; for any second grouping database, any four incompletely repeated primitives are combined into a group of data to be verified to determine a rectangular database to be verified.
[0061] Valid entities refer to entities that are officially used in drawings. For example, auxiliary contents (such as auxiliary lines) in drawing files will not be officially used, and the entities corresponding to these contents are invalid entities. On the contrary, entities that are officially used are valid entities.
[0062] In some embodiments, the processor may determine that the referenced primitive is a valid primitive based on the reference information. In some embodiments, the processor may determine that the primitive in the printed layer is a valid primitive based on the printing information. In some embodiments, the processor may determine that the referenced primitive in the printed layer is a valid primitive.
[0063] It is understandable that unreferenced primitives are redundant data of the drawing file and will not be officially used. After cleaning, the operating efficiency and accuracy of the subsequent recognition system can be improved. The primitives under the unprinted layer are auxiliary content of the drawing file (such as auxiliary lines) and will not be officially used. After cleaning, the operating efficiency and accuracy of the subsequent recognition system can be improved.
[0064] The second grouping database refers to a database used to store the graphic element information of the valid graphic elements in a certain layer.
[0065] In some embodiments, the processor may determine the layer to which each valid primitive belongs based on the layer information of multiple valid primitives. The processor may determine that the layer in which the valid primitive exists is a valid layer. In some embodiments, for each valid layer, the processor may construct a second grouping database corresponding to the valid layer based on the primitive information of the valid primitives contained in the valid layer.
[0066] In some embodiments, the processor may combine any incompletely repeated four primitives in each second grouping database into a group of data to be verified, and store them in the rectangular database to be verified. The incompletely repeated four primitives may include the existence of four identical primitives, three identical primitives, two identical primitives, four different primitives, etc. In this embodiment, the rectangular database to be verified includes four valid primitives in each group of data to be verified belonging to the same layer.
[0067] In some embodiments of this specification, some primitives that cannot form a frame are filtered out by reference information and print information, which can improve the efficiency and accuracy of subsequent recognition and reduce the complexity of the entire recognition calculation. At the same time, primitives under different layers do not have the possibility of becoming rectangles. After grouping the primitives by layer, multiple second grouping databases are obtained, which helps to improve the efficiency and accuracy of the subsequent recognition system.
[0068] Step 330 : Based on the first preset feature set, verify each group of data to be verified in the rectangular database to be verified, and determine the rectangular database.
[0069] The first preset feature set is a feature set used to determine whether the data to be verified constitutes a rectangle. The first preset feature set includes multiple first preset features. The first preset feature is a feature condition used to determine whether the data to be verified constitutes a rectangle. For example, the first preset feature set may include one or more first preset features such as 4 graphic elements in a group of data to be verified are all straight line segments, intersecting with each other, the sum of the 4 angles formed is 360 degrees, the lengths are equal, and the 4 angles formed are all 90 degrees. In some embodiments, the first preset feature set can be pre-set by professionals.
[0070] In some embodiments, when the four primitives in a group of data to be verified are all straight line segments, it can be determined that the data to be verified has rectangular features. In some embodiments, when the four primitives in a group of data to be verified intersect each other, it can be determined that the data to be verified has rectangular features. In some embodiments, when the sum of the four angles formed by the four primitives in a group of data to be verified is 360 degrees, it can be determined that the data to be verified has rectangular features. In some embodiments, when the lengths of the four primitives in a group of data to be verified are equal, it can be determined that the data to be verified has rectangular features.
[0071] In some embodiments, when the four angles formed by four graphic elements in a set of data to be verified are all 90 degrees, it can be determined that the data to be verified constitutes a rectangle.
[0072] In some embodiments, when four graphic elements in a set of data to be verified satisfy all first preset features in a first preset feature set, it can be determined that the data to be verified constitutes a rectangle.
[0073] The rectangular database refers to a database for storing rectangular data. The rectangular data refers to a group of graphic elements constituting a rectangle. The rectangular data includes 4 graphic elements, and the 4 graphic elements included in the rectangular data meet all the first preset features in the first preset feature set.
[0074] In some embodiments, the processor may determine the data to be verified in the rectangular database to be verified that meets the first preset feature set as rectangular data, and store it in the rectangular database. For example, the processor may compare the first preset feature of all the data to be verified in the rectangular database to the first preset feature set in sequence; determine the data to be verified that meets all the first preset features as rectangular data, and store it in the rectangular database.
[0075] It should be noted that when the four primitives in any group of data to be verified in the rectangular database to be verified are not limited to whether they belong to the same layer, the four primitives in any group of data to be verified in the rectangular database determined based on the rectangular database to be verified are also not limited to whether they belong to the same layer. When the four primitives in each group of data to be verified included in the rectangular database to be verified belong to the same layer, the four primitives in each group of data to be verified in the rectangular database determined based on the rectangular database to be verified also belong to the same layer.
[0076] Step 340, verify each set of rectangle data in the rectangle database to determine the frame database.
[0077] The frame database refers to a database for storing frames. In some embodiments, each set of rectangle data in the frame database corresponds to a frame.
[0078] A drawing frame refers to rectangular data with certain characteristics. For example, a drawing frame can be rectangular data whose position and size meet the set requirements.
[0079] In some embodiments, the processor may determine rectangular data with certain characteristics in the rectangular database as frames, make a one-to-one correspondence between the rectangular data corresponding to each frame and the frame, and store them in the frame database.
[0080] In some embodiments, the processor may determine the frame database based on the size range of the standard frame, the second preset feature set, and the overlap of the rectangular data. For more information about this embodiment, see Figure 4and its related description.
[0081] It should be noted that when the four primitives in any group of rectangular data in the rectangular database are not limited to whether they belong to the same layer, the four primitives in any group of rectangular data in the frame database determined based on the rectangular database are also limited to whether they belong to the same layer. When the four primitives in each group of rectangular data in the rectangular database belong to the same layer, the four primitives in each group of rectangular data in the frame database determined based on the rectangular database also belong to the same layer.
[0082] Step 350 , grouping the graphics primitives based on the world coordinates of the graphics frame, and establishing a first grouping database.
[0083] World coordinates refer to the position information of the frame in a drawing (e.g., a CAD drawing file). In some embodiments, the world coordinates may include the coordinates of the four vertices of the frame. In some embodiments, the world coordinates may include the coordinate ranges of the four sides of the frame. In some embodiments, the processor may obtain the world coordinates of the frame based on the position information of the rectangular data corresponding to the frame.
[0084] The first grouping database refers to a database for storing the first grouping. The first grouping refers to a grouping of graphic elements determined based on a picture frame. In some embodiments, the first grouping includes four graphic elements corresponding to the picture frame border and one or more graphic elements inside the picture frame. The number of picture frames corresponds to the number of first groups.
[0085] In some embodiments, the processor can locate the four primitives corresponding to the frame border and the in-frame primitives contained in the frame based on the world coordinates of the frame, and treat the four primitives corresponding to the frame border of the same frame and one or more in-frame primitives contained in the frame as a first group with the frame, and store the first groups corresponding to each frame in the first grouping database. The four primitives corresponding to the frame border are the four primitives contained in the rectangular data corresponding to the frame. The in-frame primitives refer to the primitives contained in the frame.
[0086] In some embodiments, the processor may determine the first association and the second association respectively, and establish a first grouping database based on the first association and the second association.
[0087] In some embodiments, the processor may also determine a third association, and establish a first grouping database based on the third association. For more information about the first association, the second association, and the third association, see Figure 5 and its related description.
[0088] It should be noted that when the four graphics elements in any group of rectangular data in the frame database are not limited to whether they belong to the same layer, the four graphics elements in any group of first groups in the first grouping database determined based on the frame database are also limited to whether they belong to the same layer. When the four graphics elements in each group of rectangular data in the frame database belong to the same layer, the four graphics elements in each group of first groups in the first grouping database determined based on the frame database also belong to the same layer.
[0089] Step 360: Acquire drawing query information, search the first grouping database based on the drawing query information, and determine the target graphic element information to be displayed.
[0090] Drawing query information refers to information for querying drawings. For example, the drawing query information may be the name of the element to be queried, the name of the layer to be queried, the world coordinates of the frame to be queried, etc. In some embodiments, the drawing query information may be obtained based on user input.
[0091] In some embodiments, the processor matches the primitive associated with the drawing query information in the first grouping database based on the drawing query information, and uses the primitive information of the primitive as the target primitive information. In some embodiments, the primitive associated with the drawing query information may include a primitive having the same primitive name as the primitive to be queried, a primitive belonging to the same layer name as the layer to be queried, a primitive corresponding to a frame having a world coordinate close to the frame to be queried, etc.
[0092] In some embodiments, the processor may match the primitive associated with the drawing query information in the first grouping database based on the drawing query information (e.g., the name of the primitive to be queried), and use the primitive information of the primitive as the target primitive information. In some embodiments, the processor may match the layer associated with the drawing query information in the first grouping database based on the drawing query information (e.g., the name of the layer to be queried), and use the primitive information of all primitives contained in the layer as the target primitive information. In some embodiments, the processor may match the frame associated with the drawing query information in the first grouping database based on the drawing query information (e.g., the world coordinates of the frame to be queried), and use the primitive information of all primitives corresponding to the frame as the target primitive information.
[0093] In some embodiments, the processor may match the drawing query information with the text information associated with each first group in the first group database to determine the target primitive information. For more information on determining the target primitive information, see Figure 6 and its related description.
[0094] In some embodiments of the present specification, the drawing frame can be quickly identified and located by querying the first grouping database; the drawing frame is located and displayed according to the input drawing name information, which helps to improve viewing efficiency and refine drawing management.
[0095] It should be noted that the above description of steps 310 to 360 is only for example and explanation, and does not limit the scope of application of this specification. For those skilled in the art, various modifications and changes can be made to steps 310 to 360 under the guidance of this specification. However, these modifications and changes are still within the scope of this specification.
[0096] Figure 4 is an exemplary schematic diagram of determining a frame database according to some embodiments of the present specification.
[0097] like Figure 4 As shown, in some embodiments, the processor can obtain the size range 410 of the standard frame, verify each group of rectangular data in the rectangular database 420 based on the size range 410, and determine the first sub-database 430; verify each group of rectangular data in the first sub-database 430 based on the second preset feature set 440, and determine the second sub-database 450; verify the overlap of each group of rectangular data in the second sub-database 450, and determine the frame database 460.
[0098] The standard drawing frame refers to a drawing frame used as a standard. In some embodiments, the standard drawing frame can be set and determined by professionals based on historical experience.
[0099] The size range of standard drawing frames can be determined according to different drawing formats. Common drawing frame formats include A0, A1, A2, A3, A4, etc. For example, the length of A0 drawing frame format is 1189mm and the width is 841mm; the length of A1 drawing frame format is 841mm and the width is 594mm; the length of A2 drawing frame format is 594mm and the width is 420mm; the length of A3 drawing frame format is 420mm and the width is 297mm; the length of A4 drawing frame format is 297mm and the width is 210mm.
[0100] In some embodiments, the processor may correct the size range of commonly used picture frame formats based on the error correction value to obtain the size range of the standard picture frame. For example, the processor may correct the size range of the above five commonly used picture frame formats using an error correction value of plus or minus 10 mm to obtain the size range of five standard picture frames.
[0101] In some embodiments, the processor can correct the size range of the commonly used frame format based on multiple preset correction ratios in response to the printing demand to obtain multiple standard frame size ranges. In some embodiments, the size correction ratio includes but is not limited to 1:50, 1:100, 1:150, 1:200, 1:250, 1:300, 1:500, etc.
[0102] For example, the processor can enlarge the frame sizes in equal proportions according to a plurality of preset correction ratios based on the size ranges of the above five commonly used frame formats to obtain a plurality of standard frame size ranges. As an example only, when the size correction ratios include the above seven, 35 standard frame size ranges can be determined based on the size ranges of the above five commonly used frame formats.
[0103] For more information about rectangle databases and rectangle data, see Figure 3 and its related description.
[0104] The first sub-database refers to a database composed of rectangular data whose size range meets the requirements. In some embodiments, the processor can store the rectangular data in the rectangular database that meets the size range of the standard frame in the first sub-database. For example, the processor can use the size of the two longer primitives in the rectangular data as the length and the size of the two shorter primitives as the width to determine whether it meets the size range of the standard frame.
[0105] In some embodiments, the processor may determine whether the size range of each set of rectangular data in the rectangular database satisfies the first preset condition and / or the second preset condition to verify whether the size range of each set of rectangular data in the rectangular database satisfies the size range of the standard frame. In some embodiments, when the size range of the rectangular data satisfies at least one of the first preset condition and the second preset condition, it may be determined that the size range of the rectangular data satisfies the size range of the standard frame.
[0106] In some embodiments, the first preset condition may include that the length of the size range of the rectangular data is greater than the minimum length of the size ranges of multiple standard frames. For example, the first preset condition may include that the length of the size range of the rectangular data is greater than the minimum length of the size ranges of 35 standard frames.
[0107] In some embodiments, the second preset condition may include that the width in the size range of the rectangular data is less than the maximum length in the size ranges of the plurality of standard frames, and is greater than the minimum length in the size ranges of the plurality of standard frames. For example, the second preset condition may include that the width in the size range of the rectangular data is less than the maximum length in the size ranges of 35 standard frames, and is greater than the minimum length in the size ranges of the 35 standard frames.
[0108] In some embodiments, the first preset condition and the second preset condition may also be any other feasible forms and may be set according to actual needs.
[0109] The second preset feature set is a feature set used to verify whether the rectangular data in the first sub-database constitutes a frame. The second preset feature set may include multiple second preset features.
[0110] The second preset feature is a feature condition for determining whether the rectangular data constitutes a frame. In some embodiments, the second preset feature set may include one or more second preset features, including the size of the primitive corresponding to the frame border being greater than a preset size threshold, the number of primitives in the frame being greater than a first number threshold, and the number of primitives in the intersecting frames being greater than a second number threshold. For example, the second preset feature may be that the size of the primitive corresponding to the frame border is greater than 1000 mm. For example, the second preset feature may be that the number of primitives in the frame is greater than 100. For another example, the second preset feature may be that the number of primitives in the intersecting frames is 3, etc.
[0111] In some embodiments, the second preset feature set may be determined by professionals based on historical experience.
[0112] The second sub-database refers to a database composed of rectangular data that meets the second preset feature set. In some embodiments, the processor can store the rectangular data that meets the second preset feature set in the first sub-database into the second sub-database.
[0113] The overlap degree refers to the overlap degree of two sets of rectangular data. In some embodiments, the overlap degree may include the overlap degree of lines of the two sets of rectangular data and / or the overlap degree of coverage of the two sets of rectangular data.
[0114] In some embodiments, the processor may randomly extract two sets of rectangular data from the second sub-database to determine the overlap of the two sets of rectangular data. For example, the processor may calculate the area of the overlapped portion of the coordinate regions of the two sets of rectangular data, and use the ratio between the area of the overlapped portion and the area of each of the two sets of rectangular data as the overlap of the two sets of rectangular data.
[0115] The coordinate area of the rectangular data refers to the pixel coordinate area contained in the drawing frame represented by the rectangular data.
[0116] In some embodiments, the processor may store the rectangular data in the second sub-database whose overlap degree is less than the overlap threshold into the frame database.
[0117] In some embodiments, the processor may traverse any two sets of rectangular data in the second sub-database; in response to the existence of overlapping areas in the coordinate areas of any two sets of rectangular data, the rectangular data with an area less than a preset area threshold is deleted to obtain a frame database. The overlapping area refers to the overlapping part of the coordinate areas of the two sets of rectangular data. The preset area threshold may be a system default value, an experience value, a manually preset value, or any combination thereof, and may be set according to actual needs.
[0118] In some embodiments, the processor can traverse any two sets of rectangular data in the second sub-database; in response to the existence of overlapping areas in the coordinate areas of any two sets of rectangular data, and the degree of overlap is not less than the overlap threshold, delete the rectangular data with an area less than the preset area threshold to obtain a frame database.
[0119] In some embodiments of the present specification, by traversing the second sub-database, the overlapping parts of the rectangular data can be effectively filtered, the duplication of the recognition system can be reduced, and the recognition efficiency can be improved.
[0120] In some embodiments of the present specification, by clearly defining the characteristics of the frame, the characteristics of the graphics elements within the frame, and the frame deduplication method, the amount of data for subsequent processing is greatly reduced, the efficiency and accuracy of frame database screening are effectively improved, and great convenience is provided for subsequent query, display and operation.
[0121] Figure 5 It is an exemplary schematic diagram of determining a first grouping database according to some embodiments of this specification.
[0122] like Figure 5 As shown, in some embodiments, the processor can locate the frame element 530 corresponding to the frame 520 based on the world coordinates 510, and establish a first association 540 between the frame element 530 and the world coordinates 510 of the frame 520; extract text information 550 from the frame element 530, and establish a second association 560 between the text information 550 and the frame 520; and generate a first grouping database 570 based on the first association 540 and the second association 560.
[0123] For more information about world coordinates, frames, and text information, see Figure 3 and its related contents.
[0124] A frame primitive refers to a primitive within the coordinate region of a frame. In some embodiments, a frame primitive includes a primitive corresponding to a frame border and an in-frame primitive contained within the frame. In some embodiments, a processor may determine the coordinate region of a frame based on the world coordinates of the frame; and determine the primitive within the coordinate region of the frame as a frame primitive.
[0125] The first association refers to the association between the world coordinates of the frame and the frame primitives. In some embodiments, the processor may establish a connection between the world coordinates of the frame and the frame primitives to determine the first association.
[0126] The second association refers to the association between the text information and the picture frame. In some embodiments, the processor can extract the text information in the picture element, correspond the text information of the picture frame picture element with the picture frame, and establish the second association.
[0127] In some embodiments, the processor may associate the world coordinates of the frame, all frame primitives, and text information of all frame primitives based on the first association and the second association to establish a first group. In some embodiments, the processor may generate a first grouping database based on at least one first grouping corresponding to at least one frame. In this embodiment, each first grouping in the first grouping database includes the world coordinates of a frame, all frame primitives, and text information of all frame primitives.
[0128] In some embodiments of the present specification, a first grouping database generated based on the first association and the second association can efficiently store and retrieve the association between the world coordinates of the frame and the frame elements and the text information of the frame elements, thereby facilitating subsequent analysis, query and display.
[0129] In other embodiments, the processor may determine the frame primitives corresponding to the frame based on the world coordinates, extract text information of the frame primitives, and establish a third association between the text information and the world coordinates of the frame; and generate a first grouping database based on the third association.
[0130] The third association refers to the association between the text information and the world coordinates of the frame.
[0131] In some embodiments, the processor may establish a first group after associating the world coordinates of the frame with the text information of all frame primitives corresponding to the frame based on the third association. In some embodiments, the processor may generate a first grouping database based on at least one first grouping corresponding to at least one frame. In this embodiment, each first grouping in the first grouping database includes the world coordinates of a frame and the text information of all frame primitives in the frame.
[0132] In some embodiments of the present specification, a first grouping database is generated based on the third association, which can ensure the accurate correspondence between text information and the world coordinates of the frame, improve the integrity of the data, and allow users to quickly query the graphics elements and their text information under a specific frame without having to sift through a large amount of data one by one.
[0133] Figure 6 It is an exemplary schematic diagram of determining target primitive information according to some embodiments of this specification.
[0134] like Figure 6 As shown, in some embodiments, in response to the first grouping database being generated based on the first association and the second association, the processor may match the drawing query information 610 with the text information 550 associated with each first group in the first grouping database to determine the target first group 620; and determine the graphic element information of the graphic element in the target first group 620 as the target graphic element information 630.
[0135] For more information about drawing query information, first group, first group database, text information, primitives, and primitive information, see Figure 3 and its related contents.
[0136] The target first group refers to the first group that matches the drawing query information. In some embodiments, the processor can match the text information associated with each first group in the first group database based on the drawing query information (for example, the name of the element to be queried), and determine the first group corresponding to the matched text information as the target first group.
[0137] In some embodiments, the processor may also match the world coordinates associated with each first group in the first group database based on the drawing query information (for example, the world coordinates of the drawing frame to be queried), and determine the first group where the matched world coordinates are located as the target first group.
[0138] In some embodiments, after determining the target first group, the processor can determine the graphic element information of all frame graphics elements in the target first group as the target graphic element information based on the association between the world coordinates of the frames included in the target first group, all frame graphics elements corresponding to the frames, and text information of all frame graphics elements corresponding to the frames.
[0139] In some embodiments of this specification, by matching the drawing query information with the text information associated with each first group in the first group database, the target first group containing the required information can be directly located without traversing the entire database or performing complex search operations. This greatly reduces the query time and improves the query efficiency.
[0140] In some embodiments, in response to the first grouping database being generated based on the third association, the processor may match the drawing query information with the text information associated with each first group in the first grouping database, determine the target first group, and determine the frame in the target first group as the target frame; based on the world coordinates of the target frame, determine the target graphic element information.
[0141] For more information about the image frame and world coordinates, see Figure 3 and its related description.
[0142] The target frame refers to the frame included in the target first group. In some embodiments, the processor can match the text information associated with each first group in the first group database based on the drawing query information (for example, the name of the graphic element to be queried), and determine the frame corresponding to the target first group corresponding to the matched text information as the target frame.
[0143] In some embodiments, the processor may match the drawing query information (eg, the world coordinates of the frame to be queried) with the world coordinates associated with each first group in the first group database, and determine the frame corresponding to the matched world coordinates as the target frame.
[0144] In some embodiments, after determining the target frame, the processor can determine the graphic element information of all frame graphic elements contained in the target frame based on the world coordinates of the target frame and the association between the world coordinates of the frames included in the target first group and the text information of all frame graphic elements in the frame, and determine it as the target graphic element information.
[0145] In some embodiments of the present specification, when the corresponding primitive cannot be found according to the frame, the target primitive information can be further searched according to the world coordinates of the frame to reduce the situation where the corresponding primitive cannot be identified.
[0146] The embodiments of the present specification also provide a computer-readable storage medium, which stores computer instructions. When the computer instructions are executed by a computer, the drawing information locating method described in any one of the embodiments of the present specification is implemented.
[0147] The basic concepts have been described above. Obviously, for those skilled in the art, the above detailed disclosure is only for example and does not constitute a limitation of this specification. Although not explicitly stated here, those skilled in the art may make various modifications, improvements and corrections to this specification. Such modifications, improvements and corrections are suggested in this specification, so such modifications, improvements and corrections still belong to the spirit and scope of the exemplary embodiments of this specification.
[0148] At the same time, this specification uses specific words to describe the embodiments of this specification. For example, "some embodiments" means a certain feature, structure or characteristic related to at least one embodiment of this specification. Therefore, it should be emphasized and noted that "some embodiments" mentioned twice or more in different places in this specification do not necessarily refer to the same embodiment. In addition, some features, structures or characteristics in one or more embodiments of this specification can be appropriately combined.
[0149] In addition, unless explicitly stated in the claims, the order of the processing elements and sequences described in this specification, the use of alphanumeric characters, or the use of other names are not intended to limit the order of the processes and methods of this specification. Although the above disclosure discusses some invention embodiments that are currently considered useful through various examples, it should be understood that such details are only for illustrative purposes, and the attached claims are not limited to the disclosed embodiments. On the contrary, the claims are intended to cover all modifications and equivalent combinations that are consistent with the essence and scope of the embodiments of this specification. For example, although the system components described above can be implemented by hardware devices, they can also be implemented only by software solutions, such as installing the described system on an existing server or mobile device.
[0150] Similarly, it should be noted that in order to simplify the description disclosed in this specification and thus help understand one or more embodiments of the invention, in the above description of the embodiments of this specification, multiple features are sometimes combined into one embodiment, figure or description thereof. However, this disclosure method does not mean that the features required by the subject matter of this specification are more than the features mentioned in the claims. In fact, the features of the embodiments are less than all the features of the single embodiment disclosed above.
[0151] Finally, it should be understood that the embodiments described in this specification are only used to illustrate the principles of the embodiments of this specification. Other variations may also fall within the scope of this specification. Therefore, as an example and not a limitation, alternative configurations of the embodiments of this specification may be considered consistent with the teachings of this specification. Accordingly, the embodiments of this specification are not limited to the embodiments explicitly introduced and described in this specification.
Claims
1. A frame recognition method, characterized in that: include: Extracting all graphic elements in the drawing and the graphic element information of the graphic elements, wherein the graphic element information at least includes the layer information to which the graphic element belongs; Based on the graphic element and the layer information, a rectangular database to be verified is determined, wherein each group of data to be verified in the rectangular database to be verified includes four graphic elements; Based on the first preset feature set, verify each group of the to-be-verified data in the to-be-verified rectangular database to determine a rectangular database; Each group of rectangle data in the rectangle database is checked to determine a frame database, wherein each group of rectangle data in the frame database corresponds to a frame.
2. The method according to claim 1, characterized in that: The primitive information also includes reference information of the primitive, and the layer information includes printing information of the layer; The step of determining a rectangle database to be checked based on the graphic element and the layer information includes: Determine a valid graphic element based on the reference information and / or the printing information, and establish a second grouping database based on the layer information of the valid graphic element; For any of the second grouping databases, any four incompletely repeated graphic elements are combined into a group of the to-be-checked data to determine the to-be-checked rectangular database.
3. The method according to claim 1 or 2, characterized in that: The checking each set of rectangle data in the rectangle database to determine the frame database includes: Acquire a size range of a standard frame, verify each set of rectangle data in the rectangle database based on the size range, and determine a first sub-database; Based on a second preset feature set, verify each group of rectangular data in the first sub-database to determine a second sub-database; The overlapping degree of each group of the rectangular data in the second sub-database is checked to determine the frame database.
4. The method according to claim 3, characterized in that The checking the overlap of each group of the rectangular data in the second sub-database to determine the frame database includes: Traversing any two groups of the rectangular data in the second sub-database; In response to the existence of overlapping areas in the coordinate areas of any two sets of the rectangular data, the rectangular data with an area smaller than a preset area threshold is deleted to obtain the frame database.
5. The method according to claim 1, characterized in that The method further comprises: The graphic elements are grouped based on the world coordinates of the picture frame, and a first grouping database is established, wherein the first grouping database is the graphic element grouping determined based on the picture frame.
6. The method according to claim 5, characterized in that The step of grouping the graphic elements based on the world coordinates of the graphic frame and establishing a first grouping database includes: Based on the world coordinates, determining a frame primitive corresponding to the frame, and establishing a first association between the frame primitive and the world coordinates of the frame; Extracting text information from the picture frame primitives, and establishing a second association between the text information and the picture frame; The first grouping database is generated based on the first association and the second association.
7. The method according to claim 5, characterized in that The step of grouping the graphic elements based on the world coordinates of the graphic frame and establishing a first grouping database includes: Based on the world coordinates, determining a frame primitive corresponding to the frame, extracting text information of the frame primitive, and establishing a third association between the text information and the world coordinates of the frame; Based on the third association, the first grouping database is generated.
8. A frame recognition system, characterized in that: The system comprises: Data preprocessing module, used to: Extracting all graphic elements in the drawing and the graphic element information of the graphic elements, wherein the graphic element information at least includes the layer information to which the graphic element belongs; Based on the graphic element and the layer information, a rectangular database to be verified is determined, wherein each group of data to be verified in the rectangular database to be verified includes four graphic elements; A rectangle recognition module, used to verify each group of the to-be-verified data in the to-be-verified rectangle database based on a first preset feature set, and determine the rectangle database; The frame recognition module is used to verify each group of rectangle data in the rectangle database to determine the frame database, wherein each group of rectangle data in the frame database corresponds to a frame.
9. A computer-readable storage medium, wherein the storage medium stores computer instructions. When a computer reads the computer instructions in the storage medium, the computer executes the frame recognition method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Drawing frame parameter identification and drawing output method based on autoCAD
CN103793145A
Picture frame identification method and system
CN110084179A
Engineering drawing recognition method, electronic equipment and related products
CN110765891A
Label determination method and device for electronic engineering drawing, storage medium and terminal
CN111460202A
Universal AutoCAD drawing frame identification method
CN111611945A
