A machine vision-based indwelling needle assembly defect detection method

CN123015541APending Publication Date: 2026-10-30AP TECH (XIAMEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611486123.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-23
Publication Date
2026-10-30

AI Technical Summary

Technical Problem

[0003]尽管如此,现有留置针组件缺陷检测方法仍存在改进之处,难以区分真实的材料缺陷与光学投影干扰,导致误报率提高,此外,缺乏对圆柱形组件进行轴向与周向展开的材料坐标映射机制,难以在组件旋转过程中对同一缺陷进行多角度的特征关联与验证,从而导致对功能性缺陷的漏检

Benefits of technology

[0055]本发明有益效果为:通过建立个性化的组件界面基准图,一定程度上消除了产品个体差异带来的误判,通过独特的材料坐标映射机制,实现了对旋转圆柱体表面缺陷的定位与跨角度特征关联,并且利用梯度反向性验证和穿刺针遮挡带再现性逻辑,剔除了光照伪影与投影干扰,这一系列技术手段协同作用,降低了留置针组件检测过程中的误报率与漏检率,实现了对线状缺陷、面状缺陷、线状跨界缺陷及面状跨界缺陷的识别与量化分析,从而有效提升了医疗器械生产的质量控制水平与自动化检测的可靠性。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123015541A_ABST
    Figure CN123015541A_ABST
Patent Text Reader

Abstract

The application discloses a kind of based on machine vision's indwelling needle assembly defect detection method, it is related to defect detection technical field, the method is removed illumination interference edge by according to the position consistency of interface attribution abnormal edge and gradient reversibility, the puncture needle projection range in each corner under backlight profile is expanded outward, forms puncture needle shielding band, according to the reproduction state of remaining interface attribution abnormal edge outside puncture needle shielding band, remove projection interference edge, form material abnormal edge, material abnormal edge is written into component interface reference map and constructs defect through topology, analyzes defect through topology, obtains the detection result of the indwelling needle assembly to be detected;The application reduces the false alarm rate and the rate of omission in the detection process of indwelling needle assembly by constructing defect through topology, realizes the identification and quantitative analysis of linear defect, surface defect, linear cross-border defect and surface cross-border defect.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of defect detection technology, and in particular to a method for defect detection of indwelling needle components based on machine vision. Background Technology

[0002] As the medical device manufacturing industry continues to develop towards automation and precision, indwelling needles, as key consumables in clinical infusion therapy, face increasingly stringent production quality control standards. Indwelling needle assemblies typically consist of a transparent polymer catheter and an internal metal puncture needle. The assembly process involves complex bonding techniques, and extremely high requirements are placed on the sharpness of the needle tip, the smoothness of the catheter's inner wall, and the sealing of the bonding area. To ensure high product yield and safety, machine vision inspection technology has gradually replaced manual visual inspection as the mainstream online inspection method. This has, to a certain extent, automated the production line, meeting basic dimensional measurement and surface foreign object detection needs, and improving production efficiency.

[0003] Nevertheless, existing methods for detecting defects in indwelling needle components still have room for improvement. They struggle to distinguish between genuine material defects and optical projection interference, leading to a higher false alarm rate. Furthermore, they lack a material coordinate mapping mechanism for axial and circumferential expansion of cylindrical components, making it difficult to perform multi-angle feature correlation and verification of the same defect during component rotation, thus resulting in missed detection of functional defects. Summary of the Invention

[0004] In view of the aforementioned existing problems, the present invention is proposed.

[0005] Therefore, the present invention provides a machine vision-based defect detection method for indwelling needle components to solve the problem of missed detection of functional defects.

[0006] To solve the above-mentioned technical problems, the present invention provides the following technical solution:

[0007] This invention provides a machine vision-based method for detecting defects in indwelling needle components, comprising:

[0008] The backlight contour image, reverse dark field image, different focal plane images and polarization image of the indwelling needle assembly under test at each corner are collected and registered to form a multi-perturbation image group.

[0009] After extracting the normal structural edges of the transparent indwelling catheter, metal puncture needle, needle tip bevel and bonding transition zone from the multi-perturbation image group, the catheter centerline and puncture needle centerline are fitted to form a component interface reference map.

[0010] Establish axial-circumferential material coordinates and map the multi-perturbation image group into a material coordinate map;

[0011] Candidate anomalous edges that deviate from the normal structure edges are extracted from the material coordinate diagram. The interfaces to which the candidate anomalous edges belong are identified based on the responses of the candidate anomalous edges in the reverse dark field diagram, different focal plane diagrams and polarization diagrams, thus forming interface-assigned anomalous edges.

[0012] Based on the positional consistency and gradient reversal of the interface-assigned abnormal edges, the illumination interference edges are removed. The projection range of the puncture needle in the backlight contour map at each corner is expanded to form a puncture needle occlusion zone. Based on the reproduction state of the remaining interface-assigned abnormal edges outside the puncture needle occlusion zone, the projection interference edges are removed to form material abnormal edges.

[0013] The abnormal material edge is written into the component interface baseline map to construct the defect penetration topology. The defect penetration topology is parsed to obtain the test results of the indwelling needle component to be inspected.

[0014] As a preferred embodiment of the machine vision-based defect detection method for indwelling needle assembly described in this invention, the indwelling needle assembly to be inspected includes a transparent indwelling catheter and a metal puncture needle inserted into the transparent indwelling catheter.

[0015] The front end of the metal puncture needle is a beveled tip;

[0016] The transparent indwelling catheter is provided with an adhesive transition zone.

[0017] In a preferred embodiment of the machine vision-based defect detection method for indwelling needle components described in this invention, the step of forming a multi-perturbation image group specifically includes:

[0018] The indwelling needle assembly to be inspected is fixed along the axial direction. The indwelling needle assembly to be inspected is controlled to rotate sequentially at preset equal angular intervals and stop at each angle. Backlight illumination is turned on to collect backlight contour map. After the backlight illumination is turned off, the reverse dark field map is collected by sequentially illuminating from the opposite direction. Backlight illumination is maintained and the focal plane position is adjusted sequentially along the imaging optical axis to collect different focal plane maps. Under a fixed illumination direction, parallel polarization state and orthogonal polarization state are set sequentially to collect polarization map.

[0019] Write the backlight profile diagram, reverse dark field diagram, different focal plane diagrams and polarization diagram into the corresponding indwelling needle component number and corner number to be inspected;

[0020] Using the backlight profile at the same angle as the registration reference, the endpoints of the transparent indwelling catheter, the tip of the metal puncture needle, and the boundary points of the bonding transition zone are extracted from the backlight profile as registration points. The corresponding registration points are located in the reverse dark field image, different focal plane images, and polarization images at the same angle.

[0021] The rotation and translation amounts are calculated based on the positional differences between the corresponding registration points. The image coordinates of the reverse dark field image, different focal plane images and polarization images are transformed into the backlight contour image. The images are then associated according to the component number, corner number and image category of the indwelling needle under inspection to form a multi-perturbation image group.

[0022] As a preferred embodiment of the machine vision-based defect detection method for indwelling needle components according to the present invention, wherein: the formation of the component interface reference map specifically includes:

[0023] Read the multi-perturbation image group sequentially according to the corner number, and extract the outer contour edge of the transparent indwelling catheter, the inner contour edge of the transparent indwelling catheter, the contour edges of both sides of the metal puncture needle, and the contour edge of the needle tip bevel according to the gray-scale abrupt change position in the backlight contour image.

[0024] The extraction results were checked point by point using the brightness, sharpness and polarization response changes of the reverse dark field image, different focal plane images and polarization images at the same image coordinates under the same rotation angle. The contour edges with continuous positions and stable response differences with adjacent areas were retained. The bonding transition zone boundary was extracted based on the continuous response change position between the transparent indwelling catheter and the metal puncture needle. The outer contour edge of the transparent indwelling catheter, the inner contour edge of the transparent indwelling catheter, the contour edges on both sides of the metal puncture needle, the contour edge of the needle tip bevel and the bonding transition zone boundary were marked as normal structure edges.

[0025] The midpoints between the normal structural edges on both sides of the transparent indwelling catheter are calculated sequentially along the axis of the transparent indwelling catheter and continuously fitted to form the catheter centerline. The midpoints between the normal structural edges on both sides of the metal puncture needle are calculated sequentially along the axis of the metal puncture needle and continuously fitted to form the puncture needle centerline. The normal structural edges, catheter centerline and puncture needle centerline are written into a unified image coordinate system according to the corner number to form a component interface reference map.

[0026] As a preferred embodiment of the machine vision-based defect detection method for indwelling needle components described in this invention, the establishment of axial-circumferential material coordinates specifically includes:

[0027] The intersection of the catheter centerline and the normal structural edge of the transparent indwelling catheter tip is taken as the axial starting point. The axial position is continuously set along the catheter centerline according to the image pixel spacing, and the cumulative distance from each axial position to the axial starting point is taken as the axial coordinate.

[0028] The corners of the indwelling needle assembly to be inspected are read according to the corner number. The projection position relationship between the catheter centerline and the outer contour edges of the transparent indwelling catheter on both sides is identified at each axial position. The circumferential position of the image to be mapped relative to the current corner is calculated based on the ratio between the distance from the image to be mapped to the catheter centerline and the distance from the catheter centerline to the outer contour edge of the corresponding transparent indwelling catheter. The calculated circumferential position is used as the circumferential coordinate of the corresponding image to be mapped, and the axial-circumferential material coordinates are established.

[0029] As a preferred embodiment of the machine vision-based defect detection method for indwelling needle components described in this invention, the step of mapping the multi-perturbation image group to a material coordinate diagram specifically involves:

[0030] Draw perpendicular lines along the axial positions of the catheter centerline, and read the backlight contour image value, reverse dark field image value, different focal plane image value and polarization image value at the corresponding positions between the perpendicular lines and the normal structural edge of the transparent indwelling catheter in the multi-perturbation image group.

[0031] The backlight contour image value, reverse dark field image value, image values ​​of different focal planes, and polarization image value are written into the same image position according to the corresponding axial and circumferential coordinates, and the overlapping image positions corresponding to adjacent corners are averaged to form a material coordinate diagram.

[0032] As a preferred embodiment of the machine vision-based defect detection method for indwelling needle components described in this invention, the step of extracting candidate abnormal edges deviating from the normal structural edges from the material coordinate diagram specifically involves:

[0033] The normal structural edges in the component interface reference diagram are mapped to the material coordinate diagram according to the axial-circumferential material coordinates. The gray-level gradient between adjacent image positions is calculated based on the backlight contour image value in the material coordinate diagram. The local maxima of the gray-level gradient are connected to form continuous edge lines.

[0034] Continuous edge lines that coincide with normal structural edges and extend in the same direction are considered normal structural edges, while continuous edge lines that do not coincide with normal structural edges or deviate from normal structural edges are considered candidate abnormal edges.

[0035] In a preferred embodiment of the machine vision-based defect detection method for indwelling needle components described in this invention, the step of forming an interface belonging to an abnormal edge specifically involves:

[0036] Along the normal structural edges of the transparent indwelling catheter, metal puncture needle, needle tip bevel, and adhesive transition zone, the brightness difference between the two sides of the normal structural edge in the reverse dark field image is read respectively. The sum of the absolute values ​​of the gray-level gradients of the neighborhood of the normal structural edge in different focal plane images at each focal plane position is calculated. The difference between the sum of the maximum and minimum absolute values ​​of the gray-level gradients is calculated. The brightness difference under different polarization states in the polarization image is read. The average reverse dark field response, the average response of different focal planes, and the average polarization response of the normal structural edges corresponding to the transparent indwelling catheter, metal puncture needle, needle tip bevel, and adhesive transition zone are calculated respectively.

[0037] Based on the axial and circumferential coordinates of the candidate abnormal edge, the same response of the candidate abnormal edge is read in the reverse dark field image, different focal plane images and polarization images. The initial response difference between the average response of the candidate abnormal edge and the average response of the corresponding normal structural edge of the transparent indwelling catheter, metal puncture needle, needle tip bevel and adhesive transition zone is calculated respectively.

[0038] The initial response difference between the candidate abnormal edge and each normal structural edge under the same response is normalized to form a normalized response difference. The reverse dark field response weight, different focal plane response weight and polarization response weight are calculated based on the response difference between the normal structural edges corresponding to the transparent indwelling catheter, metal puncture needle, needle tip bevel and adhesive transition zone.

[0039] Each normalized response difference is multiplied by its corresponding response weight and then summed to form a comprehensive response difference between the candidate abnormal edge and the transparent indwelling catheter, metal puncture needle, needle tip bevel, and adhesive transition zone. The interface to which the normal structural edge with the smallest comprehensive response difference belongs is identified as the interface to which the candidate abnormal edge belongs. The candidate abnormal edges are marked according to their respective interfaces to form interface-assigned abnormal edges.

[0040] In a preferred embodiment of the machine vision-based defect detection method for indwelling needle components described in this invention, the formation of a material abnormality edge specifically involves:

[0041] The allowable position difference is calculated based on the maximum position difference between each registration point after it is transformed to the backlight profile and the corresponding registration point in the backlight profile during the registration process.

[0042] Read the interface anomalous edges one by one according to the axial-circumferential material coordinates, find the edge positions corresponding to the interface anomalous edges in the reverse dark field map under different lighting directions, and calculate the axial coordinate difference and circumferential coordinate difference of the edge positions.

[0043] Based on the number of pixels corresponding to the outer diameter of the transparent indwelling conduit, the circumferential coordinate difference is converted into the circumferential position difference, and the gray-scale gradient direction is calculated. Interface aberration edges with axial coordinate difference and circumferential position difference not greater than the allowable position difference and opposite gray-scale gradient directions under different lighting directions are retained. Interface aberration edges with axial coordinate difference and circumferential position difference greater than the allowable position difference and gray-scale gradient direction not reversed are removed as lighting interference edges.

[0044] Extract the outline edges of the metal puncture needle from the backlight contour map at each corner, connect the outline edges of the metal puncture needle to form the projection range of the puncture needle, and extend it outward from the projection range of the puncture needle according to the allowable position difference to form a puncture needle occlusion zone.

[0045] Retain the remaining abnormal edges whose interfaces belong to the metal puncture needle and the bevel of the needle tip;

[0046] For the remaining abnormal edges of the interface that belong to the transparent indwelling catheter and the bonding transition zone, determine whether the remaining abnormal edges of the interface belong to the puncture needle shielding zone at each corner, and find the corresponding edge position of the remaining abnormal edges of the interface after they leave the puncture needle shielding zone according to the axial coordinate and circumferential coordinate.

[0047] Retain any remaining interface anomalous edges that reappear within the allowable positional difference after leaving the puncture needle shielding zone. Identify and remove any remaining interface anomalous edges that only appear within the puncture needle shielding zone and do not reappear after leaving the puncture needle shielding zone as projection interference edges. Collect the retained remaining interface anomalous edges as material anomalous edges.

[0048] In a preferred embodiment of the machine vision-based defect detection method for indwelling needle components described in this invention, the step of obtaining the detection result of the indwelling needle component to be inspected specifically includes:

[0049] According to the axial-circumferential material coordinates, the axial coordinates, circumferential coordinates and the interface to which each material abnormality edge belongs are written into the component interface reference diagram. Material abnormality edges that intersect each other and whose distance between endpoints is no greater than the allowable position difference are connected in sequence to form continuous material abnormality edges.

[0050] Record the intersection, crossing, termination and closure relationships between the continuous material anomalous edges and the normal structural edges of the transparent indwelling catheter, metal puncture needle, needle tip bevel and bonding transition zone, and construct the defect-through topology;

[0051] Analyze the topology of defects, mark the basic shape type of continuous material anomaly edges that do not form closed regions as linear, and mark the basic shape type of continuous material anomaly edges that form closed regions as planar;

[0052] Read the crossing relationship between continuous material anomaly edges and normal structure edges according to the connection order of continuous material anomaly edges. When a continuous material anomaly edge crosses a normal structure edge, the material anomaly edges before and after the crossing position remain continuously connected, and the belonging interfaces recorded by the material anomaly edges before and after the crossing position are different, mark the crossing state of the continuous material anomaly edge as crossing; otherwise, mark the crossing state of the continuous material anomaly edge as non-crossing.

[0053] Based on the basic morphology type and the boundary state, continuous material anomaly edges with a basic morphology type of linear and a boundary state of non-boundary are identified as linear defects; continuous material anomaly edges with a basic morphology type of planar and a boundary state of non-boundary are identified as planar defects; continuous material anomaly edges with a basic morphology type of linear and a boundary state of boundary are identified as linear boundary defects; and continuous material anomaly edges with a basic morphology type of planar and a boundary state of boundary are identified as planar boundary defects.

[0054] The interfaces to which continuous material anomaly edges belong are deduplicated to form a set of defect-related interfaces. Based on the set of defect-related interfaces, the transparent indwelling catheter, metal puncture needle, needle tip bevel, and bonding transition area involved in the defect are identified. The defect location is identified based on the axial and circumferential coordinates. The defect size is calculated based on the axial span, circumferential span, and closed area of ​​the continuous material anomaly edge. The defect type, defect-related interfaces, defect location, and defect size are collected to obtain the test results of the indwelling needle assembly to be inspected.

[0055] The beneficial effects of this invention are as follows: By establishing a personalized component interface baseline map, misjudgments caused by individual product differences are eliminated to a certain extent. Through a unique material coordinate mapping mechanism, the location of surface defects of rotating cylinders and cross-angle feature correlation are realized. Furthermore, by utilizing gradient reverse verification and reproducibility logic of the puncture needle occlusion band, illumination artifacts and projection interference are eliminated. The synergistic effect of these technologies reduces the false alarm rate and false negative rate in the indwelling needle component detection process. It enables the identification and quantitative analysis of linear defects, planar defects, linear cross-boundary defects, and planar cross-boundary defects, thereby effectively improving the quality control level and reliability of automated testing in medical device production. Attached Figure Description

[0056] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the following description of the embodiments will be briefly introduced. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0057] Figure 1 This is a flowchart of a machine vision-based defect detection method for indwelling needle components.

