Mechanical stopwatch detection method and system

By acquiring test videos of mechanical stopwatches, extracting subpixel-level coordinates and smoothing them using a Kalman filter, segmenting and filtering effective segments, and combining weighted average and linkage constraint models, the problems of zero drift and gap error in mechanical stopwatches were solved, achieving high-precision timing detection.

CN121785076APending Publication Date: 2026-04-03SHANDONG MEASUREMENT SCI RES INST
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-02-10
Publication Date
2026-04-03

AI Technical Summary

Technical Problem

Existing technologies struggle to effectively identify systematic errors in mechanical stopwatches, such as zero drift and mechanical backlash, resulting in insufficient timing accuracy and failing to meet the demands of modern high-precision applications.

Method used

By acquiring video of the testing process of a mechanical stopwatch, sub-pixel level coordinates of the second hand tip are extracted to construct a sequence of the second hand's running trajectory. A Kalman filter is used for smoothing, and effective running segments are segmented and filtered. Combined with a weighted average and linkage constraint model, mechanical errors are identified and corrected.

Benefits of technology

It achieves high-precision detection of mechanical stopwatches, accurately identifies zero drift and mechanical gaps, improves the accuracy and reliability of timing, and is suitable for automated detection and long-term monitoring in complex environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121785076A_ABST
    Figure CN121785076A_ABST
Patent Text Reader

Abstract

The invention provides a mechanical stopwatch detection method and system, and relates to the technical field of stopwatch detection.The method comprises the steps that whether a test instruction exists or not is judged, if yes, a mechanical stopwatch is controlled to respond to the test instruction, and if not, processing is not conducted; the method comprises the following steps: acquiring a test process video of a mechanical stopwatch, respectively extracting second hand tip sub-pixel-level coordinates in each frame of image in the test process video, constructing a second hand moving track sequence based on all the second hand tip sub-pixel-level coordinates, calculating a time interval sequence of second hand movement based on the second hand moving track sequence, and calculating the time interval sequence of the mechanical stopwatch. And generating a detection result according to the time interval sequence and a standard time interval. According to the invention, systematic errors such as zero drift of a mechanical stopwatch and a mechanical gap can be identified.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the technical field of stopwatch testing, and in particular to a method and system for testing mechanical stopwatches. Background Technology

[0002] As a high-precision timing tool, the stopwatch is widely used in sports competitions, industrial production, scientific experiments, and medical diagnosis. Its timing accuracy is directly related to the fairness and data reliability of these activities. With the ever-increasing demands for time measurement accuracy, traditional methods relying on manual reading or simple electronic calibration are no longer sufficient to meet the needs of modern high-precision applications.

[0003] Currently, the performance testing of mechanical stopwatches mostly adopts external synchronous comparison or sensor-assisted recording methods. The testing system starts the stopwatch under test synchronously with a high-precision standard clock, and uses photoelectric gates, infrared sensors or high-speed cameras to record the time points when the pointer passes through the preset scale, and then calculates the timekeeping error.

[0004] Mechanical stopwatches often suffer from zero-point drift (i.e., the pointer does not strictly return to zero when not in use) or non-linear timekeeping errors (such as start-up lag or skipping hands during operation) due to assembly tolerances, aging hairsprings, or gear backlash. These errors are not random noise, but rather systematic biases with repeatability and structure. If the detection process relies solely on dial readings or simple timestamp comparisons, without a detailed model of the pointer's initial state, the continuity of movement, and the mechanical response characteristics, it will be impossible to distinguish between true timing errors and pseudo-errors caused by zero-point inaccuracy or mechanical backlash. Summary of the Invention

[0005] In order to identify systematic errors such as zero drift and mechanical backlash in mechanical stopwatches, this application provides a mechanical stopwatch detection method and system.

[0006] Firstly, this application provides a method for testing a mechanical stopwatch, employing the following technical solution: A method for testing a mechanical stopwatch includes the following steps: Determine if a test command exists. If yes, control the mechanical stopwatch to respond to the test command; otherwise, do nothing. The test process video of the mechanical stopwatch is acquired. In each frame of the test process video, the subpixel coordinates of the tip of the second hand are extracted. A sequence of the second hand's running trajectory is constructed based on all the subpixel coordinates of the second hand's tip. The time interval sequence of the second hand's movement is calculated based on the time interval sequence and the standard time interval. The test result is generated based on the time interval sequence and the standard time interval.

[0007] The mechanical stopwatch testing method provided in this application controls the mechanical stopwatch to respond to specific test actions when a test command is available, and further acquires a video of the mechanical stopwatch's test process. Then, it determines whether the second hand accurately points to 0, i.e., whether zero-point drift exists, by analyzing the first frame or the first few frames of the test process video. This application obtains a sequence of second hand movement trajectories through the test process video and sub-pixel positioning, calculates a sequence of time intervals for the second hand's movement based on this sequence, and identifies the presence of mechanical gaps by comparing each time interval in the time interval sequence with a standard time interval.

