Graph detection method and device, electronic equipment and computer storage medium
By automating the inspection of graphic processing files of mechanical products, extracting key information and comparing it with the original graphics, the problems of low efficiency and error-proneness of manual inspection are solved, thus improving inspection efficiency, reducing costs, and ensuring product quality.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- HONGFUJIN PRECISION ELECTRONICS ZHENGZHOU
- Filing Date
- 2022-12-29
- Publication Date
- 2026-04-17
AI Technical Summary
In the process of machining mechanical products, manual inspection is inefficient, prone to errors, and costly, making it difficult to guarantee high-quality and high-standard product delivery.
By extracting key graphic information from the graphic processing file, a first graphic is created and compared with the original graphic. An error value is generated to determine whether it is within the preset range, and the processing file is automatically updated.
Automated testing has been achieved, improving testing efficiency and accuracy, reducing the cost of manual testing, and ensuring product quality.
Smart Images

Figure CN116071312B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of graphic detection technology, and in particular to a graphic detection method, apparatus, electronic device, and computer storage medium. Background Technology
[0002] With the continuous development of the machinery industry, the market demand for mechanical products is also increasing. Currently, in the processing of mechanical products, processing a product often requires multiple processing procedures, and different processing procedures also require the use of different processing tools.
[0003] In order to ensure high product quality and improve customer satisfaction during product processing, continuous manual inspection is required. However, manual product inspection suffers from problems such as low efficiency, high error rate, and high cost. Summary of the Invention
[0004] In view of this, it is necessary to provide a graphic inspection method, apparatus, electronic device, and computer storage medium to improve inspection efficiency, reduce costs, and ensure high-quality and high-efficiency product delivery during product processing.
[0005] One embodiment of this application provides a graphic detection method, the method comprising:
[0006] Extract key graphic information from the graphic processing file, wherein the key graphic information includes several key graphic values, which are used to characterize the shape information of the processed graphic in the graphic processing file; create a first graphic based on the key graphic values; compare the first graphic with the original graphic to generate a graphic comparison result.
[0007] Accurately extracting key graphic values from graphic processing files enables precise identification of critical information in the processed graphic, creating a first graphic, and automatically comparing the first graphic with the original graphic. This avoids the inefficiencies and errors associated with manual offline inspection of product processing.
[0008] In some embodiments, the step of extracting graphic key information from a graphic processing file, wherein the graphic key information includes several graphic key values, includes: receiving the graphic processing file and reading the graphic processing file according to a preset reading rule; based on the reading result of reading the graphic processing file, detecting whether the graphic processing file contains the graphic key information; if the graphic processing file contains the graphic key information, extracting several of the graphic key values from the graphic key information.
[0009] In some embodiments, detecting whether the graphic processing file contains graphic key information includes: if the graphic processing file does not contain the graphic key information, generating an information reading completion result.
[0010] In some embodiments, the plurality of graphic key values include positioning values, a plurality of graphic shape values, and a plurality of coordinate values; the step of creating a first graphic based on the plurality of graphic key values includes: locating the graphic processing position of the first graphic based on the positioning values; parsing the plurality of graphic shape values based on the graphic processing position to obtain the processed graphic shape of the first graphic; and parsing the plurality of coordinate values based on the processed graphic shape to create the first graphic.
[0011] In some embodiments, the graphic comparison result includes a successful graphic comparison result and a failed graphic comparison result; the step of comparing the first graphic and the original graphic to generate a graphic comparison result includes: comparing the first graphic and the original graphic to obtain a first error value; if the first error value is within a preset error range, generating a successful graphic comparison result; if the first error value is not within the preset error range, generating a failed graphic comparison result.
[0012] In some embodiments, the method further includes: if the graphic comparison result is a graphic comparison failure result, updating the graphic processing file according to the first error value.
[0013] In some embodiments, before receiving the graphic processing file, the method further includes: receiving the file path information of the graphic processing file; receiving the graphic processing file includes: parsing the file path information to obtain the graphic processing file.
[0014] One embodiment of this application also provides a graphic detection device, comprising: an extraction module for receiving a graphic processing file and extracting graphic key information from the graphic processing file, wherein the graphic key information includes a plurality of graphic key values, the plurality of graphic key values being used to characterize the shape information of the processed graphic in the graphic processing file; a graphic creation module for creating a first graphic based on the plurality of graphic key values; and a comparison module for comparing the first graphic with the original graphic and generating a graphic comparison result.
[0015] One embodiment of this application also provides an electronic device, which includes a processor and a memory. The memory is used to store instructions, and the processor is used to call the instructions in the memory to cause the electronic device to execute the above-described image detection method.
[0016] An embodiment of this application also provides a computer-readable storage medium that stores computer instructions that, when executed on an electronic device, cause the electronic device to perform the above-described graphic detection method.
[0017] Compared with existing technologies, the above-described image inspection method, apparatus, electronic device, and computer-readable storage medium first obtain the image processing file by parsing the file path information containing the image processing file. Then, it reads the image processing file according to preset reading rules to extract several key image values from the file. Next, based on these key image values, a first image is obtained. Finally, the first image and the original image are compared to obtain a first error value. Whether the first error value is within a preset error range is determined to decide whether the image processing file needs to be updated. This avoids manual offline inspection of product processing, solving the problems of low efficiency, high cost, and error susceptibility associated with manual offline inspection. Attached Figure Description
[0018] Figure 1 This is a flowchart of the steps of a graphic detection method according to an embodiment of this application.
[0019] Figure 2 This is a schematic diagram of the structure of a graphic detection device according to an embodiment of this application.
[0020] Figure 3 This is a schematic diagram of the structure of an electronic device according to an embodiment of this application.
[0021] Explanation of main component symbols
[0022] Electronic devices 100
[0023] Image detection device 10
[0024] Extraction Module 11
[0025] Graphics Creation Module 12
[0026] Comparison Module 13
[0027] Memory 20
[0028] Processor 30
[0029] Computer Program 40 Detailed Implementation
[0030] To better understand the above-mentioned objectives, features, and advantages of this application, the application will be described in detail below with reference to the accompanying drawings and specific embodiments. It should be noted that, unless otherwise specified, the embodiments and features described in these embodiments can be combined with each other.
[0031] The following description sets forth many specific details to provide a full understanding of this application. The described embodiments are only some, not all, of the embodiments of this application.
[0032] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein in the specification of this application is for the purpose of describing particular embodiments only and is not intended to be limiting of this application.
[0033] It should be further noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0034] In this application, "at least one" means one or more, and "more than one" means two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, or B alone, where A and B can be singular or plural. The terms "first," "second," "third," "fourth," etc. (if present) in the specification, claims, and drawings of this application are used to distinguish similar objects, not to describe a specific order or sequence.
[0035] In the embodiments of this application, the terms "exemplary" or "for example" are used to indicate that something is an example, illustration, or description. Any embodiment or design that is described as "exemplary" or "for example" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or design. Specifically, the use of the terms "exemplary" or "for example" is intended to present the relevant concepts in a specific manner.
[0036] The image detection method of this application can be applied to one or more electronic devices. An electronic device is a device that can automatically perform numerical calculations and / or information processing according to pre-set or stored instructions, such as a server or server cluster.
[0037] Currently, with the continuous upgrading and iteration of electronic devices, the market's requirements for the quality of electronic devices are becoming increasingly higher. At the same time, the needs of end users for electronic devices are also constantly changing. Meanwhile, as a smart manufacturing plant for electronic devices, it needs to meet the needs of end users in the market, not only by mass-producing different types of electronic devices, but also by meeting the frequent changes in the types of electronic devices that end users require.
[0038] Figure 1 This is a flowchart of the steps of an embodiment of the graphic detection method of this application.
[0039] See Figure 1 As shown, an image detection method may include the following steps:
[0040] S100. Extract key graphic information from the graphic processing file, wherein the key graphic information includes several key graphic values, which are used to characterize the shape information of the processed graphic in the graphic processing file.
[0041] In some embodiments, the process of manufacturing electronic devices in a smart factory involves the customer providing product manufacturing drawings. Based on these drawings, engineers design workstations for different production stages and develop corresponding product processing programs. These processing programs form the original processing files, which the machine tools then use to process the products. Next, on-site quality inspection is required to ensure a high pass rate. However, on-site inspection is time-consuming, labor-intensive, inefficient, and prone to errors. Therefore, the graphic inspection method of this application allows for automated online inspection, improving efficiency and accuracy.
[0042] In some embodiments, when inspecting a product under processing, the product processing personnel can select a file path on the graphic inspection system, where the file path contains the graphic processing file of the product to be processed. Then, after receiving the file path information of the graphic processing file, the graphic inspection system parses the file path information to obtain the graphic processing file. In other embodiments, the graphic inspection system may also read the corresponding graphic processing file from a default file path. The reading rules can be set by the engineer. This application does not limit the file path or the method of reading the graphic processing file, as long as the graphic inspection system can read the correct graphic processing file.
[0043] In some embodiments, the image detection system reads the image processing file according to a preset reading rule. Then, based on the reading result of the image processing file, it detects whether the image processing file contains key image information. If key image information is detected, several key image values are extracted from the key image information. If no key image information is detected, a result indicating that the information reading is complete is generated. In this embodiment, the preset reading rule is to read the information in the image processing file in the order it is written. Since the image processing information is for a specific product, the image processing file contains code. The code information is read line by line according to the execution order of the code to detect whether the image processing file contains key image information. In other embodiments, the reading can also be performed in the order of paragraphs. This application does not limit the content of the preset reading rule.
[0044] In some embodiments, the graphic key information may also include several graphic shapes. For example, in a smart factory, since each production line processes one type of product, the graphic key information can include the shapes of different parts of the product at different angles. Then, a graphic inspection system reads the graphic processing file according to preset reading rules to detect whether the graphic processing file contains several graphic shapes. This application does not limit the specific content of the graphic key information; it can be set according to actual conditions.
[0045] S200. Based on several key graphic values, create the first graphic.
[0046] In some embodiments, the key graphic values include positioning values, graphic shape values, and coordinate values. The graphic inspection system locates the graphic processing position of the first graphic based on the positioning values. For example, in the graphic processing file, the code representing the positioning value is G00. After reading the value of G00, the graphic processing position is obtained. Then, based on the graphic processing position, the key graphic shape values are parsed to obtain the processed graphic shape of the first graphic. For example, the graphic shape values include G01, G02, and G03, where G01 represents a straight line, G02 represents a clockwise arc, and G03 represents a counterclockwise arc. Thus, the graphic inspection system can determine the shape of a component of the product to be processed. Finally, based on the processed graphic shape, the key coordinate values are parsed to create the first graphic. For example, X, Y, and Z represent the length information on the X-axis, Y-axis, and Z-axis, respectively. After all the information in the graphic processing file has been read, the graphic inspection system can create the first graphic based on the key graphic values. In other embodiments, the coordinate values may also include four-dimensional coordinates, six-dimensional coordinates, etc., and the graphic shape values may also include wavy lines, broken lines, etc. This application does not limit the content of the positioning values, graphic shape values and coordinate values.
[0047] S300. Compare the first graphic with the original graphic to generate a graphic comparison result.
[0048] In some embodiments, the graphic comparison result includes a successful graphic comparison result and a failed graphic comparison result. Each product has an original processing drawing file before processing, which includes the original graphic. The graphic inspection system compares the first graphic and the original graphic to obtain a first error value. If the first error value is within a preset error range, a successful graphic comparison result is generated. If the first error value is not within the preset error range, a failed graphic comparison result is generated. If the graphic comparison result is a failed graphic comparison result, the graphic processing file is updated according to the first error value. In this embodiment, the preset error range can be [0.001-0.009]. If the first error value between the first graphic and the original graphic is within [0.001-0.009], the graphic comparison result is successful, the product processing is normal, and processing can continue. Otherwise, problems may occur during processing, requiring engineers to promptly review the graphic processing file, modify and update it, and reload the updated graphic processing file into the graphic inspection system. In other embodiments, the preset error range can also be [0.01-0.09], which can be set according to the actual product processing accuracy. This application does not limit the preset error range.
[0049] In some embodiments, if the graphic key information includes several graphic key values, several positioning values, several graphic shape values, and several coordinate values can be obtained from the graphic processing file read by the graphic detection system according to preset reading rules. Then, during product processing, the graphic detection system compares the actual positioning values, graphic shape values, and coordinate values of the processed product with those read from the graphic processing file to obtain a graphic comparison result. For example, when processing a certain position on a certain edge of the product, the X-axis coordinate value read is 100.0067mm, while the X-axis coordinate value read from the graphic processing file is 100.0057mm. The difference between 100.0067mm and 100.0057mm is 0.001. The preset error range is [0.001-0.009]. If 0.001 is within the preset error range, it proves that the product processing meets the requirements. Otherwise, it proves that the product processing is abnormal and needs to be detected in time.
[0050] In some embodiments, if the key information of a graphic contains several graphic shapes, the graphic detection system can use preset graphic comparison rules to compare the first graphic with the original graphic and generate a graphic comparison result. The preset graphic comparison rules can use mainstream artificial intelligence graphic detection methods, such as image similarity comparison algorithms. Alternatively, they can use image similarity detection formulas, such as cosine similarity, hash algorithms, histograms, etc.
[0051] The graphic detection method in this embodiment first obtains the graphic processing file by parsing the file path information containing the graphic processing file. Then, it reads the graphic processing file according to preset reading rules to extract several graphic key values from the file. These graphic key values include positioning values representing the product processing location, product shape values representing the processed product, and processing coordinate values. Next, a first graphic is obtained based on these graphic key values. Finally, the first graphic is compared with the original graphic to obtain a first error value. Whether the first error value is within a preset error range determines whether the graphic processing file needs to be updated. This avoids manual offline inspection of product processing, solving the problems of low efficiency, high cost, and error susceptibility associated with manual offline inspection.
[0052] In some embodiments, this application also provides a graphic detection device 10, such as Figure 2 As shown, the image detection device 10 includes an extraction module 11, an image creation module 12, and a comparison module 13. The unit or module referred to in the embodiments of this application can refer to a series of computer program instructions capable of performing a specific function, or it can be a functional unit formed by the cooperation of computer program instruction segments and hardware. The division of units or modules is a logical functional division, and in actual implementation, it can be another division method, which is not limited in this application.
[0053] The extraction module 11 is used to receive a graphic processing file and extract key graphic information from the graphic processing file. The key graphic information includes several key graphic values, which are used to characterize the shape information of the processed graphic in the graphic processing file.
[0054] The graphic creation module 12 is used to create a first graphic based on several graphic key values;
[0055] The comparison module 13 is used to compare the first graphic with the original graphic and generate graphic comparison results.
[0056] In some embodiments, this application also discloses an electronic device 100, such as... Figure 3As shown, the electronic device 100 includes a memory 20 and a processor 30. The memory 20 stores instructions, and the processor 30 calls the instructions in the memory 20 to cause the electronic device 100 to execute the steps in the image detection method of the above embodiment, for example... Figure 1 The steps S100 to S300 are shown. The electronic device 100 may be a device equipped with a graphics detection system. In the embodiments of this application, the example described is that the electronic device 100 is equipped with a graphics detection system.
[0057] Those skilled in the art will understand that the schematic diagram is merely an example of the electronic device 100 and does not constitute a limitation on the electronic device 100. It may include more or fewer components than shown in the diagram, or combine certain components, or different components. For example, the electronic device 100 may also include input / output devices, network access devices, buses, etc.
[0058] Processor 30 can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. General-purpose processors can be microprocessors, single-chip microcomputers, or any conventional processor.
[0059] The memory 20 can be used to store computer programs 40 and / or modules / units. The processor 30 implements various functions of the electronic device 100 by running or executing the computer programs 40 and / or modules / units stored in the memory 20 and by calling data stored in the memory 20. The memory 20 may mainly include a program storage area and a data storage area. The program storage area may store the operating system, application programs required for at least one function (such as sound playback function, image playback function, etc.), etc.; the data storage area may store data created according to the use of the electronic device 100 (such as audio data), etc. In addition, the memory 20 may include high-speed random access memory, and may also include non-volatile memory, such as hard disk, RAM, plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, at least one disk storage device, flash memory device, or other non-volatile solid-state storage device.
[0060] This application also discloses a computer-readable storage medium storing computer instructions, which, when executed on an electronic device 100, cause the electronic device 100 to perform the graphics detection method of this embodiment. The computer-readable storage medium may include: any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a portable hard drive, a magnetic disk, an optical disk, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electrical carrier signal, a telecommunication signal, and a software distribution medium, etc. It should be noted that the content included in the computer-readable medium may be appropriately added to or subtracted according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, the computer-readable storage medium does not include electrical carrier signals and telecommunication signals.
[0061] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application and are not intended to limit it. Although this application has been described in detail with reference to the above embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of this application without departing from the spirit and scope of the technical solutions of this application.
Claims
1. A method for detecting images, characterized in that, include: Extract key graphic information from a graphic processing file, wherein the key graphic information includes several key graphic values, which are used to characterize the shape information of the processed graphic in the graphic processing file; the graphic processing file is a code program; A first graphic is created based on several graphic key values; wherein the several graphic key values include positioning values, several graphic shape values, and several coordinate values; the creation of the first graphic based on the several graphic key values includes: Based on the positioning value, locate the graphic processing position of the first graphic; Based on the graphic processing position, several graphic shape values are analyzed to obtain the processed graphic shape of the first graphic; Based on the shape of the processed graphic, several coordinate values are analyzed to create the first graphic; Compare the first image with the original image to generate an image comparison result; the image comparison result includes a successful image comparison result and a failed image comparison result. By comparing the first image with the original image, a first error value is obtained; If the first error value is within the preset error range, the graphic comparison success result is generated. If the first error value is not within the preset error range, then the graphic comparison failure result is generated; If the graphic comparison result is a failure, the graphic processing file is updated according to the first error value.
2. The image detection method as described in claim 1, characterized in that, The extraction of key graphic information from the graphic processing file, wherein the key graphic information includes several key graphic values, including: Receive the graphic processing file and read the graphic processing file according to a preset reading rule; Based on the reading result of the graphic processing file, it is detected whether the graphic processing file contains the graphic key information. If the graphic processing file contains the graphic key information, several graphic key values are extracted from the graphic key information.
3. The image detection method as described in claim 2, characterized in that, The detection of whether the graphic processing file contains key graphic information includes: If the graphic processing file is found to contain no key graphic information, a result indicating that the information has been read is generated.
4. The image detection method as described in claim 2, characterized in that, Before receiving the graphic processing file, the method further includes: Receive the file path information of the graphic processing file; The received graphic processing file includes: The file path information is parsed to obtain the graphic processing file.
5. A graphic detection device, characterized in that, include: An extraction module is used to receive a graphic processing file and extract key graphic information from the graphic processing file. The key graphic information includes several key graphic values, which are used to characterize the shape information of the processed graphic in the graphic processing file. The graphic processing file contains code programs. A graphic creation module is used to create a first graphic based on a plurality of graphic key values; wherein the plurality of graphic key values include positioning values, a plurality of graphic shape values, and a plurality of coordinate values; the creation of the first graphic based on the plurality of graphic key values includes: Based on the positioning value, locate the graphic processing position of the first graphic; Based on the graphic processing position, several graphic shape values are analyzed to obtain the processed graphic shape of the first graphic; Based on the shape of the processed graphic, several coordinate values are analyzed to create the first graphic; The comparison module is used to compare the first graphic and the original graphic to generate a graphic comparison result; the graphic comparison result includes a successful graphic comparison result and a failed graphic comparison result. By comparing the first image with the original image, a first error value is obtained; If the first error value is within the preset error range, the graphic comparison success result is generated. If the first error value is not within the preset error range, then the graphic comparison failure result is generated; If the graphic comparison result is a failure, the graphic processing file is updated according to the first error value.
6. An electronic device, the electronic device comprising a processor and a memory, characterized in that, The memory is used to store instructions, and the processor is used to call the instructions in the memory to cause the electronic device to execute the image detection method as described in any one of claims 1 to 4.
7. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that, when executed on an electronic device, cause the electronic device to perform the graphic detection method as described in any one of claims 1 to 4.
Citation Information
Patent Citations
Method for analyzing measured drawing of part
CN103954213A