Engineering drawing automatic recognition device, method and computer storage medium

By obtaining file attributes and content, using creator information, coded information, frame bodies and devil numbers to determine whether the PDF file is an engineering drawing, solving the problem of insufficient recognition accuracy in the existing technology, and achieving efficient and accurate recognition effect.

CN116386073BActive Publication Date: 2025-09-02INNER MONGOLIA ELECTRIC POWER GROUP MENGDIAN ECONOMIC & TECHNOLOGICAL RESEARCH INSTITUTE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310147624.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-02-21
Publication Date
2025-09-02
Estimated Expiration
2043-02-21

AI Technical Summary

Technical Problem

In the prior art, the automatic identification method of identifying whether a PDF file is an engineering drawing file is insufficient.

Method used

By obtaining the file attributes and contents of the file to be identified, including creator information, coded information, frame body, frame area and position, and devil numbers in the drawing frame, we can determine whether the file is an engineering drawing.

Benefits of technology

It improves the accuracy and efficiency of identifying whether PDF files are engineering drawings, ensures that the selected files are engineering drawings, avoids missing screens, and achieves efficient and accurate identification results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116386073B_ABST
    Figure CN116386073B_ABST
Patent Text Reader

Abstract

The present invention discloses an automatic identification device and method for engineering drawings, and a computer storage medium. The method includes: S100, obtaining file attributes of a file to be identified, and judging whether the file to be identified is an engineering drawing according to the file attributes, if so, judging that the file to be identified is an engineering drawing, and if not, executing S200; S200, judging whether the file to be identified contains a frame, and if not, judging that the file to be identified is not an engineering drawing, and if so, executing S300; S300, judging whether the frame is a drawing frame, and if not, judging that the file to be identified is not an engineering drawing, and if so, executing S400; S400, judging whether a first devil number can be obtained from the drawing frame, and if so, judging that the file to be identified is an engineering drawing, and if not, judging that the file to be identified is not an engineering drawing. The present invention sequentially judges whether the file to be identified is a drawing file by using file attributes and file content, thereby ensuring recognition efficiency and recognition accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of file type recognition, and in particular to an automatic recognition device and method for engineering drawings and a computer storage medium. Background Art

[0002] Engineering projects typically require numerous engineering drawing files. These files typically have a specific file extension, also known as a file extension. This extension is a mechanism used by operating systems to identify file types. For example, architectural drawings, which depict a building's interior layout, exterior shape, finishes, construction, and other details, are typically CAD files in the DWG format and typically have a file extension of "dwg."

[0003] Computers can determine whether a file is an engineering drawing by the suffix name, but engineering drawing files will be converted into PDF (or pdf) format when needed. Once the engineering drawing is converted into PDF format, the computer will no longer be able to determine whether the file is an engineering drawing based on the suffix name.

[0004] In the related art, whether it is an engineering drawing is determined by reading the file header of the file to be identified. The file header is a piece of data located at the beginning of the file that performs a certain task. This method can solve the problem of inaccurate file type identification due to modification of the suffix name, etc. However, for drawing files that have been converted into PDF, it is still impossible to accurately determine whether the PDF file is an engineering drawing.

[0005] Therefore, the above-mentioned prior art has at least the following technical problems: the automatic identification method for identifying whether a PDF file is an engineering drawing file in the prior art is not accurate enough. Summary of the Invention

[0006] The embodiments of the present application solve the technical problem in the prior art of insufficient accuracy of the automatic identification method for identifying whether a PDF file is an engineering drawing file by providing an automatic identification device, method and computer storage medium for engineering drawings.

[0007] To solve the above technical problems, in a first aspect, an embodiment of the present application provides a method for automatically identifying engineering drawings, the method comprising:

[0008] S100, obtaining file attributes of a file to be identified, and determining whether the file to be identified is an engineering drawing based on the file attributes. If so, determining that the file to be identified is an engineering drawing; if not, executing S200;

[0009] S200, determining whether the file to be identified contains a frame; if not, determining that the file to be identified is not an engineering drawing; if so, executing S300;

[0010] S300, determining whether the frame is a drawing frame, if not, determining whether the file to be identified is not an engineering drawing, if so, executing S400;

[0011] S400, determining whether a first magic number can be obtained from the drawing frame, where the first magic number is information that can identify an engineering drawing; if so, determining that the file to be identified is an engineering drawing; if not, determining that the file to be identified is not an engineering drawing.

[0012] Furthermore, the S100 specifically includes:

[0013] S110, obtaining creator information of the file to be identified, and determining whether a second magic number can be obtained from the creator information, where the second magic number is information that can identify an engineering drawing. If so, determining that the file to be identified is an engineering drawing; if not, executing S120;

[0014] S120, obtaining coding information of the file to be identified, and determining whether a second magic number can be obtained from the coding information. If so, determining that the file to be identified is an engineering drawing; if not, executing S200.

[0015] Furthermore, the S200 specifically includes:

[0016] S210, obtaining the file to be identified in image format, and selecting a first target image, wherein when the number of pages N of the file to be identified is ≥ 2, the first target image is any page from the second to the Nth page of the file to be identified; and when the number of pages N of the file to be identified is 1, the first target image is the first page of the file to be identified;

[0017] S220, obtaining a grayscale image of the target image;

[0018] S230, performing blur processing on the text portion in the grayscale image to obtain a second target image;

[0019] S240, performing binarization processing on the second target image to obtain a third target image including only black and white pixels;

[0020] S250 , acquiring all frames on the third target image. If at least one frame cannot be acquired, determining that the file to be identified is not an engineering drawing. If at least one frame can be acquired, executing S300 .

[0021] Furthermore, the S300 specifically includes:

[0022] S310, obtaining the area of ​​each frame;

[0023] S320, determining a degree of matching between the area of ​​each frame and each standard area value in a pre-stored frame library, wherein the frame library pre-stores a correspondence between frame type, frame area standard value, relative position standard value of the frame in the image, and frame type, frame area standard value, and relative position standard value; if the maximum value of the degree of matching between the area of ​​any frame and each standard area value is not less than a preset value, determining that the frame is a target frame; if the maximum value of the degree of matching between the area of ​​any frame and each standard area value is less than a preset value, determining that the frame is not a target frame;

