Instrument reading recognition method and device and storage medium
By acquiring and processing multiple instrument area images, determining image deviations and generating binary images, and identifying instrument readings, the problem of low recognition accuracy in existing technologies is solved, achieving efficient and accurate instrument reading recognition.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CHINA CONSTR THIRD ENG BUREAU GRP CO LTD
- Filing Date
- 2026-04-29
- Publication Date
- 2026-07-28
AI Technical Summary
Existing recognition technologies have low accuracy in recognizing instrument readings in industrial equipment cockpit scenarios, making it difficult to meet the requirements for real-time performance and robustness, and are affected by equipment vibration and unstable LED data streams.
By acquiring multiple instrument area images, it is determined whether the image deviation information meets the stability condition. The target binarized image is collected and generated to identify the target instrument reading. A customized YOLOv2-tiny model is used to reduce background interference. Combined with inter-frame pixel difference processing and binarization threshold optimization, the LED character features are enhanced and noise is eliminated.
It improves the accuracy of instrument reading recognition, especially in complex working conditions, enhancing image clarity and recognition rate, achieving an accuracy rate of 98%, reducing computational load, and ensuring real-time recognition.
Smart Images

Figure CN122473802A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of image recognition technology, specifically to a method, device, and storage medium for recognizing instrument readings. Background Technology
[0002] Existing recognition technologies have many shortcomings in practical applications in industrial equipment cockpit scenarios, making it difficult to meet the real-time and robustness requirements of on-site operations. Vibrations during equipment operation and unstable LED data streams can easily lead to unstable video streams and poor image quality, resulting in low accuracy of instrument reading recognition in existing technologies. Summary of the Invention
[0003] This application provides a method, apparatus, and storage medium for identifying instrument readings, which can improve the accuracy of instrument reading identification.
[0004] Firstly, the method for identifying instrument readings provided in this application includes: Acquire multiple images of the first instrument area; Determine whether the image deviation information between multiple images of the first instrument area meets the preset stability condition; When the image deviation information does not meet the preset stability conditions, multiple images of the second instrument area are acquired; Generate a target binarized image based on multiple images of the second instrument area; The target binarized image is identified to obtain the target instrument reading.
[0005] Optionally, generating a target binarized image based on multiple images of the second instrument area includes: Based on the target binarization threshold corresponding to the second instrument area image, the second instrument area image is binarized to obtain an initial binarized image corresponding to the second instrument area image, and multiple initial binarized images are obtained. Determine the average grayscale value of each pixel in multiple images of the first instrument area; When the average gray value is not greater than the gray value threshold, the maximum gray value of the pixels at the same position on the multiple initial binarized images is determined as the gray value of the pixel at the corresponding position in the target binarized image, thus obtaining the target binarized image.
[0006] Optionally, the method for identifying the instrument reading further includes: When the average gray value is greater than the gray value threshold, the average gray value of the pixels at the same position on the multiple initial binarized images is determined as the gray value of the pixel at the corresponding position in the target binarized image, thus obtaining the target binarized image.
[0007] Optionally, the step of binarizing the second instrument region image based on the target binarization threshold corresponding to the second instrument region image to obtain the initial binarized image corresponding to the second instrument region image includes: Obtain multiple candidate binarization thresholds corresponding to the second instrument area image; The second instrument region image is binarized based on the multiple candidate binarization thresholds to obtain multiple candidate binarized images corresponding to the multiple candidate binarization thresholds; Determine the overall average gray value of the candidate binarized image, the average background gray value of the background pixels in the candidate binarized image, and the average foreground gray value of the foreground pixels in the candidate binarized image; Based on the overall average gray value, the background average gray value, and the foreground average gray value, the inter-class variance of the candidate classes is determined, and the inter-class variance of the candidate classes corresponding to the multiple candidate binarization thresholds is obtained. The candidate binarization threshold corresponding to the largest inter-class variance is determined as the target binarization threshold corresponding to the second instrument area image.
[0008] Optionally, determining whether the image deviation information among the multiple first instrument area images meets a preset stability condition includes: Two adjacent images of the first instrument area are defined as a group of area images, resulting in multiple groups of area images. By comparing the gray values of pixels at the same position in two first instrument region images in the region image group, the inter-frame gray value difference corresponding to multiple pixels is obtained, and the average value of the inter-frame gray value difference corresponding to multiple pixels is calculated as the average value of the inter-frame difference of the region image group, thus obtaining the average value of the inter-frame difference of multiple region image groups. The ratio of the standard deviation to the average value of the multiple inter-frame differences is determined as the deviation rate, and the deviation rate is determined as the image deviation information; When the deviation rate is less than the deviation rate threshold, the image deviation information is determined to meet the preset stability condition.
[0009] Optionally, acquiring multiple first instrument area images includes: Acquire the instrument video stream obtained by capturing images of the instrument, and extract multiple frames of the first original instrument image from the instrument video stream; Based on the target detection model, the instrument region is identified in the first original instrument image to obtain the target instrument detection region; The image in the target instrument detection area is determined as the first instrument area image, and multiple first instrument area images are obtained.
[0010] Optionally, the step of recognizing the target binarized image to obtain the target instrument reading includes: The target binarized image is denoised to obtain the denoised target binarized image; Digital region detection is performed on the denoised target binarized image to obtain a digital region image; The digital region image is input into a character segmentation model to obtain multiple character segmentation regions on the digital region image; The multiple character segmentation regions are input into the character recognition model to obtain multiple numeric characters; By concatenating multiple numerical characters, the target instrument reading is obtained.
[0011] Secondly, the instrument reading recognition device provided in this application includes: The acquisition module is used to acquire multiple images of the first instrument area; The judgment module is used to determine whether the image deviation information between multiple images of the first instrument area meets the preset stability conditions; The acquisition module is used to acquire multiple images of the second instrument area when the image deviation information does not meet the preset stability conditions; The binarization module is used to generate a target binarized image based on multiple images of the second instrument area; The recognition module is used to recognize the binary image of the target and obtain the target instrument reading.
[0012] Thirdly, the electronic device provided in this application includes a memory and a processor. The memory stores a computer program, and the processor is used to run the computer program in the memory to implement the steps in the instrument reading recognition method provided in this application.
[0013] Fourthly, the computer-readable storage medium provided in this application stores a computer program that is adapted to be loaded by a processor to implement the steps in the instrument reading identification method provided in this application.
[0014] Fifthly, the computer program product provided in this application includes a computer program that, when executed by a processor, implements the steps in the instrument reading identification method provided in this application.
[0015] In this application, compared to related technologies, multiple first instrument area images are acquired; it is determined whether the image deviation information between the multiple first instrument area images meets a preset stability condition; when the image deviation information does not meet the preset stability condition, multiple second instrument area images are acquired; a target binarized image is generated based on the multiple second instrument area images; and the target binarized image is identified to obtain the target instrument reading. This application, when multiple first instrument area images are detected to be unstable, generates and identifies a target binarized image from multiple second instrument area images, thereby improving the accuracy of instrument reading recognition. Attached Figure Description
[0016] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0017] Figure 1 This is a schematic diagram of a scenario for an instrument reading recognition system provided in an embodiment of this application; Figure 2 This is a schematic flowchart of an embodiment of the instrument reading identification method provided in this application. Figure 3 This is a schematic diagram of the first instrument area image in one embodiment of the instrument reading recognition method provided in this application; Figure 4 This is a schematic diagram of a first original instrument image in one embodiment of the instrument reading recognition method provided in this application; Figure 5 This is a schematic diagram of a target binarized image in one embodiment of the instrument reading recognition method provided in this application; Figure 6 This is a schematic diagram of a digital area image in one embodiment of the instrument reading recognition method provided in this application. Figure 7 This is a schematic flowchart of another embodiment of the instrument reading identification method provided in this application; Figure 8 This is a schematic diagram of the structure of an embodiment of the instrument reading recognition device provided in this application; Figure 9 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0018] It should be noted that the principles of this application are illustrated by example in a suitable computing environment. The following description is based on the specific embodiments of this application that are illustrated, and should not be regarded as limiting other specific embodiments not detailed herein.
[0019] In the following description of this application, "some embodiments" are referred to, which describe a subset of all possible embodiments. However, it is understood that "some embodiments" may be the same subset or different subset of all possible embodiments, and may be combined with each other without conflict.
[0020] In the following description of this application, the terms "first, second, third" are used merely to distinguish similar objects and do not represent a specific ordering of objects. It is understood that "first, second, third" may be interchanged in a specific order or sequence where permitted, so that the embodiments of this application described herein can be implemented in an order other than that illustrated or described herein.
[0021] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of this application only and is not intended to limit this application.
[0022] To improve the accuracy of instrument reading recognition, embodiments of this application provide an instrument reading recognition method, an instrument reading recognition device, an electronic device, a computer-readable storage medium, and a computer program product. The instrument reading recognition method can be executed by the instrument reading recognition device or by an electronic device integrating the instrument reading recognition device.
[0023] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0024] This application also provides an instrument reading recognition system, which includes electronic equipment. The electronic equipment integrates the instrument reading recognition device provided in this application.
[0025] To better understand the instrument reading identification method, apparatus, electronic device, and storage medium provided in the embodiments of this application, the application environment applicable to the embodiments of this application is described below.
[0026] Please see Figure 1 , Figure 1This diagram illustrates an application environment for a method for identifying instrument readings provided in an embodiment of this application. As one implementation, the method for identifying instrument readings provided in this embodiment can be applied to an electronic device. This electronic device can be, for example,... Figure 1 The server 110 shown can be connected to the terminal device 120 via a network. The network serves as a medium for providing a communication link between the server 110 and the terminal device 120. The network can include various connection types, such as wired communication links, wireless communication links, etc., and this embodiment does not limit this. Optionally, in other embodiments, the electronic device can also be a smartphone, laptop, or other terminal device.
[0027] It should be understood that Figure 1 The server 110, network, and terminal device 120 shown are merely illustrative. Depending on the implementation requirements, any number of servers, networks, and terminal devices can be included. For example, server 110 can be a physical server, a cloud server, or a server cluster composed of multiple servers, etc., and terminal device 120 can be a mobile phone, tablet computer, desktop computer, laptop computer, smartwatch, smart glasses, in-vehicle terminal, smart home terminal, cloud computer, etc. It is understood that embodiments of this application can also allow multiple terminal devices 120 to access server 110 simultaneously.
[0028] In addition, the instrument reading recognition system may also include a memory for storing raw data, intermediate data, and result data during the instrument reading recognition process. In this embodiment of the application, the storage device can be a cloud storage device. Cloud storage is a new concept that is extended and developed from the concept of cloud computing. A distributed cloud storage system (hereinafter referred to as a storage system) refers to a storage system that uses cluster applications, grid technology and distributed storage file system functions to bring together a large number of storage devices of various types in the network (storage devices are also called storage nodes) through application software or application interfaces to work together to provide data storage and business access functions to the outside world.
[0029] Currently, the storage method of storage systems is as follows: Logical volumes are created. During the creation of a logical volume, physical storage space is allocated to each logical volume. This physical storage space may consist of a single storage device or the disks of several storage devices. Clients store data on a logical volume, which means storing the data on the file system. The file system divides the data into many parts, each part being an object. Each object contains not only the data but also additional information such as a data identifier (ID). The file system writes each object to the physical storage space of that logical volume, and it records the storage location information of each object. Therefore, when a client requests access to data, the file system can allow the client to access the data based on the storage location information of each object.
[0030] The process by which a storage system allocates physical storage space to a logical volume is as follows: the physical storage space is pre-divided into strips according to the capacity estimate of the objects stored in the logical volume (this estimate often has a large margin relative to the actual capacity of the objects to be stored) and the grouping of the Redundant Array of Independent Disks (RAID). A logical volume can be understood as a strip, thus allocating physical storage space to the logical volume.
[0031] It should be noted that, Figure 1 The schematic diagram of the instrument reading recognition system shown is merely an example. The instrument reading recognition system and scenario described in this application are for the purpose of more clearly illustrating the technical solutions of this application, and do not constitute a limitation on the technical solutions provided in this application. As those skilled in the art will know, with the evolution of the instrument reading recognition system and the emergence of new business scenarios, the technical solutions provided in this application are also applicable to similar technical problems.
[0032] The following sections provide detailed descriptions of each example. It should be noted that the sequence numbers of the following embodiments are not intended to limit the preferred order of the embodiments.
[0033] Please refer to Figure 2 , Figure 2 This is a schematic flowchart of an embodiment of the instrument reading identification method provided in this application, as shown below. Figure 2 As shown, the flow of the instrument reading identification method provided in this application is as follows: 201. Acquire multiple images of the first instrument area.
[0034] The instrument can be an LED instrument, used to display readings. The first instrument area image is as follows: Figure 3 As shown. The first instrument area can have two, three, or more images, depending on the specific situation.
[0035] In one specific embodiment, the multiple first instrument area images are machine-recognized first instrument area images. Acquiring the multiple first instrument area images includes: (1) Obtain the instrument video stream obtained by shooting the instrument, and extract multiple frames of the first original instrument image from the instrument video stream.
[0036] In this embodiment, a camera and instruments are installed in the cockpit. The camera takes pictures of the instruments in the cockpit to obtain an instrument video stream, and multiple frames of first original instrument images are extracted from the instrument video stream. Specifically, 25-30 frames of the first original instrument images can be acquired per second. The first original instrument images are shown below. Figure 4 As shown.
[0037] (2) Based on the target detection model, the instrument region is identified in the first original instrument image to obtain the target instrument detection region.
[0038] In one specific embodiment, a YOLOv26-tiny model is obtained. Redundant convolutional layers are pruned from the YOLOv26-tiny model, small receptive field detection branches are removed, and cockpit instrument-specific anchor frames are designed for the instrument size and proportions of different device models to reduce the generation of background interference boxes, thus obtaining a target detection model. The first original instrument image is input into the target detection model for instrument region recognition to obtain the target instrument detection region.
[0039] Furthermore, based on the target detection model, instrument region recognition is performed on multiple first original instrument images to obtain multiple initial instrument detection regions corresponding to the multiple first original instrument images. The average of the multiple initial instrument detection regions is then calculated to obtain the target instrument detection region.
[0040] (3) The image in the target instrument detection area is determined as the first instrument area image, and multiple first instrument area images are obtained.
[0041] Specifically, the image of the first instrument area is as follows: Figure 3 As shown. In other embodiments, the plurality of first instrument area images may be pre-cropped images containing instruments.
[0042] 202. Determine whether the image deviation information between multiple first instrument area images meets the preset stability conditions.
[0043] In this embodiment of the application, determining whether the image deviation information between multiple first instrument area images meets a preset stability condition includes: (1) Two adjacent first instrument area images are defined as a region image group to obtain multiple region image groups.
[0044] Specifically, the region image group (t-1, t) includes the t-th frame image and the (t-1)-th frame image.
[0045] (2) Compare the gray values of pixels at the same position on the two first instrument area images in the area image group to obtain the inter-frame gray value difference corresponding to multiple pixels, and calculate the average value of the inter-frame gray value difference corresponding to multiple pixels as the average value of the inter-frame difference of the area image group to obtain the average value of the inter-frame difference of multiple area image groups.
[0046] Wherein, the grayscale value corresponding to the pixel in the i-th row and j-th column of the first instrument area image in the (t-1)-th frame is... The grayscale value corresponding to the pixel in the i-th row and j-th column of the first instrument area image in frame t is... The inter-frame grayscale difference corresponding to the pixel in the i-th row and j-th column is ( The absolute value of ).
[0047] Average inter-frame difference of region image group (t-1, t) The calculation formula is as follows:
[0048] Where H is the image height and W is the image width. Let be the gray value of the image at coordinates (i,j) in frame t.
[0049] (3) The ratio of the standard deviation to the average value of multiple inter-frame differences is determined as the deviation rate, and the deviation rate is determined as image deviation information.
[0050] Specifically, deviation rate The calculation formula is as follows:
[0051] in, Let be the average inter-frame difference of the region image group (t-1, t). Let be the standard deviation and u be the mean.
[0052] (4) When the deviation rate is less than the deviation rate threshold, the image deviation information is determined to meet the preset stability condition.
[0053] Specifically, deviation rate If the deviation rate is less than the deviation rate threshold, the image deviation information is determined to meet the preset stability condition. Otherwise, the image deviation information is determined to not meet the preset stability condition.
[0054] Furthermore, when the average of multiple inter-frame differences is... Less than the average threshold, and the deviation rate If the deviation rate is less than the deviation rate threshold, the image deviation information is determined to meet the preset stability condition.
[0055] 203. When the image deviation information does not meet the preset stability conditions, multiple images of the second instrument area are collected.
[0056] In this embodiment, multiple frames of second original instrument images are extracted from the instrument video stream to obtain multiple second original instrument images. The image located within the target instrument detection area of the second original instrument image is determined as the second instrument region image, resulting in multiple second instrument region images. These multiple second original instrument images are images following multiple first original instrument images. Specifically, 25-30 frames of second instrument region images are acquired.
[0057] 204. Generate a target binarized image based on multiple second instrument area images.
[0058] In this embodiment of the application, generating a target binarized image based on multiple second instrument area images includes: (1) Binarize the second instrument region image based on the target binarization threshold corresponding to the second instrument region image to obtain the initial binarized image corresponding to the second instrument region image, and obtain multiple initial binarized images.
[0059] The target binarization threshold can be preset, for example, the target binarization threshold can be 100 or 120, and can be set according to the specific situation.
[0060] Specifically, the gray value of each pixel in the second instrument area image is compared with the target binarization threshold. If the gray value of the pixel is greater than the target binarization threshold, the pixel is determined to be a foreground point, and the gray value of the corresponding pixel in the initial binarized image is 1. If the gray value of the pixel is not greater than the target binarization threshold, the pixel is determined to be a background point, and the gray value of the corresponding pixel in the initial binarized image is 0.
[0061] (2) Determine the average gray value of each pixel on multiple first instrument area images.
[0062] (3) When the average gray value is not greater than the gray value threshold, the maximum gray value of the pixel at the same position on multiple initial binarized images is determined as the gray value of the pixel at the corresponding position in the target binarized image, and the target binarized image is obtained.
[0063] The grayscale threshold can be set according to specific circumstances, for example, the grayscale threshold can be 100, 120 or other values.
[0064] In this embodiment, when the average gray value is not greater than the gray value threshold, it indicates that the scene is in low light and the data stream is unstable. The gray value of the pixel in the i-th row and j-th column of the target binarized image is... , .
[0065] in, Let N be the grayscale value of the pixel in the i-th row and j-th column of the initial binarized image of frame k, and N be the total number of initial binarized images.
[0066] In scenarios with unstable data and low light conditions, enhance the bright features of LED instrument characters and suppress background noise.
[0067] In this embodiment of the application, when the average gray value is greater than the gray value threshold, the average gray value of the pixels at the same position on multiple initial binarized images is determined as the gray value of the pixel at the corresponding position in the target binarized image, thereby obtaining the target binarized image.
[0068] In this embodiment, when the average gray value is not greater than the gray value threshold, it indicates that the scene is not in low light and the data flow is unstable. The gray value of the pixel in the i-th row and j-th column of the target binarized image is... , .
[0069] in, Let N be the grayscale value of the pixel in the i-th row and j-th column of the initial binarized image of frame k, and N be the total number of initial binarized images.
[0070] In scenarios with unstable data and high lighting, pixel-wise average values are taken for unstable scenes caused by vibration to eliminate inter-frame ghosting and improve image clarity.
[0071] In this embodiment, the second instrument region image is binarized based on the target binarization threshold corresponding to the second instrument region image. The initial binarized image corresponding to the second instrument region image includes: (1) Obtain multiple candidate binarization thresholds corresponding to the second instrument area image.
[0072] In this embodiment, the multiple candidate binarization thresholds can be selected from the range of 0-255, depending on the specific situation. For example, multiple candidate binarization thresholds can be obtained at equal intervals from the range of 0-255.
[0073] (2) The second instrument region image is binarized based on multiple candidate binarization thresholds to obtain multiple candidate binarized images corresponding to multiple candidate binarization thresholds.
[0074] Specifically, the gray value of each pixel in the second instrument area image is compared with the candidate binarization threshold. If the gray value of the pixel is greater than the candidate binarization threshold, the pixel is determined to be a foreground point, and the gray value of the corresponding pixel in the candidate binarized image is 1. If the gray value of the pixel is not greater than the candidate binarization threshold, the pixel is determined to be a background point, and the gray value of the corresponding pixel in the candidate binarized image is 0.
[0075] (3) Determine the overall average gray value of the candidate binarized image, the background average gray value of the background pixels in the candidate binarized image, and the foreground average gray value of the foreground pixels in the candidate binarized image.
[0076] The overall average gray value of the candidate binarized image is the average of the gray values of all pixels in the candidate binarized image.
[0077] (4) Based on the overall average gray value, the background average gray value and the foreground average gray value, determine the inter-class variance of the candidate classes and obtain the inter-class variance of the candidate binarization thresholds.
[0078] Furthermore, the inter-class variance of candidates is determined based on the overall average gray value, the average gray value of the background, the average gray value of the foreground, the proportion of background pixels, and the proportion of foreground pixels, thus obtaining the inter-class variance of candidates corresponding to multiple candidate binarization thresholds.
[0079] Specifically, the variance between candidate classes The calculation formula is as follows: .
[0080] in, The overall average gray value of the candidate binarized image. The average gray value of the background. The average gray value of the foreground. The percentage of background pixels. This represents the percentage of foreground pixels.
[0081] (5) The candidate binarization threshold corresponding to the largest inter-class variance is determined as the target binarization threshold corresponding to the second instrument area image.
[0082] Furthermore, when the image deviation information meets the preset stability conditions, a second instrument area image is acquired, and the single second instrument area image is binarized to obtain a single target binarized image.
[0083] 205. Identify the target's binarized image and obtain the target's instrument reading.
[0084] In this embodiment of the application, identifying the target binarized image and obtaining the target instrument reading includes: (1) Denoise the target binarized image to obtain the denoised target binarized image.
[0085] Specifically, a morphological opening operation is performed on the target binarized image to obtain a denoised target binarized image.
[0086]
[0087] Where I is the binarized image of the target, K represents the denoised binarized image of the target, where K is the structuring element (e.g., a 3×3 rectangular kernel). For corrosion / expansion operation.
[0088] Specifically, the binarized image of the target, such as Figure 5 As shown.
[0089] (2) Perform digital region detection on the denoised target binarized image to obtain the digital region image.
[0090] In this embodiment, Canny edge detection is performed on the denoised target binarized image to extract the edge contours of all objects in the image, resulting in a contour detection image. The boundary information of numbers, scales, markings, and borders is highlighted. All connected component contour regions in the contour detection image are searched to obtain all possible connected component contour regions within the instrument (including numbers, scales, indicator lights, borders, and noise), such as... Figure 5 As shown, the image includes the connected component contour regions of four digits and two indicator lights. The aspect ratio and area of each connected component contour region are determined. Connected component contour regions with aspect ratios within a threshold range and areas within an area threshold range are defined as digit contour regions. The detected digit contour regions are arranged sequentially according to their horizontal axes, and the images of these sequentially arranged digit contour regions are cropped to obtain the digit region image, thereby removing scale marks, units, thin lines, noise, and other unwanted features. The aspect ratio threshold range can be from 0.3 to 0.8, and the area threshold range can be set according to specific circumstances. The digit region image is shown below. Figure 6 As shown, noise has been removed.
[0091] (3) Input the digital region image into the character segmentation model to obtain multiple character segmentation regions in the digital region image.
[0092] The digital region image is input into the PSENet character detection network based on the lightweight backbone of MobileNetV3 to achieve pixel-level digital character segmentation, solve the problem of slight adhesion of LED digits, and output multiple character segmentation regions.
[0093] For example, a digital region image is Figure 6The digit region image is input into the character segmentation model to obtain multiple character segmentation regions in the digit region image. These multiple character segmentation regions are the character segmentation regions corresponding to the four digits.
[0094] (4) Input the multiple character segmentation regions into the character recognition model to obtain multiple numeric characters.
[0095] In this process, the CNN backbone of the CRNN+CTC recognition network is replaced with MobileNetV3, redundant LSTM layers are pruned, and only a single-layer bidirectional LSTM is retained. At the same time, the dictionary of the CTC transcription layer is optimized for the digit (0-9) + decimal point features of the cockpit LED instrument, thus obtaining the character recognition model.
[0096] The CTC loss function is shown in the following formula.
[0097]
[0098] in, For the true label sequence, π represents all sequences that can be mapped to... The set of predicted sequences, Predicting sequences for the model The probability of.
[0099] (5) Concatenate multiple numeric characters to obtain the target instrument reading.
[0100] For example, if multiple numeric characters are 1, 7, 5, 0, the target instrument reading is 1750.
[0101] Furthermore, a decimal point can be added at a preset position between multiple numeric characters. For example, adding a decimal point at the third-to-last digit of the target instrument reading will result in a target instrument reading of 17.50.
[0102] The beneficial effects of this invention include the following aspects: 1. Instrument positioning achieves both accuracy and lightweight design: By combining the customized and optimized YOLOv26-tiny model with prior knowledge from the cockpit, the model parameters and computing power requirements are significantly reduced.
[0103] 2. Adaptive frame processing of video stream effectively solves image quality problems under complex working conditions: Automatic determination of stable state of video stream is achieved by using inter-frame pixel difference. The maximum / average strategy designed for low light / unstable scenes can effectively enhance LED character features, eliminate vibration ghosting and low light noise, and improve the image character clarity by more than 80% under complex working conditions; the single frame processing strategy for stable scenes reduces the amount of computation by more than 60% and ensures real-time recognition.
[0104] 3. The design of precise digital area positioning, lightweight character detection and customized CRNN+CTC recognition is linked to eliminate the accumulation of errors caused by independent design of each link. The optimized design for LED digital adhesion and edge blurring, as well as the construction of a dedicated dictionary library, make the digital recognition accuracy of LED instrument in the cockpit ≥98%, and significantly improve the error tolerance for decimal point and continuous digit recognition.
[0105] Please refer to Figure 7 , Figure 7 This is a schematic flowchart of another embodiment of the instrument reading identification method provided in this application, as shown below. Figure 7 As shown, the flow of the instrument reading identification method provided in this application is as follows: 301. Obtain the instrument video stream captured by the instrument, and extract multiple frames of the first original instrument image from the instrument video stream.
[0106] 302. Based on the target detection model, the instrument region is identified in the first original instrument image to obtain the target instrument detection region.
[0107] 303. The image in the target instrument detection area is determined as the first instrument area image, and multiple first instrument area images are obtained.
[0108] 304. Determine whether the image deviation information between multiple first instrument area images meets the preset stability conditions.
[0109] When the image deviation information does not meet the preset stability conditions, multiple images of the second instrument area are acquired. When the image deviation information meets the preset stability conditions, one image of the second instrument area is acquired, and the single second instrument area image is binarized to obtain a single target binarized image.
[0110] 305. Acquire an image of a second instrument area and binarize the single second instrument area image to obtain a single target binarized image.
[0111] 306. Acquire multiple images of the second instrument area, and perform binarization processing on the second instrument area images based on the target binarization threshold corresponding to the second instrument area images to obtain the initial binarized images corresponding to the second instrument area images, thereby obtaining multiple initial binarized images.
[0112] 307. Determine whether the average gray value of each pixel in multiple first instrument area images is greater than the gray value threshold.
[0113] 308. The maximum gray value of the pixels at the same position on multiple initial binarized images is determined as the gray value of the corresponding pixel in the target binarized image, thus obtaining the target binarized image.
[0114] When the average gray value is not greater than the gray value threshold, the maximum gray value of the pixels at the same position on multiple initial binarized images is determined as the gray value of the corresponding pixel in the target binarized image, thus obtaining the target binarized image.
[0115] 309. The average gray value of pixels at the same position on multiple initial binarized images is used as the gray value of the corresponding pixel in the target binarized image to obtain the target binarized image.
[0116] When the average gray value is greater than the gray value threshold, the average gray value of the pixels at the same position on multiple initial binarized images is determined as the gray value of the pixel at the corresponding position in the target binarized image, thus obtaining the target binarized image.
[0117] 310. Identify the target's binarized image and obtain the target's instrument reading.
[0118] To facilitate better implementation of the instrument reading identification method provided in this application, this application also provides an instrument reading identification device based on the above-described instrument reading identification method. The meanings of the terms used are the same as in the instrument reading identification method described above; for specific implementation details, please refer to the descriptions in the above method embodiments.
[0119] Please refer to Figure 8 , Figure 8 This is a schematic diagram of an embodiment of the instrument reading recognition device provided in this application. The instrument reading recognition device may include an acquisition module 701, a judgment module 702, a data acquisition module 703, a binarization module 704, and a recognition module 705, wherein... Acquisition module 701 is used to acquire multiple images of the first instrument area; The judgment module 702 is used to determine whether the image deviation information between multiple first instrument area images meets the preset stability conditions; The acquisition module 703 is used to acquire multiple images of the second instrument area when the image deviation information does not meet the preset stability conditions; Binarization module 704 is used to generate a target binarized image based on multiple images of the second instrument area; The recognition module 705 is used to recognize the target binarized image and obtain the target instrument reading.
[0120] Please refer to Figure 9 , Figure 9 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application.
[0121] The electronic device may include a radio frequency (RF) circuit 901, a memory 902 including one or more computer-readable storage media, an input unit 903, a display unit 904, a sensor 905, an audio circuit 906, a wireless fidelity (WiFi) module 907, a processor 908 including one or more processing cores, and a power supply 909, among other components. Those skilled in the art will understand that... Figure 9 The electronic device structure shown does not constitute a limitation on the electronic device and may include more or fewer components than shown, or combine certain components, or have different component arrangements. Wherein: RF circuit 901 can be used for receiving and transmitting signals during information transmission or calls. Specifically, it receives downlink information from the base station and hands it over to one or more processors 908 for processing; additionally, it transmits uplink data to the base station. Typically, RF circuit 901 includes, but is not limited to, an antenna, at least one amplifier, a tuner, one or more oscillators, a Subscriber Identity Module (SIM) card, a transceiver, a coupler, a low-noise amplifier (LNA), a duplexer, etc. Furthermore, RF circuit 901 can also communicate wirelessly with networks and other devices. Wireless communication can use any communication standard or protocol, including but not limited to GSM, GPRS, CDMA, WCDMA, LTE, email, and SMS.
[0122] The memory 902 can be used to store software programs and modules. The processor 908 executes various functional applications and identifies instrument readings by running the software programs and modules stored in the memory 902. The memory 902 may mainly include a program storage area and a data storage area. The program storage area may store the operating system, application programs required for at least one function (such as sound playback function, image playback function, etc.), etc.; the data storage area may store data created according to the use of the electronic device (such as audio data, telephone directory, etc.). In addition, the memory 902 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device. Accordingly, the memory 902 may also include a memory controller to provide access to the memory 902 for the processor 908 and the input unit 903.
[0123] Input unit 903 can be used to receive input digital or character information, and to generate keyboard, mouse, joystick, optical, or trackball signal inputs related to user settings and function control. Specifically, in one embodiment, input unit 903 may include a touch-sensitive surface and other input devices. A touch-sensitive surface, also known as a touch display or touchpad, can collect user touch operations on or near it (e.g., user operations using fingers, styluses, or any suitable object or accessory on or near the touch-sensitive surface) and drive corresponding connection devices according to a pre-set program. Optionally, the touch-sensitive surface may include a touch detection device and a touch controller. The touch detection device detects the user's touch location and the signal generated by the touch operation, transmitting the signal to the touch controller; the touch controller receives touch information from the touch detection device, converts it into touch point coordinates, sends it to the processor 908, and can receive and execute commands from the processor 908. Furthermore, various types of touch-sensitive surfaces, such as resistive, capacitive, infrared, and surface acoustic wave, can be used. In addition to the touch-sensitive surface, input unit 903 may also include other input devices. Specifically, other input devices may include, but are not limited to, one or more of the following: physical keyboard, function keys (such as volume control buttons, power buttons, etc.), trackball, mouse, joystick, etc.
[0124] Display unit 904 can be used to display information input by the user or information provided to the user, as well as various graphical user interfaces of electronic devices. These graphical user interfaces can be composed of graphics, text, icons, video, and any combination thereof. Display unit 904 may include a display panel, optionally configured as a liquid crystal display (LCD), organic light-emitting diode (OLED), or similar form. Furthermore, a touch-sensitive surface may cover the display panel. When the touch-sensitive surface detects a touch operation on or near it, it transmits the information to processor 908 to determine the type of touch event. Subsequently, processor 908 provides corresponding visual output on the display panel according to the type of touch event. Although in the figures, the touch-sensitive surface and the display panel are shown as two separate components for implementing input and output functions, in some embodiments, the touch-sensitive surface and the display panel can be integrated to achieve both input and output functions.
[0125] Electronic devices may also include at least one sensor 905, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor may include an ambient light sensor and a proximity sensor, wherein the ambient light sensor can adjust the brightness of the display panel according to the ambient light level, and the proximity sensor can turn off the display panel and / or backlight when the electronic device is moved to the ear. As a type of motion sensor, a gravity acceleration sensor can detect the magnitude of acceleration in various directions (generally three axes), and can detect the magnitude and direction of gravity when stationary. It can be used for applications that recognize the phone's posture (such as landscape / portrait switching, related games, magnetometer posture calibration), vibration recognition-related functions (such as pedometers, taps), etc. Other sensors that may be configured in electronic devices, such as gyroscopes, barometers, hygrometers, thermometers, and infrared sensors, will not be described in detail here.
[0126] Audio circuitry 906, a speaker, and a microphone provide an audio interface between the user and the electronic device. Audio circuitry 906 converts received audio data into electrical signals, transmits them to the speaker, and the speaker converts them into sound signals for output. Conversely, the microphone converts collected sound signals into electrical signals, which are then received by audio circuitry 906, converted back into audio data, and processed by processor 908. The processed data is then transmitted via RF circuitry 901 to, for example, another electronic device, or output to memory 902 for further processing. Audio circuitry 906 may also include an earphone jack to facilitate communication between external headphones and the electronic device.
[0127] WiFi is a short-range wireless transmission technology. Electronic devices using WiFi module 907 can help users send and receive emails, browse web pages, and access streaming media, providing users with wireless broadband internet access. Although WiFi module 907 is shown in the figure, it is understood that it is not an essential component of the electronic device and can be omitted as needed without changing the essence of the invention.
[0128] The processor 908 is the control center of the electronic device. It connects various parts of the phone via various interfaces and lines, and performs various functions and processes data by running or executing software programs and / or modules stored in the memory 902, and by calling data stored in the memory 902, thereby performing overall detection of the phone. Optionally, the processor 908 may include one or more processing cores; preferably, the processor 908 may integrate an application processor and a modem processor, wherein the application processor mainly handles the operating system, user interface, and applications, and the modem processor mainly handles wireless communication. It is understood that the modem processor may also not be integrated into the processor 908.
[0129] The electronic device also includes a power supply 909 (such as a battery) that supplies power to various components. Preferably, the power supply can be logically connected to the processor 908 through a power management system, thereby enabling functions such as charging, discharging, and power consumption management through the power management system. The power supply 909 may also include one or more DC or AC power supplies, recharging systems, power fault detection circuits, power converters or inverters, power status indicators, and other arbitrary components.
[0130] Although not shown, the electronic device may also include a camera, Bluetooth module, etc., which will not be described in detail here. Specifically, in this embodiment, the processor 908 in the electronic device loads the executable files corresponding to the processes of one or more applications into the memory 902 according to the following instructions, and the processor 908 runs the applications stored in the memory 902 to realize various functions: Acquire multiple images of the first instrument area; determine whether the image deviation information between the multiple images of the first instrument area meets the preset stability condition; when the image deviation information does not meet the preset stability condition, acquire multiple images of the second instrument area; generate a target binarized image based on the multiple second instrument area images; identify the target binarized image to obtain the target instrument reading.
[0131] It should be noted that the electronic device provided in this application embodiment and the instrument reading recognition method in the above embodiment belong to the same concept. The specific implementation process can be found in the above related embodiments, and will not be repeated here.
[0132] This application also provides a computer-readable storage medium storing a computer program thereon. When the computer program stored thereon is executed on the processor of the electronic device provided in the embodiments of this application, the processor of the electronic device performs the steps in the instrument reading identification method provided in this application. The storage medium may be a magnetic disk, optical disk, read-only memory (ROM), or random access memory (RAM), etc.
[0133] This application also provides a computer program product or computer program including computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform various optional implementations of the above-described method for identifying instrument readings.
[0134] The present application provides a detailed description of an instrument reading identification method and device. Specific examples have been used to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only for the purpose of helping to understand the method and core ideas of the present application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of the present application. Therefore, the content of this specification should not be construed as a limitation of the present application.
[0135] It should be noted that when the above embodiments of this application are applied to specific products or technologies, and user-related data is involved, user permission or consent is required, and the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions.
Claims
1. A method for identifying instrument readings, characterized in that, The method for identifying the instrument readings includes: Acquire multiple images of the first instrument area; Determine whether the image deviation information between multiple images of the first instrument area meets the preset stability condition; When the image deviation information does not meet the preset stability conditions, multiple images of the second instrument area are acquired; Generate a target binarized image based on multiple images of the second instrument area; The target binarized image is identified to obtain the target instrument reading.
2. The method for identifying instrument readings according to claim 1, characterized in that, The step of generating a target binarized image based on multiple images of the second instrument area includes: Based on the target binarization threshold corresponding to the second instrument area image, the second instrument area image is binarized to obtain an initial binarized image corresponding to the second instrument area image, and multiple initial binarized images are obtained. Determine the average grayscale value of each pixel in multiple images of the first instrument area; When the average gray value is not greater than the gray value threshold, the maximum gray value of the pixels at the same position on the multiple initial binarized images is determined as the gray value of the pixel at the corresponding position in the target binarized image, thus obtaining the target binarized image.
3. The method for identifying instrument readings according to claim 2, characterized in that, The method for identifying instrument readings further includes: When the average gray value is greater than the gray value threshold, the average gray value of the pixels at the same position on the multiple initial binarized images is determined as the gray value of the pixel at the corresponding position in the target binarized image, thus obtaining the target binarized image.
4. The method for identifying instrument readings according to claim 2, characterized in that, The step of binarizing the second instrument region image based on the target binarization threshold corresponding to the second instrument region image to obtain the initial binarized image corresponding to the second instrument region image includes: Obtain multiple candidate binarization thresholds corresponding to the second instrument area image; The second instrument region image is binarized based on the multiple candidate binarization thresholds to obtain multiple candidate binarized images corresponding to the multiple candidate binarization thresholds; Determine the overall average gray value of the candidate binarized image, the average background gray value of the background pixels in the candidate binarized image, and the average foreground gray value of the foreground pixels in the candidate binarized image; Based on the overall average gray value, the background average gray value, and the foreground average gray value, the inter-class variance of the candidate classes is determined, and the inter-class variance of the candidate classes corresponding to the multiple candidate binarization thresholds is obtained. The candidate binarization threshold corresponding to the largest inter-class variance is determined as the target binarization threshold corresponding to the second instrument area image.
5. The method for identifying instrument readings according to claim 1, characterized in that, The step of determining whether the image deviation information between multiple images of the first instrument area meets a preset stability condition includes: Two adjacent images of the first instrument area are defined as a group of area images, resulting in multiple groups of area images. By comparing the gray values of pixels at the same position in two first instrument region images in the region image group, the inter-frame gray value difference corresponding to multiple pixels is obtained, and the average value of the inter-frame gray value difference corresponding to multiple pixels is calculated as the average value of the inter-frame difference of the region image group, thus obtaining the average value of the inter-frame difference of multiple region image groups. The ratio of the standard deviation to the average value of the multiple inter-frame differences is determined as the deviation rate, and the deviation rate is determined as the image deviation information; When the deviation rate is less than the deviation rate threshold, the image deviation information is determined to meet the preset stability condition.
6. The method for identifying instrument readings according to claim 1, characterized in that, The acquisition of multiple first instrument area images includes: Acquire the instrument video stream obtained by capturing images of the instrument, and extract multiple frames of the first original instrument image from the instrument video stream; Based on the target detection model, the instrument region is identified in the first original instrument image to obtain the target instrument detection region; The image in the target instrument detection area is determined as the first instrument area image, and multiple first instrument area images are obtained.
7. The method for identifying instrument readings according to claim 1, characterized in that, The process of identifying the target binarized image and obtaining the target instrument reading includes: The target binarized image is denoised to obtain the denoised target binarized image; Digital region detection is performed on the denoised target binarized image to obtain a digital region image; The digital region image is input into a character segmentation model to obtain multiple character segmentation regions on the digital region image; The multiple character segmentation regions are input into the character recognition model to obtain multiple numeric characters; By concatenating multiple numerical characters, the target instrument reading is obtained.
8. A device for identifying instrument readings, characterized in that, The instrument reading recognition device includes: The acquisition module is used to acquire multiple images of the first instrument area; The judgment module is used to determine whether the image deviation information between multiple images of the first instrument area meets the preset stability conditions; The acquisition module is used to acquire multiple images of the second instrument area when the image deviation information does not meet the preset stability conditions; The binarization module is used to generate a target binarized image based on multiple images of the second instrument area; The recognition module is used to recognize the binary image of the target and obtain the target instrument reading.
9. An electronic device, characterized in that, The method includes a memory and a processor, the memory storing a computer program and the processor running the computer program in the memory to perform the steps in the instrument reading identification method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a plurality of instructions adapted for loading by a processor to perform the steps in the method for identifying instrument readings according to any one of claims 1 to 7.