A system and method for detecting the aperture size of a suspension clamp

CN123028520APending Publication Date: 2026-11-03GUILIN TIANDI OPTICAL FIBER COMM CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611386188.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-08
Publication Date
2026-11-03

AI Technical Summary

Technical Problem

Existing technologies for detecting the diameter of suspension clamps are limited by the fact that manual inspection is susceptible to clamping deviations, while machine vision inspection requires frequent calibration and cannot distinguish the causes of deviations, thus failing to guide upstream processing adjustments.

Method used

The pre-positioning identification module identifies the position of the hole to be inspected, the bearing positioning module performs translation and rotation correction, the illumination imaging module realizes same-frame imaging, the image processing module calculates the aperture size and determines the out-of-tolerance type, and the determination output module outputs adjustment prompts.

Benefits of technology

It enables aperture measurement without absolute calibration, suppresses conversion drift caused by clamping distance fluctuations and backlight attenuation, improves the reliability and accuracy of detection results, and can guide upstream processing adjustments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123028520A_ABST
    Figure CN123028520A_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of machine vision detection, in particular to a kind of suspension clamp aperture size detection system and detection method, solve the problem that workpiece shift in multi-hole detection leads to continuous deviation, magnification calibration drift and the cause of out-of-tolerance cannot be distinguished.The system collects the whole image to identify the position of each hole to be detected and generates a displacement instruction;the edge of the positioning surface is provided with a standard hole with known aperture, the hole to be detected and the standard hole are imaged in the same frame, and the aperture is converted according to the ratio of pixel size, without absolute calibration;the actual position and the theoretical position of the measured hole are used to calculate the translation and rotation amount online, and the walking position is corrected hole by hole, and it is returned to re-identify when it fails;The present application realizes the automatic detection of the multi-hole aperture of the suspension clamp, extends the detection results to the cause of out-of-tolerance diagnosis, and outputs the upstream processing procedure adjustment prompt before the distribution center reaches the tolerance band boundary, suitable for online quality control of power fittings production.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of machine vision inspection technology, specifically to a system and method for detecting the aperture size of a suspension clamp. Background Technology

[0002] Suspension clamps are critical power fittings used to suspend conductors in overhead transmission lines. The diameter of their bolt holes, pin holes, and other openings directly affects the fit accuracy with the connecting parts. Out-of-tolerance hole diameters can lead to loose line connections, abnormal stress, and threaten power transmission safety. Therefore, inspecting the diameter of each hole in the suspension clamp is an important part of the quality control process in the production of power fittings.

[0003] Currently, there are two main methods for inspecting the aperture of suspension clamps: one is manual inspection, where an operator uses measuring tools such as calipers, plug gauges, and inside micrometers to measure each hole individually; the other is machine vision inspection, which uses a camera to capture images of the holes, extracts edges and fits circles to obtain the pixel dimensions of the holes, and then converts them into aperture dimensions according to a pre-calibrated magnification. Among these, machine vision inspection is gradually replacing manual inspection due to its high efficiency and non-contact nature.

[0004] However, existing inspection methods still have the following shortcomings: First, the number of holes to be inspected in the suspension clamp is large and distributed in different parts of the clamp. Manual alignment of each hole or movement at a fixed step distance is easily affected by clamping deviation and individual size differences. Moreover, once the clamp moves during the inspection process, subsequent holes will continuously deviate from the inspection position. Second, visual inspection relies on the pre-calibrated magnification to convert the aperture. Fluctuations in clamping distance and backlight attenuation will cause the conversion result to drift, requiring frequent recalibration. Third, existing inspection methods only output the conclusion of whether the aperture is out of tolerance, and cannot distinguish the cause of the out-of-tolerance, nor can they guide the upstream processing process to make adjustments before batch out-of-tolerance occurs.

[0005] Therefore, the present invention provides a system and method for detecting the diameter of a suspension clamp. Summary of the Invention

[0006] In order to overcome the shortcomings of the prior art, at least one technical problem raised in the background art is solved.

[0007] The technical solution adopted by the present invention to solve its technical problem is: a suspension clamp hole diameter detection system, including a pre-positioning recognition module, used to acquire the whole image of the suspension clamp to be inspected, identify the pixel position of each hole to be inspected, and generate a shifting command for each hole to be inspected to enter the detection pose in sequence. The bearing positioning module is used to clamp the suspension clamp to be inspected and drive the suspension clamp to be inspected to translate and rotate. Its positioning surface edge is provided with a standard hole with a known diameter that penetrates the positioning surface. The bearing positioning module is also used to calculate the translation and rotation of the suspension clamp to be inspected relative to the theoretical pose based on the measured pixel position and theoretical pixel position of at least two measured holes, and to correct the subsequent displacement command of the hole to be inspected. The illumination imaging module includes a backlight unit, a telecentric lens, and an image sensor arranged along the imaging optical axis, used to enable the hole to be inspected in the detection pose and the standard hole to be imaged in the same field of view in the same frame. The image processing module is used to extract the sub-pixel edges of two transmitted light spots and obtain the pixel diameters of the hole to be inspected and the standard hole through circle fitting. Based on the ratio of the pixel diameters of the hole to be inspected and the standard hole and the known aperture of the standard hole, the aperture size of the hole to be inspected is calculated, and the local aperture of each sector of the hole contour is calculated. The judgment output module is used to compare the hole diameter with the design tolerance zone of the hole to be inspected and output the judgment result. It determines the out-of-tolerance type based on the circumferential distribution pattern of the hole diameter in each sector, and statistically analyzes the distribution center of the hole diameter at the same position on the same type of suspension clamp to be inspected in batches. When the sign of the signed offset of the distribution center relative to the center of the design tolerance zone is the same in at least three consecutive batches and the absolute value increases batch by batch, it outputs an adjustment prompt for the upstream processing process.

[0008] Preferably, the pre-positioning identification module includes: First, determine the pixel equivalent of the entire image based on the known aperture of the standard hole and the pixel diameter of the standard hole in the entire image; S201. Perform binary segmentation on the acquired whole image and extract connected components; identify the connected components corresponding to the standard hole according to the pixel position and pixel diameter of the standard hole in the whole image, and remove the connected components corresponding to the standard hole from the candidate area of ​​the hole to be inspected; determine the connected components in the remaining connected components whose pixel area is within the area range determined by the upper limit aperture, lower limit aperture and the pixel equivalent of the hole to be inspected, and whose ratio of the long side to the short side of the circumscribed rectangle is within the aspect ratio range determined by the circular connected components as candidate areas of the hole to be inspected; S202. Perform circle fitting on the edge of each candidate area of ​​the hole to be inspected, and determine the center of the fitted circle as the pixel position of the corresponding hole to be inspected. S203. Based on the pixel equivalent, the pixel displacement of each hole to be inspected relative to the current detection position is converted into the physical displacement of the bearing positioning module, and a shift command is generated; based on the pixel equivalent relationship between the whole image and the hole image and the pixel position of the standard hole in the hole image obtained by imaging in the same frame, the theoretical pixel position of each hole to be inspected under the detection pose is determined.

[0009] Preferably, the bearing positioning module calculates the translation and rotation of the suspended clamp under test relative to its theoretical pose, including: Obtain the measured pixel positions and theoretical pixel positions of at least two measured holes, and form a set of position point pairs with the measured pixel positions and theoretical pixel positions of each measured hole; The root mean square of the fitting residuals of all edge points of the hole image corresponding to the i-th measured hole is used as the fitting error of the i-th position point pair. The weight of the i-th position point pair is the reciprocal of the fitting error after constraining it to a lower limit of 0.01 pixels, and the value after normalizing the reciprocals of all position point pairs. The translation and rotation amounts are calculated with the goal of minimizing the sum of the squared weighted Euclidean distances between the measured pixel positions of each pair of points after translation and rotation composite transformation and the theoretical pixel positions.

[0010] Preferably, the bearing positioning module includes a clamping mechanism, an X-axis translation mechanism, a Y-axis translation mechanism, and a rotation mechanism that rotates about the normal to the positioning surface; the bearing positioning module controls the movement of the suspended clamp to be inspected and corrects the displacement command in the following manner: When the number of measured holes is less than two, the bearing positioning module moves according to the original displacement amount in the displacement command; After two holes have been measured, the displacement amount in the displacement command of the subsequent holes to be inspected is corrected according to the translation and rotation amounts, and the following steps are performed: S401. Correct the displacement amount in the displacement command of the next hole to be inspected according to the translation and rotation amount, and control the suspension clamp to be inspected to move according to the corrected displacement command. S402. Obtain the residual deviation between the measured pixel position and the theoretical pixel position of the next hole to be inspected in the hole image. If the residual deviation is not greater than the alignment upper limit, confirm that the correction is effective. Add the position point pair formed by the measured pixel position and the theoretical pixel position of the next hole to be inspected to the position point pair set. Recalculate the translation and rotation amounts. Correct the shift amount in the shift command of the subsequent hole to be inspected according to the recalculated translation and rotation amounts. The alignment upper limit is one-tenth of the number of pixels corresponding to the tolerance zone of the hole to be inspected. S403. If the residual deviation is greater than the alignment upper limit, it is determined that the suspension clamp under inspection has been displaced twice. The suspension clamp under inspection is controlled to return to the acquisition position of the whole piece image. The pre-positioning recognition module re-acquires the whole piece image and regenerates the displacement instructions for each undetected hole.

