An image recognition-based inspection method and inspection device for differential shell end cover screw holes

By employing an image recognition-based method for detecting screw holes in differential housing end caps, a high-precision detection method is achieved using a servo indexing turntable and rotary encoder combined with an industrial camera. This method solves the problems of slow detection speed and low accuracy in existing technologies, and realizes efficient and robust screw hole detection and defect classification.

CN122391091APending Publication Date: 2026-07-14LINZHOU HENGLI AUTO PARTS CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610415402.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-03-31
Publication Date
2026-07-14

AI Technical Summary

Technical Problem

Existing technologies make it difficult to perform rapid and high-precision inspection of differential housing end cap screw holes on high-speed production lines. Coordinate measuring machines are slow and expensive, making it difficult to integrate them into high-speed production lines for full inspection.

Method used

A method for detecting screw holes in differential housing end caps based on image recognition is adopted. The differential end cap is driven to rotate by a servo indexing turntable, and image acquisition is triggered by a rotary encoder. An industrial camera and dual telecentric lenses are used for image preprocessing and sub-pixel precision ellipse fitting to achieve non-contact, fully automatic detection of screw holes.

Benefits of technology

It enables efficient, accurate, and robust online detection of differential housing end cap screw holes, allowing for rapid defect classification, improved production efficiency, and guidance for process improvement.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122391091A_ABST
    Figure CN122391091A_ABST
Patent Text Reader

Abstract

The application discloses an image recognition-based inspection method and inspection device for differential shell end cover screw holes, and relates to the technical field of precision detection.The inspection method combines high-precision indexing rotation, isochronous sequence visual trigger collection and image coincidence rate intelligent analysis, realizes non-contact, full-automatic and online comprehensive detection and intelligent diagnosis of the position degree and perpendicularity of the annularly distributed screw holes of a differential shell, achieves high-efficiency, high-precision and high-robustness synchronous quantitative detection and defect classification, and effectively guides process improvement, and has better application value.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of precision testing technology, and more specifically, to a method and apparatus for inspecting differential housing end cap screw holes based on image recognition. Background Technology

[0002] The differential housing, or simply differential case, is a key component of an automotive transmission system. The differential case end cap, located at one end of the differential case, is conical in shape with a central columnar protrusion. A center pin hole in the center of this protrusion connects to the half-shaft. Surrounding the center pin hole are two evenly distributed rings of threaded holes. The inner ring connects to the differential case, creating a cavity between the end cap and the differential case to accommodate the planetary gears. The outer ring connects to the driven bevel gear, which meshes with the driving bevel gear to transmit kinetic energy to the entire differential. A high degree of coaxiality is required between the differential case, the end cap, and the driven bevel gear to ensure smooth differential operation. The key to ensuring coaxiality lies in the machining accuracy of these two rings of threaded holes. This includes the positional accuracy (the deviation of the hole center from its theoretical distribution position) and perpendicularity (the perpendicularity of the hole axis to the end face of the case). Therefore, during manufacturing, these threaded holes must undergo 100% online or offline inspection.

[0003] Currently, the inspection of this type of annular hole system is mainly carried out using a coordinate measuring machine (CMM): this is the most accurate method, which measures the three-dimensional coordinates of the center of each hole by contact with a probe and then calculates the positional accuracy. However, this method is slow, expensive, and has high environmental requirements, making it difficult to integrate into high-speed production lines for full inspection. Therefore, in order to meet the growing production demands, it is essential to develop a new inspection method that is fast and accurate. Summary of the Invention

[0004] The purpose of this invention is to provide an image recognition-based method and apparatus for inspecting differential housing end cover screw holes, which can simplify the inspection process of differential housing end cover screw holes, quickly and efficiently achieve batch inspection of differential housing end cover screw holes, and improve production efficiency.

