An image feature-based parking nut defect recognition system

By acquiring image sequences during the clamping and rotation of the parking nut, calculating the nut center and generating a polar coordinate ring detection area, extracting texture angular and boundary angular signatures, locating slip breakpoints and performing phase mapping, the problem of inaccurate image alignment during parking nut rotation photography is solved, improving the stability and reliability of defect identification.

CN122048934BActive Publication Date: 2026-07-21HANGZHOU YUANSHI TRADE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
HANGZHOU YUANSHI TRADE CO LTD
Filing Date
2026-04-15
Publication Date
2026-07-21

AI Technical Summary

Technical Problem

In the existing technology, the parking nut may slip slightly when it is clamped and rotated for shooting, resulting in inaccurate image alignment and causing misjudgment or missed detection of defects. Moreover, this instability is difficult to solve effectively without changing the production line cycle time.

Method used

By acquiring image sequences of the parking nut clamping and rotating process, the center of the nut is calculated and the polar coordinate annular detection area is extracted to generate texture angular signatures and boundary angular signatures. Based on the inter-frame incremental consistency, the slip breakpoint is located, phase-stable segments are divided, phase mapping is constructed to complete the angle alignment, and defect candidate points are extracted in the circumferential unfolded image of the segments. Logistic regression is then used to output the true defect probability.

Benefits of technology

This technology improves the stability and reliability of parking nut defect identification without changing the production line cycle time, reduces structural drift interference caused by rotational instability, and ensures the continuous observability and location reliability of defect candidates.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122048934B_ABST
    Figure CN122048934B_ABST
Patent Text Reader

Abstract

The application discloses a parking nut defect recognition system based on image features and particularly relates to the field of industrial visual inspection, which is used to solve the problem that defects and splicing artifacts are difficult to distinguish in the clamping and rotating process of a parking nut. The system acquires an image sequence of the clamping and rotating process of the parking nut, calculates the center of the nut, intercepts a polar coordinate annular detection area, generates texture angular signatures and boundary angular signatures to obtain texture phases and boundary phases, positions a slip breakpoint according to inter-frame incremental consistency, divides phase stable segments, constructs a phase mapping, completes angle alignment, generates a segment circumferential development diagram, extracts broken edge candidate points and texture mutation candidate points in the segment circumferential development diagram to form defect candidates, and back projects the defect candidates to the polar coordinate annular detection area to obtain a back projection area. The tooth pitch anchor recurrence index and tooth profile damage width are calculated, and a real defect probability is output by logistic regression. Finally, a defect recognition result and a defect position mapping are output.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of industrial visual inspection, and more specifically, to a parking nut defect recognition system based on image features. Background Technology

[0002] Parking nuts are fasteners related to assembly and braking, and during mass production, automated inspection of the threaded area and key appearance surfaces is typically required. To capture as much detail as possible along the circumference of the thread, a common practice on production lines is to clamp the nut at the inspection station and use a rotating mechanism to continuously capture images. The acquired images are then fed into a vision system to extract image features such as contours, edges, and textures for defect identification and sorting. This method of clamping and rotating to cover the entire circumference of the thread is already publicly available in existing thread vision inspection equipment.

[0003] Under the aforementioned detection method, a situation that is easily overlooked but can directly undermine the reliability of identification is that the nut may experience very slight relative slippage during clamping and rotation for imaging. This slippage is not visually obvious, but it subtly alters the correspondence between the image captured and the image taken at the desired rotation position. Since existing processes often assume this correspondence is stable and reliable, multiple images are subsequently aligned, stitched together, or expanded, and image features are extracted at fixed positions to determine defects. Therefore, once slippage occurs, the position of the same thread or surface in different images will not match. At the stitching points, fracture marks that appear to be defects may appear, and the actual defect may be misaligned and fragmented, leading to misjudgments or missed detections. Moreover, this instability usually fluctuates with changes in surface oil film, clamping contact conditions, etc., making it difficult to quickly pinpoint the cause on-site. Therefore, the technical problem to be solved is how to automatically complete alignment and correction using the relatively stable structural features in the nut image without changing the production line cycle time, so that subsequent feature extraction and defect determination rely on the defect itself rather than motion errors, thereby improving the consistency and interpretability of parking nut defect identification based on image features.

[0004] To address the aforementioned problems, a technical solution is provided. Summary of the Invention

[0005] To overcome the aforementioned deficiencies of the prior art, embodiments of the present invention provide a parking nut defect recognition system based on image features. This system acquires image sequences of the parking nut clamping and rotating process, calculates the nut center, and extracts a polar coordinate annular detection area. It generates texture angular signatures and boundary angular signatures to obtain texture phase and boundary phase. Based on inter-frame incremental consistency, it locates slip breakpoints and divides phase-stable segments. It constructs phase mapping to complete angle alignment and generates a segment circumferential unfolded map. From the segment circumferential unfolded map, it extracts fracture edge candidate points and texture mutation candidate points to form defect candidates, which are then projected back into the polar coordinate annular detection area to obtain the projected area. It calculates the tooth pitch anchorage recurrence index and the tooth profile destruction width, and outputs the true defect probability through logistic regression. Finally, it outputs the defect recognition result and defect location mapping to solve the problems mentioned in the background art.

[0006] To achieve the above objectives, the present invention provides the following technical solution: Center positioning module: Acquires image sequences of the parking nut clamping and rotating process, calculates the nut center based on the outer contour and inner hole boundary, and extracts the annular detection area where the thread inlet is located around the nut center and converts it into polar coordinates; Phase extraction module: Generates two angular signatures in the polar coordinate annular detection area. One angular signature comes from the periodic light and dark texture formed by the thread profile, and the other angular signature comes from the directional change texture formed by the outer contour boundary. Calculate the corresponding phase for each frame's angular signature and record it as the texture phase and boundary phase. Sliding segmentation module: Based on the inter-frame increment consistency of texture phase and boundary phase, the sliding breakpoint is located, and the image sequence is divided into phase-stable segments according to the sliding breakpoint. Within the segment, the segment phase median increment is used to generate phase mapping and complete angle alignment, and the segment circumferential unfolding map is output. Candidate re-projection module: Extracts fracture edges and texture abrupt change locations from the circumferential unfolded image of the fragment to form defect candidates, and the defect candidates are re-projected back to the original image sequence through phase mapping; Probabilistic decision module: Calculates the tooth pitch anchorage recurrence index and tooth profile damage width in the re-projection area, outputs the true defect probability through logistic regression, and uses the true defect probability to screen out false candidates of misaligned joints, outputting the defect identification result and defect location mapping.

[0007] Furthermore, image sequences of the parking nut clamping and rotating process are acquired. The gradient magnitude of each frame is calculated, and edge candidate images are generated by determining the edge threshold based on the valley points of the histogram. After closure and area filtering, the outer contour point set and the inner hole boundary point set are obtained. Ellipse fitting is performed on each, and outliers are removed by residual mutation to obtain the outer contour ellipse center and the inner hole ellipse center. The nut center is selected based on the median of the residual. The brightness of the end face background area is located between the outer contour and the inner hole around the nut center and normalized. The annular detection area is determined based on the distance distribution mutation and a polar coordinate annular detection area is generated.

[0008] Furthermore, a radius difference amplitude map is calculated in the polar coordinate annular detection area. The radius difference amplitude map is summarized by radius row to form a radius structure energy curve. The texture clear radius band is determined based on the energy main peak and the energy drop inflection point. The outer contour transition radius band is obtained based on the outer priority scan. The radius second difference and three-line smoothing are performed in the texture clear radius band, and the texture angular signature is generated by taking the maximum absolute response of the radius.

[0009] Furthermore, within the outer contour transition radius zone, the maximum position of the radius difference amplitude is located for each angle sampling point, and the first-order radius difference with a sign is taken to generate the boundary angular signature. Cyclic correlation between the texture angular signature and the texture reference signature, as well as between the boundary angular signature and the boundary reference signature, are calculated by cyclic shifting point multiplication and summation. The shift amount corresponding to the maximum similarity is recorded as the boundary phase, and the texture phase is determined by the maximum similarity candidate set according to the boundary phase proximity principle.