[0024] S330, obtaining the number of the target frames. If the number of the target frames is zero, determining that the document to be identified is not an engineering drawing; if the number of the target frames is not zero, executing S340;

[0025] At step S340 , the relative position of the target frame in the third target image is obtained, and based on whether the correspondence between the relative position and the area conforms to the correspondence between the standard area value and the standard relative position value in the frame library, it is determined whether the target frame belongs to a frame type in the frame library. If not, it is determined that the file to be identified is not an engineering drawing. If so, it is determined that the target frame is a drawing frame, and step S400 is executed.

[0026] Furthermore, the S400 specifically includes:

[0027] S410 , obtaining coordinates of the drawing frame in the third target image, and based on the coordinates, obtaining text in the drawing frame from the first target image;

[0028] S420, determining whether the first magic number can be obtained in the text, if so, determining that the file to be identified is an engineering drawing, if not, determining that the file to be identified is not an engineering drawing.

[0029] In a second aspect, an embodiment of the present application provides an automatic identification device for engineering drawings, the device comprising:

[0030] a first judgment unit, configured to obtain a file attribute of a file to be identified, and determine whether the file to be identified is an engineering drawing according to the file attribute; if so, determining that the file to be identified is an engineering drawing; if not, executing a second judgment unit;

[0031] a second judging unit, configured to judge whether the file to be identified contains a frame, and if not, to judge that the file to be identified is not an engineering drawing, and if so, to execute a third judging unit;

[0032] a third judging unit, configured to judge whether the frame is a drawing frame, and if not, to judge whether the file to be identified is not an engineering drawing, and if so, to execute the fourth judging unit;

[0033] A fourth judgment unit is used to judge whether a first devil number can be obtained from the drawing frame, where the first devil number is information that can identify an engineering drawing. If so, it is judged that the file to be identified is an engineering drawing; if not, it is judged that the file to be identified is not an engineering drawing.

[0034] Furthermore, the first judgment unit includes:

[0035] a first judgment module, configured to obtain creator information of the file to be identified, and determine whether a second magic number can be obtained from the creator information, where the second magic number is information that can identify an engineering drawing; if so, determining that the file to be identified is an engineering drawing; if not, executing the first judgment module, wherein the first judgment module is configured to:

[0036] The second judgment module is used to obtain the coding information of the file to be identified, and judge whether the second magic number can be obtained from the coding information. If so, it is judged that the file to be identified is an engineering drawing; if not, the second judgment unit is executed.

[0037] Furthermore, the third judgment unit includes:

[0038] a first acquisition module, configured to acquire the area of ​​each frame;

[0039] a third judgment module, configured to judge a degree of match between the area of ​​each frame and each standard area value in a pre-stored frame library, wherein the frame library pre-stores a correspondence between frame type, frame area standard value, relative position standard value of the frame in the image, and frame type, frame area standard value, and relative position standard value; if the maximum value of the degree of match between the area of ​​any frame and each standard area value is not less than a preset value, the frame is judged to be a target frame; if the maximum value of the degree of match between the area of ​​any frame and each standard area value is less than a preset value, the frame is judged not to be a target frame;

[0040] a fourth judgment module, configured to obtain the number of the target frames, and if the number of the target frames is zero, determine that the document to be identified is not an engineering drawing; and if the number of the target frames is not zero, execute the fifth judgment module;

[0041] A fifth judgment module is configured to obtain a relative position of the target frame in the first target image, and determine whether the target frame belongs to a frame type in the frame library based on whether the correspondence between the relative position and the area conforms to the correspondence between the standard area value and the standard relative position value in the frame library; if not, determine that the file to be identified is not an engineering drawing; if so, determine that the target frame is a drawing frame, and execute the fourth judgment unit.

[0042] In a third aspect, an embodiment of the present application provides an automatic identification device for engineering drawings, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the following steps are implemented:

[0043] S100, obtaining file attributes of a file to be identified, and determining whether the file to be identified is an engineering drawing based on the file attributes. If so, determining that the file to be identified is an engineering drawing; if not, executing S200;

[0044] S200, determining whether the file to be identified contains a frame; if not, determining that the file to be identified is not an engineering drawing; if so, executing S300;

[0045] S300, determining whether the frame is a drawing frame, if not, determining whether the file to be identified is not an engineering drawing, if so, executing S400;

[0046] S400, determining whether a first magic number can be obtained from the drawing frame, where the first magic number is information that can identify an engineering drawing; if so, determining that the file to be identified is an engineering drawing; if not, determining that the file to be identified is not an engineering drawing.

[0047] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon, wherein when the program is executed by a processor, the following steps are implemented:

[0048] S100, obtaining file attributes of a file to be identified, and determining whether the file to be identified is an engineering drawing based on the file attributes. If so, determining that the file to be identified is an engineering drawing; if not, executing S200;

[0049] S200, determining whether the file to be identified contains a frame; if not, determining that the file to be identified is not an engineering drawing; if so, executing S300;

[0050] S300, determining whether the frame is a drawing frame, if not, determining whether the file to be identified is not an engineering drawing, if so, executing S400;

[0051] S400, determining whether a first magic number can be obtained from the drawing frame, where the first magic number is information that can identify an engineering drawing; if so, determining that the file to be identified is an engineering drawing; if not, determining that the file to be identified is not an engineering drawing.

[0052] One or more technical solutions provided in the embodiments of this application have at least the following technical effects or advantages:

[0053] The embodiment of the present application obtains the file attributes of the file to be identified to preliminarily determine whether it is an engineering drawing. This can preliminarily screen out the vast majority of engineering drawing files with high accuracy. Since identification is performed only by extracting the file attributes of the file to be identified, data processing is simple and identification efficiency is high. Then, by obtaining the file content to determine whether the file to be identified is an engineering drawing, omissions can be avoided and the screening accuracy can be further improved, ensuring that only drawing files are screened out. File content identification includes identifying whether there is a frame in the file to be identified, whether the frame is a drawing frame, and whether the frame contains a first magic number that can identify an engineering drawing. Therefore, by sequentially identifying whether the file to be identified is a drawing file through file attributes and file content, identification efficiency and accuracy are guaranteed, effectively resolving the technical problem of insufficient accuracy in the prior art automatic identification methods for identifying whether a PDF file is an engineering drawing, and achieving the beneficial effects of high efficiency and high accuracy. BRIEF DESCRIPTION OF THE DRAWINGS