[0058] Figure 2 Multiple curves showing the occlusion ratio and the retention rate of abnormal edges in the actual material.

[0059] Figure 3 A heatmap showing the accuracy of cross-corner correlation.

[0060] Figure 4 This is a scatter plot of the actual area and the detected area of ​​the planar defect. Detailed Implementation

[0061] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings.

[0062] Many specific details are set forth in the following description in order to provide a full understanding of the invention. However, the invention may also be practiced in other ways different from those described herein, and those skilled in the art can make similar extensions without departing from the spirit of the invention. Therefore, the invention is not limited to the specific embodiments disclosed below.

[0063] Secondly, the term "one embodiment" or "embodiment" as used herein refers to a specific feature, structure, or characteristic that may be included in at least one implementation of the present invention. The phrase "in one embodiment" appearing in different places in this specification does not necessarily refer to the same embodiment, nor is it a single or selective embodiment that is mutually exclusive with other embodiments.

[0064] Reference Figures 1-4 As one embodiment of the present invention, this embodiment provides a machine vision-based method for detecting defects in indwelling needle components, comprising the following steps:

[0065] S1: Collect backlight contour images, reverse dark field images, different focal plane images and polarization images of the indwelling needle assembly under inspection at each corner, register them, and form a multi-perturbation image group.

[0066] S1.1: It should be noted that the indwelling needle assembly under test includes a transparent indwelling catheter and a metal puncture needle inserted inside the transparent indwelling catheter. The front end of the metal puncture needle is a beveled tip, and the transparent indwelling catheter is provided with an adhesive transition zone. The indwelling needle assembly under test is fixed axially so that its axial direction coincides with the rotation axis. An industrial camera with an imaging lens is installed on the side of the indwelling needle assembly facing the imaging direction. Taking the initial placement position of the indwelling needle assembly under test as the starting angle, the indwelling needle assembly under test is rotated at preset equal angular intervals. After each rotation reaches the corresponding angle and stops, the position of the indwelling needle assembly under test remains unchanged. Backlighting is set on the side of the indwelling needle assembly under test away from the industrial camera. On the side, turn on the backlight illumination, allowing light to pass through the transparent indwelling catheter and form a projection on the metal puncture needle. Use an industrial camera to capture the backlight contour image at the corresponding corner. Turn off the backlight illumination and sequentially illuminate the indwelling needle assembly from both sides in opposite directions. Use the industrial camera to capture reverse dark field images of different illumination directions at the corresponding corners. Turn the backlight illumination back on, keeping the imaging directions of the indwelling needle assembly, backlight illumination, and industrial camera unchanged. First, adjust the distance between the imaging lens and the indwelling needle assembly along the imaging optical axis until the outline of the transparent indwelling catheter closer to the imaging direction is clear. Record the first focal plane position and capture the corresponding focal plane image using the industrial camera. Then, move the lens sequentially along the imaging optical axis by equal displacement. The imaging lens is moved until the outlines of both sides of the metal puncture needle and the bevel of the needle tip are clear. The second focal plane position is recorded, and the corresponding focal plane image is acquired through an industrial camera. The imaging lens is then moved along the imaging optical axis until the outline of the transparent indwelling catheter on the side away from the imaging direction is clear. The third focal plane position is recorded, and the corresponding focal plane image is acquired through an industrial camera. The backlight intensity, exposure time of the industrial camera, and image resolution are kept consistent at the first, second, and third focal plane positions to form different focal plane images at corresponding angles. A polarizer is placed on the light path of the light source with a fixed illumination direction, and an analyzer is placed in front of the imaging lens. The transmission axis direction of the polarizer is used as the polarization direction reference to maintain the polarization direction of the indwelling catheter under inspection. With the position of the needle assembly, the fixed illumination direction, and the focal plane position unchanged, rotate the analyzer so that its transmission axis is aligned with that of the polarizer, forming a parallel polarization state. Then, acquire the polarization map under this parallel polarization state using an industrial camera. After acquiring the polarization map under this parallel polarization state, keep the transmission axis of the polarizer unchanged and rotate the analyzer 90 degrees so that its transmission axis is perpendicular to that of the polarizer, forming an orthogonal polarization state. Acquire the polarization map under this orthogonal polarization state using an industrial camera. After acquiring the backlight profile, reverse dark field image, different focal plane images, and polarization map at each rotation angle, continue rotating the needle assembly until image acquisition is completed for all rotation angles.