[0010] Furthermore, based on the texture phase and boundary phase, the inter-frame texture phase increment and inter-frame boundary phase increment are calculated. The symmetrical wrap-around interval is used to eliminate the integer boundary jump. The incremental consistency criteria of consistent direction and consistent amplitude are constructed. The amplitude limit is taken as half of the main thread period. The continuous consistency is broken to determine the slip breakpoint and complete the phase stable segment division.

[0011] Furthermore, within the phase-stable segment, the segment step is selected based on the segment rotation direction and three-point median smoothing is performed. The segment's starting frame boundary phase is used as an anchor point to accumulate and generate a phase map, and an integer loop is performed. The polar coordinate annular detection area is cyclically translated along the angular direction according to the phase map to complete the angular alignment. The sharpness score is calculated within the texture clarity radius band and written into the segment circumferential unfolding map by selecting the best angle column.

[0012] Furthermore, the source frame number of the angle column is recorded in the circumferential unfolded image of the fragment. The column source consistency mask is constructed by comparing adjacent frames of the whole circle and the radius difference amplitude map and the angle difference amplitude map are generated. The transition ridge radius position is located in the texture clear radius zone within the effective angle column of the column source consistency mask and the transition intensity is calculated. The candidate points of the fracture edge are extracted based on the local peak-valley relationship between the transition ridge radius jump variable and the transition intensity consistency score.

[0013] Furthermore, the angular texture energy is obtained by accumulating the radius difference amplitude of the texture clear radius band within the effective angular column of the column source consistency mask. The period consistency score is calculated by combining the thread principal period and the low energy anomaly is suppressed by the energy protection rule. Based on the local peak-valley relationship between the period consistency score and the angular mutation intensity, texture mutation candidate points are extracted. The fracture edge candidate points and texture mutation candidate points are aggregated by angular connection to form a polar coordinate frame and the projection area is generated by phase mapping and inverse compensation.

[0014] Furthermore, the grayscale difference between adjacent radius sampling points is calculated within the radius of the projection area and accumulated along the radius to form an angular gradient curve. The angular gradient curve is filtered by local maxima and constrained by minimum spacing to obtain the tooth pitch anchor point sequence. The defect candidate center angle position is matched with the tooth pitch anchor point sequence to obtain the relative phase within the interval. The multi-frame stability statistics of the relative phase within the interval are used to obtain the tooth pitch anchoring recurrence index.

[0015] Furthermore, a radial grayscale profile is extracted along the angle position of the defect candidate center in the projection area. The radial grayscale profiles of the adjacent angle columns outside the defect candidate angle range form a detrended baseline. The radial grayscale profile is subtracted from the trend baseline to obtain the detrended profile. The detrended profile is subjected to radial difference and sign flipping to obtain the tooth profile transition sequence. The tooth profile transition sequence is paired with the local benchmark transition sequence and connected to the failure segment to obtain the tooth profile failure width. The tooth pitch anchorage recurrence index and the tooth profile failure width are input into logistic regression to obtain the true defect probability.

[0016] The technical effects and advantages of the parking nut defect recognition system based on image features of the present invention are as follows: 1. By using nut center positioning and polar coordinate ring detection area resampling, the thread entry texture is transformed into a continuous one-dimensional structure along the angle axis. Texture angular signature and boundary angular signature together generate texture phase and boundary phase. Combined with inter-frame incremental consistency, the slip breakpoint is located and a phase-stable segment is formed, so that the circumferential unfolded image of the segment still maintains angular alignment under slip and clamping disturbance conditions. Defect candidates obtain a more stable morphological presentation from the fracture edge and texture mutation, reducing structural drift interference caused by rotational instability.

[0017] 2. A column source consistency mask is introduced into the circumferential unfolded image of the fragment to suppress pseudo-mutations at the strip splicing boundary. Then, a polar coordinate box is formed by angular connectivity aggregation of candidate points of break edges and candidate points of texture mutations. The polar coordinate box is back-projected based on phase mapping to generate a back-projection region, realizing dual-domain consistent localization of the unfolded domain and the original image sequence. This makes the defect candidate have both the continuous observability of the unfolded domain and the traceable position mapping of the original domain, making the defect position output more reliable and easier to verify.

[0018] 3. Simultaneously calculate the tooth pitch anchoring reproduction index and the tooth profile damage width in the re-projection area. Use the thread pitch as a built-in scale to characterize the cross-frame reproduction stability of defect candidates. Use the radial tooth profile transition transition sequence to characterize the continuous scale of tooth profile structure damage. Input the two types of complementary evidence into logistic regression to obtain the true defect probability. It can distinguish between false changes in brightness fracture and true defects in tooth profile structure damage. The recognition results maintain consistent judgment logic under complex lighting and surface texture conditions. Attached Figure Description

[0019] Figure 1This is a schematic diagram of the structure of a parking nut defect recognition system based on image features according to the present invention. Detailed Implementation

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

[0021] Example 1: Figure 1 This invention provides a parking nut defect identification system based on image features, comprising: Center positioning module: Acquires image sequences of the parking nut clamping and rotating process, calculates the nut center based on the outer contour and inner hole boundary, and extracts the annular detection area where the thread inlet is located around the nut center and converts it into polar coordinates.

[0022] Phase extraction module: Generates two angular signatures in the polar coordinate annular detection area. One angular signature comes from the periodic light and dark texture formed by the thread profile, and the other angular signature comes from the directional change texture formed by the outer contour boundary. Calculate the corresponding phase for each frame's angular signature and record it as the texture phase and boundary phase.

[0023] Sliding segmentation module: Based on the inter-frame increment consistency of texture phase and boundary phase, the sliding breakpoint is located, and the image sequence is divided into phase-stable segments according to the sliding breakpoint. Within the segment, the segment phase median increment is used to generate phase mapping and complete angle alignment, and output the segment circumferential unfolded map.

[0024] Candidate re-projection module: Extracts fracture edges and texture abrupt change locations from the circumferential unfolded image of the fragment to form defect candidates, and the defect candidates are re-projected back to the original image sequence through phase mapping.

[0025] Probabilistic decision module: Calculates the tooth pitch anchorage recurrence index and tooth profile damage width in the re-projection area, outputs the true defect probability through logistic regression, and uses the true defect probability to screen out false candidates of misaligned joints, outputting the defect identification result and defect location mapping.

[0026] When the parking nut is clamped and rotated for shooting, the highlights and shadows on the nut surface change with the angle, and the brightness fluctuations are more obvious at the junction of the end face and the inner hole. The texture phase and boundary phase depend on the stability of the angular signature, which in turn depends on the stability of the ring detection area position. The stability of the ring detection area position depends on the stability of the nut center, which in turn depends on the reliability of the outer contour point set and the inner hole boundary point set. Therefore, the center positioning module revolves around contour extraction and center determination, and after the center is determined, the end face background area is located and the brightness is normalized to ensure that the sampling ring position of the same nut is consistent in different frames.

[0027] S101 edge candidate generation.

[0028] Edge candidate generation employs a gradient magnitude method that is sensitive to grayscale changes but relatively insensitive to brightness scales. For each grayscale image frame, the differences between adjacent pixels in the horizontal and vertical directions are calculated separately. Then, the squares of these differences are summed and the square root is taken to form a gradient magnitude map. The gradient magnitude map represents the intensity of local grayscale changes; the outer contour of the nut and the boundary of the inner hole appear as a continuous high-response band in the gradient magnitude map.

[0029] When converting the gradient magnitude map into an edge candidate map, a valley segmentation method based on the gradient magnitude histogram is used. Specifically, the gradient magnitude histogram is statistically analyzed. First, the main peak of the background is located. Then, the first obvious valley point after the main peak is searched along the direction of increasing magnitude. The valley point magnitude serves as the edge threshold. Positions with gradient magnitudes higher than the edge threshold are marked as edge candidate points, thus obtaining the edge candidate map.

[0030] The edge threshold is derived from the gradient distribution of each frame and can be automatically adjusted according to changes in reflectivity, so that the nut boundary remains consistent across different frames.

[0031] Extraction of S102 outer contour point set and inner hole boundary point set.

