[go: up one dir, main page]
More Web Proxy on the site http://driver.im/

CN110765893A - Drawing file identification method, electronic equipment and related product - Google Patents

Drawing file identification method, electronic equipment and related product Download PDF

Info

Publication number
CN110765893A
CN110765893A CN201910944738.6A CN201910944738A CN110765893A CN 110765893 A CN110765893 A CN 110765893A CN 201910944738 A CN201910944738 A CN 201910944738A CN 110765893 A CN110765893 A CN 110765893A
Authority
CN
China
Prior art keywords
primitives
target
primitive
preset
attribute information
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201910944738.6A
Other languages
Chinese (zh)
Other versions
CN110765893B (en
Inventor
张泽斌
夏晨曦
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Wanyi Digital Technology Co ltd
Original Assignee
Wanyi Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Wanyi Technology Co Ltd filed Critical Wanyi Technology Co Ltd
Priority to CN201910944738.6A priority Critical patent/CN110765893B/en
Publication of CN110765893A publication Critical patent/CN110765893A/en
Application granted granted Critical
Publication of CN110765893B publication Critical patent/CN110765893B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V30/00Character recognition; Recognising digital ink; Document-oriented image-based pattern recognition
    • G06V30/40Document-oriented image-based pattern recognition
    • G06V30/42Document-oriented image-based pattern recognition based on the type of document
    • G06V30/422Technical drawings; Geographical maps
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/22Matching criteria, e.g. proximity measures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • G06V10/22Image preprocessing by selection of a specific region containing or referencing a pattern; Locating or processing of specific regions to guide the detection or recognition

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • General Physics & Mathematics (AREA)
  • Artificial Intelligence (AREA)
  • Data Mining & Analysis (AREA)
  • Multimedia (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Evolutionary Biology (AREA)
  • Evolutionary Computation (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • General Engineering & Computer Science (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

The embodiment of the application discloses a drawing file identification method, electronic equipment and related products, which are applied to the electronic equipment, wherein the method comprises the following steps: extracting primitives in a model space to obtain P primitives, wherein P is an integer greater than or equal to 1; screening out the primitives with the size larger than a preset threshold value from the P primitives to obtain a first target primitive; and returning the position information of the first target primitive when the attribute information of the first target primitive is consistent with the preset attribute information. By adopting the method and the device, the coordinate position of the primitive can be accurately identified.

Description

Drawing file identification method, electronic equipment and related product
Technical Field
The application relates to the technical field of graphic processing, in particular to a drawing file identification method, electronic equipment and a related product.
Background
In life, in the engineering field, Computer Aided Design (CAD) is undoubtedly a Design software used by each Design unit at high frequency, and for various projects, CAD can be adopted for Design and finally saved in the form of electronic version.
In fact, when the engineering project design is completed, the design drawing is often intricate, and therefore, it is difficult to accurately identify the coordinate position corresponding to the primitive.
Disclosure of Invention
The embodiment of the application provides a drawing file identification method, electronic equipment and a related product, and the coordinate position of a primitive can be accurately identified.
In a first aspect, an embodiment of the present application provides a drawing file identification method, which is applied to an electronic device, and the method includes:
extracting primitives in a model space to obtain P primitives, wherein P is an integer greater than or equal to 1;
screening out the primitives with the size larger than a preset threshold value from the P primitives to obtain a first target primitive;
and returning the position information of the first target primitive when the attribute information of the first target primitive is consistent with the preset attribute information.
In a second aspect, an embodiment of the present application provides a drawing file identification apparatus, which is applied to an electronic device, and the apparatus includes:
the first extraction unit is used for extracting primitives in a model space to obtain P primitives, wherein P is an integer greater than or equal to 1;
the first screening unit is used for screening the primitives with the size larger than a preset threshold value from the P primitives to obtain a first target primitive;
and the first returning unit is used for returning the position information of the first target graphic primitive when the attribute information of the first target graphic primitive is consistent with the preset attribute information.
In a third aspect, an embodiment of the present application provides an electronic device, including a processor, a memory, a communication interface, and one or more programs, where the one or more programs are stored in the memory and configured to be executed by the processor, and the program includes instructions for executing the steps in the first aspect of the embodiment of the present application.
In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, where the computer-readable storage medium stores a computer program for electronic data exchange, where the computer program enables a computer to perform some or all of the steps described in the first aspect of the embodiment of the present application.
In a fifth aspect, embodiments of the present application provide a computer program product, where the computer program product includes a non-transitory computer-readable storage medium storing a computer program, where the computer program is operable to cause a computer to perform some or all of the steps as described in the first aspect of the embodiments of the present application. The computer program product may be a software installation package.
The embodiment of the application has the following beneficial effects:
it can be seen that the drawing file identification method, the electronic device and the related product described in the embodiments of the present application are applied to an electronic device, and extract primitives in a model space to obtain P primitives, where P is an integer greater than or equal to 1, screen out primitives with a size greater than a preset threshold from the P primitives to obtain a first target primitive, and when attribute information of the first target primitive is consistent with preset attribute information, return position information of the first target primitive, so that the position information of the primitive can be determined by screening the primitives and matching the attribute information of the screened primitives, which is helpful for accurately identifying coordinate positions of the primitives.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1A is a schematic flowchart of a drawing file identification method according to an embodiment of the present application;
fig. 1B is a schematic flowchart of another drawing file identification method provided in the embodiment of the present application;
FIG. 2 is a schematic flowchart of another drawing file identification method provided in the embodiments of the present application;
fig. 3 is a schematic structural diagram of another electronic device provided in an embodiment of the present application;
fig. 4A is a block diagram illustrating functional units of a drawing document identification apparatus according to an embodiment of the present disclosure;
fig. 4B is a modified structure of another drawing document identification device provided in the embodiment of the present application;
fig. 4C is a modified structure of still another drawing document identification device provided in the embodiment of the present application;
fig. 4D is a modified structure of still another drawing document identification device provided in the embodiment of the present application.
Detailed Description
The terms "first," "second," and the like in the description and claims of the present application and in the above-described drawings are used for distinguishing between different objects and not for describing a particular order. Furthermore, the terms "include" and "have," as well as any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not limited to only those steps or elements listed, but may alternatively include other steps or elements not listed, or inherent to such process, method, article, or apparatus.
Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the application. The appearances of the phrase in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. It is explicitly and implicitly understood by one skilled in the art that the embodiments described herein can be combined with other embodiments.
In order to make the technical solutions of the present application better understood, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The electronic device described in the embodiment of the present application may include a smart Phone (e.g., an Android Phone, an iOS Phone, a Windows Phone, etc.), a tablet computer, a palm computer, a notebook computer, a video matrix, a monitoring platform, a Mobile Internet device (MID, Mobile Internet Devices), or a wearable device, which are merely examples, but not exhaustive, and include but are not limited to the foregoing Devices, and of course, the electronic device may also be a server.
The following describes embodiments of the present application in detail.
Referring to fig. 1A, fig. 1A is a schematic flowchart of a drawing file identification method provided in an embodiment of the present application, and as shown in the drawing, the drawing file identification method is applied to an electronic device, and includes:
101. and extracting the primitives in the model space to obtain P primitives, wherein P is an integer greater than or equal to 1.
In the embodiment of the present application, a CAD construction drawing (for example, a DWG file) may be imported into Building Information Modeling (BIM) model software. The electronic equipment can extract the primitives from a preset area in the model space to obtain P primitives, wherein P is an integer greater than or equal to 1, and the preset area can be set by a user or defaulted by a system.
In a specific implementation, a user can click a position in an operation process, and the file is taken as a preset area.
In one possible example, the step 101 of extracting primitives in the model space to obtain P primitives includes:
11. acquiring a target position clicked by a user in the model space;
12. determining a preset area taking the target position as a center;
13. and extracting the primitives in the preset area to obtain the P primitives.
In specific implementation, a user can perform a click operation in a model space, and the electronic device can acquire a target position clicked by the user in the model space, and further determine a preset region centered on the target position, specifically determine a region within a preset radius range centered on the target position as the preset region, or extract primitives in the preset region to obtain P primitives using a rectangular region centered on the target position as the preset region.
102. And screening out the primitives with the size larger than a preset threshold value from the P primitives to obtain a first target primitive.
The preset threshold value can be set by the user or defaulted by the system. In this embodiment of the application, the size may include a length and a width, the preset threshold may include a preset length and a preset width, and the length corresponding to the dimension greater than the preset length and the width corresponding to the dimension greater than the preset width may be understood as the size greater than the preset threshold. In a specific implementation, the electronic device may screen, from the P primitives, primitives with a size greater than a preset threshold, where the first target primitive may include at least one primitive.
103. And returning the position information of the first target primitive when the attribute information of the first target primitive is consistent with the preset attribute information.
In this embodiment of the present application, the preset attribute information may be at least one of the following: the element type, the size information corresponding to the element type, the number of elements corresponding to the element type, the layer position corresponding to the primitive, and the like, which are not limited herein. The element type may be at least one of: straight lines, curves, arcs, rectangles, triangles, circles, ellipses, diamonds, etc., without limitation thereto. In a specific implementation, when the attribute information of the first target primitive is consistent with the preset attribute information, the electronic device may return the position information of the first target primitive, that is, the coordinate position corresponding to the preset attribute information may be used as the position information of the first target primitive.
For example, as shown in fig. 1B, the electronic device may extract primitives in the model space to obtain at least one primitive, may screen primitives with larger primitive sizes (for example, primitives larger than the largest drawing) from the primitives, detect whether the length and width of the primitive are the same as those of a normal frame, if the primitive can be found, return coordinates of the primitive, otherwise, extract the primitives in the layout space, and perform the following steps on the primitive: and detecting whether the primitive with the same length and width as the normal picture frame can be found, if so, returning the coordinates of the primitive, otherwise, extracting the primitive in the layout space.
In one possible example, the following steps may be included:
a1, when no primitive with the size larger than the preset threshold exists in the P primitives, extracting the primitives in a layout space to obtain Q primitives, wherein Q is an integer larger than or equal to 1;
a2, screening out primitives with the size larger than the preset threshold value from the Q primitives to obtain a second target primitive;
and A3, returning the position information of the second target graphic element when the attribute information of the second target graphic element is consistent with the preset attribute information.
In specific implementation, when no primitive with a size larger than a preset threshold exists in the P primitives, the electronic device may extract the primitives in the layout space to obtain Q primitives, where Q is an integer larger than or equal to 1, further, may further screen out the primitives with a size larger than the preset threshold from the Q primitives to obtain a second target primitive, and when attribute information of the second target primitive is consistent with the preset attribute information, may return position information of the second target primitive, that is, may use a coordinate position corresponding to the preset attribute information as a coordinate position of the second target primitive.
In one possible example, the following steps may be further included:
b1, when no primitive exists in the model space, extracting the primitives in the layout space to obtain K primitives, wherein K is an integer greater than or equal to 1;
b2, screening out the primitives with the size larger than the preset threshold value from the K primitives to obtain a third target primitive;
and B3, returning the position information of the third target primitive when the attribute information of the third target primitive is consistent with the preset attribute information.
In a specific implementation, when no primitive exists in the model space, the electronic device may extract primitives in the layout space to obtain K primitives, where K is an integer greater than or equal to 1, further, may screen out primitives with a size greater than a preset threshold from the K primitives to obtain a third target primitive, and when attribute information of the third target primitive is consistent with preset attribute information, may return position information of the third target primitive, that is, may use a coordinate position corresponding to the preset attribute information as position information of the third target primitive.
In one possible example, the preset attribute information is at least one preset element type of a preset primitive, an element number and an element size corresponding to each preset element type; between the above step 102 and step 103, the following steps may be further included:
31. acquiring at least one target element type of the first target primitive, and the element quantity and the element size corresponding to each target element type;
32. and when the at least one target element type is consistent with the at least one preset element type, and the element quantity and the element size corresponding to the at least one target element type are matched with the element quantity and the element size corresponding to the at least one preset element type, confirming that the attribute information of the first target primitive is consistent with the preset attribute information.
In this embodiment of the application, the preset attribute information is at least one preset element type of a preset primitive, an element number corresponding to each preset element type, and an element size. In a specific implementation, the electronic device may obtain at least one target element type and each target element type of the first target primitive, and an element type and an element size corresponding to each target element type, compare the at least one target element type and each target element type of the first target primitive, and the element type and the element size corresponding to each target element type with at least one preset element type, an element number and an element size corresponding to each preset element type of a preset primitive, and when the at least one target element type is consistent with the at least one preset element type, the element number and the element size corresponding to the at least one target element type are consistent with the element number and the element size corresponding to the at least one preset element type, confirm that the attribute information of the first target primitive is consistent with the preset attribute information, otherwise, the attribute information of the first target graphic element is determined to be not matched with the preset attribute information.
In one possible example, after the step 103, the following steps may be further included:
c1, acquiring a target image aiming at the first target primitive;
c2, acquiring a preset template primitive corresponding to the preset attribute information;
c3, performing feature extraction on the target image to obtain a target feature point set;
c4, determining a module value corresponding to each feature point in the target feature point set to obtain a plurality of module values;
c5, selecting a module value larger than a preset module value from the module values to obtain a plurality of target module values, and obtaining characteristic points corresponding to the target module values to obtain a plurality of target characteristic points;
c6, matching the target feature points with a preset feature point set of a preset template primitive to obtain a plurality of pairs of successfully matched feature points;
c7, selecting three pairs of characteristic point pairs with the maximum matching value from the plurality pairs of characteristic points which are successfully matched;
c8, constructing a first triangle and a second triangle according to the three pairs of feature point pairs, wherein the first triangle is a feature point in the target image, and the second triangle is a feature point in the preset feature point set;
and C9, when the first triangle is similar to the second triangle, confirming that the target image is successfully matched with the preset template primitive, and taking the primitive content corresponding to the preset template primitive as the primitive content of the first target primitive.
In specific implementation, the preset modulus value may be set by a user or default by a system, the preset template primitive may be stored in the electronic device in advance, the electronic device may perform screenshot operation on an area where the first target primitive is located to obtain a target image of the first target primitive, the electronic device may further store a mapping relationship between the preset attribute information and the preset template primitive in advance, and then, the preset template primitive corresponding to the preset attribute information may be obtained.
Further, the electronic device may perform feature extraction on the target image to obtain a target feature point set, and the feature point extraction algorithm may be at least one of the following: the method includes the steps of harris corner detection, Scale Invariant Feature Transform (SIFT), laplace transform, wavelet transform, contour wave transform, shear wave transform and the like, and is not limited herein.
Further, the electronic device may match the plurality of target feature points with a preset feature point set of a preset template primitive to obtain a plurality of pairs of successfully matched feature points, and a feature point extraction algorithm for the preset feature point set may be at least one of the following: the method includes the steps of harris corner detection, scale invariant feature transformation, laplace transformation, wavelet transformation, contourlet transformation, shear wave transformation and the like, and is not limited herein, further three pairs of feature point pairs with the largest matching value can be selected from the multiple pairs of successfully matched feature points, a first triangle and a second triangle can be constructed according to the three pairs of feature point pairs, wherein the first triangle is a feature point in a target image, the second triangle is a feature point in a preset feature point set, when the first triangle is similar to the second triangle, the target image and a preset template primitive are confirmed to be successfully matched, and primitive content of the preset template primitive can be used as primitive content of the first target primitive. On the contrary, when the first triangle and the second triangle are not similar, the target image is determined to fail to be matched with the primitive of the preset template, so that the primitive content identification of the primitive can be accurately realized.
The drawing file identification method described in the embodiment of the application can be seen, which is applied to electronic equipment, extracts primitives in a model space to obtain P primitives, where P is an integer greater than or equal to 1, screens out primitives with sizes greater than a preset threshold from the P primitives to obtain a first target primitive, and returns position information of the first target primitive when attribute information of the first target primitive is consistent with preset attribute information.
Referring to fig. 2, fig. 2 is a schematic flow chart of a drawing document identification method according to an embodiment of the present application, and as shown in the figure, the drawing document identification method is applied to an electronic device, and includes:
201. and extracting the primitives in the model space to obtain P primitives, wherein P is an integer greater than or equal to 1.
202. And screening out the primitives with the size larger than a preset threshold value from the P primitives to obtain a first target primitive.
203. And returning the position information of the first target primitive when the attribute information of the first target primitive is consistent with the preset attribute information.
204. And when no primitive with the size larger than the preset threshold value exists in the P primitives, extracting the primitives in the layout space to obtain Q primitives, wherein Q is an integer larger than or equal to 1.
205. And screening out the primitives with the size larger than the preset threshold value from the Q primitives to obtain a second target primitive.
206. And returning the position information of the second target primitive when the attribute information of the second target primitive is consistent with the preset attribute information.
The specific description of the steps 201 to 206 may refer to the corresponding steps of the drawing file identification method described in the above fig. 1A, and is not repeated herein.
It can be seen that the drawing file identification method described in the embodiment of the present application is applied to an electronic device, extracts primitives in a model space to obtain P primitives, where P is an integer greater than or equal to 1, screens out primitives with sizes greater than a preset threshold from the P primitives to obtain a first target primitive, returns position information of the first target primitive when attribute information of the first target primitive is consistent with the preset attribute information, extracts primitives in a layout space to obtain Q primitives when primitives with sizes greater than the preset threshold do not exist in the P primitives, where Q is an integer greater than or equal to 1, screens out primitives with sizes greater than the preset threshold from the Q primitives to obtain a second target primitive, returns position information of the second target primitive when attribute information of the second target primitive is consistent with the preset attribute information, and thus, by screening primitives, and the screened attribute information of the primitive is matched to determine the position information of the primitive, which is beneficial to accurately identifying the coordinate position of the primitive.
In accordance with the foregoing embodiments, please refer to fig. 3, fig. 3 is a schematic structural diagram of an electronic device according to an embodiment of the present application, and as shown in the drawing, the electronic device includes a processor, a memory, a communication interface, and one or more programs, where the one or more programs are stored in the memory and configured to be executed by the processor, and in an embodiment of the present application, the programs include instructions for performing the following steps:
extracting primitives in a model space to obtain P primitives, wherein P is an integer greater than or equal to 1;
screening out the primitives with the size larger than a preset threshold value from the P primitives to obtain a first target primitive;
and returning the position information of the first target primitive when the attribute information of the first target primitive is consistent with the preset attribute information.
It can be seen that, in the electronic device described in this embodiment of the present application, primitives in a model space are extracted to obtain P primitives, where P is an integer greater than or equal to 1, a primitive whose size is greater than a preset threshold is screened from the P primitives to obtain a first target primitive, and when attribute information of the first target primitive is consistent with preset attribute information, position information of the first target primitive is returned, so that the position information of the primitive can be determined by screening the primitives and matching the attribute information of the screened primitives, which is helpful for accurately identifying a coordinate position of the primitive.
In one possible example, the program further includes instructions for performing the steps of:
when no primitive with the size larger than the preset threshold value exists in the P primitives, extracting the primitives in a layout space to obtain Q primitives, wherein Q is an integer larger than or equal to 1;
screening out the primitives with the size larger than the preset threshold value from the Q primitives to obtain a second target primitive;
and returning the position information of the second target primitive when the attribute information of the second target primitive is consistent with the preset attribute information.
In one possible example, in extracting primitives from the model space to obtain P primitives, the program includes instructions for:
acquiring a target position clicked by a user in the model space;
determining a preset area taking the target position as a center;
and extracting the primitives in the preset area to obtain the P primitives.
In one possible example, the program further includes instructions for performing the steps of:
extracting the primitives in the layout space when no primitive exists in the model space to obtain K primitives, wherein K is an integer greater than or equal to 1;
screening out the primitives with the size larger than the preset threshold value from the K primitives to obtain a third target primitive;
and returning the position information of the third target primitive when the attribute information of the third target primitive is consistent with the preset attribute information.
In a possible example, when the preset attribute information is at least one preset element type of a preset primitive, a number of elements corresponding to each preset element type, and an element size, the program further includes instructions for performing the following steps:
acquiring at least one target element type of the first target primitive, and the element quantity and the element size corresponding to each target element type;
and when the at least one target element type is consistent with the at least one preset element type, and the element quantity and the element size corresponding to the at least one target element type are matched with the element quantity and the element size corresponding to the at least one preset element type, confirming that the attribute information of the first target primitive is consistent with the preset attribute information.
The above description has introduced the solution of the embodiment of the present application mainly from the perspective of the method-side implementation process. It is understood that the electronic device comprises corresponding hardware structures and/or software modules for performing the respective functions in order to realize the above-mentioned functions. Those of skill in the art will readily appreciate that the present application is capable of hardware or a combination of hardware and computer software implementing the various illustrative elements and algorithm steps described in connection with the embodiments provided herein. Whether a function is performed as hardware or computer software drives hardware depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
In the embodiment of the present application, the electronic device may be divided into the functional units according to the method example, for example, each functional unit may be divided corresponding to each function, or two or more functions may be integrated into one processing unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit. It should be noted that the division of the unit in the embodiment of the present application is schematic, and is only a logic function division, and there may be another division manner in actual implementation.
Fig. 4A is a block diagram of functional units of a drawing document identification apparatus 400 according to an embodiment of the present application. The drawing file identification device 400 is applied to electronic equipment, and the device 400 comprises: a first extraction unit 401, a first filtering unit 402, and a first returning unit 403, wherein,
a first extraction unit 401, configured to extract primitives in a model space to obtain P primitives, where P is an integer greater than or equal to 1;
a first screening unit 402, configured to screen, from the P primitives, a primitive whose size is greater than a preset threshold, so as to obtain a first target primitive;
a first returning unit 403, configured to return the position information of the first target primitive when the attribute information of the first target primitive is consistent with preset attribute information.
It can be seen that the drawing file identification device described in the embodiment of the present application is applied to an electronic device, extracts primitives in a model space to obtain P primitives, where P is an integer greater than or equal to 1, screens out primitives with a size greater than a preset threshold from the P primitives to obtain a first target primitive, and returns position information of the first target primitive when attribute information of the first target primitive is consistent with preset attribute information.
In one possible example, as shown in fig. 4B, fig. 4B is another modified structure of the drawing document identification apparatus shown in fig. 4A, which may further include, compared with fig. 4A: the second extracting unit 404, the second screening unit 405, and the second returning unit 406 are as follows:
a second extracting unit 404, configured to extract primitives in a layout space to obtain Q primitives when there is no primitive with a size greater than the preset threshold in the P primitives, where Q is an integer greater than or equal to 1;
a second screening unit 405, configured to screen, from the Q primitives, a primitive whose size is greater than the preset threshold, so as to obtain a second target primitive;
a second returning unit 406, configured to return the position information of the second target primitive when the attribute information of the second target primitive is consistent with the preset attribute information.
In one possible example, in extracting primitives in the model space to obtain P primitives, the first extraction unit is specifically configured to:
acquiring a target position clicked by a user in the model space;
determining a preset area taking the target position as a center;
and extracting the primitives in the preset area to obtain the P primitives.
In one possible example, as shown in fig. 4C, fig. 4C is a further modified structure of the drawing document identification apparatus shown in fig. 4A, which may further include, compared with fig. 4A: the third extracting unit 407, the third screening unit 408 and the third returning unit 409 are as follows:
a third extraction unit, configured to extract primitives in a layout space when no primitive exists in the model space, so as to obtain K primitives, where K is an integer greater than or equal to 1;
the third screening unit is used for screening the primitives with the size larger than the preset threshold value from the K primitives to obtain a third target primitive;
and the third returning unit is used for returning the position information of the third target primitive when the attribute information of the third target primitive is consistent with the preset attribute information.
In one possible example, the preset attribute information is at least one preset element type of a preset primitive, an element number and an element size corresponding to each preset element type; as shown in fig. 4D, fig. 4D is a further modified structure of the drawing document identification apparatus shown in fig. 4A, which, compared with fig. 4A, may further include: the obtaining unit 410 and the determining unit 411 are specifically as follows:
the acquisition unit is used for acquiring at least one target element type of the first target primitive, and the element quantity and the element size corresponding to each target element type;
a determining unit, configured to confirm that the attribute information of the first target primitive is consistent with the preset attribute information when the at least one target element type is consistent with the at least one preset element type, and the number of elements and the element size corresponding to the at least one target element type are matched with the number of elements and the element size corresponding to the at least one preset element type.
It can be understood that the functions of each program module of the drawing document identification apparatus in this embodiment may be specifically implemented according to the method in the foregoing method embodiment, and the specific implementation process may refer to the related description of the foregoing method embodiment, which is not described herein again.
Embodiments of the present application also provide a computer storage medium, where the computer storage medium stores a computer program for electronic data exchange, the computer program enabling a computer to execute part or all of the steps of any one of the methods described in the above method embodiments, and the computer includes an electronic device.
Embodiments of the present application also provide a computer program product comprising a non-transitory computer readable storage medium storing a computer program operable to cause a computer to perform some or all of the steps of any of the methods as described in the above method embodiments. The computer program product may be a software installation package, the computer comprising an electronic device.
It should be noted that, for simplicity of description, the above-mentioned method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the present application is not limited by the order of acts described, as some steps may occur in other orders or concurrently depending on the application. Further, those skilled in the art should also appreciate that the embodiments described in the specification are preferred embodiments and that the acts and modules referred to are not necessarily required in this application.
In the foregoing embodiments, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus may be implemented in other manners. For example, the above-described embodiments of the apparatus are merely illustrative, and for example, the above-described division of the units is only one type of division of logical functions, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection of some interfaces, devices or units, and may be an electric or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit may be stored in a computer readable memory if it is implemented in the form of a software functional unit and sold or used as a stand-alone product. Based on such understanding, the technical solution of the present application may be substantially implemented or a part of or all or part of the technical solution contributing to the prior art may be embodied in the form of a software product stored in a memory, and including several instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the above-mentioned method of the embodiments of the present application. And the aforementioned memory comprises: a U-disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic or optical disk, and other various media capable of storing program codes.
Those skilled in the art will appreciate that all or part of the steps in the methods of the above embodiments may be implemented by associated hardware instructed by a program, which may be stored in a computer-readable memory, which may include: flash Memory disks, Read-Only memories (ROMs), Random Access Memories (RAMs), magnetic or optical disks, and the like.
The foregoing detailed description of the embodiments of the present application has been presented to illustrate the principles and implementations of the present application, and the above description of the embodiments is only provided to help understand the method and the core concept of the present application; meanwhile, for a person skilled in the art, according to the idea of the present application, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present application.

Claims (10)

1. A drawing file identification method is applied to electronic equipment and comprises the following steps:
extracting primitives in a model space to obtain P primitives, wherein P is an integer greater than or equal to 1;
screening out the primitives with the size larger than a preset threshold value from the P primitives to obtain a first target primitive;
and returning the position information of the first target primitive when the attribute information of the first target primitive is consistent with the preset attribute information.
2. The method of claim 1, further comprising:
when no primitive with the size larger than the preset threshold value exists in the P primitives, extracting the primitives in a layout space to obtain Q primitives, wherein Q is an integer larger than or equal to 1;
screening out the primitives with the size larger than the preset threshold value from the Q primitives to obtain a second target primitive;
and returning the position information of the second target primitive when the attribute information of the second target primitive is consistent with the preset attribute information.
3. The method according to claim 1 or 2, wherein the extracting primitives from the model space to obtain P primitives comprises:
acquiring a target position clicked by a user in the model space;
determining a preset area taking the target position as a center;
and extracting the primitives in the preset area to obtain the P primitives.
4. The method according to claim 1 or 2, characterized in that the method further comprises:
extracting the primitives in the layout space when no primitive exists in the model space to obtain K primitives, wherein K is an integer greater than or equal to 1;
screening out the primitives with the size larger than the preset threshold value from the K primitives to obtain a third target primitive;
and returning the position information of the third target primitive when the attribute information of the third target primitive is consistent with the preset attribute information.
5. The method according to any one of claims 1 to 4, wherein the preset attribute information is at least one preset element type of a preset primitive, an element number and an element size corresponding to each preset element type;
the method further comprises the following steps:
acquiring at least one target element type of the first target primitive, and the element quantity and the element size corresponding to each target element type;
and when the at least one target element type is consistent with the at least one preset element type, and the element quantity and the element size corresponding to the at least one target element type are matched with the element quantity and the element size corresponding to the at least one preset element type, confirming that the attribute information of the first target primitive is consistent with the preset attribute information.
6. A drawing file recognition device is applied to electronic equipment, and the device comprises:
the first extraction unit is used for extracting primitives in a model space to obtain P primitives, wherein P is an integer greater than or equal to 1;
the first screening unit is used for screening the primitives with the size larger than a preset threshold value from the P primitives to obtain a first target primitive;
and the first returning unit is used for returning the position information of the first target graphic primitive when the attribute information of the first target graphic primitive is consistent with the preset attribute information.
7. The apparatus of claim 6, further comprising: a second extraction unit, a second screening unit and a second return unit, wherein,
the second extraction unit is configured to extract primitives in a layout space to obtain Q primitives when no primitive with a size larger than the preset threshold exists in the P primitives, where Q is an integer larger than or equal to 1;
the second screening unit is used for screening the primitives with the size larger than the preset threshold value from the Q primitives to obtain a second target primitive;
and the second returning unit is used for returning the position information of the second target primitive when the attribute information of the second target primitive is consistent with the preset attribute information.
8. The apparatus according to claim 6 or 7, wherein, in extracting primitives from the model space to obtain P primitives, the first extraction unit is specifically configured to:
acquiring a target position clicked by a user in the model space;
determining a preset area taking the target position as a center;
and extracting the primitives in the preset area to obtain the P primitives.
9. An electronic device comprising a processor, a memory for storing one or more programs and configured for execution by the processor, the programs comprising instructions for performing the steps in the method of any of claims 1-5.
10. A computer-readable storage medium, characterized in that a computer program for electronic data exchange is stored, wherein the computer program causes a computer to perform the method according to any one of claims 1-5.
CN201910944738.6A 2019-09-30 2019-09-30 Drawing file identification method, electronic equipment and related product Active CN110765893B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910944738.6A CN110765893B (en) 2019-09-30 2019-09-30 Drawing file identification method, electronic equipment and related product

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910944738.6A CN110765893B (en) 2019-09-30 2019-09-30 Drawing file identification method, electronic equipment and related product

Publications (2)

Publication Number Publication Date
CN110765893A true CN110765893A (en) 2020-02-07
CN110765893B CN110765893B (en) 2022-03-22

Family

ID=69330146

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910944738.6A Active CN110765893B (en) 2019-09-30 2019-09-30 Drawing file identification method, electronic equipment and related product

Country Status (1)

Country Link
CN (1) CN110765893B (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111611945A (en) * 2020-05-25 2020-09-01 江西金格科技股份有限公司 Universal AutoCAD picture frame identification method
CN111611936A (en) * 2020-05-22 2020-09-01 青矩技术股份有限公司 Automatic identification system for similar vector diagrams in CAD drawings
CN111832256A (en) * 2020-06-30 2020-10-27 万翼科技有限公司 Information marking method for examining picture and related device
CN111881947A (en) * 2020-07-09 2020-11-03 广联达科技股份有限公司 Feature point set pair screening method, target matching method and device and electronic equipment

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020009223A1 (en) * 2000-07-13 2002-01-24 Wong Tin Cheung Computer automated process for analysing and interpreting engineering drawings
CN102693334A (en) * 2012-03-01 2012-09-26 成都鹏业软件股份有限公司 Dynamic construction member identifying method based on CAD (computer-aided design) electronic drawing
CN103605970A (en) * 2013-12-02 2014-02-26 华中师范大学 Drawing architectural element identification method and system based on machine learning
CN107315817A (en) * 2017-06-30 2017-11-03 华自科技股份有限公司 Electronic drawing text matching technique, device, storage medium and computer equipment

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020009223A1 (en) * 2000-07-13 2002-01-24 Wong Tin Cheung Computer automated process for analysing and interpreting engineering drawings
CN102693334A (en) * 2012-03-01 2012-09-26 成都鹏业软件股份有限公司 Dynamic construction member identifying method based on CAD (computer-aided design) electronic drawing
CN103605970A (en) * 2013-12-02 2014-02-26 华中师范大学 Drawing architectural element identification method and system based on machine learning
CN107315817A (en) * 2017-06-30 2017-11-03 华自科技股份有限公司 Electronic drawing text matching technique, device, storage medium and computer equipment

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111611936A (en) * 2020-05-22 2020-09-01 青矩技术股份有限公司 Automatic identification system for similar vector diagrams in CAD drawings
CN111611945A (en) * 2020-05-25 2020-09-01 江西金格科技股份有限公司 Universal AutoCAD picture frame identification method
CN111832256A (en) * 2020-06-30 2020-10-27 万翼科技有限公司 Information marking method for examining picture and related device
CN111881947A (en) * 2020-07-09 2020-11-03 广联达科技股份有限公司 Feature point set pair screening method, target matching method and device and electronic equipment
CN111881947B (en) * 2020-07-09 2024-05-14 广联达科技股份有限公司 Feature point set pair screening method, target matching method, device and electronic equipment

Also Published As

Publication number Publication date
CN110765893B (en) 2022-03-22

Similar Documents

Publication Publication Date Title
CN110765893B (en) Drawing file identification method, electronic equipment and related product
CN110765891B (en) Engineering drawing identification method, electronic equipment and related product
CN110796016A (en) Engineering drawing identification method, electronic equipment and related product
CN110781859B (en) Image annotation method and device, computer equipment and storage medium
CN111640130A (en) Table reduction method and device
CN112818456B (en) Layer configuration method, electronic equipment and related products
CN107545223B (en) Image recognition method and electronic equipment
CN112241565A (en) Modeling method and related device
CN112988557B (en) Search box positioning method, data acquisition method, device and medium
CN112668566A (en) Form processing method and device, electronic equipment and storage medium
CN113010944A (en) Model checking method, electronic equipment and related product
CN115392937A (en) User fraud risk identification method and device, electronic equipment and storage medium
CN111492407B (en) System and method for map beautification
CN111783561A (en) Picture examination result correction method, electronic equipment and related products
CN111260564A (en) Image processing method and device and computer storage medium
CN109711287B (en) Face acquisition method and related product
CN114048539A (en) CAD file analysis and rule judgment method and related device
CN113052181A (en) Table reconstruction method, device and equipment based on semantic segmentation and storage medium
CN117593420A (en) Plane drawing labeling method, device, medium and equipment based on image processing
CN111649749A (en) Navigation method based on BIM (building information modeling), electronic equipment and related product
CN108804652B (en) Method and device for generating cover picture, storage medium and electronic device
JP2009032109A (en) Document image search method, document image registration method, and program and apparatus for the same
CN111563898B (en) Image segmentation method, electronic equipment and related products
CN111639636A (en) Character recognition method and device
CN112446850A (en) Adaptation test method and device and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20230626

Address after: A601, Zhongke Naneng Building, No. 06 Yuexing 6th Road, Gaoxin District Community, Yuehai Street, Nanshan District, Shenzhen City, Guangdong Province, 518063

Patentee after: Shenzhen Wanyi Digital Technology Co.,Ltd.

Address before: 519000 room 105-24914, No.6 Baohua Road, Hengqin New District, Zhuhai City, Guangdong Province (centralized office area)

Patentee before: WANYI TECHNOLOGY Co.,Ltd.