[0005] The embodiments of the present invention are implemented as follows: A method for detecting screw holes in a differential housing end cover based on image recognition, wherein the differential end cover has a central reference hole and N screw holes distributed in a ring around the central reference hole, comprising the following steps: S1. Self-calibration steps: Drive the differential end cover to rotate continuously around the central reference hole for one revolution, record the rotation period T experienced when any selected screw hole returns to its initial visual position, and obtain the reference image of the selected screw hole at that position. S2, Timing detection steps: With an interval of one-Nth of the period T, drive the differential end cover to rotate and trigger image acquisition at N equally divided timing points in sequence, and obtain the detection images when the N screw holes move to the initial visual position in sequence. S3. Image Comparison and Diagnosis Steps: Compare each detected image with the reference image. Based on the image overlap and shape characteristics, determine the positional accuracy and axial direction of the corresponding screw hole, and output the diagnostic results.

[0006] Furthermore, in other preferred embodiments of the present invention, the image acquisition in step S2 is triggered by an equal-angle interval pulse signal emitted by a rotary encoder, ensuring that the theoretical rotation angle of the differential end cap is an integer multiple of (360 / N) degrees during each acquisition.

[0007] Furthermore, in other preferred embodiments of the present invention, after acquiring the reference image in step S1 and the detection image in step S2, an image preprocessing step is performed, including: S31. Perform Gaussian filtering on the acquired raw image to suppress noise; S32. An adaptive threshold segmentation algorithm is used to binarize and separate the screw hole area from the body area of ​​the differential end cover. S33. Perform a morphological closing operation on the binary image to fill in the tiny holes within the contour and smooth the edges.

[0008] Furthermore, in other preferred embodiments of the present invention, step S3, based on the image overlap and shape features, includes the following feature extraction sub-steps: S341. Contour Extraction: Extract pixel-level edge contours of the screw hole region from the preprocessed image; S342, Subpixel accuracy improvement: A subpixel edge localization algorithm based on spatial moments is adopted to interpolate the pixel-level edge contours and obtain a contour coordinate sequence with subpixel accuracy. S343. Shape Fitting: Based on the sub-pixel contour coordinate sequence, perform least squares ellipse fitting to obtain the center coordinates (x, y), major axis radius a, minor axis radius b, and orientation angle of the fitted ellipse.

[0009] Furthermore, in other preferred embodiments of the present invention, step S3, which involves determining the image overlap and shape features, specifically includes: Based on the parameters of the fitted ellipse, the roundness value C = b / a of the screw hole in the detected image is calculated; Calculate the normalized cross-correlation coefficient (NCC) between the screw hole contour region in the detected image and the corresponding region in the reference image; If the roundness value C is greater than or equal to the roundness threshold C th And the cross-correlation coefficient NCC is greater than or equal to the overlap threshold S. thIf so, the screw hole is deemed qualified; If C ≥ C th But NCC th If so, it is determined that there is a positional deviation in the screw hole; If C <C th If so, the screw hole is determined to be an oblique hole whose axis is not perpendicular to the shooting plane.

[0010] Furthermore, in other preferred embodiments of the present invention, when a positional deviation is determined to exist, the method further includes a deviation source diagnosis step: The differential end cover is controlled to reciprocate at a micro-angle near its current position, and the NCC value of the current detection image and the reference image is calculated in real time at each micro-angle. Record the micro-angle Δθ that makes the NCC value reach its maximum. max ; Compare Δθ of all screw holes max Whether there is consistency is determined, and the source of deviation is identified accordingly.

[0011] Furthermore, in other preferred embodiments of the present invention, in step S2, for each screw hole, multiple frames are continuously acquired within a time window before and after the theoretical triggering time, and the fitting results of the multiple frames are weighted and averaged to improve the robustness and accuracy of a single measurement.

[0012] Furthermore, in other preferred embodiments of the present invention, it further includes: S4. Data validity verification: After completing the detection of one rotation cycle T, the center coordinates of all screw holes are fitted with the least squares method to obtain the center coordinates of the actual distribution circle; the distance deviation between the fitted circle center coordinates and the theoretical rotation center of the system is calculated to determine the validity of the data.

