Pointer instrument reading identification method based on high-precision positioning
By combining an improved LoFTR network with polar coordinate ring modeling, the problems of inaccurate positioning and unstable recognition of pointer instruments in complex scenarios are solved, and high-precision pointer instrument reading recognition is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-25
- Publication Date
- 2026-03-31
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Existing pointer instrument reading recognition methods are not accurate and are unstable in complex scenarios. In particular, the recognition accuracy drops significantly when there are changes in lighting, viewing angle shifts, and dial obstruction. Furthermore, they lack effective constraints on the geometric structure of the instrument dial.
An improved LoFTR network with feature amplitude clipping and normalization is introduced. Combined with polar coordinate ring modeling of the pointer instrument dial, and through index difference and angle order consistency constraints, combined with homography transformation consistency verification and closed-loop correction, high-precision normalized alignment of the dial attitude is achieved.
It significantly improves the accuracy and stability of pointer instrument positioning and reading recognition, suppresses mismatches caused by repeated scales and similar textures, and ensures high precision and robustness of reading recognition under complex conditions.
Smart Images

Figure CN121767972A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer vision and image processing technology, and in particular to a method for recognizing pointer instrument readings based on high-precision positioning. Background Technology
[0002] With the development of industrial automation, intelligent inspection, and remote monitoring technologies, pointer-type instruments are still widely used in industrial scenarios such as power, petrochemical, metallurgy, and rail transportation. To reduce the cost of manual inspection and improve operational safety, image-based pointer instrument reading recognition methods have gradually become a research hotspot. Existing technologies typically acquire instrument images using industrial cameras or mobile terminals and then analyze the dial area, pointer position, and scale information using traditional image processing algorithms or deep learning models to achieve automatic acquisition of instrument readings.
[0003] In existing pointer instrument reading recognition schemes, one type of method relies on traditional image processing techniques such as edge detection, Hough transform, or template matching to detect the pointer and scale. These methods are sensitive to changes in lighting, viewing angle shifts, and dial occlusion; when the instrument is tilted, has perspective distortion, or is subject to background interference, the recognition accuracy drops significantly. Another type of method introduces convolutional neural networks or keypoint detection models to achieve dial localization and pointer recognition by learning feature maps. However, most methods still rely on planar Cartesian coordinates for feature matching, failing to fully utilize the inherent circular and radial structural characteristics of pointer instruments, and are prone to feature mismatches in complex scenes.
[0004] In recent years, image registration methods based on depth feature matching have been attempted for instrument positioning and reading recognition. However, existing solutions mostly use general feature matching networks for global matching, lacking constraints on the geometric structure of the instrument dial. On the one hand, in dial areas with dense scales and repetitive textures, the similarity between depth features is high, easily leading to discrete and disordered distribution of matching point pairs. On the other hand, due to changes in shooting angle or installation environment limitations, instrument images often have significant pose deviations, resulting in insufficient stability of geometric transformation parameters obtained from a single matching, affecting the reliability of subsequent reading calculations. Furthermore, existing technologies typically perform pointer angle analysis directly after completing one matching and transformation, lacking a re-correction mechanism for the geometric alignment results, causing errors to amplify step by step in the processing flow.
[0005] Therefore, how to provide a method for recognizing pointer instrument readings based on high-precision positioning is a problem that urgently needs to be solved by those skilled in the art. Summary of the Invention
[0006] One objective of this invention is to propose a pointer instrument reading recognition method based on high-precision positioning. This invention introduces an improved LoFTR network with feature amplitude clipping and normalization, and combines it with polar coordinate ring modeling of the pointer instrument dial. It applies index difference and angle order consistency constraints to the feature matching process, effectively suppressing mismatches caused by repeated scales and texture similarity. At the same time, through homography transformation consistency verification and closed-loop correction, it achieves high-precision normalized alignment of the dial posture, thereby significantly improving the accuracy and stability of pointer instrument positioning and reading recognition under complex shooting conditions.
[0007] A pointer instrument reading recognition method based on high-precision positioning according to an embodiment of the present invention includes the following steps: S1. Obtain the original image containing the pointer instrument and the standard dial image corresponding to the pointer instrument; S2. Based on the improved LoFTR network, multi-scale feature maps are extracted from the original image and the standard dial image respectively, and amplitude cropping and normalization processing are performed. S3. Determine the center coordinates of the dial based on the dial area in the original image, and construct a polar coordinate ring feature unit composed of radius interval index and angle interval index, using the center coordinates of the dial as the pole. S4. Input the polar coordinate annular feature unit into the coarse matching stage of the improved LoFTR network. Based on the adjacency relationship where the annular index difference and the angle index difference are preset integers, determine the feature unit pairs participating in the matching and generate the first set of feature matching point pairs. S5. Sort the first group of feature matching point pairs according to the angle index order, and remove feature matching point pairs with inconsistent angle index order to form the second group of feature matching point pairs. S6. Calculate the homography transformation parameters of the dial area based on the second set of feature matching points, and perform pose normalization processing on the original image according to the homography transformation parameters to obtain a normalized dial image. S7. The improved LoFTR network is reused between the normalized dial image and the standard dial image to perform feature matching, and the homography transformation parameters are corrected based on the feature matching results.
[0008] Optionally, S1 includes: S11. Acquire an original image containing the pointer instrument using an image acquisition device, wherein the original image at least covers the dial area of the pointer instrument; S12. Read the standard dial image corresponding to the pointer instrument model from the storage medium. The standard dial image is a dial image acquired or generated under normal viewing conditions. The standard dial image includes the range markings, scale distribution and dial shape structure consistent with the pointer instrument. S13. Perform size resampling processing on the original image and the standard dial image respectively, and redefine the pixel coordinate system according to a unified pixel coordinate origin and coordinate axis direction; S14. Perform grayscale conversion processing on the original image, and crop the original image based on the preset image boundary cropping rules to obtain an image region containing the complete dial structure.
[0009] Optionally, S2 includes: S21. Input the original image region containing the complete dial structure and the standard dial image into the convolutional feature extraction module of the improved LoFTR network. The improved LoFTR network is a network structure that introduces feature amplitude cropping and feature normalization processing on the basis of the LoFTR network. According to the output order of different convolutional layers in the network, multi-scale feature maps corresponding to different spatial resolutions are obtained. The multi-scale feature maps correspond one-to-one with the pixel positions of the input image in spatial location. S22. For each feature map in the multi-scale feature map, traverse the feature vector corresponding to each pixel position in the feature map, compare the magnitude of each component in the feature vector, and replace the component that exceeds the preset amplitude upper limit with the preset amplitude upper limit, while keeping the component that does not exceed the preset amplitude upper limit unchanged, so as to form a feature vector with amplitude clipping. S23. Perform normalization processing on the clipped feature vector, calculate the corresponding vector magnitude based on the values of each component of the feature vector, and scale each component of the corresponding feature vector according to the vector magnitude to form a normalized feature vector with a consistent amplitude range. S24. The normalized feature vectors are rearranged according to their original pixel positions to construct a set of normalized multi-scale feature maps, while maintaining the spatial alignment between the original image and the standard dial image on each scale feature map.
[0010] Optionally, S3 includes: S31. Determine the set of closed contour points of the outer boundary of the dial in the original image area, calculate the circumscribed rectangle based on the set of closed contour points, and use the geometric center point of the circumscribed rectangle as the center coordinate of the dial. S32. Determine the minimum pixel distance and the maximum pixel distance from the outer boundary of the dial to the center coordinates of the dial in the original image area, and determine the dial radius range using the minimum pixel distance and the maximum pixel distance; S33. Divide the dial radius range into multiple radius intervals according to the preset number of radius intervals, and assign a corresponding radius interval index to each radius interval; S34. Divide the circumferential angle range with the center coordinates of the dial as the origin into multiple angle intervals according to the preset number of angle intervals, and assign a corresponding angle interval index to each angle interval. S35. Traverse the pixel positions of each scale feature map in the normalized multi-scale feature map set, calculate the pixel distance from the pixel position to the center coordinate of the dial based on the horizontal pixel difference and the vertical pixel difference between the pixel position and the center coordinate of the dial, determine the radius interval index corresponding to the pixel position based on the pixel distance, and determine the angle interval index corresponding to the pixel position based on the horizontal pixel difference and the vertical pixel difference. S36. Using the combination of the radius interval index and the angle interval index as the index key, normalized feature vectors with the same index key are aggregated, and the normalized feature vectors with the same index key are summed and divided by the number of vectors to form polar coordinate annular feature units.
[0011] Optionally, S4 includes: S41. Input the normalized feature vector corresponding to the polar coordinate annular feature unit into the coarse matching stage of the improved LoFTR network, and read the corresponding radius interval index and angle interval index for each polar coordinate annular feature unit. S42. For each polar coordinate ring feature unit in the original image, traverse the set of polar coordinate ring feature units in the standard dial image and calculate the difference between the radius interval index and the difference between the angle interval index respectively. S43. Based on the preset first index difference threshold and second index difference threshold, select polar coordinate ring feature units from the polar coordinate ring feature units in the standard dial image that satisfy the condition that the radius interval index difference does not exceed the first index difference threshold and the angle interval index difference does not exceed the second index difference threshold, as candidate matching units; S44. Within the range of the candidate matching units, the polar coordinate annular feature units in the original image are mapped to query features, the candidate matching units are mapped to key-value features, and feature correlation calculation is performed between the query features and the key-value features. S45. Based on the feature correlation calculation results, determine the corresponding matching polar coordinate annular feature unit for each polar coordinate annular feature unit in the original image, and generate the first set of feature matching point pairs based on the matching relationship.
[0012] Optionally, S5 includes: S51. For the first set of feature matching point pairs, read the angle interval index of the polar coordinate ring feature unit on the original image side and the angle interval index of the polar coordinate ring feature unit on the standard dial image side in each feature matching point pair. S52. Sort the first set of feature matching point pairs according to the size of the angle interval index of the polar coordinate ring feature unit of the original image to form a matching point pair sequence arranged in ascending order of angle interval index. S53. In the matching point pair sequence, based on the difference in the original image side angle interval index of adjacent matching point pairs, and according to the preset angle interval interval threshold, the matching point pair sequence is divided into multiple continuous subsequences. S54. For each of the continuous subsequences, according to the order of the matching point pairs in the matching point pair sequence, the changing direction of the corresponding standard dial image side angle interval index is compared sequentially, and matching point pairs that have inconsistent changing directions of angle interval index within the same continuous subsequence are marked. S55. Remove the marked matching point pairs from the matching point pair sequence, and gather the remaining matching point pairs to form a second set of feature matching point pairs.
[0013] Optionally, S6 includes: S61. Based on the second set of feature matching point pairs, read the original image side pixel coordinates and the standard dial image side pixel coordinates in each feature matching point pair respectively, and sort the feature matching point pairs according to the distance and orientation distribution of the original image side pixel coordinates to the center of the dial. S62. Select feature matching point pairs covering the center area and the outer edge area of the dial from the sorted feature matching point pairs, and construct a set of pixel coordinate correspondences. S63. Based on the set of pixel coordinate correspondences, calculate the homography transformation parameters that map the original image coordinate system to the standard dial image coordinate system, and perform a consistency check on the homography transformation parameters. Based on the mapping deviation of each pixel coordinate correspondence under the homography transformation, remove pixel coordinate correspondences whose mapping deviation exceeds a preset range. S64. Using the homography transformation parameters after consistency verification, perform geometric transformation processing on the original image to map the dial area in the original image to a coordinate system consistent with the standard dial image, forming a pose-normalized dial image. S65. Align the posture-normalized dial image with the standard dial image within the pixel coordinate range.
[0014] Optionally, S7 includes: S71. Using the pose-normalized dial image and the standard dial image as input, extract the corresponding multi-scale feature maps respectively, and generate closed-loop correction feature matching point pairs based on the feature matching structure of the improved LoFTR network. S72. Based on the closed-loop correction feature matching point pairs, reconstruct the set of pixel coordinate correspondences between the attitude-normalized dial image and the standard dial image; S73. Based on the set of pixel coordinate correspondences, the homography transformation parameters are re-estimated to obtain the corrected homography transformation parameters; S74. Perform geometric transformation processing on the attitude-normalized dial image using the corrected homography transformation parameters to generate a corrected dial image, and use the corrected dial image as the final input image for pointer instrument reading analysis.
[0015] The beneficial effects of this invention are: This invention addresses the issues of insufficient positioning accuracy and unstable matching results of pointer instruments under complex shooting conditions by deeply integrating an improved LoFTR feature matching network with the geometric structural characteristics of the instrument dial. In the image feature extraction stage, feature amplitude clipping and normalization are introduced to suppress the interference of local abnormal responses on the matching process and improve the consistency of multi-scale features under different lighting and texture conditions. In the dial modeling stage, polar coordinate annular feature units composed of radius interval indices and angle interval indices are constructed with the dial center as the pole, reorganizing planar pixel features into a structured feature representation that conforms to the radial distribution law of the instrument. Furthermore, during the feature matching stage, the attention calculation and matching range are limited by index difference constraints, significantly reducing the probability of mismatches caused by repeated scales and similar textures. In the matching and filtering stage, a serialization constraint based on angle order consistency is further introduced, transforming discrete matching point pairs into angle sequences with local continuity, effectively ensuring the structural consistency of the matching relationship in the circumferential distribution. In the geometric alignment stage, the homography transformation parameters are solved by combining matching point pairs covering the center and outer edge regions of the dial, and the geometric mapping results are iteratively corrected through consistency verification and closed-loop re-matching mechanisms, allowing the attitude normalization results to gradually converge under multiple matching constraints. Through the synergistic effect of the above technical means, this invention achieves high-precision geometric positioning and stable alignment of the pointer instrument dial without additional calibration or manual intervention, providing a unified and reliable spatial reference for subsequent pointer angle analysis and reading calculation, significantly improving the accuracy and robustness of automatic readings of pointer instruments in complex industrial environments. Attached Figure Description
[0016] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used in conjunction with embodiments of the invention to explain the invention and do not constitute a limitation thereof. In the drawings:
[0017] Figure 1 This is a schematic diagram of the overall process of a pointer instrument reading recognition method based on high-precision positioning proposed in this invention; Figure 2This is a schematic diagram of the process of multi-scale feature extraction and feature amplitude clipping and normalization based on the improved LoFTR network in this invention; Figure 3 This is a schematic diagram illustrating the serialization and filtering of feature matching point pairs based on the consistency of angular order in this invention. Detailed Implementation
[0018] The present invention will now be described in further detail with reference to the accompanying drawings. These drawings are simplified schematic diagrams, illustrating only the basic structure of the invention, and therefore only show the components relevant to the invention.
[0019] refer to Figure 1-3 A method for recognizing pointer instrument readings based on high-precision positioning includes the following steps: S1. Obtain the original image containing the pointer instrument and the standard dial image corresponding to the pointer instrument; S2. Based on the improved LoFTR network, multi-scale feature maps are extracted from the original image and the standard dial image respectively, and amplitude cropping and normalization processing are performed. S3. Determine the center coordinates of the dial based on the dial area in the original image, and construct a polar coordinate ring feature unit composed of radius interval index and angle interval index, using the center coordinates of the dial as the pole. S4. Input the polar coordinate annular feature unit into the coarse matching stage of the improved LoFTR network. Based on the adjacency relationship where the annular index difference and the angle index difference are preset integers, determine the feature unit pairs participating in the matching and generate the first set of feature matching point pairs. S5. Sort the first group of feature matching point pairs according to the angle index order, and remove feature matching point pairs with inconsistent angle index order to form the second group of feature matching point pairs. S6. Calculate the homography transformation parameters of the dial area based on the second set of feature matching points, and perform pose normalization processing on the original image according to the homography transformation parameters to obtain a normalized dial image. S7. The improved LoFTR network is reused between the normalized dial image and the standard dial image to perform feature matching, and the homography transformation parameters are corrected based on the feature matching results.
[0020] This invention, while maintaining the overall framework of LoFTR feature matching, introduces a geometric constraint mechanism oriented towards the structure of pointer instrument dials. Specifically, by constructing polar coordinate annular feature units with the dial center as the pole, the feature matching is transformed from Cartesian space to an index space consistent with the dial geometry. The matching candidate range is limited based on the annular index difference and angle index difference, thereby reducing the probability of mismatches caused by repeated scales and background textures. At the same time, the matching results are screened for angular order consistency, and combined with closed-loop correction processing of homography transformation, the dial pose normalization process is made more stable.
[0021] In this embodiment, S1 includes: S11. Acquire an original image containing the pointer instrument using an image acquisition device, wherein the original image at least covers the dial area of the pointer instrument; S12. Read the standard dial image corresponding to the pointer instrument model from the storage medium. The standard dial image is a dial image acquired or generated under normal viewing conditions. The standard dial image includes the range markings, scale distribution and dial shape structure consistent with the pointer instrument. S13. Perform size resampling processing on the original image and the standard dial image respectively, and redefine the pixel coordinate system according to a unified pixel coordinate origin and coordinate axis direction; S14. Perform grayscale conversion processing on the original image, and crop the original image based on the preset image boundary cropping rules to obtain an image region containing the complete dial structure.
[0022] In this embodiment, S2 includes: S21. Input the original image region containing the complete dial structure and the standard dial image into the convolutional feature extraction module of the improved LoFTR network. The improved LoFTR network is a network structure that introduces feature amplitude cropping and feature normalization processing on the basis of the LoFTR network. According to the output order of different convolutional layers in the network, multi-scale feature maps corresponding to different spatial resolutions are obtained. The multi-scale feature maps correspond one-to-one with the pixel positions of the input image in spatial location. S22. For each feature map in the multi-scale feature map, traverse the feature vector corresponding to each pixel position in the feature map, compare the magnitude of each component in the feature vector, and replace the component that exceeds the preset amplitude upper limit with the preset amplitude upper limit, while keeping the component that does not exceed the preset amplitude upper limit unchanged, so as to form a feature vector with amplitude clipping. S23. Perform normalization processing on the clipped feature vector, calculate the corresponding vector magnitude based on the values of each component of the feature vector, and scale each component of the corresponding feature vector according to the vector magnitude to form a normalized feature vector with a consistent amplitude range. S24. The normalized feature vectors are rearranged according to their original pixel positions to construct a set of normalized multi-scale feature maps, while maintaining the spatial alignment between the original image and the standard dial image on each scale feature map.
[0023] The improved LoFTR network in this invention does not change the basic structure of the original network. Instead, while maintaining the convolutional feature extraction layers and multi-scale output mechanism, it introduces a pixel-by-pixel, component-by-component amplitude clipping and normalization process in the feature extraction results. This ensures that feature vectors at different scales and spatial locations maintain consistent numerical distribution. This processing uses pixel-level feature vectors as the smallest operational unit, adjusting values according to a preset amplitude upper limit and vector magnitude, while preserving the spatial index relationship in the multi-scale feature map. This results in a stable and alignable feature representation, providing a unified data foundation for subsequent feature recombination and matching based on polar coordinates. In the feature amplitude clipping process, a preset upper limit is used to limit abnormally large component values in the multi-scale feature vector. This upper limit is set as a fixed threshold for the absolute value of the feature vector components before normalization, and in this embodiment, it is set to 10.0. When the value of any component in the feature vector exceeds this threshold, that component is replaced with the upper limit to suppress abnormal responses caused by local strong reflections or scale edges.
[0024] In this embodiment, S3 includes: S31. Determine the set of closed contour points of the outer boundary of the dial in the original image area, calculate the circumscribed rectangle based on the set of closed contour points, and use the geometric center point of the circumscribed rectangle as the center coordinate of the dial. S32. Determine the minimum pixel distance and the maximum pixel distance from the outer boundary of the dial to the center coordinates of the dial in the original image area, and determine the dial radius range using the minimum pixel distance and the maximum pixel distance; S33. Divide the dial radius range into multiple radius intervals according to the preset number of radius intervals, and assign a corresponding radius interval index to each radius interval; S34. Divide the circumferential angle range with the center coordinates of the dial as the origin into multiple angle intervals according to the preset number of angle intervals, and assign a corresponding angle interval index to each angle interval. S35. Traverse the pixel positions of each scale feature map in the normalized multi-scale feature map set, calculate the pixel distance from the pixel position to the center coordinate of the dial based on the horizontal pixel difference and the vertical pixel difference between the pixel position and the center coordinate of the dial, determine the radius interval index corresponding to the pixel position based on the pixel distance, and determine the angle interval index corresponding to the pixel position based on the horizontal pixel difference and the vertical pixel difference. S36. Using the combination of the radius interval index and the angle interval index as the index key, normalized feature vectors with the same index key are aggregated, and the normalized feature vectors with the same index key are summed and divided by the number of vectors to form polar coordinate annular feature units.
[0025] This invention determines the center and radius of the dial within the image space through contour analysis. Based on this center, it establishes a dual discrete partitioning rule for the radial and circumferential angular directions, mapping continuous pixel coordinates into a polar coordinate index system with defined index meanings. Furthermore, feature vectors in the normalized multi-scale feature map are grouped and numerically aggregated according to their index keys, reorganizing the features originally scattered in the planar coordinate system into annular and partitioned structural units. This process directly utilizes the inherent circular and radial distribution characteristics of the dial to complete feature rearrangement, providing a clear data organization foundation for subsequent index-based matching.
[0026] In this embodiment, S4 includes: S41. Input the normalized feature vector corresponding to the polar coordinate annular feature unit into the coarse matching stage of the improved LoFTR network, and read the corresponding radius interval index and angle interval index for each polar coordinate annular feature unit. S42. For each polar coordinate ring feature unit in the original image, traverse the set of polar coordinate ring feature units in the standard dial image and calculate the difference between the radius interval index and the difference between the angle interval index respectively. S43. Based on the preset first index difference threshold and second index difference threshold, select polar coordinate ring feature units from the polar coordinate ring feature units in the standard dial image that satisfy the condition that the radius interval index difference does not exceed the first index difference threshold and the angle interval index difference does not exceed the second index difference threshold, as candidate matching units; S44. Within the range of the candidate matching units, the polar coordinate annular feature units in the original image are mapped to query features, the candidate matching units are mapped to key-value features, and feature correlation calculation is performed between the query features and the key-value features. S45. Based on the feature correlation calculation results, determine the corresponding matching polar coordinate annular feature unit for each polar coordinate annular feature unit in the original image, and generate the first set of feature matching point pairs based on the matching relationship.
[0027] In the coarse matching stage of the improved LoFTR network, polar coordinate annular feature units are used as the basic computational units. A first index difference threshold and a second index difference threshold are set to limit the range of feature units participating in the matching. The first index difference threshold corresponds to the radius interval index difference, and in this embodiment, it is set to 1, meaning only feature units located within the same or adjacent radius intervals are allowed to participate in the matching. The second index difference threshold corresponds to the angle interval index difference, and in this embodiment, it is set to 2, meaning matching is allowed within two adjacent angle intervals in the circumferential direction, thus balancing matching robustness and positioning accuracy. For each polar coordinate annular feature unit from the original image, a corresponding set of candidate matching units is first obtained by filtering based on the radius interval index difference and the angle interval index difference. Subsequently, the polar coordinate annular feature units and the set of candidate matching units are mapped to query features and key-value features, respectively, and feature correlation is calculated between the query features and each key-value feature. The feature correlation, after normalization, is used as an attention weight to participate in the matching calculation between the polar coordinate annular feature units, thereby completing feature matching within the limited index space.
[0028] In this embodiment, S5 includes: S51. For the first set of feature matching point pairs, read the angle interval index of the polar coordinate ring feature unit on the original image side and the angle interval index of the polar coordinate ring feature unit on the standard dial image side in each feature matching point pair. S52. Sort the first set of feature matching point pairs according to the size of the angle interval index of the polar coordinate ring feature unit of the original image to form a matching point pair sequence arranged in ascending order of angle interval index. S53. In the matching point pair sequence, based on the difference in the original image side angle interval index of adjacent matching point pairs, and according to the preset angle interval interval threshold, the matching point pair sequence is divided into multiple continuous subsequences. In the angle order consistency screening process, an angle interval threshold is introduced to divide continuous subsequences. This threshold is used to determine the continuity of adjacent matching point pairs in terms of angle interval indices on the original image side. In the embodiment, the value is 1. When the difference between adjacent angle interval indices is greater than this threshold, the matching point pairs are considered not to belong to the same continuous subsequence.
[0029] S54. For each of the continuous subsequences, according to the order of the matching point pairs in the matching point pair sequence, the changing direction of the corresponding standard dial image side angle interval index is compared sequentially, and matching point pairs that have inconsistent changing directions of angle interval index within the same continuous subsequence are marked. S55. Remove the marked matching point pairs from the matching point pair sequence, and gather the remaining matching point pairs to form a second set of feature matching point pairs.
[0030] This invention does not simply compare the angles of matching point pairs. Instead, it first arranges the matching point pairs in an ordered manner based on the angle interval index of the original image, transforming the matching relationship into a sequence structure with a clear order. Then, by comparing the interval relationship between adjacent matching point pairs on the angle interval index of the original image, the sequence is segmented, forming multiple locally continuous subsequences. Within each subsequence, the directional relationship of the standard dial image's angle interval index as the sequence position changes is checked sequentially. This directional relationship is used as the consistency judgment criterion, and matching point pairs that do not satisfy the same direction of change are marked and removed. This process, through a combination of "sorting—segmentation—directional consistency judgment," elevates the angle constraint from a single-point judgment to a sequence-level structural constraint, ensuring that the remaining matching point pairs maintain a stable correspondence in local angle order.
[0031] In this embodiment, S6 includes: S61. Based on the second set of feature matching point pairs, read the original image side pixel coordinates and the standard dial image side pixel coordinates in each feature matching point pair respectively, and sort the feature matching point pairs according to the distance and orientation distribution of the original image side pixel coordinates to the center of the dial. S62. Select feature matching point pairs covering the center area and the outer edge area of the dial from the sorted feature matching point pairs, and construct a set of pixel coordinate correspondences. S63. Based on the set of pixel coordinate correspondences, calculate the homography transformation parameters that map the original image coordinate system to the standard dial image coordinate system, and perform a consistency check on the homography transformation parameters. Based on the mapping deviation of each pixel coordinate correspondence under the homography transformation, remove pixel coordinate correspondences whose mapping deviation exceeds a preset range. During the homography transformation parameter consistency verification process, a preset range is set to eliminate unstable pixel coordinate correspondences. This preset range is based on pixel-level error settings, and in this embodiment, it is set to 3 pixels. When the mapping deviation of a certain pixel coordinate correspondence under homography transformation exceeds the preset range, the correspondence is removed from the set of pixel coordinate correspondences.
[0032] S64. Using the homography transformation parameters after consistency verification, perform geometric transformation processing on the original image to map the dial area in the original image to a coordinate system consistent with the standard dial image, forming a pose-normalized dial image. S65. Align the posture-normalized dial image with the standard dial image within the pixel coordinate range.
[0033] This invention, when constructing the set of pixel coordinate correspondences, not only considers the number of matching point pairs but also introduces spatial distribution constraints between the center and outer edges of the dial, ensuring that the selected samples are representative in both the radial and circumferential directions. Based on this, a consistency check is performed on the pixel coordinate correspondences, evaluating the deviation of each correspondence under the homography transformation mapping, and retaining stable correspondences within a preset deviation range, thereby forming reliable geometric mapping parameters. These homography transformation parameters are then directly applied to the pixel coordinates of the original image, achieving geometric repositioning of the dial area in a unified coordinate system, providing a consistent spatial reference for subsequent pointer angle analysis.
[0034] In this embodiment, S7 includes: S71. Using the pose-normalized dial image and the standard dial image as input, extract the corresponding multi-scale feature maps respectively, and generate closed-loop correction feature matching point pairs based on the feature matching structure of the improved LoFTR network. S72. Based on the closed-loop correction feature matching point pairs, reconstruct the set of pixel coordinate correspondences between the attitude-normalized dial image and the standard dial image; S73. Based on the set of pixel coordinate correspondences, the homography transformation parameters are re-estimated to obtain the corrected homography transformation parameters; S74. Perform geometric transformation processing on the attitude-normalized dial image using the corrected homography transformation parameters to generate a corrected dial image, and use the corrected dial image as the final input image for pointer instrument reading analysis.
[0035] After completing attitude normalization, this invention extracts multi-scale features again based on the normalized dial image and the standard dial image, and uses an improved LoFTR network to generate new feature correspondences, enabling feature matching to be established on images under a unified coordinate system. By reconstructing the set of pixel coordinate correspondences, the existing homography transformation parameters are re-estimated, so that the geometric mapping parameters are updated synchronously with the feature alignment results. This closed-loop processing, through the continuous execution of "transformation-rematching-re-estimation," gradually converges the homography transformation parameters to stable values, achieving high-precision geometric correction of the dial image and providing a more consistent spatial reference for subsequent pointer reading analysis.
[0036] Example 1: To verify the feasibility and technical effectiveness of this invention in practical applications, a pointer instrument reading recognition method based on high-precision positioning proposed in this invention was applied to an automated inspection scenario in an industrial field. This scenario is located in a chemical production plant area, where a large number of pointer-type instruments such as pressure gauges, flow meters, and thermometers are distributed. These instruments vary in model, installation height, and orientation, and are subjected to high temperatures, vibrations, and complex lighting conditions for extended periods. Traditional manual inspection methods are not only labor-intensive but also prone to misreading at night or under high-reflectivity lighting conditions. Existing methods based on simple image processing or single-shot deep learning recognition show significantly increased reading errors when the instrument is tilted, the shooting angle is off, or there is localized glare on the dial, failing to meet the high-reliability data acquisition requirements of production.
[0037] In this application scenario, a fixed industrial camera is first used to periodically photograph the pointer instrument, acquiring raw images containing the complete dial area. For different instrument models, the system pre-stores corresponding standard dial images, which are acquired under frontal viewing conditions and include the complete scale distribution, range markings, and dial shape structure. After acquiring the raw images, the raw images and standard dial images are resampled in size and their pixel coordinates are unified according to the method of this invention, ensuring that they are in a consistent coordinate system during subsequent processing.
[0038] Subsequently, the cropped dial image region is input into an improved LoFTR network for multi-scale feature extraction. During this process, amplitude cropping and normalization are performed on the feature vectors at different scales, effectively suppressing abnormal feature responses caused by local reflections, shadows, or tick marks, ensuring consistent numerical distribution of features from different shooting conditions. Based on the normalized multi-scale feature map, the outer boundary contour of the dial is determined in the original image, and the dial center coordinates are calculated using the bounding rectangle. Using these center coordinates as the pole, the dial region is divided into multiple polar coordinate rings according to a preset number of radius and angle intervals, and a unique radius and angle interval index is assigned to each pixel position, thus constructing polar coordinate ring feature units.
[0039] In the feature matching stage, the system does not perform unconstrained matching globally. Instead, it inputs polar coordinate annular feature units into the coarse matching stage of the improved LoFTR network and limits the matching range based on the radius interval index difference and angle interval index difference, allowing only feature units whose index difference is within a preset adjacency range to participate in the matching. This significantly reduces erroneous matching point pairs generated in areas with repeated scales and similar textures. After generating the first set of feature matching point pairs, the matching point pairs are further sorted according to the angle interval index on the original image side, and continuous subsequences are divided based on the angle interval interval threshold. Within each subsequence, the consistency of the direction of change of the angle interval index on the standard dial image side is checked, thereby eliminating matching point pairs with inconsistent angle order, resulting in a second set of feature matching point pairs with stronger structural consistency.
[0040] Based on the filtered matching point pairs, the system selects the pixel correspondences covering the center and outer edge regions of the dial, calculates the homography transformation parameters from the original image to the standard dial image, and eliminates correspondences with excessive mapping deviations through consistency verification to obtain stable geometric mapping results. The homography transformation parameters are then used to perform a geometric transformation on the original image to normalize the dial pose. Subsequently, feature matching based on an improved LoFTR network is performed again between the normalized dial image and the standard dial image to construct new pixel coordinate correspondences and re-estimate the homography transformation parameters, thereby completing closed-loop correction and further converging the dial alignment results.
[0041] To verify the beneficial effects of this invention, three common pointer instruments were selected in the same industrial site, and a total of 1200 images were collected as test samples, including various complex situations such as normal lighting, strong reflection, low illumination, and shooting angle shift. Reading recognition was performed using the traditional Hough transform-based method, the general deep learning pointer recognition method, and the method of this invention, respectively. The dial positioning error, pointer angle error, and final reading error were statistically analyzed, and the experimental results are shown in Table 1.
[0042] Table 1. Performance Comparison of Different Methods in Industrial Field Pointer Instrument Reading Recognition
[0043] As shown in Table 1, the method of this invention significantly outperforms traditional methods in all key indicators of pointer instrument reading recognition in industrial settings. Under the same number of test images, the average dial positioning error of the method of this invention is only 1.3 pixels, a significant reduction from the 8.6 pixels of the traditional method, indicating higher geometric positioning accuracy under complex shooting conditions. The average and maximum pointer angle errors are controlled within 0.6 degrees and 1.2 degrees respectively, significantly better than traditional methods, demonstrating that the matching strategy based on polar coordinate structure constraints and closed-loop correction effectively improves the stability of pointer angle resolution. Regarding the final reading results, the relative error of the method of this invention is reduced to 0.8%, meeting the requirements of high-precision industrial monitoring. Furthermore, the recognition success rate reaches 98.7% under complex lighting conditions, an improvement of over 16 percentage points compared to traditional methods, fully verifying the significant advantages of this invention in robustness and engineering applicability.
[0044] The above description is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any equivalent substitutions or modifications made by those skilled in the art within the scope of the technology disclosed in the present invention, based on the technical solution and inventive concept of the present invention, should be covered within the scope of protection of the present invention.
Claims
1. A method for reading a pointer instrument based on high-precision positioning, characterized in that, The method comprises the following steps: S1, obtaining an original image containing a pointer instrument and a standard dial image corresponding to the pointer instrument; S2, extracting multi-scale feature maps from the original image and the standard dial image based on an improved LoFTR network, and performing amplitude clipping and normalization processing; S3, determining a dial center coordinate based on a dial area in the original image, and constructing a polar coordinate ring belt feature unit composed of a radius interval index and an angle interval index with the dial center coordinate as the pole point; S4, inputting the polar coordinate ring belt feature unit into the coarse matching stage of the improved LoFTR network, determining the feature unit pairs participating in matching based on the adjacent relationship of the ring belt index difference and the angle index difference being a preset integer, and generating a first group of feature matching point pairs; S5, sorting the first group of feature matching point pairs in order of angle index, and eliminating feature matching point pairs with inconsistent angle index order to form a second group of feature matching point pairs; S6, calculating the homographic transformation parameters of the dial area based on the second group of feature matching point pairs, and performing pose normalization processing on the original image according to the homographic transformation parameters to obtain a normalized dial image; S7, performing feature matching between the normalized dial image and the standard dial image by reusing the improved LoFTR network, and correcting the homographic transformation parameters based on the feature matching result.
2. The method of claim 1, wherein, The S1 comprises: S11, obtaining an original image containing a pointer instrument through an image acquisition device, the original image covering at least a dial area of the pointer instrument; S12, reading a standard dial image corresponding to the pointer instrument model from a storage medium, the standard dial image being a dial image collected or generated under normal vision conditions, the standard dial image containing a range identifier, a scale distribution and a dial shape structure consistent with the pointer instrument; S13, performing size resampling processing on the original image and the standard dial image respectively, and redefining the pixel coordinate system according to a unified pixel coordinate origin and coordinate axis direction; S14, performing gray scale conversion processing on the original image, and performing clipping on the original image based on a preset image boundary clipping rule to obtain an image area containing a complete dial structure.
3. The method of claim 1, wherein, The S2 comprises: S21, inputting the original image area containing a complete dial structure and the standard dial image into a convolution feature extraction module of the improved LoFTR network, the improved LoFTR network being a network structure in which feature amplitude clipping processing and feature normalization processing are introduced based on the LoFTR network, and multi-scale feature maps corresponding to different spatial resolutions are obtained in the order of output of different convolution layers in the network, the multi-scale feature maps being one-to-one corresponding to the pixel positions of the input image in spatial position; S22, for each of the multi-scale feature maps, traversing the feature vectors corresponding to each pixel position in the feature map, comparing the numerical values of each component in the feature vector, and replacing the components exceeding the preset amplitude upper limit with the preset amplitude upper limit, while keeping the numerical values of the components not exceeding the preset amplitude upper limit unchanged, to form a feature vector subjected to amplitude clipping processing; S23, performing normalization processing on the clipped feature vector, calculating the corresponding vector length based on the numerical values of each component of the feature vector, and scaling each component of the corresponding feature vector according to the vector length, to form a normalized feature vector with consistent amplitude range; S24, rearranging the normalized feature vectors according to the original pixel positions, constructing a normalized multi-scale feature map set, and maintaining the spatial alignment relationship between the original image and the standard dial image on each scale feature map.
4. The method of claim 1, wherein, The S3 comprises: S31, determining a closed contour point set of the dial outer boundary in the original image region, calculating an inscribed rectangle based on the closed contour point set, and taking the geometric center point of the inscribed rectangle as the dial center coordinate; S32, determining the minimum pixel distance and the maximum pixel distance from the dial outer boundary to the dial center coordinate in the original image region, and determining the dial radius range based on the minimum pixel distance and the maximum pixel distance; S33, dividing the dial radius range into a plurality of radius intervals according to a preset number of radius intervals, and assigning a corresponding radius interval index to each radius interval; S34, dividing the circumferential angle range with the dial center coordinate as the origin into a plurality of angle intervals according to a preset number of angle intervals, and assigning a corresponding angle interval index to each angle interval; S35, traversing each pixel position of each scale feature map in the normalized multi-scale feature map set, calculating the pixel distance from the pixel position to the dial center coordinate based on the horizontal pixel difference and the vertical pixel difference between the pixel position and the dial center coordinate, and determining the corresponding radius interval index of the pixel position according to the pixel distance, and determining the corresponding angle interval index of the pixel position based on the horizontal pixel difference and the vertical pixel difference; S36, taking the combination of the radius interval index and the angle interval index as an index key, aggregating the normalized feature vectors with the same index key, performing summation on the normalized feature vectors with the same index key and dividing by the number of vectors to form a polar coordinate ring band feature unit.
5. The method of claim 1, wherein, The S4 comprises: S41, inputting the normalized feature vector corresponding to the polar coordinate ring band feature unit into the coarse matching stage of the improved LoFTR network, and reading the corresponding radius interval index and angle interval index for each polar coordinate ring band feature unit; S42, for each polar coordinate ring band feature unit in the original image, traversing the set of polar coordinate ring band feature units in the standard dial image, and calculating the radius interval index difference and the angle interval index difference, respectively; S43, filtering, from the polar coordinate ring belt feature units in the standard watch face image, polar coordinate ring belt feature units satisfying that a radius interval index difference value does not exceed the first index difference threshold value and an angle interval index difference value does not exceed the second index difference threshold value, as candidate matching units according to the first index difference threshold value and the second index difference threshold value; S44, mapping, in a range of the candidate matching units, a polar coordinate ring belt feature unit in an original image as a query feature and mapping the candidate matching unit as a key-value feature, and performing feature correlation degree calculation between the query feature and the key-value feature; S45, determining, according to a feature correlation degree calculation result, a corresponding matching polar coordinate ring belt feature unit for each polar coordinate ring belt feature unit in the original image, and generating a first group of feature matching point pairs based on the matching relationship.
6. The method of claim 1, wherein, The S5 comprises: S51, reading, for the first group of feature matching point pairs, an angle interval index of a polar coordinate ring belt feature unit on an original image side and an angle interval index of a polar coordinate ring belt feature unit on a standard watch face image side in each feature matching point pair respectively; S52, sorting the first group of feature matching point pairs according to a size of the angle interval index of the polar coordinate ring belt feature unit on the original image side, to form a matching point pair sequence arranged in an angle interval index increasing order; S53, dividing, in the matching point pair sequence, the matching point pair sequence into a plurality of continuous subsequences based on a difference value of the original image side angle interval index corresponding to adjacent matching point pairs and according to a preset angle interval interval threshold value; S54, for each continuous subsequence, comparing, in sequence, a change direction of the standard watch face image side angle interval index corresponding to the continuous subsequence according to an order of the matching point pairs in the matching point pair sequence in the continuous subsequence, and marking matching point pairs with inconsistent angle interval index change directions in the same continuous subsequence; S55, eliminating the marked matching point pairs from the matching point pair sequence, and collecting uneliminated matching point pairs to form a second group of feature matching point pairs.
7. The method of claim 1, wherein, The S6 comprises: S61, reading, based on the second group of feature matching point pairs, an original image side pixel coordinate and a standard watch face image side pixel coordinate in each feature matching point pair respectively, and sorting the feature matching point pairs according to a distance size and an orientation distribution of the original image side pixel coordinate to a watch face center; S62, selecting, from the sorted feature matching point pairs, feature matching point pairs covering a watch face center area and a watch face outer edge area, and constructing a pixel coordinate correspondence relationship set; S63, calculating, based on the pixel coordinate correspondence relationship set, a homographic transformation parameter for mapping an original image coordinate system to a standard watch face image coordinate system, performing consistency verification on the homographic transformation parameter, and eliminating, based on a mapping deviation size of each pixel coordinate correspondence relationship under the homographic transformation, a pixel coordinate correspondence relationship with a mapping deviation exceeding a preset range. S64, performing geometric transformation processing on the original image using the homographic transformation parameter after consistency verification to map the dial area in the original image to a coordinate system consistent with the standard dial image, forming a posture normalized dial image; S65, aligning the posture normalized dial image and the standard dial image in the pixel coordinate range.
8. The method of claim 1, wherein, The S7 includes: S71, taking the posture normalized dial image and the standard dial image as input, respectively extracting corresponding multi-scale feature maps, and generating closed-loop correction feature matching point pairs based on the feature matching structure of the improved LoFTR network; S72, based on the closed-loop correction feature matching point pairs, reconstructing the pixel coordinate correspondence relationship set between the posture normalized dial image and the standard dial image; S73, re-estimating the homographic transformation parameter according to the pixel coordinate correspondence relationship set, obtaining the corrected homographic transformation parameter; S74, performing geometric transformation processing on the posture normalized dial image using the corrected homographic transformation parameter, generating a corrected dial image, and taking the corrected dial image as the final input image for pointer instrument reading analysis.