Circuit board detection method based on data analysis
Through the circuit board detection method based on data analysis, the pixel values and edge points of the circuit board are automatically identified and processed, electrical inspection signals are generated, and the detection equipment parameters are adjusted according to the model parameters, which solves the problem of manual model confirmation and parameter adjustment in the existing technology. Solve the problem of low detection efficiency and realize efficient and automated circuit board detection.
Patent Information
- Application Number
- CN202411382463.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-30
- Publication Date
- 2025-01-24
- Estimated Expiration
- Not applicable · inactive patent
Smart Images

Figure CN119359649A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of electronic manufacturing, and in particular to a circuit board detection method based on data analysis. Background Art
[0002] A printed circuit board (PCB) is an electronic device used to connect and support electronic components. It is composed of insulating materials and conductive materials and is made through processes such as etching and drilling. The conductive paths on the circuit board are called wires or traces, which are used to connect electronic components to realize circuit functions.
[0003] Prior art CN105548860A discloses a method for testing the electrical performance of a carbon oil circuit board, comprising the following steps: performing an electrical performance test on all adjacent network units in a carbon oil area of the carbon oil circuit board using a first test voltage, and judging whether the insulation impedance between adjacent network units is greater than a first preset insulation impedance value based on the test result of the electrical performance test using the first test voltage; if the insulation impedance between all adjacent network units in the carbon oil area of the carbon oil circuit board is greater than the first preset insulation impedance value, it indicates that the insulation impedance between adjacent network units in the carbon oil area of the carbon oil circuit board meets the requirements; otherwise, it indicates that the insulation impedance of the carbon oil area of the carbon oil circuit board does not meet the requirements.
[0004] However, when testing circuit boards, it is usually necessary to manually confirm the model of the circuit board, adjust the machine parameters, and then test it. But if multiple models of circuit boards need to be tested at the same time, at this time, when the models of the circuit boards need to be manually confirmed and adjusted one by one, the detection efficiency of the circuit boards will be greatly reduced. Summary of the invention
[0005] The purpose of the present invention is to solve the problems in the background technology and to propose a circuit board detection method based on data analysis.
[0006] In order to achieve the above object, the present invention adopts the following technical solutions:
[0007] A circuit board detection method based on data analysis, the method specifically comprises the following steps:
[0008] Step 1: Set up a detection database, which stores information of various types of circuit boards;
[0009] Step 2: Use an image acquisition device to identify the pixel values of the pixels in the detection area, accumulate the pixels with the same pixel values, obtain the comprehensive cumulative value of the pixels, and determine the board pixels of the target circuit board based on the comprehensive cumulative value;
[0010] Taking the panel pixels as the reference pixel value, the pixels of each row and each column are identified respectively, and combined with the background pixels to determine the upper edge point, lower edge point, left edge point and right edge point;
[0011] Perform straight line fitting on the upper edge point, the lower edge point, the left edge point and the right edge point respectively, and intersect the fitted straight lines at the same time, take the closed area formed after the intersection, and obtain the overall contour area of the target circuit board;
[0012] Using mathematical tools, the midpoint coordinates of the overall contour area are identified, and based on the midpoint coordinates, the real-time acquisition points are determined. Then, the image acquisition device acquires images of the target circuit board based on the real-time acquisition points to obtain a plane image, wherein the plane image includes a top view image and a bottom view image.
[0013] Step 3: Based on the plane image and the overall contour area of the target circuit board, extract the front image and the back image of the target circuit board, first identify the components on the target circuit board according to the front image, obtain the component parameters, take the component parameters as the first feature, take the overall contour area as the second feature, obtain the standard image of the target circuit board in the detection database, and take the back image in the standard image as the first image, identify the position of the solder joint in the first image, determine the position of the solder joint in the first image in the back image in the plane image, and identify the solder joint feature value in the back image, then calculate the straight-line distance value of any two adjacent solder joints based on the solder joint feature value, compare the straight-line distance value with the solder joint distance threshold, and obtain the electrical inspection signal;
[0014] Step 4: When the electrical inspection signal is generated, the corresponding detection parameters are obtained from the inspection database according to the model parameters of the target circuit board, and the parameters of the inspection equipment are adjusted.
[0015] As a further solution of the present invention, a method for acquiring panel pixels includes:
[0016] Identify the detection area, and set a two-dimensional coordinate system with the lower left corner of the detection area as the origin, wherein the detection area is in the first quadrant of the two-dimensional coordinate system;
[0017] Based on image recognition technology, the pixel value of each pixel in the detection area is obtained, wherein the pixel of the detection area is determined by the resolution of the image acquisition device;
[0018] Identify the pixel value of each pixel point, and accumulate the pixels with the same pixel value to obtain the comprehensive cumulative value of the pixel points;
[0019] The comprehensive cumulative values of each pixel point are compared in turn to obtain the maximum value of the comprehensive cumulative value and its corresponding pixel point, and the pixel point is marked as the board pixel.
[0020] As a further solution of the present invention, before comparing pixel values, the background pixel values of the detection area are first identified. When the image detection device compares the pixel values of the target circuit board, the background pixel values of the detection area are first deleted, and then the board surface pixels are determined.
[0021] As a further solution of the present invention, a method for determining the upper edge point, the lower edge point, the left edge point and the right edge point includes:
[0022] S11: Taking the pixel value of the panel pixel as the reference pixel value, at the same time, according to the recognition area of the detection area, the pixel points of the detection area are arranged into a rectangular arrangement (m, n), where m represents a row and n represents a column;
[0023] S12: Taking the direction of the coordinate axis in the two-dimensional coordinate system as the positive direction, selecting the first column of pixels, comparing the pixel values of the first column of pixels with the reference pixel values, and identifying the panel pixels in the first column of pixels;
[0024] S13: According to the board pixels in the first column of pixels, a board pixel A1 is randomly selected, and the background pixels at the upper and lower ends of the board pixel A1 are identified, and the upper background pixel is marked as Dup, and the lower background pixel is marked as Ddown. In this column, if there is no other board pixel B1 between the board pixel A1 and the background pixel Dup, the board pixel A1 is marked as an upper edge point. If there is no other board pixel B1 between the board pixel A1 and the background pixel Ddown, the board pixel A1 is marked as a lower edge point. If there are other background pixels B1 between the board pixel A1 and the background pixels Dup and Ddown at the same time, no processing is performed on the board pixel A1.
[0025] S14: Similarly, the first row of pixels is selected, and the panel pixels in the first row and the background pixels DL and DR at the left and right ends are identified. In the first row, a panel pixel A2 is randomly selected. If there is no other panel pixel B2 between the panel pixel A2 and the background pixel DL, the panel pixel A2 is marked as a left edge point. If there is no other panel pixel B2 between the panel pixel A2 and the background pixel DR, the panel pixel A2 is marked as a right edge point. If there are other panel pixels B2 between the panel pixel A2 and the background pixels DL and DR at the same time, no processing is performed on the panel pixel.
[0026] According to the method of steps S1 to S4 above, the pixel points of n rows and m columns are processed in sequence to obtain the upper edge point, the lower edge point, the left edge point and the right edge point respectively.
[0027] As a further solution of the present invention, a method for obtaining the overall contour area includes:
[0028] S21: Select an upper edge point as an analysis object, and generate corresponding coordinates DSi(Xi, Yi) for the upper edge point based on a two-dimensional coordinate system, where i represents different upper edge points;
[0029] S22: according to the coordinates DSi of the upper edge point, a straight line is fitted to the upper edge point using the least square method, and the fitted straight line is marked as the upper contour line;
[0030] When performing straight line fitting on the upper edge points, it is necessary to identify and delete the abnormal deviation points in the upper edge points. The specific abnormal deviation points refer to the points whose distance value from the upper edge point to the upper line of the contour is greater than or equal to the deviation threshold Dy1;
[0031] The lower edge point, the left edge point and the right edge point are processed in sequence according to the methods of the above steps S21 and S22 to obtain the contour lower line, the contour left line and the contour right line respectively;
[0032] S23: intersecting the upper contour line, the lower contour line, the left contour line and the right contour line on a two-dimensional plane, and taking a closed area formed by the intersection, thereby obtaining an overall contour area of the target circuit board.
[0033] As a further solution of the present invention, a method for acquiring real-time collection points includes:
[0034] Use MALTAB mathematical tools to calculate the midpoint coordinates of the closed area, take the detection area as a plane, and the position of the midpoint coordinates as the intersection of the normals, and set the normal for the detection area;
[0035] The moving path of the image detection device is intersected with the normal line, and the intersection of the moving path and the normal line is marked as the real-time acquisition point. Then the image detection device is moved to the real-time acquisition point, and the image of the target circuit board in the detection area is acquired.
[0036] As a further solution of the present invention, a method for identifying the position of a welding point in a first image includes:
[0037] Based on the overall contour area of the target circuit board, image interception is performed in the plane image to obtain the front image and the back image of the target circuit board;
[0038] Matching the front image and the back image of the target circuit board according to the position direction of the overall contour area;
[0039] Take the front image of the target circuit board, identify the components in the front image one by one based on the image recognition technology, and obtain the component parameters of each component in the detection database;
[0040] The overall contour area is used as the first feature, and the components and component parameters in the front image are used as the second feature. According to the first feature and the second feature, the model parameters of the target circuit board are matched in the detection database to obtain the standard image of the target circuit board;
[0041] The reverse image of the standard image is taken and marked as the first image. In the first image, the welding points in the first image are identified based on the image processing function in the HALCON software.
[0042] As a further solution of the present invention, a method for determining the straight-line distance includes:
[0043] pre-marking the solder joints in the reverse image as inspection solder joints based on the positions of the solder joints in the first image;
[0044] Extract the pixel value of the detected solder joint, and identify the mode of the pixel value in the detected solder joint as the pixel feature value;
[0045] Randomly select a detection solder joint as the target solder joint, and identify the adjacent detection solder joints of the target solder joint in all directions at the same time, and mark them as interval solder joints. First, identify the pixel feature value of the target solder joint, obtain the pixel point closest to the interval solder joint in the feature pixel value of the target solder joint, and mark it as pixel feature point E1. Similarly, obtain the pixel point closest to the target solder joint in the pixel feature value of the interval solder joint, and mark it as pixel feature point E2.
[0046] Then, the straight-line distance JD between the pixel feature points E1 and E2 is identified by image processing technology.
[0047] As a further solution of the present invention, a method for acquiring an electrical inspection signal includes:
[0048] Compare the straight-line distance JD with the welding point distance threshold Yh. If JD<Yh, a welding abnormality signal is directly generated and transmitted to the terminal early warning device to remind the corresponding staff. Otherwise, if JD≥Yh, other detection welding points are selected and re-selected as target welding points, and processed in the above manner until all detection welding points are compared in sequence and no welding abnormality signal is generated. At this time, an electrical inspection signal is generated.
[0049] Compared with the prior art, the advantages of the present invention are:
[0050] The present invention determines the midpoint coordinates of the circuit board to be detected by using image data processing technology, and determines the real-time acquisition point according to the normal line on the midpoint coordinates and the moving path of the image detection device. After the image acquisition device is automatically moved to the position corresponding to the real-time acquisition point, the target image is acquired, thereby ensuring that the acquired image is located at the center of the field of view, reducing the error introduced by the camera distortion, and at the same time, the image acquisition based on the center of the circuit board can reduce the error caused by the incorrect viewing angle and uneven illumination, and further improve the image acquisition accuracy;
[0051] The present invention first identifies the solder joints of the target circuit board, generates an electrical detection signal according to the identification result, then obtains corresponding detection parameters according to the model of the target detection board, and adjusts the parameters of the inspection equipment. On the one hand, the present invention identifies solder joint anomalies in advance and adjusts the detection parameters in time, making the entire detection process smoother and avoiding repeated detection work caused by solder joint problems found in subsequent detections. On the other hand, the system can quickly adjust the corresponding detection parameters according to a preset program, reducing the time delayed by manually setting the parameters, thereby improving the detection efficiency of the circuit board. BRIEF DESCRIPTION OF THE DRAWINGS
[0052] Figure 1 It is a schematic diagram of the method flow structure of the present invention. DETAILED DESCRIPTION
[0053] The technical solutions in the embodiments of the present invention will be described clearly and completely below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments.
[0054] Reference Figure 1 , a circuit board detection method based on data analysis, the method specifically comprises the following steps:
[0055] Step 1: Setting up a detection database, wherein the detection database stores information of circuit boards of various models, and the specific circuit board information includes image information, component parameters, and detection information, etc.;
[0056] Step 2: An image acquisition device is set in the detection area, and the image acquisition device is used to acquire a plane image of the target circuit board, wherein the plane image includes a top view image and a bottom view image, wherein the top view image is an image acquired by the image acquisition device at the upper end of the target circuit board, and the bottom view image is an image acquired by the image acquisition device at the lower end of the target circuit board;
[0057] Furthermore, in this embodiment, the image acquisition device is set as an industrial camera, and the target circuit board refers to the circuit board to be detected;
[0058] In one embodiment of the present invention, since the size specifications of circuit boards vary depending on the model of the circuit boards, before capturing the image of the target circuit board, it is necessary to determine the midpoint coordinates of the target circuit board, and then set the real-time acquisition point of the image acquisition device based on the midpoint coordinates. The specific method for setting the real-time acquisition point includes:
[0059] S1: Identify the detection area, and set a two-dimensional coordinate system with the lower left corner of the detection area as the origin, where the detection area is in the first quadrant of the two-dimensional coordinate system;
[0060] S2: Based on image recognition technology, a pixel value of each pixel in the detection area is obtained, wherein the pixel of the detection area is determined by the resolution of the image acquisition device;
[0061] Then, the pixel value of each pixel is identified, and the pixels with the same pixel value are accumulated to obtain the comprehensive cumulative value of the pixel;
[0062] Compare the comprehensive cumulative values of each pixel point in turn, obtain the maximum comprehensive cumulative value and its corresponding pixel point, and mark this pixel point as a panel pixel;
[0063] It should be further explained that before comparing pixel values, the background pixel values of the detection area need to be identified first, and then when the image detection device compares the pixel values of the target circuit board, the background pixel values of the detection area need to be deleted first to prevent the background pixel values of the detection area from affecting the determination of the board surface pixels;
[0064] S3: Taking the pixel value of the panel pixel as the reference pixel value, at the same time, according to the recognition area of the detection area, the pixel points of the detection area are set to a rectangular arrangement (m, n), where m represents a row and n represents a column;
[0065] Taking the direction of the coordinate axis in the two-dimensional coordinate system as the positive direction, selecting the first column of pixels, comparing the pixel values of the first column of pixels with the reference pixel values, and identifying the panel pixels in the first column of pixels;
[0066] Then, according to the board pixels in the first column of pixels, a board pixel A1 is randomly selected, and the background pixels at the upper and lower ends of the board pixel A1 are identified, and the upper background pixel is marked as Dup, and the lower background pixel is marked as Ddown. In this column, if there is no other board pixel B1 between the board pixel A1 and the background pixel Dup, the board pixel A1 is marked as an upper edge point, if there is no other board pixel B1 between the board pixel A1 and the background pixel Ddown, the board pixel A1 is marked as a lower edge point, if there are other background pixels B1 between the board pixel A1 and the background pixels Dup and Ddown at the same time, no processing is performed on the board pixel A1;
[0067] Similarly, the first row of pixels is selected, and the panel pixels in the first row and the background pixels DL and DR at the left and right ends are identified. In the first row, a panel pixel A2 is randomly selected. If there is no other panel pixel B2 between the panel pixel A2 and the background pixel DL, the panel pixel A2 is marked as the left edge point. If there is no other panel pixel B2 between the panel pixel A2 and the background pixel DR, the panel pixel A2 is marked as the right edge point. If there are other panel pixels B2 between the panel pixel A2 and the background pixels DL and DR at the same time, no processing is performed on the panel pixel.
[0068] According to the method of step S3 above, the pixel points of n rows and m columns are processed in sequence to obtain the upper edge point, the lower edge point, the left edge point and the right edge point respectively;
[0069] S4: first select the upper edge point as the analysis object, and generate the corresponding coordinates DSi(Xi, Yi) for the upper edge point based on the two-dimensional coordinate system, where i represents different upper edge points;
[0070] According to the coordinates DSi of the upper edge point, a straight line is fitted to the upper edge point using the least square method, and the fitted straight line is marked as the upper contour line, wherein the least square method is a prior art and will not be described in detail here;
[0071] It should be further explained that when performing straight line fitting on the upper edge points, it is necessary to identify and delete the abnormal deviation points in the upper edge points. The specific abnormal deviation points refer to the points where the distance value between the upper edge points and the upper line of the contour is greater than or equal to the deviation threshold Dy1. The specific value of the deviation threshold Dy1 is obtained by technicians in this field after big data calculation.
[0072] Then, the lower edge point, the left edge point and the right edge point are processed in sequence according to the method of step S4 above to obtain the contour lower line, the contour left line and the contour right line respectively;
[0073] S5: intersecting the upper contour line, the lower contour line, the left contour line and the right contour line on a two-dimensional plane, and taking a closed area formed by the intersection, thereby obtaining an overall contour area of the target circuit board;
[0074] S6: Then, a mathematical tool is used to calculate the midpoint coordinates of the closed area, and then the detection area is taken as a plane and the position of the midpoint coordinates is taken as the intersection point of the normal line to set the normal line for the detection area;
[0075] The moving path of the image detection device is intersected with the normal line, and the intersection of the moving path and the normal line is marked as a real-time acquisition point, and then the image detection device is moved to the real-time acquisition point, and an image of the target circuit board in the detection area is acquired;
[0076] The mathematical tool mentioned above is MALTAB in this embodiment, and the specific operation process of MALTAB is a prior art, which will not be described in detail here.
[0077] The advantages of setting a real-time acquisition point based on the midpoint coordinates of the target circuit board and automatically moving the image acquisition device to the position corresponding to the real-time acquisition point before acquiring the target image include: ensuring that the acquired image is located at the center of the field of view, reducing the error introduced by camera distortion, and at the same time, acquiring the image based on the center of the circuit board can reduce the error caused by incorrect viewing angle and uneven lighting, further improving the image acquisition accuracy;
[0078] Step 3: Based on the plane image of the target circuit board, determine the visual defects of the target circuit board. The specific method for determining the visual defects includes:
[0079] SS1: Based on the overall contour area of the target circuit board, image capture is performed in the plane image to obtain the front image and the back image of the target circuit board;
[0080] Wherein, the front image is an image captured according to the overall contour area of the target circuit board image in the top view image, further, the top view image includes the front image and a blank background image, the blank background image refers to the detection area not covered by the circuit board to be detected, and the back image is an image captured according to the overall contour area of the target circuit board image in the bottom view image, further, the bottom view image includes the back image and the blank background image;
[0081] SS2: Match the front image and the back image of the target circuit board according to the position direction of the overall contour area;
[0082] At the same time, the front image of the target circuit board is first obtained, and the components in the front image are identified in turn based on the image recognition technology, and the component parameters of each component are obtained in the detection database, and the overall contour area is used as the first feature, and the components in the front image and their component parameters are used as the second feature. According to the first feature and the second feature, the model parameters of the target circuit board are matched in the detection database, and the standard image of the target circuit board is obtained;
[0083] Take the reverse image of the standard image and mark it as the first image. In the first image, based on the image processing function in the HALCON software, identify the solder joints in the first image. The identification of solder joints based on the image processing function in the HALCON software is a prior art and will not be described in detail here. The specific value of the standard solder joint size is obtained by those skilled in the art after big data calculation.
[0084] SS3: Based on the positions of the solder joints in the first image, the solder joints in the reverse image are pre-marked as detection solder joints;
[0085] Extracting pixel feature values of the detected solder joints. Further, extracting pixel values of the detected solder joints and identifying the mode of the pixel values in the detected solder joints. The mode of the pixel values is the pixel feature value.
[0086] Randomly select a detection solder joint as the target solder joint, and identify the adjacent detection solder joints of the target solder joint in all directions at the same time, and mark them as interval solder joints. First, identify the pixel feature value of the target solder joint, obtain the pixel point closest to the interval solder joint in the feature pixel value of the target solder joint, and mark it as pixel feature point E1. Similarly, obtain the pixel point closest to the target solder joint in the pixel feature value of the interval solder joint, and mark it as pixel feature point E2.
[0087] Then, the straight-line distance JD of the pixel feature points E1 and E2 is identified by image processing technology, and the straight-line distance JD is compared with the welding point distance threshold Yh. If JD<Yh, a welding abnormality signal is directly generated, and the welding abnormality signal is transmitted to the terminal warning device, and the corresponding staff is reminded. On the contrary, if JD≥Yh, other detection welding points are selected and re-used as target welding points, and processed in the above manner until all the detection welding points are compared in sequence and no welding abnormality signal is generated. At this time, an electrical inspection signal is generated, wherein the specific value of the welding point distance threshold Yh is obtained by technicians in this field after big data calculation;
[0088] Step 4: When the electrical inspection signal is generated, the corresponding detection parameters are obtained from the inspection database according to the model parameters of the target circuit board, and the parameters of the inspection equipment are adjusted, so that the inspection equipment automatically tests the target circuit board.
[0089] The above description is only a preferred specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can make equivalent replacements or changes according to the technical scheme and inventive concept of the present invention within the technical scope disclosed by the present invention, which should be covered by the protection scope of the present invention.
Claims
1. A circuit board detection method based on data analysis, characterized in that: The method specifically comprises the following steps: Step 1: Set up a detection database, which stores information of various types of circuit boards; Step 2: Use an image acquisition device to identify the pixel values of the pixels in the detection area, accumulate the pixels with the same pixel values, obtain the comprehensive cumulative value of the pixels, and determine the board pixels of the target circuit board based on the comprehensive cumulative value; Taking the panel pixels as the reference pixel value, the pixels of each row and each column are identified respectively, and combined with the background pixels to determine the upper edge point, lower edge point, left edge point and right edge point; Perform straight line fitting on the upper edge point, the lower edge point, the left edge point and the right edge point respectively, and intersect the fitted straight lines at the same time, take the closed area formed after the intersection, and obtain the overall contour area of the target circuit board; Using mathematical tools, the midpoint coordinates of the overall contour area are identified, and based on the midpoint coordinates, the real-time acquisition points are determined. Then, the image acquisition device acquires images of the target circuit board based on the real-time acquisition points to obtain a plane image, wherein the plane image includes a top view image and a bottom view image. Step 3: Based on the plane image and the overall contour area of the target circuit board, extract the front image and the back image of the target circuit board, first identify the components on the target circuit board according to the front image, obtain the component parameters, take the component parameters as the first feature, take the overall contour area as the second feature, obtain the standard image of the target circuit board in the detection database, and take the back image in the standard image as the first image, identify the position of the solder joint in the first image, determine the position of the solder joint in the first image in the back image in the plane image, and identify the solder joint feature value in the back image, then calculate the straight-line distance value of any two adjacent solder joints based on the solder joint feature value, compare the straight-line distance value with the solder joint distance threshold, and obtain the electrical inspection signal; Step 4: When the electrical inspection signal is generated, the corresponding detection parameters are obtained from the inspection database according to the model parameters of the target circuit board, and the parameters of the inspection equipment are adjusted.
2. A circuit board detection method based on data analysis according to claim 1, characterized in that: The method of obtaining the pixels on the board includes: Identify the detection area, and set a two-dimensional coordinate system with the lower left corner of the detection area as the origin, wherein the detection area is in the first quadrant of the two-dimensional coordinate system; Based on image recognition technology, the pixel value of each pixel in the detection area is obtained, wherein the pixel of the detection area is determined by the resolution of the image acquisition device; Identify the pixel value of each pixel point, and accumulate the pixels with the same pixel value to obtain the comprehensive cumulative value of the pixel points; The comprehensive cumulative values of each pixel point are compared in turn to obtain the maximum value of the comprehensive cumulative value and its corresponding pixel point, and the pixel point is marked as the board pixel.
3. A circuit board detection method based on data analysis according to claim 2, characterized in that: Before comparing pixel values, the background pixel values of the detection area are first identified. When the image detection device compares the pixel values of the target circuit board, the background pixel values of the detection area are first deleted, and then the board surface pixels are determined.
4. A circuit board detection method based on data analysis according to claim 2, characterized in that: The method for determining the upper edge point, the lower edge point, the left edge point and the right edge point includes: S11: Taking the pixel value of the panel pixel as the reference pixel value, at the same time, according to the recognition area of the detection area, the pixel points of the detection area are arranged into a rectangular arrangement (m, n), where m represents a row and n represents a column; S12: Taking the direction of the coordinate axis in the two-dimensional coordinate system as the positive direction, selecting the first column of pixels, comparing the pixel values of the first column of pixels with the reference pixel values, and identifying the panel pixels in the first column of pixels; S13: According to the board pixels in the first column of pixels, a board pixel A1 is randomly selected, and the background pixels at the upper and lower ends of the board pixel A1 are identified, and the upper background pixel is marked as Dup, and the lower background pixel is marked as Ddown. In this column, if there is no other board pixel B1 between the board pixel A1 and the background pixel Dup, the board pixel A1 is marked as an upper edge point. If there is no other board pixel B1 between the board pixel A1 and the background pixel Ddown, the board pixel A1 is marked as a lower edge point. If there are other background pixels B1 between the board pixel A1 and the background pixels Dup and Ddown at the same time, no processing is performed on the board pixel A1. S14: Similarly, the first row of pixels is selected, and the panel pixels in the first row and the background pixels DL and DR at the left and right ends are identified. In the first row, a panel pixel A2 is randomly selected. If there is no other panel pixel B2 between the panel pixel A2 and the background pixel DL, the panel pixel A2 is marked as a left edge point. If there is no other panel pixel B2 between the panel pixel A2 and the background pixel DR, the panel pixel A2 is marked as a right edge point. If there are other panel pixels B2 between the panel pixel A2 and the background pixels DL and DR at the same time, no processing is performed on the panel pixel. According to the method of steps S1 to S4 above, the pixel points of n rows and m columns are processed in sequence to obtain the upper edge point, the lower edge point, the left edge point and the right edge point respectively.
5. A circuit board detection method based on data analysis according to claim 4, characterized in that: The method for obtaining the overall contour area includes: S21: Select an upper edge point as an analysis object, and generate corresponding coordinates DSi(Xi, Yi) for the upper edge point based on a two-dimensional coordinate system, where i represents different upper edge points; S22: according to the coordinates DSi of the upper edge point, a straight line is fitted to the upper edge point using the least square method, and the fitted straight line is marked as the upper contour line; When performing straight line fitting on the upper edge points, it is necessary to identify and delete the abnormal deviation points in the upper edge points. The specific abnormal deviation points refer to the points whose distance value from the upper edge point to the upper line of the contour is greater than or equal to the deviation threshold Dy1; The lower edge point, the left edge point and the right edge point are processed in sequence according to the methods of the above steps S21 and S22 to obtain the contour lower line, the contour left line and the contour right line respectively; S23: intersecting the upper contour line, the lower contour line, the left contour line and the right contour line on a two-dimensional plane, and taking a closed area formed by the intersection, thereby obtaining an overall contour area of the target circuit board.
6. A circuit board detection method based on data analysis according to claim 5, characterized in that: Methods for obtaining real-time collection points include: Use MALTAB mathematical tools to calculate the midpoint coordinates of the closed area, take the detection area as a plane, and the position of the midpoint coordinates as the intersection of the normals, and set the normal for the detection area; The moving path of the image detection device is intersected with the normal line, and the intersection of the moving path and the normal line is marked as the real-time acquisition point. Then the image detection device is moved to the real-time acquisition point, and the image of the target circuit board in the detection area is acquired.
7. A circuit board detection method based on data analysis according to claim 1, characterized in that: The method for identifying the position of the welding point in the first image includes: Based on the overall contour area of the target circuit board, image interception is performed in the plane image to obtain the front image and the back image of the target circuit board; Matching the front image and the back image of the target circuit board according to the position direction of the overall contour area; Take the front image of the target circuit board, identify the components in the front image one by one based on the image recognition technology, and obtain the component parameters of each component in the detection database; The overall contour area is used as the first feature, and the components and component parameters in the front image are used as the second feature. According to the first feature and the second feature, the model parameters of the target circuit board are matched in the detection database to obtain the standard image of the target circuit board; The reverse image of the standard image is taken and marked as the first image. In the first image, the welding points in the first image are identified based on the image processing function in the HALCON software.
8. A circuit board detection method based on data analysis according to claim 7, characterized in that: Methods for determining straight-line distance include: pre-marking the solder joints in the reverse image as inspection solder joints based on the positions of the solder joints in the first image; Extract the pixel value of the detected solder joint, and identify the mode of the pixel value in the detected solder joint as the pixel feature value; Randomly select a detection solder joint as the target solder joint, and identify the adjacent detection solder joints of the target solder joint in all directions at the same time, and mark them as interval solder joints. First, identify the pixel feature value of the target solder joint, obtain the pixel point closest to the interval solder joint in the feature pixel value of the target solder joint, and mark it as pixel feature point E1. Similarly, obtain the pixel point closest to the target solder joint in the pixel feature value of the interval solder joint, and mark it as pixel feature point E2. Then, the straight-line distance JD between the pixel feature points E1 and E2 is identified by image processing technology.
9. A circuit board detection method based on data analysis according to claim 8, characterized in that: The method for obtaining the electrical inspection signal includes: Compare the straight-line distance JD with the welding point distance threshold Yh. If JD<Yh, a welding abnormality signal is directly generated and transmitted to the terminal early warning device to remind the corresponding staff. Otherwise, if JD≥Yh, other detection welding points are selected and re-selected as target welding points, and processed in the above manner until all detection welding points are compared in sequence and no welding abnormality signal is generated. At this time, an electrical inspection signal is generated.
Citation Information
Patent Citations
Electric performance testing method for carbon oil circuit board
CN105548860A
Cited By
SPR (Surface Plasmon Resonance) riveting point position detection method and system based on coordinate recognition
CN120672839A
SPR riveting point position detection method and system
CN120781464A
SPR rivet point position detection method and system
CN120781464B