Automatic reading method, device and equipment for pointer type instrument and storage medium

Through improved lightweight YOLOv5 network and adaptive filtering technology, combined with GA-Otsu and RANSAC algorithms, the positioning and reading problems of pointer instruments in complex environments are solved, and efficient and accurate automatic reading is achieved, suitable for industrial fields such as electricity and chemical industry.

CN120356194APending Publication Date: 2025-07-22ZHEJIANG XINGKE OPTOELECTRONICS TECHNOLOGY CO LTD +1
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202510314742.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-17
Publication Date
2025-07-22

AI Technical Summary

Technical Problem

The reading of existing pointer instruments relies on low manual operation efficiency, are susceptible to environmental interference and are not robust enough. Traditional automation methods are inaccurately positioned in complex industrial scenarios, making it difficult to deal with problems such as lighting changes, shooting angle tilts and background noise.

Method used

The improved lightweight YOLOv5 target detection network and adaptive bilateral filtering technology are used to perform instrument positioning and tilt correction, combined with the improved GA-Otsu algorithm to segment the pointer area, and the pointer center line is extracted through the RANSAC straight line fitting algorithm, and the reading is calculated based on the range information.

Benefits of technology

It significantly improves the accuracy and robustness of automatic reading of pointer instruments, reduces the amount of calculation, and can operate in real-time in embedded devices with resource-constrained resources, reduces manual dependence and operation and maintenance costs, and adapts to complex industrial environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120356194A_ABST
    Figure CN120356194A_ABST
Patent Text Reader

Abstract

The invention discloses an automatic reading method and device for a pointer instrument, equipment and a storage medium. The method comprises the following steps: acquiring an image of a to-be-measured instrument, and preprocessing image data; inputting the preprocessed image into an improved lightweight YOLOv5 target detection network, detecting and positioning an instrument area, performing tilt correction on an instrument based on a prediction frame, and extracting a front view table image; performing graying processing on the front view chart disc image, and segmenting a pointer region by using an improved GA-Otsu algorithm; and extracting a pointer center line in the pointer area through an RANSAC straight line fitting algorithm, and calculating instrument reading by combining range information and a horizontal angle method. According to the technical scheme, through the lightweight network and the optimization algorithm, the instrument detection precision and efficiency are remarkably improved, and the calculation amount is reduced. The anti-interference capability is enhanced by self-adaptive filtering and tilt correction, the reading error of GA-Otsu combined with RANSAC is relatively low, the end-to-end design adapts to embedded equipment, and the labor dependence and cost are reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of computer vision, and in particular to an automatic reading method, device, equipment and storage medium for pointer-type instruments. Background Art

[0002] Due to advantages such as simple structure, strong anti-interference ability, and low cost, pointer-type instruments are still widely used in industrial fields such as electric power, chemical industry, and manufacturing. However, due to the lack of a digital interface, the readings of such instruments rely on manual regular inspections and readings, which have significant drawbacks. First, manual operation is inefficient and easily affected by subjective factors. Especially in dangerous scenarios such as high-temperature, high-pressure, and corrosive environments, manual inspections not only consume time and effort but also pose safety hazards. Second, long-term use of the instrument may cause dial contamination, pointer deformation, or scale blurring, further increasing the error risk of manual reading. In addition, although existing automated reading methods based on traditional image processing reduce manual dependence to a certain extent, they still face many challenges: for example, the algorithms are sensitive to environmental interferences such as light changes, shooting angle tilts, and background noise, resulting in inaccurate positioning; at the same time, traditional methods mostly rely on fixed threshold segmentation and simple geometric fitting, making it difficult to handle dynamic interferences in complex industrial scenarios and having insufficient robustness, with limited actual application effects. How to properly solve the above problems has become an urgent issue in the industry. Summary of the Invention