[0008] Optionally, after constructing the sequence of the second hand's trajectory, the method further includes: The motion continuity of the extracted subpixel-level coordinates of the second hand tip is verified, and coordinate jump points caused by image blurring or occlusion are deleted to obtain the verified coordinates. The verified coordinates are arranged in the order of the timestamps of the video frames to construct the calibration running trajectory sequence. The calibration trajectory sequence is smoothed using a Kalman filter to predict and correct the position of the second hand in each frame, resulting in a smoothed second hand trajectory sequence.

[0009] This application verifies the motion coherence of the extracted sub-pixel coordinates of the second hand tip and constructs a calibration trajectory sequence based on the motion coherence verification results. This effectively filters out coordinate errors caused by image blur (such as low light), occlusion (such as accidental finger touch), or reflection.

[0010] This application employs a Kalman filter to smooth the calibration trajectory sequence, further obtaining a smoothed second hand trajectory sequence. This reduces trajectory fluctuations caused by minor jitters such as camera noise and mechanical vibration, making the second hand movement more consistent with physical laws. The smoothed second hand trajectory sequence allows the second hand to pass through the same scale point more accurately, reducing the statistical error of the time interval sequence.

[0011] Optionally, before calculating the time interval sequence of the second hand movement, the method further includes: In the smoothed second hand trajectory sequence, periodic reversal points in the second hand's running direction are detected, and the calibration trajectory is divided into multiple unidirectional running segments based on these periodic reversal points. Within each unidirectional running segment, the instantaneous angular velocity of the second hand is calculated based on the verified coordinates, and the mean and standard deviation of the instantaneous angular velocity in each unidirectional running segment are calculated. If the mean and standard deviation of the instantaneous angular velocity fluctuate within the preset normal threshold range, the segment is determined to be a valid running segment; otherwise, it is marked as an abnormal segment and deleted. All valid running segments are spliced ​​together in chronological order to generate an optimized running trajectory sequence for calculating time intervals.

[0012] Mechanical jamming, manual reversal of the second hand, and other abnormal movements can introduce erroneous time intervals (such as negative or extreme values). This application, through segmentation and filtering, retains only segments with normal unidirectional movement, thus minimizing the contamination of the time interval sequence by abnormal data. The mean and standard deviation of the angular velocity in abnormal segments deviate from the normal range, and the statistical characteristics (such as mean and variance) of the time intervals after filtering are more consistent with the actual error distribution.

[0013] This application generates an optimized operating trajectory sequence for calculating time intervals by splicing all effective operating segments in chronological order. This optimized operating trajectory sequence contains only segments of normal motion, making the analysis results of systematic errors such as zero drift and mechanical backlash more accurate. It is suitable for automated detection and long-term monitoring in complex environments.

[0014] Optionally, generating the detection result based on the time interval sequence and the standard time interval includes: Obtain the running trajectory length corresponding to each time interval in the time interval sequence. Based on the running trajectory length, perform a weighted average on the corresponding time intervals to obtain the weighted average time interval. Compare the weighted average time interval with the standard time interval and calculate the absolute error and relative error. If both the absolute error and the relative error are within the allowable error range, a test result indicating that the mechanical stopwatch is qualified is generated. If the absolute or relative error exceeds the allowable error range, a test result indicating that the mechanical stopwatch is unqualified is generated, and the time interval with the largest error and the corresponding video frame timestamp are located.

[0015] Traditional methods directly calculate the arithmetic mean of all time intervals, which is susceptible to interference from transient anomalies (such as mechanical jams or occlusions). This application employs a weighted average algorithm that allocates weights based on trajectory length, automatically reducing the weight of abnormal time intervals and making the results closer to the true values. This application uses both absolute and relative error indicators for verification, resulting in higher statistical significance.

[0016] Optionally, when the mechanical stopwatch has multiple hands, the method further includes: While extracting the subpixel-level coordinates of the tip of the second hand, the coordinates of the tip of the other hand on the stopwatch are also extracted, and the corresponding running trajectory sequence is constructed, which is denoted as the target trajectory sequence. Based on the transmission ratio relationship of the mechanical stopwatch movement, a linkage constraint model between the second hand and another hand is established; During the process of generating the optimized running trajectory sequence, the logical consistency of the second hand trajectory is checked using the linkage constraint model. When the logical consistency check fails, the data in the optimized running trajectory sequence is interpolated or corrected based on the target trajectory sequence and the linkage constraint model.

[0017] This application extracts the sub-pixel coordinates of the second hand's tip while simultaneously extracting the tip coordinates of another hand (such as the minute or hour hand) using the same image processing algorithm. It then constructs a corresponding trajectory sequence and a linkage constraint model. This allows for the detection and correction of the second hand's abnormality by analyzing the minute hand's trajectory, even when the second hand is stuck due to mechanical failure but the minute hand is moving normally. When the second hand is obscured but the other hand is visible, this application can infer the second hand's position using the linkage constraint model, making it suitable for complex environments such as occlusion and noise.

