Image splicing method, medium and terminal device of PCBA board
By extracting the feature points and circuit parameters of the local images of the PCBA board, determine the pairing priority of the feature point, and carry out the problem of matching and stitching of the same name point. Panorama splicing effect.
Patent Information
- Application Number
- CN202411345306.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-26
- Publication Date
- 2025-01-24
- Estimated Expiration
- 2044-09-26
AI Technical Summary
It is difficult for the prior art to obtain a complete panoramic view of the PCBA board through a single acquisition, and only multiple local images can be obtained. How to stitch these local images into a complete panoramic image is a technical problem.
By collecting some local images of the PCBA board, extract the feature points of each local image, and determine the circuit parameters of each local image based on the feature point information, and then determine the pairing priority of each feature point, perform the same name pairing and subsequent stitching, and subsequent stitching. Build the relationship between local images and obtain the stitching PCB board panoramic image.
It achieves efficient and accurate panoramic splicing of PCBA boards, avoids blind matching of feature points, improves pairing efficiency and accuracy, and enables the spliced pictures to show the panoramic view of the entire PCBA board.
Smart Images

Figure CN118864243B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image processing, and in particular to an image splicing method, medium and terminal equipment of a PCBA board. Background Art
[0002] As modern electronic products place increasingly stringent quality requirements on printed circuit boards (PCBs), image acquisition of PCBAs has become a key step in ensuring quality control and product traceability during the manufacturing process. Given the high density and complex routing of components on PCBAs, it is critical to capture every detail. To this end, a small field of view, high-precision image acquisition method must be adopted. However, the challenge faced by this method is that the small field of view, high-precision image acquisition method makes it impossible to obtain a complete panoramic view of the PCBA through a single acquisition with a reduced field of view, and only multiple partial images of the entire PCBA can be obtained.
[0003] Therefore, how to stitch these multiple local images to obtain a complete view of the entire PCBA board is a technical problem that needs to be solved urgently in this field. Summary of the invention
[0004] In order to solve at least one of the above technical problems, the present invention provides an image stitching method of a PCBA board, comprising:
[0005] Collect several partial images of the PCBA board, wherein any partial image has an overlapping area with at least another image;
[0006] Extracting feature points of each local image, and determining circuit parameters of each local image based on the feature point information;
[0007] According to the circuit parameters of each local image, the pairing priority of each feature point is determined;
[0008] Pair the feature points with the same name according to the priority;
[0009] According to the results of the pairing of the same-name points, the association relationship between the local images is constructed, and the local images are spliced to obtain a spliced panoramic image of the PCB board.
[0010] Furthermore, the step of determining the circuit parameters of each local image includes:
[0011] Extract feature points from each local image, cluster the feature points, and define the device area of each local image;
[0012] According to the characteristic points of each device region, the edge contour of each device region is fitted to determine the device type represented by each device region and its connection relationship;
[0013] The key points of each edge contour are obtained according to the device type, and the positional relationship of the connected devices is determined according to the position of each key point.
[0014] Furthermore, the step of determining the pairing priority of each feature point includes:
[0015] Divide each local image into several areas to be compared;
[0016] According to the circuit parameters of each area to be compared, a group of areas to be compared is constructed, and a characteristic value of each group of areas to be compared is determined;
[0017] According to the constructed area groups to be compared, it is determined that only the feature points included in each area group to be compared are to be paired; and according to the feature values of each area group to be compared, the pairing priority of the feature points included in each area group to be compared is determined.
[0018] Furthermore, the step of constructing the region group to be compared is specifically as follows:
[0019] According to the device types contained in the regions to be compared, the regions to be compared that include the same device types in different local images are constructed into a group of regions to be compared.
[0020] Furthermore, the step of determining the characteristic value of each to-be-compared region group is specifically as follows:
[0021] Taking the basic information of the device type as the first gradient, determining the first characteristic coefficient of each area to be compared according to the weight;
[0022] Taking the connection relationship and position relationship between the components as the second gradient, determining the second characteristic coefficient of each area to be compared according to the weight;
[0023] According to the first characteristic coefficient and the second characteristic coefficient of each area to be compared, the characteristic value of each group of areas to be compared is determined.
[0024] Furthermore, the step of determining the characteristic value of each to-be-compared region group is specifically as follows:
[0025] T = k1 × T1 + k2 × T2;
[0026] Among them, T1 and T2 represent the first characteristic coefficient and the second characteristic coefficient respectively; k1 and k2 represent the first weight coefficient and the second weight coefficient of the first characteristic coefficient T1 and the second characteristic coefficient T2 respectively; T represents the characteristic value.
[0027] Furthermore, before extracting the feature points of each local image, the following steps are also included:
[0028] The feature point detection area of each local image is delineated by an adaptive region division algorithm; only the feature points of the feature point detection area in each local image are extracted later.
[0029] Furthermore, the step of stitching the local images includes:
[0030] According to the results of the pairing of the same-name points, the position of the successful pairing is located as the overlapping area of each local image, and an affine transformation is performed to generate a homography matrix, and the corresponding local images are registered to be aligned in the same coordinate system;
[0031] The transformation relationship between the local images is calculated through the results of the pairing of the same-name points; the local images are corrected and then spliced according to the transformation relationship;
[0032] The stitching edges are fused to obtain a fused stitching image.
[0033] On the other hand, the present invention further provides a computer-readable storage medium storing thereon a method for executing the image stitching of a PCBA board as described in any one of the above.
[0034] On the other hand, the present invention also provides a terminal device, including a memory and a processor; the memory stores a program code that can be executed by the processor; the program code is used to execute the image stitching method of the PCBA board described in any one of the above.
[0035] Compared with the traditional method of extracting feature points for direct pairing for stitching, the image stitching method, medium and terminal device of the PCBA board provided by the present invention first determine the circuit parameters of each local image according to the feature point information, and then determine the pairing priority of each feature point according to the circuit parameters, and then perform pairing of points with the same name and subsequent stitching, which can avoid blind pairing of each feature point and improve the pairing efficiency and pairing accuracy; relying on the circuit topology structure of the PCBA board, it can efficiently and accurately perform panoramic stitching of the PCBA board while retaining the image details as much as possible, so that the stitched picture can show the panoramic view of the entire PCBA board. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] Figure 1 A flowchart of an embodiment of the image stitching method of a PCBA board of the present invention;
[0037] Figure 2 The figure is a flow chart of another embodiment of the image stitching method of the PCBA board of the present invention. DETAILED DESCRIPTION
[0038] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0039] It should be noted that if the embodiments of the present invention involve directional indications, such as up, down, left, right, front, back, etc., then the directional indication is only used to explain the relative position relationship, movement status, etc. between the components in a certain specific posture. If the specific posture changes, the directional indication will also change accordingly. In addition, if the embodiments of the present invention involve descriptions of "first, second", "S1, S2", "step one, step two", etc., then such descriptions are only used for descriptive purposes and cannot be understood as indicating or implying their relative importance or implicitly indicating the number of indicated technical features or indicating the execution order of the method, etc. Those skilled in the art can understand that anything that does not violate the gist of the invention under the technical concept of the invention should be included in the protection scope of the present invention.
[0040] like Figure 1 As shown, the present invention provides an image stitching method of a PCBA board, comprising:
[0041] S1: Collect several partial images of the PCBA board, where any partial image has an overlapping area with at least another image;
[0042] Specifically, multiple image acquisition devices can be used to obtain several partial images of the PCBA board in different regions; or the same image acquisition device can be used to obtain several partial images of the PCBA board in batches along a certain path, such as from left to right, from top to bottom, as images to be spliced, which are used to subsequently splice the complete image of the whole board; it is worth noting that any image must have at least an overlapping area with another image so that an association relationship can be established between the two for subsequent splicing. Specifically, in order to understand the overall picture of the PCBA board, the several partial images are preferably spliced to fully cover the entire PCBA board.
[0043] S2: extracting feature points of each local image, and determining circuit parameters of each local image based on the feature point information;
[0044] Specifically, computer vision algorithms such as scale-invariant feature transform SIFT, accelerated robust feature SURF, and ORB (Oriented FAST and Rotated BRIEF) can be optionally used to detect each local image; preferably, an AKAZE feature point detector is used for feature point detection. Compared with the traditional SIFT feature point detector, AKAZE can extract more feature points on the PCBA board, and AKAZE is specially designed to accelerate the feature point detection process, which can improve the feature point detection speed to extract the feature points of each local image; then, according to the position and other information of each feature point, the feature points are divided into regions to obtain several device regions; finally, the specific information of each device region is analyzed to identify the devices, traces, solder joints, etc. on the circuit board represented by the device region, so as to determine the relevant circuit parameters of each device region, such as the device type, position, size, etc. represented by the device region.
[0045] For example, the circuit parameters include any one or more of the device type, the connection relationship between the devices, and the position relationship between the devices; preferably, step S2 may optionally include but is not limited to:
[0046] S21: extracting feature points of each local image, clustering the feature points, and defining a device area of each local image;
[0047] Specifically, since there are fewer feature points in the area without devices in the PCBA board, and there are many dense feature points in the area with devices, it is optional but not limited to clustering the feature points according to the distance between each feature point, and dividing the feature points with a distance less than a set threshold into feature points of the same area, and dividing the feature points of each local image into several device areas, each device area includes several feature points with a distance less than the set threshold.
[0048] S22: fitting the edge contour of each device region according to the feature points of each device region to determine the device type represented by each device region and its connection relationship;
[0049] Specifically, for the feature points in each device area, its edge contour is fitted to determine what device the device area specifically represents based on unique property information such as contour shape and size; examples include but are not limited to: wires, resistors, capacitors, inductors, potentiometers, transformers, crystal diodes, field effect transistors, electroacoustic devices, optoelectronic devices, display devices, sensors, etc.; on the one hand, the specific device type of each device area is determined; on the other hand, whether the devices are connected is determined based on whether there are wires between them.
[0050] Preferably, step S2 may also optionally include but is not limited to:
[0051] S23: Obtain key points of each edge contour according to the device type, and determine the positional relationship of the connected devices according to the positions of the key points.
[0052] Specifically, it is possible to optionally determine corner points, center points, etc. as feature key points based on the inherent characteristics of each device type to determine the key points of each edge contour. By determining the direction of the corresponding key points, the distance between each key point, etc. according to the device types and their connection relationships determined in step S22, the relative position relationship between each connected device can be characterized. The resistor in the example is at the lower left corner of the capacitor, and the distance is 3 cm, etc., to further understand the circuit topology between the devices.
[0053] In this embodiment, a preferred embodiment of step S2 is given, in which the device areas are divided by clustering the feature points, and each device area is fitted to determine the device type, connection relationship, positional relationship, etc., so as to understand the actual situation of each device area in each local image, determine the circuit parameters of each local image, and lay the foundation for the priority of subsequent feature point matching.
[0054] Preferably, before step S21, step S20 may be optionally but not limited to:
[0055] The feature point detection area of each local image is delineated by an adaptive region division algorithm; in step S21, only the feature points of the feature point detection area in each local image are extracted.
[0056] In this embodiment, a further preferred embodiment of step S2 is provided, and step S20 is added to adaptively divide the detection area with the most effective feature points. Based on this additional step, compared with the traditional method of performing feature point detection on the entire image of the local image, this method is optimized from full-image detection to small-image detection, which can greatly reduce the amount of computing resources occupied, reduce the consumption of computing resources and shorten the computing time, and improve the efficiency of feature point extraction.
[0057] S3: Determine the pairing priority of each feature point according to the circuit parameters of each local image;
[0058] Specifically, it is possible to determine which feature points with stronger characteristics to pair first and which feature points with weaker characteristics to pair later based on any one or more parameters of the circuit parameters of each local image, such as which components are included, the connection relationship between the components, and the position relationship.
[0059] Preferably, step S3 may optionally include but is not limited to:
[0060] S31: Divide each local image into a number of areas to be compared;
[0061] Specifically, it is optional but not limited to setting a size slightly larger than the size of the overlapping area according to the size of the overlapping area preset by the acquisition device in step S1, and dividing each partial image into a number of areas to be compared;
[0062] S32: constructing a group of regions to be compared according to the circuit parameters of each region to be compared, and determining a characteristic value of each group of regions to be compared;
[0063] Specifically, it is optional to determine which areas are likely to be the same area in different local images based on the circuit parameters of each area to be compared, and construct a group of areas to be compared; areas that are unlikely to be the same area in different local images can be directly discarded without comparison; further, based on the circuit parameters of each area to be compared, determine the characteristic value of each constructed area to be compared, that is, the degree of characteristic similarity, and if the degree is high, the subsequent pairing will be prioritized, and if the degree is low, the subsequent pairing will be delayed.
[0064] S33: According to the constructed area groups to be compared, determining to pair only the feature points included in each area group to be compared; and according to the feature values of each area group to be compared, determining the pairing priority of the feature points included in each area group to be compared.
[0065] In this embodiment, a preferred embodiment of step S3 is given, which divides the area to be compared, constructs the area group to be compared, and determines its characteristic value, screens the pairing of characteristic points, and sets the priority, and pairs with high characteristic values in the area group to be compared are paired first, and pairs with low characteristic values are paired later. In this way, after screening and grading, on the one hand, those that do not need to be paired are screened; on the other hand, those with high degree are paired and confirmed first, which is equivalent to selecting those with high possibility first to avoid blind selection; further improving the pairing efficiency, pairing success rate and pairing accuracy.
[0066] More preferably, step S32 may optionally include but is not limited to:
[0067] S321: constructing a group of regions to be compared that include the same device type in different local images according to the device types included in the regions to be compared;
[0068] Specifically, according to whether the area to be compared includes the same device type, it can be determined which areas to be compared need to be compared to determine whether the features are similar; which areas to be compared do not need to be compared at all, and cannot be the same area corresponding to different local images; for example, according to the device type, if two areas to be compared in different local images do not have the same device type at all, for example, the area to be compared A1 in local image A and the area to be compared B1 in local image B do not contain the same device type at all, and there is a field effect transistor in A1 but not in B1, then the two cannot be the same area and do not need to be compared; however, if the two have the same device type, they may be the same area or not, and need to be formed into a group of areas to be compared.
[0069] S322: taking basic information of device type as the first gradient, determining a first characteristic coefficient T1 of each area to be compared according to a weight;
[0070] Specifically, the first characteristic coefficient of each area group to be compared can be set according to the basic type of the device type in the area to be compared, such as the number, commonness, and particularity of the device, to characterize the characteristics of the area reflected by the device type. For example, taking the commonness of the device as an example, if the two areas to be compared include the same device type of resistor, which is a common component with a high frequency of occurrence, a lower characteristic coefficient of 0.1 can be set, that is, the first characteristic coefficient of the two areas to be compared is 0.1; if the two areas to be compared include the same device type of field effect transistor, which is a special device with a low frequency of occurrence, a higher characteristic coefficient of 0.3 can be set, that is, the first characteristic coefficient of the two areas to be compared is 0.3. Taking quantity as an example, if the two areas to be compared include the same 2 resistors and 1 field effect transistor, then its first characteristic coefficient = 0.1×2+0.3=0.5.
[0071] S323: Taking the connection relationship and position relationship between the components as the second gradient, determining the second characteristic coefficient T2 of each area to be compared according to the weight;
[0072] Specifically, it is optional to select the connection relationship and position relationship between the components. For example, the above example shows that two areas to be compared include the same two resistors and one field effect tube, so the first characteristic coefficient = 0.1×2+0.3=0.5. Then if the two resistors are connected in the two areas to be compared, the second characteristic coefficient of 0.1 can be increased. If their position relationship is such that one is at the upper left corner of the other, the second characteristic coefficient of 0.1 can be increased. If the distance between the center points of the two resistors is equal, the second characteristic coefficient of 0.1 can be increased.
[0073] S324: determining a characteristic value T of each to-be-compared region group according to the first characteristic coefficient T1 and the second characteristic coefficient T2 of each to-be-compared region;
[0074] Specifically, optionally but not limited to the same, weight coefficients are set for the first characteristic coefficient T1 and the second characteristic coefficient T2, and the characteristic value T=k1×T1+k2×T2 of each group of area groups to be compared is calculated; k1 and k2 are the first weight coefficient and the second weight coefficient of the first characteristic coefficient T1 and the second characteristic coefficient T2 respectively.
[0075] In this embodiment, step S32 is given, which is a preferred embodiment of how to construct a group of areas to be compared according to the circuit parameters of each area to be compared and determine the characteristic value of each group of areas to be compared. The characteristic value of each group of areas to be compared is determined based on the circuit parameters, such as device type, connection relationship between devices, position relationship, etc. Subsequently, the group of areas to be compared with high correlation reflected by the characteristic value is paired first; the group of areas to be compared with high correlation and low difficulty is paired later; the large amount of calculation caused by blind pairing is avoided.
[0076] S4: Pair the feature points with the same name according to their priority;
[0077] Specifically, after determining the pairing priority of each feature point in step S2, a feature point matching algorithm, such as the fast nearest neighbor library FLANN or Brute-Force matching, can be used to find the same or similar feature points in each device area of different local images in order of priority, and pair the same-name points. Preferably, the fast nearest neighbor matching algorithm FLANN is used to replace the nearest neighbor matching algorithm in the traditional method for feature point matching. Compared with the nearest neighbor matching algorithm, FLANN can quickly match feature points and maintain a high matching accuracy while reducing the amount of calculation, thereby improving the matching efficiency.
[0078] More preferably, after the feature points are matched, candidate matching pairs are obtained, but some incorrectly matched point pairs may be included. In order to improve the accuracy of the matching, the incorrectly matched point pairs can be removed through the RANSAC screening algorithm to retain the correct matching point pairs.
[0079] S5: According to the result of pairing the same-name points, the association relationship between the local images is constructed, and the local images are stitched together to obtain a stitched panoramic image of the PCB board.
[0080] Specifically, it is possible to determine the overlapping areas of the local images based on the results of the pairing of the same-name points, and then analyze the spatial relationship between the local images based on the same overlapping areas in different local images to construct the association relationship between the local images.
[0081] Preferred, optional but not limited to include:
[0082] S51: According to the result of pairing the same-name points, the position of the successful pairing is located as the overlapping area of each local image, and an affine transformation is performed to generate a homography matrix, and the corresponding local images are registered to be aligned in the same coordinate system.
[0083] Specifically: The process first calculates the parameters required for the affine transformation through these matching point pairs. Affine transformation is a linear transformation that can maintain the parallelism of straight lines and the relative position relationship of straight lines. Based on the calculated affine transformation parameters, an affine transformation matrix is constructed. This matrix describes how to map points in one image to corresponding points in another image, thereby achieving registration between the two images. By appropriately expanding the affine transformation matrix, a homography matrix is generated. The generated homography matrix is applied to one of the images, and the pixels in the image are transformed and mapped to the position in the other image, so that the two images can be aligned in the same coordinate system.
[0084] S52: Calculate the transformation relationship between the local images through the results of the pairing of the same-name points, which may include but is not limited to geometric transformation parameters such as translation, rotation, and scaling; correct the local images and then stitch them.
[0085] Specifically, since the camera shooting posture and position may change when shooting partial images, there may be differences in position offset, rotation and scale between different images. Image relationship matching can calibrate these images and correct these differences so that the offset, rotation and scale between different images are consistent. Through image relationship matching, the artifacts and discontinuity of the stitching edges after image stitching can be reduced, making the stitched panoramic image smoother and more realistic.
[0086] Preferably, the method further includes processing the edges of the images after they are spliced, S53: image fusion.
[0087] Preferably, image fusion techniques, such as gradient domain fusion, Poisson fusion, etc., are used to smooth the stitching area and reduce the stitching marks. Finally, by adaptively adjusting the image parameters and using the Poisson fusion strategy for image fusion, the panoramic image can obtain a more natural transition effect. The whole process aims to achieve seamless stitching of the panoramic image of the PCBA board, and present a more natural, more human-eye-friendly panoramic image without stitching gaps while maintaining the consistency of geometry and luminosity. This module aims to seamlessly stitch the images after image relationship matching, eliminate stitching marks, and ensure image quality. This module can effectively eliminate the marks produced by stitching through fine pixel value fusion and transition area processing. At the same time, the image can be color corrected during the fusion process to ensure color consistency between different images. This module can avoid image quality degradation due to fusion while maintaining the clarity and details of the image to the maximum extent.
[0088] More preferably, the following optional but not limited methods may be used: automatically evaluating the image parameters (exposure, contrast, saturation, etc.) of the image set, adaptively adjusting the images in the image set to uniform image parameters, and cropping the images according to the input images, masks, feature points, and resolution information. The process first removes the non-target areas in the image according to the mask information, and only retains the target area. After that, the mask is applied to the original image to remove the part marked as the background in the mask, thereby obtaining the cropped image, and the range of the cropped area is determined according to the position of the feature points to ensure that all important feature points are included in the cropped image. According to the input resolution information, the cropped image is adjusted to ensure that it meets the required width and height. Finally, the cropped image will meet the input requirements and only include the target area. The cropping process can extract and adjust specific target areas in the image to meet the needs of subsequent processing or display. The cropped images are spliced and aligned, and the image parameters after splicing and alignment are adaptively adjusted again. This operation is conducive to the subsequent image fusion to eliminate splicing traces. Finally, the Poisson fusion strategy is used to fuse the images to avoid discontinuity at the fusion edge, and finally the stitched panoramic picture is output, that is, all the local images are stitched together to form a seamless panoramic PCB board image.
[0089] Compared with the traditional method of extracting feature points for direct pairing for stitching, the image stitching method of the PCBA board provided by the present invention first determines the circuit parameters of each local image according to the feature point information, and then determines the pairing priority of each feature point according to the circuit parameters, and then performs pairing of points with the same name and subsequent stitching, which can avoid blind pairing of each feature point and improve the pairing efficiency and pairing accuracy; relying on the circuit topology structure of the PCBA board, it can efficiently and accurately perform panoramic stitching of the PCBA board while retaining the image details as much as possible, so that the stitched picture can show the panoramic view of the entire PCBA board.
[0090] On the other hand, the present invention further provides a computer storage medium storing an executable program code; the executable program code is used to execute any of the above-mentioned PCBA board image stitching methods.
[0091] On the other hand, the present invention also provides a terminal device, including a memory and a processor; the memory stores a program code that can be executed by the processor; the program code is used to execute any of the above-mentioned PCBA board image stitching methods.
[0092] Exemplarily, the program code may be divided into one or more modules / units, which are stored in the memory and executed by the processor to complete the present invention. The one or more modules / units may be a series of computer program instruction segments capable of completing specific functions, which are used to describe the execution process of the program code in the terminal device.
[0093] The terminal device may be a computing device such as a desktop computer, a notebook, a PDA, a cloud server, etc. The terminal device may include, but is not limited to, a processor and a memory. Those skilled in the art will appreciate that the terminal device may also include an input / output device, a network access device, a bus, etc.
[0094] The processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.
[0095] The memory may be an internal storage unit of the terminal device, such as a hard disk or a memory. The memory may also be an external storage device of the terminal device, such as a plug-in hard disk, a smart memory card (SmartMedia Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the terminal device. Further, the memory may also include both an internal storage unit of the terminal device and an external storage device. The memory is used to store the program code and other programs and data required by the terminal device. The memory may also be used to temporarily store data that has been output or is to be output.
[0096] The above-mentioned computer storage medium and terminal device are created based on the image stitching method of the above-mentioned PCBA board. Their technical functions and beneficial effects are not repeated here. The technical features of the above-mentioned embodiments can be combined arbitrarily. In order to make the description concise, all possible combinations of the various technical features in the above-mentioned embodiments are not described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0097] The above-mentioned embodiments only express several implementation methods of the present invention, and the description is relatively specific and detailed, but it cannot be understood as limiting the scope of the invention patent. It should be pointed out that for ordinary technicians in this field, several modifications and improvements can be made without departing from the concept of the present invention, which all belong to the protection scope of the present invention.
Claims
1. A PCBA board image stitching method, characterized in that: include: Collect several partial images of the PCBA board, wherein any partial image has an overlapping area with at least another image; Extracting feature points of each local image, and determining circuit parameters of each local image based on the feature point information; According to the circuit parameters of each local image, the characteristic value of each local image is determined, and according to the characteristic value of each local image, the pairing priority of the characteristic points contained in each local image is determined; the circuit parameters include: any one or more parameters of device type, device quantity, connection relationship between devices, and position relationship between devices; Pair the feature points with the same name according to the priority; According to the results of the pairing of the same-name points, the association relationship between the local images is constructed, and the local images are spliced to obtain a spliced panoramic image of the PCB board; The steps of determining the circuit parameters of each partial image include: Extract feature points from each local image, cluster the feature points, and define the device area of each local image; According to the characteristic points of each device region, the edge contour of each device region is fitted to determine the device type represented by each device region and its connection relationship; The key points of each edge contour are obtained according to the device type, and the positional relationship of the connected devices is determined according to the position of each key point.
2. The image stitching method of PCBA board according to claim 1, characterized in that: The steps of determining the pairing priority of each feature point include: Divide each local image into several areas to be compared; According to the circuit parameters of each area to be compared, a group of areas to be compared is constructed, and a characteristic value of each group of areas to be compared is determined; According to the constructed area groups to be compared, it is determined that only the feature points included in each area group to be compared are to be paired; and according to the feature values of each area group to be compared, the pairing priority of the feature points included in each area group to be compared is determined.
3. The image stitching method of PCBA board according to claim 2, characterized in that: The steps for constructing the region group to be compared are as follows: According to the device types contained in the regions to be compared, the regions to be compared that include the same device types in different local images are constructed into a group of regions to be compared.
4. The image stitching method of the PCBA board according to claim 3, characterized in that: The steps of determining the characteristic values of each to-be-compared region group are specifically as follows: Taking the basic information of the device type as the first gradient, determining the first characteristic coefficient of each area to be compared according to the weight; Taking the connection relationship and position relationship between the components as the second gradient, determining the second characteristic coefficient of each area to be compared according to the weight; According to the first characteristic coefficient and the second characteristic coefficient of each area to be compared, the characteristic value of each group of areas to be compared is determined.
5. The image stitching method of PCBA board according to claim 4, characterized in that: The steps of determining the characteristic values of each to-be-compared region group are specifically as follows: T = k1 × T1 + k2 × T2; Among them, T1 and T2 represent the first characteristic coefficient and the second characteristic coefficient respectively; k1 and k2 represent the first weight coefficient and the second weight coefficient of the first characteristic coefficient T1 and the second characteristic coefficient T2 respectively; T represents the characteristic value.
6. The image stitching method of PCBA board according to claim 1, characterized in that: Before extracting the feature points of each local image, it also includes: The feature point detection area of each local image is delineated by an adaptive region division algorithm; only the feature points of the feature point detection area in each local image are extracted later.
7. The image stitching method of PCBA board according to any one of claims 1 to 6, characterized in that: The step of stitching the local images includes: According to the results of the pairing of the same-name points, the position of the successful pairing is located as the overlapping area of each local image, and an affine transformation is performed to generate a homography matrix, and the corresponding local images are registered to be aligned in the same coordinate system; The transformation relationship between the local images is calculated through the results of the pairing of the same-name points; the local images are corrected and then spliced according to the transformation relationship; The stitching edges are fused to obtain a fused stitching image.
8. A computer-readable storage medium, characterized in that: The image stitching method for executing the PCBA board described in any one of claims 1 to 7 is stored thereon.
9. A terminal device, characterized in that: It comprises a memory and a processor; the memory stores a program code executable by the processor; the program code is used to execute the image stitching method of the PCBA board described in any one of claims 1 to 7.
Citation Information
Patent Citations
Circuit board image splicing method for screening matching points based on clustering method
CN111340701A
Image splicing method and device, electronic equipment and storage medium
CN118570061A