[0011] Preferably, the illumination imaging module includes: Obtain the width of the edge grayscale transition zone of the standard aperture transmitted light spot in the first valid aperture image, and use it as the reference edge grayscale transition zone width; Obtain the width of the grayscale transition band at the edge of the transmitted light spot through the standard aperture in the previous frame image; Before acquiring the hole image of the current hole to be inspected, the exposure time of the current hole image is determined based on the exposure time of the previous hole image, the width of the reference edge grayscale transition band, and the width of the edge grayscale transition band of the previous hole image, so that the width of the edge grayscale transition band of the standard hole transmitted light spot in the current hole image is equal to the width of the reference edge grayscale transition band.

[0012] Preferably, the image processing module further includes: Using the fitted center of the hole to be inspected as the vertex and the direction of the fixed edge of the positioning surface of the positioning module in the hole image as the zero-degree direction, determine the central angle of each rejected edge point; The rejected edge points are sorted according to their central angles, and the angle sequence that crosses the boundary between 0° and 360° is periodically expanded in 360°. A series of consecutive points whose difference between adjacent central angles is no greater than the central angle of a sector and which contains at least two rejected edge points is defined as a defect angle interval. The defect angle interval is defined by the central angle of the first rejected edge point and the central angle of the last rejected edge point in the corresponding series of consecutive points. The defect angle range is sent to the determination output module; When determining the type of out-of-tolerance, the output module compares the sector angle range of the local aperture out-of-tolerance with the defect angle range. If there is an overlap between the two, the out-of-tolerance type is determined to be a local defect at the aperture.

[0013] Preferably, the image processing module calculates the local aperture of each sector of the aperture contour, including: Using the fitted circle center of the hole to be inspected as the center, the hole outline is divided into M sectors according to the central angle, where M is an even number not less than 4. The opposite sector of each sector is determined; the opposite sector is the sector whose central angle differs from that of the sector by 180°. Calculate the average radial distance from each edge point in the sector to the center of the fitted circle to obtain the first radial distance; calculate the average radial distance from each edge point in the sector to the center of the fitted circle to obtain the second radial distance. The sum of the first radial distance and the second radial distance is used as the pixel quantity of the local aperture of the sector; the pixel quantity of the local aperture of each sector is converted into the local aperture of each sector according to the ratio of the pixel diameter and the known aperture. When any sector and / or its opposite sector has no edge point, the sector is identified as an invalid sector. The average local aperture of the two valid sectors located on both sides of the invalid sector and closest to the invalid sector along the circumferential direction is taken as the local aperture of the invalid sector. When all sectors are invalid sectors, the aperture image of the hole to be inspected is re-acquired.

[0014] Preferably, the determination output module determines the out-of-tolerance type based on the circumferential distribution pattern of the local aperture in each sector, including: Calculate the difference between the aperture size and the tolerance zone center to obtain the overall deviation; the tolerance zone center is the arithmetic mean of the upper limit aperture and the lower limit aperture of the hole to be inspected; Calculate the difference between the local aperture of each sector and the aperture size to obtain the local deviation of each sector; if the aperture size exceeds the design tolerance zone and the absolute value of the local deviation of each sector is not greater than the local judgment limit, determine the out-of-tolerance type as overall dimensional deviation. When the absolute value of the local deviation is greater than the local judgment limit, the sectors are continuously distributed in the circumferential direction, and the angle range of the continuous sectors overlaps with the defect angle range, the out-of-tolerance type is determined to be a local defect at the orifice. If there is a pair of sectors that are mutually opposite sectors, and the signs of their local deviations are the same and their absolute values ​​are both greater than the local judgment limit, and the signs of the local deviations of a pair of opposite sectors that are 90° apart from the center angle of the pair of sectors are opposite and their absolute values ​​are both greater than the local judgment limit, then the out-of-tolerance type is determined to be clamping deformation. The overall dimensional deviation, local defects at the orifice, and clamping deformation are judged in sequence. If the first condition is met, the corresponding deviation type is determined. If none of the three conditions are met, the deviation type is determined to be a compound deviation. The local judgment limit is one-tenth of the design tolerance band width.

[0015] Preferably, the determination output module outputs adjustment prompts for upstream processing steps, including: For the same hole position on the same type of suspension clamp to be inspected, the distribution center of the hole diameter is statistically analyzed by batch; the distribution center is the arithmetic mean of the hole diameter of the same hole position within the same batch; Calculate the signed offset of the distribution center of each batch relative to the tolerance zone center to obtain the offset sequence; When the signs of the signed offsets are the same in at least three consecutive batches and the absolute values ​​increase batch by batch, the offset sequence is linearly fitted to obtain the rate of change of the signed offset with the batch. When the product of the signed offset of the current batch and the rate of change is greater than zero, calculate the number of remaining batches required for the distribution center to reach the tolerance zone boundary in the current offset direction; The adjustment prompt includes the remaining batch number and the aperture offset direction; when the sector with the largest absolute value of local deviation in each sector is the same sector in at least three consecutive batches, the adjustment prompt also includes the center angle of that sector.

[0016] A method for detecting the aperture size of a suspension clamp includes the following steps: Step 1: Acquire the whole image of the suspension clamp to be inspected, identify the pixel position of each hole to be inspected, and generate a shift command for each hole to be inspected to enter the inspection pose in sequence. Step 2: Move according to the shift command, project backlight along the imaging optical axis and collect the hole image through the telecentric lens, so that the hole to be tested in the detection pose and the standard hole with the known hole diameter at the edge of the positioning surface are imaged in the same frame, and the standard hole is always within the field of view when each hole to be tested is detected in turn. Step 3: Extract the sub-pixel edges of the two transmitted light spots in the same frame image, perform circle fitting and remove edge points whose fitting residuals exceed the allowable range, then refit, and calculate the aperture size of the hole to be inspected according to the ratio of the pixel size of the hole to be inspected to the standard hole and the known aperture. Step 4: When the number of measured holes is less than two, move according to the original shift amount in the shift command; when the number of measured holes reaches two, calculate the translation and rotation amounts based on the measured pixel positions and theoretical pixel positions of at least two measured holes, and correct the shift amount in the subsequent shift command; if the residual deviation of the moved hole after correction is greater than the alignment upper limit, return to the acquisition position of the whole image and re-execute Step 1; otherwise, add the position point pair formed by the measured pixel position and theoretical pixel position of the hole to the position point pair set, and recalculate the translation and rotation amounts based on the updated position point pair set. The alignment upper limit is one-tenth of the number of pixels corresponding to the tolerance zone of the hole to be inspected. Step 5: Determine the type of out-of-tolerance based on the circumferential distribution of the local aperture in each sector; for the same hole position on the same type of suspension clamp to be inspected, count the distribution center of the aperture size by batch, and when the signs of the signed offsets are the same in at least three consecutive batches and the absolute values ​​increase batch by batch, output the adjustment prompt for the upstream processing process.

[0017] This invention provides a system and method for detecting the aperture size of a suspension clamp. It offers the following advantages: 1. This invention sets a standard hole with a known aperture at the edge of the bearing positioning surface, so that the standard hole is always within the field of view when each hole to be inspected is inspected in sequence. The hole to be inspected and the standard hole are imaged simultaneously in the same frame of hole image through the same optical path. The aperture size is converted by the ratio of the two pixel sizes and the known aperture size. The influence of the imaging magnification on the two holes cancels each other out in the proportional conversion, realizing aperture measurement without absolute calibration, suppressing the conversion drift caused by clamping distance fluctuation and backlight attenuation, and making the detection results of different batches and different time periods have a consistent conversion benchmark.

[0018] 2. This invention obtains the measured pixel positions and theoretical pixel positions of two or more measured holes, calculates the translation and rotation of the suspended clamp under test relative to the theoretical pose online, and corrects subsequent shift commands. After each hole is corrected, the residual deviation is used to verify the correction effect. When the correction is effective, the position point pair is added to the calculation for rolling correction. When it exceeds the alignment range, it returns to the acquisition position and re-identifies the whole piece. This realizes online compensation for clamp movement during the detection process and timely retraction when correction fails, avoiding continuous deviation of subsequent holes from the detection pose, and improving the alignment accuracy and reliability of multi-hole successive detection.

[0019] 3. This invention calculates the local hole diameter by dividing the hole contour into sectors according to the central angle. It determines the type of out-of-tolerance based on the circumferential distribution of the local hole diameter in each sector and counts the distribution center of the hole diameter size by batch. When the signs of the signed offsets are the same and the absolute values ​​increase batch by batch, it outputs adjustment prompts for the upstream processing steps. When the sectors with the largest absolute values ​​of local deviations are the same sector, the adjustment prompts also include the central angle of that sector. This allows the test results to directly guide the adjustment of feed, reclamping, deburring, and other treatment measures, thus avoiding the generation of batches of out-of-tolerance workpieces. Attached Figure Description