[0013] Furthermore, in other preferred embodiments of the present invention, during the image acquisition process in step S2, the light source intensity is dynamically adjusted based on the brightness information fed back in real time from the detected image to ensure that the illumination conditions of each screw hole image are consistent, thereby eliminating the influence of surface reflectivity differences on image contrast.

[0014] An inspection device for differential housing end cap screw holes based on image recognition, used to perform the above-mentioned detection method, comprising: Servo indexing rotary table, used to support and drive the rotation of the differential end cover; A rotary encoder, coaxially connected to the turntable, is used to generate trigger pulses with equal angular intervals; The vision imaging unit includes an industrial camera, dual telecentric lenses and a backlight. The industrial camera is fixedly set and aligned with the shooting position on the turntable, and performs image acquisition in response to trigger pulses. ​The control and processing unit, which communicates with the servo indexing turntable, rotary encoder and industrial camera, is configured to execute the steps of the method and includes software modules for implementing image preprocessing, subpixel edge extraction, ellipse fitting and diagnostic algorithms.

[0015] The beneficial effects of the embodiments of the present invention are: This invention provides a method and apparatus for inspecting differential housing end cover screw holes based on image recognition. The inspection method combines high-precision indexing rotation, time-sequential visual trigger acquisition, and intelligent analysis of image overlap rate. It achieves non-contact, fully automatic, and online comprehensive detection and intelligent diagnosis of the position and perpendicularity of the annularly distributed screw holes in the differential housing. It achieves the effect of simultaneously completing quantitative detection and defect classification with high efficiency, high precision, and high robustness, and effectively guides process improvement, thus having good application value. Attached Figure Description

[0016] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of the present invention and should not be regarded as a limitation on the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0017] Figure 1 This is a schematic diagram of the differential housing end cap provided in an embodiment of the present invention.

[0018] Icons: 100 - Differential housing end cap; 110 - Center pin hole; 120 - Screw hole. Detailed Implementation

[0019] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention. Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the claimed invention, but merely to represent selected embodiments of the invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0020] The abbreviations and key terms used in the following embodiments are defined as follows: Example

[0021] This embodiment provides a method for detecting screw holes in the end cap of a differential housing based on image recognition. For example... Figure 1 As shown, the differential housing end cap 100 is located at one end of the differential housing. It is conical in shape with a central columnar protrusion. A central pin hole 110 (i.e., a central reference hole) is located in the center of the columnar protrusion for connection to the half-shaft. Two rings of threaded holes 120 are evenly distributed around the central pin hole. The inner ring of threaded holes 120 (N=12) is used to connect to the differential housing, forming a cavity between the differential housing end cap and the differential housing to accommodate the planetary gears. The outer ring of threaded holes 120 (N=12) is used to connect to the driven bevel gear, which meshes with the driving bevel gear to transmit kinetic energy to the entire differential. This type is commonly found in 140-type and 145-type differentials.

[0022] The detection method includes the following steps: S1. Self-calibration steps: Drive the differential end cover to rotate continuously around the central reference hole for one revolution, record the rotation period T when any selected screw hole (denoted as hole A) returns to its initial visual position, and obtain the reference image Image_A of hole A at that position.

[0023] Specifically, to determine whether hole A has returned to its initial visual position, the final image after one rotation is compared with the reference image to ensure a pixel-level overlap of over 99.5%. If this standard is met, it indicates good alignment and system stability, allowing for subsequent inspection. If the standard is not met, an alarm should be triggered, prompting a check of the workpiece clamping or system calibration.

[0024] S2. Timing detection steps: With an interval of one-Nth of the period T (t=T / 12 in this embodiment), drive the differential end cover to rotate and trigger image acquisition at N equally divided timing points in sequence, and obtain the detection images when the N screw holes move to the initial visual position in sequence.

