A miniature endoscopic distance and coaxiality detection device and method

By integrating a structured light projection window and imaging channel at the front end of the probe and placing the light source at the rear end of the probe, combined with binocular stereo matching and three-dimensional point cloud fitting, the problem of distance and coaxiality detection in confined spaces was solved, achieving high-precision detection results.

CN123154776APending Publication Date: 2026-11-24WUHAN GANWEI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611626035.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-10-20
Publication Date
2026-11-24

AI Technical Summary

Technical Problem

Existing technologies make it difficult to achieve simultaneous quantitative detection of distance and coaxiality in confined spaces. Conventional endoscopes lack depth sensing capabilities, and insufficient baseline in stereo endoscopes leads to large ranging errors. External sensors cannot enter narrow channels, and heat from the light source causes thermal drift of the objective lens focal length.

Method used

A miniature endoscopic distance and coaxiality detection device is adopted, which integrates the structured light projection window and imaging channel at the front end of the probe, and places the light source at the rear end of the probe and transmits it through optical fiber. Combined with binocular stereo matching and three-dimensional point cloud fitting, the device achieves quantitative detection of distance and coaxiality, and reduces the influence of thermal drift by illuminating the light source with time-division pulse.

Benefits of technology

High-precision distance and coaxiality detection was achieved in narrow channels, reducing ranging errors and thermal drift, and improving the reliability and accuracy of detection results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123154776A_ABST
    Figure CN123154776A_ABST
Patent Text Reader

Abstract

This application discloses a miniature endoscopic distance and coaxiality detection device and method. The device includes a probe assembly, a light source module, and a control and processing unit. The probe assembly includes a probe body with an outer diameter of D. The front end face has a first imaging channel and a second imaging channel with parallel optical axes. The center distance between the two channels forms a baseline b, and b / D ≥ 0.5. The light source module is rear-mounted on the rear exterior of the probe body, away from the front end face. A structured light laser unit is connected to a structured light projection window to project a structured light pattern. The control and processing unit performs stereo matching on the images synchronously acquired by the two channels, calculates the distance based on parallax, generates a three-dimensional point cloud, obtains the center position and axial direction of the target being measured through three-dimensional fitting, and calculates the lateral eccentricity and coaxiality angle. This device reduces the heat load on the probe front end by rear-mounting the light source and transmitting it via optical fiber, establishing a distance measurement baseline within a limited outer diameter, making it suitable for quantitative detection of distance and coaxiality in narrow channels.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of precision measurement and optical detection technology, specifically to a miniature endoscopic distance and coaxiality detection device and method. Background Technology

[0002] In the fields of precision assembly and online inspection, it is often necessary to perform distance measurements and coaxiality determinations on the target object within confined channels or cavities. For example, in scenarios such as engine block assembly, nuclear industry pipeline inspection, and aero-engine blade clearance measurement, the measuring probe needs to enter narrow channels with an aperture of 8–10 mm to perform geometric measurements with sub-millimeter precision at a working distance of 30–100 mm. This need for geometric measurement within confined spaces has driven the development of related inspection technologies towards miniaturization and quantitative inspection.

[0003] To address the aforementioned detection needs, existing technologies commonly employ methods including conventional industrial endoscopes, stereo endoscopes, external precision ranging sensors, time-of-flight ranging modules, and structured light 3D scanners. Conventional industrial endoscopes typically provide only two-dimensional images for human observation; while stereo endoscopes employ dual-channel imaging to achieve stereoscopic vision, their design primarily focuses on the stereoscopic display effect perceived by the human eye; external precision ranging sensors, such as laser triangulation displacement meters and spectral confocal displacement meters, are usually independent of the probe or are relatively large; time-of-flight ranging modules attempt to estimate distance by measuring the round-trip time of light pulses; in addition, optical measurement methods based on monocular defocus depth, coaxial projection circular pattern ranging schemes, and monocular methods combined with known dimensions are applied to specific scenarios.

[0004] However, existing technologies face the following specific engineering bottlenecks in achieving simultaneous quantitative detection of distance and coaxiality within confined spaces: First, conventional industrial endoscopes lack depth sensing capabilities and cannot output quantitative data on distance and coaxiality; Second, in order to arrange the annular illumination fiber optic bundle and mechanical structure within the tiny endoscope body, the center-to-center distance (baseline b) of the binocular objective lenses in observation-type stereo endoscopes is typically less than 0.3 times the probe's outer diameter D (for example, less than 2.4 mm baseline within an 8 mm outer diameter probe). According to the binocular ranging error propagation relationship ΔZ=(Z^2 / (f·b))·Δd, an excessively small baseline b results in an axial ranging error exceeding 1–3 mm at a working distance of 30–100 mm, and the measured metal structure… The surfaces of the parts generally lack natural texture, and passive binocular matching is prone to failure due to uniform grayscale. Third, external laser triangulation displacement meters or structured light 3D scanners require a baseline greater than 30mm due to the separate arrangement of the projector and camera, which cannot be inserted into narrow channels with an aperture of 8-10mm. Furthermore, point laser rangefinders can only measure single-point distances and cannot obtain the eccentricity of the target's three-dimensional spatial center and the tilt angle of the axis. Fourth, traditional endoscopic probes usually have the LED illumination source directly encapsulated at the front end of the probe. The Joule heat of the light source during operation is directly conducted to the adjacent miniature objective lens, causing thermal expansion of the objective lens barrel and temperature drift of the lens refractive index, resulting in thermal drift of the objective lens focal length f and proportionally introducing errors into the distance measurement system. Summary of the Invention

[0005] To address the technical problems in existing technologies, such as insufficient binocular ranging baseline due to the limited outer diameter of miniature endoscopic probes, failure of stereo matching on textureless metal surfaces, and thermal drift of objective lens focal length caused by heat generation from the front-end light source, this application provides a miniature endoscopic distance and coaxiality detection device and method.

[0006] The miniature endoscopic distance and coaxiality detection device and method provided in this application adopts the following technical solution:

[0007] A miniature endoscopic distance and coaxiality detection device includes:

[0008] The probe assembly includes an outer diameter of The probe body is cylindrical, and a first imaging channel, a second imaging channel, and a structured light projection window are provided on the front end surface of the probe body. The optical axes of the first and second imaging channels are both parallel to the central axis of the probe body, and the center distance between the two optical axes forms a baseline. ,in ;

[0009] The light source module, rear-mounted at the external rear end of the probe body away from the front end surface, includes a structured light laser unit connected via an optical fiber to the structured light projection window to project a structured light pattern onto the target under test; and

[0010] The control and processing unit is configured to perform stereo matching on the images synchronously acquired by the first imaging channel and the second imaging channel under the structured light pattern projection, generate a three-dimensional point cloud of the surface of the target under test based on the parallax obtained from the stereo matching, and calculate a first distance value of the target feature center point on the target under test along the central axis of the probe body. The test involves performing a three-dimensional fitting of the geometric features of the target based on the three-dimensional point cloud to obtain the target feature center coordinates and target reference direction vector of the target, and calculating the lateral eccentricity e and coaxial angle θ of the target relative to the central axis of the probe body.

[0011] A miniature endoscopic distance and coaxiality detection method, applied to the aforementioned miniature endoscopic distance and coaxiality detection device, comprises the following steps:

[0012] Image acquisition steps: A structured light pattern is projected onto the target through the structured light laser unit in the light source module located outside the rear end of the probe body, away from the front end face, via the light transmission fiber and the structured light projection window, and by satisfying… The first imaging channel and the second imaging channel synchronously acquire images under the structured light pattern projection;

[0013] Stereo matching step: The control and processing unit performs stereo matching on the images synchronously acquired by the first imaging channel and the second imaging channel under the structured light pattern projection. Based on the parallax obtained from the stereo matching, a three-dimensional point cloud of the surface of the target under test is generated, and the first distance value of the target feature center point on the target under test along the central axis of the probe body is calculated. ;as well as

[0014] Coaxiality calculation steps: The control and processing unit performs three-dimensional fitting on the geometric features of the target under test based on the three-dimensional point cloud to obtain the target feature center coordinates and target reference direction vector of the target under test, and calculates the lateral eccentricity e and coaxial angle θ of the target under test relative to the central axis of the probe body.

[0015] In summary, this application includes at least one of the following beneficial technical effects:

[0016] 1. By placing the structured light laser unit on the external rear end of the probe body and connecting it to the structured light projection window on the front end via a light-transmitting fiber with a diameter of only a few hundred micrometers, the radial space on the front end of the probe body, which was originally occupied by a large laser projection source, is freed up, allowing the first and second imaging channels to... The large baseline is set on the front face of the probe body with an outer diameter of D (for example, establishing a binocular baseline of 4.8-6.0 mm inside a probe with an outer diameter of 8-10 mm); according to the binocular ranging depth error formula At the same working distance Z and parallax accuracy Compared to conventional binocular endoscopic arrangements with a baseline ratio of less than 0.3, this application can improve the axial distance resolution accuracy. At the same time, it utilizes actively projected structured light patterns to construct spatially unique grayscale features on a textureless metal surface, enabling simultaneous distance quantization measurement based on binocular parallax and lateral eccentricity e and coaxial angle θ quantization detection based on 3D point cloud fitting within a narrow channel.