[0067] Furthermore, before image acquisition begins, each indwelling needle assembly to be inspected executes the image acquisition sequence sequentially, assigning a unique indwelling needle assembly number to each assembly. Using the initial turning angle as the zero-degree turning angle, the turning angle numbers are accumulated sequentially at preset equal angular intervals. Each time the industrial camera acquires a backlight contour image, a reverse dark field image, a different focal plane image, or a polarization image, it reads the current indwelling needle assembly number and the current turning angle number, writing the indwelling needle assembly number, turning angle number, and image category into the corresponding image file name. Specifically, the file name for the reverse dark field image is written with the illumination direction; the file name for the different focal plane images is written with the first focal plane position, the second focal plane position, or the third focal plane position; and the file name for the polarization image is written with the parallel polarization state or the orthogonal polarization state. This establishes a correspondence between the backlight contour image, reverse dark field image, different focal plane image, and polarization image of the same indwelling needle assembly at the same turning angle, based on the indwelling needle assembly number and the turning angle number.

[0068] The preset equal angle interval is set according to the requirement of complete coverage of the circumferential surface of the transparent indwelling catheter and maintaining the overlapping area of ​​adjacent corner images. For example, the preset equal angle interval is 45°, which corresponds to collecting 8 corners around the circumference.

[0069] S1.2: It should be noted that, according to the number of the indwelling needle assembly under test and the corner number, the backlight profile image, reverse dark field image, different focal plane images, and polarization image under the same corner are read, and the backlight profile image is used as the registration reference; with the axis of the indwelling needle assembly under test as the scanning direction, the scanning positions are continuously set along the axis of the indwelling needle assembly under test in the backlight profile image. At each scanning position, the gray value of each image position is read sequentially in the direction perpendicular to the axis of the indwelling needle assembly under test, and the absolute value of the gray value difference between adjacent image positions is calculated. The image position where the absolute value of the gray value difference is greater than the average value of the absolute value of the gray value difference at the same scanning position and is a local maximum value is determined as the gray value change position. The gray value change position is determined according to the minimum distance between adjacent scanning positions and the direction of gray value change. To establish a consistent connection, the grayscale abrupt change positions corresponding to each scanning position are sequentially connected to form a contour line. The endpoints of the transparent indwelling catheter contour line are selected along the axial direction of the indwelling needle assembly to be inspected as the endpoints of the transparent indwelling catheter contour line. The foremost position of the metal puncture needle contour line facing the needle tip slope is selected as the needle tip point of the metal puncture needle. The continuous grayscale change boundary between the transparent indwelling catheter and the metal puncture needle is extracted, and the midpoint of the continuous grayscale change boundary is selected as the boundary point of the bonding transition zone. The endpoints of the transparent indwelling catheter contour line, the needle tip point of the metal puncture needle, and the boundary point of the bonding transition zone are used as registration points. The endpoints of the transparent indwelling catheter contour line at both ends are read from the backlight contour image, and the contour lines are then connected along the indwelling catheter assembly to be inspected. The midpoint between the two transparent indwelling catheter outline endpoints is taken along the axial direction of the needle assembly. Excluding the positions corresponding to the transparent indwelling catheter outline endpoints, the metal puncture needle tip, and the boundary points of the bonding transition zone along the axial direction of the indwelling needle assembly under test, the image position closest to the midpoint is taken as the midpoint of the transparent indwelling catheter. A cross-section is drawn at the midpoint of the transparent indwelling catheter along a direction perpendicular to the axial direction of the indwelling needle assembly under test. Image positions are sequentially read from both ends of the cross-section towards the interior of the indwelling needle assembly under test. The first grayscale abrupt change when the image background enters the transparent indwelling catheter material on each side is taken as the intersection point of the cross-section and the outer contours of both sides of the transparent indwelling catheter. The pixel distance between the two intersection points is calculated. The pixel distance is used as the number of pixels corresponding to the outer diameter of the transparent indwelling catheter. Taking each registration point in the backlight contour map as the center, the search range is expanded in both the horizontal and vertical directions along the image by the number of pixels corresponding to the outer diameter of the transparent indwelling catheter, forming a search range whose horizontal and vertical lengths are both twice the number of pixels corresponding to the outer diameter of the transparent indwelling catheter. Within the search range of the reverse dark field map, different focal plane maps, and polarization maps at the same turning angle, the search range is moved pixel by pixel. The difference between the gray-level gradient distribution around each moving position and the gray-level gradient distribution around the corresponding registration point in the backlight contour map is calculated. The moving position with the smallest difference in gray-level gradient distribution is determined as the corresponding registration point in the reverse dark field map, different focal plane maps, and polarization maps, respectively.

[0070] S1.3: It should be noted that, following the arrangement order of the transparent indwelling catheter outline endpoint, the metal puncture needle tip, and the bonding transition zone boundary point, the lateral and longitudinal coordinates of the corresponding registration points in the backlight outline image and each reverse dark field image, different focal plane images, and polarization images at the same angle are read respectively. The average lateral and longitudinal coordinates of all registration points in the backlight outline image and each reverse dark field image, different focal plane images, and polarization images are calculated. The difference between the lateral coordinate of each registration point and the average lateral coordinate of all registration points in the corresponding image is calculated to obtain the centered lateral coordinate of the registration point. The difference between the longitudinal coordinate of each registration point and the average longitudinal coordinate of all registration points in the corresponding image is calculated to obtain the centered longitudinal coordinate of the registration point. The centered lateral coordinate of the registration point in the backlight outline image is multiplied by the centered lateral coordinate of the corresponding image registration point. The centered longitudinal coordinate of the registration point in the backlight outline image is multiplied by the centered longitudinal coordinate of the corresponding image registration point. The sum of the two product results is then accumulated for all registration points to obtain the dot product sum of the centered coordinates of the registration points. The product of the centered vertical coordinates of the registration points in the backlight contour image and the centered horizontal coordinates of the corresponding registration points in the image is calculated. The product of the centered horizontal coordinates of the registration points in the backlight contour image and the centered vertical coordinates of the corresponding registration points in the image is then calculated. The difference between the two products is calculated, and this difference is summed for all registration points to obtain the cross product of the centered coordinates of the registration points. This cross product sum is used as the vertical input for the bivariate arctangent calculation, and the dot product sum is used as the horizontal input for the bivariate arctangent calculation. The rotation amount relative to the backlight contour image is then calculated for each inverted dark field image, different focal plane images, or polarization images.

[0071] ;

[0072] in, Indicates the amount of rotation. This represents the sum of the cross products of the registration point's centered coordinates. This represents the sum of the dot product of the registration point's centered coordinates.

[0073] The rotation is calculated based on the average horizontal and vertical coordinates of the registration points for each reversed dark field image, different focal plane images, or polarization images. The difference between the average horizontal coordinates of the registration points in the backlight contour image and the rotated average horizontal coordinates is calculated to obtain the horizontal translation amount, expressed by the formula:

[0074] ;

[0075] in, Indicates the lateral translation amount. This represents the average horizontal coordinate of the registration points in the backlight profile diagram. This represents the average lateral coordinate of all corresponding registration points in each inverted dark field image, different focal plane images, or polarization images. Indicates the amount of rotation. This represents the average value of the longitudinal coordinates of the registration points.

[0076] Based on the rotation amount, the average horizontal and vertical coordinates of the registration points for each inverted dark field image, different focal plane images, or polarization images are rotated and calculated to obtain the average vertical coordinate after rotation. The formula is as follows:

[0077] ;

[0078] in, This represents the average value of the vertical coordinate after rotation. This represents the average lateral coordinate of all corresponding registration points in each inverted dark field image, different focal plane images, or polarization images. This represents the average value of the longitudinal coordinates of the registration points. Indicates the amount of rotation.

[0079] The difference between the average value of the longitudinal coordinates of the registration points of the backlight profile and the average value of the rotated longitudinal coordinates is calculated to obtain the longitudinal translation amount; the translation amount consists of the lateral translation amount and the longitudinal translation amount.