[0032] The extraction of the outer contour point set and the inner hole boundary point set starts from the edge candidate map and employs connected component tracing and closure screening. Boundary chains are extracted from each connected component in the edge candidate map, and these boundary chains are represented by a sequence of pixel coordinates. Closure determination uses a joint constraint of the distance between boundary chain endpoints and the number of broken boundary chain segments: connected components with a distance between boundary chain endpoints less than a preset proportion of the circumferential length of the boundary chain and a number of broken boundary chain segments not exceeding a preset upper limit are considered approximately closed boundaries.

[0033] The outer contour point set is selected from all approximately closed boundaries, choosing the one with the largest enclosing area. The outer contour point set consists of the pixel coordinates on this boundary chain. The inner hole boundary point set is selected from the approximately closed boundaries located within the outer contour area, choosing the one with the largest area. The inner hole boundary point set consists of the pixel coordinates on the corresponding boundary chain.

[0034] By using both area and location as filters, the outer contour point set and the inner hole boundary point set can remain stable even when there is reflection and background interference, thus avoiding mistaking the fixture edge or background texture for the nut contour.

[0035] S103 Nut Center Calculation.

[0036] The nut center calculation is based on elliptical fitting of the outer contour point set and the inner hole boundary point set, respectively, and robust point selection is achieved using the median of the residuals. The elliptical fitting employs a least-squares method, fitting the point set to a quadratic curve that satisfies the elliptical constraints, minimizing the overall algebraic error from all points to the fitted curve. After fitting, the geometric residual is calculated for each point in the point set. The geometric residual is defined as the normal distance from the point to the boundary of the fitted ellipse, expressed in pixel length.

[0037] Outlier removal employs residual mutation limits. Geometric residuals are sorted from smallest to largest. The difference between adjacent residuals is calculated. The point where the difference first exceeds a preset multiple of the median of the previous range of differences, and remains true for several consecutive adjacent differences, corresponds to the residual limit. Points whose residuals do not exceed the residual limit are retained, and ellipse fitting is performed again to obtain the center of the outer contour ellipse and the center of the switching inner hole ellipse.

[0038] The selection of the reliable center is based on the comparison of the median residuals. The median geometric residuals of the outer contour point set and the inner hole boundary point set under the final fitting are calculated separately. The side with the smaller median residual is considered to have a more reliable fit. When the distance between the center of the outer contour ellipse and the center of the inner hole ellipse is less than a preset proportion of the minor axis length of the outer contour ellipse, the nut center is taken as the midpoint of the two centers; when the distance between the center of the outer contour ellipse and the center of the inner hole ellipse exceeds a preset proportion of the minor axis length of the outer contour ellipse, the nut center is taken as the center of the ellipse with the smaller median geometric residual.

[0039] The nut center is directly constrained by the boundary point set, and when the two types of boundary qualities are different, the more reliable center source is automatically selected, and center drift is effectively suppressed.

[0040] S104 end face background area positioning and brightness normalization.

[0041] Brightness normalization is performed around the end-face background region, which is obtained by selecting the weakest structural area from the end-face annulus between the outer contour and the inner hole. First, an end-face annulus is formed with the nut center as the center, between the outer side of the inner hole boundary and the inner side of the outer contour. Then, the end-face annulus is divided into multiple thin annulus bands according to their radius. The structural energy of each thin annulus is calculated, defined as the average gradient amplitude within the thin annulus. The thin annulus with the lowest structural energy corresponds to the position with the least surface texture and farthest from the edge transition; this thin annulus is designated as the end-face background region.

[0042] The upper and lower bounds of grayscale in the background area of ​​the end face are determined by the inflection points of grayscale distribution. By statistically analyzing the grayscale histogram of the background area of ​​the end face, the main grayscale peak is first located, and then obvious inflection points after the main peak are searched for at the dark and bright ends respectively. The inflection points correspond to the transition of grayscale distribution from dense to sparse. The inflection point at the dark end is used as the lower bound of grayscale, and the inflection point at the bright end is used as the upper bound of grayscale.

[0043] Brightness normalization linearly stretches each frame of grayscale image, mapping the lower bound of grayscale to zero and the upper bound to one, truncating values ​​exceeding the range to zero or one. This process compresses the overall brightness drift caused by reflections across different frames to the same scale, maintaining a consistent relative contrast for the threaded entry texture.

[0044] S105 Annular Detection Region Determination and Polar Coordinate Annular Detection Region Generation.

[0045] The annular detection area is determined by the inflection points of the radial distance distribution between the inner hole boundary and the outer contour, avoiding the inclusion of edge transitions and strong reflections in the sampling. Using the nut center as a reference, the distance set from the inner hole boundary points to the nut center is calculated, with distances expressed in pixels. The distance set is sorted from smallest to largest, and the difference between adjacent distances is calculated. The locations where the difference changes abruptly correspond to abnormal points in the inner hole boundary affected by noise or gaps. The maximum distance before the change is taken as the inner radius limit. The distance set from the outer contour points to the nut center is obtained using the same method to obtain the outer radius limit, which is the minimum distance after the change, avoiding the highlight transitions at the outer contour edge. The annular detection area is formed by the inner and outer radius limits.

[0046] The polar coordinate ring detection region is generated using central polar coordinate resampling. The center of the nut is used as the origin of the polar coordinate system. Angles are sampled uniformly from zero to integers around the circumference, and the radius is sampled uniformly from the inner radius boundary to the outer radius boundary. Each polar coordinate sampling point corresponds to a non-integer coordinate position in the original image, and the grayscale value is obtained through bilinear interpolation. The interpolation results form a two-dimensional array, with the horizontal index representing the angle position and the vertical index representing the radius position, thus obtaining the polar coordinate ring detection region.

[0047] The ring detection region is constrained by geometric boundaries. The polar coordinate ring detection region converts the thread entry information into a continuous angular structure. When extracting angular signatures, it can directly converge along the angular direction. When calculating texture phase and boundary phase, it can directly compare along the angular direction.

[0048] After this step is completed, the outer contour point set and the inner hole boundary point set provide reliable geometric support, the nut center remains consistent in different frames, the end face background area is used for brightness normalization to make the grayscale scale of the same nut consistent in different frames, the annular detection area locks the effective texture near the thread inlet, the polar coordinate annular detection area forms an angular continuous sampling structure, and the angular signature can be stably generated within the same coordinate frame.

[0049] During the clamping and rotation process of the parking nut, the thread profile exhibits a stable periodic transition in the angular direction, while the inner side of the outer contour shows a stable boundary transition in the angular direction. The polar coordinate annular detection area unfolds the information near the thread inlet into angular coordinates, which is suitable for forming a one-dimensional angular signature. However, the thread texture is periodic, and the relevant matching may show multiple peaks. The outer contour boundary may also show local breaks under reflective interference. It is necessary to first separate the clear radius band of the thread inlet from the outer contour transition radius band, then stabilize the two types of angular signatures separately, and finally convert the angular signature into texture phase and boundary phase.

[0050] S201 radius difference amplitude construction.

[0051] Within the polar coordinate annular detection area, both the thread profile and the outer contour boundary exhibit a light-dark transition along the radial direction. The radius difference amplitude can highlight the transition position from the gradual brightness fluctuations. Each column of the polar coordinate annular detection area corresponds to an angle sampling point, and each row corresponds to a radius sampling point. For each angle sampling point, the grayscale difference between two adjacent radius sampling points is sequentially taken along the radial direction. The absolute value of the grayscale difference is used to obtain the radius difference amplitude map. The numerical unit of the radius difference amplitude map is consistent with the grayscale unit; a larger value indicates a more pronounced transition. The radius difference amplitude map is used for subsequent radius band positioning and angular signature convergence, continuously enhancing the transition area and continuously suppressing the flat area of ​​the end face.

[0052] S202 features clear texture and radius-based positioning.

[0053] The clear radius band at the thread inlet needs to cover the radius range where the thread profile transition is most concentrated, avoiding mixing the flat area of ​​the end face and the shaded area of ​​the inner hole into the angular signature. The radius difference amplitude map is summarized by radius row. Specifically, at the same radius sampling point, the radius difference amplitudes of all angle sampling points around the entire circumference are summed to obtain the radius structure energy curve. The radius structure energy curve contains a main peak, corresponding to the location where the thread profile transition is most concentrated. The location of the main peak is obtained by taking the maximum value from the radius structure energy curve.