[0054] Figure 1 A schematic diagram of a method for automatically identifying engineering drawings in an embodiment of the present invention Figure 1 ;

[0055] Figure 2 A schematic diagram of a method for automatically identifying engineering drawings in an embodiment of the present invention Figure 2 (YES means yes, NO means no);

[0056] Figure 3 A schematic diagram of the file properties of an engineering drawing in PDF format in the prior art;

[0057] Figure 4 It is a structural diagram of a label frame of an engineering drawing in the prior art;

[0058] Figure 5 Schematic diagram of the structure of an automatic identification device for engineering drawings according to an embodiment of the present invention;

[0059] Figure 6 Schematic diagram of the structure of another automatic identification device for engineering drawings in an embodiment of the present invention.

[0060] Explanation of the reference numerals: first judgment unit 11 , second judgment unit 12 , third judgment unit 13 , fourth judgment unit 14 , bus 300 , receiver 301 , processor 302 , transmitter 303 , memory 304 , bus interface 306 . DETAILED DESCRIPTION

[0061] The embodiments of the present application solve the technical problem in the prior art of insufficient accuracy of the automatic identification method for identifying whether a PDF file is an engineering drawing file by providing an automatic identification device, method and computer storage medium for engineering drawings.

[0062] To address the aforementioned technical issues, the technical solution provided in this application is as follows: By obtaining the file attributes of the file to be identified, a preliminary determination is made as to whether the file to be identified is an engineering drawing. This allows for the initial screening of the vast majority of engineering drawing files with high accuracy. Furthermore, since identification is performed solely by extracting the file attributes of the file to be identified, data processing is simplified and identification efficiency is high. Furthermore, by obtaining the file content to determine whether the file to be identified is an engineering drawing, missed selections are avoided, and screening accuracy is further improved, ensuring that only engineering drawings are screened out. File content identification includes identifying whether the file to be identified contains a frame, whether the frame is a drawing frame, and whether the frame contains a first magic number that can identify an engineering drawing. Therefore, by sequentially identifying whether the file to be identified is an engineering drawing file based on both file attributes and file content, identification efficiency and accuracy are ensured, effectively resolving the technical issue of insufficient accuracy in conventional automatic identification methods for identifying whether a PDF file is an engineering drawing, and achieving the beneficial effects of high efficiency and accuracy.

[0063] In order to enable those skilled in the art to better understand the present invention, the following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0064] The terms "first," "second," and the like in the specification and claims of this application and the accompanying drawings are used to distinguish between different objects, not to describe a particular order. Furthermore, the terms "including," "having," and any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, product, or apparatus comprising a series of steps or elements is not limited to the listed steps or elements but may optionally include steps or elements not listed, or may optionally include other steps or elements inherent to the process, method, product, or apparatus.

[0065] References to "embodiments" herein mean that a particular feature, structure, or characteristic described in connection with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various places in the specification does not necessarily refer to the same embodiment, nor does it constitute an independent or alternative embodiment that is mutually exclusive of other embodiments. It is understood, both explicitly and implicitly, by those skilled in the art that the embodiments described herein may be combined with other embodiments.

[0066] The hardware architecture used to implement the technical solutions provided in the embodiments of this application can be any of the following:

[0067] (1) Client-server architecture, also known as the CS architecture model, such as an engineering drawing automatic recognition app installed on a mobile phone or computer;

[0068] (2) Browser and server architecture mode, namely BS architecture mode, for example, engineering drawings accessed through a browser on a mobile phone or computer automatically recognize the web version;

[0069] (3) The combination of CS and BS architectures, such as automatic recognition of engineering drawing files loaded in WeChat mini-programs, automatic recognition of engineering drawings in the quick application center, etc.

[0070] (4) Local device architecture mode, such as an engineering drawing automatic recognition APP installed on a mobile phone or laptop that does not rely on the network. The local device can run a lightweight graphics engine, which is specifically implemented through a processing chip architecture. The processing chip architecture may include a CPU and at least one neural network processor NPU. The CPU is connected to at least one NPU, and the at least one NPU can process part or all of the data processing logic in the automatic recognition of engineering drawing files.

[0071] Example 1

[0072] Figure 1 、 2 They are respectively a schematic diagram of the process of an automatic identification method for engineering drawings in an embodiment of the present invention Figure 1 、 two ,like Figure 1 、 2 As shown, the method includes:

[0073] Step 100, obtaining the file attributes of the file to be identified, and determining whether the file to be identified is an engineering drawing based on the file attributes. If so, determining that the file to be identified is an engineering drawing; if not, executing step 200;

[0074] Specifically, the file to be identified is a PDF (or pdf) file. The applicant has discovered that the file attributes of a PDF file may contain creator information or encoding information. After using CAD software or a specific drawing converter to convert the PDF file, relevant information may be recorded in the creator information (Content Creator) or encoding information (Encoding Software), such as keywords such as "AUTOCAD", "CAD", "DWG", "ZWCAD", "autocad", "cad", "dwg", and / or "zwcad", etc. Figure 3 As shown in Figure 1, these keywords are related to CAD software, the drawing software for engineering drawings. Therefore, by identifying whether the file attributes contain these common keywords, it is possible to determine whether the file to be identified is an engineering drawing. This preliminary screening of the vast majority of engineering drawing files based on file attributes is highly accurate. Furthermore, since step 100 only extracts file attributes for identification, data processing is simple and identification efficiency is high.

[0075] It's important to note that file attributes classify files into different types for storage and transmission. They define a file's unique properties. Common file attributes include system, hidden, read-only, and archive. File attributes include creator information and encoding information. Creator information refers to information about the file's creator. Encoding information is the process of assigning codes to information elements during information processing to facilitate storage, retrieval, and use. This establishes a one-to-one correspondence between different codes and basic units of information.

[0076] Furthermore, the step 100 specifically includes:

