Glue path detection area determination method and device, electronic equipment and storage medium
By analyzing the graphic elements of the glue circuit electronic drawings, the glue circuit detection area is automatically determined, which solves the problems of low rubber circuit detection efficiency and large errors in the existing technology, and achieves efficient and accurate rubber circuit detection.
Patent Information
- Application Number
- CN202510552070.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-28
- Publication Date
- 2025-08-15
AI Technical Summary
In the prior art, the determination efficiency of the product glue circuit detection area is low and artificial drawing errors are prone to occur, which affects product quality and performance.
By acquiring electronic drawings of glue circuits, analyzing graphic elements, determining the first glue circuit area, and generating glue circuit images containing the second glue circuit area, reducing manual drawing and improving the accuracy and efficiency of the detection area.
There is no need to manually draw the area to be tested, which can reduce manual workload, eliminate human errors, and improve the determination efficiency and accuracy of the rubber road detection area.
Smart Images

Figure CN120495469A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of machine vision technology, and in particular to a method, device, electronic device, and storage medium for determining a glue road detection area. Background Art
[0002] Gluing is a critical step in the product manufacturing process. During this process, problems such as glue breakage, glue overflow, and insufficient glue may occur, affecting the quality of the glue path formed. This quality, in turn, directly affects the final performance of the product. Therefore, after gluing, the resulting glue path needs to be inspected to eliminate problems arising from the gluing process, improve glue path quality, and ultimately enhance the final performance of the product.
[0003] Current solutions for inspecting glue lines on products are based on identifying the area to be inspected along the glue line. This area requires workers to manually draw it on an image of the glued product. However, manually drawing the area to be inspected is inefficient. Summary of the Invention
[0004] The purpose of the embodiments of the present application is to provide a method, device, electronic device, and storage medium for determining a glue road detection area to improve the efficiency of determining the glue road detection area. The specific technical solution is as follows:
[0005] In a first aspect, an embodiment of the present application provides a method for determining a glue road detection area, the method comprising:
[0006] In response to an import operation of an electronic drawing of a glue path for a target product, obtaining the electronic drawing of the glue path;
[0007] Performing element analysis on the electronic drawing of the glue circuit to obtain graphic elements contained in the electronic drawing of the glue circuit;
[0008] determining a first glue path area in the glue path electronic drawing according to the obtained element information of the graphic element;
[0009] generating a glue path image including a second glue path area according to the first glue path area, wherein the second glue path area is converted from the first glue path area;
[0010] The glue path image is displayed.
[0011] In a second aspect, an embodiment of the present application provides a device for determining a glue road detection area, the device comprising:
[0012] A drawing acquisition module, configured to acquire the electronic drawing of the glue path in response to an import operation of the electronic drawing of the glue path of the target product;
[0013] An element analysis module, configured to perform element analysis on the electronic drawing of the glue circuit to obtain graphic elements contained in the electronic drawing of the glue circuit;
[0014] an area determination module, configured to determine a first glue path area in the glue path electronic drawing according to the element information of the obtained graphic element;
[0015] an image generation module, configured to generate a glue path image including a second glue path area based on the first glue path area, wherein the second glue path area is converted from the first glue path area;
[0016] An image display module is used to display the glue path image.
[0017] In a third aspect, an embodiment of the present application provides an electronic device, including:
[0018] Memory for storing computer programs;
[0019] The processor is configured to implement the method described in the first aspect above when executing the program stored in the memory.
[0020] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method described in the first aspect is implemented.
[0021] Beneficial effects of the embodiments of the present application:
[0022] As can be seen from the above, when applying the solution provided in the embodiments of the present application to determine the area to be inspected for the adhesive path on a product, elemental analysis is performed on the electronic drawing of the adhesive path of the target product to obtain the graphic elements contained in the electronic drawing of the adhesive path. Based on the elemental information of the obtained graphic elements, the first adhesive path area in the electronic drawing of the adhesive path can be accurately determined, and then an adhesive path image containing the second adhesive path area is generated based on the first adhesive path area. In this way, a solution for inspecting the adhesive path of the target product can be designed based on the second adhesive path area contained in the adhesive path image. As can be seen, the above process does not require the user to manually draw the area to be inspected, thereby improving the efficiency of determining the area and reducing the manual workload. In addition, this solution eliminates manual errors when manually drawing the area to be inspected, and can improve the accuracy of determining the area. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other embodiments can also be obtained based on these drawings.
[0024] Figure 1 A schematic flow chart of a method for determining a glue road detection area provided in an embodiment of the present application;
[0025] Figure 2a A schematic diagram of a user interaction interface provided in an embodiment of the present application;
[0026] Figure 2b A schematic diagram of a glue path image provided in an embodiment of the present application;
[0027] Figure 3a A schematic diagram of a rectangular area provided in an embodiment of the present application;
[0028] Figure 3b A schematic diagram of an arc-shaped area provided in an embodiment of the present application;
[0029] Figure 3c A schematic diagram of a polygonal area provided in an embodiment of the present application;
[0030] Figure 4a A schematic diagram of a structure of two intersecting and perpendicular line segments provided in an embodiment of the present application;
[0031] Figure 4b A schematic diagram of a candidate rectangular area provided in an embodiment of the present application;
[0032] Figure 5 A flow chart of a method for generating a glue path detection solution provided in an embodiment of the present application;
[0033] Figure 6 A schematic structural diagram of a device for determining a glue road detection area provided in an embodiment of the present application;
[0034] Figure 7 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0035] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field based on this application are within the scope of protection of this application.
[0036] First, the execution entity of the region determination solution provided in the embodiment of the present application is described.
[0037] The region determination solution provided in the embodiments of the present application can be implemented by a machine vision application software platform. The machine vision application software platform can interact with users and execute corresponding data processing procedures based on user operations on the platform, such as machine vision inspection, measurement and code reading, and positioning. The platform can also display data processing results for user review.
[0038] The following describes the method and device for determining the glue road detection area provided in the embodiments of the present application through specific examples.
[0039] In one embodiment of the present application, see Figure 1 , a flow chart of a method for determining a glue road detection area is provided. In this embodiment, the method includes the following steps S101-S105.
[0040] Step S101: in response to an import operation of an electronic drawing of a glue circuit for a target product, obtaining the electronic drawing of the glue circuit.
[0041] The electronic drawing of the glue path has the area for gluing on the target product drawn therein, which is used to instruct the gluing equipment to gluing the target product according to the area for gluing drawn in the electronic drawing of the glue path when gluing the target product.
[0042] The electronic drawing of the glue path may be an electronic drawing drawn using AutoCAD (Autodesk Computer Aided Design), Visio or other drawing software.
[0043] Specifically, the above-mentioned electronic drawings of the glue circuit can be stored in a preset storage device, and the above-mentioned platform can establish a communication connection with the storage device. After the user imports the electronic drawings of the glue circuit for the target product, the above-mentioned platform receives the user's import operation and obtains the electronic drawings of the glue circuit stored on the storage device through the communication connection with the storage device.
[0044] For example, see Figure 2a, shows a user interaction interface of the above platform, which contains two controls: "Glue Path Track Creation" and "Glue Path ROI Adjustment". When the user selects the "Glue Path Track Creation" control, the interface will pop up two controls: "Draw Glue Path Track" and "Import CAD File". When the user selects the "Import CAD File" control, a pop-up window for importing CAD files will pop up. The pop-up window displays various CAD files of the stored DXF file type, such as center glue, solder point glue, steel mesh glue, voice coil skeleton glue, and magnetic steel basin frame glue. The user can select the file to be imported from these files, so that the file name of the selected file will be displayed in the text box of the file name below. Then, after the user clicks the Open control, the selected file can be imported. In addition, the user can also click the Cancel control to exit the pop-up window.
[0045] Step S102: performing element analysis on the electronic drawing of the glue circuit to obtain graphic elements contained in the electronic drawing of the glue circuit.
[0046] The above-mentioned graphic elements can be understood as the elements that constitute the graphics contained in the electronic drawings of the glue circuit. For example, in CAD drawings (i.e., electronic drawings drawn using AutoCAD drawing software), the above-mentioned graphic elements include line segments, arcs, polygons, etc.
[0047] After the platform obtains the electronic drawing of the glue circuit, it can use element analysis algorithms, models and other technologies corresponding to the drawing type of the electronic drawing of the glue circuit to perform element analysis on the electronic drawing of the glue circuit, thereby obtaining the graphic elements contained in the electronic drawing of the glue circuit.
[0048] For example, if the above-mentioned electronic drawing of the glue circuit is a CAD drawing, then an analysis algorithm for analyzing elements in a CAD drawing can be used to perform element analysis on the electronic drawing of the glue circuit to obtain the graphic elements contained in the electronic drawing of the glue circuit.
[0049] Step S103: determining a first glue path area in the glue path electronic drawing according to the obtained element information of the graphic element.
[0050] The element information of the graphic element may include the size, position, color, logo, element type, and expression representing the graphic element, etc.
[0051] Specifically, according to the element information of the obtained graphic element, the first glue path area in the glue path electronic drawing may be determined in any one of the following three implementation methods.
[0052] In a first implementation manner, the first glue path area of the preset area shape in the glue path electronic drawing can be determined based on the element information of the graphic elements of the element type corresponding to the preset area shape in the obtained graphic elements.
[0053] The detailed description of this implementation method can be found in the subsequent embodiments and will not be described in detail here.
[0054] In the second implementation method, in the glue path electronic drawing, the colors of the elements belonging to the glue path area can be distinguished from the colors of other elements, that is, the elements belonging to the glue path area are shown in a specific color, and other elements are shown in other colors. In this way, after parsing the graphic elements contained in the glue path electronic drawing, the elements with the specific color can be traversed in the obtained graphic elements, so as to determine that the area composed of the traversed elements is the first glue path area.
[0055] In the third implementation method, in the glue path electronic drawing, the elements belonging to the glue path area can be elements with identification. In this way, after parsing the graphic elements contained in the glue path electronic drawing, the elements with identification can be traversed in the obtained graphic elements, so as to determine that the area composed of the traversed elements is the first glue path area.
[0056] Step S104: generating a glue path image including a second glue path area according to the first glue path area.
[0057] The second glue path area is converted from the first glue path area.
[0058] Specifically, according to the first glue road area, the glue road image may be generated in either of the following two implementations.
[0059] In the first implementation method, the first glue path area can be converted according to the conversion relationship between the unit size of the electronic drawing and the image pixel and the offset relationship between the drawing center and the image center of the glue path electronic drawing to generate a glue path image containing the second glue path area.
[0060] The detailed description of this implementation method can be found in the subsequent embodiments and will not be described in detail here.
[0061] In the second implementation method, after determining the first glue path area, the size ratio and position of the first glue path area in the glue path electronic drawing can be obtained, and then a glue path image containing the second glue path area can be generated based on the obtained size ratio and position, wherein the size ratio of the second glue path area in the glue path image is the same as the obtained size ratio, and the position of the second glue path area in the glue path image is the same as the obtained position.
[0062] Step S105: Displaying the glue path image.
[0063] After the glue path image is generated, the second glue path area contained in the glue path image can be regarded as the area to be detected of the glue path on the target product determined in the image of the target product. By displaying the glue path image, the user can know the area to be detected of the glue path on the target product.
[0064] As can be seen from the above, when applying the solution provided in the embodiments of the present application to determine the area to be inspected for the adhesive path on a product, elemental analysis is performed on the electronic drawing of the adhesive path of the target product to obtain the graphic elements contained in the electronic drawing of the adhesive path. Based on the elemental information of the obtained graphic elements, the first adhesive path area in the electronic drawing of the adhesive path can be accurately determined, and then an adhesive path image containing the second adhesive path area is generated based on the first adhesive path area. In this way, a solution for inspecting the adhesive path of the target product can be designed based on the second adhesive path area contained in the adhesive path image. As can be seen, the above process does not require the user to manually draw the area to be inspected, thereby improving the efficiency of determining the area and reducing the manual workload. In addition, this solution eliminates manual errors when manually drawing the area to be inspected, and can improve the accuracy of determining the area.
[0065] In one embodiment of the present application, after displaying the glue road image, the user can view the second glue road area contained in the glue road image and adjust the second glue road area based on their own experience. In this case, the platform can adjust the second glue road area in response to the adjustment operation on the second glue road area in the displayed glue road image.
[0066] Adjusting the second glue path area may include scaling, moving, rotating, etc. the second glue path area.
[0067] See also Figure 2b , showing a glue path image including a second glue path area, Figure 2b The various rectangular and arc-shaped areas are all second road regions in the road image. Users can view the road image on the platform and perform the aforementioned operations such as scaling, moving, and rotating each second road region in the road image. Upon detecting such operations, the platform can adjust the second road region in the displayed road image accordingly.
[0068] In this solution, after the platform displays the glue path image, the user can also adjust the second glue path area in the glue path image, so that the second glue path area can better meet the user's actual detection needs and improve the accuracy of the second glue path area.
[0069] The following describes the first implementation method of determining the first glue path area mentioned in the above step S103.
[0070] In one embodiment of the present application, when determining the first glue path area, the first glue path area of the preset area shape in the glue path electronic drawing is determined based on the element information of the graphic elements in the obtained graphic elements that belong to the element type corresponding to the preset area shape.
[0071] The above-mentioned area shape is a preset shape, for example, the above-mentioned area shape can be a rectangle, an arc, a polygon, a ring, a sector, etc.
[0072] The above element types may include line segment types, arc types, polygon types, and the like.
[0073] Closed areas in electronic drawings are formed by combining graphic elements. There's a correspondence between the shape of an area and the type of elements that make it up. Therefore, when determining the first glue path area, the element information of the graphic elements within the obtained image elements that belong to the element type corresponding to the preset area shape can accurately determine the first glue path area. Furthermore, based on this first glue path area, the area to be inspected on the target product can be determined, improving the accuracy of the determined area.
[0074] The following describes the correspondence between the preset area shapes and the element types of the graphic elements.
[0075] 1. The preset area shape is a rectangle
[0076] When the preset area shape is a rectangle, the element type corresponding to the preset area shape is a line segment type.
[0077] In this case, see Figure 3a , showing a rectangular area, from Figure 3a It can be seen that the rectangular area can be regarded as a combination of four line segments, that is, the rectangular area is a combination of four line segment type elements. Therefore, when determining the first glue path area, based on the element information of the line segment type graphic elements in the obtained graphic elements, the rectangular first glue path area in the glue path electronic drawing can be accurately determined, and then the area to be inspected on the target product can be determined based on the first glue path area, which can improve the accuracy of the determined area.
[0078] The specific implementation method of determining the first glue path area according to the element information of the line segment type graphic element can be found in the subsequent embodiments and will not be described in detail here.
[0079] 2. The preset area shape is arc
[0080] When the preset area shape is an arc, the element types corresponding to the preset area shape are a line segment type and an arc type.
[0081] In this case, see Figure 3b , showing an arc-shaped area, from Figure 3bIt can be seen that the arc area can be regarded as a combination of four line segments, that is, the rectangular area is a combination of four line segment type elements. Therefore, when determining the first glue path area, based on the element information of the line segment type and the arc type graphic element in the obtained graphic element, the arc-shaped first glue path area in the glue path electronic drawing can be accurately determined, and then the area to be inspected on the target product can be determined based on the first glue path area, which can improve the accuracy of the determined area.
[0082] The specific implementation method of determining the first glue path area according to the element information of the line segment type and the arc type graphic element can be found in the subsequent embodiments and will not be described in detail here.
[0083] 3. The preset area shape is polygon
[0084] In the case where the preset area shape is a polygon, the element type corresponding to the preset area shape is a polygon type.
[0085] In this case, see Figure 3c , showing a polygonal area, from Figure 3c It can be seen that the polygonal area has multiple edges, which are polygonal elements in the glue path electronic drawing. When determining the first glue path area, the polygonal first glue path area in the glue path electronic drawing can be accurately determined based on the element information of the polygonal graphic element in the obtained graphic element, and then the area to be inspected on the target product can be determined based on the first glue path area, which can improve the accuracy of the determined area.
[0086] When the shape of the preset area is other than a rectangle, an arc, and a polygon, the element type corresponding to the other shape can also be determined. Therefore, after the above-mentioned platform parses and obtains the graphic elements, the graphic elements of the determined element type can be screened out from the obtained graphic elements. According to the element information of the screened graphic elements, the first glue path area in the glue path electronic drawing can be accurately determined, and then the area to be inspected on the target product can be determined based on the first glue path area, which can improve the accuracy of the determined area.
[0087] The following describes a method for determining the first glue path area when the shape of the preset area is a rectangle.
[0088] In one embodiment of the present application, when determining the first glue path area, based on the element information of the first element of the line segment type in the parsed graphic elements, the rectangular area in the glue path electronic drawing whose four sides all belong to the first element is determined as the first glue path area.
[0089] From the aforementioned Figure 3aAs can be seen in the figure, the rectangular area can be considered a combination of four line segments, that is, a combination of four line segment-type elements. Therefore, based on the element information of the first element belonging to the line segment type, the rectangular area whose four sides all belong to the first element in the electronic drawing of the glue path can be accurately determined. Furthermore, since the glue path formed when the glue application device is applied in a single direction during glue application on the target product can be considered rectangular, using the above-determined rectangular area as the first glue path area can accurately determine the first glue path area. Furthermore, based on the first glue path area, the area to be inspected on the target product can be determined, thereby improving the accuracy of the determined area.
[0090] Specifically, according to the element information of the first element, the first glue path area may be determined in either of the following two implementations.
[0091] In the first implementation method, intersecting and perpendicular first element pairs can be determined among the first elements of the line segment type in the parsed graphic elements, and based on each first element pair, a rectangular area in the glue path electronic drawing whose four sides all belong to the first element is determined as the first glue path area.
[0092] For the convenience of description, the first element belonging to the line segment type is referred to as a line segment below.
[0093] In this implementation, the line segment parsed by the above platform (i.e., the first element belonging to the line segment type) can be regarded as a line segment in a line segment set. For every two line segments in the line segment set, it can be detected whether the two line segments intersect and are perpendicular. If the two line segments intersect and are perpendicular, it is determined that the two line segments constitute the first element pair.
[0094] When detecting whether two line segments intersect, since the line segments in the electronic drawing of the glue circuit can be expressed using formulas, the formulas of the two line segments to be detected can be combined into an equation group, and the equation group is solved. If the equation group has no solution, it means that the two line segments do not intersect. If the equation group has a solution, it means that the two line segments intersect.
[0095] When checking whether two line segments are perpendicular, you can multiply the slopes in the formulas of the two line segments. If the multiplication result is 1, it means that the two line segments are perpendicular. If the multiplication result is not 1, it means that the two line segments are not perpendicular.
[0096] After detecting all combinations of two line segments in the line segment set in the above manner, all first element pairs can be determined.
[0097] Since the rectangle can be considered to be composed of two pairs of first element pairs, after determining all the first element pairs, the rectangular area in the electronic drawing of the glue path whose four sides all belong to the first element can be accurately determined based on each first element pair, that is, the first glue path area can be accurately determined, and then the area to be inspected on the target product can be determined based on the first glue path area, which can improve the accuracy of the determined area.
[0098] The above implementation method of determining the first glue path area according to each first element pair can be found in subsequent embodiments and will not be described in detail here.
[0099] In the second implementation method, after obtaining the first element of the line segment type through parsing, that is, after obtaining the above-mentioned line segment set, the closed area enclosed by the line segments in the above-mentioned line segment set in the electronic drawing of the glue path can be retrieved. For each closed area retrieved, it can be detected again whether the number of line segments constituting the closed area is 4, and whether every two adjacent sides in the closed area are perpendicular. If the number of line segments constituting the closed area is 4, and every two adjacent sides in the closed area are perpendicular, it can be determined that the closed area is a rectangular first glue path area.
[0100] The following describes a method for determining the first glue path area based on each first element pair.
[0101] In one embodiment of the present application, after the above-mentioned platform determines the intersecting and perpendicular first element pairs, for each first element pair, it can determine a candidate rectangular area with two line segments in the first element pair as adjacent sides, eliminate the repeated rectangular areas and the target rectangular area in the candidate rectangular area, and use the remaining candidate rectangular areas as the first glue path area in the glue path electronic drawing.
[0102] The target rectangular area includes: a candidate rectangular area whose four sides do not all belong to the first element and / or a candidate rectangular area that includes other rectangular areas.
[0103] Specifically, the two line segments in each first element pair intersect and are perpendicular, and the intersection of the two line segments in the first element pair can be determined, and each line segment in the element pair has two endpoints, so that the intersection and one endpoint on each of the two line segments in the element pair can be used as the three endpoints of the candidate rectangular area, and based on the position information of these three endpoints of the candidate rectangular area, the last endpoint of the candidate rectangular area is determined, and thus the candidate rectangular area is determined based on these four endpoints.
[0104] For example, see Figure 4a 、 Figure 4b , Figure 4aTwo intersecting and perpendicular line segments m and n are shown in a first element pair, wherein point Pm1 and point Pm2 are the two endpoints of line segment m, point Pn1 and point Pn2 are the two endpoints of line segment n, and point Pmn is the intersection of line segment m and line segment n.
[0105] Figure 4b Shown according to Figure 4a The four candidate rectangular regions 1, 2, 3, and 4 are determined by the five points in . The following describes the process of determining the four candidate rectangular regions.
[0106] When determining the candidate rectangular area 1, point Pmn, point Pm1 and point Pn1 can be used as the three endpoints of the candidate rectangular area 1, and the last endpoint Pw1 of the candidate rectangular area 1 is determined based on these three endpoints. Point Pw1 and point Pm1 are connected, and point Pw1 and point Pn1 are connected to obtain the candidate rectangular area 1.
[0107] When determining the candidate rectangular area 2, point Pmn, point Pm1 and point Pn2 can be used as the three endpoints of the candidate rectangular area 1, and the last endpoint Pw2 of the candidate rectangular area 1 can be determined based on these three endpoints. Connect point Pw2 and point Pm1, and connect point Pw2 and point Pn2 to obtain the candidate rectangular area 2.
[0108] When determining the candidate rectangular area 3, point Pmn, point Pm2 and point Pn1 can be used as the three endpoints of the candidate rectangular area 1, and the last endpoint Pw3 of the candidate rectangular area 1 can be determined based on these three endpoints. Connect point Pw3 and point Pm2, and connect point Pw3 and point Pn1 to obtain the candidate rectangular area 3.
[0109] When determining the candidate rectangular area 4, point Pmn, point Pm2 and point Pn2 can be used as the three endpoints of the candidate rectangular area 1, and the last endpoint Pw4 of the candidate rectangular area 1 can be determined based on these three endpoints. Connect point Pw4 and point Pm2, and connect point Pw4 and point Pn2 to obtain the candidate rectangular area 4.
[0110] After performing the above processing on each first element pair, a plurality of candidate rectangular regions can be obtained. At this time, the following three processing methods can be used to process the obtained plurality of candidate rectangular regions.
[0111] In the first processing method, the multiple candidate rectangular regions are traversed to determine whether there are repeated rectangular regions. If so, the repeated and redundant rectangular regions are eliminated.
[0112] In the second processing method, for each candidate rectangular area, it is detected whether the four sides of the candidate rectangular area all belong to the first element. If there is at least one side that does not belong to the first element, that is, the four sides do not all belong to the first element, then it means that the candidate rectangular area is not obtained by combining the first elements. At this time, the candidate rectangular area is eliminated.
[0113] In the third processing method, for each candidate rectangular region, it is detected whether there are other rectangular regions in the candidate rectangular region.
[0114] After gluing a certain area on the product, the glue path formed will cover the entire area of the area, and in order to avoid wasting glue, the glue paths will not completely overlap. If a glue path area in the glue path electronic drawing contains another glue path area, the smaller glue path area in the two glue path areas will be repeatedly glued in the corresponding area on the product, that is, the glue paths in the corresponding areas on the product will completely overlap. Therefore, if other rectangular areas are detected in the candidate rectangular area, the candidate rectangular area will be eliminated.
[0115] The above three processing methods are executed in sequence, and the embodiments of the present application do not limit the execution order of the three processing methods. For example, the first processing method can be executed first, then the third processing method, and finally the second processing method, or the third processing method can be executed first, then the first processing method, and finally the second processing method, and so on.
[0116] It can be seen from the above that when the solution provided in the embodiment of the present application is applied to determine the area, after determining the candidate rectangular area for each first element pair, after eliminating the duplicate rectangular areas and the target rectangular areas, the remaining candidate rectangular areas are the first glue path areas that actually exist in the glue path electronic drawing, thereby determining the area to be inspected on the target product based on the first glue path area, which can improve the accuracy of the determined area.
[0117] In another embodiment of the present application, after the above-mentioned platform determines the intersecting and perpendicular first element pairs, it can determine, for each first element pair, a first target element pair in other first element pairs, the two line segments contained in which are different from the two line segments contained in the first element pair, and detect whether the two line segments in the first element pair are respectively intersecting and perpendicular to the two line segments in the first target element pair. If so, the rectangular area formed by the first element pair and the line segments contained in the first target element pair is determined to be the first glue path area.
[0118] The following describes a method for determining the first glue path area when the preset area is in an arc shape.
[0119] In one embodiment of the present application, when determining the first glue path area, a second element pair with a common center is determined among the elements of the arc type in the parsed graphic elements; a target element pair is screened among the obtained second element pairs; and an arc area formed by the two arcs in the target element pair and the line connecting the endpoints on the same side of the two arcs is determined as the first glue path area.
[0120] The line connecting the endpoints on the same side of the two arcs in the target element pair belongs to the first element.
[0121] The first element is: the element of the line segment type in the obtained graphic elements.
[0122] For ease of description, elements belonging to the arc type are referred to as arcs, and elements belonging to the line segment type are referred to as line segments.
[0123] Specifically, after parsing the graphic elements in the electronic drawing of the glue circuit, the arcs in the parsed graphic elements can be considered as arcs in an arc set, and the line segments in the parsed graphic elements can be considered as line segments in a line segment set. For the arc set, the center position information of each arc in the arc set can be determined, and each pair of arcs with the same center position information can be identified as a second element pair.
[0124] For example, if the position information of the centers of arcs 1, 2, and 3 are all the same, arc 1 and arc 2 constitute a second element pair, arc 2 and arc 3 constitute a second element pair, and arc 1 and arc 3 constitute a second element pair.
[0125] For each second element pair, the line segment between the endpoints on the same side of the two arcs contained in the second element pair can be determined based on the position information of the endpoints on the same side of the two arcs, and it can be judged whether the determined line segment belongs to the analyzed line segment. If it is judged that the endpoint line segments on both sides of the two arcs belong to the analyzed line segments, then the second element pair can be determined as the target element pair, and the arc area formed by the two arcs in the element pair and the line connecting the endpoints on the same side of the two arcs is determined as the first glue path area.
[0126] It can be seen from the above that when the solution provided in the embodiment of the present application is applied to determine the area, when the preset area shape is an arc, since the line between the endpoints on the same side of the two arcs in the target element pair belongs to the element of the line segment type obtained by analysis, the arc area formed by the two arcs in the target element pair and the line between the endpoints on the same side of the two arcs are all composed of elements in the drawing. In this way, the determined arc area is determined as the first glue path area, and the first glue path area can be accurately determined, so that the area to be inspected on the target product is determined based on the first glue path area, which can improve the accuracy of the determined area.
[0127] The first implementation method of generating the glue path image mentioned in the above step S104 is described below.
[0128] In one embodiment of the present application, when generating a glue path image, the size of each graphic element in the first glue path area is converted according to the conversion relationship between the unit size of the electronic drawing and the image pixel to obtain the second glue path area; according to the offset relationship between the drawing center and the image center of the glue path electronic drawing, the first glue path area is positionally offset to obtain the position of the second glue path area in the glue path image; and according to the obtained position, a glue path image including the second glue path area is generated.
[0129] The unit size of the electronic drawing may be centimeters, millimeters, etc.
[0130] The conversion relationship between the unit size of the electronic drawing and the image pixels can be set in advance, and the conversion relationship can be divided into two sub-conversion relationships, one of which is the conversion relationship between the length dimension of the electronic drawing and the pixels in the pixel column direction in the image, and the other is the conversion relationship between the width dimension of the electronic drawing and the pixels in the pixel row direction in the image.
[0131] Specifically, after determining the first glue path area in the glue path electronic drawing, the size of the first glue path area can be determined. According to the conversion relationship between the unit size of the above electronic drawing and the image pixel, the size of the first glue path area is converted to obtain the size of the second glue path area in the glue path image.
[0132] In addition, in the process of determining the area, the above-mentioned platform can, on the one hand, determine the position of the drawing center of the electronic glue road drawing after obtaining the electronic glue road drawing, and on the other hand, determine the position of the image center of the glue road image according to the preset size of the glue road image, thereby obtaining the offset relationship between the two centers based on the determined position of the drawing center of the electronic glue road drawing and the position of the image center of the glue road image, thereby after determining the first glue road area in the electronic glue road drawing, the first glue road area is positionally offset according to the offset relationship between the two centers, and the position of the offset first glue road area is obtained as the position of the second glue road area.
[0133] For example, the position of the drawing center can be expressed as its coordinates in a drawing coordinate system, which can be constructed with the drawing's length and width as the X-axis and Y-axis, respectively, and with the vertex at the lower left corner of the drawing as the origin. The position of the image center can be expressed as its coordinates in an image coordinate system, which can be constructed with the pixel rows and columns as the X-axis and Y-axis, respectively, and with the pixel at the lower left corner of the image as the origin. After obtaining the coordinates (X1, Y1) of the drawing center and the coordinates (X2, Y2) of the image center, the offset coefficients of these two centers on the X-axis and Y-axis can be calculated as X2 / X1, and the offset coefficient on the Y-axis can be calculated as Y2 / Y1. After determining the first glue path area, the X- and Y-axis positions of each element in the first glue path area can be offset based on the two offset coefficients calculated above. The offset position is then used as the position of the second glue path area.
[0134] After calculating the size and position of the second glue path area, a glue path image can be generated according to the size and position of the second glue path area. The area in the generated glue path image with the calculated size and position is the second glue path area.
[0135] It can be seen from the above that when the scheme provided in the embodiment of the present application is applied to determine the area, when generating the glue path image, the size of each graphic element in the first glue path area is converted according to the conversion relationship between the unit size of the electronic drawing and the image pixel, so that the second glue path area can be accurately obtained. According to the offset relationship between the drawing center and the image center of the glue path electronic drawing, the position of the first glue path area is offset, so that the position of the second glue path area in the glue path image can be accurately obtained. In this way, according to the obtained position, the glue path image containing the second glue path area can be accurately generated, so that the area to be inspected on the target product can be accurately determined based on the glue path image. Therefore, the application of the area determination scheme provided in the embodiment of the present application can improve the accuracy of area determination.
[0136] After the glue path image including the second glue path area is generated, further processing may be performed according to the methods mentioned in the following embodiments.
[0137] In one embodiment of the present application, after generating a glue road image including the second glue road area, a detection module for performing glue road detection on the second glue road area can be generated; the generated detection module is added to a preset glue road detection scheme template to obtain a detection scheme for performing glue road detection on the target product.
[0138] Among them, the above-mentioned glue path detection solution template is a preset solution template, which can include one or more algorithm modules, such as a module for color extraction of the input image, a module for image preprocessing, a module for matching the input image with the glue path image, etc.
[0139] Specifically, the platform can pre-store detection module templates corresponding to different area shapes, such as rectangles and arcs. These detection module templates can be created based on the blob analysis module. After generating a glue path image containing the second glue path area, for each second glue path area in the glue path image, a detection module template corresponding to the shape of the second glue path area can be determined. The determined template is then retrieved, and attribute information of the second glue path area, such as size and position, is written into the retrieved template to obtain a detection module for performing glue path detection on the second glue path area.
[0140] Add the generated inspection module to the glue path inspection plan template. By combining the various modules in the template with the generated inspection module, you can obtain a complete inspection plan for the glue path inspection of the target product. After the target product is glued, you can perform glue path inspection on the target product according to this inspection plan.
[0141] As can be seen from the above, when applying the solution provided in the embodiment of the present application to determine the area, after generating the glue road image, a detection module can be generated to perform glue road detection on the second glue road area in the glue road image. By adding the detection module to the glue road detection solution template, a more accurate detection solution for glue road detection of the target product can be obtained. Subsequently, the target product can be subjected to glue road detection based on the detection solution, and it can accurately detect whether there is a problem with the glue road on the target product, and determine whether the quality of the glue road on the target product meets the specifications.
[0142] In the case where the electronic drawing of the glue path includes multiple layers, the solution mentioned in the following embodiments can be used to determine the area.
[0143] In one embodiment of the present application, the electronic drawing of the glue path includes multiple layers, and the drawings in different layers are drawings for performing different types of glue path inspections on the target product.
[0144] The above-mentioned different types of glue line detection are used to detect different problems of the glue line. For example, different types of glue line detection methods can be used to detect problems such as glue breakage, glue overflow, and insufficient glue.
[0145] Different layers in the glue path electronic drawing correspond to different types of glue path inspections. Drawings on different layers are used to perform glue path inspections on the target product. For example, if Layer 1 corresponds to glue breakage inspection and is called the glue breakage inspection layer, and Layer 2 corresponds to glue overflow inspection and is called the glue overflow inspection layer, then the drawings in Layer 1 are used for glue breakage inspection on the target product, and the drawings in Layer 2 are used for glue overflow inspection on the target product.
[0146] In this case, when performing element analysis on the electronic drawing of the glue circuit, it is necessary to perform element analysis on the drawings in each layer contained in the electronic drawing of the glue circuit separately; when generating the detection module, the glue circuit detection type corresponding to the layer where the graphic element describing the second glue circuit area is located can be determined; and a detection module is generated to perform the determined type of glue circuit detection on the second glue circuit area.
[0147] Since the second glue path area is obtained by converting the first glue path area, there is a correspondence between the second glue path area and the first glue path area. Since the first glue path area is composed of graphic elements obtained by analysis, there is a correspondence between the second glue path area and the graphic elements that constitute the first glue path area. The graphic elements describing the second glue path area are the graphic elements corresponding to the second glue path area.
[0148] For each second glue road area in the glue road image, when generating a detection module for performing glue road detection on the second glue road area, the graphic element corresponding to the second glue road area in the glue road electronic image can be determined, and the layer where the graphic element is located can be determined, and then the glue road detection type corresponding to the layer where the graphic element is located can be determined. The glue road detection type is the glue road detection type corresponding to the layer where the graphic element describing the second glue road area is located.
[0149] The detection module templates stored in the platform can be further divided into templates corresponding to different area shapes and different adhesive path detection types. For each second adhesive path area, after the platform determines the adhesive path detection type corresponding to the layer containing the graphic elements describing the second adhesive path area, it can determine the detection module template corresponding to the area shape of the second adhesive path area and the determined adhesive path detection type in each detection module template. Attribute information of the second adhesive path area, such as size and position, is written into the determined template to obtain a detection module for performing adhesive path detection on the second adhesive path area.
[0150] As can be seen above, when applying the solution provided in the embodiments of this application to determine regions, if the electronic drawing of the adhesive path contains multiple layers, a detection module is generated for each second adhesive path region, which performs the corresponding type of adhesive path detection for that second adhesive path region. By adding the detection module to the adhesive path detection solution template, an accurate detection solution for adhesive path detection of the target product can be obtained. Furthermore, because the drawings in different layers are drawings for performing different types of adhesive path detection on the target product, the platform can implement multiple types of adhesive path detection by importing a single electronic drawing of the adhesive path containing multiple layers, thereby improving the convenience of region determination.
[0151] In one embodiment of the present application, see Figure 5 , provides a flow chart of a method for generating a glue path detection scheme. In this embodiment, the method includes the following steps S501-S508.
[0152] Step S501: in response to an import operation of an electronic drawing of a glue circuit for a target product, obtaining the electronic drawing of the glue circuit.
[0153] Step S502: performing element analysis on the electronic drawing of the glue circuit to obtain graphic elements contained in the electronic drawing of the glue circuit.
[0154] Step S503: determining a first glue path area in the glue path electronic drawing according to the obtained element information of the graphic element.
[0155] The above steps S501-S503 are respectively the same as the above steps S101-S103, and are not repeated here.
[0156] Step S504: converting the size of each graphic element in the first glue path area according to the conversion relationship between the unit size of the electronic drawing and the image pixel to obtain a second glue path area.
[0157] Step S505: performing a position shift on the first glue path area according to the offset relationship between the drawing center and the image center of the glue path electronic drawing to obtain the position of the second glue path area in the glue path image.
[0158] Step S506: generating a glue path image including the second glue path area according to the obtained position.
[0159] The description of steps S504 to S506 can be found in the description of the first implementation method of generating the glue path image mentioned in step S104, and will not be repeated here.
[0160] Step S507: generating a detection module for performing glue path detection on the second glue path area.
[0161] Step S508: Add the generated detection module to a preset glue path detection plan template to obtain a detection plan for performing glue path detection on the target product.
[0162] The description of steps S507-S508 can be found in the aforementioned method embodiment and will not be repeated here.
[0163] Corresponding to the aforementioned method for determining a glue path detection area, an embodiment of the present application also provides a device for determining a glue path detection area.
[0164] In one embodiment of the present application, see Figure 6 , provides a structural schematic diagram of a device for determining a glue road detection area. In this embodiment, the device includes:
[0165] The drawing acquisition module 601 is configured to acquire the electronic drawing of the glue path of the target product in response to an import operation of the electronic drawing of the glue path;
[0166] An element analysis module 602 is configured to perform element analysis on the electronic drawing of the glue circuit to obtain graphic elements contained in the electronic drawing of the glue circuit;
[0167] An area determination module 603 is configured to determine a first glue path area in the glue path electronic drawing according to the element information of the obtained graphic element;
[0168] An image generation module 604 is configured to generate a glue path image including a second glue path area based on the first glue path area, wherein the second glue path area is converted from the first glue path area;
[0169] The image display module 605 is used to display the glue path image.
[0170] As can be seen from the above, when applying the solution provided in the embodiments of the present application to determine the area to be inspected for the adhesive path on a product, elemental analysis is performed on the electronic drawing of the adhesive path of the target product to obtain the graphic elements contained in the electronic drawing of the adhesive path. Based on the elemental information of the obtained graphic elements, the first adhesive path area in the electronic drawing of the adhesive path can be accurately determined, and then an adhesive path image containing the second adhesive path area is generated based on the first adhesive path area. In this way, a solution for inspecting the adhesive path of the target product can be designed based on the second adhesive path area contained in the adhesive path image. As can be seen, the above process does not require the user to manually draw the area to be inspected, thereby improving the efficiency of determining the area and reducing the manual workload. In addition, this solution eliminates manual errors when manually drawing the area to be inspected, and can improve the accuracy of determining the area.
[0171] In one embodiment of the present application, the region determination module 603 includes:
[0172] The area determination submodule is used to determine the first glue path area of the preset area shape in the glue path electronic drawing based on the element information of the graphic elements belonging to the element type corresponding to the preset area shape in the obtained graphic elements.
[0173] In this solution, enclosed areas on electronic drawings are formed by combining graphic elements. The shape of an area on the electronic drawing corresponds to the type of elements that make it up. Therefore, when determining the first glue path area, the element information of the graphic elements within the obtained image elements that belong to the element type corresponding to the preset area shape can accurately determine the first glue path area. Furthermore, the area to be inspected on the target product can be determined based on the first glue path area, thereby improving the accuracy of the determined area.
[0174] In one embodiment of the present application, when the shape of the preset area is a rectangle, the element type corresponding to the shape of the preset area is a line segment type.
[0175] When determining the first glue path area, based on the element information of the line segment type graphic elements in the obtained graphic elements, the rectangular first glue path area in the glue path electronic drawing can be accurately determined, and then the area to be inspected on the target product can be determined based on the first glue path area, which can improve the accuracy of the determined area.
[0176] In one embodiment of the present application, when the shape of the preset area is an arc, the element types corresponding to the shape of the preset area are a line segment type and an arc type.
[0177] When determining the first glue path area, based on the element information of the line segment type and arc type graphic elements in the obtained graphic elements, the arc-shaped first glue path area in the glue path electronic drawing can be accurately determined, and then the area to be inspected on the target product can be determined based on the first glue path area, which can improve the accuracy of the determined area.
[0178] In one embodiment of the present application, when the preset area shape is a polygon, the element type corresponding to the preset area shape is a polygon type.
[0179] When determining the first glue path area, based on the element information of the polygonal type graphic elements in the obtained graphic elements, the polygonal first glue path area in the glue path electronic drawing can be accurately determined, and then the area to be inspected on the target product can be determined based on the first glue path area, which can improve the accuracy of the determined area.
[0180] In one embodiment of the present application, when the shape of the preset area is a rectangle, the area determination submodule includes:
[0181] The rectangle determining unit is used to determine, based on the element information of the first element of the line segment type in the obtained graphic elements, a rectangular area in the glue path electronic drawing whose four sides all belong to the first element as the first glue path area.
[0182] A rectangular area can be considered a combination of four line segments, that is, a combination of four line segment-type elements. Therefore, based on the element information of the first line segment-type element, a rectangular area in the electronic drawing of the glue path, whose four sides all belong to the first element, can be accurately determined. Furthermore, since the glue path formed when the glue application device is applied in a single direction on the target product can be considered rectangular, using the determined rectangular area as the first glue path area can accurately determine the first glue path area. Furthermore, based on the first glue path area, the area to be inspected on the target product can be determined, thereby improving the accuracy of the determined area.
[0183] In one embodiment of the present application, the rectangle determining unit includes:
[0184] An element pair determining subunit, configured to determine, among the first elements of the line segment type in the obtained graphic elements, a first pair of elements that intersect and are perpendicular to each other;
[0185] The area determination subunit is used to determine, based on each pair of first elements, a rectangular area in the electronic drawing of the glue path, whose four sides all belong to the first elements, as a first glue path area.
[0186] Since the rectangle can be considered to be composed of two pairs of first element pairs, after determining all the first element pairs, the rectangular area in the electronic drawing of the glue path whose four sides all belong to the first element can be accurately determined based on each first element pair, that is, the first glue path area can be accurately determined, and then the area to be inspected on the target product can be determined based on the first glue path area, which can improve the accuracy of the determined area.
[0187] In one embodiment of the present application, the region determination subunit is specifically configured to:
[0188] For each first element pair, determining a candidate rectangular region having two line segments in the first element pair as adjacent sides;
[0189] Eliminate duplicate rectangular areas and target rectangular areas in the candidate rectangular areas, and use the remaining candidate rectangular areas as the first glue path area in the glue path electronic drawing, wherein the target rectangular area includes: a candidate rectangular area whose four sides do not all belong to the first element and / or a candidate rectangular area containing other rectangular areas.
[0190] It can be seen from the above that when the solution provided in the embodiment of the present application is applied to determine the area, after determining the candidate rectangular area for each first element pair, after eliminating the duplicate rectangular areas and the target rectangular areas, the remaining candidate rectangular areas are the first glue path areas that actually exist in the glue path electronic drawing, thereby determining the area to be inspected on the target product based on the first glue path area, which can improve the accuracy of the determined area.
[0191] In one embodiment of the present application, when the shape of the preset area is an arc, the area determination submodule is specifically configured to:
[0192] Determine a second pair of elements with the same center among the arc type elements in the obtained graphic elements;
[0193] Selecting a target element pair from the obtained second element pair, wherein a line connecting the endpoints of two arcs on the same side of the target element pair belongs to a first element, and the first element is an element of a line segment type from the obtained graphic elements;
[0194] An arc region formed by the two arcs in the target element pair and a line connecting the endpoints on the same side of the two arcs is determined as a first glue path region.
[0195] It can be seen from the above that when the solution provided in the embodiment of the present application is applied to determine the area, when the preset area shape is an arc, since the line between the endpoints on the same side of the two arcs in the target element pair belongs to the element of the line segment type obtained by analysis, the arc area formed by the two arcs in the target element pair and the line between the endpoints on the same side of the two arcs are all composed of elements in the drawing. In this way, the determined arc area is determined as the first glue path area, and the first glue path area can be accurately determined, so that the area to be inspected on the target product is determined based on the first glue path area, which can improve the accuracy of the determined area.
[0196] In one embodiment of the present application, the image generation module is specifically configured to:
[0197] Convert the size of each graphic element in the first glue path area according to the conversion relationship between the unit size of the electronic drawing and the image pixel to obtain a second glue path area;
[0198] Performing a position shift on the first glue path area according to the offset relationship between the drawing center and the image center of the glue path electronic drawing to obtain the position of the second glue path area in the glue path image;
[0199] According to the obtained position, a glue path image including the second glue path area is generated.
[0200] It can be seen from the above that when the scheme provided in the embodiment of the present application is applied to determine the area, when generating the glue path image, the size of each graphic element in the first glue path area is converted according to the conversion relationship between the unit size of the electronic drawing and the image pixel, so that the second glue path area can be accurately obtained. According to the offset relationship between the drawing center and the image center of the glue path electronic drawing, the position of the first glue path area is offset, so that the position of the second glue path area in the glue path image can be accurately obtained. In this way, according to the obtained position, the glue path image containing the second glue path area can be accurately generated, so that the area to be inspected on the target product can be accurately determined based on the glue path image. Therefore, the application of the area determination scheme provided in the embodiment of the present application can improve the accuracy of area determination.
[0201] In one embodiment of the present application, the device further includes:
[0202] A first generating module is used to generate a detection module for performing glue road detection on the second glue road area;
[0203] The solution generation module is used to add the generated detection module to the preset glue path detection solution template to obtain a detection solution for performing glue path detection on the target product.
[0204] As can be seen from the above, when applying the solution provided in the embodiment of the present application to determine the area, after generating the glue road image, a detection module can be generated for glue road detection of the second glue road area in the glue road image, and the detection module can be added to the glue road detection solution template to obtain a detection solution for glue road detection of the target product. Subsequently, glue road detection of the target product can be achieved based on this detection solution.
[0205] In one embodiment of the present application, the electronic drawing of the adhesive path includes multiple layers, and the drawings in different layers are drawings for performing different types of adhesive path inspections on the target product;
[0206] The element parsing module is specifically used to:
[0207] Performing element analysis on the drawings in each layer included in the electronic drawings of the glue circuit;
[0208] The first generating module is specifically configured to:
[0209] Determine the glue path detection type corresponding to the layer where the graphic element describing the second glue path area is located;
[0210] A detection module is generated for performing glue path detection of the determined type on the second glue path area.
[0211] As can be seen from the above, when the solution provided in the embodiment of the present application is applied to determine the area, when the electronic drawing of the glue road contains multiple layers, for each second glue road area, a detection module is generated for performing the corresponding type of glue road detection on the second glue road area, thereby adding the detection module to the glue road detection solution template, and accurately obtaining the detection solution for glue road detection of the target product.
[0212] In one embodiment of the present application, the device further includes:
[0213] The area adjustment module is used to adjust the second glue path area in response to an adjustment operation on the second glue path area in the displayed glue path image.
[0214] In this solution, after the platform displays the glue path image, the user can also adjust the second glue path area in the glue path image, so that the second glue path area can better meet the user's actual detection needs and improve the accuracy of the second glue path area.
[0215] In the technical solution of this application, the operations involved in obtaining, storing, using, processing, transmitting, providing and disclosing user personal information are all carried out with the user's authorization.
[0216] It should be noted that the head model in this embodiment is not a head model for a specific user and cannot reflect the personal information of a specific user.
[0217] It should be noted that the two-dimensional face images in this embodiment come from a public dataset.
[0218] The present application also provides an electronic device, such as Figure 7 Shown, including:
[0219] Memory 701, used for storing computer programs;
[0220] The processor 702 is configured to execute the program stored in the memory 701, and implement the following steps:
[0221] In response to an import operation of an electronic drawing of a glue path for a target product, obtaining the electronic drawing of the glue path;
[0222] Performing element analysis on the electronic drawing of the glue circuit to obtain graphic elements contained in the electronic drawing of the glue circuit;
[0223] determining a first glue path area in the glue path electronic drawing according to the obtained element information of the graphic element;
[0224] generating a glue path image including a second glue path area according to the first glue path area, wherein the second glue path area is converted from the first glue path area;
[0225] The glue path image is displayed.
[0226] Furthermore, the electronic device may further include a communication bus and / or a communication interface, and the processor 702, the communication interface, and the memory 701 communicate with each other via the communication bus.
[0227] The communication bus mentioned in the electronic device mentioned above may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. This communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is used in the figure, but this does not mean that there is only one bus or only one type of bus.
[0228] The communication interface is used for communication between the above electronic device and other devices.
[0229] The memory may include random access memory (RAM) or non-volatile memory (NVM), such as at least one disk storage. Alternatively, the memory may be at least one storage device located away from the processor.
[0230] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0231] In another embodiment provided in the present application, a computer-readable storage medium is further provided, wherein a computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, the steps of any of the above-mentioned area determination methods are implemented.
[0232] In another embodiment provided by the present application, a computer program product including instructions is also provided, which, when executed on a computer, enables the computer to execute any area determination method in the above embodiments.
[0233] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from one website, computer, server or data center to another website, computer, server or data center via a wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) method. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrations. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a solid-state drive (SSD).
[0234] It should be noted that, in this document, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply the existence of any such actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or device comprising the element.
[0235] Each embodiment in this specification is described in a related manner. Similar portions between embodiments can be referenced to each other. Each embodiment focuses on the differences between other embodiments. In particular, since the apparatus, electronic device, computer-readable storage medium, and computer program product embodiments are generally similar to the method embodiments, their descriptions are relatively simplified. For related portions, reference can be made to the descriptions of the method embodiments.
[0236] The above description is only a preferred embodiment of the present application and is not intended to limit the scope of protection of the present application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present application are included in the scope of protection of the present application.
Claims
1. A method for determining a glue road detection area, characterized in that: The method comprises: In response to an import operation of an electronic drawing of a glue path for a target product, obtaining the electronic drawing of the glue path; Performing element analysis on the electronic drawing of the glue circuit to obtain graphic elements contained in the electronic drawing of the glue circuit; determining a first glue path area in the glue path electronic drawing according to the obtained element information of the graphic element; generating a glue path image including a second glue path area according to the first glue path area, wherein the second glue path area is converted from the first glue path area; The glue path image is displayed.
2. The method according to claim 1, characterized in that The step of determining the first glue path area in the glue path electronic drawing according to the obtained element information of the graphic element includes: According to the element information of the graphic elements belonging to the element type corresponding to the preset area shape in the obtained graphic elements, the first glue path area of the preset area shape in the glue path electronic drawing is determined.
3. The method according to claim 2, characterized in that In the case where the shape of the preset area is a rectangle, the element type corresponding to the shape of the preset area is a line segment type; and / or In the case where the shape of the preset area is an arc, the element type corresponding to the shape of the preset area is a line segment type and an arc type; and / or In the case where the preset area shape is a polygon, the element type corresponding to the preset area shape is a polygon type.
4. The method according to claim 3, characterized in that In a case where the shape of the preset area is a rectangle, determining the first glue path area of the preset area shape in the glue path electronic drawing according to the element information of the graphic elements belonging to the element type corresponding to the preset area shape in the obtained graphic elements includes: According to the element information of the first element of the line segment type in the obtained graphic elements, a rectangular area in the glue path electronic drawing whose four sides all belong to the first element is determined as the first glue path area.
5. The method according to claim 4, characterized in that The step of determining, based on the element information of the first element of the line segment type in the obtained graphic elements, a rectangular area in the electronic drawing of the glue path, all four sides of which belong to the first element, as the first glue path area, includes: Among the first elements of the line segment type in the obtained graphic elements, determining the first intersecting and perpendicular element pairs; According to each pair of first elements, a rectangular area in the glue path electronic drawing, in which all four sides belong to the first elements, is determined as a first glue path area.
6. The method according to claim 5, characterized in that The step of determining, based on each pair of first elements, a rectangular area in the electronic drawing of the glue path, all four sides of which belong to the first elements, as the first glue path area includes: For each first element pair, determining a candidate rectangular region having two line segments in the first element pair as adjacent sides; Eliminate duplicate rectangular areas and target rectangular areas in the candidate rectangular areas, and use the remaining candidate rectangular areas as the first glue path area in the glue path electronic drawing, wherein the target rectangular area includes: a candidate rectangular area whose four sides do not all belong to the first element and / or a candidate rectangular area containing other rectangular areas.
7. The method according to claim 3, characterized in that In the case where the preset area shape is an arc, determining the first glue path area of the preset area shape in the glue path electronic drawing according to the element information of the graphic elements belonging to the element type corresponding to the preset area shape in the obtained graphic elements includes: Determine a second pair of elements with the same center among the arc type elements in the obtained graphic elements; Selecting a target element pair from the obtained second element pair, wherein a line connecting the endpoints of two arcs on the same side of the target element pair belongs to a first element, and the first element is an element of a line segment type from the obtained graphic elements; An arc region formed by the two arcs in the target element pair and a line connecting the endpoints on the same side of the two arcs is determined as a first glue path region.
8. The method according to any one of claims 1 to 7, characterized in that Generating a glue path image including a second glue path area according to the first glue path area includes: Convert the size of each graphic element in the first glue path area according to the conversion relationship between the unit size of the electronic drawing and the image pixel to obtain a second glue path area; Performing a position shift on the first glue path area according to the offset relationship between the drawing center and the image center of the glue path electronic drawing to obtain the position of the second glue path area in the glue path image; According to the obtained position, a glue path image including the second glue path area is generated.
9. The method according to any one of claims 1 to 7, characterized in that The method further comprises: generating a detection module for performing glue road detection on the second glue road area; The generated detection module is added to the preset glue path detection scheme template to obtain a detection scheme for performing glue path detection on the target product.
10. The method according to claim 9, characterized in that The electronic drawing of the glue path includes multiple layers, and the drawings in different layers are drawings for performing different types of glue path tests on the target product; The element analysis of the electronic drawing of the glue circuit includes: Performing element analysis on the drawings in each layer included in the electronic drawings of the glue circuit; The generating of the detection module for performing glue path detection on the second glue path area includes: Determine the glue path detection type corresponding to the layer where the graphic element describing the second glue path area is located; A detection module is generated for performing glue path detection of the determined type on the second glue path area.
11. The method according to any one of claims 1 to 7, characterized in that The method further comprises: In response to an adjustment operation on the second glue path area in the displayed glue path image, the second glue path area is adjusted.
12. A device for determining a glue road detection area, characterized in that: The device comprises: A drawing acquisition module, configured to acquire the electronic drawing of the glue path in response to an import operation of the electronic drawing of the glue path of the target product; An element analysis module, configured to perform element analysis on the electronic drawing of the glue circuit to obtain graphic elements contained in the electronic drawing of the glue circuit; an area determination module, configured to determine a first glue path area in the glue path electronic drawing according to the element information of the obtained graphic element; an image generation module, configured to generate a glue path image including a second glue path area based on the first glue path area, wherein the second glue path area is converted from the first glue path area; An image display module is used to display the glue path image.
13. The device according to claim 12, characterized in that The region determination module includes: a region determination submodule for determining a first glue path region of the preset region shape in the glue path electronic drawing based on element information of graphic elements belonging to an element type corresponding to the preset region shape among the obtained graphic elements; and / or In the case where the shape of the preset area is a rectangle, the element type corresponding to the shape of the preset area is a line segment type; and / or In the case where the shape of the preset area is an arc, the element type corresponding to the shape of the preset area is a line segment type and an arc type; and / or In the case where the shape of the preset area is a polygon, the element type corresponding to the shape of the preset area is a polygon type; and / or In the case where the shape of the preset area is a rectangle, the area determination submodule includes: a rectangle determination unit configured to determine, based on element information of a first element belonging to a line segment type in the obtained graphic element, a rectangular area in the electronic drawing of the glue path, all four sides of which belong to the first element, as a first glue path area; and / or The rectangle determination unit includes: an element pair determination subunit for determining intersecting and perpendicular first element pairs from among the first elements of the line segment type in the obtained graphic elements; and an area determination subunit for determining, based on each first element pair, a rectangular area in the electronic drawing of the glue path, the four sides of which all belong to the first elements, as a first glue path area. and / or The region determination subunit is specifically configured to: for each first element pair, determine a candidate rectangular region having two line segments in the first element pair as adjacent sides; eliminate duplicate rectangular regions and target rectangular regions from the candidate rectangular regions, and use the remaining candidate rectangular regions as the first glue path region in the glue path electronic drawing, wherein the target rectangular region includes: a candidate rectangular region whose four sides do not all belong to the first elements and / or a candidate rectangular region that includes other rectangular regions; and / or In the case where the shape of the preset area is an arc, the area determination submodule is specifically configured to: determine a second element pair with a common center among the elements of the arc type in the obtained graphic elements; screen a target element pair from the obtained second element pairs, wherein a line connecting the endpoints on the same side of two arcs in the target element pair belongs to a first element, and the first element is an element of the line segment type in the obtained graphic elements; and determine an arc area formed by the two arcs in the target element pair and the line connecting the endpoints on the same side of the two arcs as a first glue path area; and / or The image generation module is specifically configured to: convert the size of each graphic element in the first glue path area according to the conversion relationship between the unit size of the electronic drawing and the image pixel to obtain the second glue path area; perform a position shift on the first glue path area according to the offset relationship between the drawing center and the image center of the glue path electronic drawing to obtain the position of the second glue path area in the glue path image; and generate a glue path image including the second glue path area according to the obtained position; and / or The device further includes: a first generation module for generating a detection module for performing glue road detection on the second glue road area; a solution generation module for adding the generated detection module to a preset glue road detection solution template to obtain a detection solution for performing glue road detection on the target product; and / or The electronic glue path drawing includes multiple layers, and the drawings in different layers are drawings for performing different types of glue path inspections on the target product. The element analysis module is specifically used to: perform element analysis on the drawings in each layer included in the electronic glue path drawing. The first generation module is specifically used to: determine the glue path inspection type corresponding to the layer where the graphic element describing the second glue path area is located; and generate a detection module for performing the determined type of glue path inspection on the second glue path area. and / or The apparatus further includes: an area adjustment module configured to adjust the second glue path area in response to an adjustment operation on the second glue path area in the displayed glue path image.
14. An electronic device, characterized in that: include: Memory for storing computer programs; A processor, configured to implement the method according to any one of claims 1 to 11 when executing a program stored in a memory.
15. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 11 is implemented.