[0018] Optionally, the linkage constraint model is a spatiotemporal synchronization model constructed based on the transmission ratio relationship of the movement, and the step of using the linkage constraint model to perform logical consistency verification on the second hand trajectory includes: Align the optimized running trajectory sequence with the target trajectory sequence by timestamp. Based on the linkage constraint model, calculate the theoretical positional relationship between the second hand and another hand at the same moment. Compare the theoretical positional relationship with the actual positional relationship. If the deviation between the theoretical positional relationship and the actual positional relationship exceeds the linkage tolerance threshold, it is determined to be logically inconsistent.

[0019] Optionally, when there is a logical inconsistency, the coordinates at the corresponding time in the optimized running trajectory sequence are corrected or interpolated based on the continuity of the linkage constraint model and the target trajectory sequence.

[0020] This application optimizes the alignment of the running trajectory sequence and the target trajectory sequence by timestamp, making the pointer positions at the same moment comparable and minimizing misjudgments caused by time offset. Based on the linkage constraint model, this application calculates the theoretical positional relationship (such as angle difference and speed ratio) between the second hand and other pointers, which can transform the abstract transmission ratio into a concrete and verifiable geometric relationship, helping to identify logical inconsistencies.

[0021] When logical inconsistencies exist, this application can correct or interpolate the coordinates at corresponding times in the optimized trajectory sequence based on the linkage constraint model and the continuity of the target trajectory sequence, thereby improving the continuity of the trajectory sequence and minimizing the obstruction of subsequent analysis due to missing data. The interpolation in the optimized trajectory sequence is based on model constraints, which can reduce subjective assumptions and improve the credibility of the results.

[0022] Optionally, the detection of the periodic reversal point of the second hand's running direction includes: Based on the smoothed second hand trajectory sequence, the direction vector between adjacent coordinate points is calculated, a direction vector sequence is constructed, and the local direction change rate is calculated using a sliding window. Identify coordinate points whose rate of change exceeds a preset direction reversal threshold and use them as candidate reversal points; By combining the mechanical characteristics and operating cycle of the mechanical stopwatch movement, candidate reversal points are periodically tested, and reversal points that conform to the periodic pattern are selected as the final periodic reversal points.

[0023] This application calculates the direction vector between adjacent coordinate points based on the smoothed second hand trajectory sequence, making the direction vector of adjacent coordinate points closer to the actual movement trend and reducing the interference of instantaneous fluctuations on reversal point detection. This application directly locates the specific moment of reversal by using a rate of change threshold, minimizing the possibility of missing instantaneous reversals that may be missed by sampling at fixed time intervals.

[0024] This application combines the mechanical characteristics (such as gear ratio and balance wheel period) and operating cycle rules of mechanical stopwatch movements to conduct secondary screening of candidate reversal points, reducing non-periodic reversals caused by external impacts (such as collisions) or electronic interference, so that the results conform to the physical constraints of mechanical watches and improve credibility.

[0025] Optionally, the method further includes: After generating a test result indicating that the mechanical stopwatch is defective, based on the time interval with the largest error and the corresponding video frame timestamp, the original video segment corresponding to that time interval is extracted back. Multi-scale image enhancement processing is performed on the original video segment, and optical flow analysis is used to analyze the continuity of the second hand's movement within the original video segment. Based on the analysis results, the cause of the error is determined to be mechanical jamming, abnormal image recognition, or external interference. The determination results, along with the corresponding video segment and error data, are then fed back to the maintenance terminal.

[0026] This application can directly pinpoint the specific time and video segment where the problem occurred by using the time interval with the largest positioning error and the video frame timestamp, thus improving work efficiency. Subsequently, by performing multi-scale enhancement on the original video segment, key features such as the second hand edge and the pointer scale can be enhanced, improving the reliability of subsequent analysis.

[0027] This application uses optical flow to calculate the motion vector field of the second hand between consecutive frames. It judges mechanical jamming or image recognition error by the sudden change of optical flow vector. Based on the optical flow analysis results, combined with mechanical characteristics and image features, the error is attributed to mechanical jamming, abnormal image recognition, or external interference. The judgment results, the corresponding video segments, and error data are fed back to the operation and maintenance terminal to assist operation and maintenance personnel in making decisions.

[0028] Secondly, this application provides a mechanical stopwatch testing system, which adopts the following technical solution: A mechanical stopwatch detection system includes: a processor, and a memory communicatively connected to the processor; The memory is provided with a computer-readable storage medium, and a computer program is stored on the computer-readable storage medium. When the processor processes a computer program stored on the computer-readable storage medium, it implements the method as described in the first aspect.