[0080] For each inverted dark field image, different focal plane image, or polarization image, the image coordinates are ( , For each pixel, the horizontal and vertical transformation coordinates in the backlight contour map are calculated based on the rotation, horizontal translation, and vertical translation. The formula is:

[0081] ;

[0082] ;

[0083] in, This represents the lateral transformation coordinates in the backlight profile diagram. This represents the vertical transformation coordinates in the backlight profile diagram. Indicates the longitudinal translation amount. Indicates the lateral translation amount, ( , () represents the image coordinates of any pixel in each inverted dark field image, different focal plane image, or polarization image before coordinate transformation.

[0084] When the horizontal or vertical transformation coordinates are non-integer, the image value at the non-integer image coordinate is calculated based on the image values ​​of the four adjacent pixels surrounding the non-integer image coordinate and the distance ratio between the non-integer image coordinate and the four adjacent pixels. This completes the image coordinate transformation from the reverse dark field image, different focal plane images, and polarization images to the backlight contour image. The transformed reverse dark field images, different focal plane images, and polarization images under the same inspection needle component number and the same corner number are associated with the backlight contour image according to image category, forming a multi-perturbation image group.

[0085] S2: After extracting the normal structural edges of the transparent indwelling catheter, metal puncture needle, needle tip bevel, and adhesive transition zone from the multi-perturbation image group, fit the center line of the catheter and the center line of the puncture needle to form a component interface reference map.

[0086] S2.1: It should be noted that the backlight contour map in the multi-perturbation image group is read sequentially according to the corner number. Taking the axis of the indwelling needle assembly under test as the scanning direction, the scanning position is continuously set along the axis of the indwelling needle assembly under test in the backlight contour map. At each scanning position, the gray value of each image position is read in a direction perpendicular to the axis of the indwelling needle assembly under test. The absolute value of the gray value difference between adjacent image positions is calculated. The image position where the absolute value of the gray value difference is greater than the average value of the absolute value of the gray value difference at the same scanning position and is a local maximum is determined as the gray value change position. The gray value change positions are read from both ends of the scanning line toward the center of the axis of the indwelling needle assembly under test. The gray value change position that first appears when the image background enters the transparent indwelling catheter material is marked as the outer contour position of the transparent indwelling catheter. The gray value change position that subsequently appears when the transparent indwelling catheter material enters the inner region of the transparent indwelling catheter is marked. The location is marked as the inner contour of the transparent indwelling catheter. Two gray-scale abrupt change locations distributed around the low gray-scale projection area of ​​the metal puncture needle are marked as the two side contour locations of the metal puncture needle. According to the connection relationship of minimum distance between adjacent scanning positions and consistent gray-scale change direction, the outer contour location of the transparent indwelling catheter, the inner contour location of the transparent indwelling catheter, and the two side contour locations of the metal puncture needle at each scanning position are connected to form the outer contour edge of the transparent indwelling catheter, the inner contour edge of the transparent indwelling catheter, and the two side contour edges of the metal puncture needle. In the area where the two side contour edges of the metal puncture needle gradually approach and terminate towards the front end of the metal puncture needle, the continuous inclined gray-scale abrupt change locations separating the low gray-scale projection area of ​​the metal puncture needle and the inner area of ​​the transparent indwelling catheter are extracted. They are connected sequentially according to the connection relationship of minimum distance between adjacent inclined gray-scale abrupt change locations to form the bevel contour edge of the needle tip. The termination positions towards the tip of the metal puncture needle are read along the outer contour edges of both sides of the transparent indwelling catheter. Between these two termination positions, grayscale abrupt change positions are sequentially read. These grayscale abrupt change positions, which separate the image background from the transparent indwelling catheter material and are continuously connected to the termination positions of the outer contour edges of the transparent indwelling catheter, are connected sequentially according to the minimum distance between adjacent grayscale abrupt change positions and the consistent direction of grayscale change, forming the front contour edge of the transparent indwelling catheter. The contour points of the front contour edge of the transparent indwelling catheter are maintained between the termination positions of the outer contour edges of the transparent indwelling catheter towards the tip of the metal puncture needle, while maintaining the separation between the image background and the transparent indwelling catheter material.

[0087] S2.2: It should be noted that, according to the corner number, the reverse dark field image, different focal plane images, and polarization images obtained after image coordinate transformation at the same corner are read. Contour points are set point by point along the extracted outer contour edge, inner contour edge, front contour edge, both sides of the metal puncture needle, and the beveled edge of the needle tip. The contour extension direction is determined based on the adjacent contour points before and after each contour point. Then, adjacent regions of the same width are set on both sides perpendicular to the contour extension direction. The width of the adjacent region is half the pixel distance between the current contour point and the nearest other contour edge to prevent adjacent regions from crossing another contour edge. The image values ​​of the contour points and the adjacent regions on both sides of the contour points are read from the reverse dark field images acquired from different lighting directions. The same image coordinates are then used to... The brightness change value is obtained by subtracting the minimum image value from the maximum image value under different lighting directions. The sum of the absolute values ​​of the gray-level gradients of the contour point and its adjacent regions at each focal plane position is calculated in different focal plane images. The sum of the absolute values ​​of the gray-level gradients at each focal plane position is compared, and the difference between the sum of the maximum and minimum gray-level gradients is calculated to obtain the response values ​​for different focal planes. The polarization image values ​​at each image position of the contour point and its adjacent regions under parallel and orthogonal polarization states are read. The sum of all polarization image values ​​within the same region is then divided by the number of corresponding image positions to obtain the average image values ​​of the contour point and its adjacent regions under parallel and orthogonal polarization states, respectively.The absolute value of the difference between the average image value under parallel polarization and the average image value under orthogonal polarization is calculated to obtain the polarization response change value. The differences between the brightness change value of the contour point, the response value at different focal planes, and the polarization response change value and the corresponding average values ​​of the adjacent regions on both sides of the contour point are calculated. The differences between the maximum and minimum values ​​of the brightness change value, the response value at different focal planes, and the polarization response change value within the adjacent regions on both sides of the contour point are also calculated to obtain the response fluctuation value within the adjacent regions. Based on the structural positional relationship of the outer contour edge of the transparent indwelling catheter, the inner contour edge of the transparent indwelling catheter, the contour edges on both sides of the metal puncture needle, and the contour edge of the needle tip bevel in the backlight contour image, the connection order of the corresponding contour edges is... The contour points are checked point by point. The contour points of the outer contour of the transparent indwelling catheter are kept between the image background and the transparent indwelling catheter material. The contour points of the inner contour of the transparent indwelling catheter are kept between the transparent indwelling catheter material and the internal area of ​​the transparent indwelling catheter. The contour points of the two sides of the metal puncture needle are kept distributed on both sides of the low grayscale projection area of ​​the metal puncture needle. The contour points of the beveled edge of the needle tip are kept in the area where the two sides of the metal puncture needle gradually approach and terminate towards the front end of the metal puncture needle. Among the contour points that meet the corresponding structural positional relationship, the contour points that are adjacent to each other are retained with a horizontal or vertical interval of no more than one image position, and can be kept according to the minimum distance between adjacent scanning positions and grayscale changes. Contour edges with consistent connection directions, continuous connections to similar contour points before and after, and whose three differences are all greater than the response fluctuation values ​​within the corresponding adjacent regions, and whose three differences maintain the same positive and negative relationship along the contour extension direction; edge portions that deviate from the corresponding structural position relationship, form independent branches, experience local interruptions, or cannot be continuously connected to similar contour points before and after according to the connection relationship of minimum distance between adjacent scanning positions and consistent gray-scale change direction are not retained as corresponding contour edges; continuously read brightness change values, different focal plane response values, and polarization response change values ​​along the axial direction of the indwelling needle assembly under test between the inner contour edge of the transparent indwelling catheter and the contour edges on both sides of the metal puncture needle, and calculate the three differences between adjacent axial image positions. The difference in the change values ​​of the three responses is used to determine the image positions where all three response change values ​​continuously increase or decrease as continuous response change positions. Connecting the start and end positions of the continuous response change positions along the circumference of the transparent indwelling catheter forms the boundary of the adhesion transition zone. The outer contour edge of the transparent indwelling catheter, the inner contour edge of the transparent indwelling catheter, the contour edges on both sides of the metal puncture needle, and the contour edge of the needle tip slope that simultaneously satisfy the corresponding structural positional relationship, continuous connection relationship, and stable response difference are marked as normal structural edges with the boundary of the adhesion transition zone formed according to the continuous response change positions. Edges that only satisfy the stable response difference but do not satisfy the corresponding structural positional relationship or continuous connection relationship are not marked as normal structural edges.

[0088] Furthermore, if the three response change values ​​do not show a continuous increase or decrease, for example, if any response change value changes from increasing to decreasing or from decreasing to increasing between adjacent image positions, or if the directions of change of the three response change values ​​are inconsistent, then the corresponding image position is not determined to be a continuous response change position and will not participate in the connection of the subsequent bonding transition zone boundary; only when the three response change values ​​maintain the same increasing direction or the same decreasing direction when continuously read along adjacent image positions, will the corresponding image position be determined to be a continuous response change position.

[0089] S2.3: It should be noted that the normal structural edges that have been checked point by point are read sequentially according to the corner number. The upper left corner of the backlight contour image under each corner is used as the origin of the unified image coordinate system. The horizontal direction of the backlight contour image is used as the horizontal coordinate direction, and the vertical direction of the backlight contour image is used as the vertical coordinate direction. Axial sampling positions are set sequentially along the axis of the transparent indwelling catheter at intervals of one image pixel. At each axial sampling position, a line perpendicular to the axis of the transparent indwelling catheter is drawn. The two intersection points of the line and the normal structural edges on both sides of the transparent indwelling catheter are determined. The average horizontal coordinate of the two intersection points is used as the horizontal coordinate of the midpoint of the transparent indwelling catheter. Using the average coordinate as the longitudinal coordinate of the midpoint of the transparent indwelling catheter, all midpoints of the transparent indwelling catheters are arranged in axial sampling order. The arrangement of the midpoints is then used as the corresponding fitting position. A cubic polynomial is established between every two adjacent midpoints of the transparent indwelling catheters, showing the changes in both lateral and longitudinal coordinates with the fitting position. Each cubic polynomial passes through the corresponding two adjacent midpoints of the transparent indwelling catheters, ensuring that the lateral, longitudinal, first-order, and second-order changes of adjacent cubic polynomials at the common midpoint are continuous. The arrangement of the first and last ends is then performed. The second-order variation of the cubic polynomial should be set to zero. Simultaneously establish the coordinate continuity conditions, first-order variation continuity conditions, and second-order variation continuity conditions corresponding to the midpoints of each transparent indwelling catheter. Calculate the coefficients of the cubic polynomial between the midpoints of adjacent transparent indwelling catheters. Connect each segment of the cubic polynomial sequentially according to the axial sampling position order to form the catheter centerline. Set axial sampling positions sequentially along the axis of the metal puncture needle at one image pixel intervals. At each axial sampling position, draw a line perpendicular to the axis of the metal puncture needle. Determine the two intersection points of the line with the two normal structural edges on both sides of the metal puncture needle. Use the average of the lateral coordinates of the two intersection points as the lateral coordinates of the midpoint of the metal puncture needle. The average longitudinal coordinate of each intersection point is used as the longitudinal coordinate of the midpoint of the metal puncture needle. All midpoints of the metal puncture needles are arranged in the order of axial sampling positions, and the midpoints of adjacent metal puncture needles are continuously fitted using a cubic spline curve (same as the fitting method above) to form the center line of the puncture needle. According to the corner number, the lateral and longitudinal coordinates of each image position in the outer contour edge of the transparent indwelling catheter, the inner contour edge of the transparent indwelling catheter, the normal structure edge of the front end of the transparent indwelling catheter, the contour edges of both sides of the metal puncture needle, the contour edge of the needle tip bevel, the boundary of the bonding transition zone, the center line of the catheter, and the center line of the puncture needle are written into the unified image coordinates under the corresponding corner number to form the component interface reference map.

[0090] S3: Establish axial-circumferential material coordinates and map the multi-perturbation image group into a material coordinate map.

[0091] S3.1: It should be noted that, according to the corner number, the catheter centerline and the normal structural edge of the transparent indwelling catheter tip are read from the reference image of the component interface. The intersection image position of the catheter centerline and the normal structural edge of the transparent indwelling catheter tip is found in the unified image coordinates. The intersection image position is marked as the axial starting point, and the axial coordinate of the axial starting point is set to zero. Starting from the axial starting point, the image positions on the catheter centerline are read sequentially along the catheter centerline in the direction away from the normal structural edge of the transparent indwelling catheter tip. The horizontal coordinate difference and vertical coordinate difference between adjacent image positions are calculated. The square root of the square of the horizontal coordinate difference and the vertical coordinate difference is then taken to obtain the distance between adjacent image positions. Starting from the previous axial position, the distance between adjacent image positions is continuously accumulated. When the accumulated distance first reaches one image pixel, the corresponding catheter centerline image position is set as the next axial position, and the distance between adjacent image positions is accumulated again from the next axial position until the end of the catheter centerline. According to the order of the axial positions, the distances of all adjacent axial positions from the axial starting point to the Kth axial position are summed to obtain the axial coordinate of the Kth axial position.

[0092] S3.2: It should be noted that, according to the corner number, the component interface reference diagram of the indwelling needle assembly under inspection is read sequentially at each corner. Taking the current corner corresponding to the starting corner as zero degree, according to the arrangement order of the corner numbers, the number of times the preset equal angle interval is accumulated is counted starting from the starting corner. The accumulated number is multiplied by the preset equal angle interval to obtain the current corner number. The axial position is read sequentially along the catheter centerline. A perpendicular line is drawn from the current axial position to the extension direction of the catheter centerline. The intersection of the perpendicular line with the catheter centerline and the intersection of the perpendicular line with the outer contour edges of the left and right sides of the transparent indwelling catheter are determined. The distance from the intersection point of the catheter centerline to the intersection point of the outer contour edges on the left and right sides is calculated respectively. The position of the image to be mapped relative to the catheter centerline is determined to be on the left or right side of the catheter centerline. For the image position to be mapped located on the right side of the catheter centerline, the distance from the intersection point of the catheter centerline to the image position is calculated. The circumferential coordinate of the corresponding image position is calculated based on the distance from the intersection point of the catheter centerline to the image position. The formula is:

[0093] );

[0094] in, The circumferential coordinates representing the position of the image to be mapped. Indicates the current turning angle. This indicates the distance from the intersection of the catheter centerlines to the intersection of the right outer contour edge. This represents the distance from the intersection of the catheter centerlines to the location of the image to be mapped.

[0095] For the image position to be mapped located to the left of the catheter centerline, calculate the distance from the intersection of the catheter centerlines to the image position. Based on the distance from the intersection of the catheter centerlines to the image position and the distance from the intersection of the catheter centerlines to the intersection of the left outer contour edge, calculate the circumferential coordinates of the corresponding image position. The formula is:

[0096] );

