A non-contact device and method for inspecting the appearance of the inner surface of a hole.
By designing a non-contact hole inner surface appearance inspection device, and using a combination of single-axis displacement stage and rotary stage calibration method, panoramic image acquisition and quantitative defect assessment of the inner wall of small holes were achieved. This solves the problem that existing technologies cannot detect defects in the inner wall of small holes non-contactly, and improves the detection accuracy.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- INST OF CHEM MATERIAL CHINA ACADEMY OF ENG PHYSICS
- Filing Date
- 2022-05-27
- Publication Date
- 2026-05-26
AI Technical Summary
Existing methods for detecting defects in the inner walls of holes cannot achieve non-contact inspection of the inner walls of small holes with a diameter of less than 8 mm, cannot obtain complete images and perform quantitative assessment of defects, and may damage the inner surface of the hole.
A non-contact hole inner surface appearance inspection device was designed, including a single-axis displacement stage, a cantilever beam, an industrial camera, a single-axis rotary stage, a video tube, and a two-dimensional alignment stage. The actual size corresponding to the image pixels is determined by a calibration device, and a panoramic image of the hole inner wall is acquired to calculate the defect location.
It enables panoramic image acquisition and quantitative defect assessment of the inner surface of vertical holes with diameters of 4-8mm, reduces uncertainties introduced by manual alignment, and improves the accuracy of image stitching and defect location assessment.
Smart Images

