A printed circuit board size measurement method, device, terminal and storage medium
By preprocessing and clustering the printed circuit board image data and integrating the measurement units, the problem of low efficiency of existing equipment is solved, and a more efficient measurement process is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- GUANGDONG ZHENGYE TECH CO LTD
- Filing Date
- 2023-05-18
- Publication Date
- 2026-05-15
AI Technical Summary
Existing printed circuit board measurement equipment suffers from excessively large full-image size and numerous measurement points, resulting in long point-finding times, high measurement time overhead, low efficiency, and a high degree of dependence on hardware performance.
By acquiring image data of the actual printed circuit board, the image data is preprocessed to extract edge contours, obtain standard graphic information and locate it, and cluster analysis is used to integrate the measured units, thereby reducing template matching time and improving equipment efficiency.
It reduces the time overhead of template matching, improves device operating efficiency, and reduces the dependence on hardware.
Smart Images

Figure CN116563259B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of printed circuit board (PCB) dimension measurement, and more particularly to a method, apparatus, terminal, and storage medium for measuring PCB dimensions. Background Technology
[0002] With the increasing prevalence of printed circuit board (PCB) dimensional measurement equipment, the efficiency of traditional measurement devices (such as 2D measuring machines) can no longer meet customer needs. Full-image scanning measurement equipment is the future trend in measurement equipment.
[0003] Full-image scanning equipment places the object to be measured on a platform, loads pre-prepared data, and uses a line scan camera to acquire a full image of the object. Based on the information in the data, measurements are performed on each measurement unit on the full image. In actual measurement, due to the large size of the full image, the large number of measurement points, and the long point-finding (template matching) time, the overall measurement process is time-consuming, inefficient, and highly dependent on hardware performance.
[0004] Therefore, existing technologies still need improvement and development. Summary of the Invention
[0005] The technical problem to be solved by the present invention is to provide a method, device, terminal and storage medium for measuring the size of printed circuit boards, in view of the above-mentioned defects of the prior art. The aim is to solve the problems of the prior art, which are that the full image is too big, there are many measurement points, the point search time is long, the measurement time is large and the efficiency is low, and the dependence on hardware performance is high.
[0006] The technical solution adopted by this invention to solve the problem is as follows:
[0007] In a first aspect, embodiments of the present invention provide a method for measuring the dimensions of a printed circuit board, wherein the method includes:
[0008] Acquire image data of the measured printed circuit board, and preprocess the image data to obtain preprocessed image data;
[0009] Edge contour extraction is performed on the preprocessed image data to determine the measured graphic information;
[0010] Obtain standard graphic information, locate the measured graphic in the measured graphic information based on the standard graphic information and the measured graphic information, and obtain updated measured graphic information;
[0011] Based on the updated measured image information, cluster analysis is performed on the measured images to determine several measured units, wherein each measured unit is an image category, and each image category includes several measured images and updated measured image information corresponding to the several measured images;
[0012] Obtain the unit under test, and determine the measurement data corresponding to the unit under test based on the unit under test and the measured unit.
[0013] In one implementation, the preprocessing of the image data to obtain preprocessed image data includes:
[0014] The image data is binarized to obtain binarized image data;
[0015] The binarized image data is denoised to obtain the preprocessed image data.
[0016] In one implementation method, the step of extracting edge contours from the preprocessed image data to determine the measured graphic information includes:
[0017] Edge contour extraction is performed on the preprocessed image data to obtain the measured graphic contour point set;
[0018] The measured graphic information is determined based on the set of points representing the measured graphic contour.
[0019] In one implementation method, locating the measured graphic in the measured graphic information based on the standard graphic information and the measured graphic information includes:
[0020] Based on the measured graphic information, determine the minimum outer matrix corresponding to each measured graphic;
[0021] Based on each of the minimum bounding matrices, a number of image reference circles corresponding to each of the minimum bounding matrices are determined, wherein each of the image reference circles is the maximum inscribed circle at each corner of the minimum bounding matrix;
[0022] Based on the aforementioned standard graphic information, several standard reference circles are determined;
[0023] The measured graphic is initially positioned based on the standard reference circle and the image reference circle.
[0024] In one implementation method, determining the minimum bounding matrix corresponding to each measured graphic based on the measured graphic information includes:
[0025] Based on the measured graphic information, determine several boundary points corresponding to each measured graphic;
[0026] Based on each of the boundary points, determine the minimum outer matrix corresponding to each of the measured patterns.
[0027] In one implementation method, the preliminary positioning of the measured graphic based on each of the standard reference circles and each of the image reference circles includes:
[0028] Calculate the center of the standard reference circle corresponding to each of the aforementioned standard reference circles and the center of the image reference circle corresponding to each of the aforementioned image reference circles;
[0029] The average offset of the measured graphic is determined based on the center of each standard reference circle and the center of each image reference circle.
[0030] The measured image is initially located based on the average offset.
[0031] In one implementation method, the measured unit includes measured shape information and measured coordinate information corresponding to the measured graphic, and the unit to be measured includes measured coordinate information corresponding to the graphic to be measured. The step of determining the measurement data corresponding to the unit to be measured based on the unit to be measured and the measured unit includes:
[0032] Compare the measured coordinate information corresponding to each measured graphic in the measured unit with the measured coordinate information corresponding to each measured graphic in the test unit;
[0033] When the geometric distance between the measured coordinate information and the coordinate information to be measured is less than a preset threshold, the measurement data of the graphic to be measured in the unit to be measured is determined according to the updated measured graphic information.
[0034] Secondly, embodiments of the present invention also provide a dimensional measuring device for printed circuit boards, wherein the dimensional measuring device for printed circuit boards includes:
[0035] The preprocessing module is used to acquire image data of the measured printed circuit board, and to preprocess the image data to obtain preprocessed image data.
[0036] The contour extraction module is used to extract edge contours from the preprocessed image data to determine the measured graphic information;
[0037] The positioning module is used to acquire standard graphic information, locate the measured graphic in the measured graphic information according to the standard graphic information and the measured graphic information, and obtain updated measured graphic information.
[0038] The clustering analysis module is used to perform clustering analysis on the measured graphics based on the updated measured graphics information to determine several measured units, wherein each measured unit is an image category, and each image category includes several measured graphics and updated measured graphics information corresponding to the several measured graphics;
[0039] The data determination module is used to acquire the unit under test and determine the measurement data corresponding to the unit under test based on the unit under test and the measured unit.
[0040] Thirdly, embodiments of the present invention also provide a terminal, characterized in that the terminal includes a memory and one or more processors; the memory stores one or more programs; the programs include instructions for performing the printed circuit board dimension measurement method as described above; and the processor is used to execute the programs.
[0041] Fourthly, embodiments of the present invention also provide a computer-readable storage medium storing a plurality of instructions, wherein the instructions are adapted to be loaded and executed by a processor to implement any of the printed circuit board dimension measurement methods described above.
[0042] The beneficial effects of this invention are as follows: In this embodiment, the invention acquires image data of a measured printed circuit board, preprocesses the image data to obtain preprocessed image data, extracts the edge contours of the preprocessed image data to obtain measured graphic information, acquires standard graphic information, and locates the measured graphic in the measured graphic information based on the standard graphic information and the measured graphic information to obtain updated measured graphic information, performs cluster analysis on the measured graphics based on the updated measured graphic information to determine several measured units, acquires the unit to be measured, and determines the measurement data corresponding to the unit to be measured based on the unit to be measured and the measured units. Because this invention uses edge contour extraction and cluster analysis to integrate different types of measured images to obtain measured units, and then measures each measured unit, it reduces the time overhead of template matching, improves equipment operating efficiency, and reduces the dependence on hardware. Attached Figure Description
[0043] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0044] Figure 1 This is a flowchart illustrating the method for measuring the dimensions of a printed circuit board provided in an embodiment of the present invention.
[0045] Figure 2 This is a schematic diagram of the internal modules of the printed circuit board size measuring device provided in an embodiment of the present invention.
[0046] Figure 3 This is a schematic diagram of the terminal provided in the embodiment of the present invention. Detailed Implementation
[0047] This invention discloses a method, apparatus, terminal, and storage medium for measuring the dimensions of printed circuit boards. To make the objectives, technical solutions, and effects of this invention clearer and more explicit, the invention is further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only for explaining the invention and are not intended to limit the invention.
[0048] Those skilled in the art will understand that, unless specifically stated otherwise, the singular forms “a,” “an,” “the,” and “the” used herein may also include the plural forms. It should be further understood that the term “comprising” as used in this specification means the presence of the stated features, integers, steps, operations, elements, and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or groups thereof. It should be understood that when we say an element is “connected” or “coupled” to another element, it can be directly connected or coupled to the other element, or there may be intermediate elements. Furthermore, “connected” or “coupled” as used herein can include wireless connections or wireless coupling. The term “and / or” as used herein includes all or any units and all combinations of one or more associated listed items.
[0049] It will be understood by those skilled in the art that, unless otherwise defined, all terms used herein (including technical and scientific terms) have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains. It should also be understood that terms such as those defined in general dictionaries should be understood to have the same meaning as in the context of the prior art, and should not be interpreted in an idealized or overly formal sense unless specifically defined as herein.
[0050] With the increasing prevalence of printed circuit board (PCB) dimensional measurement equipment, the efficiency of traditional measurement devices (such as 2D measuring machines) can no longer meet customer needs. Full-image scanning measurement equipment is the future trend in measurement equipment.
[0051] Full-image scanning equipment places the object to be measured on a platform, loads pre-prepared data, and uses a line scan camera to acquire a full image of the object. Based on the information in the data, measurements are performed on each measurement unit on the full image. In actual measurement, due to the large size of the full image, the large number of measurement points, and the long point-finding (template matching) time, the overall measurement process is time-consuming, inefficient, and highly dependent on hardware performance.
[0052] To address the aforementioned deficiencies in existing technologies, this invention provides a method for measuring the dimensions of printed circuit boards (PCBs). The method involves acquiring image data of the measured PCB, preprocessing the image data to obtain preprocessed image data, extracting the edge contours of the preprocessed image data to obtain measured graphic information, acquiring standard graphic information, locating the measured graphic information within the measured graphic information based on the standard graphic information and the measured graphic information, obtaining updated measured graphic information, performing cluster analysis on the measured graphic information based on the updated measured graphic information to determine several measured units, acquiring the unit to be measured, and determining the corresponding measurement data for the unit to be measured based on the unit to be measured and the measured units. Because this invention employs edge contour extraction and cluster analysis to integrate different types of measured images to obtain measured units, and then measures each measured unit, it reduces the time overhead of template matching, improves equipment operating efficiency, and reduces dependence on hardware.
[0053] Exemplary methods
[0054] like Figure 1 As shown, the method includes:
[0055] Step S100: Obtain image data of the actual printed circuit board, and preprocess the image data to obtain preprocessed image data.
[0056] In simple terms, to obtain data from a printed circuit board (PCB), it needs to be inspected. The PCB being tested is the one currently being inspected. In this embodiment, a line scan camera is used to capture a full image of the PCB being tested, obtaining image data of the PCB. This image data is then preprocessed to obtain preprocessed image data, thereby improving the efficiency and accuracy of subsequent data processing.
[0057] In one implementation, the preprocessing of the image data to obtain preprocessed image data includes:
[0058] Step S101: Perform binarization processing on the image data to obtain binarized image data;
[0059] Step S102: Denoise the binarized image data to obtain the preprocessed image data.
[0060] Specifically, the preprocessing method in this embodiment includes binarization and denoising. Image data is converted into binarized image data using a global threshold. Based on the area of the brown region in the binarized image data, background noise with an area less than 50 pixels is removed to obtain preprocessed image data. This embodiment reduces the memory usage of the resulting binarized image data to only one-eighth of the original image, thus reducing image size, computational load, and efficiency. Denoising also improves the success rate and accuracy of subsequent contour extraction.
[0061] Step S200: Extract edge contours from the preprocessed image data to determine the measured graphic information.
[0062] In short, the preprocessed image data contains a large amount of data. In order to reduce the time for subsequent template matching, this embodiment extracts the edge contours of the preprocessed image data to obtain the measured graphic information, which facilitates subsequent template matching and reduces the template matching time.
[0063] In one implementation, the step of extracting edge contours from the preprocessed image data to determine the measured graphic information includes:
[0064] Step S201: Extract edge contours from the preprocessed image data to obtain a set of measured graphic contour points;
[0065] Step S202: Determine the measured graphic information based on the measured graphic contour point set.
[0066] Specifically, this embodiment uses OpenCV's findContours function to extract the edge contours of the preprocessed image data, and employs the Teh-Chin chain approximation algorithm to extract the contour point set. This contour point set contains the coordinate information of each point on all contours in the image coordinates. Then, OpenCV's approxPolyDP is used to calculate the shape of the corresponding contour point set, as well as the coordinate and shape information of all shapes, to obtain the measured graphic information (e.g., the radius and center coordinates of a circle; the center coordinates, length, and width of a rectangle; the center coordinates and length of a line, etc.), and generates a set of measured graphics. Each set of measured graphics contains multiple measured graphics, such as all circles as a set.
[0067] Step S300: Obtain standard graphic information; based on the standard graphic information and the measured graphic information, locate the measured graphic in the measured graphic information to obtain updated measured graphic information.
[0068] In simple terms, after determining the measured graphic information and knowing the position of each measured graphic, matching can be performed based on the position of the measured graphics. This embodiment obtains standard graphic information, which records the position and shape information of each graphic. The measured graphics in the measured graphic information are matched and located based on the standard graphic information, and the located measured graphic information is used to update the measured graphic information. This embodiment matches and locates graphics directly rather than finding points on the original image, making the matching method simpler and faster, reducing the time overhead of template matching, and improving template efficiency.
[0069] In one implementation, locating the measured graphic in the measured graphic information based on the standard graphic information and the measured graphic information includes:
[0070] Step S301: Determine the minimum outer matrix corresponding to each measured graphic based on the measured graphic information;
[0071] Step S302: Based on each of the minimum bounding matrices, determine a number of image reference circles corresponding to each of the minimum bounding matrices, wherein each of the image reference circles is the maximum inscribed circle at each corner of the minimum bounding matrix;
[0072] Step S303: Determine several standard reference circles based on the standard graphic information;
[0073] Step S304: Based on the standard reference circle and the image reference circle, perform preliminary positioning of the measured graphic.
[0074] Specifically, since the measured graphic information contains multiple measured graphics and the coordinate information of each measured graphic, the minimum bounding matrix corresponding to each measured graphic can be determined based on the measured graphic information. To achieve preliminary positioning of each measured graphic, several image reference circles corresponding to the minimum bounding matrix of each measured graphic are determined. In this embodiment, there are generally four image reference circles, which are the largest inscribed circles corresponding to each of the four corners of the minimum bounding matrix. After finding each image reference circle, the contour information of each image reference circle is recorded, including the coordinate information of each point on the contour. Similarly, the standard reference circle corresponding to each standard graphic can be determined based on the standard graphic information. Then, the standard reference circle and the image reference circle are compared and matched to achieve preliminary positioning of the measured graphic. This embodiment calculates the image reference circle corresponding to each measured graphic and performs matching and positioning by comparing the image reference circle and the standard reference circle, further reducing the points that need to be compared during the matching process, reducing the amount of computation, and improving the positioning efficiency.
[0075] In one implementation, determining the minimum bounding matrix corresponding to each measured graphic based on the measured graphic information includes:
[0076] Step S3011: Based on the measured graphic information, determine several boundary points corresponding to each measured graphic;
[0077] Step S3012: Determine the minimum outer matrix corresponding to each measured pattern based on the boundary points.
[0078] Specifically, since the measured graphic information contains the coordinate information of each measured graphic, the first step is to determine several boundary points corresponding to each measured graphic based on its coordinate information. The number of boundary points is generally four. The method for determining the boundary points is as follows: find the point corresponding to the smallest X-coordinate, the point corresponding to the smallest Y-coordinate, the point corresponding to the largest X-coordinate, and the point corresponding to the largest Y-coordinate for each measured graphic. These four points are then used as the boundary points for the measured graphic. After obtaining the boundary points, the minimum external matrix corresponding to the measured graphic can be calculated based on these boundary points.
[0079] In one implementation, the preliminary positioning of the measured graphic based on each of the standard reference circles and each of the image reference circles includes:
[0080] Step S3041: Calculate the center of the standard reference circle corresponding to each of the standard reference circles and the center of the image reference circle corresponding to each of the image reference circles;
[0081] Step S3042: Determine the average offset of the measured graphic based on the center of each standard reference circle and the center of each image reference circle;
[0082] Step S3043: Perform preliminary positioning of the measured graphic based on the average offset.
[0083] Specifically, to more accurately achieve preliminary positioning of the measured graphic based on the image reference circle, this embodiment first calculates the center of the standard reference circle corresponding to the standard reference circle and the center of the image reference circle corresponding to the image reference circle. Then, based on the standard reference circle center and the image reference circle center, the average offset of the measured graphic is calculated. The average offset includes the average offset of the measured graphic in the X direction and the average offset in the Y direction. The calculation method is as follows: subtract the coordinates of the four standard reference circles from the coordinates of the four corresponding image reference circles to obtain the offsets in the four X directions and four Y directions. The average of the four X-direction offsets is taken as the average offset of the measured graphic in the X direction, and the average of the four Y-direction offsets is taken as the average offset of the measured graphic in the Y direction. Based on the obtained average offsets, the X coordinates of all points on the contour point set of the measured graphic are added to the offset in the X direction, and the Y coordinates are added to the average offset in the Y direction to achieve preliminary positioning of the measured graphic.
[0084] Step S400: Based on the updated measured image information, perform cluster analysis on the measured images to determine several measured units, wherein each measured unit is an image category, and each image category includes several measured images and updated measured image information corresponding to the several measured images.
[0085] Specifically, to facilitate the retrieval of each measured image, this embodiment performs cluster analysis on each measured image in the updated measured image information to obtain several image categories. Each image category includes several measured images and their corresponding updated measured image information, thereby determining several measured units. In this embodiment, cluster analysis can be performed on the measured images as a whole, or cluster analysis can be performed on the measured images in each set of measured images separately. For example, cluster analysis can be performed on a set of circles, and based on factors such as the size of the circles, they can be further divided into several circle categories, with each circle category serving as a measured unit.
[0086] Step S500: Obtain the unit under test, and determine the measurement data corresponding to the unit under test based on the unit under test and the measured unit.
[0087] In simple terms, the unit under test is the graphic that needs to be detected to obtain measurement data. In this embodiment, based on the unit under test, the type and quantity of the graphic to be detected, as well as the graphic measurement data to be obtained, can be obtained. The measured graphic contains relevant information of each measured graphic. Therefore, the required measurement data can be found and matched in the measured unit based on the unit under test, thereby determining the measurement data corresponding to the unit under test.
[0088] In one implementation, the measured unit includes measured shape information and measured coordinate information corresponding to the measured graphic, and the unit to be measured includes measured coordinate information corresponding to the graphic to be measured. The step of determining the measurement data corresponding to the unit to be measured based on the unit to be measured and the measured unit includes:
[0089] Step S501: Compare the measured coordinate information corresponding to each measured graphic in the measured unit with the measured coordinate information corresponding to each measured graphic in the test unit;
[0090] Step S502: When the geometric distance between the measured coordinate information and the coordinate information to be measured is less than a preset threshold, the measurement data of the graphic to be measured in the unit to be measured is determined according to the updated measured graphic information.
[0091] Specifically, the measured unit includes the updated measured shape information and measured coordinate information of the measured graphic positioning, while the unit to be measured also includes the measured coordinate information and measured shape information of the graphic to be measured. The measured coordinate information and the coordinate information to be measured are compared and analyzed, and the set distance between the coordinates is calculated. If the set distance between the measured coordinate information and the coordinate information to be measured is less than a preset threshold, the measured unit corresponding to the unit to be measured is retained, redundant measured units are deleted, and the updated measured graphic information of the measured unit is assigned to the unit to be measured as the measurement data corresponding to the unit to be measured. The measurement is completed when all measured units have been compared. This embodiment assigns the data of the measured unit to the past according to the needs of the unit to be measured, reducing the overall data exchange and improving speed.
[0092] Based on the above embodiments, the present invention also provides a dimensional measuring device for printed circuit boards, such as... Figure 2 As shown, the device includes:
[0093] Preprocessing module 01 is used to acquire image data of the measured printed circuit board, and preprocess the image data to obtain preprocessed image data;
[0094] Contour extraction module 02 is used to extract edge contours from the preprocessed image data to determine the measured graphic information;
[0095] The positioning module 03 is used to acquire standard graphic information, locate the measured graphic in the measured graphic information according to the standard graphic information and the measured graphic information, and obtain updated measured graphic information;
[0096] Clustering analysis module 04 is used to perform clustering analysis on the measured graphics based on the updated measured graphics information to determine several measured units, wherein each measured unit is an image category, and each image category includes several measured graphics and updated measured graphics information corresponding to several measured graphics.
[0097] The data determination module 05 is used to acquire the unit under test and determine the measurement data corresponding to the unit under test based on the unit under test and the measured unit.
[0098] Based on the above embodiments, the present invention also provides a terminal, the principle block diagram of which can be as follows: Figure 3 As shown, the terminal includes a processor, memory, network interface, and display screen connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The network interface is used for communication with external terminals via a network connection. When the computer program is executed by the processor, it implements a method for measuring the dimensions of printed circuit boards. The display screen can be a liquid crystal display (LCD) or an electronic ink display.
[0099] Those skilled in the art will understand that Figure 3 The schematic diagram shown is merely a partial structural diagram related to the present invention and does not constitute a limitation on the terminal to which the present invention is applied. A specific terminal may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0100] In one implementation, the terminal's memory stores one or more programs, and these programs are configured to be executed by one or more processors, and the programs contain instructions for performing a method for measuring the dimensions of a printed circuit board.
[0101] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided by this invention can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and RAMbus dynamic RAM (RDRAM), etc.
[0102] In summary, this invention discloses a method, apparatus, terminal, and storage medium for measuring the dimensions of printed circuit boards. The method involves acquiring image data of the measured printed circuit board, preprocessing the image data to obtain preprocessed image data, extracting the edge contours of the preprocessed image data to obtain measured graphic information, acquiring standard graphic information, locating the measured graphic in the measured graphic information based on the standard graphic information and the measured graphic information to obtain updated measured graphic information, performing cluster analysis on the measured graphics based on the updated measured graphic information to determine several measured units, acquiring the unit to be measured, and determining the corresponding measurement data for the unit to be measured based on the unit to be measured and the measured units. Because this invention uses edge contour extraction and cluster analysis to integrate different types of measured images to obtain measured units, and then measures each measured unit, it reduces the time overhead of template matching, improves equipment operating efficiency, and reduces the dependence on hardware.
[0103] It should be understood that the application of the present invention is not limited to the examples above. Those skilled in the art can make improvements or modifications based on the above description, and all such improvements and modifications should fall within the protection scope of the appended claims.
Claims
1. A method for measuring the dimensions of a printed circuit board, characterized in that, The method includes: Acquire image data of the measured printed circuit board, and preprocess the image data to obtain preprocessed image data; Edge contour extraction is performed on the preprocessed image data to determine the measured graphic information; Obtain standard graphic information, locate the measured graphic in the measured graphic information based on the standard graphic information and the measured graphic information, and obtain updated measured graphic information; Based on the updated measured image information, cluster analysis is performed on the measured images to determine several measured units, wherein each measured unit is an image category, and each image category includes several measured images and the updated measured image information corresponding to the several measured images; Obtain the unit under test, and determine the measurement data corresponding to the unit under test based on the unit under test and the measured unit; The step of locating the measured graphic in the measured graphic information based on the standard graphic information and the measured graphic information includes: Based on the measured graphic information, determine the minimum outer matrix corresponding to each measured graphic; Based on each of the minimum bounding matrices, a number of image reference circles corresponding to each of the minimum bounding matrices are determined, wherein each of the image reference circles is the maximum inscribed circle at each corner of the minimum bounding matrix; Based on the aforementioned standard graphic information, several standard reference circles are determined; The measured graphic is initially positioned based on the standard reference circle and the image reference circle. The measured unit includes measured shape information and measured coordinate information corresponding to the measured graphic; the unit to be measured includes measured coordinate information corresponding to the graphic to be measured; and determining the measurement data corresponding to the unit to be measured based on the unit to be measured and the measured unit includes: Compare the measured coordinate information corresponding to each measured graphic in the measured unit with the measured coordinate information corresponding to each measured graphic in the test unit; When the geometric distance between the measured coordinate information and the coordinate information to be measured is less than a preset threshold, the measurement data of the graphic to be measured in the unit to be measured is determined according to the updated measured graphic information.
2. The method for measuring the dimensions of a printed circuit board according to claim 1, characterized in that, The preprocessing of the image data to obtain preprocessed image data includes: The image data is binarized to obtain binarized image data; The binarized image data is denoised to obtain the preprocessed image data.
3. The method for measuring the dimensions of a printed circuit board according to claim 1, characterized in that, The step of extracting edge contours from the preprocessed image data to determine the measured graphic information includes: Edge contour extraction is performed on the preprocessed image data to obtain the measured graphic contour point set; The measured graphic information is determined based on the set of points representing the measured graphic contour.
4. The method for measuring the dimensions of a printed circuit board according to claim 1, characterized in that, The step of determining the minimum bounding matrix corresponding to each measured graphic based on the measured graphic information includes: Based on the measured graphic information, determine several boundary points corresponding to each measured graphic; Based on each of the boundary points, determine the minimum outer matrix corresponding to each of the measured patterns.
5. The method for measuring the dimensions of a printed circuit board according to claim 4, characterized in that, The preliminary positioning of the measured graphic based on each of the standard reference circles and each of the image reference circles includes: Calculate the center of the standard reference circle corresponding to each of the aforementioned standard reference circles and the center of the image reference circle corresponding to each of the aforementioned image reference circles; The average offset of the measured graphic is determined based on the center of each standard reference circle and the center of each image reference circle. The measured image is initially located based on the average offset.
6. A device for measuring the dimensions of a printed circuit board, characterized in that, The device includes: The preprocessing module is used to acquire image data of the measured printed circuit board, and to preprocess the image data to obtain preprocessed image data. The contour extraction module is used to extract edge contours from the preprocessed image data to determine the measured graphic information; The positioning module is used to acquire standard graphic information, locate the measured graphic in the measured graphic information according to the standard graphic information and the measured graphic information, and obtain updated measured graphic information. The clustering analysis module is used to perform clustering analysis on the measured graphics based on the updated measured graphics information to determine a number of measured units, wherein each measured unit is an image category, and each image category includes a number of measured graphics and the updated measured graphics information corresponding to the number of measured graphics; The data determination module is used to acquire the unit under test and determine the measurement data corresponding to the unit under test based on the unit under test and the measured unit. The step of locating the measured graphic in the measured graphic information based on the standard graphic information and the measured graphic information includes: Based on the measured graphic information, determine the minimum outer matrix corresponding to each measured graphic; Based on each of the minimum bounding matrices, a number of image reference circles corresponding to each of the minimum bounding matrices are determined, wherein each of the image reference circles is the maximum inscribed circle at each corner of the minimum bounding matrix; Based on the aforementioned standard graphic information, several standard reference circles are determined; The measured graphic is initially positioned based on the standard reference circle and the image reference circle. The measured unit includes measured shape information and measured coordinate information corresponding to the measured graphic; the unit to be measured includes measured coordinate information corresponding to the graphic to be measured; and determining the measurement data corresponding to the unit to be measured based on the unit to be measured and the measured unit includes: Compare the measured coordinate information corresponding to each measured graphic in the measured unit with the measured coordinate information corresponding to each measured graphic in the test unit; When the geometric distance between the measured coordinate information and the coordinate information to be measured is less than a preset threshold, the measurement data of the graphic to be measured in the unit to be measured is determined according to the updated measured graphic information.
7. A terminal, characterized in that, The terminal includes a memory and one or more processors; the memory stores one or more programs; the programs contain instructions for performing the printed circuit board dimension measurement method as described in any one of claims 1-5; the processor is used to execute the programs.
8. A computer-readable storage medium storing a plurality of instructions, characterized in that, The instructions are applicable to being loaded and executed by a processor to implement the steps of the printed circuit board dimension measurement method according to any one of claims 1-5.