[0025] The image acquisition is triggered by equally spaced pulse signals from a rotary encoder, ensuring that the theoretical rotation angle of the differential end cap is an integer multiple of (360 / N) degrees during each acquisition. That is, at times t, 2t, 3t, 4t, and 5t, the camera is triggered to acquire images Image_B, Image_C, Image_D, Image_E, and Image_F, respectively. Theoretically, these should correspond to the images of holes B, C, D, E, and F moving to the original position of hole A.

[0026] Furthermore, for each screw hole, multiple frames are continuously acquired within a time window before and after the theoretical triggering time, and the fitting results of the multiple frames are weighted and averaged to improve the robustness and accuracy of a single measurement.

[0027] Optionally, during image acquisition, the light source intensity is dynamically adjusted based on the brightness information fed back from the detected image in real time, so as to ensure that the lighting conditions of each screw hole image are consistent and to eliminate the influence of surface reflectivity differences on image contrast.

[0028] By employing an image acquisition method triggered by an angle such as a rotary encoder, strict synchronization between image acquisition and workpiece rotation angle is ensured. This avoids acquisition position errors caused by motor start-stop jitter or speed fluctuations, thereby significantly improving the timing accuracy and repeatability of position detection and laying a hardware synchronization foundation for achieving high-precision comparison.

[0029] Optionally, after acquiring the reference image in step S1 and the detection image in step S2, an image preprocessing step is performed, including: S31. Perform Gaussian filtering on the acquired raw image to suppress noise; S32. An adaptive threshold segmentation algorithm is used to binarize and separate the screw hole area from the body area of ​​the differential end cover. S33. Perform a morphological closing operation on the binary image to fill in the tiny holes within the contour and smooth the edges.

[0030] After image preprocessing, interference from common industrial noise, uneven lighting, and minor defects can be effectively suppressed, extracting clean and complete binary contours of screw holes. This greatly enhances the robustness and stability of subsequent image processing and feature extraction algorithms, enabling the system to adapt to different workpiece surface conditions and workshop environments.

[0031] S3. Image Comparison and Diagnosis Steps: Compare each detected image with the reference image. Based on the image overlap and shape characteristics, determine the positional accuracy and axial direction of the corresponding screw hole, and output the diagnostic results.

[0032] Furthermore, step S3, based on image overlap and shape features, includes the following feature extraction sub-steps: S341. Contour Extraction: Extract pixel-level edge contours of the screw hole region from the preprocessed image; S342, Subpixel accuracy improvement: A subpixel edge localization algorithm based on spatial moments is adopted to interpolate the pixel-level edge contours and obtain a contour coordinate sequence with subpixel accuracy. S343. Shape Fitting: Based on the sub-pixel contour coordinate sequence, perform least squares ellipse fitting to obtain the center coordinates (x, y), major axis radius a, minor axis radius b, and orientation angle of the fitted ellipse.

[0033] Specifically, the goal of sub-pixel edge localization algorithms is to improve edge localization accuracy from the integer pixel level to the sub-pixel level (e.g., 0.1 pixels). For a local region near a detected coarse edge point (x0, y0) in an image, its gray-level distribution can be modeled using spatial moments: Let the normal direction of the edge point (x0, y0) be (n x n y A set of gray values ​​I(i) of pixels are collected along the normal direction. By calculating the first three moments of this gray distribution, the sub-pixel position offset δ of the edge can be solved.

[0034] , in, , where i is the offset index in pixels along the normal direction, and the summation range is usually k=1 or 2.

[0035] Finally, the sub-pixel precision edge point coordinates (x sub y sub )for: .

[0036] Furthermore, least squares ellipse fitting is performed after obtaining a set of sub-pixel edge points. Then, an ellipse is fitted using the least squares method. The general equation of a quadratic curve of an ellipse is: , The constraints are .

[0037] The goal of fitting is to find the parameter vector. This minimizes the sum of the squared algebraic distances from all edge points to the ellipse, i.e.: .

[0038] After solving for v, the required geometric parameters can be obtained using the following formula: Center coordinates (x) c , y c ): ; Major and minor axis radii a, b: ; Rotation angle θ: .