Figure CN117169118B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of visual inspection technology for defects on the inner surface of vertical holes in products, and in particular to a method for aligning the visual probe with the axis of the vertical hole to achieve panoramic image acquisition and defect location of the inner surface of the hole. Specifically, it is a non-contact device and method for inspecting the appearance of the inner surface of a hole. Background Technology
[0002] In fields such as energy and chemical engineering, automotive manufacturing, aerospace, pharmaceuticals, and military, many processed products have small machined holes on their surfaces. These holes are generally used for liquid transportation or to prevent damage to the product structure caused by thermal expansion and contraction. As part of the product structure, these holes may develop defects or cracks on their inner walls due to manufacturing errors, long-term wear, or harsh environmental damage. These defects can affect the product's lifespan and safety. Therefore, the detection of defects on the inner walls of these holes has always been an important requirement in industrial inspection. In the defense industry, especially in the manufacturing of complex structural components, similar deep holes are machined on the surface. If cracks or defects exist on the inner walls of these holes, they pose safety hazards to subsequent processing, transportation, and use. Therefore, it is necessary to detect defects on the inner surface of these holes to support quality assessment.
[0003] Currently, methods for detecting defects on the inner walls of holes are mainly divided into structured light methods and vision methods. Structured light methods project a laser beam into the hole to be tested and acquire the laser profile using an image acquisition device. The profile is then used to determine pits or deformations within the hole. This method is currently mainly applied to holes with diameters greater than 20mm. Vision-based methods primarily utilize industrial endoscopes. The smallest industrial endoscopes can currently be used to measure the inner walls of holes with diameters up to 2.5mm. However, industrial endoscopes require manual insertion into the hole, which may damage the inner surface due to contact friction. Furthermore, they cannot quantitatively assess the specific location and size of defects. Therefore, a non-contact detection method is needed for the inner walls of holes with diameters less than 8mm, enabling panoramic defect detection and assessment of size and location within the hole. Summary of the Invention
[0004] This invention provides a non-contact device and method for inspecting the appearance of the inner surface of a hole, in order to solve the above-mentioned problems, enabling the device to acquire a complete image of the inner wall of a small hole and to complete the assessment of the location and size of defects in the inner wall.
[0005] The technical solution adopted in this invention is: to provide a non-contact hole inner surface appearance inspection device, comprising:
[0006] A single-axis displacement stage includes a Z-axis motor and a sliding plate, wherein the Z-axis motor can drive the sliding plate to move in the vertical direction;
[0007] A cantilever beam, one end of which is connected to a sliding plate on a single-axis displacement stage via a first connecting plate;
[0008] The connecting cylinder is fixedly installed at the other end of the cantilever beam;
[0009] The lens sleeve is coaxially mounted above the connecting cylinder;
[0010] An industrial camera is coaxially mounted on the lens sleeve, with its industrial microscope lens located inside the lens sleeve;
[0011] A single-axis rotary table, coaxially mounted below the connecting cylinder, includes a rotary motor and a turntable, the rotary motor driving the turntable to rotate; the single-axis rotary table is provided with a light-transmitting hole coaxial with the turntable;
[0012] A video tube, detachably mounted at the center of the turntable, is used to acquire an image of the inner surface of the hole;
[0013] LED lights are used to provide illumination for the picture tube;
[0014] A laser, detachably mounted at a non-center location on the turntable, is used to calculate the position of the turntable's center.
[0015] A two-dimensional alignment stage includes an X-axis motor, a Y-axis motor, and an alignment platform. The X-axis motor and the Y-axis motor can respectively drive the alignment platform to move along the X-axis and the Y-axis.
[0016] A motion controller is used to control the movement of the X-axis motor, Y-axis motor, Z-axis motor, and rotary motor.
[0017] Furthermore, the single-axis displacement stage also includes a displacement frame, a screw, and a slide rail. The slide rail is vertically mounted on the displacement frame, the screw is mounted on the Z-axis motor, and the slide plate is provided with a slide block that mates with the slide rail and a threaded hole that mates with the screw.
[0018] Furthermore, the connecting cylinder includes an upper connecting cylinder, a connecting block, and a lower connecting cylinder arranged sequentially from top to bottom. The upper connecting cylinder is detachably connected to the lens sleeve, the connecting block is detachably connected to the cantilever beam, and the lower connecting cylinder is detachably connected to the single-axis rotary table.
[0019] This invention also discloses a non-contact method for inspecting the appearance of the inner surface of a hole. This method is based on the aforementioned non-contact device for inspecting the appearance of the inner surface of a hole, and includes:
[0020] A calibration device is used to determine the actual size of each pixel in the image.
[0021] To ensure that the axis of the hole to be measured coincides with the axis of the image tube;
[0022] Obtain a panoramic image of the inner wall of the hole and calculate the location of the defect.
[0023] Furthermore, the calibration device determines the actual size corresponding to each pixel of the image by including:
[0024] Remove the image tube so that the industrial camera's field of view can pass through the light aperture of the single-axis rotary table to obtain the image below;
[0025] Calibrate the pixel coordinates of the rotation center of the single-axis turntable;
[0026] The relationship between the motion distance and direction of the calibrated two-dimensional alignment stage and the image pixels is determined.
[0027] Furthermore, the pixel coordinates for calibrating the rotation center of the single-axis turntable include:
[0028] Place a flat object to be tested at the height of the imaging plane below the industrial camera, and fine-tune the height of the industrial microscope lens so that it can clearly focus on the surface of the object to be tested.
[0029] A fixed laser is mounted on a single-axis rotary table and rotates together with the single-axis rotary table. It is necessary to ensure that the laser has two rotational degrees of freedom, pitch and yaw, in the z-axis direction where its beam is located. The laser pointing direction is finely adjusted so that the laser point emitted by it illuminates the object to be measured below and appears in the imaging field of the industrial camera.
[0030] Control the single-axis rotary table to drive the laser to rotate to at least 3 positions, acquire images at each position and extract the center of the laser point;
[0031] The pixel coordinates of the center of the circle formed by the centers of the light spots at all positions in the image are determined by using the least squares circle fitting method. This coordinate value is recorded as the rotation center of the single-axis rotary table, and the rotation center is the optical axis of the entire optical path.
[0032] Furthermore, the relationship between the calibration two-dimensional alignment stage's movement distance and direction and the image pixels includes:
[0033] Marking points for photogrammetry are attached to the object to be measured;
[0034] Place the object to be tested on the two-dimensional alignment stage. The alignment platform of the two-dimensional alignment stage is perpendicular to the optical axis of the entire optical path. Move the two-dimensional alignment stage so that the small hole on the object to be tested enters the middle position of the field of view of the industrial camera. Adjust the height of the single-axis displacement stage so that the point to be marked is clearly imaged in the field of view of the industrial camera.
[0035] The two-dimensional alignment stage is controlled to move αmm along the positive and negative mechanical x-axis and y-axis respectively. The initial position is obtained using the OTSU thresholding method and a circle center extraction algorithm. The pixel coordinates of the circle centers at five positions are: x-axis ± αmm and y-axis ± αmm. The mechanical coordinates of the five positions are (x...)... t0 y t0 ), (x t1 y t1 ), (x t2 y t2 ), (x t3 y t3 ), (x t4 y t4 ), the corresponding pixel coordinates are (x p1 y p1 ), (x p2 y p2 ), (x p3 y p3 ), (x p4 y p4 The angle θ between the two coordinate systems and the scaling relationship Scale are calculated using the following formulas:
[0036]
[0037]
[0038] After calibration, calculate the required 2D alignment stage movement distance by moving m pixels along the positive x-axis and n pixels along the positive y-axis in the image using the following formula:
[0039]
[0040]
[0041] In the formula x pm x pn Represent the x-axis movement distance and y-axis movement distance of the two-dimensional alignment stage, respectively. pm y pn These represent the y-axis movement distance of the two-dimensional alignment stage.
[0042] Furthermore, achieving the alignment of the axis of the hole to be measured with the axis of the image tube includes:
[0043] Place the hole to be measured on the two-dimensional alignment stage, and control the two-dimensional alignment stage to move the hole to be measured into the camera's field of view.
[0044] The center of the hole to be measured is fitted using binarization and least squares method, and the pixel distance between the fitted center and the rotation center of the single-axis rotary table in the x and y directions of the image is calculated.
[0045] The actual moving distance of the two-dimensional alignment stage is calculated to make the axis of the hole to be measured coincide with the axis of the rotation center, thus completing the alignment;
[0046] Install the image tube and ensure that the axis of the image tube coincides with the axis of the single-axis rotary table through machining precision. At this time, the axis of the image tube, the rotation axis of the single-axis rotary table, and the axis of the hole to be measured coincide.
[0047] Furthermore, acquiring a panoramic image of the inner wall of the hole and calculating the location of the defect includes:
[0048] The actual spatial distance for calibrating the individual pixel size of an industrial camera;
[0049] Select an appropriate pixel size for the pixel cropping area, and calculate the actual size of the inner wall area of the hole to be measured corresponding to the cropped area image based on the calibration results of the industrial camera;
[0050] Move and rotate the viewing tube to obtain a panoramic image of the inner wall of the hole;
[0051] Calculate the location of the image and the specific location of the defect.
[0052] Furthermore, the actual spatial distance for calibrating a single pixel size of the camera includes:
[0053] A resolution board was used for camera calibration experiments. The calibration board was placed close to the imaging end face of the image tube so that the camera could acquire a clear image of the calibration board surface.
[0054] The widths of the horizontal β-group and vertical β-group resolution lines on the calibration board are obtained using an edge extraction algorithm, denoted as w. p1 -w pβ h p1 -h pβ The actual width of each set of resolution lines is k. The actual dimensions w and h of a single pixel in the image along the x and y directions are calculated using the following formulas:
[0055]
[0056] The process of moving and rotating the viewing tube to obtain a panoramic image of the inner wall of the hole includes:
[0057] Determine the distance of a single movement along the axis, and determine the height h of a single cropped image. n As the single-movement interval of a single-axis displacement stage;
[0058] Determine the angle of rotation along the axis in a single rotation, and calculate the field of view ω corresponding to the image region according to the following formula: ω=2arcsin(w m / 2r), where r represents the radius of the hole to be measured, and the calculated field of view is the single rotation interval of the single-axis rotary table.
[0059] The single-axis displacement stage is controlled to drive the image tube to extend into the bottom of the hole to be measured, with w m The interval moves upward [l / w] m Each time the camera stops, it captures an image of the corresponding size. After reaching the top of the hole, it controls the single-axis rotary table to rotate the image tube by ω degrees. Then, it moves down to the bottom of the hole in the same way and rotates by ω degrees again until the number of rotations reaches [360 / ω]+1, indicating that the panoramic image of the inner wall of the hole to be measured has been acquired.
[0060] The location of the calculated image and the specific location of the defect include:
[0061] Calculate the location of the image and the specific location of the defect, obtain the number of vertical movements *i* and the number of horizontal rotations *j*, and for the image with index *k*, calculate its location using the following formula (l k ω k ):
[0062]
[0063]
[0064] Where [] indicates rounding down to the nearest integer, and % indicates taking the remainder;
[0065] Calculate the specific location of the defect in the image. The pixel coordinates of the defect in the k-th image are (u ki v ki Based on the calibration results of the industrial camera, the actual distance (x) from the top left corner of the image is calculated using the following formula. ki y ki ):
[0066] x ki =u ki ·w
[0067] y ki =v ki ·h
[0068] For the width direction, the distance x ki Convert to angle ω ki The transformation relationship is shown in the following formula:
[0069]
[0070] Based on the position of the kth image (l k ω k The global location of the defect on the inner wall of the hole (l) gi ω gi As shown in the following formula:
[0071] l gi =l k +y ki ;
[0072] ω gi =ω k +ω ki .
[0073] The beneficial effects of this invention are:
[0074] 1) This invention constructs a vision device for inspecting the inner surface quality of vertical holes with a diameter of 4-8 mm. A precision single-axis displacement stage and a single-axis rotary stage drive the image tube to move along and rotate around the axis of the hole under test, enabling the acquisition of images of the inner wall of the small hole. By combining image cropping and motion schemes, a panoramic image of the inner wall of the small hole can be obtained and a panoramic stitched image can be generated. By combining calibration methods and the positional degrees of the precision displacement stage and rotary stage, a quantitative assessment of the location and size of defects on the inner wall can be achieved.
[0075] 2) This invention uses a two-dimensional planar alignment stage as the stage, and combined with the designed two-dimensional alignment stage calibration method and single-axis rotary stage rotation center calibration method, it can realize the coincidence of the axis of the hole to be measured with the optical axis of the device, reduce the uncertainty factors introduced by manual alignment, ensure the stability of the field of view, and improve the accuracy of image stitching, defect location and size assessment. Attached Figure Description
[0076] Figure 1 This is a schematic diagram of the non-contact hole inner surface appearance inspection device disclosed in this invention;
[0077] Figure 2 This is a schematic diagram of the structure of the single-axis displacement stage disclosed in this invention;
[0078] Figure 3 This is a schematic diagram of the structure of the single-axis rotary table disclosed in this invention;
[0079] Figure 4 This is a schematic diagram of the structure of the two-dimensional alignment stage disclosed in this invention;
[0080] Figure 5 This is a schematic diagram of the structure of the image tube disclosed in this invention;
[0081] Figure 6 This is a schematic diagram of the structure of the connecting cylinder disclosed in this invention;
[0082] Figure 7 This is a schematic diagram of the cantilever beam structure disclosed in this invention;
[0083] Figure 8 This is a schematic diagram of the structure of the first connecting plate disclosed in this invention;
[0084] Figure 9 This is a schematic diagram of the structure of the second connecting plate disclosed in this invention;
[0085] Figure 10 This is a schematic diagram of the imaging optical path and installation method of the picture tube disclosed in this invention;
[0086] Figure 11 This is a schematic diagram of the method for determining the image coordinates of the rotation center using a laser, as disclosed in this invention.
[0087] Figure 12 This is a schematic diagram of the calibration two-dimensional alignment stage and the process of aligning the axis of the hole to be measured with the axis of the image tube disclosed in this invention.
[0088] Figure 13 This is a schematic diagram of the process disclosed in this invention for obtaining a panoramic image of the inner wall of a hole and calculating the location of the defect.
[0089] Reference numerals: 1. Single-axis displacement stage; 101. Displacement stage frame; 102. Slide rail; 103. Slide plate; 104. Screw; 105. Z-axis motor; 2. Single-axis rotary stage; 201. Rotary motor; 202. Turntable; 203. Light-transmitting hole; 204. Rotation mechanism; 3. Two-dimensional alignment stage; 301. Alignment platform; 302. X-axis motor; 303. Y-axis motor; 4. Motion controller; 5. Industrial camera; 6. Industrial microscope lens; 7. FPC flexible board LED light source; 8. Image tube; 9. Laser; 10. First connecting plate; 11. Lens sleeve; 12. Connecting cylinder; 121. Upper connecting cylinder; 122. Connecting block; 123. Lower connecting cylinder; 13. Cantilever beam; 14. Second connecting plate. Detailed Implementation
[0090] To make the objectives, technical solutions, and advantages of the present invention clearer, the present invention will be described in further detail below with reference to the accompanying drawings, but the embodiments of the present invention are not limited thereto.
[0091] Example 1:
[0092] See Figure 1-11This embodiment discloses a non-contact internal surface appearance inspection device for holes, comprising: a single-axis displacement stage 1, including a Z-axis motor 105 and a sliding plate 103, wherein the Z-axis motor 105 can drive the sliding plate 103 to move in the vertical direction; a cantilever beam 13, one end of which is connected to the sliding plate 103 on the single-axis displacement stage 1 via a first connecting plate 10; a connecting cylinder 12, which is fixedly installed at the other end of the cantilever beam 13; a lens sleeve 11, which is coaxially installed above the connecting cylinder 12; an industrial camera 5, which is coaxially installed on the lens sleeve 11, with its industrial microscope lens 6 located inside the lens sleeve 11; and a single-axis rotary stage 2, which is coaxially installed below the connecting cylinder 12, including a rotary motor 201 and a turntable 202, wherein the rotary motor 201 can drive the turntable. 202 Rotation; the single-axis rotary table 2 is provided with a light-transmitting hole 203 coaxial with the turntable 202; a viewing tube 8 is detachably installed at the center of the turntable 202 for acquiring an image of the inner surface of the hole; an LED light is used to provide illumination to the viewing tube 8; a laser 9 is detachably installed at a non-center of the turntable 202 for calculating the position of the center of the turntable 202; a two-dimensional alignment stage 3 includes an X-axis motor 302, a Y-axis motor 303, and an alignment platform 301, wherein the X-axis motor 302 and the Y-axis motor 303 can respectively drive the alignment platform 301 to move along the X-axis and Y-axis; and a motion controller 4 is used to control the movement of the X-axis motor 302, the Y-axis motor 303, the Z-axis motor 105, and the rotary motor 201.
[0093] like Figure 2 As shown, this embodiment uses... Figure 2 The single-axis rotary table 2 shown realizes the movement of the slide plate 103 along the Z-axis. Specifically, the single-axis displacement table 1 includes a Z-axis motor 105, a slide plate 103, a displacement frame 101, a screw 104, and a slide rail 102. The slide rail 102 is vertically mounted on the displacement frame 101, the screw 104 is mounted on the Z-axis motor 105, and the slide plate 103 is provided with a slide block that cooperates with the slide rail 102 and a threaded hole that cooperates with the screw 104.
[0094] The structure of the single-axis rotary table 2 is as follows Figure 3 As shown, it includes a rotary motor 201, a turntable 202 and a rotating mechanism 204. The rotating mechanism 204 is provided with a light-transmitting hole 203. The single-axis rotary table 2 is an existing mature product with the model number TBR60. Therefore, its specific structure and connection relationship will not be described in detail in this embodiment.
[0095] The structure of the two-dimensional alignment stage 3 is as follows Figure 4 As shown, the two-dimensional alignment stage 3 is also an existing mature product, model number ZolixXY120120. Therefore, its specific structure and connection relationship will not be described in detail in this embodiment.
[0096] The structure of the video tube 8 is as follows Figure 5 As shown, the image tube 8 can acquire images from the side of the tube body and then transmit them to the industrial camera 5. The image tube 8 is also a mature existing product. In this embodiment, the image tube 8 produced by SIJHT-PIPE is used.
[0097] like Figure 6 As shown, this embodiment designs a connecting cylinder 12, which includes an upper connecting cylinder 121, a connecting block 122, and a lower connecting cylinder 123 arranged sequentially from top to bottom. The upper connecting cylinder 121 is detachably connected to the lens sleeve 11, the connecting block 122 is detachably connected to the cantilever beam 13, and the lower connecting cylinder 123 is detachably connected to the single-axis rotary table 2. A horizontally oriented waist hole is provided at the other end of the cantilever beam 13, through which a screw passes to connect to the connecting block 122. The LED light is an FPC flexible board LED light, which is adhered to the inner wall of the lower connecting cylinder 123. A vertical mounting groove is provided on the lower connecting cylinder 123 to facilitate the adhesion of the FPC flexible board LED light. See also... Figure 1 An FPC flexible board LED light source 7 is also installed between the two cantilever beams 13 to control the FPC flexible board LED light.
[0098] like Figure 7 As shown, the left end of the cantilever beam 13 is also provided with a horizontal waist hole. The screw passes through the waist hole and connects to the connecting block 122. The waist hole allows the connecting cylinder 12 to be finely adjusted in position.
[0099] like Figure 10 The image tube 8 is a schematic diagram of the imaging optical path and installation method. The image tube 8 is connected to the lower connecting cylinder 133 through the second connecting plate 14. The image tube 8 collects images from the side wall of the hole and transmits them to the industrial microscope head 6 and the industrial camera 5 through the light passage 203.
[0100] like Figure 11 This is a schematic diagram of the invention using laser 9 to determine the image coordinates of the rotation center. After removing the image tube 8, the laser 9 is installed on the turntable 202 of the single-axis rotary stage 2. By rotating it multiple times, a unique circle can be determined, thereby determining the circle point, which is the point where the rotation center is located. The rotation center is also the straight line where the optical axis is located.
[0101] Example 2
[0102] See Figure 12 This embodiment discloses a non-contact method for inspecting the appearance of the inner surface of a hole. The non-contact method is based on a non-contact device for inspecting the appearance of the inner surface of a hole as described in Embodiment 1. The non-contact method includes:
[0103] S1, Calibration device, which determines the actual size of each pixel in the image;
[0104] S2. Align the axis of the hole to be measured with the axis of the image tube;
[0105] S3. Obtain a panoramic image of the inner wall of the hole and calculate the location of the defect.
[0106] Specifically, S1, the calibration device, determines the actual size corresponding to each pixel of the image by including:
[0107] S1.1 Remove the image tube so that the industrial camera's field of view can pass through the light hole of the single-axis rotary table to obtain the image below (considering the working distance of the industrial camera, the height of the object surface at the clearest position from the bottom of the rotary table should be about 40mm).
[0108] S1.2, Calibrate the pixel coordinates of the rotation center of the single-axis turntable;
[0109] S1.3, Calibrate the relationship between the movement distance and direction of the two-dimensional alignment stage and the image pixels.
[0110] Specifically, S1.2, calibrating the pixel coordinates of the single-axis turntable rotation center, includes:
[0111] S1.2.1 Place a flat object to be tested at the height of the imaging plane below the industrial camera, and finely adjust the height of the industrial microscope lens so that it can clearly focus on the surface of the object to be tested.
[0112] S1.2.2 Install a fixed laser on a single-axis rotary table and rotate it together with the single-axis rotary table. It is necessary to ensure that the laser has two rotational degrees of freedom, pitch and yaw, in the z-axis direction where its beam is located. Fine-tune the laser pointing direction so that the laser point emitted by it illuminates the object to be measured below and appears in the imaging field of view of the industrial camera.
[0113] S1.2.3. Control the single-axis rotary stage to rotate the laser at least three positions, acquire images at each position, and extract the center of the laser point. In this embodiment, the single-axis rotary stage is controlled to rotate 10 times at a 36° rotation angle. At each position, the computer automatically obtains the pixel coordinates of the laser point's centroid. After the rotation is complete, the pixel coordinates are fitted with a circle center. The obtained circle center coordinates are the rotation center of the single-axis rotary stage and also the rotation axis of the image tube.
[0114] S1.2.4. Use the least squares circle fitting method to determine the pixel coordinates of the center of the circle formed by the centers of the light spots at all positions in the image, and record the coordinate value as the rotation center of the single-axis rotary table. The rotation center is the optical axis of the entire optical path.
[0115] Specifically, S1.3, calibrating the relationship between the movement distance and direction of the two-dimensional alignment stage and the image pixels, includes:
[0116] S1.3.1. Attach photogrammetric markers to the object to be measured (considering the field of view of the image acquisition module, photogrammetric markers with a diameter of 0.7 mm are used in this embodiment);
[0117] S1.3.2 Place the object to be tested on the two-dimensional alignment stage. The alignment platform of the two-dimensional alignment stage is perpendicular to the optical axis of the entire optical path. Move the two-dimensional alignment stage so that the small hole on the object to be tested enters the middle position of the field of view of the industrial camera. Adjust the height of the single-axis displacement stage so that the point to be marked is clearly imaged in the field of view of the industrial camera.
[0118] S1.3.3. Control the two-dimensional alignment stage to move αmm along the positive and negative directions of the mechanical x-axis and y-axis respectively. In this embodiment, 1mm is selected. The initial position is obtained by using the OTSU thresholding method and the circle center extraction algorithm. The pixel coordinates of the circle center at five positions are: x-axis ±1mm and y-axis ±1mm. The mechanical coordinates of the five positions are (x... t0 y t0 ), (x t1 y t1 ), (x t2 y t2 ), (x t3 y t3 ), (x t4 y t4 ), the corresponding pixel coordinates are (x p1 y p1 ), (x p2 y p2 ), (x p3 y p3 ), (x p4 y p4 The angle θ between the two coordinate systems and the scaling relationship Scale are calculated using the following formulas:
[0119]
[0120]
[0121] S1.3.4 After calibration, calculate the required 2D alignment stage movement distance by moving m pixels along the positive x-axis and n pixels along the positive y-axis in the image according to the following formula:
[0122]
[0123]
[0124] In the formula x pm x pn Represent the x-axis movement distance and y-axis movement distance of the two-dimensional alignment stage, respectively. pm y pnThese represent the y-axis movement distance of the two-dimensional alignment stage.
[0125] Specifically, S2, aligning the axis of the hole to be measured with the axis of the viewing tube, includes:
[0126] S2.1 Place the hole to be measured on the two-dimensional alignment stage, and control the two-dimensional alignment stage to move the hole to be measured into the camera's field of view;
[0127] S2.2. The center of the hole to be measured is fitted using binarization and least squares method, and the pixel distance between the fitted center and the rotation center of the single-axis rotary table in the x and y axis directions of the image is calculated.
[0128] S2.3 Calculate the actual moving distance of the two-dimensional alignment stage to make the axis of the hole to be measured coincide with the axis of rotation center, and complete the alignment;
[0129] S2.4 Install the image tube and ensure that the axis of the image tube coincides with the axis of the single-axis rotary table through machining precision. At this time, the axis of the image tube, the rotation axis of the single-axis rotary table, and the axis of the hole to be measured coincide.
[0130] See Figure 13 Specifically, step S3, acquiring a panoramic image of the inner wall of the hole and calculating the location of the defect, includes:
[0131] S3.1, The actual spatial distance for calibrating the size of a single pixel in an industrial camera;
[0132] S3.2 Select an appropriate pixel size for the pixel cropping area, and calculate the actual size of the inner wall area of the hole to be measured corresponding to the cropping area image based on the calibration results of the industrial camera;
[0133] S3.3 Move and rotate the viewing tube to obtain a panoramic image of the inner wall of the hole;
[0134] S3.4 Calculate the location of the image and the specific location of the defect.
[0135] Specifically, S3.1, the actual spatial distance for calibrating the size of a single pixel of the camera, includes:
[0136] S3.1.1. The camera calibration experiment was conducted using the resolution plate from Edmund Optics. The calibration plate was placed close to the imaging end face of the image tube so that the camera could acquire a clear image of the calibration plate surface.
[0137] S3.1.2. Use the edge extraction algorithm to obtain the width of the horizontal β group and the vertical β group resolution lines on the calibration board, denoted as w. p1 -w pβ h p1 -h pβ The actual width of each set of resolution lines is k. The actual dimensions w and h of a single pixel in the image along the x and y directions are calculated using the following formulas:
[0138]
[0139] Specifically, S3.3, moving and rotating the viewing tube to obtain a panoramic image of the inner wall of the hole, includes:
[0140] S3.3.1 Determine the single movement distance along the axis direction, and use the height hn of a single cropped image as the single movement interval of the single-axis displacement stage;
[0141] S3.3.2 Determine the angle of a single rotation around the axis, and calculate the field of view ω corresponding to the image region according to the following formula: ω=2arcsin(w m / 2r), where r represents the radius of the hole to be measured, and the calculated field of view is the single rotation interval of the single-axis rotary table.
[0142] S3.3.3, Control the single-axis displacement stage to drive the image tube to extend into the bottom of the hole to be measured, so that w m The interval moves upward [l / w] m Each time the camera stops, it captures an image of the corresponding size. After reaching the top of the hole, it controls the single-axis rotary table to rotate the image tube by ω degrees. Then, it moves down to the bottom of the hole in the same way and rotates by ω degrees again until the number of rotations reaches [360 / ω]+1, indicating that the panoramic image of the inner wall of the hole to be measured has been acquired.
[0143] Specifically, S3.4, calculating the location of the image and the specific location of the defect, includes:
[0144] S3.4.1 Calculate the location of the image and the specific location of the defect, obtain the number of vertical movements *i* and the number of horizontal rotations *j*. For the image with sequence number *k*, calculate the location of the image according to the following formula (l k ω k ):
[0145]
[0146]
[0147] Where [] indicates rounding down to the nearest integer, and % indicates taking the remainder;
[0148] S3.4.2 Calculate the specific location of the defect in the image. The pixel coordinates of the defect in the k-th image are (u ki v ki Based on the calibration results of the industrial camera, the actual distance (x) from the top left corner of the image is calculated using the following formula. ki y ki ):
[0149] x ki =u ki ·w
[0150] y ki =v ki ·h
[0151] S3.4.3, For the width direction, the distance x ki Convert to angle ω ki The transformation relationship is shown in the following formula:
[0152]
[0153] S3.4.4, Based on the position of the kth image (l k ω k The global location of the defect on the inner wall of the hole (l) gi ω gi As shown in the following formula:
[0154] l gi =l k +y ki ;
[0155] ω gi =ω k +ω ki .
[0156] The above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A non-contact method for inspecting the appearance of the inner surface of a hole, characterized in that, The non-contact method for inspecting the appearance of the inner surface of a hole includes: A calibration device is used to determine the actual size of each pixel in the image. Determining the actual size corresponding to each pixel of the image includes: Remove the image tube so that the industrial camera's field of view can pass through the light aperture of the single-axis rotary table to obtain the image below; Calibrate the pixel coordinates of the rotation center of the single-axis turntable; The relationship between the motion distance and direction of the calibrated two-dimensional alignment stage and image pixels; The relationship between the calibration two-dimensional alignment stage's motion distance and direction and image pixels includes: Marking points for photogrammetry are attached to the object to be measured; Place the object to be tested on the two-dimensional alignment stage. The alignment platform of the two-dimensional alignment stage is perpendicular to the optical axis of the entire optical path. Move the two-dimensional alignment stage so that the small hole on the object to be tested enters the middle position of the field of view of the industrial camera. Adjust the height of the single-axis displacement stage so that the point to be marked is clearly imaged in the field of view of the industrial camera. The two-dimensional alignment stage is controlled to move αmm along the positive and negative mechanical x-axis and y-axis respectively. The initial position is obtained using the OTSU thresholding method and a circle center extraction algorithm. The pixel coordinates of the circle centers at five positions are: x-axis ± αmm and y-axis ± αmm. The mechanical coordinates of the five positions are as follows: , , , , The corresponding pixel coordinates are , , , The angle between the two coordinate systems is calculated using the following formulas. Relationship with scaling : ; ; After calibration, calculate the required 2D alignment stage movement distance by moving m pixels along the positive x-axis and n pixels along the positive y-axis in the image using the following formula: ; ; In the formula , These represent the x-axis movement distance of the two-dimensional alignment stage, respectively. , These represent the y-axis movement distance of the two-dimensional alignment stage; To ensure that the axis of the hole to be measured coincides with the axis of the image tube; Obtain a panoramic image of the inner wall of the hole and calculate the location of the defect.
2. The non-contact method for inspecting the appearance of the inner surface of a hole according to claim 1, characterized in that, The pixel coordinates for calibrating the rotation center of the single-axis turntable include: Place a flat object to be tested at the height of the imaging plane below the industrial camera, and fine-tune the height of the industrial microscope lens so that it can clearly focus on the surface of the object to be tested. A fixed laser is mounted on a single-axis rotary table and rotates together with the single-axis rotary table. It is necessary to ensure that the laser has two rotational degrees of freedom, pitch and yaw, in the z-axis direction where its beam is located. The laser pointing direction is finely adjusted so that the laser point emitted by it illuminates the object to be measured below and appears in the imaging field of the industrial camera. Control the single-axis rotary table to drive the laser to rotate to at least 3 positions, acquire images at each position and extract the center of the laser point; The pixel coordinates of the center of the circle formed by the centers of the light spots at all positions in the image are determined by using the least squares circle fitting method. This coordinate value is recorded as the rotation center of the single-axis rotary table, and the rotation center is the optical axis of the entire optical path.
3. The non-contact method for inspecting the appearance of the inner surface of a hole according to claim 2, characterized in that, The process of aligning the axis of the hole to be measured with the axis of the image tube includes: Place the hole to be measured on the two-dimensional alignment stage, and control the two-dimensional alignment stage to move the hole to be measured into the camera's field of view. The center of the hole to be measured is fitted using binarization and least squares method, and the pixel distance between the fitted center and the rotation center of the single-axis rotary table in the x and y directions of the image is calculated. The actual moving distance of the two-dimensional alignment stage is calculated to make the axis of the hole to be measured coincide with the axis of the rotation center, thus completing the alignment; Install the image tube and ensure that the axis of the image tube coincides with the axis of the single-axis rotary table through machining precision. At this time, the axis of the image tube, the rotation axis of the single-axis rotary table, and the axis of the hole to be measured coincide.
4. The non-contact method for inspecting the appearance of the inner surface of a hole according to claim 3, characterized in that, The process of acquiring a panoramic image of the inner wall of the hole and calculating the location of the defect includes: The actual spatial distance for calibrating the individual pixel size of an industrial camera; Select an appropriate pixel size for the pixel cropping area, and calculate the actual size of the inner wall area of the hole to be measured corresponding to the cropped area image based on the calibration results of the industrial camera; Move and rotate the viewing tube to obtain a panoramic image of the inner wall of the hole; Calculate the location of the image and the specific location of the defect.
5. The non-contact method for inspecting the appearance of the inner surface of a hole according to claim 4, characterized in that, The actual spatial distance for determining the size of a single pixel of the calibrated camera includes: A resolution board was used for camera calibration experiments. The calibration board was placed close to the imaging end face of the image tube so that the camera could acquire a clear image of the calibration board surface. The widths of the horizontal β-group and vertical β-group resolution lines on the calibration board are obtained using an edge extraction algorithm, denoted as , The actual width of each set of resolution lines is The actual size of a single pixel in the image along the x and y directions is calculated using the following formula. and : ; The process of moving and rotating the viewing tube to obtain a panoramic image of the inner wall of the hole includes: Determine the distance of a single movement along the axis and the height of a single cropped image. As the single-movement interval of a single-axis displacement stage; Determine the angle of a single rotation around the axis, and calculate the field of view corresponding to the image region using the following formula. : In the formula The radius of the hole to be measured is given, and the calculated field of view is the rotation interval of the single-axis rotary table in one operation. The single-axis displacement stage is controlled to drive the image tube to extend into the bottom of the hole to be measured. The interval of upward movement Each time the camera stops, it acquires and captures an image of the appropriate size. Once it reaches the top of the hole, the single-axis rotary table rotates the video tube. Then, following the same method, move downwards to the bottom of the hole and rotate again. degrees, until the number of rotations reaches This indicates that the panoramic image acquisition of the inner wall of the hole to be tested is complete; The location of the calculated image and the specific location of the defect include: Calculate the location of the image and the specific location of the defect, and obtain the number of vertical movements. The number of horizontal rotations is For image number k, the position of the image is calculated according to the following formula. : ; ; Where [] indicates rounding down to the nearest integer, and % indicates taking the remainder; Calculate the specific location of the defect in the image. The pixel coordinates of the defect in the k-th image are: Based on the calibration results of the industrial camera, the actual distance from the top left corner of the image is calculated using the following formula. : ; ; For the width direction, the distance Convert to angle The transformation relationship is shown in the following formula: ; Based on the location of the kth image The global location of the defect on the inner wall of the hole. As shown in the following formula: ; 。 6. A non-contact hole inner surface appearance inspection device, employing the non-contact hole inner surface appearance inspection method as described in claims 1-5, characterized in that, include: A single-axis displacement stage includes a Z-axis motor and a sliding plate, wherein the Z-axis motor can drive the sliding plate to move in the vertical direction; A cantilever beam, one end of which is connected to a sliding plate on a single-axis displacement stage via a first connecting plate; The connecting cylinder is fixedly installed at the other end of the cantilever beam; The lens sleeve is coaxially mounted above the connecting cylinder; An industrial camera is coaxially mounted on the lens sleeve, with its industrial microscope lens located inside the lens sleeve; A single-axis rotary table, coaxially mounted below the connecting cylinder, includes a rotary motor and a turntable, the rotary motor driving the turntable to rotate; the single-axis rotary table is provided with a light-transmitting hole coaxial with the turntable; A video tube, detachably mounted at the center of the turntable, is used to acquire an image of the inner surface of the hole; LED lights are used to provide illumination for the picture tube; A laser, detachably mounted at a non-center location on the turntable, is used to calculate the position of the turntable's center. A two-dimensional alignment stage includes an X-axis motor, a Y-axis motor, and an alignment platform. The X-axis motor and the Y-axis motor can respectively drive the alignment platform to move along the X-axis and the Y-axis. as well as A motion controller is used to control the movement of the X-axis motor, Y-axis motor, Z-axis motor, and rotary motor.
7. The non-contact hole inner surface appearance inspection device according to claim 6, characterized in that, The single-axis displacement stage also includes a displacement frame, a screw, and a slide rail. The slide rail is vertically mounted on the displacement frame, the screw is mounted on the Z-axis motor, and the slide plate is provided with a slide seat that mates with the slide rail and a threaded hole that mates with the screw.
8. The non-contact hole inner surface appearance inspection device according to claim 6, characterized in that, The connecting cylinder includes an upper connecting cylinder, a connecting block, and a lower connecting cylinder arranged sequentially from top to bottom. The upper connecting cylinder is detachably connected to the lens sleeve, the connecting block is detachably connected to the cantilever beam, and the lower connecting cylinder is detachably connected to the single-axis rotary table.