[0003] The present invention provides an automatic reading method, device, equipment and storage medium for pointer-type instruments, which are used for lightweight network design and multi-stage algorithm optimization, significantly improving the accuracy, efficiency, and robustness of automatic reading of pointer-type instruments. The improved SCC-YOLO network adopts the ShuffleBlock_lite module and SimAM attention mechanism, which improves the detection accuracy while reducing the computational load, and solves the problem of difficult instrument positioning in complex environments. The adaptive bilateral filtering and the tilt correction technology based on the prediction box effectively overcome the influence of noise interference and shooting angle tilt on dial extraction, ensuring the accuracy of subsequent processing. In addition, the improved GA-Otsu algorithm quickly optimizes through genetic algorithms and combines RANSAC regression fitting, significantly improving the anti-interference ability of pointer segmentation and center line recognition, with a relatively small maximum relative error. The overall solution adopts end-to-end process optimization, reducing the difficulty of algorithm deployment, and can run in real time on resource-constrained embedded devices, greatly reducing manual dependence and operation and maintenance costs, providing an efficient and reliable technical support for industrial automation.

[0004] According to a first aspect of the present invention, there is provided an automatic reading method for pointer-type instruments, the automatic reading method for pointer-type instruments including:

[0005] Obtain the image of the instrument to be measured, and preprocess the image data, including noise filtering, resolution adjustment, and data augmentation;

[0006] Input the preprocessed image into the improved lightweight YOLOv5 object detection network, detect and locate the instrument area, perform tilt correction on the instrument based on the prediction box, and extract the front-view dial image;

[0007] Perform grayscale processing on the front-view dial image, and use the improved GA-Otsu algorithm to segment the pointer area;

[0008] Extract the pointer center line in the pointer area through the RANSAC line fitting algorithm, and calculate the instrument reading in combination with the range information and the horizontal angle method.

[0009] In one embodiment, the preprocessing of the image data includes:

[0010] Use an adaptive bilateral filter to filter the noise of the original image;

[0011] Adjust the image resolution to a preset square size, and perform data augmentation through mosaic splicing and geometric transformation.

[0012] In one embodiment, the improved lightweight YOLOv5 object detection network includes:

[0013] The backbone network uses the ShuffleBlock_lite module for lightweight feature extraction;

[0014] Introduce the CoordConv coordinate convolution module and the CARAFE lightweight upsampling module in the feature fusion stage;

[0015] Strengthen the feature extraction ability through the SimAM parameter-free attention mechanism.

[0016] In one embodiment, the tilt correction includes:

[0017] Calculation of the instrument tilt angle based on the prediction box;

[0018] Correct the tilted dial through affine transformation;

[0019] Combine the Hough gradient method and the mask method to extract the corrected dial area.

[0020] In one embodiment, the improved GA-Otsu algorithm includes:

[0021] Use the genetic algorithm to perform fast threshold search for Otsu threshold segmentation;

[0022] Perform morphological thinning processing on the segmented pointer area;

[0023] Remove noise interference through connected component analysis.

[0024] In one embodiment, extracting the pointer center line by the RANSAC line fitting algorithm and calculating the meter reading by combining the range information and the horizontal angle method includes:

[0025] Fitting the straight line equation of the pointer center line based on the RANSAC algorithm;

[0026] Calculating the pointer deflection angle by combining the range and the horizontal reference line;

[0027] Outputting the final reading according to the mapping relationship between the angle and the range.

[0028] According to the second aspect of the present invention, there is provided an automatic reading device for a pointer-type meter, including:

[0029] An acquisition module, configured to acquire an image of the meter to be measured and preprocess the image data, including noise filtering, resolution adjustment, and data enhancement;

[0030] An extraction module, configured to input the preprocessed image into an improved lightweight YOLOv5 object detection network, detect and locate the meter area, correct the tilt of the meter based on the prediction box, and extract the front-view dial image;

[0031] A segmentation module, configured to perform grayscale processing on the front-view dial image and segment the pointer area by using an improved GA-Otsu algorithm;

[0032] A calculation module, configured to extract the pointer center line in the pointer area by the RANSAC line fitting algorithm and calculate the meter reading by combining the range information and the horizontal angle method.

[0033] According to the third aspect of the present invention, there is provided an electronic device, which includes: a communication interface, a processor, and a memory;

[0034] Wherein, the memory is used to store program instructions, and when the program instructions are executed by the processor communicatively connected to the memory through the communication interface, any of the above automatic reading methods for pointer-type meters is implemented.