[0077] Step 110: Obtain creator information of the file to be identified, and determine whether a second magic number can be obtained from the creator information, where the second magic number is information that can identify an engineering drawing. If so, determine that the file to be identified is an engineering drawing; if not, proceed to step 120.

[0078] Step 120 , obtaining the coding information of the file to be identified, and determining whether the second magic number can be obtained from the coding information. If so, determining that the file to be identified is an engineering drawing; if not, executing step 210 .

[0079] Specifically, the "devil number" refers to the field content that can reflect the characteristics of different file types. The principle is to identify the creator information or coding information of the file to be identified. If the creator information or coding information contains the devil number corresponding to the pre-stored engineering drawing file, the type of the file to be identified is determined to be an engineering drawing file.

[0080] In this embodiment, the second magic number can be a field related to the drawing software or processing software used for the engineering drawing, such as keywords such as "AUTOCAD," "CAD," "DWG," "ZWCAD," "autocad," "cad," "dwg," and "zwcad." Furthermore, the second magic number can be accumulated and enriched over time to improve the accuracy of engineering drawing recognition.

[0081] Step 110 and step 120 can read the creator information and encoding information through the PyMuPDF open source tool, wherein PyMuPDF is a Python package for operating PDF documents. It has powerful functions and does not rely on other Python packages. In addition to providing convenient and easy-to-use functions, it also provides some underlying operation methods. These underlying operation functions can be used to implement almost all operations on PDF documents, including reading the creator information and encoding information of the file to be identified in PDF format and converting the PDF format into an image format.

[0082] It should be noted that the specific working principle and steps of PyMuPDF reading the creator information and encoding information of a PDF file are well known in the art and are not within the scope of protection of this embodiment, so they will not be described in detail here. Of course, other tools with the same function can also be used to read the creator information and encoding information of the file to be identified, and this is not limited here.

[0083] Furthermore, before step 100, the method further includes: traversing the files to be identified in PDF format in the file package according to their suffix names.

[0084] Specifically, a file package refers to a folder containing files to be identified, which is generally provided by a user.

[0085] Step 200, determining whether the file to be identified contains a frame, if not, determining that the file to be identified is not an engineering drawing, if so, executing step 300;

[0086] Specifically, engineering drawings generally contain label frames and / or drawing frames. Identifying whether the file to be identified contains a frame can also be used as a factor in determining whether the file to be identified is an engineering drawing.

[0087] Furthermore, the step 200 specifically includes:

[0088] Step 210: Obtain the file to be identified in image format and select a first target image. When the number of pages N of the file to be identified is ≥ 2, the first target image is any page from the 2nd to the Nth page of the file to be identified. When the number of pages N of the file to be identified is 1, the first target image is the first page of the file to be identified, where N is a positive integer.

[0089] Specifically, since the first page of an engineering drawing may be a catalog page, skipping the first page when selecting the first target image will improve the recognition accuracy. However, if the file to be recognized has only one page, only this page (i.e., the first page) can be selected as the first target image.

[0090] Step 210 converts the file to be identified in PDF format into an image format through PyMuPDF. The image format can be any one of common image formats such as bmp, jpg, png, tif, gif, pcx, tga, exif, fpx, svg, psd, cdr, pcd, dxf, ufo, eps, ai, raw, WMF, webp, avif, apng, etc.

[0091] It should be noted that the specific working principle and steps of PyMuPDF for converting PDF format to image format are well-known existing technologies in the field and do not fall within the scope of protection of this embodiment, so they will not be described in detail here. Of course, other tools with the same function can also be used to convert PDF format to image format, which is not limited here.

[0092] Step 220: Obtain a grayscale image of the first target image;

[0093] Specifically, step 230 can convert the first target image into a grayscale image using the cvtColor function, converting the image's pixels from three channels to a single channel. The cvtcolor function is a color space conversion function that can convert RGB colors to color spaces such as HSV and HSI, or to grayscale images. Of course, other tools with similar functionality can also be used to convert the first target image into a grayscale image, and this is not a limitation.

[0094] It should be noted that the cvtColor function is an existing image processing function in OpenCV. The specific working principle and steps of the cvtcolor function to implement grayscale image conversion are well known in the art and do not fall within the scope of protection of this embodiment. We will not elaborate on them here. Among them, OpenCV is a cross-platform computer vision and machine learning software library released under the Apache 2.0 license (open source) and can run on Linux, Windows, Android and Mac OS operating systems.

[0095] Step 230: performing blurring processing on the text portion in the grayscale image to obtain a second target image;

[0096] Specifically, step 230 can perform median filtering on the text portion in the grayscale image through the medianBlur function, thereby blurring the text portion so that when there is a frame in the second target image, the frame is relatively prominent, making it easier to capture the frame; of course, the text portion can also be blurred by other tools with the same function, which is not limited here.

[0097] It should be noted that the medianBlur function is an existing image processing function of Opencv. The medianBlur function uses a median filter to smooth (blur) an image. As for the specific working principles and steps of the medianBlur function to implement median filtering to blur text, they are well-known existing technologies in the field and do not fall within the scope of protection of this embodiment, so they will not be described here.

[0098] Step 240: binarize the second target image to obtain a third target image consisting of only black and white pixels.

[0099] Specifically, step 240 binarizes the second target image using a threshold function, and the processed third target image has only two color values, black and white. Of course, the second target image can also be binarized using other tools with the same function, which is not limited here.

[0100] It should be noted that the threshold function is an existing image processing function of OpenCV. The threshold function binarizes the image information by traversing the points in the grayscale image. As for the specific working principle and steps of the threshold function binarizing the second target image to obtain a third target image consisting of only black and white pixels, it is a well-known existing technology in the art and does not fall within the scope of protection of this embodiment, so it will not be repeated here.

[0101] Step 250 , obtaining all frames on the third target image. If at least one frame cannot be obtained, it is determined that the file to be identified is not an engineering drawing. If at least one frame can be obtained, step 310 is executed.

[0102] Specifically, if the third target image does not contain any frames, it indicates that the file to be identified is not an engineering drawing, because engineering drawings generally have label frames and / or drawing frames. Step 250 uses the findContours function to obtain all frames in the third target image. Of course, other tools with similar functions can also be used to obtain all frames in the third target image, and this is not limited here.