[0039] Furthermore, step S3, based on image overlap and shape features, specifically includes: Based on the parameters of the fitted ellipse, the roundness value C = b / a of the screw hole in the detected image is calculated; the closer the roundness value is to 1, the closer the screw hole is to a perfect circle.

[0040] Calculate the normalized cross-correlation coefficient (NCC) between the screw hole contour region in the detected image and the corresponding region in the reference image; If the roundness value C is greater than or equal to the roundness threshold C th (Values ​​can range from 0.92 to 0.98), and the cross-correlation coefficient (NCC) is greater than or equal to the overlap threshold (S). th (A value of 0.97~0.995 is acceptable), then the screw hole is considered qualified; If C ≥ C th But NCC th If so, it is determined that there is a positional deviation in the screw hole; If C <C th If so, the screw hole is determined to be an oblique hole whose axis is not perpendicular to the shooting plane.

[0041] This step establishes a clear and reliable automated judgment logic by comparing two quantitative indicators, roundness value (C) and normalized cross-correlation coefficient (NCC), with thresholds. This logic can accurately and automatically distinguish between three core quality states: "qualified hole," "positional deviation hole," and "skewed hole," achieving intelligent diagnosis of complex geometric tolerances, replacing manual subjective judgment, and improving the consistency and accuracy of inspection.

[0042] Furthermore, when a positional deviation is determined to exist, the method also includes a deviation source diagnosis step: The differential end cover is controlled to reciprocate at a micro-angle near its current position, and the NCC value of the current detection image and the reference image is calculated in real time at each micro-angle. Record the micro-angle Δθ that makes the NCC value reach its maximum. max ; Compare Δθ of all screw holes max Whether there is consistency is determined, and the source of deviation is identified accordingly.

[0043] Ideally, each screw hole is precisely and evenly distributed. After the turntable rotates by the theoretical division angle (i.e., 30°), the image of the next hole (hole B) should completely coincide with the reference image of the previous hole (hole A). At this point, the NCC value reaches its maximum at the theoretical position, and the compensation angle Δθ is achieved. max It should be 0. When a position deviation (NCC) is detected. th If the image of the current hole (let's say hole B) is misaligned with the reference image at its theoretical position, it indicates that the image is not aligned with the reference image. At this point, the system controls the turntable to perform a fine-motion search near the current position to find the position that maximizes the NCC (Negative Compensation Corner), and records its compensation angle Δθ. max After all screw holes have been inspected, if only one screw hole recorded Δθ...​​max If the screw hole is not found, it indicates that the screw hole is the source of the deviation and its position is incorrect; if all screw holes (except the reference hole, i.e., hole A) have recorded Δθ max If the results show a high degree of consistency (variance less than the threshold), it indicates that the reference hole is the source of deviation, and the detection of all screw holes is based on an incorrect reference. All screw holes (except the reference hole, i.e., hole A) recorded Δθ. max However, the lack of consistency may mean that multiple holes have independent positional deviations, which is very difficult to occur in lathe machining. More likely, the workpiece clamping is extremely unstable, or there is a problem with the detection system itself. In this case, manual intervention is required for verification or equipment inspection.

[0044] Furthermore, the image recognition-based method for detecting differential housing end cap screw holes provided in this embodiment also includes: S4. Data validity verification: After completing the detection of one rotation cycle T, the center coordinates of all screw holes are fitted with the least squares method to obtain the center coordinates of the actual distribution circle; the distance deviation between the fitted circle center coordinates and the theoretical rotation center of the system is calculated to determine the validity of the data.

[0045] Specifically, the center coordinates of the obtained N screw holes are considered as a point set. The least squares method is used to fit a circle to this point set, finding the "best-fit circle" that minimizes the sum of the squares of the distances from all points to the circle. The center coordinates of this fitted circle are denoted as (x...). fitted y fitted ), which is the geometric center around which all screw holes are actually distributed.