[0035] According to the fourth aspect of the present invention, there is provided a computer-readable storage medium, on which computer program instructions are stored, and when the computer program instructions are executed by a computer (for example, a processor in the computer), any of the above automatic reading methods for pointer-type meters is implemented.

[0036] In summary, the present invention provides an automatic reading method and device for pointer-type instruments. The method includes: obtaining an image of the instrument to be measured and preprocessing the image data, including noise filtering, resolution adjustment, and data augmentation; inputting the preprocessed image into an improved lightweight YOLOv5 object detection network to detect and locate the instrument area, performing tilt correction on the instrument based on the prediction box, and extracting the frontal view dial image; performing grayscale processing on the frontal view dial image and using an improved GA-Otsu algorithm to segment the pointer area; extracting the pointer center line in the pointer area through the RANSAC line fitting algorithm, and calculating the instrument reading in combination with the range information and the horizontal angle method. The technical solution of this application significantly improves the accuracy, efficiency, and robustness of automatic reading of pointer-type instruments through lightweight network design and multi-stage algorithm optimization. The improved SCC-YOLO network adopts the ShuffleBlock_lite module and the SimAM attention mechanism, which improves the detection accuracy while reducing the computational load, and solves the problem of difficult instrument positioning in complex environments. The adaptive bilateral filtering and the tilt correction technology based on the prediction box effectively overcome the influence of noise interference and shooting angle tilt on dial extraction, ensuring the accuracy of subsequent processing. In addition, the improved GA-Otsu algorithm quickly optimizes through the genetic algorithm and combines RANSAC regression fitting, significantly improving the anti-interference ability of pointer segmentation and center line recognition, and the maximum relative error is small.

[0037] Other features and advantages of the present invention will be described in the following specification, and, in part, will be obvious from the specification, or will be understood by implementing the present invention. The objectives and other advantages of the present invention can be realized and obtained by the structure specifically pointed out in the written specification and the drawings.

[0038] The following will further describe the technical solution of the present invention in detail through the drawings and embodiments. Description of the Drawings

[0039] In order to more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the following will briefly introduce the drawings required for the description of the specific embodiments or the prior art. Obviously, the following drawings are some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.

[0040] Figure 1 It is a flowchart of an automatic reading method for pointer-type instruments provided by an embodiment of the present invention;

[0041] Figure 2 It is a schematic diagram of an object detection algorithm provided by an embodiment of the present invention;

[0042] Figure 3 Schematic diagram of the backbone network lightweight design provided by the embodiment of the present invention;

[0043] Figure 4 Structural diagram of an automatic reading device for pointer-type instruments provided by the embodiment of the present invention;

[0044] Figure 5 Structural diagram of an electronic device provided by the embodiment of the present invention. Detailed implementation manners

[0045] The features and exemplary embodiments of various aspects of the present application will be described in detail below. To make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only intended to explain the present application, rather than limiting the present application. For those skilled in the art, the present application can be implemented without some of these specific details. The following description of the embodiments is only intended to provide a better understanding of the present application by showing examples of the present application.

[0046] It should be noted that in this article, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the term "comprising", "including" or any other variant thereof is intended to cover a non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements, but also includes other elements not expressly listed, or also includes elements inherent to such process, method, article or device. Without further limitation, elements defined by the statement "including..." do not exclude the presence of additional identical elements in the process, method, article or device including the said elements.

[0047] As Figure 1 shown, the present invention provides an automatic reading method for pointer-type instruments. The automatic reading method for pointer-type instruments includes:

[0048] In step S11, an image of the instrument to be measured is acquired, and the image data is preprocessed, including noise filtering, resolution adjustment and data enhancement;

[0049] In step S12, the preprocessed image is input into an improved lightweight YOLOv5 target detection network to detect and locate the instrument area, tilt correction is performed on the instrument based on the prediction box, and a front-view dial image is extracted;

[0050] In step S13, the frontal view dial image is grayscale processed, and the pointer area is segmented using an improved GA-Otsu algorithm;