[0103] It should be noted that the findContours function is an existing OpenCV function for searching image contours. The specific working principle and steps of the findContours function for obtaining the box are well-known existing technologies in the art and do not fall within the scope of protection of this embodiment, so they will not be described in detail here.

[0104] Step 300, determining whether the frame is a drawing frame, if not, determining that the file to be identified is not an engineering drawing, if so, executing step 400;

[0105] Specifically, after obtaining the frame, it is necessary to further determine whether the frame is a frame in the engineering drawing to further improve the accuracy of recognition.

[0106] Furthermore, the step 300 specifically includes:

[0107] Step 310: Obtain the area of ​​each frame, where the area of ​​the frame refers to the area of ​​the portion enclosed by the frame;

[0108] Specifically, step 310 calculates the area of ​​all frames using the contourArea function. Of course, the area of ​​the frames can also be calculated using other tools with the same function, which is not limited here.

[0109] It should be noted that the contourArea function is an existing function of OpenCV for calculating the area of ​​an image contour. The specific working principle and steps of the contourArea function for calculating the area of ​​a frame are well-known existing technologies in the art and do not fall within the scope of protection of this embodiment, so they will not be described here.

[0110] Step 320: Determine the degree of match between the area of ​​each frame and each standard area value in a pre-stored frame library, wherein the frame library pre-stores frame type, frame area standard value, standard value of relative position of the frame in the image, and correspondences between frame type, frame area standard value, and relative position standard value. If the maximum value of the degree of match between the area of ​​any frame and each standard area value is not less than a preset value, determine that the frame is a target frame; if the maximum value of the degree of match between the area of ​​any frame and each standard area value is less than a preset value, determine that the frame is not a target frame.

[0111] Specifically, the size and relative position of the label frame and the drawing frame in drawings of the same size are generally fixed. For example, in A4 drawings, the size of the label frame is basically the same and is generally located in the lower right corner; in A3 drawings, the size of the label frame is also basically the same and is generally located in the lower right corner. In this embodiment, the target frame can be a label frame, and the frame types pre-stored in the frame library mainly refer to label frames of drawings of various sizes, for example, as shown in Table 1; of course, the target frame can also be a drawing frame, and the frame type can be a drawing frame of drawings of various sizes, etc., which is not limited here. The frame area standard values ​​a and b are determined according to the actual area of ​​the target frame in the drawings of each size. The relative position standard value of the frame in the picture is determined according to the actual position of the target frame in the drawings of each size, such as center, upper left, lower left, lower right, etc.

[0112] Step 320 preliminarily determines whether the frame is a frame included in all drawings (such as a label frame) based on the area, thereby further improving the accuracy of engineering drawing recognition.

[0113] Table 1 Partial contents of the framework library

[0114]

[0115] Step 330, obtaining the number of the target frames. If the number of the target frames is zero, it is determined that the document to be identified is not an engineering drawing; if the number of the target frames is not zero, executing step 340;

[0116] Specifically, determining whether the file to be identified contains a frame commonly found in engineering drawings can be used to determine whether the file to be identified is an engineering drawing file. For example, whether the file to be identified contains a label frame. Since engineering drawings all have label frames, if the file to be identified does not contain a label frame, then the file to be identified is determined not to be an engineering drawing, resulting in high recognition efficiency and accuracy.

[0117] Step 340 : Obtain the relative position of the target frame in the third target image. Based on whether the correspondence between the relative position and the area conforms to the correspondence between the standard area value and the standard relative position value in the frame library, determine whether the target frame belongs to a frame type in the frame library. If not, determine that the file to be identified is not an engineering drawing. If so, determine that the target frame is a drawing frame, and execute step 410 .

[0118] Specifically, by determining whether the relative position and area of ​​the target frame conform to the corresponding relationship shown in Table 1, it can be determined whether the target frame is a label frame. Step 340 further determines whether the frame is a drawing frame included in the drawing, such as a label frame, based on the relative position. This further improves the accuracy and ensures the effectiveness of the method described in this embodiment.

[0119] Step 400 is to determine whether a first magic number can be obtained from the drawing frame, where the first magic number is information that can identify an engineering drawing. If so, it is determined that the file to be identified is an engineering drawing; if not, it is determined that the file to be identified is not an engineering drawing.

[0120] Specifically, such as Figure 4 As shown, the label box generally contains first magic numbers such as "Standard," "Audit," "Verification," "Design," "CAD Drawing," "Scale," "Date," and "Drawing Number." Recognizing any of these first magic numbers within the drawing box further confirms that the file to be identified is an engineering drawing, further improving accuracy and ensuring the effectiveness of the method described in this embodiment. Furthermore, first magic numbers can be accumulated and enriched over time to improve the accuracy of engineering drawing recognition.

[0121] Furthermore, the step 400 specifically includes:

[0122] Step 410 , obtaining coordinates of the drawing frame in the third target image, and based on the coordinates, obtaining text in the drawing frame from the first target image;

[0123] Specifically, after step 230 , the text portion is relatively fuzzy. Therefore, the text in the drawing frame is obtained from the first target image through the coordinates of the drawing frame with a relatively high accuracy.

[0124] In step 410, the coordinates of the drawing frame can be fitted into the coordinates of the four vertices of the frame using the boundingrect function, thereby obtaining the coordinates of the drawing frame. The boundingrect function is a computational technique that uses abscissas, ordinates, length, and width to measure the size of an object. This function plays an important role in graphics processing because it helps users measure the size and position of objects. The specific operating principles and steps of the boundingrect function for obtaining the coordinates of the drawing frame in the third target image are well known in the art and are beyond the scope of protection of this embodiment. These details will not be elaborated here. Of course, other tools with similar functions can also be used to obtain the coordinates of the drawing frame in the third target image, and this is not a limitation here.

[0125] In addition, the text in the drawing frame can be obtained from the first target image using an OCR (optical character recognition) text recognition tool. Of course, the text in the drawing frame can also be obtained using other tools with the same function, such as Baidu PaddleOCR, but this is not limited here. It should be noted that the OCR (optical character recognition) text recognition tool is an existing tool for recognizing text in images. The specific working principles and steps of OCR text recognition are well-known in the art and do not fall within the scope of protection of this embodiment, so they will not be described in detail here.