[0097] in, This represents the circumferential coordinates of the position in the image to be mapped. Indicates the current turning angle. This indicates the distance from the intersection of the catheter centerlines to the intersection of the left outer contour edge. This represents the distance from the intersection of the catheter centerlines to the location of the image to be mapped.

[0098] The position of the image to be mapped on the center line of the conduit corresponds to the rotation angle after the current rotation angle is increased by 90°; when the circumferential coordinate reaches or exceeds 360°, subtract 360°, and record the combination of the axial coordinate and circumferential coordinate corresponding to each position of the image to be mapped to establish the axial-circumferential material coordinate system.

[0099] Furthermore, the circumferential coordinates of each image position to be mapped are recorded based on the circumferential position of the material of the indwelling needle assembly to be inspected. The circumferential coordinates of the same material position remain unchanged when the current angle changes. For a material position whose circumferential coordinates have been determined, at any subsequent angle, the difference between the circumferential coordinates of the material position and the subsequent angle is calculated. When the difference is less than 0°, it is increased by 360° to obtain the circumferential position of the material position relative to the subsequent angle. When the circumferential position of the material position relative to the subsequent angle is within the range of 0° to 180°, the material position is determined to be the material position that can be mapped to the current subsequent angle image. When it exceeds 180°, the next angle is read.

[0100] S3.3: It should be noted that perpendicular lines perpendicular to the extension direction of the catheter centerline are drawn at each axial position along the catheter centerline. The intersection points of the perpendicular lines with the left side of the transparent indwelling catheter normal structure and the right side of the transparent indwelling catheter normal structure are determined. The corresponding positions are set sequentially between the two intersection points at intervals of one image pixel. Based on the horizontal and vertical coordinates of each corresponding position in the unified image coordinate system, the backlight contour image value, the reverse dark field image value corresponding to each illumination direction, the different focal plane image values ​​corresponding to each focal plane position, and the polarization image values ​​corresponding to parallel polarization and orthogonal polarization states are read from the multi-perturbation image group under the same rotation angle at the same image coordinates. The backlight contour image value, reverse dark field image value, different focal plane image value, and polarization image value are associated and recorded with the axial coordinates, circumferential coordinates, and image coordinates of the corresponding positions.

[0101] Using axial coordinates as the axial arrangement position of the material coordinate diagram and circumferential coordinates as the circumferential arrangement position, backlight contour image values ​​with the same axial and circumferential coordinates, reverse dark field image values ​​corresponding to different illumination directions, different focal plane image values ​​corresponding to different focal plane positions, and polarization image values ​​corresponding to different polarization states are written into the same image position in the material coordinate diagram. All corners are compared according to their corner numbers, and image positions with the same axial and circumferential coordinates in different corners are determined as coincident image positions. The sum of all backlight contour image values ​​corresponding to the coincident image positions is then divided by the number of backlight contour image values ​​to obtain the average backlight contour image value. Similarly, the sum of all reverse dark field image values ​​corresponding to the same illumination direction in the coincident image positions is divided by the number of reverse dark field image values ​​corresponding to the same illumination direction to obtain the average reverse dark field image value. Finally, the sum of all reverse dark field image values ​​corresponding to the same focal plane position in the coincident image positions is then divided by the number of reverse dark field image values ​​corresponding to the same illumination direction to obtain the average reverse dark field image value. The summation of image values ​​at different focal planes is divided by the number of image values ​​at the same focal plane position to obtain the average image value at different focal planes. The summation of all polarization image values ​​corresponding to the same polarization state at the overlapping image positions is then divided by the number of polarization image values ​​corresponding to the same polarization state to obtain the average polarization image value. The average backlight profile image value is used to replace the backlight profile image value at the overlapping image positions. The average reverse dark field image value is used to replace the reverse dark field image value corresponding to the same illumination direction at the overlapping image positions. The average image values ​​at different focal planes are used to replace the different focal plane image values ​​corresponding to the same focal plane position at the overlapping image positions. The average polarization image value is used to replace the polarization image value corresponding to the same polarization state at the overlapping image positions. Only the image positions corresponding to a single corner retain the original backlight profile image value, reverse dark field image value, image values ​​at different focal planes, and polarization image value. All image positions are arranged according to axial and circumferential coordinates to form a material coordinate diagram.

[0102] S4: Extract candidate anomalous edges that deviate from the normal structure edges from the material coordinate diagram, and identify the associated interfaces based on the responses of the candidate anomalous edges in the reverse dark field diagram, different focal plane diagrams and polarization diagrams, thus forming interface-assigned anomalous edges.

[0103] S4.1: It should be noted that, according to the axial-circumferential material coordinates, the axial and circumferential coordinates corresponding to the image positions of each normal structural edge in the component interface reference diagram are read, and the image positions with the same axial and circumferential coordinates are marked in the material coordinate diagram to complete the correspondence between the normal structural edge and the material coordinate diagram; for the backlight contour image value in the material coordinate diagram, the difference between the backlight contour image value of the next axially adjacent image position after the current image position and the backlight contour image value of the previous axially adjacent image position is calculated to obtain the axial grayscale difference, and the difference between the backlight contour image value of the next circumferentially adjacent image position after the current image position and the backlight contour image value of the previous circumferentially adjacent image position is calculated to obtain the circumferential grayscale difference. Among them, the previous circumferentially adjacent image position with a circumferential coordinate of 0° corresponds to the image position after subtracting the circumferential coordinate interval by 360°, and the maximum circumferential coordinate... The image position corresponding to 0° in the circumferential adjacent image position is determined. The gray-level gradient of the current image position is obtained by summing the squares of the axial gray-level differences and the squares of the circumferential gray-level differences. The gray-level gradient of the current image position is compared with the gray-level gradients of the axial and circumferential adjacent image positions. The image position whose gray-level gradient is not less than the gray-level gradients of all adjacent image positions is determined as the local maximum position of the gray-level gradient. The local maximum positions of the gray-level gradient are read sequentially according to the axial and circumferential coordinates. Local maximum positions of the gray-level gradient that differ by one axial position in axial coordinate and not more than one circumferential position in circumferential coordinate are connected. Local maximum positions of the gray-level gradient that differ by one circumferential position in circumferential coordinate and not more than one axial position in axial coordinate are connected until there are no unconnected local maximum positions of the gray-level gradient in the adjacent range, forming a continuous edge line.

[0104] S4.2: It should be noted that the image positions in the continuous edge lines formed by the backlight contour image values ​​are read line by line according to the axial and circumferential coordinates, and the coordinates of each image position in the continuous edge line are compared with the image positions in the normal structure edge. When the image positions in the continuous edge line and the image positions in the normal structure edge have the same axial and circumferential coordinates, the corresponding image positions are determined as coincident positions. For adjacent image positions in the continuous edge line, the difference between the axial coordinate of the later image position and the axial coordinate of the earlier image position is calculated to obtain the change in the axial coordinate of the continuous edge line. The difference between the circumferential coordinate of the later image position and the circumferential coordinate of the earlier image position is calculated to obtain the initial change in the circumferential coordinate of the continuous edge line. When the initial change in the circumferential coordinate of the continuous edge line is greater than 180°, 360° is subtracted; when the initial change in the circumferential coordinate of the continuous edge line is less than -180°, ... Add 360° to obtain the circumferential coordinate change of the continuous edge line; using the same calculation method, calculate the axial coordinate change and circumferential coordinate change of the normal structural edge at the corresponding image positions before and after it; when the axial coordinate change of the continuous edge line is in the same positive and negative direction as the axial coordinate change of the normal structural edge, and the circumferential coordinate change of the continuous edge line is in the same positive and negative direction as the circumferential coordinate change of the normal structural edge, the extension direction of the corresponding image position is determined to be consistent; continuous edge lines whose image positions all coincide with normal structural edges and whose extension directions at each coincident position are consistent are considered normal structural edges; continuous edge lines whose image positions do not coincide with normal structural edges are considered candidate abnormal edges, and continuous edge lines whose image positions partially coincide with normal structural edges but whose axial or circumferential coordinates deviate from the corresponding image positions of normal structural edges are considered candidate abnormal edges.

[0105] S4.3: It should be noted that the normal structural edge image positions belonging to the transparent indwelling catheter, metal puncture needle, needle tip bevel, and adhesive transition zone are collected according to axial and circumferential coordinates respectively. The previous and next normal structural edge image positions are read sequentially along the arrangement of each normal structural edge image position. The extension direction of the normal structural edge is determined based on the direction from the previous normal structural edge image position to the next normal structural edge image position, and the vertical direction of the normal structural edge is determined by rotating the extension direction of the normal structural edge by 90°. In the reverse dark field images corresponding to different illumination directions, the reverse dark field image values ​​are read respectively from one image pixel away from the current normal structural edge image position and located in the positive and negative directions of the vertical direction of the normal structural edge. The absolute value of the difference between the two reverse dark field image values ​​is calculated, and the sum of the absolute values ​​of the differences corresponding to different illumination directions is then divided by the number of illumination directions. The calculation yields the inverse dark field response value at the current normal structure edge image position. Using the current normal structure edge image position as the center, the range of each adjacent image position in both axial and circumferential coordinates is defined as the normal structure edge neighborhood. The differences in focal plane image values ​​between adjacent axial and circumferential image positions within the normal structure edge neighborhood are calculated in different focal plane images. The absolute values ​​of all differences in focal plane image values ​​at the same focal plane position are summed to obtain the sum of the absolute values ​​of the grayscale gradients at the corresponding focal plane position. The sum of the absolute values ​​of the grayscale gradients at each focal plane position is compared, and the difference between the sum of the maximum and minimum absolute values ​​of the grayscale gradients is calculated to obtain the different focal plane response values ​​at the current normal structure edge image position. The polarization image values ​​at the current normal structural edge image position are read from the polarization image under parallel polarization and the polarization image under orthogonal polarization. The absolute value of the difference between the two polarization image values ​​is calculated to obtain the polarization response value at the current normal structural edge image position. The reverse dark field response values ​​of all normal structural edge image positions in the transparent indwelling catheter, the metal puncture needle, the needle tip bevel, and the adhesive transition zone are summed and then divided by the number of normal structural edge image positions to obtain the average reverse dark field response. The response values ​​of different focal planes of all normal structural edge image positions are summed and then divided by the number of normal structural edge image positions to obtain the average response of different focal planes. Finally, the polarization response values ​​of all normal structural edge image positions are summed and then divided by the number of normal structural edge image positions to obtain the average polarization response.