[0029] In summary, this application includes at least one of the following beneficial technical effects: 1. The mechanical stopwatch detection method provided in this application controls the mechanical stopwatch to respond to a specific test action when a test command is available, and further acquires a video of the mechanical stopwatch's test process. Then, it determines whether the second hand accurately points to 0, i.e., whether zero-point drift exists, by analyzing the first frame or the first few frames of the test process video. This application obtains a sequence of second hand movement trajectories through the test process video and sub-pixel positioning, calculates a sequence of time intervals for the second hand's movement based on the second hand movement trajectory sequence, and identifies the presence of mechanical gaps by comparing each time interval in the time interval sequence with a standard time interval.

[0030] 2. This application employs a Kalman filter to smooth the calibration trajectory sequence, further obtaining a smoothed second hand trajectory sequence. This reduces trajectory fluctuations caused by minor jitters such as camera noise and mechanical vibration, making the second hand movement more consistent with physical laws. The smoothed second hand trajectory sequence allows the second hand to pass through the same scale point more accurately, reducing the statistical error of the time interval sequence.

[0031] 3. This application extracts the sub-pixel coordinates of the second hand's tip while simultaneously extracting the tip coordinates of another hand (such as the minute or hour hand) using the same image processing algorithm. It then constructs the corresponding trajectory sequence and linkage constraint model. This allows for the detection and correction of the second hand's abnormality through the minute hand's trajectory, even when the second hand is stuck due to mechanical failure but the minute hand is moving normally. When the second hand is obscured but the other hand is visible, this application can infer the second hand's position using the linkage constraint model, making it suitable for complex environments such as occlusion and noise. Attached Figure Description

[0032] Figure 1 This is a flowchart of the method in Embodiment 1 of this application. Detailed Implementation

[0033] The following combination Figure 1 This application will be described in further detail.

[0034] Example 1: This example discloses a method for testing a mechanical stopwatch, referring to... Figure 1 The method includes: S11 instruction judgment, S12 extraction of sub-pixel level coordinates of the second hand tip, S13 motion coherence verification and smoothing, S14 screening of valid running segments, and S15 detection. The execution process of each step in this embodiment is as follows: S11 instruction judgment: listen for external input signals used as test instructions, such as TCP instructions sent by the host computer or physical button trigger signals.

[0035] If a test command is received within the preset waiting window, standard test commands such as start, reset, stop, and timing are sent to the mechanical stopwatch. For example, the stopwatch is put into a standardized test process by simulating the manual pressing of the stopwatch button through the electromagnetic push rod, such as: reset → start → run for 30 seconds → stop.

[0036] If no test command is received, no action is taken.

[0037] The S12 extracts the sub-pixel coordinates of the second hand tip and uses a camera to record the stopwatch's testing process video while the mechanical stopwatch executes test commands.

[0038] The test process video is processed frame by frame, including: using a method based on a combination of Hough transform and template matching to initially locate the second hand area; within the second hand area, using Zernike moments or gray-scale centroid method to perform sub-pixel level edge fitting to accurately extract the two-dimensional coordinates of the second hand tip, i.e., the sub-pixel level coordinates of the second hand tip, and recording the timestamp corresponding to each frame image.

[0039] By sorting the subpixel-level coordinates of the tips of all the second hands of the same mechanical stopwatch according to the timestamp, a sequence of the second hand's running trajectory is obtained.

[0040] S13 motion coherence verification and smoothing process calculates the Euclidean distance change rate of the second hand tip between adjacent frames. If the Euclidean distance change rate of a frame exceeds 3 times the median absolute deviation (MAD), it is determined to be an abnormal point caused by reflection, blur or temporary occlusion and is removed. The remaining subpixel level coordinates of the second hand tip are marked as the verified coordinates. The verified coordinates are arranged in the order of the timestamps of the video frames to obtain the calibration running trajectory sequence.

[0041] Using the position of the second hand as the state variable, a uniform rotation model is established. A Kalman filter is used to predict and correct the calibration trajectory sequence, resulting in a smoothed second hand trajectory sequence.

[0042] S14 filters the valid running segment and performs directional analysis on the smoothed second hand trajectory sequence, including the following steps: Calculate the angular velocity sign of adjacent frames, identify the periodic reversal point of the second hand based on the change of the angular velocity sign of adjacent frames, such as the angular velocity changing from zero to clockwise at the moment of start-up, or the reverse angular velocity (bounce) appearing when stopping, and divide the calibration running trajectory into multiple unidirectional running segments with the reversal point as the boundary.

[0043] Within each unidirectional operating segment, the instantaneous angular velocity at each preset time interval is calculated. Using all the instantaneous angular velocities within the unidirectional operating segment, the mean and standard deviation of the instantaneous angular velocity of the unidirectional operating segment are calculated. If the standard deviation of the instantaneous angular velocity of the unidirectional operating segment is less than the preset standard deviation threshold (e.g., 0.05 rad / s) and the mean falls within ±5% of the theoretical value (the theoretical angular velocity of a mechanical stopwatch is 6° / s), then the unidirectional operating segment is marked as a valid operating segment; otherwise, it is considered as jitter, stuttering, or abnormal operation, and the unidirectional operating segment is marked as an abnormal segment and discarded.