[0054] The left and right boundaries of the main peak are determined by the energy drop inflection point. Along the main peak towards the inner hole, the energy difference between adjacent rows is compared row by row; the row with the largest absolute energy difference is designated as the inner boundary. Similarly, along the main peak towards the outer contour, the energy difference between adjacent rows is compared row by row; the row with the largest absolute energy difference is designated as the outer boundary. The continuous radius interval between the inner and outer boundaries is defined as the texture-clear radius band. The texture-clear radius band is determined by the energy abrupt change in the radius structure; the effective texture at the thread inlet is concentrated within this band, and the periodic texture is more stable upwards at the angle.

[0055] S203 texture angular signature generation.

[0056] The textured angular signature needs to reflect the periodicity of the tooth profile transition while suppressing slow brightness slopes and localized reflective bright spots on the apical face. Within the clear texture radius band, second-order difference enhancement is first performed in the radial direction. Specifically, at the same angular sampling point, three adjacent rows of grayscale are taken to form a second-order difference. The second-order difference equals the grayscale of the outer row minus twice the grayscale of the middle row, plus the grayscale of the inner row. The second-order difference result shows alternating positive and negative responses at the transition position between the tooth crest and floor, canceling out slow brightness changes. The second-order difference result is then smoothed by averaging the three rows in the radial direction. The smoothing uses the arithmetic mean of the second-order differences of the current row and the two adjacent rows to suppress particle noise.

[0057] Angular convergence employs the maximum absolute response in the radial direction. For each angular sampling point, all radial sampling points are scanned within the clear texture radius band, and the maximum value of the smoothed second-order difference absolute value is taken as the texture angular signature value at that angular sampling point. The texture angular signature yields a one-dimensional sequence arranged along the angular sampling points, with numerical units consistent with grayscale units. The maximum absolute response stably projects the strongest tooth profile transition position onto the angular direction. Local noise in the radial direction does not possess a continuous peak structure, making it difficult to form a stable period after projection, resulting in more concentrated texture-related peaks.

[0058] S204 Outer contour transition radius zone positioning and boundary angle signature generation.

[0059] The boundary angle signature needs to lock the inner transition of the outer contour to avoid being dominated by the periodic texture of the thread entry. The outer contour transition radius band positioning adopts an outer-priority strategy. The radius structure energy curve is scanned from one side of the outer contour towards the inner hole. The first significant peak encountered is taken as the main peak of the outer contour. The significant peak is defined as the inflection point where the energy changes from increasing to decreasing and the energy value is greater than the energy value of the adjacent inflection point. The left and right boundaries of the main peak of the outer contour are obtained using the energy drop inflection point method consistent with the texture clear radius band, thus obtaining the outer contour transition radius band.

[0060] The boundary angular signature generation consists of two steps: transition position localization and transition direction representation. Transition position localization is completed within the outer contour transition radius band. For each angular sampling point, the radius difference amplitude of the outer contour transition radius band is scanned, and the position with the largest radius difference amplitude is taken as the transition radius position. Transition direction representation uses a signed first-order radius difference. At the transition radius position, the grayscale value of the outer radius sampling point is subtracted from the grayscale value of the inner radius sampling point, retaining the sign of the difference, to obtain the boundary angular signature value at that angular sampling point. The boundary angular signature yields a one-dimensional sequence arranged along the angular sampling points, with numerical units consistent with grayscale units. The outer contour transition radius band is locked by an outer priority rule, and the boundary angular signature reflects the angular position and direction of the outer contour transition, significantly reducing multi-peak interference from the thread periodic texture.

[0061] The S205 cyclic correlation is used to obtain the texture phase and boundary phase and perform multi-peak disambiguation.

[0062] The texture reference signature is taken from the texture angular signature of the first frame of the image sequence, and the boundary reference signature is taken from the boundary angular signature of the first frame of the image sequence. For any frame, the cyclic correlation between the texture angular signature and the texture reference signature, and the cyclic correlation between the boundary angular signature and the boundary reference signature are calculated respectively. The cyclic correlation operation uses cyclic shifting plus dot product summation. Cyclic shifting refers to shifting the entire one-dimensional sequence in the same direction by several angular sampling points, with elements beyond the end of the sequence wrapping back to the beginning position. Dot product summation refers to multiplying the two sequences at the same angular sampling point position and accumulating them over an integer range of angular sampling points. The result of cyclic correlation is a set of similarity sequences corresponding to the shift amount; the higher the similarity value, the more aligned the two sequences are under that shift amount.

[0063] The texture phase is determined by the shift value corresponding to the maximum value of the texture cyclic correlation similarity sequence, and the boundary phase is determined by the shift value corresponding to the maximum value of the boundary cyclic correlation similarity sequence. The unit of the shift value is angular sampling points. Periodic textures may have multiple maximum shift values, and multi-peak disambiguation adopts the boundary phase proximity principle. After the boundary phase is determined, all shift values ​​that achieve the maximum similarity in texture cyclic correlation are formed into a candidate set. The angular cyclic distance between each candidate shift value and the boundary phase is calculated. The angular cyclic distance refers to the shorter wraparound distance of the difference between two shift values ​​within an integer cycle, and the unit of the angular cyclic distance is angular sampling points. The candidate shift value with the smallest angular cyclic distance is determined as the texture phase. The texture phase and the boundary phase jointly record the angular alignment relationship of each frame. The texture phase is affected by the tooth pattern period, and the boundary phase is affected by the outer contour constraint. The combination of the two compresses multi-peak matching into a single stable shift value.

[0064] This step outputs the texture angular signature, boundary angular signature, texture phase, and boundary phase. The clear texture radius band and the outer contour transition radius band are located by the radius structure energy inflection point and separated by the outer priority rule. The texture angular signature and the boundary angular signature express the thread profile transition and the outer contour transition, respectively. Cyclic correlation converts the angular signature into a phase sequence. Multi-peak disambiguation uses the proximity principle of the boundary phase. The brightness fluctuations and texture periodic interference caused by the rotation of the parking nut during shooting are effectively suppressed in the phase calculation stage.

[0065] After the parking nut completes the phase extraction module, the texture phase and boundary phase are recorded frame by frame. During the normal clamping and rotation phase, the texture phase and boundary phase change in the same direction and with similar amplitudes. When micro-slippage occurs during clamping, the texture phase and boundary phase will continuously separate for a short period of time. This separation manifests as both opposite directions and a sudden increase in amplitude. However, single-frame illumination fluctuations and multi-peak texture periods can also cause occasional errors. The slip segmentation module focuses on the disruption of continuous consistency and corrects texture ambiguities using boundary constraints within stable segments. Then, it generates phase mappings to achieve angle alignment and segment circumferential unfolding.

[0066] Calculation of wraparound of S301 texture phase increment and boundary phase increment.

[0067] Texture phase and boundary phase are derived from cyclically related shifts, counted in angular sampling points, with an integer cycle corresponding to the angular sampling length. Direct subtraction encounters integer cycle wraparound boundaries, causing the phase difference between adjacent frames to jump from a small step to a large jump approaching an integer cycle. To avoid this jump, inter-frame texture phase increments and inter-frame boundary phase increments are represented using symmetrical wraparound intervals. The calculation process first performs direct subtraction of the phases of adjacent frames to obtain an initial difference, then checks whether the initial difference exceeds half of the angular sampling length. If the initial difference exceeds half of the angular sampling length, the angular sampling length is subtracted from the initial difference; if the initial difference is less than half of the negative angular sampling length, the angular sampling length is added to the initial difference; otherwise, the initial difference remains unchanged. After processing, both inter-frame texture phase increments and inter-frame boundary phase increments fall within the interval between the negative and positive half cycles, and their direction and amplitude can be directly compared under the same dimensions. Phase differences crossing integer cycle boundaries will no longer be disguised as slippage.

[0068] S302 Incremental Consistency Criterion and Slip Breakpoint Location.