[0051] In step S14, the pointer center line in the pointer area is extracted through the RANSAC line fitting algorithm, and the instrument reading is calculated by combining the range information and the horizontal angle method.

[0052] In one embodiment, an end-to-end automatic recognition method for pointer-type instruments is provided. By means of lightweight network design, multi-stage algorithm optimization, and process integration, problems existing in traditional methods in complex industrial scenarios, such as low detection accuracy, weak anti-interference ability, and difficult deployment, are solved. The specific implementation process is divided into image preprocessing, instrument detection and correction, pointer segmentation, and reading calculation.

[0053] The industrial field environment is complex, and images are easily affected by factors such as uneven illumination, dust, and electromagnetic interference, resulting in significant noise. Traditional mean filtering or Gaussian filtering is prone to blurring pointer details and affecting subsequent segmentation accuracy. The bilateral filter realizes noise reduction by combining spatial proximity and pixel similarity, and dynamically adjusts the filtering parameters: enhancing the smoothing effect in high-noise areas (such as the dial edge), and reducing smoothing in the pointer area to retain details. Automatically adjust the filtering intensity according to the local image contrast. For example, increase the smoothing weight in low-contrast areas and reduce the smoothing weight in high-contrast areas. For example, in the chemical plant inspection scenario, the collected instrument images have speckle noise due to steam interference. The target detection network is sensitive to the input size, and unifying the size can reduce computational redundancy. The target detection algorithm is as shown in the appendix Figure 2 shown; data augmentation can improve the generalization ability of the model. The images are uniformly scaled to 640×640 pixels, and the edges are filled to maintain the aspect ratio and avoid deformation. Randomly select 4 images and splice them into a single input to simulate complex background interference. Randomly rotate (±15°), scale (0.8 - 1.2 times), and shear (±10°) to enhance the model's adaptability to tilted instruments.

[0054] The traditional YOLOv5 network has a large number of parameters and is difficult to be deployed on embedded devices. The standard convolution is split into depthwise convolution and pointwise convolution, and feature interaction is enhanced through channel shuffling, reducing the computational cost of YOLOv5. The energy function automatically focuses on the key features of the instrument (such as the root of the pointer and the scale of the dial), reducing redundant calculations. Coordinate channels (x, y) are added to the input of the CoordConv layer to enhance the network's perception of spatial positions. Through CARAFE upsampling and content-aware dynamic kernel prediction, the edge sharpness of the feature map is improved. The installation angles of the instrument are diverse, and tilting makes it difficult to extract the dial area. Based on the four vertex coordinates of the detection box, the main direction offset angle is calculated, and the tilted dial is converted into a front view through affine transformation. Based on the Hough gradient method, the circular contour of the dial is detected, and background interference is excluded by combining the masking method (based on color threshold).

[0055] The traditional Otsu algorithm relies on a global threshold and is sensitive to uneven illumination. The genetic algorithm optimization quickly searches for the optimal segmentation threshold by simulating the biological evolution process (selection, crossover, mutation), and the fitness function is to maximize the between-class variance. Morphological thinning uses a cross-shaped structuring element for erosion to remove burrs and retain the main body of the pointer. Connected component labeling is based on 8-neighborhood traversal to label all potential pointer areas. Noise areas with fewer than 50 pixels are removed, and the largest connected component is retained as the main body of the pointer to achieve area filtering.

[0056] The traditional least squares method is sensitive to outliers and is prone to fitting deviations. Random sampling and consistency checking randomly select points from the pointer area to generate candidate lines, and the line with the most inliers is selected as the final result. Iterative optimization is repeated multiple times to improve the fitting robustness. The horizontal reference line calibration is based on the 0 scale line of the dial, and the angle between it and the horizontal axis of the image is calculated. The pointer deflection angle is calculated based on the angle between the fitted pointer center line and the reference line, and is mapped to the actual reading in combination with the pre-input range.

[0057] The hardware platform uses NVIDIA Jetson Xavier NX as the core processor, paired with an 8-megapixel industrial camera. The software architecture implements the detection model based on the PyTorch framework, uses OpenCV to process image algorithms, and the ROS system to achieve communication with the console. The end-to-end latency refers to the time taken from image acquisition to reading output ≤ 200 ms. Under sudden illumination changes, local occlusion, and vibration interference, the system reading success rate ≥ 98%, with high robustness.