[0044] All valid running segments are spliced ​​together in chronological order to generate an optimized running trajectory sequence for calculating time intervals.

[0045] S15 detection calculates the time interval sequence of the second hand movement based on the optimized trajectory sequence, and generates the detection result based on the time interval sequence and the standard time interval. Specifically, it includes the following steps: In optimizing the trajectory sequence, the time interval sequence of the second hand movement is constructed by identifying the moment when the second hand completes one revolution (360°) or passes through a fixed angle (e.g., 6° corresponds to 1 second).

[0046] For each time interval sequence of the second hand movement, calculate the corresponding arc length of the second hand's trajectory. The arc length of the second hand's trajectory is obtained by integrating the sub-pixel coordinates.

[0047] The weighted average time interval is obtained by using the arc length of the second hand's trajectory as the weight and then averaging the time interval sequence of the second hand's movement.

[0048] The weighted average time interval is compared with the standard time interval (1.000 s), and the absolute error and relative error are calculated. If both the absolute error and the relative error are within the allowable error range, a qualified test result for the mechanical stopwatch is generated. If the absolute error or the relative error exceeds the allowable error range (e.g., ±0.05 s and ±5%), a unqualified test result for the mechanical stopwatch is generated, and the time interval with the largest error and the corresponding video frame timestamp are located.

[0049] In other embodiments, when the stopwatch has multiple hands, the method further includes extracting the sub-pixel coordinates of the second hand tip in S12: While extracting the sub-pixel level coordinates of the tip of the second hand, the coordinates of the tip of the minute hand or hour hand are also extracted to construct the trajectory sequence of the minute hand or hour hand, which is denoted as the target trajectory sequence.

[0050] Taking the minute hand as an example, based on the standard gear ratio of a mechanical stopwatch (for example, the minute hand rotates 1 revolution for every 60 revolutions of the second hand, i.e., the gear ratio is 60:1), a linkage constraint model is established as follows:

[0051] in, Let be the angular position of the target pointer at time t; t represents the angular position of the second hand at time t; k is the transmission ratio coefficient, which is 60 in this embodiment; The initial phase offset represents the inherent angular offset between the minute and second hands at time t=0.

[0052] During the generation of the optimized running trajectory sequence, a linkage constraint model is used to perform logical consistency verification on the second hand trajectory, including: In t i At any given moment, the theoretical minute hand angle position is calculated using the linkage constraint model, where the initial phase offset is obtained from the initial static frame calibration of the test.

[0053] Then, the theoretical minute hand angle position is compared with the actual extracted minute hand angle position to calculate the absolute deviation of the minute hand.

[0054] If the absolute deviation of the minute hand is greater than the preset deviation threshold (e.g., 2°), it is determined that there is a logical inconsistency at that moment, and the logical consistency check is not passed.

[0055] Analyzing the continuity of the minute hand's trajectory within its neighborhood: If the minute hand's motion is smooth and conforms to its own dynamic laws, then the minute hand data is considered reliable. Furthermore, based on the linkage constraint model, the second hand's trajectory at time t is inferred. i The formula for calculating the corrected angular position at time t is as follows:

[0056] in, For the second hand at t i The correction angle position at any given time; k is the transmission ratio coefficient, which is 60 in this embodiment; For the minute hand at t i The actual angular position at that moment; The initial phase offset represents the inherent angular offset between the minute and second hands at time t=0.

[0057] The inferred value is compared with the actual angular position of the second hand, and the difference between the real-time angular position and the inferred angular position of the second hand is calculated. The calculation model is as follows:

[0058] in, The real-time angular position of the second hand and the position of the reasoning angle The difference.

[0059] If the difference between the real-time angular position and the inference angular position of the second hand is greater than the tolerance threshold (e.g., 2°), then the logic consistency check is deemed to have failed.

[0060] For moments when the verification fails but the target pointer is reliable, this embodiment uses the inference angle position of the second hand to replace the real-time angle position of the second hand, and converts the inference angle position of the second hand back to the sub-pixel level coordinates of the image plane, thereby correcting the corresponding points in the optimized running trajectory sequence; if both pointers are unreliable, the time period is marked as an abnormal segment and removed.

[0061] When both the second hand and the target hand are unreliable, interpolation is performed using the local continuity of their trajectories to complete the data, which is then used to correct the second hand. The process is as follows: Detect whether there are empty defects in the target trajectory sequence. If t i There are no valid coordinates for the time interval, but within its neighborhood time window [t] i-n ,t i+n If there are at least two reliable data points in memory (e.g., n=3), then the trajectory of the target pointer is interpolated and completed based on the continuity of the target trajectory sequence.