[0069] When the clamping state is stable, the texture phase increment and the boundary phase increment describe the same rotational step, with consistent direction and similar amplitude. During slight clamping slippage, they continuously separate. To accurately determine the separation based on a computable criterion, the consistency criterion consists of two parts: directional consistency and amplitude consistency. Directional consistency is determined by the sign of the increment: a positive texture phase increment indicates a positive direction, and a negative increment indicates a negative direction; the boundary phase increment is treated similarly. Amplitude consistency is determined by the absolute difference between the two increments, counted in angular sampling points. The amplitude limit is half the main thread period, which is taken from the autocorrelation peak spacing of the texture angular signature, both in angular sampling points.

[0070] The consistency violation flag is valid when any one of the conditions is met. The flag is valid when the directions are inconsistent, and valid when the absolute value of the difference is not less than the amplitude limit. Slip breaks are not triggered by single-frame flags; they are triggered by continuous consistency violations. Continuous consistency violations are triggered by the simultaneous validity of two adjacent consistency violation flags, and the slip break point is determined by the starting frame number of the trigger segment. Continuous triggering compresses occasional peak errors within a single frame, and slip breaks more closely match the continuous characteristics of clamping micro-slips.

[0071] S303 Phase Stable Segment Division and Phase Mapping Generation.

[0072] The sliding breakpoint divides the image sequence into multiple phase-stable segments. Each phase-stable segment covers the frame number interval between two sliding breakpoints, with the starting segment beginning at the first frame of the sequence and the ending segment ending at the last frame. Periodic ambiguity in texture phase increments may still exist within a segment. Boundary phase increments are more stable due to constraints from the outer contour; therefore, a consistent direction is prioritized when selecting segment steps within a segment. The segment step selection process first determines the segment rotation direction, which is largely determined by the direction of the boundary phase increments within the segment. After determining the direction, for each frame within the segment, the texture phase increment is used when its direction aligns with the segment rotation direction; otherwise, the boundary phase increment is used.

[0073] To suppress pulse-type jitter within segments, the segment stepping is further smoothed using three-point median smoothing. Three-point median smoothing takes the median value of the segment stepping over three consecutive frames as the smoothing stepping value for the current frame, and uses adjacent two points to fill in the boundaries.

[0074] Phase mapping is established with the segment's starting frame as the anchor point, which is the boundary phase of the segment's starting frame. Then, it is accumulated frame by frame with a smooth step. When the accumulated result exceeds the integer range, a wraparound process is performed, which involves subtracting or adding the angular sampling length to bring the result within the integer count range. Phase mapping within a segment remains continuous in both direction and amplitude, while phase mapping between segments is isolated by slip breaks.

[0075] S304 Angle Alignment and Fragment Circumferential Unfolding Generation.

[0076] In the polar coordinate annular detection region, each column corresponds to an angle sampling point, and each row corresponds to a radius sampling point. Angle alignment is achieved through cyclic translation using the angle index. For each frame, the phase mapping is considered as the angle translation amount, and the polar coordinate annular detection region is translated as a whole along the angular direction by the phase mapping angle sampling points. During the translation, columns exceeding the end of the angular sampling length wrap back to the starting position, with the wrap-back rule using the angle index exceeding the limit and continuing counting from the first column. After the translation is complete, the tooth-shaped texture is aligned angularly upwards, and the outer contour transition is aligned angularly upwards.

[0077] The fragment circumferential unfolded map selects the frame column with the best sharpness according to the angle column to avoid splicing blur. The sharpness score is calculated within the texture sharpness radius band. The calculation process is as follows: for each frame and each angle column, the absolute value of the grayscale difference between two adjacent rows is calculated row by row along the radial direction of the texture sharpness radius band and accumulated. The accumulated value is used as the sharpness score of that frame and that angle column. For each angle sampling point, the frame with the highest sharpness score is selected, and the entire column radius data of the corresponding frame is written into the fragment circumferential unfolded map. Sharpness comes from the tooth profile transition intensity. Blurring of the transition caused by reflection will reduce the score. The unfolded result is smoother at the angular joints, and the texture continuity of the thread inlet is stronger.

[0078] After this step, the texture phase and boundary phase are symmetrically wrapped to obtain the inter-frame texture phase increment and inter-frame boundary phase increment. The consistency criterion unifies direction separation and amplitude separation to a consistency violation marker. Continuous consistency violation determines the slip breakpoint. The slip breakpoint divides the image sequence into phase-stable segments. Within each segment, a phase mapping is generated using consistent direction priority and three-point median smoothing. The polar coordinate annular detection region is angularly aligned according to the phase mapping. The circumferential unfolded map of the segment is formed by selectively writing the sharpness score, resulting in more stable angular continuity of the unfolded map.

[0079] The circumferential unfolded image of a fragment expands the thread entry texture to the angular direction, making it easier for fracture edges and texture abrupt changes to appear as continuous patterns on the unfolded image. The circumferential unfolded image is formed by selectively writing sharpness scores. The source frame number of the angle column switches along the angular direction, and the switching position forms the splicing boundary, which also exhibits gradient abrupt changes. To concentrate defect candidates on thread profile anomalies rather than splicing boundaries, the candidate re-projection module first constructs a column source consistency mask using the source frame number of the angle column, then extracts fracture edge candidate points and texture abrupt change candidate points on the angle columns allowed by the mask, forming defect candidates, and generates a re-projection region based on phase mapping.

[0080] S401 Column Source Consistency Mask Construction and Differential Graph Generation.

[0081] The source frame number of each angle column records which frame within the segment each angle column originates from. Changes in the source frame number between adjacent angle columns form the stitching boundary. Gradient changes at the stitching boundary originate from subtle differences in brightness between frames and minor geometric jitter, easily misjudged by broken edges and abrupt texture changes. The column source consistency mask is constructed based on the adjacency relationship of integer cycles. The source frame numbers of adjacent angle columns are compared sequentially along the angular direction. Unequal positions are marked as stitching boundary angle columns. The starting and ending angle columns of the integer cycle are also included in the adjacency comparison. The left and right adjacent angle columns of the stitching boundary angle column are simultaneously marked as invalid angle columns to prevent gradual transitions on both sides of the stitching boundary from entering the candidate extraction.

[0082] The difference map is used to convert thread profile transitions and angular abrupt changes into intensity distributions. The radius difference amplitude map is generated by subtracting the grayscale values ​​of adjacent radius sampling points within the same angle column and taking the absolute value, calculating row by row along the radius direction to obtain the radius difference amplitude map. The angle difference amplitude map is generated by subtracting the grayscale values ​​of adjacent angle columns within the same radius row and taking the absolute value, calculating column by column along the angle direction to obtain the angle difference amplitude map. The radius difference amplitude map highlights the transition between the thread crest and root, while the angle difference amplitude map highlights angular joints and abrupt changes in defects. Combined with a column-source consistency mask, the influence of splicing boundaries can be compressed into the range of mask-ineffective angle columns.

[0083] S402 fracture edge candidate point extraction.

[0084] The thread profile forms a continuous transition ridge in the circumferential unfolded image of the segment, with the transition ridge being most prominent within the clearly textured radius band. Defects cause interruptions and jumps in the transition ridge in the angular direction, with these jumps accompanied by inconsistencies in transition intensity between adjacent angular columns. Candidate points for fracture edges are extracted by unfolding the sequence of transition ridge radius positions and transition intensity sequences, both derived from the radius difference magnitude map and maintaining dimensional consistency.

[0085] The transition ridge radius position sequence is calculated as follows: within each effective angle column, the radius difference amplitude is scanned only within the texture-clear radius band, and the radius sampling point with the largest radius difference amplitude is found. This radius sampling point is taken as the transition ridge radius position. The transition intensity sequence is calculated as follows: within the same angle column, the maximum radius difference amplitude within the texture-clear radius band is taken as the transition intensity.

[0086] The jump variable is calculated by subtracting the radii of the transition ridges of adjacent angle columns and taking the absolute value, thus obtaining the radius jump variable of the transition ridge in the angular direction. The transition strength consistency score is calculated by dividing the smaller value of the transition strength of adjacent angle columns by the larger value, resulting in a score between zero and one. The lower the score, the more significant the difference in transition strength between adjacent angle columns.