[0046] Obtain the theoretical rotation center coordinates (x) of the system theory y theory This coordinate originates from the reference origin established in the Phase 1 "Self-calibration" step and shared by all subsequent image coordinate systems (usually initialized by the center pin hole fitting circle center and determined after registration optimization).

[0047] Calculate the Euclidean distance deviation D between the actual fitted circle center and the theoretical rotation center, and then compare the deviation D with a preset system stability threshold D. th The data will be compared to determine the overall validity of the test data for this period: If D ≤ D th The data is deemed valid. This indicates that the workpiece clamping, turntable alignment, and visual reference remained highly stable throughout the entire inspection cycle, and the measured screw hole position data are highly reliable. The system can output a final inspection report.

[0048] If D > D thThe system alarm is triggered because the validity of the data is questionable. This indicates a significant deviation between the fitted circle center and the theoretical center, which is usually caused by one or more of the following reasons: The workpiece moves or loosens unexpectedly during the inspection process.

[0049] The turntable's rotation axis has radial runout or clearance.

[0050] The visual system experiences reference drift due to factors such as temperature and vibration.

[0051] At this point, the system should not directly output the test results, but should prompt the operator to check the clamping and maintenance of the equipment, or automatically start a recalibration process.

[0052] This embodiment also provides an image recognition-based inspection device for differential housing end cap screw holes, used to perform the above-described detection method, comprising: Servo indexing rotary table, used to support and drive the rotation of the differential end cover; A rotary encoder, coaxially connected to the turntable, is used to generate trigger pulses with equal angular intervals; The vision imaging unit includes an industrial camera, dual telecentric lenses and a backlight. The industrial camera is fixedly set and aligned with the shooting position on the turntable, and performs image acquisition in response to trigger pulses. The control and processing unit, which communicates with the servo indexing turntable, rotary encoder and industrial camera, is configured to execute the steps of the method and includes software modules for implementing image preprocessing, subpixel edge extraction, ellipse fitting and diagnostic algorithms.

[0053] The beneficial effects of the embodiments of the present invention are: This invention provides a method and apparatus for inspecting differential housing end cover screw holes based on image recognition. The inspection method combines high-precision indexing rotation, time-sequential visual trigger acquisition, and intelligent analysis of image overlap rate. It achieves non-contact, fully automatic, and online comprehensive detection and intelligent diagnosis of the position and perpendicularity of the annularly distributed screw holes in the differential housing. It achieves the effect of simultaneously completing quantitative detection and defect classification with high efficiency, high precision, and high robustness, and effectively guides process improvement, thus having good application value.

[0054] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

Claims

1. A method for detecting screw holes in the end cap of a differential housing based on image recognition, characterized in that, The differential end cover has a central reference hole and N screw holes arranged in a ring around the central reference hole, and includes the following steps: S1. Self-calibration step: Drive the differential end cover to rotate continuously around the central reference hole for one revolution, record the rotation period T experienced when any selected screw hole returns to its initial visual position, and obtain the reference image of the selected screw hole at that position. S2, Timing detection step: Drive the differential end cover to rotate at intervals of one-Nth of the rotation period T and trigger image acquisition at N equally divided timing points in sequence, respectively acquiring detection images when the N screw holes move to the initial visual position in sequence. S3. Image comparison and diagnosis steps: Compare each of the detected images with the reference image respectively. Based on the image overlap and shape characteristics, determine the positional accuracy and axial direction of the corresponding screw hole, and output the diagnosis results.

2. The detection method according to claim 1, characterized in that, The image acquisition in step S2 is triggered by an equal-angle interval pulse signal emitted by the rotary encoder, ensuring that the theoretical rotation angle of the differential end cover is an integer multiple of (360 / N) degrees during each acquisition.

