Instrument reading automatic identification method and system, electronic equipment and computer readable storage medium
Through the automated instrument reading recognition method, the digital information and pointer information of the instrument panel are extracted and the reading is calculated, which solves the problems of low efficiency and poor accuracy of traditional manual readings, and achieves more efficient and accurate instrument data acquisition.
Patent Information
- Application Number
- CN202411328125.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-24
- Publication Date
- 2025-01-03
- Estimated Expiration
- 2044-09-24
AI Technical Summary
Traditional pointer instrument readings require manual observation, resulting in low reading efficiency, poor accuracy, inability to obtain in time, and difficult to deal with various environmental and operational challenges.
By obtaining the initial image of the instrument panel for preprocessing, digital information, range information, scale information and pointer information are extracted, pointer angle and unit reading are calculated, automated instrument reading recognition, and reading accuracy and efficiency are improved.
It realizes the automation of instrument readings, improves the accuracy and efficiency of readings, reduces manual intervention, avoids interference with image clarity by factors such as lighting and occlusion, and enhances the accuracy of recognition.
Smart Images

Figure CN119251815A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of instrument identification, and in particular relates to an automatic identification method and system for instrument readings, an electronic device and a computer-readable storage medium. Background Art
[0002] With the development of industry, pointer instruments have become an important tool for monitoring the operating status of equipment. Traditionally, reading pointer instruments by manual observation is used to understand changes in equipment and environment. Manual reading has problems such as failure to obtain readings in time, low reading efficiency, and reading errors. With the widespread application of pointer instruments, in order for pointer instruments to better cope with various environmental and operational challenges, the requirements for automatic identification technology of pointer instruments are getting higher and higher. Therefore, it is necessary to provide an instrument dial automatic identification method and system to achieve more accurate and automated instrument readings. Summary of the invention
[0003] The object of the present invention is to provide a method, system, electronic device and computer-readable storage medium for automatically identifying meter readings, so as to solve the problems of low accuracy and low efficiency of meter readings.
[0004] The present invention is achieved through the following technical solutions: A method for automatically identifying meter readings, comprising: S1, obtaining an initial dial image of a target instrument dial; S2, preprocessing the initial dial image to obtain a preset image; S3. Obtain digital information and range information according to a preset image, wherein the digital information includes all the numbers on the dial, and the range information includes the detection range of the dial; S4. Obtaining dial features according to the digital information, where the dial features are used to reflect the basic structure and type of the dial; S5. Obtaining scale information and pointer information according to the dial feature and the preset image, wherein the scale information refers to the position distribution information of the scale relative to the dial, and the pointer information refers to the position distribution information of the pointer relative to the dial; S6. Obtaining a pointer angle of the pointer according to the pointer information, where the pointer angle is an angle that the pointer rotates in a clockwise direction relative to a horizontal line; S7, obtaining a first angle and a second angle of the dial according to the digital information, the scale information and the dial characteristics, wherein the first angle refers to an angle corresponding to the starting scale, and the second angle refers to an angle corresponding to the ending scale; S8. Obtaining a unit reading of the target instrument according to the range information, the first angle, and the second angle, wherein the unit reading refers to a reading value corresponding to each rotation of the pointer of the target instrument by 1°; S9. Obtain the dial reading of the target instrument according to the pointer angle and the unit reading.
[0005] In some embodiments, the step of acquiring an initial dial image of a target instrument dial includes: Capturing a first image of the target instrument through a first camera, and determining whether the quality of the first image meets a first preset condition; When the quality of the first image meets the first preset condition, using the first image as the initial dial image; When the quality of the first image does not meet the first preset condition, adjusting the second camera parameter according to the quality of the first image; Acquire a second image of the target instrument by using a second camera; and determine whether the quality of the second image meets a first preset condition; When the quality of the second image meets the first preset condition, using the second image as the initial dial image; When the quality of the second image does not meet the first preset condition, the second camera parameters are readjusted according to the quality of the second image, and the second image is recaptured until the quality of the recaptured second image meets the first preset condition, and the second image that meets the first preset condition is used as the initial dial image.
[0006] In some embodiments, the step of obtaining the dial features according to the digital information refers to obtaining the dial features according to the trained dial model through the digital information, and the step of obtaining the dial features according to the trained dial model through the digital information includes: Inputting the initial dial image into the dial type determination layer of the dial model; The dial type determination layer processes the input initial dial image to obtain digital information, obtains a first fitting curve of the initial dial image according to the digital information, and obtains a dial type corresponding to the initial dial image according to the first fitting curve; The dial type is input into the dial feature determination layer of the dial model for processing to obtain the dial features corresponding to the initial dial image.
[0007] In some embodiments, the step of obtaining scale information and pointer information according to the dial features and the preset image includes: Obtain a pixel point set according to dial features and a preset image; Setting a first threshold range and a second threshold range, wherein the first threshold range is different from the second threshold range; Determine whether the area of the pixel set is within a first threshold range or a second threshold range; When the area of the pixel point set is within a first threshold range, obtaining scale information; When the area of the pixel point set is within a second threshold range, obtaining pointer information; The pixel point set is a set of pixel points corresponding to the dial scale or a set of pixel points corresponding to the dial pointer, the first threshold range is the area range of the pixel point set corresponding to the dial scale, and the second threshold range is the area range of the pixel point set corresponding to the dial pointer; the area of the pixel point set refers to the area of the line fitted by the coordinates of the pixel points in the reference coordinate system, and the reference coordinate system is a coordinate system established with any point in the initial dial image as the origin.
[0008] In some embodiments, the step of obtaining a pointer angle of the pointer according to the pointer information includes: Obtain the pointer contour line of the pointer according to the pointer information; Get the pointer endpoint of the pointer according to the pointer outline; Gets the pointer angle of a pointer based on the pointer endpoint and dial characteristics.
[0009] In some embodiments, the step of obtaining the first angle and the second angle of the dial according to the digital information, the scale information and the dial features includes: Obtain the starting scale and the ending scale according to the digital information and the scale information; Connect the center point of the starting scale and the center of the dial in the dial feature to generate a first fitting line, and the angle between the first fitting line and the x-axis of the reference coordinate system is the first angle of the dial; Connect the center point of the end scale and the center of the dial in the dial feature to generate a second fitting line, and the angle between the second fitting line and the x-axis of the reference coordinate system is the second angle of the dial; The center point of the starting scale is the center pixel point of the set of pixel points corresponding to the starting scale, the center point of the ending scale is the center pixel point of the set of pixel points corresponding to the ending scale, and the reference coordinate system refers to a coordinate system established with any point in the initial dial image as the origin.
[0010] In some embodiments, the dial reading of the target instrument is obtained by multiplying the difference between the pointer angle and the first angle by the unit reading.
[0011] The present invention also relates to an automatic meter reading recognition system, comprising: An image acquisition module is used to acquire an initial dial image of a target instrument dial and preprocess the initial dial image to obtain a preset image; A first information determination module, used to obtain digital information and range information according to a preset image; A dial feature determination module, used to obtain dial features according to digital information; A second information determination module, used to obtain scale information and pointer information according to dial features and a preset image; The reading determination module is used to obtain the pointer angle of the pointer according to the pointer information; obtain the first angle and the second angle of the dial according to the digital information, the scale information and the dial characteristics; obtain the unit reading of the target instrument according to the range information, the first angle and the second angle; obtain the dial reading of the target instrument according to the pointer angle and the unit reading.
[0012] The present invention also relates to an electronic device, comprising: processor; and, A memory, configured to store executable instructions of the processor; Wherein, the processor is configured to perform the above-mentioned automatic meter reading identification method by executing the executable instructions.
[0013] The present invention also relates to a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the above-mentioned automatic meter reading recognition method is implemented.
[0014] Compared with the prior art, the present invention has the following advantages and beneficial effects: 1. Preprocess the acquired initial dial image to obtain a preset image, obtain digital information, range information, scale information, and pointer information based on the preset image, obtain the pointer angle and unit reading based on the digital information, range information, scale information, and pointer information, and obtain the dial reading based on the pointer angle and unit reading, without relying on manual reading, realize automatic instrument reading, and improve the efficiency and accuracy of instrument reading.
[0015] 2. By determining whether the quality of the first image captured by the first camera and the quality of the second image captured by the second camera meet the first preset condition, an initial dial image that meets the quality requirements is obtained, which is beneficial to subsequent image processing and analysis, avoids interference with the clarity of the dial image due to factors such as lighting or occlusion, and improves the accuracy of automatic recognition of instrument readings.
[0016] 3. The initial dial image obtains a first fitting curve through a dial model that meets preset conditions, and the dial features are obtained according to the first fitting curve, so that the obtained dial features are more accurate, thereby improving the accuracy of the meter reading.
[0017] 4. Obtain the pointer contour line based on the pointer information; obtain the pointer endpoint based on the pointer contour line; obtain the pointer angle based on the pointer endpoint and the dial center in the dial feature, so as to accurately identify and calculate the pointer angle of the target instrument dial and improve the accuracy of the instrument reading. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.
[0019] Figure 1 The figure is a flow chart of a method for automatically identifying meter readings in an embodiment of the present invention.
[0020] Figure 2 The flowchart of obtaining an initial dial image of a target instrument dial in an embodiment of the present invention.
[0021] Figure 3 This is a flow chart of obtaining dial features through a dial model using digital information in an embodiment of the present invention.
[0022] Figure 4 The flowchart of obtaining the pointer angle of the pointer according to the pointer information in an embodiment of the present invention.
[0023] Figure 5 The figure is a flow chart of the automatic identification system for meter readings in an embodiment of the present invention.
[0024] Figure 6 Schematic diagram of an application scenario of the automatic identification system for meter readings in an embodiment of the present invention.
[0025] Among them: 110-processing equipment, 120-network, 130-storage equipment, 140-monitoring equipment, 150-target instrument. DETAILED DESCRIPTION
[0026] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments.
[0027] Example 1 Reference Figure 1 , a method for automatically identifying meter readings includes: S1, obtaining an initial dial image of a target instrument dial; S2, preprocessing the initial dial image to obtain a preset image; S3. Obtain digital information and range information according to a preset image, wherein the digital information includes all the numbers on the dial, and the range information includes the detection range of the dial; S4. Obtaining dial features according to the digital information, where the dial features are used to reflect the basic structure and type of the dial; S5. Obtaining scale information and pointer information according to the dial feature and the preset image, wherein the scale information refers to the position distribution information of the scale relative to the dial, and the pointer information refers to the position distribution information of the pointer relative to the dial; S6. Obtaining a pointer angle of the pointer according to the pointer information, where the pointer angle refers to an angle at which the pointer rotates in a clockwise direction based on the straight line where the horizontal line is located; S7, obtaining a first angle and a second angle of the dial according to the digital information, the scale information and the dial characteristics, wherein the first angle refers to an angle corresponding to the starting scale, and the second angle refers to an angle corresponding to the ending scale; S8. Obtaining a unit reading of the target instrument according to the range information, the first angle, and the second angle, wherein the unit reading refers to a reading value corresponding to each rotation of the pointer of the target instrument by 1°; S9. Obtain the dial reading of the target instrument according to the pointer angle and the unit reading.
[0028] The acquired initial dial image is preprocessed to obtain a preset image, and digital information, range information, scale information, and pointer information are obtained according to the preset image. The pointer angle and unit reading are obtained according to the digital information, range information, scale information, and pointer information. The dial reading is obtained according to the pointer angle and unit reading, without relying on manual reading, and automatic instrument reading is realized, thereby improving the efficiency and accuracy of instrument reading.
[0029] The target instrument dial refers to the dial of the instrument whose readings need to be collected. For example, when it is necessary to collect readings of the ammeter in the factory, the target dial is the dial of the ammeter installed at different locations; when it is necessary to collect readings of the pressure gauge in the gas pipeline, the target dial is the dial of the electric pressure gauge installed at different gas pipelines.
[0030] Reference Figure 2 , the steps of obtaining the initial dial image of the target instrument dial include: The first image of the target instrument is acquired through the first camera. The angle and position of the first camera are set, and the first camera is fixedly installed so that the first camera is aimed at the dial of the target instrument, and the dial of the target instrument is photographed by the first camera to acquire the first image. Due to the influence of lighting environment factors, the quality of the first image acquired each time is different; for example, when the light is too strong, the first image is easy to reflect light, and the first image obtained has a reflective area.
[0031] Determine whether the quality of the first image meets the first preset condition. The factors determining the image quality include image light uniformity, the position of the shadow area, the exposure area, the reflective area, etc. The clearer the image, the higher the image quality. The first preset bar can be set as the reflective area of the first image is less than the area threshold, or the reflective area of the first image does not belong to the area where the pointer is located, etc.
[0032] When the quality of the first image meets the first preset condition, the first image is used as the initial dial image; when the quality of the first image does not meet the first preset condition, the second camera parameters are adjusted according to the quality of the first image.
[0033] The second camera is used to capture the second image of the target instrument. The second camera is set on the adjustment arm and can move with the adjustment arm. The position and angle of the second camera can be adjusted by adjusting the adjustment arm. For example, the angle of the second camera is rotated by 30°, and the position height is reduced by 10cm. After the second camera adjusts the parameters according to the quality of the first image, the second camera is used to shoot the dial of the target instrument to obtain a second image with a different perspective from the first camera.
[0034] Determine whether the quality of the second image satisfies a first preset condition; when the quality of the second image satisfies the first preset condition, use the second image as the initial dial image; when the quality of the second image does not meet the first preset condition, readjust the parameters of the second camera according to the quality of the second image, and re-shoot the dial with the second camera after the readjusted parameters to obtain a new second image, until the quality of the re-obtained second image meets the first preset condition, and use the second image that meets the first preset condition as the initial dial image.
[0035] By determining whether the quality of the first image captured by the first camera and the quality of the second image captured by the second camera meet the first preset condition, an initial dial image that meets the quality requirements is obtained, which is beneficial to subsequent image processing and analysis, avoids interference with the clarity of the dial image due to factors such as lighting or occlusion, and improves the accuracy of automatic recognition of instrument readings.
[0036] Among them, the preprocessing methods include image processing technology, preset image generation rules, and binarization processing.
[0037] Image processing techniques include brightness adjustment, median filtering, and grayscale stretching.
[0038] The preset image generation rules include grayscale threshold and affine transformation.
[0039] Grayscale threshold refers to setting the grayscale threshold of the pixel in the initial dial image, and generating black dots or white dots according to the grayscale threshold. For example, if the grayscale threshold is set to 150, if the pixel in the initial dial image is greater than the grayscale threshold, the pixel in the generated preset image will be a black dot; if the pixel in the initial dial image is less than the grayscale threshold, the pixel in the generated preset image will be a white dot, and the preset image of the target instrument dial will be generated based on the white and black dots.
[0040] Affine transformation refers to a transformation method that does not change the original features of the image. Affine transformation includes translation transformation, tilt transformation, rotation transformation, scaling transformation, mirror transformation, and flip transformation.
[0041] A two-dimensional reference coordinate system is established with the straight line where the horizontal line is located as the x-axis, any point in the initial dial image as the origin, and a straight line perpendicular to the x-axis and intersecting the origin as the y-axis, or a three-dimensional reference coordinate system, a polar coordinate reference coordinate system, etc. Based on the two-dimensional reference coordinate system, the translation transformation refers to the horizontal and vertical coordinates (x, y) of the pixel point in the initial dial image being translated by a specified value along the x-axis or y-axis direction; the tilt transformation refers to the angle at which the initial dial image is tilted around the rotation center, and the rotation center is preset. For example, the tilt transformation can be performed by setting the upper left corner of the initial dial image as the rotation center and rotating 15° counterclockwise around the rotation center; when the initial dial image is rotated, the rotation angle of the initial dial image can be 45°, 60°, 90°, etc.; the scaling transformation refers to scaling or deforming the initial dial image, for example, scaling the elliptical initial dial image into a circular preset image; the axes of the mirror transformation and flip transformation are any position in the initial dial image; the flip transformation includes vertical flip transformation and horizontal flip transformation, etc.
[0042] The binarization process includes a threshold segmentation method, a normalization algorithm, a binary image matching algorithm model, etc. The initial dial image is subjected to the binarization process to obtain a binary image, which is a preset image obtained after the initial dial image is subjected to the binarization process.
[0043] The obtaining of digital information and range information according to the preset image refers to obtaining digital information through text recognition technology and obtaining range information according to the digital information, for example, extracting digital information from a binary image through OCR technology.
[0044] The digital information includes all the numbers on the dial, including the starting digital information and the ending digital information. The starting digital information is used to reflect the value corresponding to the scale at the smallest number that the instrument pointer can indicate, and the ending digital information is used to reflect the value corresponding to the scale at the largest number that the instrument pointer can indicate. Among all the numbers obtained, the number with the smallest value is the starting number, and the number with the largest value is the ending number. For example, all digital information is sorted according to the size of the numbers, and the first and last numbers in the sort are respectively determined as the initial number and the ending number of the target instrument dial; or, all digital information is input into the sorting model, and the initial number and the ending number are output.
[0045] The range information includes the detection range of the instrument, for example, the range information is 10MPa. Obtaining the range information according to the digital information means taking the ending digital information as the range information; or taking the difference between the ending digital and the initial digital as the range information.
[0046] Among them, the dial features are used to reflect the basic structure and type of the dial. The dial features include the dial center, rotation center, scale, numbers, pointer, etc. The dial center is the fixed point at one end of the pointer, that is, the rotation center of the pointer; the scale is used to display the value that the pointer passes, including multiple scale lines; the pointer rotates around the rotation center to display the position of the target instrument in the dial numbers.
[0047] Methods for obtaining dial features based on digital information include: (1) Use OCR technology to identify the digital information of the dial, combine it with mathematical morphology filtering or Hough algorithm to process the digital information, and analyze the connected domain composed of digital points to obtain the dial features such as the dial center, scale, and pointer.
[0048] For example, when the dial feature is a pointer, the above method is used until a connected domain composed of digital points is found that meets the preset conditions of the pointer, then the connected domain is determined to be a pointer, and the straight line corresponding to the pointer is extracted; the preset conditions of the pointer include but are not limited to the points in the connected domain being continuous, and the length of the connected domain being greater than a length threshold, and the length threshold is a preset value.
[0049] (2) The digital information obtains the dial features through the trained dial model. The input of the dial model is the initial dial image, and the output of the dial model is the dial features.
[0050] The dial models include machine learning models, recurrent neural network (RNN) models, deep neural network (DNN) models, graph neural network (GNN) models, etc.
[0051] The training method of the dial model includes: A. A large number of sample dial images of the first training samples with identification are input into the dial model, and the dial features output by the dial model and the labels of the first training samples are used to construct a first loss function. The first loss function iteratively updates the parameters of the initial dial model until a second preset condition is met, and the parameters in the dial model are determined to obtain a trained dial model. The first training sample includes a sample dial image containing a first fitting curve; the label of the first training sample includes the rotation center, scales, numbers, pointer identification, such as an identification box, of the sample dial image; the second preset condition includes but is not limited to the convergence of the first loss function, the training cycle reaching a threshold, etc.
[0052] B. Input the sample dial image of the second training sample into the dial type determination layer, input the output of the dial type determination layer into the dial feature determination layer, construct a second loss function with the output of the dial feature determination layer and the second label, and iteratively update the parameters of the initial dial type determination layer and the initial dial feature determination layer with the second loss function until the third preset condition is met, determine the parameters in the dial type determination layer and the dial feature determination layer, and obtain a trained dial model, that is, input the second training sample and obtain the trained dial model by jointly training the dial type determination layer and the dial feature determination layer; The second training sample includes a sample dial image containing the first fitting curve, and the label of the second training sample includes the rotation center, scales, numbers, and pointer identification of the sample dial image, such as an identification box; the third preset condition includes but is not limited to the convergence of the second loss function, the training cycle reaching a threshold, etc.
[0053] Reference Figure 3 The dial model includes a dial type determination layer and a dial feature determination layer. The step of obtaining the dial feature by using the dial model trained with the second training sample includes: inputting the initial dial image into the dial type determination layer of the dial model, the dial type determination layer processes the input initial dial image to obtain digital information, obtaining a first fitting curve of the initial dial image according to the digital information, obtaining a dial type corresponding to the initial dial image according to the first fitting curve, inputting the dial type into the dial feature determination layer of the dial model for processing, and obtaining the dial feature corresponding to the initial dial image.
[0054] The initial dial image obtains a first fitting curve through a dial model that meets the third preset condition, and the dial features are obtained according to the first fitting curve, so that the obtained dial features are more accurate, thereby improving the accuracy of the meter reading.
[0055] (3) Obtain a first fitting curve of the dial according to the digital information, and obtain the dial center of the dial feature according to the first fitting curve.
[0056] The first fitting curve is a curve obtained by curve fitting the point where the digital information of the dial is located, and the point where the digital information is located is the central pixel point of the set of pixel points corresponding to the digital number. Therefore, the first fitting curve is a curve obtained by curve fitting the central pixel point of the set of pixel points corresponding to the digital number of the dial. The curve fitting method includes the least square method, the RBF (Radial Basis Function) curve fitting method or the cubic spline curve fitting method. The first fitting curve can be a curve with a certain curvature, for example, a circular arc or an elliptical arc.
[0057] The method for obtaining the central pixel point includes: A. representing the position of the central pixel point by two-dimensional coordinates; B. taking the means of the horizontal and vertical coordinates in the set of pixel points as the coordinates of the central pixel point; C. using the K-means clustering algorithm to obtain the position of the central pixel point. (4) Obtain a first fitting curve of the dial according to the digital information, and obtain the dial center of the dial feature according to the coordinates of the midpoint of the arc where the first fitting curve is located and the preset image. For example, when the coordinates of the midpoint of the arc where the first fitting curve is located are (x1, y1), the coordinates of the dial center are obtained by the intersection of the straight line where y=y1 is located and the dial center in the preset image.
[0058] Among them, the scale information refers to the position distribution information of the scale relative to the dial obtained based on the dial characteristics and preset images; the pointer information refers to the position distribution information of the pointer relative to the dial obtained based on the dial characteristics and preset images.
[0059] The step of obtaining scale information and pointer information according to dial features and preset images includes: obtaining a pixel point set according to the dial features and the preset image, the pixel point set being a set of pixel points corresponding to the dial scale or a set of pixel points corresponding to the dial pointer; setting a first threshold range and a second threshold range, wherein the first threshold range is different from the second threshold range, and determining whether the area of the pixel point set falls within the first threshold range or the second threshold range to determine whether the corresponding pixel point set corresponds to a scale or a pointer; obtaining scale information when the area of the pixel point set is within the first threshold range; obtaining pointer information when the area of the pixel point set is within the second threshold range; the first threshold range is the area range of the pixel point set corresponding to the dial scale, and the second threshold range is the area range of the pixel point set corresponding to the dial pointer; the area of the pixel point set is calculated by the area of the line fitted by the coordinates of the pixel points in the reference coordinate system; a pixel point set can correspond to a fitted line.
[0060] For example, the first threshold range is set to 0-1.5 cm 2 , the second threshold range is 1.5-10cm 2 , if the area of the line fitted by the coordinates of a certain pixel point set in the preset image in the reference coordinate system is 3cm 2 , get the pointer corresponding to the pixel point set; The dial type is a pressure gauge, and the first threshold range is set to 0-1cm 2 , the second threshold range is 1.5-5cm 2 , if the area of the pixel set in the preset image is 0.5cm 2 , and obtain the scale corresponding to the pixel set.
[0061] The pointer angle refers to the angle between the straight line where the pointer outline is located and the horizontal line, that is, the angle that the pointer rotates in the clockwise direction relative to the horizontal line; the horizontal line is 0°.
[0062] Reference Figure 4 The step of obtaining the pointer angle of the pointer according to the pointer information includes: The pointer contour of the pointer is obtained according to the pointer information, specifically, the contour is extracted according to the coordinates of the pixel point set corresponding to the pointer in the reference coordinate system.
[0063] The pointer endpoint of the pointer is obtained according to the pointer contour line. Specifically, the position of the pointer tip is obtained according to the pointer contour line, and the pointer endpoint is obtained according to the pixel point where the pointer tip position is located; the coordinates of the pointer endpoint are the coordinates of the pixel point where the pointer tip position is located in the reference coordinate system.
[0064] The pointer angle of the pointer is obtained according to the pointer endpoint and the dial feature. Specifically, according to the line connecting the pointer endpoint and the dial center in the dial feature, the angle of the line rotated clockwise along the straight line where the x-axis of the reference coordinate system is located is determined as the pointer angle.
[0065] The pointer contour line is obtained according to the pointer information; the pointer endpoint is obtained according to the pointer contour line; the pointer angle is obtained according to the pointer endpoint and the dial center in the dial feature, so as to realize accurate recognition and calculation of the pointer angle of the target instrument dial and improve the accuracy of the instrument reading.
[0066] Among them, the first angle of the dial refers to the angle corresponding to the starting scale, which is the smallest scale that the instrument can measure, and the starting scale is the scale where the center pixel point of the pixel point set corresponding to the starting number is located; the second angle of the dial refers to the angle corresponding to the ending scale, which is the largest scale that the instrument can measure, and the ending scale is the scale where the center pixel point of the pixel point set corresponding to the ending number is located.
[0067] The step of obtaining a first angle and a second angle of the dial according to digital information, scale information and dial features comprises: The center point of the starting scale and the center of the dial are connected to generate a first fitting line, and the angle between the first fitting line and the x-axis of the reference coordinate system is the first angle of the dial; the center point of the ending scale and the center of the dial are connected to generate a second fitting line, and the angle between the second fitting line and the x-axis of the reference coordinate system is the second angle of the dial; the center point of the starting scale is the center pixel point of the set of pixel points corresponding to the starting scale, and the center point of the ending scale is the center pixel point of the set of pixel points corresponding to the ending scale; the first angle is smaller than the second angle, for example, the first angle is 0°, and the second angle is 180°.
[0068] The unit reading of the target instrument refers to the reading value corresponding to each time the pointer of the target instrument rotates 1°.
[0069] An example of obtaining a unit reading of a target instrument based on range information, a first angle, and a second angle: the first angle is 30°, the second angle is 150°, the range information is 120 km / h, and a unit reading of 1 km / h is obtained.
[0070] Among them, the dial reading is used to reflect the operating information of the object measured by the instrument; for example, when the instrument is used to measure speed, the dial reading is 60 km / h; when the instrument is used to measure voltage, the dial reading is 20 V.
[0071] Obtaining the dial reading of the target instrument according to the pointer angle and the unit reading means multiplying the difference between the pointer angle and the first angle by the unit reading to obtain the dial reading of the target instrument; for example, the pointer angle is 60°, the first angle is 30°, the unit reading is 1 km / h, and the dial reading obtained is (60-30)×1=30 km / h.
[0072] The present invention also relates to an automatic meter reading recognition system, referring to Figure 5 ,include: An image acquisition module is used to acquire an initial dial image of a target instrument dial and preprocess the initial dial image to obtain a preset image; A first information determination module, used to obtain digital information and range information according to a preset image; A dial feature determination module is used to obtain dial features based on digital information: A second information determination module, used to obtain scale information and pointer information according to dial features and a preset image; The reading determination module is used to obtain the pointer angle of the pointer according to the pointer information; obtain the first angle and the second angle of the dial according to the digital information, the scale information and the dial characteristics; obtain the unit reading of the target instrument according to the range information, the first angle and the second angle; obtain the dial reading of the target instrument according to the pointer angle and the unit reading.
[0073] Reference Figure 6 ,The application scenarios of the instrument reading automatic recognition system include: The processing device 110 is used to process the data and information of the meter reading automatic recognition system and execute the program instructions according to the processing results. After receiving the curve fitting instruction of the meter reading automatic recognition system, the processing device 110 performs curve fitting on the digital information. After receiving the second image acquisition instruction of the meter reading automatic recognition system, the processing device 110 collects the second image of the target meter 150 through the second camera. The processing device 110 is connected to the storage device 130 through the network 120. The processing device 110 includes a central processing device 110 (CPU), an application-specific integrated circuit (ASIC), an application-specific instruction processing device 110 (ASIP), a graphics processing device 110 (GPU), a physical processing device 110 (PPU), a digital signal processing device 110 (DSP), a field programmable gate array (FPGA), a programmable logic circuit (PLD), a controller, a microcontroller unit, a reduced instruction set computer (RISC), a microprocessing device 110, etc. The processing device 110 uses a single-core processing device 110 or a multi-core multi-core processing device 110.
[0074] The network 120 is used to provide a network 120 that can facilitate information and data exchange among the modules in the meter reading automatic identification system. For example, the network 120 sends the initial dial image obtained by the monitoring device 140 to the processing device 110. The network 120 includes a wired network 120 and a wireless network 120. The modules of the meter reading automatic identification system are connected and communicate data through the wired network 120 or the wireless network 120; the network 120 is a point-to-point, shared, centralized, or other topological structure, or a combination of multiple topological structures; the network 120 includes one or more network 120 access points, for example, the network 120 includes a wired or wireless network 120 access point.
[0075] The storage device 130 is used to store data, instructions, and other information. The storage device 130 stores data obtained from the processing device 110 and the monitoring device 140. For example, the storage device 130 stores the first image and the second image of the target instrument 150 obtained by the monitoring device 140. The storage device 130 includes a large-capacity memory, a removable memory, a volatile read-write memory, a read-only memory (ROM), etc. The large-capacity memory includes a magnetic disk, an optical disk, a solid-state disk, etc. The storage device 130 is implemented on a cloud platform.
[0076] The monitoring device 140 is used to collect data and information, for example, the monitoring device 140 is used to collect images, videos, sounds, etc. The monitoring device 140 sends the collected data and information to the processing device 110 via the network 120, or sends it to the storage device 130 via the network 120; the processing device 110 obtains the initial dial image of the target instrument 150 from the monitoring device 140, and generates a preset image according to the initial dial image. The monitoring device 140 includes devices such as data cameras and cameras. The number of the monitoring device 140 is one or more, for example, the monitoring device 140 includes a first camera and a second camera.
[0077] The target instrument 150 refers to an instrument that displays numerical values. The target instrument 150 includes flow meters, pressure meters, speed meters, electrical instruments, electronic measuring instruments, mechanical measuring instruments, and industry-specific testing instruments, etc. The electrical instruments include ammeters, voltmeters, current power frequency meters, megohmmeters, and multimeters. Electronic measuring instruments include level meters and viscometers. Mechanical measuring instruments include thickness gauges, altimeters, force measuring instruments, and speed measuring instruments. Industry-specific testing instruments include wind speed, wind temperature, and air volume meters, temperature and humidity meters, sound level meters, and mercury meters, etc. The monitoring device 140 shoots the target instrument 150 to obtain an initial dial image of the target instrument 150.
[0078] The present invention also relates to an electronic device, comprising: processor; and, A memory, configured to store executable instructions of the processor; The processor is configured to execute the above-mentioned automatic meter reading identification method by executing the executable instructions. The present invention also relates to a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the above-mentioned automatic meter reading recognition method is implemented.
[0079] The above description is only a preferred embodiment of the present invention and does not limit the present invention in any form. Any simple modification or equivalent change made to the above embodiment based on the technical essence of the present invention shall fall within the protection scope of the present invention.
Claims
1. A method for automatically identifying meter readings, characterized in that: include: S1, obtaining an initial dial image of a target instrument dial; S2, preprocessing the initial dial image to obtain a preset image; S3, obtaining digital information and range information of the target instrument dial according to the preset image, wherein the digital information includes information of all numbers on the dial, and the range information includes detection range information of the dial; S4. Obtaining dial features according to the digital information, wherein the dial features are used to determine the type of the dial; S5. Obtaining scale information and pointer information according to the dial feature and the preset image, wherein the scale information refers to the position distribution information of the scale relative to the dial, and the pointer information refers to the position distribution information of the pointer relative to the dial; S6. Obtaining a pointer angle of the pointer according to the pointer information, where the pointer angle is an angle that the pointer rotates in a clockwise direction relative to a horizontal line; S7, obtaining a first angle and a second angle of the dial according to the digital information, the scale information and the dial characteristics, wherein the first angle refers to an angle corresponding to the starting scale, and the second angle refers to an angle corresponding to the ending scale; S8. Obtaining a unit reading of the target instrument according to the range information, the first angle, and the second angle, wherein the unit reading refers to a reading value corresponding to each rotation of the pointer of the target instrument by 1°; S9. Obtain the dial reading of the target instrument according to the pointer angle and the unit reading.
2. A method for automatic identification of meter readings according to claim 1, characterized in that: The step of obtaining the initial dial image of the target instrument dial comprises: Capturing a first image of the target instrument through a first camera, and determining whether the quality of the first image meets a first preset condition; When the quality of the first image meets the first preset condition, using the first image as the initial dial image; When the quality of the first image does not meet the first preset condition, adjusting the second camera parameter according to the quality of the first image; Acquire a second image of the target instrument by using a second camera; and determine whether the quality of the second image meets a first preset condition; When the quality of the second image meets the first preset condition, using the second image as the initial dial image; When the quality of the second image does not meet the first preset condition, the second camera parameters are readjusted according to the quality of the second image, and the second image is recaptured until the quality of the recaptured second image meets the first preset condition, and the second image that meets the first preset condition is used as the initial dial image.
3. The method for automatic identification of meter readings according to claim 1, characterized in that: The step of obtaining the dial features according to the digital information refers to obtaining the dial features according to the trained dial model through the digital information. The step of obtaining the dial features according to the trained dial model through the digital information includes: Inputting the initial dial image into the dial type determination layer of the dial model; The dial type determination layer processes the input initial dial image to obtain digital information, obtains a first fitting curve of the initial dial image according to the digital information, and obtains a dial type corresponding to the initial dial image according to the first fitting curve; The dial type is input into the dial feature determination layer of the dial model for processing to obtain the dial features corresponding to the initial dial image.
4. The method for automatic identification of meter readings according to claim 1, characterized in that: The step of obtaining scale information and pointer information according to the dial features and the preset image comprises: Obtain a pixel point set according to dial features and a preset image; Setting a first threshold range and a second threshold range, wherein the first threshold range is different from the second threshold range; Determine whether the area of the pixel set is within a first threshold range or a second threshold range; When the area of the pixel point set is within a first threshold range, obtaining scale information; When the area of the pixel point set is within a second threshold range, obtaining pointer information; The pixel point set is a set of pixel points corresponding to the dial scale or a set of pixel points corresponding to the dial pointer, the first threshold range is the area range of the pixel point set corresponding to the dial scale, and the second threshold range is the area range of the pixel point set corresponding to the dial pointer; the area of the pixel point set refers to the area of the line fitted by the coordinates of the pixel points in the reference coordinate system, and the reference coordinate system is a coordinate system established with any point in the initial dial image as the origin.
5. The method for automatic identification of meter readings according to claim 1, characterized in that: The step of obtaining the pointer angle of the pointer according to the pointer information comprises: Obtain the pointer contour line of the pointer according to the pointer information; Get the pointer endpoint of the pointer according to the pointer outline; Gets the pointer angle of a pointer based on the pointer endpoint and dial characteristics.
6. The method for automatic identification of meter readings according to claim 1, characterized in that: The step of obtaining the first angle and the second angle of the dial according to the digital information, the scale information and the dial characteristics comprises: Obtain the starting scale and the ending scale according to the digital information and the scale information; Connect the center point of the starting scale and the center of the dial in the dial feature to generate a first fitting line, and the angle between the first fitting line and the x-axis of the reference coordinate system is the first angle of the dial; Connect the center point of the end scale and the center of the dial in the dial feature to generate a second fitting line, and the angle between the second fitting line and the x-axis of the reference coordinate system is the second angle of the dial; The center point of the starting scale is the center pixel point of the set of pixel points corresponding to the starting scale, the center point of the ending scale is the center pixel point of the set of pixel points corresponding to the ending scale, and the reference coordinate system refers to a coordinate system established with any point in the initial dial image as the origin.
7. The method for automatic identification of meter readings according to claim 1, characterized in that: The dial reading of the target instrument is obtained by multiplying the difference between the pointer angle and the first angle by the unit reading.
8. An automatic meter reading recognition system, characterized in that: include: An image acquisition module is used to acquire an initial dial image of a target instrument dial and preprocess the initial dial image to obtain a preset image; A first information determination module, used to obtain digital information and range information according to a preset image; A dial feature determination module, used to obtain dial features according to digital information; A second information determination module, used to obtain scale information and pointer information according to dial features and a preset image; The reading determination module is used to obtain the pointer angle of the pointer according to the pointer information; obtain the first angle and the second angle of the dial according to the digital information, the scale information and the dial characteristics; obtain the unit reading of the target instrument according to the range information, the first angle and the second angle; obtain the dial reading of the target instrument according to the pointer angle and the unit reading.
9. An electronic device, characterized in that: include: processor; as well as, A memory, configured to store executable instructions of the processor; The processor is configured to execute the meter reading automatic identification method according to any one of claims 1 to 7 by executing the executable instructions.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method for automatically identifying meter readings according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Instrument dial correction method based on neural network
CN111401358A
Automatic identification method and system for pointer type instrument reading
CN112560839A
Automatic instrument identification method and system
CN113378814A
Instrument pointer count reading method based on machine vision, and medium
CN113657339A
Automatic reading method of pointer instrument, electronic equipment and storage medium
CN114782940A