[0126] Step 420 , determining whether the first magic number can be obtained in the text, if so, determining that the file to be identified is an engineering drawing, if not, determining that the file to be identified is not an engineering drawing.

[0127] In summary, the embodiments of the present application preliminarily determine whether a file to be identified is an engineering drawing by obtaining the file attributes of the file to be identified. This can preliminarily screen out the vast majority of engineering drawing files with high accuracy. Furthermore, since identification is performed solely by extracting the file attributes of the file to be identified, data processing is simple and identification efficiency is high. Furthermore, determining whether the file to be identified is an engineering drawing by obtaining the file content can avoid missed screenings and further improve screening accuracy, ensuring that only engineering drawings are screened out. File content identification includes identifying whether there is a frame in the file to be identified, whether the frame is a drawing frame, and whether the frame contains a first magic number that can identify an engineering drawing. Therefore, identifying whether a file to be identified is an engineering drawing by sequentially using file attributes and file content ensures recognition efficiency and accuracy, effectively resolving the technical issue of insufficient accuracy in conventional automatic identification methods for identifying whether a PDF file is an engineering drawing, and achieving the beneficial effects of high efficiency and high accuracy.

[0128] In addition, the embodiment of the present application determines whether the file to be identified is an engineering drawing through three levels: the area, position and keywords of the frame, which greatly improves the accuracy of the judgment.

[0129] Example 2

[0130] Based on the same inventive concept as the method for automatically identifying engineering drawings in the aforementioned embodiment, the present invention also provides an automatic identification device for engineering drawings, such as Figure 5 As shown, the device includes:

[0131] a first judgment unit 11 configured to obtain a file attribute of a file to be identified and determine whether the file to be identified is an engineering drawing based on the file attribute; if so, determining that the file to be identified is an engineering drawing; and if not, executing a second judgment unit;

[0132] The second judging unit 12 is used to judge whether the file to be identified contains a frame. If not, it is judged that the file to be identified is not an engineering drawing. If so, the third judging unit is executed.

[0133] a third judging unit 13, configured to judge whether the frame is a drawing frame; if not, to judge whether the file to be identified is an engineering drawing; and if so, to execute a fourth judging unit;

[0134] The fourth judgment unit 14 is used to judge whether a first magic number can be obtained from the drawing frame, where the first magic number is information that can identify an engineering drawing. If so, it is judged that the file to be identified is an engineering drawing; if not, it is judged that the file to be identified is not an engineering drawing.

[0135] Furthermore, the first determining unit 11 includes:

[0136] A first judgment module is configured to obtain creator information of a file to be identified and determine whether a second magic number can be obtained from the creator information, where the second magic number is information that can identify an engineering drawing. If so, the file to be identified is determined to be an engineering drawing; if not, the first judgment module is executed. The first judgment module is configured to:

[0137] The second judgment module is used to obtain the coding information of the file to be identified, and judge whether the second magic number can be obtained from the coding information. If so, it is judged that the file to be identified is an engineering drawing; if not, the second judgment unit is executed.

[0138] Furthermore, the third judgment unit 13 includes:

[0139] A first acquisition module is used to acquire the area of ​​each frame;

[0140] a third judgment module, configured to judge the degree of match between the area of ​​each frame and each standard area value in a pre-stored frame library, wherein the frame library pre-stores frame type, frame area standard value, standard value of relative position of the frame in the image, and correspondences between frame type, frame area standard value, and relative position standard value; if the maximum value of the degree of match between the area of ​​any frame and each standard area value is not less than a preset value, then the frame is judged to be a target frame; if the maximum value of the degree of match between the area of ​​any frame and each standard area value is less than a preset value, then the frame is judged not to be a target frame;

[0141] a fourth judgment module, configured to obtain the number of the target frames, and if the number of the target frames is zero, determine that the document to be identified is not an engineering drawing; if the number of the target frames is not zero, execute the fifth judgment module;

[0142] a fifth judgment module, configured to obtain a relative position of the target frame in the first target image, and determine whether the target frame belongs to a frame type in the frame library based on whether the correspondence between the relative position and the area conforms to the correspondence between the standard area value and the standard relative position value in the frame library; if not, determine that the file to be identified is not an engineering drawing; if so, determine that the target frame is a drawing frame, and execute the fourth judgment unit.

[0143] Furthermore, the second determining unit 12 specifically includes:

[0144] a second acquisition module, configured to acquire the file to be identified in an image format and select a first target image, wherein when the number of pages N of the file to be identified is ≥ 2, the first target image is any page from the second to the Nth page of the file to be identified; and when the number of pages N of the file to be identified is 1, the first target image is the first page of the file to be identified;

[0145] A third acquisition module is used to obtain a grayscale image of the target image;

[0146] a fourth acquisition module, configured to perform blurring processing on the text portion of the grayscale image to obtain a second target image;

[0147] a fifth acquisition module, configured to perform binarization processing on the second target image to obtain a third target image consisting of only black and white pixels;

[0148] The sixth acquisition module is configured to acquire all frames on the third target image. If at least one frame cannot be acquired, it is determined that the file to be identified is not an engineering drawing. If at least one frame can be acquired, the third judgment unit is executed.

[0149] Furthermore, the fourth determining unit 14 specifically includes:

[0150] a seventh acquisition module, configured to acquire coordinates of the drawing frame in the third target image, and based on the coordinates, acquire text in the drawing frame from the first target image;

[0151] The sixth judgment module is used to judge whether the first magic number can be obtained in the text. If so, it is judged that the file to be identified is an engineering drawing; if not, it is judged that the file to be identified is not an engineering drawing.

[0152] The foregoing Figure 1 The various variations and specific examples of the method for automatic identification of engineering drawings in Example 1 are also applicable to the device for automatic identification of engineering drawings in this embodiment. Through the above detailed description of the method for automatic identification of engineering drawings, those skilled in the art can clearly understand the implementation method of the device for automatic identification of engineering drawings in this embodiment, so for the sake of brevity of the specification, it will not be described in detail here.