[0062] In this embodiment, the interpolation method is selected based on the motion characteristics of the target pointer: If the target pointer is in a uniform motion section (judged by the instantaneous angular velocity stability of the target pointer), linear interpolation or uniform angular displacement interpolation is used; If the system is in a start-stop transition phase, cubic spline interpolation or state prediction based on Kalman filtering is used to maintain trajectory smoothness.

[0063] After obtaining the interpolation of the target pointer, substitute it into the linkage constraint model to deduce the inference angle position of the second hand.

[0064] Through the above scheme, this embodiment not only achieves high-resolution quantitative evaluation of the timekeeping accuracy of mechanical stopwatches, but also effectively identifies and eliminates interference caused by image quality, mechanical jitter, or abnormal start-stop. At the same time, it enhances fault tolerance through multi-pointer linkage logic.

[0065] Example 2: This example differs from Example 1 in that, in the valid running segment selection in S14, the periodic reversal point of the second hand's running direction detection includes: Convert the smoothed second hand trajectory sequence into pixel coordinates of the dial center. Using polar coordinates as the origin, the second hand angle position of each frame is calculated, and the calculation model is shown below:

[0066] in, Let be the subpixel coordinates of the tip of the second hand in the i-th frame; Let be the instantaneous angular position of the second hand relative to the center of the dial in the i-th frame; It is the arctangent function in the four quadrants.

[0067] To reduce the impact of angular jumps (such as jumping from +π to -π), for the angular position sequence composed of the angular positions of the second hand in all frames perform phase unwrapping processing to obtain a continuous angular sequence , and then, based on the continuous angular sequence calculate the direction vectors between adjacent coordinate points. The calculation model is as follows:

[0068] where represents the angular displacement increment between adjacent frames; N is the total number of video frames.

[0069] The direction vector can be positive or negative, corresponding to clockwise or counterclockwise rotation respectively.

[0070] According to all the direction vectors in the order of timestamps, construct a direction vector sequence and use a sliding window to calculate the local direction change rate. The process is as follows: Let the window length be w (for example, w = 5 frames, corresponding to about 50 ms @ 100 fps). For each center position i (w / 2 < i < N - w / 2), calculate the principal direction angle of the direction vectors within the window by PCA or the average unit vector method. The calculation model of the principal direction angle is as follows:

[0071]

[0072] where is the average unit direction vector within the sliding window centered on the i-th frame, that is, the principal direction angle; is the length of the sliding window;[[ID=3,6]] is the second hand displacement direction vector corresponding to the j-th frame, reflecting the instantaneous movement direction and amplitude of the second hand between the j-th and j + 1-th frames; is the Euclidean norm of, that is, the modulus; is the floor operation.

[0073] Then calculate the angle between the principal directions of adjacent windows. The calculation formula is as follows:

[0074] where the angle reflects the degree of turning of the local movement direction, that is, the angle (taking the smallest positive angle) between the principal direction vectors of two adjacent windows, is the local direction change rate sequence. When the second hand starts, stops or reverses (such as the rapid reverse reset when the mechanical stopwatch returns to zero), the angle It will increase significantly.

[0075] Set direction reversal threshold (e.g., 120°), if the included angle at a certain moment is greater than the direction reversal threshold If so, mark it as a candidate reversal point.

[0076] In other embodiments, the method further includes: using changes in the sign of angular velocity for auxiliary judgment; if there are several consecutive frames (e.g., 3 frames) that satisfy s i-1 >0 and s i+1 <0, or, s i-1 <0 and s i+1 If the value is greater than 0 and the intermediate angular velocity is close to zero, then the confidence that the point is a reversal point is increased.

[0077] in,

[0078] The sign representing the i-th angular increment (or an approximation of the instantaneous angular velocity), when the second hand rotates counterclockwise between the i-th and i+1-th frames. The value is +1; when the second hand rotates clockwise between the i-th and i+1-th frames, The value is -1; when the angle increment is 0, The value is 0.

[0079] s i-1 The sign indicating the rotation direction within the previous frame interval (from frame i-1 to frame i); s i+1 The symbol indicating the rotation direction for the next frame interval (from frame i+1 to frame i+2).

[0080] Next, combining the mechanical characteristics and operating cycle of the mechanical stopwatch movement, cluster analysis was performed on the candidate reversal points to screen out the reversal points that conform to the periodic pattern, which were then used as the final periodic reversal points. The process is as follows: Set the operating cycle constraints as follows: For a standard mechanical stopwatch, the typical start-stop cycle is 30 seconds, 60 seconds, or continuous operation. The zero-return action usually occurs at the end of the test, and the interval is fixed. Pre-store the expected reversal cycle Texp for this model of stopwatch, such as 60 seconds, and the allowable deviation ΔT, such as ±2 seconds.