[0017] 2. By placing both the white light illumination unit (21) and the structured light laser unit (22) outside the rear end of the probe body (11) and transmitting light energy to the front end via the illumination fiber (17) and the light transmission fiber (18) respectively, and controlling the time-division pulse lighting of both by the synchronous controller (32) with each lighting duty cycle not exceeding 30%, on the one hand, the electro-optic conversion Joule heat source is physically isolated from the first micro-objective (121) and the second micro-objective (131) at the front end of the probe in space, and on the other hand, the average power consumption of the light source is reduced and the optical crosstalk between the white light and the structured light is reduced, thereby suppressing the thermal drift Δf of the micro-objective focal length caused by the temperature rise at the front end of the probe, and reducing the systematic ranging drift error caused by ΔZ / Z=Δf / f.

[0018] 3. By using a dual-channel fusion mechanism, the first distance value based on binocular parallax and the second distance value based on known size are scale-calibrated or consistency-checked. The comprehensive confidence level is calculated by combining the effective number of matching points, the mean modulation intensity, and the root mean square residual of the geometric fitting of the three-dimensional point cloud according to a normalized weighted model. When the comprehensive confidence level is lower than the threshold, the output is blocked and an alarm is triggered, so that the detection results have quantitative reliability assessment and anomaly detection capabilities. Attached Figure Description

[0019] Figure 1 This is a schematic diagram of the overall system structure of a miniature endoscopic distance and coaxiality detection device provided in one embodiment of this application;

[0020] Figure 2 yes Figure 1 Enlarged schematic diagram of the internal structure of the probe assembly;

[0021] Figure 3 yes Figure 1 A schematic diagram of the optical element arrangement structure on the front end face of the probe body;

[0022] Figure 4 This is a schematic diagram of the geometric optical principle of binocular stereo ranging and coaxiality (lateral eccentricity and coaxial angle) detection provided in an embodiment of this application;

[0023] Figure 5 This is a flowchart of a miniature endoscopic distance and coaxiality detection method provided in an embodiment of this application, and a hardware synchronous time-division exposure timing diagram within a single complete measurement cycle, wherein (a) is a flowchart of the detection method, and (b) is a hardware synchronous time-division exposure timing diagram.

[0024] Explanation of reference numerals in the attached figures: 1. Probe assembly; 11. Probe body; 12. First imaging channel; 121. First miniature objective lens; 122. First image sensor; 13. Second imaging channel; 131. Second miniature objective lens; 132. Second image sensor; 14. Structured light projection window; 141. Diffractive optical element; 15. Illumination light-emitting surface; 16. Sapphire protective window; 17. Illumination fiber; 18. Light transmission fiber; 2. Light source module; 21. White light illumination unit; 22. Structured light laser unit; 25. Collimating lens; 3. Control and processing unit; 31. SoC processor with integrated ISP; 32. Synchronization controller; 33. Communication interface; 4. Target under test. Detailed Implementation

[0025] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. It should be understood that the described embodiments are only some embodiments of this application, and not all embodiments. Unless otherwise specified, the embodiments and technical features in the embodiments of this application can be combined with each other.

[0026] In the fields of precision assembly and online inspection, there are numerous practical scenarios where distance measurements and coaxiality determinations of the target object need to be performed within confined spaces or cavities. For example, during engine block assembly, the probe needs to be inserted into the cylinder block through mounting holes with a diameter of only 8–10 mm to measure the distance to critical components such as the cylinder liner end face and valve seat rings, as well as to check their coaxiality relative to the probe's central axis, at a working distance of 30–100 mm. Similarly, in nuclear industry pipeline inspection and aero-engine blade clearance measurement, the measuring probe also needs to enter channels with an extremely small diameter (8–10 mm) and perform sub-millimeter precision geometric measurements at a relatively long working distance (30–100 mm).

[0027] However, existing detection methods face several challenges in the aforementioned application scenarios. Conventional industrial endoscopes can only provide two-dimensional images and lack the ability to quantify distance and coaxiality; external precision ranging sensors (such as laser triangulation displacement meters and spectral confocal displacement meters) are bulky and cannot be integrated into probes with small diameters; the absolute accuracy of time-of-flight ranging modules cannot meet the requirements of sub-millimeter precision assembly; structured light 3D scanners, due to the separate arrangement of the projector and camera, result in an excessively large baseline, making miniaturization impossible for use in narrow passages. Furthermore, under conditions of small aperture and long working distance, the monocular defocus depth method suffers from insufficient diffusion changes caused by defocus variations due to the large depth of field, rendering it unusable as an effective depth clue; in traditional solutions, the illumination source is placed at the front end of the probe, and a constantly lit source causes temperature rise at the probe front end, affecting the ranging results through focal length thermal drift.

[0028] To address the aforementioned issues, this application provides a miniature endoscopic distance and coaxiality detection device and method. The device integrates a binocular imaging channel and a structured light projection window on the front end of a miniature probe. A light source is positioned behind the probe body (11) and transmitted via optical fiber. Within a limited probe outer diameter range, a binocular baseline is established to meet the requirements of stereo ranging. The device utilizes structured light texture-assisted stereo matching and three-dimensional point cloud fitting to obtain distance and coaxiality parameters. Simultaneously, quality control of the measurement results is achieved through time-division pulse illumination of the light source and a confidence level determination mechanism.

[0029] Reference Figures 1 to 5 This embodiment provides a miniature endoscopic distance and coaxiality detection device and method for detecting the distance, lateral eccentricity, and coaxial angle of a target 4 within a narrow channel or cavity. The detection device integrates two imaging channels and a structured light projection window 14 on the front end face of the probe assembly 1, and places the light source module 2 on the rear exterior of the probe body 11. It utilizes optical fiber to transmit illumination light and structured light, and combines binocular stereo matching, three-dimensional point cloud fitting, and measurement result confidence assessment to achieve quantitative detection of the distance and geometric positional relationship of the target 4.

[0030] Example 1

[0031] Reference Figures 1 to 3 The miniature endoscopic distance and coaxiality detection device of this embodiment includes a probe assembly 1, a light source module 2, and a control and processing unit 3. The probe assembly 1 is used to enter the narrow space to be detected and acquire an image of the target 4. The light source module 2 is used to provide illumination light and structured light patterns to the target 4. The control and processing unit 3 is used to control image acquisition, process image data, calculate the distance and coaxiality parameters of the target 4, and output the detection results.