[0058] A pointer-type instrument detection method based on SCC-YOLO is proposed to solve the problems of low detection accuracy and difficult positioning of instruments in complex industrial scenarios. SCC-YOLO achieves lightweight design through channel pruning and network reconstruction. The lightweight design of the backbone network is as shown in the appendix Figure 3 as follows:

[0059] ShuffleBlock_lite lightweight feature extraction module: Split the standard convolution into depthwise separable convolution (DWConv) and pointwise convolution (PWConv), enhance feature interaction through channel rearrangement, and reduce the computational cost;

[0060] SimAM parameter-free attention mechanism: Automatically focus on the key areas of the instrument (such as the root of the pointer and the dial scale) based on the energy function, and improve the feature extraction efficiency;

[0061] Feature fusion optimization: Introduce the CoordConv coordinate convolution module (add coordinate channels to enhance spatial perception) and the CARAFE lightweight upsampling module (dynamic kernel prediction to improve edge sharpness) in the Neck network to achieve full feature fusion and expand the receptive field.

[0062] Experiments show that the computational cost of the improved SCC-YOLO network is reduced by 83.3%, 64.3% and 16.7% respectively, and the detection accuracy (mAP@0.5) of the medium model and the large model is improved by 2.3% and 4.9%.

[0063] A method for dial extraction and tilt correction of pointer-type instruments is proposed. The specific steps include:

[0064] Adaptive bilateral filtering denoising: Dynamically adjust the filtering parameters according to the local contrast, suppress noise while retaining the details of the pointer;

[0065] Dial separation combining Hough gradient method and masking method: Accurately extract the dial area through circular contour detection and color threshold segmentation;

[0066] Tilt correction based on the prediction box: Calculate the tilt angle according to the vertices of the detection box, and generate a front view of the dial using affine transformation.

[0067] The success rate of dial extraction in scenarios with a tilt angle exceeding 30° is increased to 93% by this method, significantly enhancing the adaptability of the algorithm.

[0068] A method for pointer extraction and reading based on GA-Otsu and RANSAC is proposed. The specific process is as follows:

[0069] Improved GA-Otsu segmentation algorithm: Use the genetic algorithm to quickly search for the optimal threshold, combine morphological thinning to remove burrs, and the segmentation accuracy (IoU) reaches 89.7%, which is 24.5% higher than that of the traditional Otsu;

[0070] RANSAC pointer fitting algorithm: Through random sampling and consistency test, tolerate the interference of outliers, and reduce the fitting error (RMSE) by 62%;

[0071] Horizontal angle method reading calculation: Combine the pre-input range information with the pointer deflection angle mapping to output the final reading.

[0072] Experiments show that the maximum absolute error of this method is 0.472, the maximum relative error is 1.732%, and the average relative error is 1.15%, fully meeting the accuracy requirements of industrial scenarios.

[0073] The specific implementation method includes the following steps:

[0074] Prior information input: Pre-input the range, unit, and scale information of the instrument to be measured through the data interface as the reference parameters for program reading.

[0075] Program deployment: Deploy the algorithm program on the embedded core processor of the unmanned device (such as the NVIDIA Jetson series) to achieve local operation.

[0076] Device initialization: Start the power module, image acquisition module, and communication unit to complete system self-check and function initialization.

[0077] Image acquisition: Take images of the on-site instrument through an industrial camera or vision sensor to obtain raw data.

[0078] Data enhancement: Use mosaic splicing, random rotation / scaling to improve the generalization ability of the model; Preprocessing: Perform adaptive bilateral filtering for noise reduction, resolution normalization (such as 640×640 pixels), and normalization operations.

[0079] Instrument detection and region cropping: Use the improved SCC-YOLO target detection network to locate the instrument region and crop it for output to the subsequent processing module.