[0020] Figure 1 This is a flowchart of the method of the present invention; Figure 2 This is a schematic diagram illustrating the online pose correction, out-of-tolerance detection, and batch adjustment prompts of the present invention. Detailed Implementation

[0021] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0022] like Figures 1 to 2 As shown, the present invention proposes a suspension clamp aperture size detection system, including a pre-positioning recognition module, which is used to acquire the whole image of the suspension clamp to be inspected, identify the pixel position of each hole to be inspected, and generate a shift command for each hole to be inspected to enter the detection pose in sequence. The detection pose refers to the pose where the hole axis to be inspected is parallel to the imaging optical axis, and both the hole to be inspected and the standard hole are located within the field of view and depth of field of the telecentric lens. The shift command includes the displacement of the positioning module along the X-axis, the displacement along the Y-axis, and the rotation around the normal to the positioning surface. The complete image refers to an image whose field of view covers all holes to be inspected and the standard hole; the hole image refers to an image within the same frame that simultaneously contains the transmitted light spot of the current hole to be inspected and the transmitted light spot of the standard hole. The pixel diameter refers to the number of pixels corresponding to the diameter of the fitted circle in the image; The bearing positioning module is used to clamp the suspension clamp to be inspected and execute the displacement command. Its positioning surface edge is provided with a standard hole with a known diameter that penetrates the positioning surface. The hole axis of the standard hole is parallel to the imaging optical axis. It is also used to obtain the measured pixel position and theoretical pixel position of two or more measured holes, calculate the translation and rotation of the suspension clamp to be inspected relative to the theoretical pose, and correct the displacement amount in the displacement command of the subsequent hole to be inspected entering the detection pose according to the translation and rotation amount. The bearing positioning module includes a clamping mechanism, an X-axis translation mechanism, a Y-axis translation mechanism, and a rotation mechanism that rotates around the normal to the positioning surface; the shift command includes the X-axis displacement, the Y-axis displacement, and the rotation around the normal to the positioning surface; The illumination imaging module includes a backlight unit, a telecentric lens, and an image sensor arranged along the imaging optical axis. The backlight unit projects backlight along the imaging optical axis, so that the hole to be inspected and the standard hole in the detection pose form transmitted light spots in the same field of view. When each hole to be inspected is detected in sequence, the standard hole is always in the field of view. The image sensor acquires hole images through the telecentric lens. The image processing module, which communicates with the illumination imaging module, is used to extract the sub-pixel edges of the two transmitted light spots. After least-squares circle fitting and removing edge points whose fitting residuals exceed the allowable range, it is refitted to obtain the pixel diameter of the hole to be inspected and the pixel diameter of the standard hole. Based on the ratio of the pixel diameter of the hole to be inspected to the standard hole in the same frame of hole image and the known hole diameter, the hole diameter size of the hole to be inspected is calculated. With the fitting circle center of the hole to be inspected as the center, the hole contour is divided into M sectors according to the central angle, where M is an even number not less than 4, and the local hole diameter of each sector is calculated. The judgment output module, which communicates with the image processing module, is used to compare the aperture size with the design tolerance zone of the hole to be inspected and output the judgment result; determine the out-of-tolerance type based on the circumferential distribution pattern of the local aperture in each sector; for the same hole position on the same type of suspension clamp to be inspected, count the distribution center of the aperture size by batch; when the sign of the signed offset of the distribution center relative to the tolerance zone center is the same in at least three consecutive batches and the absolute value increases batch by batch, output the adjustment prompt for the upstream processing process; when the sectors with the largest absolute value of the difference between the local aperture and the aperture size in each sector are the same sector in at least three consecutive batches, the adjustment prompt also includes the center angle of that sector.

[0023] In some implementations, considering that the number of holes to be inspected in the suspension clamp is large and distributed in different parts of the clamp, if manual alignment of each hole or movement at a fixed step distance is relied upon, the holes to be inspected may deviate from the detection position due to clamping deviations and individual size differences, thereby introducing imaging errors.

[0024] Therefore, before formal testing, a one-time image acquisition and hole position recognition is performed on the entire wire clamp, automatically generating shift commands for each hole to be inspected to enter the inspection position sequentially, so that subsequent hole-by-hole inspection does not require manual intervention for alignment: Specifically, the pre-positioning recognition module generates shift instructions as follows: First, determine the pixel equivalent of the entire image based on the known aperture of the standard hole and the pixel diameter of the standard hole in the entire image; S201. Perform binary segmentation on the acquired whole image, dividing the pixels in the whole image into two categories, target and background, according to their gray values, so that the hole area is separated from the clamp body area; then extract the connected components formed by interconnected pixels of the same type in the binary image, with each hole to be inspected corresponding to a connected component. Identify the connected component corresponding to the standard hole based on the pixel position and pixel diameter of the standard hole in the whole image, and remove the connected component corresponding to the standard hole from the candidate area of ​​the hole to be inspected; determine the connected component whose area and the aspect ratio of the circumscribed rectangle are both within the range determined by the upper limit hole diameter, the lower limit hole diameter, and the pixel equivalent as the candidate area of ​​the hole to be inspected.

[0025] The dual screening method using area and aspect ratio of the circumscribed rectangle is because, in addition to the hole to be inspected, there may be other interfering areas in the entire image, such as edge gaps of wire clamps, surface scratches, and installation gaps. Simply screening by area cannot eliminate long and thin scratches or strip-shaped edge gaps. However, the aspect ratio of the circumscribed rectangle of the hole to be inspected is close to 1. By constraining the aspect ratio, the above-mentioned narrow and long interfering areas can be eliminated, so that the candidate areas correspond one-to-one with the holes to be inspected.

[0026] S202. Perform circle fitting on the edges of each candidate area of ​​the hole to be inspected, and determine the center of the fitted circle as the pixel position of the corresponding hole to be inspected. Since the hole to be inspected by the hanging clamp is a circular hole, its edge points are theoretically concentric. The circle fitting uses all edge points for synthesis. Compared with directly taking the centroid of the connected region, it is less affected by local edge defects and burrs, and the determined hole center is more accurate.

[0027] S203. Based on the pixel position of each hole to be inspected and the pixel position of the standard hole, determine the theoretical pixel position of each hole to be inspected in the detection pose, and generate shift commands to drive the bearing positioning module to move in sequence according to the arrangement order of each hole to be inspected; the theoretical pixel position refers to the expected pixel position in the hole image after the hole to be inspected moves to the detection pose according to the shift command.

[0028] S203 above uses the standard hole as a common coordinate reference and determines the pixel equivalent relationship between the whole image and the hole image by utilizing the known diameter of the standard hole and its pixel diameter in the whole image and hole image, thereby converting the pixel position in the whole image coordinate system to the hole image coordinate system. The arrangement order is determined according to the order in which the sum of the movement distances between each hole to be inspected is minimized.

[0029] The pixel equivalent ratio between the whole-part image and the hole image is determined by using the ratio of the pixel diameter of the standard hole in the whole-part image to the pixel diameter of the standard hole in the hole image. The center of the standard hole is identified in the current hole image. The position vector of the hole to be inspected relative to the standard hole in the whole-part image is converted to the hole image coordinate system according to the pixel equivalent ratio. This vector is then combined with the center position of the standard hole in the current hole image to obtain the theoretical pixel position of the hole to be inspected. The angle between the coordinate axes of the whole-part image coordinate system and the hole image coordinate system is determined by the fixed installation relationship between the whole-part camera and the telecentric lens. If the fixed installation relationship cannot determine the angle between the coordinate axes, a second standard hole is set at the edge of the positioning surface, and the angle between the coordinate axes is determined by the line connecting the two standard holes.

[0030] Through the above steps S201 to S203, a single whole-piece imaging process can automatically identify and plan the movement of all holes to be inspected, eliminating the need for manual alignment of each hole during the inspection process. The dual screening eliminates interference from scratches, gaps, and other defects, and the circle fitting makes the determination of the hole center less susceptible to local edge defects and burrs. The generated theoretical pixel position also provides a comparison benchmark for the subsequent calculation of translation and rotation, connecting the pre-positioning step with the movement error compensation step, thereby improving the alignment accuracy and the level of automation in the inspection.