[0106] S4.4: It should be noted that the image positions of the candidate abnormal edges are read one by one according to the axial and circumferential coordinates of the candidate abnormal edges; according to the calculation method of the reverse dark field response value, different focal plane response value and polarization response value of the image position of the normal structure edge, the reverse dark field response value, different focal plane response value and polarization response value of each image position of the candidate abnormal edge are calculated respectively. The sum of each response value of all image positions of the same candidate abnormal edge is then divided with the number of image positions of the candidate abnormal edge to obtain the average reverse dark field response value, the average focal plane response value and the average polarization response value of the candidate abnormal edge. For each of the following responses—reverse dark field response, different focal plane responses, and polarization response—the absolute difference between the average response value corresponding to the candidate anomalous edge and the average response value corresponding to the normal structural edge of the transparent indwelling catheter, metal puncture needle, needle tip bevel, and adhesive transition zone is calculated to obtain the four initial response differences under the corresponding response. The four initial response differences under the same response are compared, and the initial response difference with the largest value is determined as the normalization base of the corresponding response. The four initial response differences are then divided by the normalization base to obtain the four normalized response differences under the corresponding response. When the normalization base is zero, all four normalized response differences under the corresponding response are set to zero. Zero; For the reverse dark field response, different focal plane responses, and polarization responses, calculate the absolute values ​​of the pairwise differences between the average values ​​of the responses of the transparent indwelling catheter, the metal puncture needle, the beveled tip, and the adhesive transition zone corresponding to the normal structural edge, and sum all the absolute values ​​of the pairwise differences to obtain the reverse dark field response differentiation quantity, the different focal plane response differentiation quantity, and the polarization response differentiation quantity; quotient each response differentiation quantity with the sum of the three response differentiation quantities to obtain the reverse dark field response weight, the different focal plane response weight, and the polarization response weight; when the sum of the three response differentiation quantities is zero, set the reverse dark field response weight, the different focal plane response weight, and the polarization response weight to one-third respectively.For transparent indwelling catheters, metal puncture needles, needle tip bevels, and adhesive transition zones, the reverse dark field normalized response difference is multiplied by its weight, the normalized response difference for different focal planes is multiplied by its weight, and the polarization normalized response difference is multiplied by its weight. These three products are then summed to obtain the comprehensive response differences for transparent indwelling catheters, metal puncture needles, needle tip bevels, and adhesive transition zones. The four comprehensive response differences are compared, and the transparent indwelling catheter, metal puncture needle, needle tip bevel, or adhesive transition zone corresponding to the smallest comprehensive response difference is identified as the interface to which the candidate abnormal edge belongs. When there are two or more comprehensive response differences with the same value and both being the minimum, the normalized response differences of the corresponding interfaces are compared sequentially according to the response weights from largest to smallest. If the response weights are the same, the comparison is based on the reverse dark field response, the response for different focal planes, and the polarization response weight. The response order is compared, and the interface with the smallest normalized response difference is identified as the interface to which the candidate anomaly edge belongs. If all normalized response differences are still the same, the image positions of the candidate anomaly edge and the normal structural edges corresponding to each interface with the same value are mapped to a unified image coordinate system based on the image position correspondence between the material coordinate diagram and the component interface reference diagram. The distance between each image position of the candidate anomaly edge and the image position of the corresponding normal structural edge of each interface is calculated. The minimum distance from each image position of the candidate anomaly edge to the normal structural edge of the same interface is selected. The sum of all minimum distances is then divided by the number of image positions of the candidate anomaly edge. The calculation results of the candidate anomaly edge relative to each interface are compared, and the interface to which the normal structural edge with the smallest value belongs is identified as the interface to which the candidate anomaly edge belongs. The interface to which the candidate anomaly edge belongs is written into all image positions of the candidate anomaly edge, forming the interface belonging anomaly edge.

[0107] S5: Remove the lighting interference edges based on the positional consistency and gradient reversal of the interface-assigned abnormal edges. Expand the projection range of the puncture needle in the backlight contour map at each corner to form a puncture needle occlusion zone. Remove the projection interference edges based on the reproduction state of the remaining interface-assigned abnormal edges outside the puncture needle occlusion zone to form material abnormal edges.

[0108] S5.1: It should be noted that, according to the component number and corner number of the indwelling needle to be inspected, the lateral and longitudinal coordinates of each registration point after transformation to the backlight profile image are read from the reverse dark field image, different focal plane images, and polarization images, respectively. The lateral and longitudinal coordinates of the corresponding registration points in the backlight profile image are also read. The difference between the lateral coordinates of each registration point after transformation to the backlight profile image and the lateral coordinates of the corresponding registration points in the backlight profile image is obtained. The difference between the longitudinal coordinates of each registration point after transformation to the backlight profile image and the longitudinal coordinates of the corresponding registration points in the backlight profile image is obtained. The square root of the sum of the squares of the lateral and longitudinal position differences is obtained to obtain the position difference of each registration point. The position differences of the corresponding registration points in the reverse dark field image, different focal plane images, and polarization images under all corners are compared, and the position difference with the largest value is determined as the allowable position difference value.

[0109] S5.2: It should be noted that, according to the axial-circumferential material coordinates, the interface-assigned anomalous edges are read one by one. The edge positions corresponding to the interface-assigned anomalous edges are found in the reverse dark field maps under different lighting directions. The axial coordinate difference and the initial circumferential coordinate difference between the corresponding edge positions under different lighting directions are calculated respectively. The absolute value of the initial circumferential coordinate difference is compared with 180°. When the absolute value of the initial circumferential coordinate difference is not greater than 180°, the absolute value of the initial circumferential coordinate difference is used as the circumferential coordinate difference. When the absolute value of the initial circumferential coordinate difference is greater than 180°, 360° is subtracted from the absolute value of the initial circumferential coordinate difference. The difference is calculated and used as the circumferential coordinate difference. The number of pixels corresponding to the outer diameter of the transparent indwelling conduit is extracted. The number of pixels corresponding to the outer diameter of the transparent indwelling conduit is multiplied by pi and the circumferential coordinate difference in turn, and then the quotient is calculated with 360° to obtain the circumferential position difference. The gray-scale gradient direction of the corresponding edge position under different lighting directions is calculated. Interface aberration edges whose axial coordinate difference and circumferential position difference are not greater than the allowable position difference and whose gray-scale gradient directions are opposite under different lighting directions are retained. Interface aberration edges whose axial coordinate difference or circumferential position difference is greater than the allowable position difference and whose gray-scale gradient direction has not changed in the opposite direction are removed as lighting interference edges.

[0110] Read the extracted metal puncture needle contour edges from the backlight contour image at each corner according to the corner number. Arrange the image positions on both sides of the metal puncture needle contour edges in ascending order of axial coordinates, and connect adjacent image positions on the same side. Connect the endpoints of the metal puncture needle contour edges at the front end of the axial direction and the endpoints of the metal puncture needle contour edges at the rear end of the axial direction to form a closed boundary. Determine all image positions inside and on the closed boundary as the puncture needle projection range. For each image position outside the puncture needle projection range, calculate the horizontal and vertical coordinate differences between the image position and each image position on the closed boundary. Add the squares of the horizontal and vertical coordinate differences and take the square root. Select the minimum calculated result as the shortest distance from the image position to the puncture needle projection range. Incorporate the external image positions whose shortest distance is not greater than the allowable position difference into the puncture needle projection range. Complete the outer expansion of the puncture needle projection range at each corner in the same way. Determine the expanded puncture needle projection range as the puncture needle occlusion zone.

[0111] Read the remaining interface aberration edges one by one, and filter out the remaining interface aberration edges whose aberration edges are metal puncture needles and needle tip bevels. Retain the axial coordinates, circumferential coordinates, aberration edges, and connection relationships between each image position of the corresponding remaining interface aberration edges. Remaining interface aberration edges whose aberration edges are transparent indwelling catheters or adhesive transition areas are not retained in the current step, and the process proceeds to the judgment process of the reproduction status inside and outside the puncture needle obscuring zone.

[0112] S5.3: It should be noted that, according to the corner number, the remaining interface aberration edges belonging to the transparent indwelling catheter or adhesive transition zone are read sequentially. Based on the correspondence between the axial-circumferential material coordinates and the image positions in the backlight contour diagram at each corner, the image positions in the remaining interface aberration edges are mapped to the backlight contour diagram at the same corner. It is determined whether the corresponding image position is located inside or on the boundary of the puncture needle shielding zone. Image positions located inside or on the boundary of the puncture needle shielding zone are marked as shielded image positions, and image positions located outside the puncture needle shielding zone are marked as unshielded image positions. From the shielded image position... Starting from the corresponding turning angle, read subsequent turning angles sequentially at preset equal angle intervals. Calculate the difference between the circumferential coordinates of the occluded image position and the subsequent turning angle. If the difference is less than 0°, increase by 360°. If the calculation result is greater than 180°, continue reading the next turning angle. When the calculation result is within the range of 0° to 180°, draw a perpendicular line to the extension direction of the catheter centerline at an axial position with the same axial coordinates as the occluded image position. Determine the intersection of the perpendicular line with the catheter centerline and the intersection of the perpendicular line with the outer contours of the left and right sides of the transparent indwelling catheter. When the calculation result is within the range of 0° to 90°, [the following steps are taken]. The distance from the intersection of the duct centerlines to the intersection of the right outer contour edge is multiplied by the cosine value of the calculated result to obtain the distance from the intersection of the duct centerlines to the corresponding image position, and the corresponding image position is determined to the right of the duct centerline. When the calculated result is greater than 90° but not greater than 180°, the distance from the intersection of the duct centerlines to the intersection of the left outer contour edge is multiplied by the absolute value of the cosine value of the calculated result to obtain the distance from the intersection of the duct centerlines to the corresponding image position, and the corresponding image position is determined to the left of the duct centerline. At the determined corresponding image position, the remaining interface belonging to the abnormal edge is searched, and the subsequent edges are read sequentially according to the preset equal angle intervals. Corner; when the corresponding image position of the remaining interface belonging to the abnormal edge is found for the first time outside the puncture needle occlusion zone, the image position of the remaining interface belonging to the abnormal edge is determined as the corresponding edge position after the remaining interface belonging to the abnormal edge leaves the puncture needle occlusion zone; when no corresponding image position of the remaining interface belonging to the abnormal edge is found outside the puncture needle occlusion zone after traversing all subsequent corners, the corresponding edge position after the remaining interface belonging to the abnormal edge leaves the puncture needle occlusion zone is not formed, and the remaining interface belonging to the abnormal edge that only has an image position inside the puncture needle occlusion zone is determined as a projection interference edge and removed.

[0113] For cases where the interface is a transparent indwelling catheter or adhesive transition zone and a residual interface aberration edge has formed after detaching from the puncture needle shielding band, the corresponding edge position after detachment is read. Then, the corresponding image position of the residual interface aberration edge is located at subsequent corners outside the puncture needle shielding band using both axial and circumferential coordinates. The found image positions of the residual interface aberration edge and its corresponding edge position after detachment from the puncture needle shielding band are converted to image coordinates in a backlit contour map, and the relationship between the two image positions is calculated. The difference between the horizontal and vertical coordinates is calculated by summing the squares of the horizontal and vertical coordinate differences and taking the square root to obtain the edge position difference. If the edge position difference is not greater than the allowable position difference, the remaining interface anomalous edge is determined to reappear after leaving the puncture needle occlusion zone and is retained. After traversing all corners, if there is an image position within the puncture needle occlusion zone and no corresponding image position outside the puncture needle occlusion zone with an edge position difference not greater than the allowable position difference, the remaining interface anomalous edge is determined as a projection interference edge and removed. The remaining interface anomalous edges retained due to the interface being a metal puncture needle or needle tip slope are combined with the remaining interface anomalous edges retained after reappearing after leaving the puncture needle occlusion zone and are used as material anomalous edges.