[0080] Geometric correction: Calculate the tilt angle based on the predicted bounding box and generate a front view of the dial through affine transformation; Dial extraction: Combine the Hough gradient method and the masking method to separate the dial region; Pointer segmentation: Use the GA-Otsu algorithm to segment the pointer region and perform morphological thinning.

[0081] Pointer fitting and reading calculation: Line fitting: Extract the center line of the pointer based on the RANSAC algorithm; Angle mapping: Combine the range information and the horizontal reference line to calculate the deflection angle and output the final reading.

[0082] Data analysis and transmission: Upload the reading results to the console through the communication interface (such as RS485, Wi-Fi) to complete data storage, anomaly warning, and operating status analysis.

[0083] Data closed-loop update: Add the newly acquired instrument images to the training dataset and iteratively optimize the model performance to ensure the continuous and stable operation of the system.

[0084] The technical solution in this embodiment significantly improves the accuracy, efficiency, and robustness of automatic reading of pointer-type instruments through lightweight network design and multi-stage algorithm optimization. The improved SCC-YOLO network adopts the ShuffleBlock_lite module and SimAM attention mechanism, which improves the detection accuracy while reducing the computational complexity, and solves the problem of difficult instrument positioning in complex environments. The adaptive bilateral filtering and the tilt correction technology based on the prediction box effectively overcome the influence of noise interference and shooting angle tilt on the dial extraction, ensuring the accuracy of subsequent processing. In addition, the improved GA-Otsu algorithm quickly optimizes through genetic algorithm and combines RANSAC regression fitting, significantly improving the anti-interference ability of pointer segmentation and center line recognition, with a relatively small maximum relative error. The overall solution optimizes the end-to-end process, reduces the difficulty of algorithm deployment, can run in real time on resource-constrained embedded devices, greatly reduces manual dependence and operation and maintenance costs, and provides efficient and reliable technical support for industrial automation.

[0085] In one embodiment, Figure 4 is a block diagram of an automatic reading device for a pointer-type instrument shown according to an exemplary embodiment. As Figure 4 shown, the automatic reading device for the pointer-type instrument includes an acquisition module, an extraction module, a segmentation module, and a calculation module.

[0086] The acquisition module 41 is used to acquire an image of the instrument to be measured and preprocess the image data, including noise filtering, resolution adjustment, and data enhancement;

[0087] The extraction module 42 is used to input the preprocessed image into the improved lightweight YOLOv5 object detection network, detect and locate the instrument area, perform tilt correction on the instrument based on the prediction box, and extract the frontal view dial image;

[0088] The segmentation module 43 is used to grayscale the frontal view dial image and segment the pointer area using the improved GA-Otsu algorithm;

[0089] The calculation module 44 is used to extract the pointer center line in the pointer area through the RANSAC line fitting algorithm, and calculate the instrument reading in combination with the range information and the horizontal angle method.

[0090] The acquisition module 41, the extraction module 42, the segmentation module 43, and the calculation module 44 included in the block diagram of the automatic reading device for the pointer-type instrument are controlled to execute the automatic reading method for the pointer-type instrument described in any of the above embodiments.

[0091] As Figure 5As shown in the figure, the present invention provides an electronic device 500, which includes a communication interface, a processor 501, and a memory 502;

[0092] Among them, the memory 502 is used to store program instructions. When the program instructions are executed by the processor 501 communicatively connected to the memory 502 through the communication interface, images of the instrument to be measured are acquired, and the image data is preprocessed, including noise filtering, resolution adjustment, and data enhancement; the preprocessed images are input into an improved lightweight YOLOv5 target detection network to detect and locate the instrument area, the instrument is corrected for tilt based on the prediction box, and the frontal dial image is extracted; the frontal dial image is grayscale processed, and an improved GA-Otsu algorithm is used to segment the pointer area; the pointer center line in the pointer area is extracted through the RANSAC line fitting algorithm, and the instrument reading is calculated by combining the range information and the horizontal angle method.