[0081] Perform an equal-interval hypothesis test on the timestamps of all candidate reversal points, including: calculating the time interval between adjacent candidate points; if the time interval of most adjacent candidate reversal points falls within the interval [Texp-ΔT, Texp+ΔT], then these candidate reversal points are considered to constitute a periodic reversal sequence; for candidate reversal points that do not fall within any interval, they are judged as noise and deleted, and the remaining candidate reversal points are taken as the final periodic reversal points.

[0082] By adopting the above scheme, this embodiment can more accurately identify the boundary of the actual running stage of the second hand, and minimize the possibility of deleting valid data or misusing abnormal data due to misjudgment of the reversal point.

[0083] Example 3: This example differs from Example 1 in that the method further includes: after generating a test result indicating that the mechanical stopwatch is defective, obtaining the start and end frame timestamps corresponding to the time interval with the largest error. The original video segment corresponding to the time interval is extracted back, and multi-scale image enhancement processing is performed on the original video segment, including: Illumination and contrast adaptive correction, namely the use of the CLAHE (Limited Contrast Adaptive Histogram Equalization) algorithm, enhances the contrast of the dial area in the local neighborhood and suppresses overexposure or underexposure. Multi-scale edge enhancement, which uses Laplacian pyramid decomposition to enhance the hand edges at both coarse-grained (low-frequency) and fine-grained (high-frequency) scales, thus highlighting the second hand's outline; Deblurring involves applying blind deconvolution algorithms based on Wiener filtering or deep learning to restore motion blur when it is detected between frames (determined by gradient magnitude distribution). Dial area masking focuses, which uses a pre-calibrated dial ROI (Region of Interest) mask to enhance only the effective area.

[0084] The motion continuity of the second hand within the original video clip was analyzed using optical flow, and the analysis results are as follows: Calculate the inter-frame pixel-level motion vector field, and perform the following analysis on the neighborhood of the second hand tip (a 15×15 pixel window centered on the initially extracted coordinates): By integrating the optical flow vector along the time dimension, the optical flow trajectory at the tip of the second hand is reconstructed. The instantaneous velocity and acceleration of the optical flow trajectory are calculated, and their values ​​are statistically analyzed. The standard deviation and maximum jump amplitude within the range are calculated; the optical flow trajectory is spatiotemporally aligned with the original geometric trajectory obtained based on template matching / subpixel localization, and the Euclidean distance deviation between the two is calculated for each frame.

[0085] Based on the Euclidean distance deviation in each frame, the cause of the error is determined to be mechanical jamming, abnormal image recognition, or external interference. The determination result, along with the corresponding video clip and error data, is then fed back to the maintenance terminal.

[0086] In this embodiment, the mechanical stutter refers to the instantaneous speed of the optical flow trajectory display being approximately 0 for two consecutive frames, and the geometric trajectory being highly consistent with the optical flow trajectory, i.e., the Euclidean distance deviation being less than 0.5px.

[0087] Image recognition anomalies refer to situations where geometric trajectories exhibit jumps or drifts, but optical flow trajectories remain smooth and continuous, and the instantaneous velocity of the optical flow trajectory is within a certain range. The standard deviation within the range is less than 0.1, and the Euclidean distance deviation is greater than 0.2px.

[0088] External interference refers to: non-rotational motions displayed in the optical flow trajectory (such as overall translation or jitter), or sudden changes in the direction of the second hand movement that do not conform to the movement dynamics (such as direct reversal without deceleration); visible finger touches or shaking of the vibration table in the video. In other words, external interference includes abnormalities beyond mechanical jamming and image recognition anomalies.

[0089] Example 4: This example discloses a mechanical stopwatch detection system, the detection system including: a processor, and a memory communicatively connected to the processor; The memory is provided with a computer-readable storage medium, and a computer program is stored on the computer-readable storage medium. When the processor processes the computer program stored on the computer-readable storage medium, it implements the mechanical stopwatch detection method.

[0090] The above are all preferred embodiments of this application, and are not intended to limit the scope of protection of this application. Therefore, all equivalent changes made in accordance with the structure, shape and principle of this application should be covered within the scope of protection of this application.

Claims

1. A method for testing a mechanical stopwatch, characterized in that, include: Determine if a test command exists. If yes, control the mechanical stopwatch to respond to the test command; otherwise, do nothing. The test process video of the mechanical stopwatch is acquired. In each frame of the test process video, the subpixel coordinates of the tip of the second hand are extracted. A sequence of the second hand's running trajectory is constructed based on all the subpixel coordinates of the second hand's tip. The time interval sequence of the second hand's movement is calculated based on the time interval sequence and the standard time interval. The test result is generated based on the time interval sequence and the standard time interval.

2. The mechanical stopwatch testing method according to claim 1, characterized in that, After constructing the sequence of the second hand's trajectory, the method further includes: The motion continuity of the extracted subpixel-level coordinates of the second hand tip is verified, and coordinate jump points caused by image blurring or occlusion are deleted to obtain the verified coordinates. The verified coordinates are arranged in the order of the timestamps of the video frames to construct the calibration running trajectory sequence. The calibration trajectory sequence is smoothed using a Kalman filter to predict and correct the position of the second hand in each frame, resulting in a smoothed second hand trajectory sequence.