3. The detection method according to claim 2, characterized in that, After acquiring the reference image in step S1 and the detection image in step S2, image preprocessing steps are performed, including: S31. Perform Gaussian filtering on the acquired raw image to suppress noise; S32. An adaptive threshold segmentation algorithm is used to binarize and separate the screw hole area from the body area of ​​the differential end cover. S33. Perform a morphological closing operation on the binary image to fill in the tiny holes within the contour and smooth the edges.

4. The detection method according to claim 3, characterized in that, Step S3, based on image overlap and shape features, includes the following feature extraction sub-steps: S341. Contour Extraction: Extract pixel-level edge contours of the screw hole region from the preprocessed image; S342, Subpixel accuracy improvement: A subpixel edge localization algorithm based on spatial moments is used to interpolate the pixel-level edge contour to obtain a contour coordinate sequence with subpixel accuracy. S343. Shape Fitting: Based on the sub-pixel contour coordinate sequence, perform least squares ellipse fitting to obtain the center coordinates (x, y), major axis radius a, minor axis radius b, and orientation angle of the fitted ellipse.

5. The detection method according to claim 4, characterized in that, Step S3 involves determining the image overlap and shape features, specifically including: Based on the parameters of the fitted ellipse, the roundness value C = b / a of the screw hole in the detected image is calculated; Calculate the normalized cross-correlation coefficient (NCC) between the screw hole contour region in the detected image and the corresponding region in the reference image; If the roundness value C is greater than or equal to the roundness threshold C th And the cross-correlation coefficient NCC is greater than or equal to the overlap threshold S. th If so, the screw hole is deemed qualified; If C ≥ C th But NCC < S th If so, it is determined that there is a positional deviation in the screw hole; If C < C th If so, the screw hole is determined to be an oblique hole whose axis is not perpendicular to the shooting plane.

6. The detection method according to claim 5, characterized in that, When a positional deviation is determined to exist, the method further includes a deviation source diagnosis step: The differential end cover is controlled to reciprocate at a micro-angle near the current position, and the NCC value of the current detection image and the reference image is calculated in real time at each micro-angle. Record the micro-angle Δθ that makes the NCC value reach its maximum. max ; Compare Δθ of all screw holes max Whether there is consistency is determined, and the source of deviation is identified accordingly.

7. The detection method according to claim 1, characterized in that, In step S2, for each screw hole, multiple frames are continuously acquired within a time window before and after the theoretical triggering time, and the fitting results of the multiple frames are weighted and averaged to improve the robustness and accuracy of a single measurement.

8. The method according to claim 1, characterized in that, Also includes: S4. Data validity verification: After completing the detection of one rotation cycle T, the center coordinates of all screw holes are fitted with the least squares method to obtain the center coordinates of the actual distribution circle; the distance deviation between the fitted circle center coordinates and the theoretical rotation center of the system is calculated to determine the validity of the data.

9. The detection method according to claim 8, characterized in that, During the image acquisition process in step S2, the light source intensity is dynamically adjusted based on the brightness information fed back from the detected image in real time, so as to ensure that the lighting conditions of each screw hole image are consistent and to eliminate the influence of surface reflectivity differences on image contrast.

10. An inspection device for differential housing end cap screw holes based on image recognition, used to perform the detection method as described in any one of claims 1 to 9, characterized in that, include: A servo indexing rotary table is used to support and drive the differential end cover to rotate; A rotary encoder, coaxially connected to the turntable, is used to generate trigger pulses with equal angular intervals; The visual imaging unit includes an industrial camera, a dual telecentric lens and a backlight. The industrial camera is fixedly set and aimed at the shooting position on the turntable, and performs image acquisition in response to the trigger pulse. The control and processing unit, which is communicatively connected to the servo indexing turntable, rotary encoder and industrial camera, is configured to execute the steps of the method and includes software modules for implementing image preprocessing, subpixel edge extraction, ellipse fitting and diagnostic algorithms.