[0032] The probe assembly 1 includes a probe body 11, which is a cylindrical, tubular, rigid mirror (e.g., made of medical-grade 316L stainless steel or titanium alloy tubing) with an outer diameter of D. The front end face of the probe body 11 is provided with a first imaging channel 12, a second imaging channel 13, and a structured light projection window 14. The optical axes of both the first imaging channel 12 and the second imaging channel 13 are parallel to the central axis of the probe body 11, and the center distance between the two optical axes constitutes the binocular imaging baseline b. In this application, the cylindrical geometric central axis of the probe body 11 is used as the central axis of the probe assembly 1 (i.e., Figure 4 (The probe optical axis reference line is shown in the figure), and a three-dimensional reference coordinate system is established with the center of the front end face of the probe body 11 as the origin O, the direction along the baseline line as the X-axis, the radial direction perpendicular to the baseline line as the Y-axis, and the direction along the central axis of the probe body 11 pointing to the target 4 as the Z-axis. .

[0033] In this embodiment, the baseline b and the outer diameter D of the probe body 11 satisfy b / D≥0.5. By symmetrically arranging two imaging channels radially within a limited probe outer diameter range, a baseline suitable for stereo ranging is established between the two imaging channels, while also meeting the miniaturization requirements of the probe body 11. Compared to a scheme that separates the projector and camera, this embodiment uses fiber optic transmission of structured light, allowing the structured light laser unit 22 to be positioned outside the rear end of the probe body 11, thereby reducing the burden of device placement at the probe front end.

[0034] The aforementioned baseline ratio constraint of b / D ≥ 0.5 ensures that, given a fixed outer diameter D of the probe body 11, the baseline b between the two imaging channels occupies a certain percentage of the usable space in the diametrical direction. The above. In binocular stereo ranging, based on the depth calculation formula... The sensitivity of distance error to parallax error satisfies That is, the axial distance resolution is directly proportional to the baseline b; when the following condition is met... At a given parallax resolution accuracy (For example, at 0.1 pixels) the axial ranging error can be reduced to The plan Therefore, under the premise of meeting the miniaturization size constraints of the probe, by... The value is limited to not less than 0.5, which can effectively ensure the axial ranging accuracy under small diameter and long working distance.

[0035] The first imaging channel 12 includes a first miniature objective lens 121 and a first image sensor 122, with the first image sensor 122 disposed at the image plane of the first miniature objective lens 121. The second imaging channel 13 includes a second miniature objective lens 131 and a second image sensor 132, with the second image sensor 132 disposed at the image plane of the second miniature objective lens 131. The first miniature objective lens 121 and the second miniature objective lens 131 have the same nominal focal length f (e.g., f = 2.4 mm) and the same entrance pupil diameter A (i.e., effective aperture). The first miniature objective lens 121 and the second miniature objective lens 131 respectively image the optical image of the target 4 under test onto the corresponding image sensor, enabling the first image sensor 122 and the second image sensor 132 to acquire images formed from different observation positions.

[0036] In one specific embodiment, the probe body 11 is a rigid cylindrical mirror with a wall thickness t = 0.35 mm and an inner diameter Din = D - 2t; the outer diameter D of the probe body 11 is 8-10 mm (corresponding to the inner diameter D). in The baseline b is 4.8–6.0 mm, and the ratio of the baseline b to the outer diameter D satisfies 0.55 ≤ b / D ≤ 0.65. The first image sensor 122 and the second image sensor 132 are miniature CMOS image sensors (e.g., 400×400 pixels with a resolution of 1.75 μm × 1.75 μm) packaged on a wafer-level chip-scale (CSP) basis. Their package sizes are both no larger than 1.0 mm × 1.0 mm, and they are directly integrated into the front-end internal cavity of the probe body 11. The effective aperture of both the first miniature objective lens 121 and the second miniature objective lens 131 is 1.4 mm, and the outer diameter Dm of a single miniature objective lens, including the lens barrel wall thickness, is 1.6 mm. The baseline b and the ratio of the outer diameter Dm of a single miniature objective lens are also within the range of 7.3–9.3 mm. m The sum satisfies b+D m ≤D in -0.9mm (e.g., when D=8.0mm, D in =7.3mm, b=4.8mm, D m When = 1.6mm, b+D m =6.4mm≤6.4mm, to reserve at least 0.45mm radial annular mounting gap on each side for the 0.4mm diameter illumination fiber 17 arranged in an outer ring, to ensure that the first micro objective 121, the second micro objective 131 and the outer illumination fiber 17 are compactly assembled inside the probe body 11 without mechanical interference.

[0037] The above dimensions are a specific structural configuration that can be adapted according to the actual outer diameter, internal space and imaging device size of the probe body 11.

[0038] Please refer to Figure 3On the front end face of the probe body 11, the first micro-objective lens 121 and the second micro-objective lens 131 are symmetrically arranged on both sides of the center along a diameter direction of the front end face, with their optical axes parallel and the center distance being the baseline b. The structured light projection window 14 is located at the midpoint of the line connecting the optical axes of the first micro-objective lens 121 and the second micro-objective lens 131. The illumination emitting surface 15 is formed by the emitting end faces of multiple illumination optical fibers 17 arranged in a ring at equal angular intervals along the radial outer periphery of the front end face. The above arrangement allows the binocular imaging channel, the structured light projection channel, and the illumination channel to be compactly distributed within a limited circular area of ​​the front end face. The first micro-objective lens 121 and the second micro-objective lens 131 are arranged at baseline b intervals, and the relationship between the baseline b and the outer diameter D satisfies b / D≥0.5. By directly integrating the first image sensor 122 and the second image sensor 132 into the front-end internal cavity of the probe body 11, the need to transmit images to the back end of the probe using an image transmission fiber bundle or cylindrical lens relay system is avoided. This helps to reduce the axial length of the rigid front end of the probe and reduce moiré fringe interference caused by the pixel grid of the image transmission fiber bundle.

[0039] In this embodiment, the wall thickness of the probe body 11 is 0.35 mm. A sapphire protective window 16 is also provided on the outer side of the front end face of the probe body 11. The sapphire protective window 16 is fixed to the outer edge of the front end face of the probe body 11 by laser welding or epoxy optical adhesive. It is used to seal and protect the first micro objective lens 121, the second micro objective lens 131, the structured light projection window 14 and the illumination light emitting surface 15 inside the front end, so as to prevent oil, coolant or dust in the test environment from entering the probe.

[0040] Sapphire material has a Mohs hardness of 9, exhibiting excellent scratch and wear resistance. Furthermore, its optical transmittance can reach over 95% in the visible to near-infrared wavelength range of 400nm to 900nm after anti-reflection coating. Therefore, using a sapphire protective window 16 can provide physical sealing protection for optical devices while reducing the light energy loss of the protective window itself on the imaging optical path and the structured light projection optical path.

[0041] Reference Figure 1 and Figure 2 The light source module 2 is located at the rear exterior of the probe body 11 away from the front end, and includes a white light illumination unit 21 and a structured light laser unit 22.

[0042] The white light illumination unit 21 is connected to the illumination emitting surface 15 disposed on the front end face of the probe body 11 via the illumination fiber 17. The illumination light generated by the white light illumination unit 21 is transmitted to the illumination emitting surface 15 via the illumination fiber 17, and is emitted from the illumination emitting surface 15 to the area where the target 4 is located, thereby providing white light illumination conditions for the first imaging channel 12 and the second imaging channel 13.

[0043] In one specific embodiment, the illumination fiber 17 is composed of 10 to 16 multimode fibers, each with a diameter of 0.4 mm and a numerical aperture (NA) of 0.5. The light-emitting end faces of each multimode fiber are arranged in a ring at equal angular intervals along the outer periphery of the front end face of the probe body 11 to form the illumination emission surface 15. Through the above arrangement, white light illumination can be uniformly emitted from the circumferential area of ​​the probe front end, providing shadow-free illumination for the target 4 under test.

[0044] Illumination fiber 17 is constructed using multimode fiber with a numerical aperture of NA=0.5, enabling each fiber's output end face to form an illumination beam with a half-divergence angle of arcsin(0.5)=30° (full divergence angle of 60°). After multiple fibers are arranged in a ring around the outer periphery of the probe's front end face, the beams emitted from each fiber overlap and cover each other at a working distance of 30–100 mm, forming a uniform illumination field that completely covers the area of ​​the target 4 under test. This reduces edge shadows caused by unilateral illumination and improves the accuracy of two-dimensional edge contour extraction using white light frames.

[0045] The white light illumination unit 21 uses a high-brightness white light-emitting diode (LED) chip with a light-emitting surface size of less than or equal to 0.5mm × 0.5mm to match the incident coupling aperture of the multimode fiber bundle. Both the white light illumination unit 21 and the structured light laser unit 22 adopt a constant current driving method to ensure the stability of the light output power during pulse illumination.

[0046] The structured light laser unit 22 is connected to the structured light projection window 14 via the optical fiber 18. The laser emitted by the structured light laser unit 22 is transmitted to the front end of the probe body 11 via the optical fiber 18, and then a structured light pattern is projected onto the target 4 through the structured light projection window 14. By placing the structured light laser unit 22 at the rear of the probe body 11 and using the optical fiber 18 to complete the light energy transmission, it is possible to avoid placing the structured light laser unit 22 directly at the front end of the probe, which is beneficial for the miniaturization of the probe assembly 1.

[0047] Both the white light illumination unit 21 and the structured light laser unit 22 are positioned at the rear of the probe body 11, outside the rear end, so that the heat generated by the light source is concentrated at the rear end of the probe rather than the front end. Since the first miniature objective lens 121 and the second miniature objective lens 131 are located at the front end of the probe, the rearward placement of the light source can reduce the thermal impact of the heat generated by the light source on the optical elements of the miniature objective lens. Under the condition of a short focal length of the miniature objective lens, the effect of focal length drift caused by temperature change on the ranging result is related to both the focal length value and the amount of temperature change; by keeping the heat source away from the objective lens area, it is beneficial to maintain the stability of the objective lens's operating temperature, thereby reducing the systematic error in ranging caused by focal length thermal drift.

[0048] In one specific embodiment, the optical fiber 18 is a single-mode fiber or a few-mode fiber. The structured light projection window 14 is positioned at the midpoint of the line connecting the optical axes of the first imaging channel 12 and the second imaging channel 13 on the front surface of the probe body 11. The edge spacing L between the outer edge of the structured light projection window 14 and the outer edges of the first imaging channel 12 and the second imaging channel 13 is... edge Satisfying 0.3mm≤L edge ≤2.0mm (e.g., when b=4.8mm, objective lens outer diameter D) m When the diameter of the structured light projection window 14 is 1.2mm and the outer diameter is 1.6mm, the edge spacing L is... edge =(4.8-1.6-1.2) / 2=1.0mm).

[0049] Please refer to Figure 2 The structured light projection window 14 has a collimating lens 25 at the incident end and a diffractive optical element 141 at the exit end. The laser light emitted by the structured light laser unit 22, with a wavelength of 650nm or 850nm, is transmitted through the optical fiber 18, collimated by the collimating lens 25, and then incident on the diffractive optical element 141. The diffractive optical element 141 modulates the incident laser light, causing the outgoing light to form a spatially non-periodic pseudo-random speckle pattern or lattice pattern, which is then projected onto the surface of the target 4.

[0050] The collimating lens 25 converts the diverging beam emitted from the optical fiber 18 into an approximately parallel beam, so that the light field incident on the diffractive optical element 141 has better spatial coherence and directional consistency. The diffractive optical element 141, through a pre-designed diffractive microstructure, splits the parallel beam and modulates it into a predetermined speckle pattern or lattice pattern. Compared with directly projecting stripes or coded patterns using a projector, generating structured light patterns through the diffractive optical element 141 does not require large projection components such as spatial light modulators or digital micromirror devices, which is beneficial for realizing structured light projection within the limited front-end space of the micro probe.

[0051] When the structured light pattern is projected onto the surface of the target 4, the speckle or dot matrix on the surface of the target 4 forms texture features that can be used for image processing. The first imaging channel 12 and the second imaging channel 13 respectively acquire images of these texture features at different observation positions for subsequent stereo matching.

[0052] When the surface of the target 4 lacks natural texture (e.g., the inner wall of a precision-machined metal cylinder liner or the end face of a valve seat), the corresponding point search in passive binocular stereo matching may result in multi-polarity matching ambiguity due to the flat grayscale distribution within a local window. By projecting a pseudo-random speckle pattern or dot matrix pattern, a high-contrast grayscale distribution feature with spatial uniqueness is formed on the surface of the target 4. The control and processing unit 3 uses the pixels in the image of the first imaging channel 12... Build a center with a size of (For example A matching window (pixels) is used to traverse candidate disparities along the same epipolar line of the image in the second imaging channel 13 by the disparity search step size. And a stereo matching cost function is constructed based on the zero-mean normalized cross-correlation (ZNCC) coefficient:

[0053]

[0054] in, , The grayscale values ​​of the structured light images acquired by the first imaging channel 12 and the second imaging channel 13 are respectively. , These are the mean grayscale values ​​within the corresponding matching window, and the summation index. Because pseudo-random speckle or lattice patterns are non-periodic and unique within a local window, the cost function... In true parallax It presents a unique significant minimum at this point; further utilization The cost of the parallax of the integer pixels to its left and right. , , Perform quadratic parabolic fitting interpolation:

[0055]

[0056] Multiply by the physical size of the image sensor pixels. The sub-pixel physical parallax of the image plane between the first imaging channel 12 and the second imaging channel 13 can then be calculated. (or continue using the symbols) This reduces matching ambiguity on textureless metal surfaces and enables subpixel-level parallax extraction. As an optional variation of the structured light projection and modulation implementation in this application, when higher spatial point cloud density is required for high-precision static parts, a micro-striped projection coupling unit based on a digital micromirror device (DMD) or liquid crystal silicon (LCOS) can be set at the rear end of the light source module 2. A multi-core image transmission fiber bundle can replace the single light transmission fiber 18 and connect to the structured light projection window 14, thereby projecting four phase-shifted phases sequentially onto the target 4. A total of 12 frames of sinusoidal stripe structured light patterns with 3 spatial frequencies.

[0057] Reference Figure 1 The control and processing unit 3 includes a SoC processor 31 with an integrated ISP, a synchronization controller 32, and a communication interface 33.

[0058] The synchronization controller 32 interacts with the first imaging channel 12, the second imaging channel 13, the white light illumination unit 21, and the structured light laser unit 22. The synchronization controller 32 coordinates the exposure time of the two imaging channels through GPIO hardware handshake signals, and controls the white light illumination unit 21 and the structured light laser unit 22 to work in a time-sharing manner, so that the two imaging channels can complete image acquisition according to a predetermined timing within the same measurement cycle.

[0059] Please refer to Figure 5 (b) During a single complete measurement cycle, the synchronization controller 32 first controls the white light illumination unit 21 ( Figure 5 The white LED (referred to as white LED in Chinese) is illuminated by a pulse and simultaneously triggers the first imaging channel 12 and the second imaging channel 13 ( Figure 5 (Referred to as a binocular camera) Exposure, synchronously acquiring one frame of white light; subsequently, the white light illumination unit 21 is turned off and kept in a high-resistivity / zero-current off state, and the synchronization controller 32 controls the structured light laser unit 22 to pulse-light in each exposure window of the first imaging channel 12 and the second imaging channel 13, synchronously acquiring one frame of static speckle / array structured light image (or, when using an optional multi-frequency phase-shifting fringe scheme, such as...). Figure 5 (b) shows a sequence of 12 frames of structured light images acquired sequentially in 4-step phase shift × 3-frequency phase shifts. Throughout the structured light image acquisition phase, the white light illumination unit 21 remains off to avoid diluting the structured light contrast and causing optical crosstalk. The synchronization controller 32 uses GPIO hardware handshake signals to achieve microsecond-level hardware timing alignment of imaging channel frame synchronization triggering, structured light projection, and light source pulse illumination, ensuring that the illumination windows of the white light illumination unit 21 and the structured light laser unit 22 are strictly synchronized with the exposure windows of the first imaging channel 12 and the second imaging channel 13.

[0060] The SoC processor 31 with integrated ISP is connected to the synchronization controller 32 to receive images acquired by the first imaging channel 12 and the second imaging channel 13, and to perform image processing, stereo matching, distance calculation, 3D point cloud generation, geometric fitting, and measurement result confidence determination.

[0061] The communication interface 33 is used to output the detection results, which include distance values ​​(Z1, Z2, or calibrated distance value Z), lateral eccentricity e, coaxial angle θ, overall confidence level Q, and image data. External devices can obtain the detection results through the communication interface 33 for subsequent assembly judgment, online inspection, or data recording.

[0062] In this embodiment, the white light illumination unit 21 and the structured light laser unit 22 operate in a time-sharing manner, and their respective illumination duty cycles are both less than or equal to 30%. By controlling the illumination time and illumination duty cycle of the light source, the heat load on the probe front end caused by continuous operation of the light source can be reduced, and the possibility of the heat generated by the light source adversely affecting the focal length stability of the miniature objective and the ranging results can be reduced.

[0063] By using a time-division pulse illumination method and limiting the illumination duty cycle to no more than 30%, the white light illumination unit 21 and the structured light laser unit 22 operate only briefly within their respective exposure windows during each measurement cycle, remaining off for the rest of the time. Compared to a constant-on light source scheme, time-division pulse illumination reduces the average power consumption of the light source per unit time, thereby reducing the heat generated by the light source and conducted to the probe front end via the illumination fiber 17 and the light transmission fiber 18, which helps maintain temperature stability in the micro-objective area at the probe front end.

[0064] Example 2

[0065] Reference Figure 4 and Figure 5 This embodiment provides a miniature endoscopic distance and coaxiality detection method applied to the above-mentioned detection device, including processes such as working condition criteria, image acquisition, stereo matching, known size detection, dual-channel fusion, coaxiality calculation, and confidence level determination. Please refer to... Figure 5 (a) The overall workflow of the detection method is as follows: S1 trigger synchronization, S2 acquire white light frames, S3 acquire structured light sequence, S4 phase demodulation / matching, S5 three-dimensional point cloud reconstruction, S6 robust ROI fitting, and S7 output results.

[0066] In the application scenario of this embodiment, since the outer diameter D of the probe body 11 is limited to 8-10 mm, the entrance pupil diameter A of the first micro-objective 121 and the second micro-objective 131 is only 1.4 mm, and the focal length f is about 2.4 mm. At the nominal working distance Z = 30-100 mm, for a small axial defocusing amount ΔZ (e.g., ΔZ = 0.5 mm), the change in the diameter of the image plane circle of confusion of the monocular imaging channel Δδ = (A·f·ΔZ) / [Z·(Z-ΔZ)] is only 0.68 μm at Z = 50 mm, which is smaller than the physical size of a single CMOS pixel (1.75 μm). Therefore, the monocular defocus depth method cannot provide effective depth resolution in such small-aperture, long-working-distance conditions. This embodiment achieves high-precision distance and coaxiality measurement by combining binocular stereo parallax that satisfies b / D ≥ 0.5 with active structured light projection.

[0067] Before starting the measurement or during the measurement initialization phase, the control and processing unit 3 determines whether the distance measurement can be performed using binocular parallax under the current working conditions based on the optical parameters of the imaging channel and the nominal working distance.

[0068] Specifically, the objective lens entrance pupil diameter A, objective lens focal length f, nominal working distance Z, and predetermined defocusing amount of the first imaging channel 12 or the second imaging channel 13 are obtained. The change in the diameter of the circle of confusion on the image plane caused by the predetermined defocusing amount is calculated according to the following formula. :

[0069]

[0070] Where A represents the entrance pupil diameter of the objective lens, f represents the focal length of the objective lens, and Z represents the nominal working distance. Indicates the predetermined defocus amount. This indicates the change in the diameter of the corresponding circle of confusion in the image plane.

[0071] The calculated change in the diameter of the circle of confusion on the image plane Compare with the physical size corresponding to a predetermined pixel threshold. When If the size is smaller than the physical size, the current working condition is determined to meet the requirements of small-diameter long working distance, and the subsequent binocular parallax ranging process is triggered.

[0072] The aforementioned operating condition criteria are used to identify measurement conditions where changes in monocular defocus are insufficient to form effective depth cues. In this case, distance information is obtained through the parallax between the first imaging channel 12 and the second imaging channel 13, rather than relying solely on the defocus changes of a single imaging channel to estimate the distance.

[0073] The physical basis for the above working condition criterion is that when the objective lens entrance pupil diameter A is small and the working distance Z is long, the predetermined defocus amount... The resulting change in the diameter of the circle of confusion The physical size may be less than one pixel, making it difficult for defocus changes to produce detectable blur differences in the image, rendering the monocular defocus depth method ineffective. Under these conditions, a binocular parallax ranging method is adopted, utilizing the parallax difference between the two imaging channels caused by the baseline b to obtain distance information. Its distance resolution is related to the baseline b and the parallax resolution accuracy, and does not depend on the amount of defocus change in a single channel.

[0074] After completing the working condition judgment, the probe assembly 1 is inserted into the narrow channel or cavity to be tested, so that the first imaging channel 12, the second imaging channel 13 and the structured light projection window 14 are facing the target 4 to be tested.

[0075] The synchronization controller 32 controls the white light illumination unit 21 to work and coordinates the exposure time of the first imaging channel 12 and the second imaging channel 13, so that the two imaging channels can synchronously acquire a white light image under white light illumination conditions to obtain the corresponding white light frame.

[0076] The SoC processor 31 with integrated ISP performs two-dimensional edge feature detection on the white light frame (e.g., using the Canny edge operator combined with morphological closing operations to extract closed edge contours) to extract the target contour of the target 4. The SoC processor 31 with integrated ISP determines the closed pixel region enclosed by the extracted target contour as the region of interest (ROI) mask for subsequent image processing to reduce the interference of background regions on stereo matching and three-dimensional point cloud extraction. For example, when the target 4 is a circular hole or a cylindrical end face, two-dimensional feature detection can extract the hole opening contour or end face contour, and the region enclosed by the contour is used as the region of interest for subsequent structured light image processing. This allows subsequent stereo matching and three-dimensional point cloud reconstruction to be performed only on structured light image pixels located within the region of interest, eliminating the interference of non-target regions such as channel walls on the matching and fitting results.

[0077] After the white light frame acquisition is completed, the synchronization controller 32 shuts down the white light illumination unit 21 and controls the structured light laser unit 22 to work. The laser emitted by the structured light laser unit 22 is transmitted to the structured light projection window 14 via the optical fiber 18, and then forms a speckle pattern or dot pattern through the collimating lens 25 and the diffractive optical element 141, and is projected onto the surface of the target 4.

[0078] The first imaging channel 12 and the second imaging channel 13 are exposed synchronously during the process of the structured light pattern being projected by the structured light laser unit 22, and respectively acquire the structured light image corresponding to the same measurement moment.

[0079] In one specific embodiment, the structured light image is a single frame of static speckle or dot matrix image projected by diffractive optical element 141. In another optional embodiment, when the light source module 2 is equipped with a miniature stripe projection coupling unit and transmitted via a multi-core imaging fiber bundle, a combination of stripe phase shifting and frequency modulation is used to sequentially and synchronously acquire a sinusoidal stripe structured light frame sequence corresponding to four phase shifts and three spatial frequencies, resulting in a total of 12 structured light images. The control and processing unit 3 processes the acquired images accordingly based on the structured light form used.

[0080] In the implementation using a 4-step phase-shift × 3-frequency structured light frame sequence, the SoC processor 31 with integrated ISP performs phase demodulation processing on 12 frames of structured light images: First, the wrapping phase value of each pixel is calculated for the 4 phase-shift images corresponding to each frequency. Then, a multi-frequency temporal unwrapping algorithm is used to fuse the wrapping phase values ​​at different frequencies to obtain a continuously unfolded absolute phase map. During the phase demodulation process, pixels with modulation intensity below a preset threshold are masked out to eliminate invalid phase data caused by insufficient reflectivity, occlusion, or overexposure of the surface of the target object 4.

[0081] By acquiring white light frames first and then structured light images within the same measurement cycle, the target contours provided by the white light frames can be used to constrain the processing range of subsequent structured light images, while reducing optical interference that may occur when white light illumination and structured light projection work simultaneously.

[0082] After the structured light image acquisition is completed, the SoC processor 31 with integrated ISP performs stereo matching on the images acquired by the first imaging channel 12 and the second imaging channel 13.

[0083] Specifically, based on the imaging relationship between the two imaging channels, the image features to be matched are determined in the image of the first imaging channel 12, and the corresponding image features are searched in the image of the second imaging channel 13. The disparity of the corresponding features is calculated using the difference in image plane position between the two images.

[0084] In stereo matching, a matching cost function can be constructed using speckle or raster textures formed by structured light projection, and the location of the corresponding image features can be determined by optimizing the matching cost. For image features requiring sub-pixel precision calculation, their sub-pixel level locations are further determined to obtain the physical parallax d of the image plane.

[0085] In the implementation using structured light texture matching, the control and processing unit 3 constructs a stereo matching cost function with a unique minimum value using the speckle pattern or lattice pattern on the surface of the target 4 to determine the parallax between the first imaging channel 12 and the second imaging channel 13. The target contour extracted from the white light frame can also be used to guide the extraction of the region of interest or to impose constraints on the target edges, thereby focusing the matching process on the region where the target 4 is located.

[0086] In the implementation using multi-frequency phase demodulation, stereo matching can be performed using the absolute phase maps obtained by the first imaging channel 12 and the second imaging channel 13 under structured light projection at the same frequency. Since the absolute phase values ​​corresponding to the same surface point of the target 4 are the same in the two imaging channels, the corresponding point can be searched in the epipolar direction through phase consistency constraints to obtain the parallax d. Combining the dual-target positioning parameters (including objective lens focal length f, baseline b, and the relative pose relationship between the two channels), the parallax d is converted into three-dimensional spatial coordinates.

[0087] After obtaining the parallax d, the first distance value of the target 4 is calculated according to the objective lens focal length f and the baseline b of the imaging channel, using the following formula. :

[0088]

[0089] in, The first distance value is obtained based on binocular stereo matching, f is the objective lens focal length of the imaging channel, b is the baseline between the first imaging channel 12 and the second imaging channel 13, and d is the sub-pixel physical parallax of the image plane.

[0090] The control and processing unit 3 further generates a three-dimensional point cloud of the target 4 based on the disparity of the effective matching points and the corresponding imaging parameters. The three-dimensional point cloud contains the three-dimensional coordinates of multiple spatial points on the target 4, which is used to characterize the surface spatial distribution of the target 4 and serve as the basis data for subsequent geometric feature fitting.

[0091] After image acquisition is completed, the control and processing unit 3 can also detect whether there are reference geometric features with known actual size on the target 4.

[0092] When the reference geometric feature is detected, its actual size is obtained. And extract the image plane size of the reference geometric feature from the white light frame or structured light image. Based on the similarity of triangles, the second distance value is calculated using the following formula. :

[0093]

[0094] in, The second distance value is calculated based on the known dimensions. The actual dimensions of the reference geometric features. Let f be the image plane size of the reference geometric feature in the image, and f be the objective lens focal length of the corresponding imaging channel.

[0095] Using the above method, when the target 4 has a reference geometric feature with known actual dimensions, another distance estimate can be obtained using its image plane size. This distance estimate is compared with the first distance value calculated based on binocular parallax. They originate from different measurement relationships and can be used for subsequent distance fusion and consistency verification.

[0096] The accuracy of binocular parallax ranging is mainly affected by the calibration accuracy of baseline b and the resolution accuracy of parallax d, while the accuracy of ranging with known dimensions is mainly affected by the actual dimensions of the reference geometric features on the target 4. Known accuracy and image plane size The extraction accuracy is affected. The two ranging methods are based on different geometric relationships, and their error sources are independent. Therefore, combining the two can be used for cross-validation or mutual calibration.

[0097] If there are no identifiable geometric features of known size in the image, this step can be skipped, and the first distance value obtained by binocular stereo matching can be used. Further processing will be carried out.

[0098] Simultaneously obtain the first distance value Second distance value In this case, the control and processing unit 3 performs dual-channel fusion and mutual calibration processing.

[0099] In the first implementation, using the second distance value As an absolute scale benchmark, the benchmark distance value measured by binocular stereo matching at the location of the benchmark geometric feature is obtained. (in (Based on the binocular physical disparity at the center of the reference geometric feature), calculate the online scale correction coefficients for the binocular channels relative to a known size reference. Then, the scale correction factor was used. Online update of equivalent focal length baseline product parameters for binocular stereo matching channels And using the updated parameters, the first distance value of any part to be measured on the target 4 is determined. Global scale calibration is performed on the 3D point cloud coordinates to obtain the calibrated distance value. Through the above processing, global scale deviation of the binocular channels caused by environmental temperature fluctuations or mechanical micro-deformations can be reduced, provided that known dimensional reference features exist within the field of view.

[0100] In the second implementation, the second distance value As the main measurement output, the first distance value As a consistency check measure, the control and processing unit 3 calculates the absolute value of the difference between the two distance values:

[0101]

[0102] and the absolute value of the difference Compare with a preset deviation threshold (e.g., 0.2 mm). When When the deviation exceeds a preset threshold, it is determined that the results of the two ranging channels have an abnormal deviation that exceeds the allowable range, and an abnormal alarm signal is triggered; when If the preset deviation threshold is not exceeded, the measurement result will be output normally.

[0103] In a third alternative embodiment, when the probe tip binocular structure is fixed with a low-expansion Invar base to ensure baseline accuracy... Maintaining a constant, and with the binocular stereo matching channel having completed the binocular distance calculation using a pre-stored temperature-focal length lookup table. Compensation is needed, while the monocular feature extraction channel requires the equivalent objective lens focal length parameter at the current operating temperature. During online identification, the measured surface of the target 4 is coplanar with the reference geometric features (i.e., Under the premise of ), the first distance value obtained by binocular parallax measurement. Substitute into the similar triangle relation, and follow Inversely solve and update the monocular channel equivalent objective lens focal length parameters in the current state. This is used for rapid monocular ranging in subsequent frames.

[0104] All three processing methods mentioned above utilize the coupling relationship between binocular stereo ranging and known size ranging to achieve distance calibration, consistency verification, or online parameter identification. The specific method used can be configured according to whether the target 4 being measured has known size reference features and the calibration requirements of the measurement system.

[0105] Please refer to Figure 4 After obtaining the 3D point cloud of the target 4, the control and processing unit 3 extracts the target region point set corresponding to the target 4 from the 3D point cloud based on the target contour (region of interest) extracted from the white light frame. This is to reduce the influence of background points in non-target regions on the geometric fitting results.

[0106] When the target 4 is a component with a circular opening or a circular end face, first, the end face points in the target area point set are calculated according to the plane equation. (in The Random Sample Consensus Algorithm (RANSAC) combined with the least squares method is used for plane fitting to obtain the end face reference plane and unit surface normal vector of the target 4. Next, the three-dimensional point set of the circular edge extracted from the target region point set is orthogonally projected onto the end face reference plane. Then, in the local two-dimensional orthogonal coordinate system of the end face reference plane, RANSAC combined with the least squares method is used according to the circle equation. Perform circle fitting, and then find the center of the resulting two-dimensional circle. Inverse transformation back to the probe's three-dimensional reference coordinate system The coordinates of the fitted circle center in three-dimensional space are obtained. The coordinates of the center of the target feature of the target being measured, 4.

[0107] Based on the fitted circle center coordinates and the central axis of the probe body 11 (in the probe's three-dimensional reference coordinate system) The Z-axis, also known as the Z-axis, has the following equation: The unit direction vector is ), calculate the center of the fitted circle Vertical distance to the central axis of probe body 11 And this vertical distance is used as the lateral eccentricity. Lateral eccentricity Used to quantitatively characterize the radial deviation of the center of the target 4 from the central axis of the probe body 11.

[0108] When the target 4 is a rotating component with an inner or outer cylindrical surface, the control and processing unit 3 performs RANSAC combined with least squares cylindrical fitting on the cylindrical surface points in the target area point set according to the spatial cylindrical surface equation, directly obtaining the unit target axis direction vector of the target 4. (and the coordinates of the reference center point on the axis); when the measured target 4 is a planar flange or annular end face component, the unit end face normal vector obtained by plane fitting is used. As the target reference direction vector.

[0109] The obtained target reference direction vector (target axis direction vector) or end face normal vector The unit direction vector of the probe body 11 and the central axis Perform dot product operation, according to or Calculate the spatial angle between the two and use this angle as the coaxial angle. .

[0110] Please refer to Figure 4 Lateral eccentricity The target feature center point of the measured target 4 To the central axis of probe body 11 ( Figure 4 The vertical distance (indicated by the reference line of the probe's optical axis) and coaxial angle. The target reference direction vector of the measured target 4 ( Figure 4 The angle between the measured surface normal (indicated by the center mark) and the central axis of the probe body 11. Lateral eccentricity. The radial distance, coaxial angle, of the center of the target 4 relative to the central axis of the probe body 11 within a cross-section (XOY plane) perpendicular to the central axis of the probe body 11 reflects this distance. This reflects the spatial tilt angle deviation of the measured target 4 relative to the central axis of the probe body 11, either along its axial direction or along its end face normal. This is achieved by simultaneously calculating the lateral eccentricity. and coaxial angle The coaxiality error of the target 4 relative to the central axis of the probe body 11 was fully quantified (including the radial position eccentricity component and the axis tilt angle component).

[0111] When using RANSAC combined with least squares for plane, circle, or cylinder fitting, the RANSAC algorithm first randomly selects the minimum number of sample points required to determine the geometric model from the target region point set (3 points for plane fitting, 3 points for projected circle fitting, and 5 points for spatial cylinder fitting) to calculate the parameters of the candidate geometric model. Then, it counts the number of interior points in the target region point set whose distance to the candidate geometric model is less than a preset tolerance threshold (e.g., 0.05 mm). After a preset number of iterations (e.g., 100–200), the candidate model with the largest number of interior points is selected as the initial fitting model. Finally, an overdetermined system of equations is constructed using all interior points corresponding to the initial fitting model for least squares fine fitting, and the root mean square distance from all interior points to the finely fitted geometric model is calculated as the root mean square residual of the 3D point cloud geometric fitting. (in The total number of interior points, For the first (Orthogonal distance from each interior point to the fitted surface). Compared to directly performing least-squares fitting on the entire point cloud containing noise, RANSAC combined with least-squares can effectively eliminate 3D outliers caused by local metallic specular reflections.

[0112] After completing the distance calculation and coaxiality calculation, the control and processing unit 3 determines the confidence level of the measurement results.

[0113] Specifically, the control and processing unit 3 acquires the number of valid matching points within the region of interest during the stereo matching process. Mean of image phase modulation intensity or correlation modulation intensity at effective matching points and the root mean square residual of geometric fitting of 3D point cloud The overall confidence level of the measurement results was calculated using the following normalized weighted formula. :

[0114]

[0115] in, Preset the number of baseline matching points (e.g.) ), The preset reference modulation intensity (for ZNCC correlation matching) is taken as follows: For 8-bit image phase shift demodulation ), To preset the maximum allowable fitting residual (e.g.) ), , , Preset non-negative weight coefficients and satisfy (For example, take) , , When only one or two indicators are used, the weight coefficients corresponding to the unused indicators are set to 0, while the sum of the remaining weight coefficients remains 1.

[0116] Among them, the number of valid matching points Used to characterize the effective 3D point cloud density obtained during stereo matching; mean modulation intensity Signal-to-noise ratio and matching significance used to characterize stripe or speckle features in structured light images; root mean square residual of geometric fitting. Used to characterize the fitting accuracy between the fitted geometric model and the target region point set. The smaller the value, the better the 3D point cloud matches the target geometric model. Therefore, by... (Transformed into a positive confidence component).

[0117] Control and processing unit 3 calculates the overall confidence level Compared with a preset reliability threshold (e.g.) ) for comparison. When the overall confidence level When the preset reliability threshold is reached or exceeded, the measurement result is determined to meet the reliability output conditions, and the distance value and lateral eccentricity are output through the communication interface 33. coaxial angle Overall confidence level and image data. When the overall confidence level If the result is below the preset confidence threshold, the valid output of the measurement result will be blocked and an alarm signal will be triggered to indicate that the measurement result does not meet the preset confidence requirement.

[0118] By setting up the above quantitative confidence determination process, it is possible to avoid outputting incorrect distance and coaxiality data when there are insufficient effective matching points, the contrast of the structured light image is degraded due to oil stains or strong reflections, or the geometric fitting error of the three-dimensional point cloud is too large. This provides a quantifiable basis for acceptance for downstream automatic assembly control systems or online quality inspection systems.

[0119] Example 3: Typical Measurement Cycle and Working Process

[0120] Reference Figures 1 to 5 In a complete measurement process, the probe assembly 1 is first inserted into the narrow channel or cavity to be measured, with the front end of the probe body 11 facing the target 4. The control and processing unit 3 initializes the imaging parameters and determines the parameters based on the objective lens entrance pupil diameter A, objective lens focal length f, nominal working distance Z, and predetermined defocusing amount. Perform operating condition criterion calculations.

[0121] After determining that binocular parallax ranging is to be used, the synchronization controller 32 first controls the white light illumination unit 21 to be lit, so that the white light is transmitted to the illumination output surface 15 through the illumination fiber 17, and the first imaging channel 12 and the second imaging channel 13 simultaneously acquire white light frames. The SoC processor 31 with integrated ISP extracts the contour of the target 4 under test from the white light frame and uses the contour for region constraints in subsequent image processing.

[0122] Subsequently, the synchronization controller 32 shuts down the white light illumination unit 21 and controls the structured light laser unit 22 to emit laser light. After being transmitted through the optical fiber 18, the laser light passes through the collimating lens 25 and the diffractive optical element 141 to form a speckle pattern or lattice pattern, which is then projected onto the surface of the target 4. The first imaging channel 12 and the second imaging channel 13 acquire structured light images under synchronous exposure conditions. When using a 4-step phase shift × 3-frequency scheme, the synchronization controller 32 sequentially controls the structured light laser unit 22 to generate structured light patterns corresponding to different phase shifts and frequencies, and synchronously triggers the binocular camera to expose during each frame projection, sequentially acquiring 12 frames of structured light images.

[0123] The SoC processor 31 with integrated ISP performs stereo matching on the structured light image to obtain the image plane parallax d, and calculates the first distance value based on the objective lens focal length f and the baseline b. Simultaneously, a 3D point cloud of the measured target 4 is generated. If a target with a known actual size is detected in the image... Based on the reference geometric features, its image plane size is further extracted. Calculate the second distance value And perform scale calibration or consistency verification according to the preset fusion strategy.

[0124] After completing the distance calculation, the control and processing unit 3 extracts the target region point set based on the target contour in the white light frame, performs circle fitting, cylinder fitting or plane fitting on the point set to obtain the center position and / or axis direction of the measured target 4, and further calculates the lateral eccentricity e and / or coaxial angle θ.

[0125] Finally, the control and processing unit 3 calculates the confidence level based on at least one of the following: the number of valid matching points, phase or correlation modulation intensity, and geometric fitting residual. It then determines whether to output the measurement result based on a preset confidence threshold. For results that meet the output conditions, the corresponding distance, lateral eccentricity e, coaxial angle θ, confidence level, and image data are output through the communication interface 33. For results that do not meet the output conditions, valid results are blocked from output and an alarm signal is triggered.

[0126] In summary, the working sequence of the entire device within a single complete measurement cycle is as follows: the synchronous controller 32 triggers each component to work in sequence via a GPIO hardware handshake signal → the white light illumination unit 21 is pulsed on and simultaneously acquires one white light frame by the first imaging channel 12 and the second imaging channel 13 → the white light illumination unit 21 is turned off → the structured light laser unit 22 is pulsed on and simultaneously acquires structured light images (one frame of speckle / dot matrix image or a sequence of 12 phase-shifted fringe images) by the first imaging channel 12 and the second imaging channel 13 → the SoC processor 31 with integrated ISP sequentially performs two-dimensional edge contour and ROI extraction, stereo matching and subpixel parallax calculation (or phase demodulation and low-profile mask culling), three-dimensional point cloud reconstruction and first distance value Z1 calculation, known size detection and dual-channel fusion (if a known size reference feature exists), target area point cloud segmentation and RANSAC+ least squares robust geometric fitting, lateral eccentricity e and coaxial angle θ calculation, and comprehensive confidence Q determination → the detection result is output or an alarm is triggered through the communication interface 33. The above measurement cycle can be continuously executed to achieve real-time online detection of the target 4 in the narrow channel.

[0127] The specific embodiments described above do not constitute a limitation on the scope of protection of this application. Any other corresponding changes and modifications made based on the technical concept of this application should be included within the scope of protection of this application.

Claims

1. A miniature endoscopic distance and coaxiality detection device, characterized in that, include: The probe assembly (1) includes a cylindrical probe body (11) with an outer diameter of D. A first imaging channel (12), a second imaging channel (13), and a structured light projection window (14) are provided on the front end surface of the probe body (11). The optical axes of the first imaging channel (12) and the second imaging channel (13) are both parallel to the central axis of the probe body (11), and the center distance between the two optical axes forms a baseline b. ; The light source module (2), rear-mounted outside the probe body (11) away from the front end, includes a structured light laser unit (22) connected to the structured light projection window (14) via a light transmission fiber (18) to project a structured light pattern onto the target (4); and The control and processing unit (3) is configured to perform stereo matching on the images synchronously acquired by the first imaging channel (12) and the second imaging channel (13) under the structured light pattern projection, generate a three-dimensional point cloud on the surface of the target (4) based on the parallax obtained from the stereo matching, and calculate the first distance value of the target feature center point on the target (4) along the central axis of the probe body (11). And based on the three-dimensional point cloud, perform three-dimensional fitting on the geometric features of the target (4) to obtain the target feature center coordinates and target reference direction vector of the target (4), and calculate the lateral eccentricity e and coaxial angle θ of the target (4) relative to the central axis of the probe body (11).

2. The miniature endoscopic distance and coaxiality detection device according to claim 1, characterized in that, The probe body (11) is further provided with an illumination emitting surface (15) on its front end surface. The light source module (2) also includes a white light illumination unit (21) connected to the illumination emitting surface (15) via an illumination fiber (17). The control and processing unit (3) includes an integrated ISP SoC processor (31) and a synchronization controller (32) interconnected with each other. The synchronization controller (32) is configured to control the white light illumination unit (21) and the structured light laser unit (22) to work in a time-sharing manner and interact with the first imaging channel (12) and the structured light laser unit (22) via a hardware handshake signal that interacts with the first imaging channel (12), the second imaging channel (13), the white light illumination unit (21), and the structured light laser unit (22). The exposure time of the second imaging channel (13) is synchronized, so that the first imaging channel (12) and the second imaging channel (13) first synchronously acquire one frame of white light under the illumination of the white light illumination unit (21) in the same measurement cycle, and then synchronously acquire at least one frame of structured light image projected by the structured light laser unit (22) after the white light illumination unit (21) is turned off; the SoC processor (31) with integrated ISP is configured to perform two-dimensional edge feature detection based on the white light frame to extract the target contour, and determine the closed pixel area enclosed by the target contour as the region of interest, so as to perform stereo matching and three-dimensional fitting only on the pixels located in the region of interest in the at least one frame of structured light image, and then calculate the first distance value. The lateral eccentricity e and the coaxial angle θ.

3. The miniature endoscopic distance and coaxiality detection device according to claim 2, characterized in that, The first imaging channel (12) and the second imaging channel (13) have miniature objectives with a focal length of f. The SoC processor (31) with integrated ISP is configured to perform sub-pixel physical parallax d at the center point of the target feature on the target (4) obtained by stereo matching, the focal length f of the miniature objective, and the baseline b according to... Calculate the first distance value The SoC processor (31) with integrated ISP is further configured to detect, in the white light frame or the at least one frame of structured light image, that the target under test (4) has a known actual size. The reference geometric features and their image plane feature dimensions are extracted. According to the relationship of similar triangles Calculate the second distance value at the location of the reference geometric feature. ; as well as Perform dual-channel fusion and mutual calibration processing, including: With the second distance value As an absolute scale reference, based on the second distance value at the location of the reference geometric feature. The reference distance value obtained by stereo matching with the binoculars at this location The ratio calculation scale correction factor Using the scale correction coefficient Online update of equivalent focal length baseline product parameters for binocular stereo matching channels , and according to Output the calibrated distance value Z; or, use the second distance value. As the main measurement output and using the first distance value As a consistency check metric, when When the preset deviation threshold is exceeded, a measurement abnormality is determined and an alarm signal is triggered; or, under the premise that the baseline b is kept constant by heat insulation encapsulation of the binocular stereo matching channel and the surface of the target (4) is coplanar with the reference geometric features, the image plane feature size is used. The baseline b and the image plane sub-pixel physical parallax d are calculated according to... For the equivalent objective lens focal length parameters at the current operating temperature Perform online identification and updates.

4. The miniature endoscopic distance and coaxiality detection device according to any one of claims 1 to 3, characterized in that, The probe body (11) has a wall thickness of A rigid, cylindrical mirror body with an inner diameter of The first imaging channel (12) includes a first miniature objective lens (121) and a first image sensor (122) disposed at the image plane of the first miniature objective lens (121); the second imaging channel (13) includes a second miniature objective lens (131) and a second image sensor (132) disposed at the image plane of the second miniature objective lens (131); the outer diameter D of the probe body (11) is 8~10mm, the baseline b is 4.8~6.0mm, and the ratio b / D of the baseline b to the outer diameter D satisfies The package size of both the first image sensor (122) and the second image sensor (132) is no larger than [the specified size]. Furthermore, it is directly integrated and packaged in the front end of the probe body (11); the effective apertures of the first micro-objective (121) and the second micro-objective (131) are both Both outer diameter and outer diameter are And the baseline b is the same as the outer diameter of the single micro-objective. The sum satisfies b+D m ≤D in -0.9mm.

5. The miniature endoscopic distance and coaxiality detection device according to claim 2, characterized in that, The illumination optical fiber (17) consists of 10 to 16 fibers with a diameter of The unit is composed of multimode optical fibers with a numerical aperture of 0.

5. The light-emitting end faces of each multimode optical fiber are arranged in a ring at equal angular intervals within the radial outer circumferential annular zone of the front end face to form the illumination light-emitting surface (15). The light-emitting surface size of the white light illumination unit (21) is less than or equal to the size of the light-emitting surface. Both the white light illumination unit (21) and the structured light laser unit (22) are driven by constant current. The synchronization controller (32) controls the white light illumination unit (21) and the structured light laser unit (22) to pulse-light within the exposure windows corresponding to the first imaging channel (12) and the second imaging channel (13). The duty cycle of each unit is less than or equal to 1. .

6. The miniature endoscopic distance and coaxiality detection device according to claim 1, characterized in that, The optical fiber (18) is a single-mode fiber or a few-mode fiber. The structured light projection window (14) is located at the midpoint of the line connecting the optical axes of the first imaging channel (12) and the second imaging channel (13). The edge spacing between the outer edge of the structured light projection window (14) and the outer edges of the first imaging channel (12) and the second imaging channel (13) both satisfy the following conditions: The structured light projection window (14) is provided with a collimating lens (25) at the incident end and a diffractive optical element (141) at the exit end. The laser with a wavelength of 650nm or 850nm emitted by the structured light laser unit (22) is transmitted through the optical fiber (18) and collimated by the collimating lens (25) before being incident on the diffractive optical element (141) to be converted into a spatial non-periodic pseudo-random speckle pattern or lattice pattern and projected onto the surface of the target (4). The control and processing unit (3) is configured to utilize the grayscale texture features formed by the speckle pattern or lattice pattern on the surface of the target (4) to construct a stereo matching cost function according to the zero-mean normalized cross-correlation criterion. The subpixel disparity between the first imaging channel (12) and the second imaging channel (13) is obtained by finding the minimum value of the stereo matching cost function within the epipolar search range and combining it with quadratic parabolic interpolation.

7. The miniature endoscopic distance and coaxiality detection device according to claim 1, characterized in that, The control and processing unit (3) is further configured to: acquire the number of valid matching points for stereo matching. Mean of image-related modulation intensity and the root mean square residual of geometric fitting of 3D point cloud According to the normalized weighted formula Calculate the overall confidence level Q of the measurement results, where Preset the number of baseline matching points, For preset reference modulation intensity, To preset the maximum allowable fitting residual, To meet The preset non-negative weighting coefficients; The measurement result is output when the overall confidence level Q reaches or exceeds the preset confidence threshold, and the measurement result output is blocked and an alarm signal is triggered when the overall confidence level Q is lower than the preset confidence threshold. The probe body (11) is encapsulated with a sapphire protective window (16) for sealing the first imaging channel (12), the second imaging channel (13) and the structured light projection window (14) on the outer side of the front end face. The control and processing unit (3) also includes a communication interface (33) for outputting distance value, lateral eccentricity e, coaxial angle θ, overall confidence level Q and image data.

8. A method for detecting distance and coaxiality using a miniature endoscope, applied to the miniature endoscope for detecting distance and coaxiality as described in any one of claims 1 to 7, characterized in that, The micro-endoscopic distance and coaxiality detection method includes the following steps: Image acquisition steps: The structured light laser unit (22) in the light source module (2) located outside the rear end of the probe body (11) away from the front end face projects a structured light pattern onto the target (4) through the light transmission fiber (18) and the structured light projection window (14), and achieves the desired image quality by... The first imaging channel (12) and the second imaging channel (13) synchronously acquire images under the structured light pattern projection; Stereo matching step: The control and processing unit (3) performs stereo matching on the images synchronously acquired by the first imaging channel (12) and the second imaging channel (13) under the structured light pattern projection. Based on the parallax obtained from the stereo matching, a three-dimensional point cloud of the surface of the target (4) is generated, and the first distance value of the target feature center point on the target (4) along the central axis of the probe body (11) is calculated. ;as well as Coaxiality calculation steps: The control and processing unit (3) performs three-dimensional fitting on the geometric features of the target (4) based on the three-dimensional point cloud to obtain the target feature center coordinates and target reference direction vector of the target (4), and calculates the lateral eccentricity e and coaxial angle θ of the target (4) relative to the central axis of the probe body (11).

9. The miniature endoscopic distance and coaxiality detection method according to claim 8, characterized in that, The first imaging channel (12) and the second imaging channel (13) have miniature objectives with a focal length of f. In the stereo matching step, based on the sub-pixel physical parallax d of the image plane at the center point of the target feature on the target (4) obtained by stereo matching, the focal length f of the miniature objective, and the baseline b, according to... Calculate the first distance value ; Furthermore, after the image acquisition step, a known size detection step is included: detecting whether the target (4) has a known actual size in the acquired image. If the baseline geometric features are detected, their image plane feature dimensions are extracted. And according to the similar triangle relationship Calculate the second distance value at the location of the reference geometric feature. ; and the dual-channel fusion step: after the stereo matching step and the known size detection step, when the second distance value is obtained. At that time, using the second distance value As an absolute scale reference, based on the second distance value at the location of the reference geometric feature. The reference distance value obtained by stereo matching with the binoculars at this location The ratio calculation scale correction factor Using the scale correction coefficient Online update of equivalent focal length baseline product parameters for binocular stereo matching channels , and according to Obtain the calibrated distance value Z; or, use the second distance value As the main measurement output and using the first distance value Perform consistency checks when An abnormal alarm signal is triggered when the preset deviation threshold is exceeded; or, under the premise that the baseline b is kept constant by heat insulation encapsulation of the binocular stereo matching channel and the surface of the target (4) is coplanar with the reference geometric features, the image plane feature size is used. The baseline b and the image plane sub-pixel physical parallax d are calculated according to... For the equivalent objective lens focal length parameters at the current operating temperature Perform online identification and updates.

10. The miniature endoscopic distance and coaxiality detection method according to claim 8, characterized in that, The light source module (2) further includes a white light illumination unit (21) connected to the illumination emitting surface (15) on the front end face of the probe body (11) via an illumination fiber (17); in the image acquisition step, within the same measurement cycle, the white light illumination unit (21) in the light source module (2) is first controlled to pulse-light within the exposure windows of the first imaging channel (12) and the second imaging channel (13) to synchronously acquire one frame of white light, which is used to perform two-dimensional edge feature detection and determine the closed pixel region enclosed by the extracted target contour as the region of interest to guide subsequent stereo matching and three-dimensional edge detection. The point cloud is extracted, and then the white light illumination unit (21) is turned off and the structured light laser unit (22) is controlled to pulse and illuminate within the exposure window of the first imaging channel (12) and the second imaging channel (13) to synchronously acquire structured light images under static speckle patterns or dot matrix patterns. Alternatively, when the light source module (2) is equipped with an optical fiber stripe modulation component, a sequence of 12 frames of sinusoidal stripe structured light frames with 4-step phase shift × 3 spatial frequencies is acquired synchronously. The white light illumination unit (21) and the structured light laser unit (22) work in a time-sharing manner and their respective illumination duty cycles are less than or equal to 30%. In the coaxiality calculation step, the target area point set of the target (4) is extracted from the three-dimensional point cloud under the guidance of the target contour of the white light frame. First, the end face points in the target area point set are fitted with a plane to determine the end face reference plane. Then, the circular edge points in the target area point set are projected onto the end face reference plane and the least squares method or RANSAC combined with the least squares method is used to perform circle fitting to obtain the center coordinates of the fitted circle in three-dimensional space as the center coordinates of the target feature. The vertical distance between the fitted circle center coordinates and the central axis of the probe body (11) is calculated as the lateral eccentricity e. The target area point set is fitted with a cylinder or a plane to obtain the target axis direction vector or the end face normal vector direction vector as the target reference direction vector. The angle between the target axis direction vector or the end face normal vector direction vector and the central axis direction vector of the probe body (11) is calculated as the coaxial angle θ. The confidence level determination step is included after the coaxiality calculation step. Based on the number of valid matching points in stereo matching Image phase modulation intensity or mean correlation modulation intensity and the root mean square residual of geometric fitting of 3D point cloud The overall confidence level Q is calculated using the following normalized weighted formula: Calculate the overall confidence level ,in Preset the number of baseline matching points, For preset reference modulation intensity, To preset the maximum allowable fitting residual, To meet The preset non-negative weighting coefficients; When the overall confidence level Q reaches or exceeds the preset confidence threshold, the distance value, the lateral eccentricity e, the coaxial angle θ, and the overall confidence level Q are output. When the overall confidence level Q is lower than the preset confidence threshold, the measurement result output is blocked and an alarm signal is triggered.