[0153] Example 3

[0154] Based on the same inventive concept as the method for automatic identification of engineering drawings in the aforementioned embodiment, the present invention also provides an automatic identification device for engineering drawings, which stores a computer program, and when the program is executed by a processor, implements the steps of any method of the method for automatic identification of engineering drawings described above.

[0155] Among them, Figure 6 In the embodiment of the present invention, a bus architecture (represented by bus 300) is shown. Bus 300 may include any number of interconnected buses and bridges. Bus 300 links various circuits together, including one or more processors represented by processor 302 and memory represented by memory 304. Bus 300 may also link various other circuits together, such as peripheral devices, voltage regulators, and power management circuits, which are well known in the art and are not described further herein. Bus interface 306 provides an interface between bus 300 and receiver 301 and transmitter 303. Receiver 301 and transmitter 303 may be the same component, namely a transceiver, which provides a means for communicating with various other devices over a transmission medium.

[0156] The processor 302 is responsible for managing the bus 300 and general processing, while the memory 304 may be used to store data used by the processor 302 when performing operations.

[0157] Example 4

[0158] Based on the same inventive concept as the method for automatically identifying engineering drawings in the aforementioned embodiment, the present invention further provides a computer-readable storage medium having a computer program stored thereon. When the program is executed by a processor, the following steps are implemented:

[0159] S100, obtaining file attributes of a file to be identified, and determining whether the file to be identified is an engineering drawing based on the file attributes. If so, determining that the file to be identified is an engineering drawing; if not, executing S200;

[0160] S200, determining whether the file to be identified contains a frame; if not, determining that the file to be identified is not an engineering drawing; if so, executing S300;

[0161] S300, determining whether the frame is a drawing frame, if not, determining whether the file to be identified is not an engineering drawing, if so, executing S400;

[0162] S400, determining whether a first magic number can be obtained from the drawing frame, where the first magic number is information that can identify an engineering drawing; if so, determining that the file to be identified is an engineering drawing; if not, determining that the file to be identified is not an engineering drawing.

[0163] It will be understood by those skilled in the art that embodiments of the present invention may be provided as methods, systems, or computer program products. Thus, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0164] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowcharts and / or block diagrams, as well as combinations of processes and / or blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowcharts and / or block diagrams. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0165] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.

[0166] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.

[0167] Obviously, those skilled in the art may make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if such changes and modifications fall within the scope of the claims and their equivalents, the present invention is intended to include such changes and modifications.

Claims

1. A method for automatic recognition of engineering drawings, characterized in that: The method comprises: S100, obtaining file attributes of a file to be identified, and determining whether the file to be identified is an engineering drawing based on the file attributes. If so, determining that the file to be identified is an engineering drawing; if not, executing S200; S200, determining whether the file to be identified contains a frame; if not, determining that the file to be identified is not an engineering drawing; if so, executing S300; S300, determining whether the frame is a drawing frame, if not, determining whether the file to be identified is not an engineering drawing, if so, executing S400; S400, determining whether a first magic number can be obtained from the drawing frame, where the first magic number is information that can identify an engineering drawing; if so, determining that the file to be identified is an engineering drawing; if not, determining that the file to be identified is not an engineering drawing; The S300 specifically includes: S310, obtaining the area of ​​each frame; S320, determining a degree of matching between the area of ​​each frame and each standard area value in a pre-stored frame library, wherein the frame library pre-stores a correspondence between frame type, frame area standard value, relative position standard value of the frame in the image, and frame type, frame area standard value, and relative position standard value; if the maximum value of the degree of matching between the area of ​​any frame and each standard area value is not less than a preset value, determining that the frame is a target frame; if the maximum value of the degree of matching between the area of ​​any frame and each standard area value is less than a preset value, determining that the frame is not a target frame; S330, obtaining the number of the target frames. If the number of the target frames is zero, determining that the document to be identified is not an engineering drawing; if the number of the target frames is not zero, executing S340; At step S340 , the relative position of the target frame in the third target image is obtained, and based on whether the correspondence between the relative position and the area conforms to the correspondence between the standard area value and the standard relative position value in the frame library, it is determined whether the target frame belongs to a frame type in the frame library. If not, it is determined that the file to be identified is not an engineering drawing. If so, it is determined that the target frame is a drawing frame, and step S400 is executed.

2. The method for automatically identifying engineering drawings according to claim 1, wherein: The S100 specifically includes: S110, obtaining creator information of the file to be identified, and determining whether a second magic number can be obtained from the creator information, where the second magic number is information that can identify an engineering drawing. If so, determining that the file to be identified is an engineering drawing; if not, executing S120; S120, obtaining coding information of the file to be identified, and determining whether a second magic number can be obtained from the coding information. If so, determining that the file to be identified is an engineering drawing; if not, executing S200.

3. The method for automatically identifying engineering drawings according to claim 1, wherein: The S200 specifically includes: S210, obtaining the file to be identified in image format, and selecting a first target image, wherein when the number of pages N of the file to be identified is ≥ 2, the first target image is any page from the 2nd to the Nth page of the file to be identified; and when the number of pages N of the file to be identified is 1, the first target image is the first page of the file to be identified; S220, obtaining a grayscale image of the target image; S230, performing blur processing on the text portion in the grayscale image to obtain a second target image; S240, performing binarization processing on the second target image to obtain a third target image including only black and white pixels; S250 , acquiring all frames on the third target image. If at least one frame cannot be acquired, determining that the file to be identified is not an engineering drawing. If at least one frame can be acquired, executing S300 .

4. The method for automatically identifying engineering drawings according to claim 3, wherein: The S400 specifically includes: S410 , obtaining coordinates of the drawing frame in the third target image, and based on the coordinates, obtaining text in the drawing frame from the first target image; S420, determining whether the first magic number can be obtained in the text, if so, determining that the file to be identified is an engineering drawing, if not, determining that the file to be identified is not an engineering drawing.