[0087] The determination of fracture edge candidate points adopts a local peak-valley combination and is constrained by the column source consistency mask. A local peak-valley combination means that the jump variable in the current angle column is simultaneously not less than the jump variables of the left and right adjacent angle columns, and the transition strength consistency score in the current angle column is simultaneously not greater than the transition strength consistency scores of the left and right adjacent angle columns. The left and right adjacent relationships are determined by full-cycle wrapping, with the starting angle column and the ending angle column of the full cycle being adjacent to each other. Angle columns with invalid column source consistency masks are not included in the determination. Fracture edge candidate points are recorded together with the angle column index and the transition ridge radius position. The connected segments of fracture edge candidate points in the angle direction form fracture edge candidate chain segments. These candidate chain segments are consistent with the spatial morphology of thread tooth fracture, significantly reducing the probability of false detection.

[0088] Extraction of candidate points for texture mutation in S403.

[0089] The texture at the thread inlet exhibits stable repeatability along the angular direction. Defects disrupt this local repeatability and introduce abrupt changes in the angular direction. Simply relying on the angular difference amplitude can easily lead to misinterpreting localized reflections and minor scratches as abrupt changes. Therefore, the extraction of candidate points for texture abrupt changes combines periodic consistency with the intensity of angular abrupt changes. Periodic consistency is used to filter out normal periodic fluctuations, while the intensity of angular abrupt changes is used to locate the angle of abrupt changes.

[0090] The angular texture energy sequence is calculated by cumulatively summing the radius difference amplitude values ​​within the clear texture radius band of each angular column, and the cumulative value is used as the angular texture energy. The angular texture energy and the radius difference amplitude values ​​are of the same origin, reflecting the overall intensity of the tooth profile transition.

[0091] The periodicity consistency score is calculated by performing local correlation calculations on the angular texture energy sequence along the angular direction, using the thread principal period as the shift step. The local correlation calculation is performed within an angular window of one thread principal period length. The angular texture energy of each angular column within the window is multiplied by the angular texture energy shifted forward by one thread principal period within the window, and these products are accumulated to obtain the correlation accumulation value. To avoid the correlation accumulation value being amplified by the overall energy increase, the local energy accumulation value is calculated simultaneously. The local energy accumulation value is the sum of the squares of the angular texture energy within the same window. The periodicity consistency score is obtained by dividing the correlation accumulation value by the local energy accumulation value.

[0092] When the accumulated local energy value approaches zero, the periodicity score loses its interpretability. Therefore, an energy protection rule is introduced. The energy protection rule uses the maximum value of the texture energy in the inner corner of the window as the criterion. When the maximum value is lower than the median value of the texture energy in the inner corner of the window, the periodicity score is directly set to zero to prevent low-energy columns from generating artificially high scores.

[0093] The angular mutation intensity is calculated by subtracting the angular texture energy of adjacent angle columns and taking the absolute value. The determination of texture mutation candidate points uses local peak-valley combinations and is constrained by the column source consistency mask. A local peak-valley combination means that the periodic consistency score in the current angle column is simultaneously not greater than that of the left and right adjacent angle columns, and the angular mutation intensity in the current angle column is simultaneously not less than that of the left and right adjacent angle columns. The left and right adjacent relationships are determined by full-cycle wrapping. Angle columns with invalid column source consistency masks are not included in the determination. Texture mutation candidate points are recorded using both the angle column index and the transition ridge radius position. The periodic consistency score uses the repeatability of normal threads as a reference, and the angular mutation intensity converges the mutation angle to the local peak position, making the candidate points more closely resemble the local periodic damage characteristics of real defects.

[0094] S404 Defect Candidate Formation and Polar Coordinate Frame Representation.

[0095] Fracture edge candidate points reflect geometric continuity disruption, while texture abrupt change candidate points reflect repetitive disruption. These two types of candidate points often appear adjacent or overlap in the angular direction at the actual defect location. To maintain a consistent detection window and avoid candidate point discrepancies during re-projection, defect candidates are represented by polar coordinate frames constructed from angular and radial ranges.

[0096] Defect candidate formation employs angular connectivity aggregation. Angular connectivity aggregation merges fracture edge candidate points and texture abrupt change candidate points into an angular binary sequence along the angular direction. The angular binary sequence is considered valid if any type of candidate point exists in a given angle column. Connectivity segment extraction is performed on the angular binary sequence, with the start and end angle columns of the connected segments forming the angle range. Connectivity segment extraction uses a integer loop rule: when both the integer start angle column and the integer end angle column are valid, the two connected segments are merged into one connected segment, avoiding splitting a single defect crossing an integer boundary into two parts.

[0097] The radius range is determined by taking the minimum and maximum values ​​of the transition ridge radius positions from the set of angle columns covered by the connected segments, serving as the lower and upper bounds of the radius range, respectively. To cover the tooth-like structures on both sides of the transition ridge, the lower bound of the radius range is extended inwards by one radius sampling interval, and the upper bound is extended outwards by one radius sampling interval, falling within the radius range of the annular detection area after expansion. The center angle column of the defect candidate is taken from the midpoint angle column of the angle range, and the midpoint of the center angle column is calculated based on the shortest angular distance when crossing the integer boundary. The polar coordinate frame transforms the defect candidate from a point-like description to a region description, resulting in stable constraints on the angle and radius windows of the projection area, and higher consistency in cross-frame positioning of the defect candidate.

[0098] S405 defect candidate return area generation.

[0099] The circumferential unfolded image of the fragment is located in angle-aligned coordinates, while the polar coordinate annular detection region is located in the original angle coordinates. Angle alignment is achieved through phase mapping in the sliding segmentation module. Angle alignment cyclically shifts the polar coordinate annular detection region along the angular direction by a phase mapping of angle sampling points. Therefore, the re-projection uses inverse compensation of phase mapping, adding the angle range of the aligned coordinates back to the angle translation amount corresponding to the phase mapping.

[0100] The calculation method for the rewind angle range is as follows: the phase mapping value of the current frame is added to the lower and upper bounds of the angle range of the defect candidate, respectively, to obtain the original lower and upper bounds of the angle range. The original angle range needs to fall within the integer angular sampling length range, therefore, angle index wrapping processing is performed. The angle index wrapping processing is implemented using an integer quotient and remainder method. The angle index is divided by the angular sampling length to obtain an integer quotient, and then the angle index is subtracted from the angular sampling length multiplied by the integer quotient to obtain the remainder. The remainder is used as the wrapped angle index. When the angle index is negative, the angular sampling length is added to the angle index until it is non-negative, and then the integer quotient and remainder processing is performed to ensure that the wrapping result falls within the valid index range.

[0101] When the original angle range crosses the integer boundary, the lower bound of the original angle range will be greater than the upper bound. In this case, the original angle range is divided into two angle intervals: one from the lower bound of the original angle range to the end of the integer end angle column, and the other from the beginning of the integer end angle column to the upper bound of the original angle range. The two angle intervals together constitute the rewind angle range.

[0102] The re-projection region is defined in each frame by both a radius range and a re-projection angle range. The radius range remains unchanged, using the radius range of the defect candidate. The re-projection angle range uses either the original angle range calculated in the current frame or the two segmented angle intervals. The re-projection region maintains polar coordinates, reducing interpolation errors caused by coordinate back-and-forth movements. This results in more consistent spatial and temporal relationships between defect candidates in the original image sequence.

[0103] After this step is completed, the column source consistency mask excludes the splicing boundary angle column from the candidate extraction entry. The fracture edge candidate points are determined by the transition ridge radius jump and the transition intensity consistency decrease. The texture mutation candidate points are determined by the period consistency score decrease and the angular mutation intensity increase. The defect candidate is represented by polar coordinate box through angular connectivity aggregation. The defect candidate generates the projection region by phase mapping inverse compensation and splits the angular interval at the integer boundary. The stability and reproducibility of defect candidate localization are enhanced.