[0093] The present invention provides a computer-readable storage medium, on which computer program instructions are stored. When the computer program instructions are executed by a processor, images of the instrument to be measured are acquired, and the image data is preprocessed, including noise filtering, resolution adjustment, and data enhancement; the preprocessed images are input into an improved lightweight YOLOv5 target detection network to detect and locate the instrument area, the instrument is corrected for tilt based on the prediction box, and the frontal dial image is extracted; the frontal dial image is grayscale processed, and an improved GA-Otsu algorithm is used to segment the pointer area; the pointer center line in the pointer area is extracted through the RANSAC line fitting algorithm, and the instrument reading is calculated by combining the range information and the horizontal angle method.

[0094] It should be understood that the specific features, operations, and details described above regarding the method of the present invention can also be similarly applied to the device and system of the present invention, or vice versa. In addition, each step of the method of the present invention described above can be executed by the corresponding components or units of the device or system of the present invention.

[0095] It should be understood that each module / unit of the device of the present invention can be implemented in whole or in part by software, hardware, firmware, or a combination thereof. Each module / unit can be embedded in the processor of the computer device in the form of hardware or firmware or independent of the processor, or stored in the memory of the computer device in the form of software for the processor to call to execute the operations of each module / unit. Each module / unit can be implemented as an independent component or module, or two or more modules / units can be implemented as a single component or module.

[0096] In one embodiment, a computer device is provided, which includes a memory and a processor. Computer instructions executable by the processor are stored on the memory. When the computer instructions are executed by the processor, the processor is instructed to execute the steps of the method according to the embodiments of the present invention. The computer device can generally be a server, a terminal, or any other electronic device with necessary computing and / or processing capabilities. In one embodiment, the computer device may include a processor, a memory, a network interface, a communication interface, etc. connected through a system bus. The processor of the computer device can be used to provide necessary computing, processing, and / or control capabilities. The memory of the computer device may include a non-volatile storage medium and an internal memory. An operating system, a computer program, etc. may be stored in or on the non-volatile storage medium. The internal memory can provide an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface and the communication interface of the computer device can be used to connect and communicate with external devices through a network. When the computer program is executed by the processor, the steps of the method according to the present invention are executed.

[0097] The present invention can be implemented as a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the method according to the embodiments of the present invention are caused to be executed. In one embodiment, the computer program is distributed on a plurality of network-coupled computer devices or processors, so that the computer program is stored, accessed, and executed in a distributed manner by one or more computer devices or processors. A single method step / operation, or two or more method steps / operations, can be executed by a single computer device or processor or by two or more computer devices or processors. One or more method steps / operations can be executed by one or more computer devices or processors, and one or more other method steps / operations can be executed by one or more other computer devices or processors. One or more computer devices or processors can execute a single method step / operation, or execute two or more method steps / operations.

[0098] Those of ordinary skill in the art can understand that the method steps of the present invention can be instructed by a computer program to complete relevant hardware such as computer devices or processors. The computer program can be stored in a non-transitory computer-readable storage medium. When the computer program is executed, the steps of the present invention are caused to be executed. Depending on the circumstances, any reference herein to a memory, storage, database, or other medium may include non-volatile and / or volatile memory. Examples of non-volatile memory include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), flash memory, magnetic tape, floppy disk, magneto-optical data storage device, optical data storage device, hard disk, solid state disk, etc. Examples of volatile memory include random access memory (RAM), external cache memory, etc. Through lightweight network design and multi-stage algorithm optimization, the accuracy, efficiency, and robustness of automatic recognition of pointer-type instruments have been significantly improved. The improved SCC-YOLO network adopts the SHUFFLEBLOCK_LITE module and the SIMAM attention mechanism, which improves the detection accuracy while reducing the computational complexity, and solves the problem of difficult instrument positioning in complex environments. The adaptive bilateral filtering and the tilt correction technology based on the prediction box effectively overcome the influence of noise interference and shooting angle tilt on the dial extraction, ensuring the accuracy of subsequent processing. In addition, the improved GA-OTSU algorithm quickly optimizes through the genetic algorithm and combines RANSAC regression fitting, significantly improving the anti-interference ability of pointer segmentation and center line recognition, and the maximum relative error is small.

[0099] The technical features described above can be combined arbitrarily. Although not all possible combinations of these technical features are described, any combination of these technical features should be considered to be covered by this specification as long as such a combination does not exist in contradiction.