[0031] Based on the theoretical pixel positions of each hole to be inspected determined in S203 above, considering that the suspended clamp to be inspected may shift relative to its theoretical pose due to vibration, stress release, etc. during the inspection process, if it still moves according to the original shift amount in the shift command, the subsequent holes to be inspected will deviate from the detection pose, thus introducing imaging errors. Therefore, in some embodiments, the bearing positioning module uses the detection results of two or more measured holes to calculate the actual pose of the clamp online, and corrects the shift amount of the subsequent holes to be inspected accordingly. Specifically, the translation and rotation amounts are calculated as follows: When the number of measured holes is less than two, since the number of position point pairs is insufficient to simultaneously determine the translation and rotation, the bearing positioning module moves according to the original displacement in the displacement command and does not perform rotation calculation; after the first hole to be inspected is inspected, only its position point pair is recorded, and the bearing positioning module still moves the second hole to be inspected to the inspection pose according to the original displacement; after the second hole to be inspected is inspected, the number of measured holes reaches two, and the translation and rotation are calculated in the following manner, and the displacement in the displacement command is corrected from the third hole to be inspected. First, a position pair is formed using two or more measured holes, where a measured hole refers to the hole to be inspected that has been moved to the detection pose and completed hole image acquisition; the measured pixel position of each measured hole... After the image processing module performs subpixel edge extraction and circle fitting on the hole image of the corresponding hole, the pixel coordinates of the fitted circle center are sent to the bearing positioning module to obtain the image. Theoretical pixel position of each measured hole The pre-positioning identification module determines and stores the information in S203 above, and the bearing positioning module retrieves the information one by one according to the order of the measured holes. and All coordinates are two-dimensional, with pixels as the unit. The subscript i represents the sequence number of the measured hole. n is the number of holes that have been measured, n≥2; Furthermore, the weights of each pair of position points are determined. The root mean square of the fitting residuals of all edge points in the hole image corresponding to the i-th measured hole is taken as the fitting error of the i-th position point pair. Fitting errors less than 0.01 pixels are treated as 0.01 pixels. The reciprocal of the processed fitting error is taken, and the reciprocal of each position point pair is divided by the sum of the reciprocals of all position point pairs to obtain the weight of each position point pair. After normalization, the sum of the weights of all position point pairs is 1.

[0032] The reason for using the above weighting method is that the smaller the circle fitting residual, the more complete the edge imaging of the corresponding hole and the more accurate the positioning of the fitted circle center. The reliability of its position point pair is higher, and giving it greater weight can suppress the influence of abnormal hole positions such as occlusion and burrs on the calculation results. Finally, the translation and rotation are calculated. The pose change of the suspended wire clamped within the positioning surface is a rigid body transformation, and theoretically, each pair of points satisfies the same translation and rotation relationship, i.e. ; Where t is the translation amount to be calculated, with pixels as the unit; R is the two-dimensional rotation matrix determined by the rotation amount θ, where θ is the rotation amount to be calculated, with radians as the unit; due to random errors in actual measurements, each pair of positions cannot simultaneously and strictly satisfy the above relationship. Therefore, the calculation is performed with the objective of minimizing the sum of squared weighted distances between the measured pixel positions of each pair of positions after the composite transformation of translation and rotation and the theoretical pixel positions. That is, t and θ are minimized by solving the following formula: ; In the formula, J is the weighted sum of squared distances of all position point pairs, which represents the overall deviation between the calculated pose transformation relationship and each position point pair, and its dimension is square pixels; This represents the squared Euclidean distance between two-dimensional vectors; the meanings of the other symbols are the same as before.

[0033] During calculation, the weighted centroids of the measured and theoretical pixel positions are first calculated according to the weights of all position point pairs. Then, the orientation angles of the measured and theoretical pixel positions relative to their corresponding weighted centroids are calculated, and the weighted average of the differences between these two orientation angles is used as the rotation amount θ. Finally, the rotation matrix R determined by the rotation amount θ is substituted back, and the difference between the weighted centroids of the theoretical and measured pixel positions after rotation is used as the translation amount t. Whenever a hole to be inspected is detected, its position point pair is added to the calculation, the weights are redefined, and the above calculation is repeated, so that the translation and rotation amounts are updated hole-by-hole as the detection progresses.

[0034] After calculating the translation and rotation amounts, the two are superimposed on the displacement amount in the displacement command of the subsequent hole to be inspected, so that after the wire clamp moves according to the corrected displacement amount, the subsequent hole to be inspected will still accurately enter the inspection position.

[0035] Using the above method, the actual position and orientation of the wire clamp are calculated and corrected online based on the detection results of the measured holes. The offset of the wire clamp during the detection process can be compensated in a timely manner. The weighted calculation makes the hole with good imaging quality play a leading role, avoiding the calculation results of individual occluded or burr holes, so that subsequent holes can enter the detection orientation according to the corrected shift command.

[0036] As an optional embodiment, based on the above calculation methods for translation and rotation, and considering that the correction is only based on the historical detection results of the measured holes, and that the accuracy of the first hole to be inspected after correction has not been verified, if the wire clamp shifts again during the correction process, continuing to move according to the inaccurate correction amount will cause subsequent holes to continuously deviate from the detection pose, and the deviation will accumulate hole by hole. Therefore, in some embodiments, the bearing positioning module verifies the correction result after each hole is corrected, and performs rolling correction or repositioning according to the verification result. Specifically, it is done in the following manner: When the number of measured holes is less than two, the bearing positioning module moves according to the original displacement amount in the displacement command and does not perform rotation calculation; after the number of measured holes reaches two, the following rolling correction steps are executed. S401. Correct the displacement amount in the displacement command of the next hole to be inspected according to the translation and rotation amount, and control the suspension clamp to be inspected to move according to the corrected displacement command.

[0037] S402. Obtain the residual deviation between the measured pixel position and the theoretical pixel position of the next hole to be inspected in the hole image. If the residual deviation is not greater than the alignment upper limit, confirm that the correction is effective. Add the measured pixel position and the theoretical pixel position of the next hole to be inspected to the position point pair set. Recalculate the translation and rotation amounts. Correct the shift amount in the shift command of the subsequent hole to be inspected according to the recalculated translation and rotation amounts.

[0038] The residual deviation refers to the Euclidean distance between the measured pixel position and the theoretical pixel position of the hole under inspection, with the dimension of pixels. The measured pixel position is determined by the center of the fitted circle output by the image processing module after sub-pixel edge extraction and circle fitting of the current hole image. The theoretical pixel position is determined by the pre-positioning recognition module in S203 above. Both are existing data and do not require additional acquisition. The alignment upper limit is one-tenth of the number of pixels corresponding to the tolerance zone of the hole under inspection. The number of pixels corresponding to the tolerance zone is determined based on the tolerance zone of the hole under inspection and the pixel equivalent of the hole image. Since the imaging parameters of the backlight unit and the telecentric lens are fixed, the conversion relationship between the physical size of the aperture and the pixel size is determined. Therefore, the number of pixels corresponding to the tolerance zone can be pre-calculated.

[0039] It should be noted that the reason for adding the current hole position pair to the position pair set and recalculating when the correction is effective is that the more position pairs involved in the calculation, the closer the calculation results of translation and rotation are to the actual pose of the wire clamp. In addition, the newly added position pair reflects the latest pose state of the wire clamp. The rolling correction of each hole can make the correction amount converge continuously as the detection is carried out, avoiding the correction amount calculated once being used throughout the process and gradually becoming inaccurate.

[0040] S403. If the residual deviation is greater than the alignment upper limit, it is determined that the suspension clamp under inspection has been displaced twice. The suspension clamp under inspection is controlled to return to the acquisition position of the whole piece image. The pre-positioning recognition module re-acquires the whole piece image and regenerates the displacement instructions for each undetected hole.

[0041] It should be noted that secondary displacement refers to the pose change of the wire clamp during the inspection process due to vibration, loosening of the clamp, or other reasons. At this time, all the position pairs used in the previous calculation have become invalid. Continuing to correct based on the original point pairs lacks a reliable comparison benchmark. Therefore, the acquisition position is returned to re-identify the entire part and re-plan the movement, so that subsequent inspections are based on the reconfirmed hole positions. After regenerating the displacement command, the inspection results of each hole that has been inspected are retained, and only the uninspected holes are inspected to avoid duplicate inspections.

[0042] Through the above steps S401 to S403, the correction effect is verified by residual deviation after each hole is corrected. When the correction is effective, the position point pair is updated and recalculated to make the correction amount converge hole by hole. When the residual deviation exceeds the range, it is returned to repositioning to avoid the accumulation of inaccurate correction amounts hole by hole, which will cause continuous misjudgment. This ensures the consistency of the test results of all holes to be inspected, while also taking into account the continuity of the inspection process, so that the whole piece does not need to be scrapped and re-inspected due to individual movement.

[0043] In some implementations, the illumination imaging module includes a backlight unit, a telecentric lens, and an image sensor arranged sequentially along the imaging optical axis.

[0044] The backlight unit projects backlight onto the suspended clamp under test along the imaging optical axis. The reason for using backlight projection instead of front illumination is that aperture detection focuses on the outline size of the aperture. After the backlight is transmitted through the aperture under test, it forms a bright transmitted light spot, while the clamp body is opaque and forms a dark area. The contrast between light and dark directly reflects the edge of the aperture, avoiding the interference of surface reflection and texture on the extraction of the aperture edge under front illumination. Optionally, the backlight unit includes a light source and a light doubling plate. The light emitted by the light source is doubled by the light doubling plate and then projected in parallel to make the illuminance uniform throughout the field of view.