3. The mechanical stopwatch testing method according to claim 2, characterized in that, Before calculating the time interval sequence of the second hand's movement, the method further includes: In the smoothed second hand trajectory sequence, periodic reversal points in the second hand's running direction are detected, and the calibration trajectory is divided into multiple unidirectional running segments based on these periodic reversal points. Within each unidirectional running segment, the instantaneous angular velocity of the second hand is calculated based on the verified coordinates, and the mean and standard deviation of the instantaneous angular velocity in each unidirectional running segment are calculated. If the mean and standard deviation of the instantaneous angular velocity fluctuate within the preset normal threshold range, the segment is determined to be a valid running segment; otherwise, it is marked as an abnormal segment and deleted. All valid running segments are spliced ​​together in chronological order to generate an optimized running trajectory sequence for calculating time intervals.

4. The mechanical stopwatch testing method according to claim 3, characterized in that, The step of generating detection results based on the time interval sequence and the standard time interval includes: Obtain the running trajectory length corresponding to each time interval in the time interval sequence. Based on the running trajectory length, perform a weighted average on the corresponding time intervals to obtain the weighted average time interval. Compare the weighted average time interval with the standard time interval and calculate the absolute error and relative error. If both the absolute error and the relative error are within the allowable error range, a test result indicating that the mechanical stopwatch is qualified is generated. If the absolute or relative error exceeds the allowable error range, a test result indicating that the mechanical stopwatch is unqualified is generated, and the time interval with the largest error and the corresponding video frame timestamp are located.

5. The mechanical stopwatch testing method according to claim 3, characterized in that, When the mechanical stopwatch has multiple hands, the method further includes: While extracting the subpixel-level coordinates of the tip of the second hand, the coordinates of the tip of another hand on the mechanical stopwatch are extracted, and the corresponding running trajectory sequence is constructed, which is denoted as the target trajectory sequence. Based on the transmission ratio relationship of the mechanical stopwatch movement, a linkage constraint model between the second hand and another hand is established; During the process of generating the optimized running trajectory sequence, the logical consistency of the second hand trajectory is checked using the linkage constraint model. When the logical consistency check fails, the data in the optimized running trajectory sequence is interpolated or corrected based on the target trajectory sequence and the linkage constraint model.

6. The mechanical stopwatch testing method according to claim 5, characterized in that, The linkage constraint model is a spatiotemporal synchronization model constructed based on the transmission ratio relationship of the movement. The step of using the linkage constraint model to perform logical consistency verification on the second hand trajectory includes: Align the optimized running trajectory sequence with the target trajectory sequence by timestamp. Based on the linkage constraint model, calculate the theoretical positional relationship between the second hand and another hand at the same moment. Compare the theoretical positional relationship with the actual positional relationship. If the deviation between the theoretical positional relationship and the actual positional relationship exceeds the linkage tolerance threshold, it is determined to be logically inconsistent.

7. The mechanical stopwatch testing method according to claim 6, characterized in that, When there is a logical inconsistency, the coordinates at the corresponding time in the optimized trajectory sequence are corrected or interpolated based on the linkage constraint model and the continuity of the target trajectory sequence.

8. The mechanical stopwatch testing method according to claim 3, characterized in that, The periodic reversal point of the detection second hand's running direction includes: Based on the smoothed second hand trajectory sequence, the direction vector between adjacent coordinate points is calculated, a direction vector sequence is constructed, and the local direction change rate is calculated using a sliding window. Identify coordinate points whose rate of change exceeds a preset direction reversal threshold and use them as candidate reversal points; By combining the mechanical characteristics and operating cycle of the mechanical stopwatch movement, candidate reversal points are periodically tested, and reversal points that conform to the periodic pattern are selected as the final periodic reversal points.

9. The mechanical stopwatch testing method according to claim 4, characterized in that, The method further includes: After generating a test result indicating that the mechanical stopwatch is defective, based on the time interval with the largest error and the corresponding video frame timestamp, the original video segment corresponding to that time interval is extracted back. Multi-scale image enhancement processing is performed on the original video segment, and optical flow analysis is used to analyze the continuity of the second hand's movement within the original video segment. Based on the analysis results, it is determined whether the error is caused by mechanical jamming, abnormal image recognition, or external interference. The determination result, along with the corresponding original video segment and the error, is then fed back to the maintenance terminal.

10. A mechanical stopwatch detection system, comprising: A processor, and a memory communicatively connected to the processor; The memory is provided with a computer-readable storage medium, and a computer program is stored on the computer-readable storage medium. When the processor processes a computer program stored on the computer-readable storage medium, it implements the method as described in any one of claims 1-9.