[0114] S6: Write the material anomaly edge into the component interface baseline map to construct the defect penetration topology, parse the defect penetration topology, and obtain the detection results of the indwelling needle component to be inspected.

[0115] S6.1: It should be noted that, according to the axial-circumferential material coordinates, the axial and circumferential coordinates of each image position in the material anomaly edge are read one by one, and the belonging interface of each material anomaly edge record is read. An association record is established between the axial coordinates, circumferential coordinates, and belonging interface of the material anomaly edge and the corresponding normal structure edge in the component interface reference diagram. Subsequent position comparisons between material anomaly edges are all performed in the axial-circumferential material coordinates. Any two material anomaly edges are compared sequentially. If any two material anomaly edges have the same axial coordinates and the same circumferential coordinates, or if the connecting line segment between adjacent material coordinate positions of any two material anomaly edges intersects in the axial-circumferential material coordinates, then any two material anomaly edges are determined to be intersecting. Connect at the intersection point; for material anomaly edges that do not intersect, read the axial and circumferential coordinates of the beginning and end of any two material anomaly edges respectively, calculate the axial coordinate difference and minimum circumferential coordinate difference between different combinations of endpoints in turn, and convert the minimum circumferential coordinate difference into a circumferential position difference according to the number of pixels corresponding to the outer diameter of the transparent indwelling conduit; calculate the distance between endpoints according to the axial coordinate difference and circumferential position difference, select the distance between endpoints with the smallest value for comparison, and connect the corresponding endpoints when the distance between endpoints is not greater than the allowable position difference; repeat the comparison and connection until there are no material anomaly edges that intersect or whose distance between endpoints is not greater than the allowable position difference and have not yet been connected, and determine the material anomaly edges after sequential connection as continuous material anomaly edges.

[0116] S6.2: It should be noted that the image positions of continuous material anomaly edges are read one by one according to the axial and circumferential coordinates, and compared with the positions of the normal structural edges of the transparent indwelling catheter, metal puncture needle, needle tip bevel, and adhesive transition zone, respectively. When the continuous material anomaly edge and the normal structural edge have the same image position, or when the connecting line segment between adjacent image positions of the continuous material anomaly edge intersects with the connecting line segment between adjacent image positions of the normal structural edge, the intersection relationship between the continuous material anomaly edge and the corresponding normal structural edge is recorded; the extension direction of the adjacent image positions before and after the normal structural edge at the intersection position is used as the reference. Using the direction as a reference, determine whether the image position of the continuous material anomaly edge before and after the intersection is clockwise or counterclockwise relative to the extension direction of the normal structural edge. When the image positions of the continuous material anomaly edge before and after the intersection are on opposite sides of the normal structural edge, read the belonging interface recorded for the material anomaly edge before and after the intersection, and calculate the distance between the endpoints of the end of the first material anomaly edge and the beginning of the second material anomaly edge. If the belonging interfaces recorded for the first and second material anomaly edges are different, and the distance between the endpoints is not greater than the allowable position difference, record the continuous material anomaly edge. The effective cross-boundary relationship of a material anomaly edge crossing a corresponding normal structure edge; when the belonging interface recorded for the preceding and following material anomaly edges is the same, or when the distance between the endpoints is greater than the allowable position difference, only the intersection relationship between the continuous material anomaly edge and the normal structure edge is recorded, and the effective cross-boundary relationship is not recorded; the distance between the endpoints of the continuous material anomaly edge and each image position of the normal structure edge is calculated, and when the minimum distance is not greater than the allowable position difference and there is no image position after the endpoint of the continuous material anomaly edge, the termination relationship of the continuous material anomaly edge terminating at the corresponding normal structure edge is recorded; the continuous material anomaly edge is calculated. The distance between the first and last ends of the abnormal material edge is recorded. When the distance between the first and last ends is not greater than the allowable position difference and the first and last ends have been connected to form a closed boundary, the closure relationship of the continuous abnormal material edge is recorded. The intersection, crossing, termination and closure relationships between the continuous abnormal material edge and the normal structural edges of the transparent indwelling catheter, metal puncture needle, needle tip bevel and bonding transition zone are written into the component interface reference diagram. The intersection position, termination position and closure position are used as the connection position. The penetration path is recorded according to the connection order between the continuous abnormal material edge and each connection position to construct the defect penetration topology.

[0117] S6.3: It should be noted that the closure relationship of continuous material anomaly edges should be read one by one according to the defect penetration topology. When the beginning and end of a continuous material anomaly edge are not connected and the continuous material anomaly edge does not form a closed boundary, the basic morphological type of the continuous material anomaly edge is marked as linear. When the beginning and end of a continuous material anomaly edge are connected and form a closed boundary, the interior of the closed boundary is determined as a closed region, and the basic morphological type of the continuous material anomaly edge is marked as planar. The effective cross-boundary relationship should be read according to the connection order of each material anomaly edge in the continuous material anomaly edge. When there is no effective cross-boundary relationship for a continuous material anomaly edge, the cross-boundary state of the continuous material anomaly edge is marked as non-cross-boundary. When there is at least one effective cross-boundary relationship for a continuous material anomaly edge, the cross-boundary state of the continuous material anomaly edge is marked as cross-boundary, and the corresponding belonging interface of the material anomaly edges on both sides of the effective cross-boundary relationship and the transparent indwelling catheter, metal puncture needle, needle tip bevel or adhesive transition area corresponding to the crossed normal structural edge are recorded.

[0118] When the basic morphology type is linear and the boundary state is non-boundary, the continuous material anomaly edge is identified as a linear defect; when the basic morphology type is planar and the boundary state is non-boundary, the continuous material anomaly edge is identified as a planar defect; when the basic morphology type is linear and the boundary state is boundary, the continuous material anomaly edge is identified as a linear boundary defect; when the basic morphology type is planar and the boundary state is boundary, the continuous material anomaly edge is identified as a planar boundary defect.

[0119] The deduplication of the assigned interfaces for all image locations of continuous material anomalies is performed to form a set of defect-related interfaces. When one assigned interface is recorded in the set of defect-related interfaces, the corresponding transparent indwelling catheter, metal puncture needle, needle tip bevel, or adhesive transition area is identified as the defect-related interface. When more than two assigned interfaces are recorded in the set of defect-related interfaces, the transparent indwelling catheter, metal puncture needle, needle tip bevel, or adhesive transition area corresponding to each assigned interface is jointly identified as the defect-related interface.

[0120] Read the axial and circumferential coordinates of all material coordinate positions along the continuous material anomaly edge. Determine the axial position of the defect as the range between the minimum and maximum axial coordinates. Arrange the circumferential coordinates in ascending order of value, and calculate the interval between adjacent circumferential coordinates and the interval between the maximum circumferential coordinate spanning 360° and the minimum circumferential coordinate. Remove the interval with the largest circumferential coordinate value, and determine the circumferential position of the defect as the remaining circumferential coordinate coverage area. Subtract the maximum and minimum axial coordinates to obtain the axial span. Subtract the 360° interval from the maximum circumferential coordinate interval to obtain the circumferential angular span. Convert the circumferential angular span to the pixel count corresponding to the outer diameter of the transparent indwelling conduit. Circumferential span; For continuous material anomaly edges forming closed regions, read the axial and circumferential coordinates of each material coordinate position according to the connection order of the closed boundary. Convert each circumferential coordinate into a circumferential position based on the number of pixels corresponding to the outer diameter of the transparent indwelling catheter. Calculate the pixel area of ​​the closed region based on the axial and circumferential coordinates of adjacent material coordinate positions. Use the axial span and circumferential span as the defect size of linear defects and linear cross-boundary defects, and use the axial span, circumferential span, and pixel area of ​​the closed region as the defect size of planar defects and planar cross-boundary defects. Collect the defect type, defect-involved interface, defect axial position, defect circumferential position, and defect size to obtain the detection results of the indwelling needle assembly to be inspected.

[0121] This embodiment also provides a computer device applicable to the machine vision-based defect detection method for indwelling needle components, comprising: a memory and a processor; the memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions to implement the machine vision-based defect detection method for indwelling needle components as proposed in the above embodiment.

[0122] The computer device can be a terminal, comprising a processor, memory, communication interface, display screen, and input devices connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, carrier networks, NFC (Near Field Communication), or other technologies. The display screen can be an LCD screen or an e-ink screen. The input devices can be a touch layer covering the display screen, buttons, a trackball, or a touchpad on the computer device's casing, or an external keyboard, touchpad, or mouse.