[0045] The telecentric lens is positioned between the suspended clamp under test and the image sensor. The image sensor acquires the aperture image through the telecentric lens. The reason for using a telecentric lens is that the position of the aperture under test and the standard aperture in the imaging optical axis differs. The magnification of a regular lens changes with the object distance, causing the ratio of the pixel sizes of the two apertures in the same frame to deviate from the actual aperture ratio. The magnification of the telecentric lens does not change with the object distance, so the ratio of the pixel sizes of the two transmitted light spots acquired in the same frame is equal to the actual aperture ratio, providing an optical basis for subsequent proportional conversion of aperture size.

[0046] The illumination imaging module's field of view covers the detection pose and the imaging area of ​​the standard hole within the entire detection stroke of the bearing positioning module; both the hole to be inspected and the standard hole in the detection pose are within the depth of field of the telecentric lens. When the bearing positioning module moves the suspended clamp to be inspected sequentially, the standard hole moves synchronously with the bearing positioning module, and its pixel position in the hole image changes, but it is still within the field of view of the image sensor.

[0047] It should be noted that a hole image refers to an image that simultaneously contains the transmitted light spot of the hole to be inspected and the transmitted light spot of the standard hole in the same frame. Since the standard hole is set at the edge of the positioning surface of the positioning module, the standard hole is always within the field of view when each hole to be inspected enters the detection position in sequence. Therefore, each frame of hole image contains two transmitted light spots at the same time. The two are imaged by the same telecentric lens, the same image sensor, and at the same time, and their imaging optical path and exposure parameters are the same.

[0048] Furthermore, considering that the light intensity of the backlight unit will decrease with the duration of use and that the ambient light will fluctuate, and that the edge sharpness of the transmitted light spot is directly affected by the degree of exposure: when the exposure is too high, the edge halo expands outward, and when the exposure is too low, the edge is dark and blurry, both of which will cause the position of the sub-pixel edge extraction to shift, thereby affecting the conversion accuracy of the pixel size ratio; therefore, in some embodiments, when the image sensor acquires the image through the telecentric lens aperture, its exposure time is adjusted frame by frame. Specifically, it shall be done in the following manner: Obtain the width of the grayscale transition band at the edge of the standard aperture transmitted light spot in the previous frame image. , where k is the frame number of the hole image, The width of the edge grayscale transition band refers to the number of pixels that the grayscale value at the edge of the transmitted light spot transitions from the background grayscale to the saturated grayscale, with the dimension being pixels. Specifically, a radial sampling line is drawn outward from the fitting circle center of the standard aperture, and the distance from the pixel point on the sampling line to the fitting circle center is denoted as r. The distribution curve of grayscale value with r is extracted. On this curve, the grayscale value transitions from the background grayscale of the dark area... The saturated gray level rises to the light spot The number of pixels spanned by the interval is the width W of the edge grayscale transition band, where , All values ​​are grayscale values, dimensionless, and the dimension of r is pixels.

[0049] The reason for using the width of the edge grayscale transition band as the feedback quantity is that this width directly represents the sharpness of the light spot edge. Compared with using the average grayscale of the entire image as the feedback quantity, it is not affected by the change in the proportion of the line clip body within the field of view, and can accurately reflect the change in the edge extraction benchmark. Before acquiring the image of the hole to be inspected, the exposure time of the image sensor is adjusted so that the width of the gray-scale transition band at the edge of the transmitted light spot of the standard hole in the current frame image is equal to the width of the gray-scale transition band at the reference edge. Specifically, the exposure time corresponding to the k-th frame image... Determine by the following formula: , , ; In the formula: The exposure time when the previous frame of the hole image was captured. Both are measured in milliseconds, representing the exposure time when the current frame aperture image is captured. The width of the grayscale transition zone at the baseline edge is taken as the width of the grayscale transition zone at the edge of the standard aperture transmitted light spot in the first valid aperture image, with the dimension being pixels; The width of the grayscale transition zone at the edge of the standard aperture transmitted light spot in the previous frame image is measured in pixels. The ratio is dimensionless, and both sides of the equation have the same dimensions. The first valid aperture image refers to the first frame of aperture image in which the edge of the transmitted light spot of the standard aperture is successfully extracted and the width of the gray-scale transition band at the edge is greater than zero. If the width of the gray-scale transition band at the edge of the previous frame of aperture image is zero, or if the calculated exposure time exceeds the exposure time range of the image sensor, the image sensor re-acquires the aperture image of the current aperture to be inspected according to the initial exposure time; if a valid edge gray-scale transition band width cannot be obtained after re-acquisition, the current aperture image is marked as an invalid image.

[0050] When detecting the first hole, there is no previous frame image of the hole; the image sensor uses the initial exposure time. The first frame of the aperture image is acquired; the initial exposure time is determined based on the rated light intensity of the backlight unit and the response characteristics of the image sensor, and is based on the first valid aperture image. This serves as the benchmark for adjustments in subsequent frames.

[0051] With the above settings, the backlight and telecentric lens ensure that the imaging optical path and exposure parameters of the two transmitted light spots in the same frame are the same, providing a basis for proportionally converting the aperture size. Using the width of the gray transition band at the edge of the standard aperture as feedback, the exposure time is adjusted frame by frame according to the proportional relationship, so that the edge extraction benchmark of each frame of aperture image remains constant. Backlight attenuation and ambient light fluctuations no longer cause the drift of the edge extraction position, so that aperture images collected in different batches and at different times have a consistent edge extraction benchmark.

[0052] Based on the hole images acquired frame by frame by the aforementioned illumination imaging module, each frame of the hole image simultaneously contains the transmitted light spot of the hole to be inspected in the detection pose and the transmitted light spot of the standard hole. Considering that the transmitted light spot is only a grayscale image, the aperture size of the hole still needs to be obtained by converting the pixel size of the light spot. The conversion accuracy is directly affected by the edge extraction accuracy and the imaging magnification: if the edge extraction is only accurate to the pixel level, the conversion result will have quantization error; if the imaging magnification fluctuates with the clamping distance, the aperture size directly converted from the pixel size will drift accordingly.

[0053] Therefore, it is necessary to solve two problems in the image processing stage: edge subpixel localization and magnification effect elimination.

[0054] Specifically, the image processing module is communicatively connected to the illumination imaging module, receives the aperture images acquired by the image sensor frame by frame, and processes them as follows: First, the sub-pixel edges of the two transmitted light spots in the aperture image are extracted. Specifically, the gray-level distribution is extracted radially along the light spot, the radial gray-level gradient curve is calculated, and quadratic curve interpolation is performed on the radial gray-level gradient curve. The peak position of the interpolation curve is used as the sub-pixel position of the edge point, so that the edge positioning accuracy is better than one pixel.

[0055] Then, least-squares circle fitting is performed on the edge points of each transmitted light spot. The difference between the distance from each edge point to the fitted circle and the average radius is calculated as the fitting residual for each edge point. After removing edge points whose absolute value of the fitting residual is greater than three times the standard deviation of the fitting residual, least-squares circle fitting is performed again on the remaining edge points. The diameter of the refitted circle is taken as the pixel diameter of the corresponding hole. Let the pixel diameter of the hole to be inspected be D, and the pixel diameter of the standard hole be... D and All dimensions are pixels; the standard deviation of the fitting residual is calculated from the fitting residuals of all edge points in this fitting. The reason for refitting after removing edge points is that edge points at the hole opening and notches will pull the fitting circle off-center. After removing edge points with abnormal residuals and refitting, the resulting pixel diameter reflects the true size of the hole body. Subsequently, based on the ratio of the pixel size of the hole to be inspected to the standard hole in the same frame image and the known hole diameter, the hole diameter d of the hole to be inspected is calculated, i.e. ; in Given the known diameter of a standard hole. , The dimensions of all are millimeters. It is a dimensionless ratio; the reason for using the same frame ratio conversion is that: the two holes are imaged through the same optical path in the same frame, and the imaging magnification has the same effect on the two. When converted according to the ratio of pixel size, the effect of magnification cancels each other out, and there is no need to perform absolute calibration of the imaging system. Furthermore, the hole profile is divided into M sectors based on the central angle, with the fitted circle of the hole to be inspected as the center. M is an even number not less than 4, such as 8 or 12. The local hole diameter of each sector is calculated to reflect the distribution pattern of the hole diameter along the circumference. Furthermore, the central angle of each rejected edge point is determined by taking the fitted center of the hole to be inspected as the vertex and the fixed edge direction of the positioning surface of the positioning module in the hole image as the zero-degree direction.

[0056] Sort each rejected edge point according to its central angle, and perform a 360° periodic expansion on the angle sequence that crosses the boundary between 0° and 360°; define a defect angle interval as a continuous point sequence in which the difference between adjacent central angles is no greater than the central angle corresponding to a sector and contains at least two rejected edge points; the defect angle interval is defined by the central angle of the first rejected edge point and the central angle of the last rejected edge point in the corresponding continuous point sequence.