[0104] The re-projection area has mapped defect candidates back to the polar coordinate ring detection area, which covers the same thread entry structure across multiple frames. Real defects often recur at the thread pitch position, forming continuous missing transitions or abnormal transition spacing in the radial tooth profile transition. Splicing residue and reflective disturbances are more likely to manifest as brightness breaks, with their positions drifting on the pitch scale, while the radial transition structure remains nearly normal. However, these two phenomena are easily confused in a single frame. The probabilistic decision module incorporates cross-frame stability and radial structure damage into the calculation simultaneously, forming an interpretable judgment criterion.

[0105] S501 tooth spacing anchor point sequence extraction.

[0106] The thread crest transition exhibits a stable radial grayscale abrupt change in the polar coordinate annular detection region. This radial grayscale abrupt change repeats along the angular direction, serving as a pitch scale. The re-projection region covers the radius near the thread inlet. Within this radius, the absolute value of the grayscale difference between adjacent radius sampling points is calculated along the radial direction to obtain the radial difference amplitude distribution. For each angular sampling point, the radial difference amplitude within the re-projection region's radius is accumulated row by row to form an angular gradient curve. The angular gradient curve undergoes local maximum screening, where a local maximum satisfies the condition that the curve value of the current angular sampling point is not less than the curve values ​​of the left and right adjacent angular sampling points in the sense of a complete circumference. The local maximum angular sampling points are used as candidate crest angle points, and a minimum spacing constraint is set based on the thread's main period. Candidate points with insufficient minimum spacing are discarded according to peak height from low to high, retaining the peak point sequence after angle sorting as the pitch anchor point sequence. The pitch anchor point sequence converts the thread pitch into an angular sampling point sequence, providing a unified scale for cross-frame position comparisons within the re-projection region.

[0107] S502 Tooth Pitch Anchoring Reproducibility Index Calculation.

[0108] Each frame corresponds to a central angular position for the defect candidate polar bounding box. When the central angular position falls between adjacent anchor points in the tooth pitch anchor point sequence, the relative position within the interval characterizes the degree of binding between the defect candidate and the tooth pitch structure. Adjacent anchor point pairs are searched in the tooth pitch anchor point sequence around the central angular position. The selection of adjacent anchor point pairs is based on the angular distance around the center angular position, prioritizing the pair with the shortest angular distance to the center angular position. The tooth pitch interval length is defined as the angular distance between two anchor points, ensuring that the tooth pitch interval length is always positive. The relative phase within the interval is obtained by dividing the angular distance from the center angular position to the previous anchor point by the tooth pitch interval length, and the relative phase is within the range of zero to one.

[0109] To suppress relative phase jitter caused by anchor point positioning jitter, peak width is used to generate the allowable bandwidth. Peak width is obtained by measuring the angle span of the angular gradient curve as it decreases to a fixed percentage of peak height at the anchor point. The peak width is then proportional to the tooth pitch interval length to obtain the allowable bandwidth. The median value of the relative phase across multiple frames is used as the reproduction benchmark. Frames whose relative phase deviates from the reproduction benchmark by no more than the allowable bandwidth are designated as consistent reproduction frames. The number of consistent reproduction frames divided by the number of frames included in the statistics yields the tooth pitch anchoring reproduction index. The tooth pitch anchoring reproduction index compresses cross-frame drift into a proportional change, and the stability of candidate positions is directly quantified on the tooth pitch scale.

[0110] Extraction of the transition sequence from the S503 tooth profile.

[0111] Real defects are more likely to alter the radial transition structure from the tooth crest to the tooth floor, and missing or offset transition points are more noticeable on the radial grayscale profile. The re-projected area provides a radial grayscale profile corresponding to the center angle position in each frame. The radial grayscale profile is directly affected by the slow brightness slope of the end face and local reflections, so it is necessary to first remove the trend and then locate the transition.

[0112] Radial grayscale profiles are extracted along the central angle position in each frame. Simultaneously, multiple radial grayscale profiles are extracted from adjacent angle columns on both sides outside the defect candidate angle range. The median line is taken point-by-point according to the radius position of the radial grayscale profiles of the adjacent angle columns to form a detrended baseline. Angle columns with obvious reflections are excluded using the extreme value elimination rule of the median line to ensure that the detrended baseline represents the normal tooth profile background. The detrended profile is obtained by subtracting the trend baseline from the radial grayscale profile.

[0113] The detrended profile calculates the difference between adjacent sampling points along the radial direction to form a radial gradient sequence. This radial gradient sequence is then smoothed using a short window with a fixed mean. The window covers the center point and an equal number of adjacent sampling points on its left and right. The window length is a preset odd number to suppress sign jitter caused by particle noise. Turning point location uses a sign-flipping rule; the position where two adjacent points in the radial gradient sequence have opposite signs is recorded as the turning point radius. The tooth profile turning sequence is obtained by sorting the radii from smallest to largest. This tooth profile turning sequence fixes the geometric framework of the tooth profile transition, weakening the overall brightness fluctuations through detrending and smoothing, resulting in more stable turning point location.

[0114] Calculation of the failure width of the tooth profile in S504.

[0115] Structural damage caused by defects typically manifests as missing transitions or abnormal transition spacing within a continuous radius. The length of this continuous radius characterizes the degree of damage. Single-point noise is more likely to cause isolated transition drift and is less likely to form continuous damage segments. Therefore, the damage width is matched by a reference transition scale constraint, and the damage markers are connected using continuity rules.

[0116] In each frame, tooth profile transition sequences are extracted from adjacent angle columns on both sides of the center angle position. After merging, they are sorted by radius to form a local reference transition sequence. The median value of the distance between adjacent transitions in the local reference transition sequence is calculated as the reference distance, and the median absolute deviation of the distance between adjacent transitions is calculated as the reference jitter. The pairing allowable distance is determined by the reference distance and the reference jitter. The allowable distance increases with the increase of the reference jitter to ensure that micro-jitter in the machining texture is not misjudged as a transition defect.

[0117] The tooth profile transition sequence at the center angle position is paired with the local reference transition sequence using nearest neighbor matching. Nearest neighbor matching is based on the minimum radius distance; a radius distance exceeding the allowable pairing distance is considered a pairing failure. The failed pairing radius positions and abnormal transition spacing positions at the center angle position are merged into a destruction marker sequence. Abnormal transition spacing positions refer to locations where adjacent transition spacings exceed the upper limit of the reference spacing, which is determined by both the reference spacing and reference jitter. The destruction marker sequence is segmented along the radial direction. When the radius interval between adjacent destruction markers is less than the upper limit of the reference spacing, they are connected as the same destruction segment. The difference in radius positions between the two ends of the destruction segment is defined as the single-frame destruction width. The multi-frame destruction width is taken as the median value of the single-frame destruction width, thus obtaining the tooth profile destruction width. The tooth profile destruction width compresses scattered anomalies into continuous segment lengths, significantly reducing inter-frame jumps and improving the interpretability of the indicators.

[0118] S505 True Defect Probability Calculation and Defect Identification Output.

[0119] The tooth pitch anchorage recurrence index reflects the recurrence stability of defect candidates on the tooth pitch scale, while the tooth profile destruction width reflects the radial continuity of tooth structure destruction; these two pieces of evidence are complementary. Logistic regression maps these two pieces of evidence to true defect probabilities ranging from zero to one, providing a uniform scale for easy screening and ranking.

[0120] In the online phase, the tooth pitch anchorage recurrence index and the tooth profile destruction width are calculated for each defect candidate. To reduce numerical bias caused by dimensional differences, the tooth profile destruction width undergoes monotonic compression mapping before entering logistic regression. The compression mapping uses a logarithmic form to maintain the magnitude relationship and suppress extreme values. The logistic regression linear score is obtained by adding three parts: a constant term, the tooth pitch anchorage recurrence index multiplied by the corresponding coefficient, and the compressed tooth profile destruction width multiplied by the corresponding coefficient. The linear score is then subjected to exponential mapping and normalization to obtain the true defect probability. The logistic regression coefficients are determined and fixed in the offline phase using the maximum likelihood criterion from the labeled samples. The true defect probability is compared with the judgment boundary one by one. Defect candidates with a true defect probability not lower than the judgment boundary are retained and labeled as defect identification results, while defect candidates with a true defect probability lower than the judgment boundary are discarded. Polar coordinate bounding boxes are output for the retained defect candidates, and the angle range and radius range of the corresponding projection area are output in each frame to form a defect location mapping. The two types of evidence are uniformly expressed in the probability space, the candidate selection rules are consistent, and the output results are easy to verify.