[0123] This embodiment also provides a storage medium storing a computer program that, when executed by a processor, implements the machine vision-based defect detection method for indwelling needle components as proposed in the above embodiments. The storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as Static Random Access Memory (SRAM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Erasable Programmable Read Only Memory (EPROM), Programmable Red-Only Memory (PROM), Read-Only Memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.

[0124] In summary, this invention establishes a personalized component interface baseline map, which to some extent eliminates misjudgments caused by individual product differences. Through a unique material coordinate mapping mechanism, it achieves the localization of surface defects on rotating cylinders and cross-angle feature correlation. Furthermore, by utilizing gradient reverse verification and reproducibility logic of the puncture needle occlusion band, it eliminates illumination artifacts and projection interference. These series of technical means work together to reduce the false alarm rate and false negative rate in the indwelling needle component testing process, and realize the identification and quantitative analysis of linear defects, planar defects, linear cross-boundary defects, and planar cross-boundary defects, thereby effectively improving the quality control level and reliability of automated testing in medical device production.

[0125] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.

Claims

1. A method for detecting defects in indwelling needle components based on machine vision, characterized in that: include, The backlight contour image, reverse dark field image, different focal plane images and polarization image of the indwelling needle assembly under test at each corner are collected and registered to form a multi-perturbation image group. After extracting the normal structural edges of the transparent indwelling catheter, metal puncture needle, needle tip bevel and bonding transition zone from the multi-perturbation image group, the catheter centerline and puncture needle centerline are fitted to form a component interface reference map. Establish axial-circumferential material coordinates and map the multi-perturbation image group into a material coordinate map; Candidate anomalous edges that deviate from the normal structure edges are extracted from the material coordinate diagram. The interfaces to which the candidate anomalous edges belong are identified based on the responses of the candidate anomalous edges in the reverse dark field diagram, different focal plane diagrams and polarization diagrams, thus forming interface-assigned anomalous edges. Based on the positional consistency and gradient reversal of the interface-assigned abnormal edges, the illumination interference edges are removed. The projection range of the puncture needle in the backlight contour map at each corner is expanded to form a puncture needle occlusion zone. Based on the reproduction state of the remaining interface-assigned abnormal edges outside the puncture needle occlusion zone, the projection interference edges are removed to form material abnormal edges. The abnormal material edge is written into the component interface baseline map to construct the defect penetration topology. The defect penetration topology is parsed to obtain the test results of the indwelling needle component to be inspected.

2. The machine vision-based defect detection method for indwelling needle components as described in claim 1, characterized in that: The indwelling needle assembly to be inspected includes a transparent indwelling catheter and a metal puncture needle inserted inside the transparent indwelling catheter; The front end of the metal puncture needle is a beveled tip; The transparent indwelling catheter is provided with an adhesive transition zone.

3. The machine vision-based defect detection method for indwelling needle components as described in claim 2, characterized in that: The formation of a multi-perturbation image group specifically involves: The indwelling needle assembly to be inspected is fixed along the axial direction. The indwelling needle assembly to be inspected is controlled to rotate sequentially at preset equal angular intervals and stop at each angle. Backlight illumination is turned on to collect backlight contour map. After the backlight illumination is turned off, the reverse dark field map is collected by sequentially illuminating from the opposite direction. Backlight illumination is maintained and the focal plane position is adjusted sequentially along the imaging optical axis to collect different focal plane maps. Under a fixed illumination direction, parallel polarization state and orthogonal polarization state are set sequentially to collect polarization map. Write the backlight profile diagram, reverse dark field diagram, different focal plane diagrams and polarization diagram into the corresponding indwelling needle component number and corner number to be inspected; Using the backlight profile at the same angle as the registration reference, the endpoints of the transparent indwelling catheter, the tip of the metal puncture needle, and the boundary points of the bonding transition zone are extracted from the backlight profile as registration points. The corresponding registration points are located in the reverse dark field image, different focal plane images, and polarization images at the same angle. The rotation and translation amounts are calculated based on the positional differences between the corresponding registration points. The image coordinates of the reverse dark field image, different focal plane images and polarization images are transformed into the backlight contour image. The images are then associated according to the component number, corner number and image category of the indwelling needle under inspection to form a multi-perturbation image group.

4. The machine vision-based defect detection method for indwelling needle components as described in claim 3, characterized in that: The formation of the component interface baseline diagram is specifically as follows: Read the multi-perturbation image group sequentially according to the corner number, and extract the outer contour edge of the transparent indwelling catheter, the inner contour edge of the transparent indwelling catheter, the contour edges of both sides of the metal puncture needle, and the contour edge of the needle tip bevel according to the gray-scale abrupt change position in the backlight contour image. The extraction results were checked point by point using the brightness, sharpness and polarization response changes of the reverse dark field image, different focal plane images and polarization images at the same image coordinates under the same rotation angle. The contour edges with continuous positions and stable response differences with adjacent areas were retained. The bonding transition zone boundary was extracted based on the continuous response change position between the transparent indwelling catheter and the metal puncture needle. The outer contour edge of the transparent indwelling catheter, the inner contour edge of the transparent indwelling catheter, the contour edges on both sides of the metal puncture needle, the contour edge of the needle tip bevel and the bonding transition zone boundary were marked as normal structure edges. The midpoints between the normal structural edges on both sides of the transparent indwelling catheter are calculated sequentially along the axis of the transparent indwelling catheter and continuously fitted to form the catheter centerline. The midpoints between the normal structural edges on both sides of the metal puncture needle are calculated sequentially along the axis of the metal puncture needle and continuously fitted to form the puncture needle centerline. The normal structural edges, catheter centerline and puncture needle centerline are written into a unified image coordinate system according to the corner number to form a component interface reference map.

5. The machine vision-based defect detection method for indwelling needle components as described in claim 4, characterized in that: The establishment of axial-circumferential material coordinates specifically involves: The intersection of the catheter centerline and the normal structural edge of the transparent indwelling catheter tip is taken as the axial starting point. The axial position is continuously set along the catheter centerline according to the image pixel spacing, and the cumulative distance from each axial position to the axial starting point is taken as the axial coordinate. The corners of the indwelling needle assembly to be inspected are read according to the corner number. The projection position relationship between the catheter centerline and the outer contour edges of the transparent indwelling catheter on both sides is identified at each axial position. The circumferential position of the image to be mapped relative to the current corner is calculated based on the ratio between the distance from the image to be mapped to the catheter centerline and the distance from the catheter centerline to the outer contour edge of the corresponding transparent indwelling catheter. The calculated circumferential position is used as the circumferential coordinate of the corresponding image to be mapped, and the axial-circumferential material coordinates are established.

6. The machine vision-based defect detection method for indwelling needle components as described in claim 5, characterized in that: The mapping of multiple perturbation image groups to a material coordinate map specifically involves: Draw perpendicular lines along the axial positions of the catheter centerline, and read the backlight contour image value, reverse dark field image value, different focal plane image value and polarization image value at the corresponding positions between the perpendicular lines and the normal structural edge of the transparent indwelling catheter in the multi-perturbation image group. The backlight contour image value, reverse dark field image value, image values ​​of different focal planes, and polarization image value are written into the same image position according to the corresponding axial and circumferential coordinates, and the overlapping image positions corresponding to adjacent corners are averaged to form a material coordinate diagram.

7. The machine vision-based defect detection method for indwelling needle components as described in claim 6, characterized in that: The extraction of candidate anomalous edges deviating from normal structural edges from the material coordinate diagram specifically involves: The normal structural edges in the component interface reference diagram are mapped to the material coordinate diagram according to the axial-circumferential material coordinates. The gray-level gradient between adjacent image positions is calculated based on the backlight contour image value in the material coordinate diagram. The local maxima of the gray-level gradient are connected to form continuous edge lines. Continuous edge lines that coincide with normal structural edges and extend in the same direction are considered normal structural edges, while continuous edge lines that do not coincide with normal structural edges or deviate from normal structural edges are considered candidate abnormal edges.

8. The machine vision-based defect detection method for indwelling needle components as described in claim 7, characterized in that: The formation of the interface belonging to the abnormal edge is specifically as follows: Along the normal structural edges of the transparent indwelling catheter, metal puncture needle, needle tip bevel, and adhesive transition zone, the brightness difference between the two sides of the normal structural edge in the reverse dark field image is read respectively. The sum of the absolute values ​​of the gray-level gradients of the neighborhood of the normal structural edge in different focal plane images at each focal plane position is calculated. The difference between the sum of the maximum and minimum absolute values ​​of the gray-level gradients is calculated. The brightness difference under different polarization states in the polarization image is read. The average reverse dark field response, the average response of different focal planes, and the average polarization response of the normal structural edges corresponding to the transparent indwelling catheter, metal puncture needle, needle tip bevel, and adhesive transition zone are calculated respectively. Based on the axial and circumferential coordinates of the candidate abnormal edge, the same response of the candidate abnormal edge is read in the reverse dark field image, different focal plane images and polarization images. The initial response difference between the average response of the candidate abnormal edge and the average response of the corresponding normal structural edge of the transparent indwelling catheter, metal puncture needle, needle tip bevel and adhesive transition zone is calculated respectively. The initial response difference between the candidate abnormal edge and each normal structural edge under the same response is normalized to form a normalized response difference. The reverse dark field response weight, different focal plane response weight and polarization response weight are calculated based on the response difference between the normal structural edges corresponding to the transparent indwelling catheter, metal puncture needle, needle tip bevel and adhesive transition zone. Each normalized response difference is multiplied by its corresponding response weight and then summed to form a comprehensive response difference between the candidate abnormal edge and the transparent indwelling catheter, metal puncture needle, needle tip bevel, and adhesive transition zone. The interface to which the normal structural edge with the smallest comprehensive response difference belongs is identified as the interface to which the candidate abnormal edge belongs. The candidate abnormal edges are marked according to their respective interfaces to form interface-assigned abnormal edges.

9. The machine vision-based defect detection method for indwelling needle components as described in claim 8, characterized in that: The formation of material anomalous edges is specifically as follows: The allowable position difference is calculated based on the maximum position difference between each registration point after it is transformed to the backlight profile and the corresponding registration point in the backlight profile during the registration process. Read the interface anomalous edges one by one according to the axial-circumferential material coordinates, find the edge positions corresponding to the interface anomalous edges in the reverse dark field map under different lighting directions, and calculate the axial coordinate difference and circumferential coordinate difference of the edge positions. Based on the number of pixels corresponding to the outer diameter of the transparent indwelling conduit, the circumferential coordinate difference is converted into the circumferential position difference, and the gray-scale gradient direction is calculated. Interface aberration edges that are not greater than the allowable position difference and whose gray-scale gradient directions are opposite under different lighting directions are retained. Interface aberration edges that are greater than the allowable position difference and whose gray-scale gradient directions have not changed in the opposite direction are removed as lighting interference edges. Extract the outline edges of the metal puncture needle from the backlight contour map at each corner, connect the outline edges of the metal puncture needle to form the projection range of the puncture needle, and extend it outward from the projection range of the puncture needle according to the allowable position difference to form a puncture needle occlusion zone. Retain the remaining abnormal edges whose interfaces belong to the metal puncture needle and the bevel of the needle tip; For the remaining abnormal edges of the interface that belong to the transparent indwelling catheter and the bonding transition zone, determine whether the remaining abnormal edges of the interface belong to the puncture needle shielding zone at each corner, and find the corresponding edge position of the remaining abnormal edges of the interface after they leave the puncture needle shielding zone according to the axial coordinate and circumferential coordinate. Retain any remaining interface anomalous edges that reappear within the allowable positional difference after leaving the puncture needle shielding zone. Identify and remove any remaining interface anomalous edges that only appear within the puncture needle shielding zone and do not reappear after leaving the puncture needle shielding zone as projection interference edges. Collect the retained remaining interface anomalous edges as material anomalous edges.

10. The machine vision-based defect detection method for indwelling needle components as described in claim 9, characterized in that: The specific steps for obtaining the test results of the indwelling needle assembly to be tested are as follows: According to the axial-circumferential material coordinates, the axial coordinates, circumferential coordinates and the interface to which each material abnormality edge belongs are written into the component interface reference diagram. Material abnormality edges that intersect each other and whose distance between endpoints is no greater than the allowable position difference are connected in sequence to form continuous material abnormality edges. Record the intersection, crossing, termination and closure relationships between the continuous material anomalous edges and the normal structural edges of the transparent indwelling catheter, metal puncture needle, needle tip bevel and bonding transition zone, and construct the defect-through topology; Analyze the topology of defects, mark the basic shape type of continuous material anomaly edges that do not form closed regions as linear, and mark the basic shape type of continuous material anomaly edges that form closed regions as planar; Read the crossing relationship between continuous material anomaly edges and normal structure edges according to the connection order of continuous material anomaly edges. When a continuous material anomaly edge crosses a normal structure edge, the material anomaly edges before and after the crossing position remain continuously connected, and the belonging interfaces recorded by the material anomaly edges before and after the crossing position are different, mark the crossing state of the continuous material anomaly edge as crossing; otherwise, mark the crossing state of the continuous material anomaly edge as non-crossing. Based on the basic morphology type and the boundary state, continuous material anomaly edges with a basic morphology type of linear and a boundary state of non-boundary are identified as linear defects; continuous material anomaly edges with a basic morphology type of planar and a boundary state of non-boundary are identified as planar defects; continuous material anomaly edges with a basic morphology type of linear and a boundary state of boundary are identified as linear boundary defects; and continuous material anomaly edges with a basic morphology type of planar and a boundary state of boundary are identified as planar boundary defects. The interfaces to which continuous material anomaly edges belong are deduplicated to form a set of defect-related interfaces. Based on the set of defect-related interfaces, the transparent indwelling catheter, metal puncture needle, needle tip bevel, and bonding transition area involved in the defect are identified. The defect location is identified based on the axial and circumferential coordinates. The defect size is calculated based on the axial span, circumferential span, and closed area of ​​the continuous material anomaly edge. The defect type, defect-related interfaces, defect location, and defect size are collected to obtain the test results of the indwelling needle assembly to be inspected.