[0057] The defect angle range is sent to the judgment output module. When determining the out-of-tolerance type, the judgment output module compares the sector angle range of the local aperture out-of-tolerance with the defect angle range; if the two overlap, the out-of-tolerance type is determined to be a local aperture defect; if the two do not overlap, the defect angle range is not used as the basis for judgment, and the out-of-tolerance type is determined according to the circumferential distribution pattern of the local aperture in each sector.

[0058] With the above settings, the sub-pixel edge extraction and residual removal followed by refitting make the pixel diameter calculation results less susceptible to the influence of burrs and notch edge points. Sector division provides circumferential distribution information of aperture. The circumferential statistics of the removed edge points enable the identification of defect orientation and corroborate the out-of-tolerance angle of the local aperture in the sector, improving the reliability of out-of-tolerance type determination and providing accurate orientation basis for subsequent process adjustments.

[0059] Based on the above sector division, considering that if the diameter of the overall fitted circle is directly used to represent the aperture of each sector, deformations such as ellipticization and local flattening of the aperture will be uniformized by the overall fitting, and local differences at the deformation location cannot be reflected, the orientation resolution will be lost when determining the out-of-tolerance type according to the distribution pattern; therefore, in some implementations, the image processing module calculates the local aperture of each sector in the following way: First, each edge point is assigned to its corresponding sector based on its central angle relative to the fitted circle's center; that is, edge points whose central angle falls within the range of a sector's central angle belong to that sector. Then, for each sector, its radial sector is determined; the radial sector is the sector whose central angle differs from the fitted circle's center by 180°. The average radial distance from each edge point within this sector to the fitted circle's center is calculated and denoted as the first radial distance. Calculate the average radial distance from each edge point within the radial sector to the center of the fitted circle, and denot it as the second radial distance. Where the subscript m is the sector number. , and The units of measurement are all pixels; Subsequently, the sum of the first radial distance and the second radial distance is used as the pixel quantity of the local aperture of the m-th sector. ,Right now The unit of measurement is pixels; then, based on the pixel size ratio mentioned above and the known aperture, the pixel count of the local aperture of each sector is converted into the local aperture of each sector. ,Right now The dimension is millimeter, and the formula is as follows: , The meaning is the same as before; where, when any sector or at least one of its opposite sectors does not have an edge point, the sector is determined as an invalid sector, and the average of the local apertures of the two valid sectors located on both sides of the invalid sector along the circumferential direction and closest to the invalid sector is taken as the local aperture of the invalid sector; when all sectors are invalid sectors, the aperture image of the hole to be inspected is re-acquired.

[0060] It should be noted that the reason for using paired sector calculation is that the local aperture of each sector is determined only by the actual edge position of the sector and its opposite sector. Without the homogenization of the overall fitting, the local aperture change at the deformation location is preserved in reality, and the distribution pattern of the aperture along the circumference is truly reflected.

[0061] In this way, the local aperture of each sector corresponds one-to-one with the actual contour of the aperture, so that the judgment output module has accurate orientation resolution when determining the out-of-tolerance type according to the distribution pattern. The circumferential aperture difference caused by deformation such as ellipticization and local flattening can be identified and located to the specific sector.

[0062] Local aperture in each sector After determining the matching method of the diameter sector as described above, considering that the causes of the diameter deviation are different, the corresponding handling measures are also different: the overall size deviation needs to be adjusted for machining feed, the clamping deformation needs to be re-clamped, and the local defects at the hole opening need to be deburred or repaired; if only the deviation conclusion is output without distinguishing the cause, the detection system cannot provide effective guidance for subsequent processing.

[0063] Therefore, in some implementations, the output module determines the type of out-of-tolerance based on the circumferential distribution of local apertures in each sector. Specifically, this is done as follows: First, calculate the difference between the diameter of the hole to be inspected and the center of the tolerance zone to obtain the overall deviation; the center of the tolerance zone is the arithmetic mean of the upper and lower limit diameters of the hole to be inspected. Then, calculate the difference between the local diameter and the diameter of each sector to obtain the local deviation for each sector.

[0064] If the aperture size exceeds the design tolerance zone, and the absolute value of the local deviation in each sector is not greater than the local judgment limit, the out-of-tolerance type is determined to be overall dimensional deviation.

[0065] When the absolute value of the local deviation is greater than the local judgment limit, the sectors are continuously distributed in the circumferential direction, and the angle range of the continuous sectors overlaps with the angle range of the defect, the out-of-tolerance type is determined to be a local defect at the orifice.

[0066] If there is a pair of sectors that are opposite to each other, and the signs of their local deviations are the same and their absolute values ​​are both greater than the local judgment limit, and the signs of the local deviations of a pair of opposite sectors whose center angles differ from those of the pair of sectors are opposite and their absolute values ​​are both greater than the local judgment limit, then the out-of-tolerance type is determined to be clamping deformation.

[0067] The above-mentioned overall dimensional deviation, local defects at the orifice, and clamping deformation are judged in sequence. If the first condition is met, the corresponding deviation type is determined. If none of the three conditions are met, the deviation type is determined to be a compound deviation. The local judgment limit is one-tenth of the design tolerance band width.

[0068] Furthermore, in some implementations, the determination output module also compares the sector angle of the local aperture deviation with the defect angle range sent by the image processing module. If the two overlap, the deviation type is confirmed as a local aperture defect. The reason is that a local aperture defect causes both a change in the local aperture in the corresponding orientation and edge point removal. When the angles of the two manifestations are consistent, they corroborate each other, making the determination result more reliable.

[0069] Through the above methods, the type of out-of-tolerance is automatically determined by the circumferential distribution pattern. Different causes of out-of-tolerance correspond to different morphological characteristics. The judgment results can directly guide the treatment measures such as adjusting the feed, re-clamping, and deburring. The verification of the defect angle range further avoids misjudgment caused by a single basis, and improves the accuracy of out-of-tolerance type determination and the effectiveness of treatment guidance.

[0070] Based on the statistical analysis of the bore diameters of each batch, the output module performs batch statistics for the same bore position on the same type of suspension clamp under inspection. The distribution center is the arithmetic mean of the bore diameters of the same bore position within the same batch; the difference between the distribution center of each batch and the tolerance zone center is the signed offset, denoted as batch number b, and the signed offset of the b-th batch is... ; When the signs of the signed offsets are the same for at least three consecutive batches and the absolute values ​​increase batch by batch, a linear fit is performed with the batch number as the x-axis and the signed offset as the y-axis. The slope of the fitted line is the rate of change v of the signed offset with the batch, with the dimension being millimeters per batch.

[0071] The signed offset of the current batch is The distance from the center of the tolerance zone to the corresponding boundary of the tolerance zone along the current offset direction is , and The dimensions of all are millimeters. , and At that time, the number of remaining batches required for the distribution center to reach the tolerance zone boundary in the current offset direction. for: ; Calculated Then round down to the nearest integer to get the estimated number of remaining complete batches; when At that time, the number of remaining complete batches is expected to be zero; when If the distribution center does not continue to shift towards the tolerance zone boundary, the remaining batch number will not be output.

[0072] The adjustment prompts include the expected number of remaining complete batches and the aperture offset direction; if the sector with the largest absolute value of local deviation in each sector is the same sector in at least three consecutive batches, the adjustment prompts also include the center angle of that sector.

[0073] It should be noted that if there are fewer than three consecutive batches that meet the same sign and whose absolute values ​​increase in batches, linear fitting and extrapolation will not be performed, and only the distribution center of each batch will be counted; when the rate of change v is zero, it indicates that the distribution center has no drift trend, and no adjustment prompt will be output.

[0074] Through the above methods, batch statistics are transformed from post-event qualitative prompts to quantitative predictions. The adjustment prompts provide the adjustment direction and time limit, allowing the production team to arrange adjustments before the distribution center reaches the tolerance zone boundary. This avoids producing workpieces that are close to exceeding the tolerance during the drift period and also avoids frequent unfounded shutdowns for inspection.

[0075] The above testing process will be explained below with reference to a set of specific testing parameters.

[0076] In one embodiment, the number of sectors M is 8, and the known diameter of the standard hole... The pixel diameter of the standard aperture is 5.000mm. The resolution is 250.0 pixels. The upper limit aperture of the hole to be inspected is 5.220 mm, the lower limit aperture is 5.180 mm, the center of the tolerance zone is 5.200 mm, and the local judgment limit is 0.004 mm.

[0077] The image processing module extracts the pixel diameter D of the hole to be inspected as 260.8 pixels. Based on the ratio of the pixel diameter of the hole to be inspected to that of the standard hole and the known diameter of the standard hole, the diameter d of the hole to be inspected is obtained as 5.216 mm.