[0121] The probabilistic decision module constructs two types of complementary evidence within the replay area. The thread pitch anchor sequence converts the thread pitch into an angular scale, and the thread pitch anchor recurrence index characterizes the stable cross-frame reproduction of defect candidates on the scale. The radial grayscale profile establishes a detrended baseline outside the defect candidate angular range, and the thread profile transition sequence locates the thread profile transition skeleton through sign flipping. The thread profile failure width is paired with the reference spacing and reference jitter constraint, and the failure segments are connected to obtain a stable scale. Logistic regression maps the two pieces of evidence to the true defect probability, achieving consistent output between the defect identification result and the defect location mapping.

[0122] Specifically, the above are merely preferred embodiments of this application and are not intended to limit this application.

[0123] In the description of this specification, references to terms such as "an embodiment," "example," and "specific example" indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of the invention. In this specification, illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.

[0124] The preferred embodiments of the present invention disclosed above are merely illustrative of the invention. These preferred embodiments do not exhaustively describe all details, nor do they limit the invention to any specific implementation. Clearly, many modifications and variations can be made based on the content of this specification. This specification selects and specifically describes these embodiments to better explain the principles and practical applications of the invention, thereby enabling those skilled in the art to better understand and utilize the invention. The invention is limited only by the claims and their full scope and equivalents.

Claims

1. A parking nut defect recognition system based on image features, characterized in that, include: Center positioning module: Acquires image sequences of the parking nut clamping and rotating process, calculates the nut center based on the outer contour and inner hole boundary, and extracts the annular detection area where the thread inlet is located around the nut center and converts it into polar coordinates; Phase extraction module: Generates two angular signatures in the polar coordinate annular detection area. One angular signature comes from the periodic light and dark texture formed by the thread profile, and the other angular signature comes from the directional change texture formed by the outer contour boundary. Calculate the corresponding phase for each frame's angular signature and record it as the texture phase and boundary phase. Sliding segmentation module: Based on the inter-frame increment consistency of texture phase and boundary phase, the sliding breakpoint is located, and the image sequence is divided into phase-stable segments according to the sliding breakpoint. Within the segment, the segment phase median increment is used to generate phase mapping and complete angle alignment, and the segment circumferential unfolding map is output. Candidate re-projection module: Extracts fracture edges and texture abrupt change locations from the circumferential unfolded image of the fragment to form defect candidates, and the defect candidates are re-projected back to the original image sequence through phase mapping; Probabilistic Decision Module: Within the radius of the re-projection area, the grayscale difference between adjacent radius sampling points is calculated and accumulated along the radius to form an angular gradient curve. The angular gradient curve is filtered by local maxima and constrained by minimum spacing to obtain the tooth pitch anchor point sequence. The angular position of the defect candidate center is matched with the tooth pitch anchor point sequence to obtain the relative phase within the interval. The multi-frame stability statistics of the relative phase within the interval are used to obtain the tooth pitch anchoring recurrence index. The tooth profile damage width is calculated in the re-projection area. Logistic regression is used to output the true defect probability. The true defect probability is used to filter out false candidates of misaligned joints and output the defect identification result and defect position mapping.

2. The parking nut defect recognition system based on image features according to claim 1, characterized in that, The central positioning module is used for: Image sequences of the parking nut clamping and rotating process are acquired. The gradient magnitude of each frame is calculated, and the edge threshold is determined according to the valley point of the histogram to generate edge candidate images. After closure and area screening, the outer contour point set and the inner hole boundary point set are obtained. Ellipse fitting is performed on each, and outliers are removed according to residual mutation to obtain the outer contour ellipse center and the inner hole ellipse center. The nut center is selected according to the median of the residual. The brightness normalization is completed in the background area of ​​the end face between the outer contour and the inner hole around the nut center. The annular detection area is determined according to the distance distribution mutation and the polar coordinate annular detection area is generated.

3. The parking nut defect recognition system based on image features according to claim 2, characterized in that, The phase extraction module is used for: Calculate the radius difference amplitude map in the polar coordinate annular detection area. Summarize the radius difference amplitude map by radius row to form the radius structure energy curve. Determine the texture clear radius band based on the main energy peak and the energy drop inflection point. Obtain the outer contour transition radius band based on the outer priority scan. Perform second-order radius difference and three-line smoothing within the texture clear radius band and take the maximum absolute response of the radius to generate the texture angular signature.

4. The parking nut defect recognition system based on image features according to claim 3, characterized in that, The phase extraction module is also used for: Within the outer contour transition radius zone, locate the position with the maximum radius difference amplitude for each angle sampling point and generate the boundary angular signature by taking the first-order radius difference with a sign. Use cyclic shift point multiplication and summation to calculate the cyclic correlation between the texture angular signature and the texture reference signature, as well as the cyclic correlation between the boundary angular signature and the boundary reference signature. The shift amount corresponding to the maximum similarity is recorded as the boundary phase. The texture phase is determined by the maximum similarity candidate set according to the boundary phase proximity principle.

5. The parking nut defect identification system based on image features according to claim 4, characterized in that, The sliding segmentation module is used for: Based on the texture phase and boundary phase, the inter-frame texture phase increment and inter-frame boundary phase increment are calculated. The symmetrical wrap-around interval is used to eliminate the integer boundary jump. The incremental consistency criteria of consistent direction and consistent amplitude are constructed. The amplitude limit is taken as half of the main thread period. The continuous consistency is broken to determine the slip breakpoint and complete the phase stable segment division.

6. The parking nut defect identification system based on image features according to claim 5, characterized in that, The sliding segmentation module is also used for: Within the phase-stable segment, the segment step is selected according to the segment rotation direction and three-point median smoothing is performed. The segment's starting frame boundary phase is used as the anchor point to accumulate and generate a phase map, and an integer loop is performed. The polar coordinate annular detection area is cyclically translated along the angular direction according to the phase map to complete the angular alignment. The sharpness score is calculated within the texture clarity radius band and written into the segment circumferential unfolding map by selecting the best angle column.

7. A parking nut defect identification system based on image features according to claim 6, characterized in that, The candidate return module is used for: Record the source frame number of the angle column in the circumferential unfolded image of the fragment. Construct a column source consistency mask by comparing adjacent frames of the whole circle and generate a radius difference amplitude map and an angle difference amplitude map. Locate the transition ridge radius position within the texture clear radius band in the effective angle column of the column source consistency mask and calculate the transition intensity. Extract candidate points of the fracture edge based on the local peak-valley relationship between the transition ridge radius jump variable and the transition intensity consistency score.

8. A parking nut defect identification system based on image features according to claim 7, characterized in that, The candidate return module is also used for: The angular texture energy is obtained by accumulating the radius difference amplitude of the texture clear radius band within the effective angular column of the column source consistency mask. The period consistency score is calculated by combining the thread principal period and the low energy anomaly is suppressed by the energy protection rule. Based on the local peak-valley relationship between the period consistency score and the angular mutation intensity, texture mutation candidate points are extracted. The fracture edge candidate points and texture mutation candidate points are aggregated by angular connection to form a polar coordinate frame and the projection area is generated by phase mapping and inverse compensation.

9. A parking nut defect identification system based on image features according to claim 8, characterized in that, The probability decision module is also used for: Radial grayscale profiles are extracted along the angle position of the defect candidate center in the feedback area. Radial grayscale profiles of adjacent angle columns outside the defect candidate angle range form a detrended baseline. The radial grayscale profile is subtracted from the trend baseline to obtain the detrended profile. The detrended profile is subjected to radial difference and sign flipping to obtain the tooth profile transition sequence. The tooth profile transition sequence is paired with the local benchmark transition sequence and connected to the failure segment to obtain the tooth profile failure width. The tooth pitch anchorage recurrence index and the tooth profile failure width are input into logistic regression to obtain the true defect probability.