[0100] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit them. Although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements for some or all of the technical features. And these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the scope of the technical solutions of the embodiments of the present invention.

Claims

1. An automatic recognition method for pointer-type instruments, characterized in that, Including: Obtain an image of the instrument to be measured, and preprocess the image data, including noise filtering, resolution adjustment, and data augmentation; Input the preprocessed image into an improved lightweight YOLOv5 object detection network, detect and locate the instrument area, correct the tilt of the instrument based on the prediction box, and extract the front-facing dial image; Perform grayscale processing on the front-facing dial image, and use the improved GA-Otsu algorithm to segment the pointer area; Extract the pointer center line in the pointer area through the RANSAC line fitting algorithm, and calculate the instrument reading in combination with the range information and the horizontal angle method.

2. The automatic recognition method for pointer-type instruments according to claim 1, wherein The preprocessing of the image data includes: Use an adaptive bilateral filter to filter the noise of the original image; Adjust the image resolution to a preset square size, and perform data augmentation through mosaic splicing and geometric transformation.

3. The automatic recognition method for pointer-type instruments according to claim 1, characterized in that, The improved lightweight YOLOv5 object detection network includes: The backbone network uses the ShuffleBlock_lite module for lightweight feature extraction; Introduce the CoordConv coordinate convolution module and the CARAFE lightweight upsampling module in the feature fusion stage; Strengthen the feature extraction ability through the SimAM parameter-free attention mechanism.

4. The automatic recognition method for pointer-type instruments according to claim 1, characterized in that, The tilt correction includes: Calculation of the instrument tilt angle based on the prediction box; Correct the tilted dial through affine transformation; Combine the Hough gradient method and the masking method to extract the corrected dial area.

5. The automatic recognition method for pointer-type instruments according to claim 1, characterized in that The improved GA-Otsu algorithm includes: Use the genetic algorithm to perform fast threshold search for Otsu threshold segmentation; Perform morphological thinning processing on the segmented pointer area; Remove noise interference through connected component analysis.

6. The automatic reading method for pointer-type instruments according to claim 1, characterized in that, The extraction of the pointer center line through the RANSAC line fitting algorithm and the calculation of the instrument reading in combination with the range information and the horizontal angle method include: Fit the straight line equation of the pointer center line based on the RANSAC algorithm; Calculate the pointer deflection angle in combination with the range and the horizontal reference line; Output the final indication according to the mapping relationship between the angle and the range.

7. An automatic recognition device for pointer-type instruments, characterized in that, Including: An acquisition module for acquiring an image of the instrument to be measured and preprocessing the image data, including noise filtering, resolution adjustment, and data augmentation; An extraction module for inputting the preprocessed image into an improved lightweight YOLOv5 object detection network, detecting and locating the instrument area, correcting the tilt of the instrument based on the prediction box, and extracting the front-facing dial image; A segmentation module for performing grayscale processing on the front-facing dial image and using the improved GA-Otsu algorithm to segment the pointer area; A calculation module for extracting the pointer center line in the pointer area through the RANSAC line fitting algorithm and calculating the instrument reading in combination with the range information and the horizontal angle method.

8. The automatic recognition device for pointer-type instruments according to claim 7, characterized in that: The acquisition module, the extraction module, the segmentation module, and the calculation module are controlled to execute the automatic reading method for pointer-type instruments according to any one of claims 1-6.

9. An electronic device, characterized in that, Including: A communication interface, a processor, and a memory; Wherein, the memory is used for storing program instructions, and when the program instructions are executed by the processor communicatively connected to the memory through the communication interface, the electronic device implements the automatic recognition method for pointer-type instruments according to any one of claims 1 to 6.

10. A computer-readable storage medium having program instructions stored thereon, characterized in that, When the program instructions are executed by a computer, the computer implements the automatic recognition method for pointer-type instruments according to any one of claims 1 to 6.

Citation Information

Cited By

  • Instrument reading method and system, computer readable storage medium and electronic equipment

    CN120544175A

  • Power distribution cabinet instrument intelligent identification method and system

    CN121392309A