[0078] The aperture size is within the design tolerance zone; if the local apertures of the 67.5° sector and the 112.5° sector are 5.222mm and 5.221mm respectively, then the local deviations of the two sectors are 0.006mm and 0.005mm respectively, both of which are greater than the local judgment limit, and the two sectors are continuously distributed along the circumference; when the angle range of the continuous sector overlaps with the defect angle range, although the aperture size does not exceed the design tolerance zone, the local apertures of the two sectors have exceeded the upper limit aperture of 5.220mm, and the hole to be inspected is judged to be out of tolerance, and the out-of-tolerance type is determined to be a local defect at the hole opening.

[0079] During the pose correction process, the pixel count corresponding to the tolerance zone of the hole under inspection is 2.0 pixels, and the alignment upper limit is 0.2 pixels.

[0080] After the first hole to be inspected is detected, only one pair of position points is obtained. The bearing positioning module moves the second hole to be inspected to the detection pose according to the original displacement command. After the second hole to be inspected is detected, two pairs of position points are obtained. The translation and rotation amounts are calculated, and the displacement command is corrected starting from the third hole to be inspected. If the residual deviation after correction for the third hole to be inspected is 0.12 pixels, the correction is confirmed to be effective and the position point pair is added to the position point pair set. If the residual deviation after correction for a subsequent hole to be inspected is 0.45 pixels, it is determined that the suspended clamp under inspection has undergone secondary displacement. The entire image acquisition position is returned and the entire recognition is re-executed.

[0081] During exposure adjustment, the exposure time for the first valid aperture image is 8.0 ms, and the reference edge grayscale transition band width is 6.0 pixels; if the edge grayscale transition band width of the previous aperture image is 7.5 pixels, then the exposure time of the current aperture image is adjusted accordingly. The calculation yielded 6.4ms.

[0082] During batch statistics, three consecutive batches of the same type of suspension clamp to be inspected were statistically analyzed for the same hole position. The distribution centers of the three batches were 5.201mm, 5.203mm, and 5.205mm, respectively, with corresponding signed offsets of 0.001mm, 0.003mm, and 0.005mm. The three signed offsets had the same sign and their absolute values ​​increased batch by batch. Linear fitting yielded a change rate of 0.002mm / batch. The tolerance zone boundary distance in the current offset direction is 0.020mm, and the signed offset of the current batch is 0.005mm. Therefore, the number of remaining batches is... After rounding down, 7 complete batches are obtained; if the sector with the largest absolute value of local deviation in three consecutive batches is the 112.5° sector, then the adjustment prompt includes 7 complete batches, the direction of larger aperture, and the center angle of the 112.5° sector.

[0083] In some embodiments, the present invention further provides a method for detecting the aperture size of a suspension clamp, comprising the following steps: Step 1: Acquire the whole image of the suspension clamp to be inspected, identify the pixel position of each hole to be inspected, and generate a shift command for each hole to be inspected to enter the inspection pose in sequence. Step 2: Move according to the shift command, project backlight along the imaging optical axis and collect the hole image through the telecentric lens, so that the hole to be tested in the detection pose and the standard hole with known hole diameter at the edge of the positioning surface are imaged in the same frame, and the standard hole is always within the field of view when each hole to be tested is detected in turn. Step 3: Extract the sub-pixel edges of the two transmitted light spots in the same frame image, perform circle fitting and remove edge points whose fitting residuals exceed the allowable range, then refit. Calculate the aperture size of the hole to be inspected based on the ratio of the pixel diameter of the hole to the standard hole and the known aperture. Step 4: When the number of measured holes is less than two, move according to the original shift amount in the shift command; when the number of measured holes reaches two, calculate the translation and rotation amounts based on the measured pixel positions and theoretical pixel positions of at least two measured holes, and correct the shift amount in subsequent shift commands; if the residual deviation of the moved hole after correction is greater than the alignment upper limit, return to the acquisition position of the entire image and re-execute Step 1; otherwise, add the position point pair formed by the measured pixel position and theoretical pixel position of the hole to the position point pair set, and recalculate the translation and rotation amounts based on the updated position point pair set; the alignment upper limit is one-tenth of the pixel quantity corresponding to the tolerance zone of the hole to be inspected; Step 5: Determine the type of out-of-tolerance based on the circumferential distribution of the local aperture in each sector; for the same hole position on the same type of suspension clamp to be inspected, count the distribution center of the aperture size by batch, and when the signs of the signed offsets are the same in at least three consecutive batches and the absolute values ​​increase batch by batch, output the adjustment prompt for the upstream processing process.

[0084] In summary, this invention combines same-frame standard hole ratio conversion, online pose closed-loop correction, and circumferential distribution pattern identification: standard holes and holes under inspection are imaged in the same frame, and ratio conversion eliminates the influence of imaging magnification on hole diameter calculation; the clamp pose is calculated online using the detection results of at least two measured holes and corrected hole by hole, with a re-identification process when correction fails; the circumferential distribution pattern of local hole diameters in the sector is used to distinguish between overall dimensional deviations, clamping deformation, and local defects at the hole opening; the batch distribution center of the same hole position is used to output upstream processing adjustment prompts before the distribution center reaches the tolerance zone boundary. Therefore, this invention achieves automated detection of multi-hole diameters in suspension clamps and extends the detection results from post-judgment to the differentiation of out-of-tolerance causes and batch adjustment prompts.

[0085] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.

Claims

1. A suspension clamp aperture size detection system, characterized in that: include: The pre-positioning recognition module is used to acquire the whole image of the suspension clamp to be inspected, identify the pixel position of each hole to be inspected, and generate a shift command for each hole to be inspected to enter the detection pose in sequence. The bearing positioning module is used to clamp the suspension clamp to be inspected and drive the suspension clamp to be inspected to translate and rotate. Its positioning surface edge is provided with a standard hole with a known diameter that penetrates the positioning surface. The bearing positioning module is also used to calculate the translation and rotation of the suspension clamp to be inspected relative to the theoretical pose based on the measured pixel position and theoretical pixel position of at least two measured holes, and to correct the subsequent displacement command of the hole to be inspected. The illumination imaging module includes a backlight unit, a telecentric lens, and an image sensor arranged along the imaging optical axis, used to enable the hole to be inspected in the detection pose and the standard hole to be imaged in the same field of view in the same frame. The image processing module is used to extract the sub-pixel edges of two transmitted light spots and obtain the pixel diameters of the hole to be inspected and the standard hole through circle fitting. Based on the ratio of the pixel diameters of the hole to be inspected and the standard hole and the known aperture of the standard hole, the aperture size of the hole to be inspected is calculated, and the local aperture of each sector of the hole contour is calculated. The judgment output module is used to compare the hole diameter with the design tolerance zone of the hole to be inspected and output the judgment result. It determines the out-of-tolerance type based on the circumferential distribution pattern of the hole diameter in each sector, and statistically analyzes the distribution center of the hole diameter at the same position on the same type of suspension clamp to be inspected in batches. When the sign of the signed offset of the distribution center relative to the center of the design tolerance zone is the same in at least three consecutive batches and the absolute value increases batch by batch, it outputs an adjustment prompt for the upstream processing process.

2. The suspension clamp aperture size detection system according to claim 1, characterized in that: The pre-positioning identification module includes: First, determine the pixel equivalent of the entire image based on the known aperture of the standard hole and the pixel diameter of the standard hole in the entire image; S201. Perform binary segmentation on the acquired whole image and extract connected components; identify the connected components corresponding to the standard hole according to the pixel position and pixel diameter of the standard hole in the whole image, and remove the connected components corresponding to the standard hole from the candidate area of ​​the hole to be inspected; determine the connected components in the remaining connected components whose pixel area is within the area range determined by the upper limit aperture, lower limit aperture and the pixel equivalent of the hole to be inspected, and whose ratio of the long side to the short side of the circumscribed rectangle is within the aspect ratio range determined by the circular connected components as candidate areas of the hole to be inspected; S202. Perform circle fitting on the edge of each candidate area of ​​the hole to be inspected, and determine the center of the fitted circle as the pixel position of the corresponding hole to be inspected. S203. Based on the pixel equivalent, the pixel displacement of each hole to be inspected relative to the current detection position is converted into the physical displacement of the bearing positioning module, and a shift command is generated; based on the pixel equivalent relationship between the whole image and the hole image and the pixel position of the standard hole in the hole image obtained by imaging in the same frame, the theoretical pixel position of each hole to be inspected under the detection pose is determined.

3. The suspension clamp aperture size detection system according to claim 1, characterized in that: The bearing positioning module calculates the translation and rotation of the suspended clamp under test relative to its theoretical pose, including: Obtain the measured pixel positions and theoretical pixel positions of at least two measured holes, and form a set of position point pairs with the measured pixel positions and theoretical pixel positions of each measured hole; The root mean square of the fitting residuals of all edge points of the hole image corresponding to the i-th measured hole is used as the fitting error of the i-th position point pair. The weight of the i-th position point pair is the reciprocal of the fitting error after constraining it to a lower limit of 0.01 pixels, and the value after normalizing the reciprocals of all position point pairs. The translation and rotation amounts are calculated with the goal of minimizing the sum of the squared weighted Euclidean distances between the measured pixel positions of each pair of points after translation and rotation composite transformation and the theoretical pixel positions.