5. An automatic recognition device for engineering drawings, characterized in that: The device comprises: a first judgment unit, configured to obtain a file attribute of a file to be identified, and determine whether the file to be identified is an engineering drawing according to the file attribute; if so, determining that the file to be identified is an engineering drawing; if not, executing a second judgment unit; a second judging unit, configured to judge whether the file to be identified contains a frame, and if not, to judge that the file to be identified is not an engineering drawing, and if so, to execute a third judging unit; a third judging unit, configured to judge whether the frame is a drawing frame, and if not, to judge whether the file to be identified is not an engineering drawing, and if so, to execute the fourth judging unit; a fourth determining unit, configured to determine whether a first magic number can be obtained from the drawing frame, the first magic number being information that can identify an engineering drawing; if so, determining that the file to be identified is an engineering drawing; and if not, determining that the file to be identified is not an engineering drawing; The third judgment unit includes: a first acquisition module, configured to acquire the area of ​​each frame; a third judgment module, configured to judge a degree of match between the area of ​​each frame and each standard area value in a pre-stored frame library, wherein the frame library pre-stores a correspondence between frame type, frame area standard value, relative position standard value of the frame in the image, and frame type, frame area standard value, and relative position standard value; if the maximum value of the degree of match between the area of ​​any frame and each standard area value is not less than a preset value, the frame is judged to be a target frame; if the maximum value of the degree of match between the area of ​​any frame and each standard area value is less than a preset value, the frame is judged not to be a target frame; a fourth judgment module, configured to obtain the number of the target frames, and if the number of the target frames is zero, determine that the document to be identified is not an engineering drawing; and if the number of the target frames is not zero, execute the fifth judgment module; A fifth judgment module is configured to obtain a relative position of the target frame in the first target image, and determine whether the target frame belongs to a frame type in the frame library based on whether the correspondence between the relative position and the area conforms to the correspondence between the standard area value and the standard relative position value in the frame library; if not, determine that the file to be identified is not an engineering drawing; if so, determine that the target frame is a drawing frame, and execute the fourth judgment unit.

6. The automatic identification device for engineering drawings according to claim 5, characterized in that: The first judgment unit includes: a first judgment module, configured to obtain creator information of the file to be identified, and determine whether a second magic number can be obtained from the creator information, where the second magic number is information that can identify an engineering drawing; if so, determining that the file to be identified is an engineering drawing; if not, executing the first judgment module, wherein the first judgment module is configured to: The second judgment module is used to obtain the coding information of the file to be identified, and judge whether the second magic number can be obtained from the coding information. If so, it is judged that the file to be identified is an engineering drawing; if not, the second judgment unit is executed.

7. An automatic recognition device for engineering drawings, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the following steps are implemented: S100, obtaining file attributes of a file to be identified, and determining whether the file to be identified is an engineering drawing based on the file attributes. If so, determining that the file to be identified is an engineering drawing; if not, executing S200; S200, determining whether the file to be identified contains a frame; if not, determining that the file to be identified is not an engineering drawing; if so, executing S300; S300, determining whether the frame is a drawing frame, if not, determining whether the file to be identified is not an engineering drawing, if so, executing S400; S400, determining whether a first magic number can be obtained from the drawing frame, where the first magic number is information that can identify an engineering drawing; if so, determining that the file to be identified is an engineering drawing; if not, determining that the file to be identified is not an engineering drawing; The S300 specifically includes: S310, obtaining the area of ​​each frame; S320, determining a degree of matching between the area of ​​each frame and each standard area value in a pre-stored frame library, wherein the frame library pre-stores a correspondence between frame type, frame area standard value, relative position standard value of the frame in the image, and frame type, frame area standard value, and relative position standard value; if the maximum value of the degree of matching between the area of ​​any frame and each standard area value is not less than a preset value, determining that the frame is a target frame; if the maximum value of the degree of matching between the area of ​​any frame and each standard area value is less than a preset value, determining that the frame is not a target frame; S330, obtaining the number of the target frames. If the number of the target frames is zero, determining that the document to be identified is not an engineering drawing; if the number of the target frames is not zero, executing S340; At step S340 , the relative position of the target frame in the third target image is obtained, and based on whether the correspondence between the relative position and the area conforms to the correspondence between the standard area value and the standard relative position value in the frame library, it is determined whether the target frame belongs to a frame type in the frame library. If not, it is determined that the file to be identified is not an engineering drawing. If so, it is determined that the target frame is a drawing frame, and step S400 is executed.

8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by the processor, the following steps are performed: S100, obtaining file attributes of a file to be identified, and determining whether the file to be identified is an engineering drawing based on the file attributes. If so, determining that the file to be identified is an engineering drawing; if not, executing S200; S200, determining whether the file to be identified contains a frame; if not, determining that the file to be identified is not an engineering drawing; if so, executing S300; S300, determining whether the frame is a drawing frame, if not, determining whether the file to be identified is not an engineering drawing, if so, executing S400; S400, determining whether a first magic number can be obtained from the drawing frame, where the first magic number is information that can identify an engineering drawing; if so, determining that the file to be identified is an engineering drawing; if not, determining that the file to be identified is not an engineering drawing; The S300 specifically includes: S310, obtaining the area of ​​each frame; S320, determining a degree of matching between the area of ​​each frame and each standard area value in a pre-stored frame library, wherein the frame library pre-stores a correspondence between frame type, frame area standard value, relative position standard value of the frame in the image, and frame type, frame area standard value, and relative position standard value; if the maximum value of the degree of matching between the area of ​​any frame and each standard area value is not less than a preset value, determining that the frame is a target frame; if the maximum value of the degree of matching between the area of ​​any frame and each standard area value is less than a preset value, determining that the frame is not a target frame; S330, obtaining the number of the target frames. If the number of the target frames is zero, determining that the document to be identified is not an engineering drawing; if the number of the target frames is not zero, executing S340; At step S340 , the relative position of the target frame in the third target image is obtained, and based on whether the correspondence between the relative position and the area conforms to the correspondence between the standard area value and the standard relative position value in the frame library, it is determined whether the target frame belongs to a frame type in the frame library. If not, it is determined that the file to be identified is not an engineering drawing. If so, it is determined that the target frame is a drawing frame, and step S400 is executed.

Citation Information

Patent Citations

  • File type recognition method and file type recognition device

    CN102571767A

  • DWG-format drawing identification method and system

    CN103500257A