4. The suspension clamp aperture size detection system according to claim 3, characterized in that: The bearing positioning module includes a clamping mechanism, an X-axis translation mechanism, a Y-axis translation mechanism, and a rotation mechanism that rotates around the normal to the positioning surface; the bearing positioning module controls the movement of the suspended clamp to be inspected and corrects the displacement command in the following manner: When the number of measured holes is less than two, the bearing positioning module moves according to the original displacement amount in the displacement command; After two holes have been measured, the displacement amount in the displacement command of the subsequent holes to be inspected is corrected according to the translation and rotation amounts, and the following steps are performed: S401. Correct the displacement amount in the displacement command of the next hole to be inspected according to the translation and rotation amount, and control the suspension clamp to be inspected to move according to the corrected displacement command. S402. Obtain the residual deviation between the measured pixel position and the theoretical pixel position of the next hole to be inspected in the hole image. If the residual deviation is not greater than the alignment upper limit, confirm that the correction is effective. Add the position point pair formed by the measured pixel position and the theoretical pixel position of the next hole to be inspected to the position point pair set. Recalculate the translation and rotation amounts. Correct the shift amount in the shift command of the subsequent hole to be inspected according to the recalculated translation and rotation amounts. The alignment upper limit is one-tenth of the number of pixels corresponding to the tolerance zone of the hole to be inspected. S403. If the residual deviation is greater than the alignment upper limit, it is determined that the suspension clamp under inspection has been displaced twice. The suspension clamp under inspection is controlled to return to the acquisition position of the whole piece image. The pre-positioning recognition module re-acquires the whole piece image and regenerates the displacement instructions for each undetected hole.

5. The suspension clamp aperture size detection system according to claim 1, characterized in that: The illumination imaging module includes: Obtain the width of the edge grayscale transition zone of the standard aperture transmitted light spot in the first valid aperture image, and use it as the reference edge grayscale transition zone width; Obtain the width of the grayscale transition band at the edge of the transmitted light spot through the standard aperture in the previous frame image; Before acquiring the hole image of the current hole to be inspected, the exposure time of the current hole image is determined based on the exposure time of the previous hole image, the width of the reference edge grayscale transition band, and the width of the edge grayscale transition band of the previous hole image, so that the width of the edge grayscale transition band of the standard hole transmitted light spot in the current hole image is equal to the width of the reference edge grayscale transition band.

6. The suspension clamp aperture size detection system according to claim 5, characterized in that: The image processing module further includes: Using the fitted center of the hole to be inspected as the vertex and the direction of the fixed edge of the positioning surface of the positioning module in the hole image as the zero-degree direction, determine the central angle of each rejected edge point; The rejected edge points are sorted according to their central angles, and the angle sequence that crosses the boundary between 0° and 360° is periodically expanded in 360°. A series of consecutive points whose difference between adjacent central angles is no greater than the central angle of a sector and which contains at least two rejected edge points is defined as a defect angle interval. The defect angle interval is defined by the central angle of the first rejected edge point and the central angle of the last rejected edge point in the corresponding series of consecutive points. The defect angle range is sent to the determination output module; When determining the type of out-of-tolerance, the output module compares the sector angle range of the local aperture out-of-tolerance with the defect angle range. If there is an overlap between the two, the out-of-tolerance type is determined to be a local defect at the aperture.

7. The suspension clamp aperture size detection system according to claim 6, characterized in that: The image processing module calculates the local aperture of each sector of the aperture contour, including: Using the fitted circle center of the hole to be inspected as the center, the hole outline is divided into M sectors according to the central angle, where M is an even number not less than 4. The opposite sector of each sector is determined; the opposite sector is the sector whose central angle differs from that of the sector by 180°. Calculate the average radial distance from each edge point in the sector to the center of the fitted circle to obtain the first radial distance; calculate the average radial distance from each edge point in the sector to the center of the fitted circle to obtain the second radial distance. The sum of the first radial distance and the second radial distance is used as the pixel quantity of the local aperture of the sector; the pixel quantity of the local aperture of each sector is converted into the local aperture of each sector according to the ratio of the pixel diameter and the known aperture. When any sector and / or its opposite sector has no edge point, the sector is identified as an invalid sector. The average local aperture of the two valid sectors located on both sides of the invalid sector and closest to the invalid sector along the circumferential direction is taken as the local aperture of the invalid sector. When all sectors are invalid sectors, the aperture image of the hole to be inspected is re-acquired.

8. The suspension clamp aperture size detection system according to claim 7, characterized in that: The determination output module determines the out-of-tolerance type based on the circumferential distribution of the local aperture in each sector, including: Calculate the difference between the aperture size and the tolerance zone center to obtain the overall deviation; the tolerance zone center is the arithmetic mean of the upper limit aperture and the lower limit aperture of the hole to be inspected; Calculate the difference between the local aperture of each sector and the aperture size to obtain the local deviation of each sector; if the aperture size exceeds the design tolerance zone and the absolute value of the local deviation of each sector is not greater than the local judgment limit, determine the out-of-tolerance type as overall dimensional deviation. When the absolute value of the local deviation is greater than the local judgment limit, the sectors are continuously distributed in the circumferential direction, and the angle range of the continuous sectors overlaps with the defect angle range, the out-of-tolerance type is determined to be a local defect at the orifice. If there is a pair of sectors that are mutually opposite sectors, and the signs of their local deviations are the same and their absolute values ​​are both greater than the local judgment limit, and the signs of the local deviations of a pair of opposite sectors that are 90° apart from the center angle of the pair of sectors are opposite and their absolute values ​​are both greater than the local judgment limit, then the out-of-tolerance type is determined to be clamping deformation. The overall dimensional deviation, local defects at the orifice, and clamping deformation are judged in sequence. If the first condition is met, the corresponding deviation type is determined. If none of the three conditions are met, the deviation type is determined to be a compound deviation. The local judgment limit is one-tenth of the design tolerance band width.

9. The suspension clamp aperture size detection system according to claim 8, characterized in that: The determination output module outputs adjustment prompts for upstream processing steps, including: For the same hole position on the same type of suspension clamp to be inspected, the distribution center of the hole diameter is statistically analyzed by batch; the distribution center is the arithmetic mean of the hole diameter of the same hole position within the same batch; Calculate the signed offset of the distribution center of each batch relative to the tolerance zone center to obtain the offset sequence; When the signs of the signed offsets are the same in at least three consecutive batches and the absolute values ​​increase batch by batch, the offset sequence is linearly fitted to obtain the rate of change of the signed offset with the batch. When the product of the signed offset of the current batch and the rate of change is greater than zero, calculate the number of remaining batches required for the distribution center to reach the tolerance zone boundary in the current offset direction; The adjustment prompt includes the remaining batch number and the aperture offset direction; when the sector with the largest absolute value of local deviation in each sector is the same sector in at least three consecutive batches, the adjustment prompt also includes the center angle of that sector.

10. A method for detecting the diameter of a suspension clamp hole, wherein the method employs a suspension clamp hole diameter detection system as described in any one of claims 1-9, characterized in that: Includes the following steps: Step 1: Acquire the whole image of the suspension clamp to be inspected, identify the pixel position of each hole to be inspected, and generate a shift command for each hole to be inspected to enter the inspection pose in sequence. Step 2: Move according to the shift command, project backlight along the imaging optical axis and collect the hole image through the telecentric lens, so that the hole to be tested in the detection pose and the standard hole with the known hole diameter at the edge of the positioning surface are imaged in the same frame, and the standard hole is always within the field of view when each hole to be tested is detected in turn. Step 3: Extract the sub-pixel edges of the two transmitted light spots in the same frame image, perform circle fitting and remove edge points whose fitting residuals exceed the allowable range, then refit, and calculate the aperture size of the hole to be inspected according to the ratio of the pixel size of the hole to be inspected to the standard hole and the known aperture. Step 4: When the number of measured holes is less than two, move according to the original shift amount in the shift command; when the number of measured holes reaches two, calculate the translation and rotation amounts based on the measured pixel positions and theoretical pixel positions of at least two measured holes, and correct the shift amount in the subsequent shift command; if the residual deviation of the moved hole after correction is greater than the alignment upper limit, return to the acquisition position of the whole image and re-execute Step 1; otherwise, add the position point pair formed by the measured pixel position and theoretical pixel position of the hole to the position point pair set, and recalculate the translation and rotation amounts based on the updated position point pair set. The alignment upper limit is one-tenth of the number of pixels corresponding to the tolerance zone of the hole to be inspected. Step 5: Determine the type of out-of-tolerance based on the circumferential distribution of the local aperture in each sector; for the same hole position on the same type of suspension clamp to be inspected, count the distribution center of the aperture size by batch, and when the signs of the signed offsets are the same in at least three consecutive batches and the absolute values ​​increase batch by batch, output the adjustment prompt for the upstream processing process.