CN112906681A - Meter reading method and device, electronic equipment and storage medium - Google Patents
Meter reading method and device, electronic equipment and storage medium Download PDFInfo
- Publication number
- CN112906681A CN112906681A CN201911228413.4A CN201911228413A CN112906681A CN 112906681 A CN112906681 A CN 112906681A CN 201911228413 A CN201911228413 A CN 201911228413A CN 112906681 A CN112906681 A CN 112906681A
- Authority
- CN
- China
- Prior art keywords
- target
- instrument
- target instrument
- scale value
- image
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 58
- 238000004891 communication Methods 0.000 claims description 19
- 238000012937 correction Methods 0.000 claims description 18
- 238000013136 deep learning model Methods 0.000 claims description 15
- 238000004590 computer program Methods 0.000 claims description 12
- 238000001514 detection method Methods 0.000 claims description 12
- 238000004364 calculation method Methods 0.000 claims description 8
- PXFBZOLANLWPMH-UHFFFAOYSA-N 16-Epiaffinine Natural products C1C(C2=CC=CC=C2N2)=C2C(=O)CC2C(=CC)CN(C)C1C2CO PXFBZOLANLWPMH-UHFFFAOYSA-N 0.000 claims description 7
- 230000009466 transformation Effects 0.000 claims description 7
- 230000008569 process Effects 0.000 description 9
- 230000008859 change Effects 0.000 description 6
- 238000010586 diagram Methods 0.000 description 6
- 238000005259 measurement Methods 0.000 description 4
- 230000009471 action Effects 0.000 description 3
- 238000012549 training Methods 0.000 description 3
- 238000005516 engineering process Methods 0.000 description 2
- 238000012545 processing Methods 0.000 description 2
- 238000013500 data storage Methods 0.000 description 1
- 238000000605 extraction Methods 0.000 description 1
- 239000000835 fiber Substances 0.000 description 1
- 230000006870 function Effects 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000002093 peripheral effect Effects 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 239000007787 solid Substances 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/20—Image preprocessing
- G06V10/22—Image preprocessing by selection of a specific region containing or referencing a pattern; Locating or processing of specific regions to guide the detection or recognition
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V2201/00—Indexing scheme relating to image or video recognition or understanding
- G06V2201/02—Recognising information on displays, dials, clocks
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Multimedia (AREA)
- Theoretical Computer Science (AREA)
- Arrangements For Transmission Of Measured Signals (AREA)
Abstract
The embodiment of the application provides a method and a device for reading a meter, electronic equipment and a storage medium, and relates to the technical field of computers, wherein the method comprises the following steps: determining the pointer position of a target instrument in the target instrument image, determining the starting scale position, the ending scale position, the starting scale value and the ending scale value of the target instrument as the starting scale position, the ending scale position, the starting scale value and the ending scale value of a target instrument template respectively, determining the proportion of the target scale value in the range of the target instrument according to the starting scale position, the ending scale position and the pointer position, and calculating the target scale value according to the proportion of the target scale value in the range of the target instrument, the starting scale value and the ending scale value. By adopting the electronic equipment, the reading precision of the instrument can be improved.
Description
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method and an apparatus for reading a meter, an electronic device, and a storage medium.
Background
At present, the meter can be applied to various engineering equipment, and a user can read the meter through electronic equipment, such as air pressure or voltage and other parameters.
In the prior art, an electronic device stores a plurality of instrument templates in advance for instruments of the same model, and a pointer of each matching template points to a scale value of the instrument template.
When the electronic equipment reads the meter image, the electronic equipment matches the meter image with a pre-stored meter template, determines the meter template closest to the position of the pointer in the meter image as the meter template matched with the meter image, and takes the scale value pointed by the pointer of the meter template matched with the meter image as the reading of the meter image.
However, the scale values in the meter template are discrete, and if the pointer of the meter in the meter image does not completely coincide with the pointer of the matching meter template, the scale value pointed by the pointer of the meter template cannot accurately represent the reading of the meter in the meter image, resulting in low accuracy of the meter reading.
Disclosure of Invention
An object of the embodiments of the present application is to provide a method and an apparatus for reading a meter, an electronic device, and a storage medium, so as to improve reading accuracy. The specific technical scheme is as follows:
in a first aspect, a meter reading method is provided, which is applied to an electronic device, and includes:
determining the pointer position of a target instrument in the target instrument image;
determining a starting scale position, an ending scale position, a starting scale value and an ending scale value of the target instrument as a starting scale position, an ending scale position, a starting scale value and an ending scale value of a target instrument template respectively, wherein the target instrument template is a template matched with the model of the target instrument;
determining the proportion of a target scale value in the measuring range of the target instrument according to the starting scale position, the ending scale position and the pointer position, wherein the target scale value is the scale value represented by the position pointed by the pointer of the target instrument;
and calculating the target scale value according to the proportion of the target scale value in the measuring range of the target instrument, the starting scale value and the ending scale value.
Optionally, the determining the pointer position of the target meter in the target meter image includes:
inputting the target instrument image into a deep learning model, and acquiring the pointer position of the target instrument output by the deep learning model; or,
and detecting the pointer position of the target instrument by a straight line detection method.
Optionally, the determining, according to the start scale position, the end scale position, and the pointer position, a ratio of the target scale value in the measurement range of the target instrument includes:
determining a first line segment formed by the starting scale position and the center of the target instrument and a second line segment formed by the ending scale position and the center of the target instrument; determining a first included angle between the first line segment and the pointer and a second included angle between the second line segment and the pointer;
and calculating the proportion of the target scale value in the measuring range of the target instrument according to the first included angle and the second included angle, wherein the proportion is a first included angle/(a first included angle + a second included angle).
Optionally, before the determining the pointer position of the target meter in the target meter image, the method further includes:
if the target instrument image is not the positive image of the target instrument, determining a target instrument template corresponding to the model of the target instrument according to the corresponding relation between the preset instrument model and the instrument template, wherein the instrument in the target instrument template is matched with the model of the target instrument, and the dial plate of the instrument in the positive image is parallel to the positive image plane;
and correcting the target instrument image into a positive shot image of the target instrument according to the target instrument template.
Optionally, the correcting the target instrument image into a positive image of the target instrument according to the target instrument template includes:
extracting coordinate points of the target instrument template and each designated position in the target instrument image to obtain a preset number of coordinate point pairs, wherein each coordinate point pair comprises a coordinate point of the designated position in the target instrument template and a coordinate point of the same designated position in the target instrument image;
and calculating to obtain a corrected positive shot image of the target instrument through affine transformation according to the preset number of coordinate point pairs.
In a second aspect, there is provided a meter reading apparatus, the apparatus being applied to an electronic device, the apparatus comprising:
the first determination module is used for determining the pointer position of the target instrument in the target instrument image;
the second determination module is used for determining that the starting scale position, the ending scale position, the starting scale value and the ending scale value of the target instrument are respectively the starting scale position, the ending scale position, the starting scale value and the ending scale value of a target instrument template, and the target instrument template is a template matched with the model of the target instrument;
the first calculation module is used for determining the proportion of a target scale value in the measuring range of the target instrument according to the starting scale position, the ending scale position and the pointer position, wherein the target scale value is the scale value represented by the position pointed by the pointer of the target instrument;
and the second calculation module is used for calculating the target scale value according to the proportion of the target scale value in the measuring range of the target instrument, the starting scale value and the ending scale value.
Optionally, the first determining module is specifically configured to:
inputting the target instrument image into a deep learning model, and acquiring the pointer position of the target instrument output by the deep learning model; or,
and detecting the pointer position of the target instrument by a straight line detection method.
Optionally, the first calculating module is specifically configured to:
determining a first line segment formed by the starting scale position and the center of the target instrument and a second line segment formed by the ending scale position and the center of the target instrument; determining a first included angle between the first line segment and the pointer and a second included angle between the second line segment and the pointer;
and calculating the proportion of the target scale value in the measuring range of the target instrument according to the first included angle and the second included angle, wherein the proportion is a first included angle/(a first included angle + a second included angle).
Optionally, the apparatus further comprises: a matching module and a correction module;
the matching module is used for determining a target instrument template corresponding to the model of the target instrument according to the corresponding relation between the preset instrument model and the instrument template if the target instrument image is not the positive image of the target instrument, wherein the instrument in the target instrument template is matched with the model of the target instrument, and the dial plate of the instrument in the positive image is parallel to the positive image plane;
and the correction module is used for correcting the target instrument image into a positive shot image of the target instrument according to the target instrument template.
Optionally, the correction module is specifically configured to:
extracting coordinate points of the target instrument template and each designated position in the target instrument image to obtain a preset number of coordinate point pairs, wherein each coordinate point pair comprises a coordinate point of the designated position in the target instrument template and a coordinate point of the same designated position in the target instrument image;
and calculating to obtain a corrected positive shot image of the target instrument through affine transformation according to the preset number of coordinate point pairs.
In a third aspect, an electronic device is provided, which includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory complete communication with each other through the communication bus;
a memory for storing a computer program;
a processor for implementing the method steps of the first aspect when executing the program stored in the memory.
In a fourth aspect, a computer-readable storage medium is provided, having stored thereon a computer program which, when being executed by a processor, carries out the method steps of the first aspect.
In a fifth aspect, there is provided a computer program product comprising instructions which, when run on a computer, cause the computer to perform the method of the first aspect described above.
According to the meter reading method and device provided by the embodiment of the application, the electronic equipment can determine the pointer position of a target meter in a target meter image, then determine the starting scale position, the ending scale position, the starting scale value and the ending scale value of the target meter as the starting scale position, the ending scale position, the starting scale value and the ending scale value of a target meter template respectively, determine the proportion of the target scale value in the range of the target meter according to the starting scale position, the ending scale position and the pointer position, and calculate the target scale value according to the proportion of the target scale value in the range of the target meter, the starting scale value and the ending scale value. Because the target scale value is a scale value calculated by the electronic device according to the proportion of the target scale value in the range of the target meter, the target scale value can represent the reading of the actual position of the pointer in the target meter image. Compared with the prior art, the scale of the template is not directly used as the reading of the instrument, so that the instrument reading determined by the method provided by the embodiment of the application is the real reading of the scale pointed by the target pointer, and the accuracy of the instrument reading can be improved by the method provided by the embodiment of the application.
Of course, not all advantages described above need to be achieved at the same time in the practice of any one product or method of the present application.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
FIG. 1 is a flow chart of a method for meter reading provided by an embodiment of the present application;
FIG. 2 is a flow chart of another method for meter reading provided by an embodiment of the present application;
FIG. 3 is a schematic diagram of a target meter provided in an embodiment of the present application;
FIG. 4 is a flow chart of another method for meter reading provided by an embodiment of the present application;
FIG. 5 is a schematic diagram of a corrected image according to an embodiment of the present disclosure;
fig. 6 is a schematic structural diagram of a meter reading device according to an embodiment of the present disclosure;
fig. 7 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The embodiment of the application provides a method for reading a meter, which is applied to electronic equipment, wherein the electronic equipment can be camera equipment, a mobile terminal or a PC (personal computer) terminal.
The method for reading a meter provided in the embodiments of the present application will be described in detail below with reference to specific embodiments, as shown in fig. 1, the specific steps are as follows:
The target instrument image is an image shot by the camera equipment, and the image contains the target instrument.
In the embodiment of the application, after the camera shooting device shoots the target instrument image, the instrument reading can be carried out based on the shot target instrument image. Or, the camera device may also send the target meter image to the terminal, and the terminal performs meter reading based on the target meter image, which is not limited in the embodiment of the present application.
And 102, determining the starting scale position, the ending scale position, the starting scale value and the ending scale value of the target instrument as the starting scale position, the ending scale position, the starting scale value and the ending scale value of the target instrument template respectively.
The target instrument template is a template matched with the model of the target instrument.
In the embodiment of the application, the target instrument template is a template which is prestored by the electronic device and has the same model with the target instrument, and the template comprises all scale positions of the instrument and scale values corresponding to all the scale positions. The electronic equipment can determine a target instrument template corresponding to the target instrument according to the model of the target instrument.
The electronic device may determine the model of the target instrument through an instrument model detection model, or the electronic device may determine the model of the target instrument through an image recognition technology, or the electronic device may display a configuration interface, where the configuration interface (for example, in a pull-down list in the configuration interface) includes pre-stored models corresponding to the instruments, and when the electronic device receives an instrument model clicking operation of a user on the configuration interface, the electronic device may use the instrument model clicked by the user as the model of the target instrument.
Of course, other methods for determining the meter model in the image in the related art may also be adopted, and this is not limited in this embodiment of the application.
In practical application, the starting scale position, the ending scale position, the starting scale value and the ending scale value of each instrument of the same model are the same.
Therefore, the start scale position, the end scale position, the start scale value and the end scale value of the target meter are the same as those of the target meter template.
The electronic device may determine the start scale position, the end scale position, the start scale value, and the end scale value of the target meter by the start scale position, the end scale position, the start scale value, and the end scale value of the target meter template.
Alternatively, the starting scale of the meter may be a positive number, a negative number, or 0, and the embodiment of the present application is not limited.
For example, the starting scale of the instrument corresponding to the temperature measuring device may be negative, i.e., the temperature measuring device may measure the sub-zero temperature.
And 103, determining the proportion of the target scale value in the measuring range of the target instrument according to the starting scale position, the ending scale position and the pointer position.
The target scale value is the scale value represented by the position pointed by the pointer of the target instrument, and the ending scale value minus the starting scale of the instrument is the measuring range of the instrument.
The target scale value is a reading of the target meter, and in step 103, the target scale value is an unknown number because the electronic device only determines the start scale value and the end scale value of the target meter. The electronic device may determine a proportion of the target scale value in the target instrument's range based on a relationship between the pointer position and the start and end scale positions.
And 104, calculating the target scale value according to the proportion of the target scale value in the measuring range of the target instrument, the starting scale value and the ending scale value.
According to the meter reading method provided by the embodiment of the application, the electronic device can determine the pointer position of a target meter in a target meter image, then determine the starting scale position, the ending scale position, the starting scale value and the ending scale value of the target meter as the starting scale position, the ending scale position, the starting scale value and the ending scale value of a target meter template respectively, determine the proportion of the target scale value in the range of the target meter according to the starting scale position, the ending scale position and the pointer position, and calculate the target scale value according to the proportion of the target scale value in the range of the target meter, the starting scale value and the ending scale value. Because the target scale value is a scale value calculated by the electronic device according to the proportion of the target scale value in the range of the target meter, the target scale value can represent the reading of the actual position of the pointer in the target meter image. Compared with the prior art, the scale of the template is not directly used as the reading of the instrument, so that the instrument reading determined by the method provided by the embodiment of the application is the real reading of the scale pointed by the target pointer, and the accuracy of the instrument reading can be improved by the method provided by the embodiment of the application.
Optionally, in the step 101, determining the pointer position of the target meter in the target meter image may specifically include the following two implementation manners:
and inputting the target instrument image into the deep learning model to obtain the pointer position of the target instrument output by the deep learning model.
The deep learning model can be obtained by training a preset training set, and the preset training set comprises a plurality of sample instrument images and a marking value of a pointer position in each sample instrument image.
In the first mode, the depth learning model may determine, through calculation, a position of the pointer in the meter image, where the position is represented by a bounding rectangle of the pointer (i.e., the pointer in the meter image is one of the diagonals of the bounding rectangle).
Because the deep learning model has good computing power, the pointer position of the target instrument in the target instrument image can be accurately determined through the deep learning model.
And secondly, detecting the pointer position of the target instrument by a straight line detection method.
The straight line detection method may be: hough transform (feature extraction), Line Segment Detector (LSD), and the like.
Other line detection methods in the related art may also be adopted in the embodiments of the present application, which are not limited in the present application.
In the embodiment of the application, the line segment detected by the electronic device may be a pointer of the target instrument or a scale mark of the target instrument. Thus, the electronic device may determine that the longest detected line segment is the pointer of the target meter.
Because the operation process involved in the processing process of the second mode is few, the electronic equipment can quickly locate the pointer position by the second mode.
Optionally, as shown in fig. 2, the specific implementation process of determining the proportion of the target scale value in the measurement range of the target instrument according to the start scale position, the end scale position, and the pointer position in step 103 may include:
As shown in fig. 3, fig. 3 is a schematic diagram of a target instrument provided in the embodiment of the present application, where fig. 3 includes a dial and a pointer, a white solid line segment is a line segment formed by a start scale position and a center of a circle of the target instrument, that is, the white solid line segment is a first line segment, a white dotted line segment is a line segment formed by an end scale position and the center of the circle of the target instrument, that is, the white dotted line segment is a second line segment, angle 1 is a first included angle, and angle 2 is a second included angle.
And 202, calculating the proportion of the target scale value in the measuring range of the target instrument according to the first included angle and the second included angle.
And the proportion of the target scale value in the measuring range of the target instrument is equal to a first included angle/(the first included angle + a second included angle).
For example, in fig. 3, the proportion of the target scale value in the range of the target gauge is ═ 1/(. sub.1 +. sub.2).
The electronic device may calculate an accurate reading of the target meter through the process of steps 201 to 202 described above.
In the embodiment of the application, the electronic equipment calculates the target scale value according to the proportion of the target scale value in the measuring range of the target instrument, the proportion exists objectively and is not influenced by the template of the target instrument, and therefore the instrument reading calculated by the embodiment of the application is more accurate.
Optionally, before the step of determining the pointer position of the target meter in the target meter image, the electronic device may further correct the target meter image, and based on this, in an implementation manner of the embodiment of the present application, as shown in fig. 4, the method specifically includes the following steps:
The instrument in the target instrument template is matched with the model of the target instrument, and the dial plate of the instrument in the positive image is parallel to the positive image plane.
For example, as shown in fig. 5, fig. 5 is a schematic diagram of a target meter image and a target meter template provided in an embodiment of the present application.
Wherein, the left side of fig. 5 is the target instrument image before correction, the middle of fig. 5 is the target instrument template, and the right side of fig. 5 is the target instrument image after correction. The model of the target instrument image before correction is the same as that of the instrument in the target instrument template.
The target instrument template is a positive image of the instrument of the model corresponding to the target instrument template, and as shown in fig. 5, the dial of the instrument in the target instrument template is parallel to the image plane of the target instrument template.
And step 402, correcting the target instrument image into a positive shot image of the target instrument according to the target instrument template.
As shown in fig. 5, after the target instrument image is corrected, the electronic device may obtain a forward image of the target instrument, where in the forward image of the target instrument, the dial of the target instrument is parallel to the image plane of the target instrument image.
The specific implementation manner of the step can be as follows: extracting coordinate points of each designated position in the target instrument template and the target instrument image to obtain a preset number of coordinate point pairs, and calculating to obtain a corrected positive shot image of the target instrument through affine transformation according to the preset number of coordinate point pairs.
And each coordinate point pair comprises a coordinate point of a specified position in the target instrument template and a coordinate point of the same specified position in the target instrument image.
For example, in fig. 5, the target meter image before correction includes 4 black dots each representing a coordinate point of one designated position, and the target meter template includes 4 black dots each representing a coordinate point of one designated position.
Taking the first coordinate point and the second coordinate point as an example, the first coordinate point and the second coordinate point are respectively a coordinate point at a specified position in the target meter image before correction, and a coordinate point at the same specified position in the target meter template, that is, the first coordinate point and the second coordinate point are a coordinate point pair.
Furthermore, fig. 5 includes 4 coordinate point pairs, and the electronic device may calculate the pre-correction instrument image by affine transformation according to the 4 coordinate point pairs to obtain a forward-shot image corresponding to the pre-correction target instrument image, that is, the post-correction target instrument image in fig. 5.
In practical application, when the shooting equipment shoots a target instrument, the shooting angle is possibly wrong, and then the image of the target instrument is not a positive shot image.
After step 402, the method further includes step 403 to step 406, where step 403 to step 406 are the same as step 101 to step 104, and reference may be made to the related descriptions in step 101 to step 104, which are not repeated herein.
By adopting the method and the device, correction and meter reading of the non-normal-shot image are realized, and the meter reading method provided by the embodiment of the application is wider in applicability.
Optionally, after the step of calculating the target scale value in step 104, the electronic device may further send a reminding message according to the target scale value, and the specific process may be as follows: and if the target scale value is larger than the preset threshold value, sending a reminding message.
In practical applications, the reminder message may be a kind of alarm information.
For example, the target instrument is a pressure instrument on a pressure sensing device, and the reading of the pressure instrument may reflect the pressure sensed by the pressure sensing device.
When the air pressure detected by the air pressure detecting device is greater than a preset threshold value, it represents a possible danger. At this time, the electronic device may send a warning message to the terminal, where the warning message is an alarm message for warning the user that the current air pressure is too high and a danger may occur.
In the embodiment of the present application, the method for sending the reminding message by the electronic device according to the target scale value is not only applied to the air pressure detection device, but also applied to the voltage detection device, the temperature detection device, and the like, and the details are not repeated in the embodiment of the present application.
In another implementation, the electronic device may also send a warning message when the target scale value is lower than the preset threshold.
In one implementation, the electronic device may also read the target meter's reading in real time.
When the target meter image is a video frame in a video shot in real time, the electronic device performs the steps 101 to 104 on each frame of video frame in the video, so that the reading of the target meter can be read in real time.
In practical applications, if the electronic device reads the reading of the target meter in real time, the electronic device can calculate the change speed of the reading of the target meter.
When the change speed of the reading of the target meter is greater than the preset change speed threshold value in the electronic device, the electronic device may send a reminding message, where the reminding message may be alarm information for reminding a user that the change speed of the reading of the current target meter is too fast, and a danger may occur.
In another implementation, the electronic device may also detect and record readings of a plurality of target meters and output a profile of the readings of each target meter.
The change curve is a continuous curve, and the change trend of the reading of the target instrument can be better reflected.
Based on the same technical concept, the embodiment of the present application further provides a meter reading device, as shown in fig. 6, the device includes: a first determination module 601, a second determination module 602, a first calculation module 603, and a second calculation module 604.
A first determining module 601, configured to determine a pointer position of a target meter in a target meter image;
a second determining module 602, configured to determine that a start scale position, an end scale position, a start scale value, and an end scale value of a target instrument are respectively a start scale position, an end scale position, a start scale value, and an end scale value of a target instrument template, where the target instrument template is a template that matches a model of the target instrument;
the first calculation module 603 is configured to determine, according to the start scale position, the end scale position, and the pointer position, a proportion of a target scale value in a measurement range of the target instrument, where the target scale value is a scale value represented by a position where a pointer of the target instrument points;
the second calculating module 604 is configured to calculate the target scale value according to a ratio of the target scale value in the measurement range of the target instrument, the starting scale value, and the ending scale value.
Optionally, the first determining module 601 is specifically configured to:
inputting the target instrument image into a deep learning model, and acquiring the pointer position of the target instrument output by the deep learning model; or,
and detecting the pointer position of the target instrument by a straight line detection method.
Optionally, the first calculating module 603 is specifically configured to:
determining a first line segment formed by the starting scale position and the center of a circle of the target instrument, and a second line segment formed by the ending scale position and the center of the circle of the target instrument; determining a first included angle between the first line segment and the pointer and a second included angle between the second line segment and the pointer;
and calculating the proportion of the target scale value in the measuring range of the target instrument according to the first included angle and the second included angle, wherein the proportion is the first included angle/(the first included angle + the second included angle).
Optionally, the apparatus further comprises: a matching module and a correction module;
the matching module is used for determining a target instrument template corresponding to the model of the target instrument according to the corresponding relation between the preset instrument model and the instrument template if the target instrument image is not the positive image of the target instrument, the instrument in the target instrument template is matched with the model of the target instrument, and the dial plate of the instrument in the positive image is parallel to the positive image plane;
and the correction module is used for correcting the target instrument image into a positive shot image of the target instrument according to the target instrument template.
Optionally, the correction module is specifically configured to:
extracting coordinate points of each designated position in the target instrument template and the target instrument image to obtain a preset number of coordinate point pairs, wherein each coordinate point pair comprises a coordinate point of the designated position in the target instrument template and a coordinate point of the same designated position in the target instrument image;
and calculating to obtain a corrected positive shot image of the target instrument through affine transformation according to the preset number of coordinate point pairs.
According to the meter reading device provided by the embodiment of the application, the electronic equipment can determine the pointer position of a target meter in a target meter image, then the start scale position, the end scale position, the start scale value and the end scale value of the target meter are respectively the start scale position, the end scale position, the start scale value and the end scale value of a target meter template, the target meter template is a template matched with the model of the target meter, then the proportion of the target scale value in the range of the target meter is determined according to the start scale position, the end scale position and the pointer position, and the target scale value is calculated according to the proportion of the target scale value in the range of the target meter, the start scale value and the end scale value. Because the target scale value is a scale value calculated by the electronic device according to the proportion of the target scale value in the range of the target meter, the target scale value can represent the reading of the actual position of the pointer in the target meter image. Compared with the prior art, the scale of the template is not directly used as the reading of the instrument, so that the instrument reading determined by the method provided by the embodiment of the application is the real reading of the scale pointed by the target pointer, and the accuracy of the instrument reading can be improved by the method provided by the embodiment of the application.
The embodiment of the present application further provides an electronic device, as shown in fig. 7, which includes a processor 701, a communication interface 702, a memory 703 and a communication bus 704, where the processor 701, the communication interface 702, and the memory 703 complete mutual communication through the communication bus 704,
a memory 703 for storing a computer program;
the processor 701 is configured to implement the following steps when executing the program stored in the memory 703:
determining the pointer position of a target instrument in the target instrument image;
determining a starting scale position, an ending scale position, a starting scale value and an ending scale value of the target instrument as a starting scale position, an ending scale position, a starting scale value and an ending scale value of a target instrument template respectively, wherein the target instrument template is a template matched with the model of the target instrument;
determining the proportion of the target scale value in the measuring range of the target instrument according to the starting scale position, the ending scale position and the pointer position, wherein the target scale value is the scale value represented by the position pointed by the pointer of the target instrument;
and calculating the target scale value according to the proportion of the target scale value in the measuring range of the target instrument, the starting scale value and the ending scale value.
It should be noted that, when the processor 701 is configured to execute the program stored in the memory 703, it is also configured to implement other steps described in the foregoing method embodiment, and reference may be made to the relevant description in the foregoing method embodiment, which is not described herein again.
The communication bus mentioned in the network device may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown, but this does not mean that there is only one bus or one type of bus.
The communication interface is used for communication between the network device and other devices.
The Memory may include a Random Access Memory (RAM) or a Non-Volatile Memory (NVM), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the processor.
The Processor may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; the Integrated Circuit may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA), or other Programmable logic devices, discrete Gate or transistor logic devices, or discrete hardware components.
Based on the same technical concept, the embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored, and the computer program, when executed by a processor, implements the above-mentioned steps of the meter reading method.
Based on the same technical concept, embodiments of the present application also provide a computer program product containing instructions that, when executed on a computer, cause the computer to perform the above-mentioned meter reading method steps.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, cause the processes or functions described in accordance with the embodiments of the application to occur, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, from one website site, computer, server, or data center to another website site, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that incorporates one or more of the available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., Solid State Disk (SSD)), among others.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
All the embodiments in the present specification are described in a related manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, as for the apparatus embodiment, since it is substantially similar to the method embodiment, the description is relatively simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
The above description is only for the preferred embodiment of the present application, and is not intended to limit the scope of the present application. Any modification, equivalent replacement, improvement and the like made within the spirit and principle of the present application are included in the protection scope of the present application.
Claims (12)
1. A method of meter reading, the method comprising:
determining the pointer position of a target instrument in the target instrument image;
determining a starting scale position, an ending scale position, a starting scale value and an ending scale value of the target instrument as a starting scale position, an ending scale position, a starting scale value and an ending scale value of a target instrument template respectively, wherein the target instrument template is a template matched with the model of the target instrument;
determining the proportion of a target scale value in the measuring range of the target instrument according to the starting scale position, the ending scale position and the pointer position, wherein the target scale value is the scale value represented by the position pointed by the pointer of the target instrument;
and calculating the target scale value according to the proportion of the target scale value in the measuring range of the target instrument, the starting scale value and the ending scale value.
2. The method of claim 1, wherein determining the pointer location of the target meter in the target meter image comprises:
inputting the target instrument image into a deep learning model, and acquiring the pointer position of the target instrument output by the deep learning model; or,
and detecting the pointer position of the target instrument by a straight line detection method.
3. The method of claim 1, wherein said determining a proportion of the target scale value in the target meter's range based on the start scale position, the end scale position, and the pointer position comprises:
determining a first line segment formed by the starting scale position and the center of the target instrument and a second line segment formed by the ending scale position and the center of the target instrument; determining a first included angle between the first line segment and the pointer and a second included angle between the second line segment and the pointer;
and calculating the proportion of the target scale value in the measuring range of the target instrument according to the first included angle and the second included angle, wherein the proportion is a first included angle/(a first included angle + a second included angle).
4. The method of any of claims 1-3, wherein prior to said determining the pointer location of the target meter in the target meter image, the method further comprises:
if the target instrument image is not the positive image of the target instrument, determining a target instrument template corresponding to the model of the target instrument according to the corresponding relation between the preset instrument model and the instrument template, wherein the instrument in the target instrument template is matched with the model of the target instrument, and the dial plate of the instrument in the positive image is parallel to the positive image plane;
and correcting the target instrument image into a positive shot image of the target instrument according to the target instrument template.
5. The method of claim 4, wherein said correcting the target meter image to a positive image of the target meter according to the target meter template comprises:
extracting coordinate points of the target instrument template and each designated position in the target instrument image to obtain a preset number of coordinate point pairs, wherein each coordinate point pair comprises a coordinate point of the designated position in the target instrument template and a coordinate point of the same designated position in the target instrument image;
and calculating to obtain a corrected positive shot image of the target instrument through affine transformation according to the preset number of coordinate point pairs.
6. A meter reading apparatus, the apparatus comprising:
the first determination module is used for determining the pointer position of the target instrument in the target instrument image;
the second determination module is used for determining that the starting scale position, the ending scale position, the starting scale value and the ending scale value of the target instrument are respectively the starting scale position, the ending scale position, the starting scale value and the ending scale value of a target instrument template, and the target instrument template is a template matched with the model of the target instrument;
the first calculation module is used for determining the proportion of a target scale value in the measuring range of the target instrument according to the starting scale position, the ending scale position and the pointer position, wherein the target scale value is the scale value represented by the position pointed by the pointer of the target instrument;
and the second calculation module is used for calculating the target scale value according to the proportion of the target scale value in the measuring range of the target instrument, the starting scale value and the ending scale value.
7. The apparatus of claim 6, wherein the first determining module is specifically configured to:
inputting the target instrument image into a deep learning model, and acquiring the pointer position of the target instrument output by the deep learning model; or,
and detecting the pointer position of the target instrument by a straight line detection method.
8. The apparatus of claim 6, wherein the first computing module is specifically configured to:
determining a first line segment formed by the starting scale position and the center of the target instrument and a second line segment formed by the ending scale position and the center of the target instrument; determining a first included angle between the first line segment and the pointer and a second included angle between the second line segment and the pointer;
and calculating the proportion of the target scale value in the measuring range of the target instrument according to the first included angle and the second included angle, wherein the proportion is a first included angle/(a first included angle + a second included angle).
9. The apparatus according to any one of claims 6-8, further comprising: a matching module and a correction module;
the matching module is used for determining a target instrument template corresponding to the model of the target instrument according to the corresponding relation between the preset instrument model and the instrument template if the target instrument image is not the positive image of the target instrument, wherein the instrument in the target instrument template is matched with the model of the target instrument, and the dial plate of the instrument in the positive image is parallel to the positive image plane;
and the correction module is used for correcting the target instrument image into a positive shot image of the target instrument according to the target instrument template.
10. The apparatus according to claim 9, wherein the correction module is specifically configured to:
extracting coordinate points of the target instrument template and each designated position in the target instrument image to obtain a preset number of coordinate point pairs, wherein each coordinate point pair comprises a coordinate point of the designated position in the target instrument template and a coordinate point of the same designated position in the target instrument image;
and calculating to obtain a corrected positive shot image of the target instrument through affine transformation according to the preset number of coordinate point pairs.
11. An electronic device is characterized by comprising a processor, a communication interface, a memory and a communication bus, wherein the processor and the communication interface are used for realizing mutual communication by the memory through the communication bus;
a memory for storing a computer program;
a processor for implementing the method steps of any one of claims 1 to 5 when executing a program stored in the memory.
12. A computer-readable storage medium, characterized in that a computer program is stored in the computer-readable storage medium, which computer program, when being executed by a processor, carries out the method steps of any one of the claims 1-5.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911228413.4A CN112906681A (en) | 2019-12-04 | 2019-12-04 | Meter reading method and device, electronic equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911228413.4A CN112906681A (en) | 2019-12-04 | 2019-12-04 | Meter reading method and device, electronic equipment and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN112906681A true CN112906681A (en) | 2021-06-04 |
Family
ID=76111018
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201911228413.4A Pending CN112906681A (en) | 2019-12-04 | 2019-12-04 | Meter reading method and device, electronic equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112906681A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113792727A (en) * | 2021-07-30 | 2021-12-14 | 华能大理风力发电有限公司 | Reading estimation method, device and system based on pointer instrument video image |
Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102840948A (en) * | 2012-09-28 | 2012-12-26 | 长庆石油勘探局技术监测中心 | Batch calibration equipment and batch calibration method for intelligent pointer-type pressure gages |
CN104410829A (en) * | 2014-11-27 | 2015-03-11 | 无锡北斗星通信息科技有限公司 | Method for automatically reading meter |
CN204229230U (en) * | 2014-11-27 | 2015-03-25 | 无锡北斗星通信息科技有限公司 | For the Intelligent Mobile Robot of automatic meter reading |
CN104597903A (en) * | 2014-11-27 | 2015-05-06 | 无锡北斗星通信息科技有限公司 | Transformer substation routing inspection robot for automatic meter reading |
CN108182433A (en) * | 2017-12-29 | 2018-06-19 | 北京易达图灵科技有限公司 | A kind of meter reading recognition methods and system |
WO2018120238A1 (en) * | 2016-12-30 | 2018-07-05 | 华为技术有限公司 | File processing device and method, and graphical user interface |
CN108764257A (en) * | 2018-05-23 | 2018-11-06 | 郑州金惠计算机系统工程有限公司 | A kind of pointer instrument recognition methods of various visual angles |
WO2018201638A1 (en) * | 2017-05-05 | 2018-11-08 | 深圳市科迈爱康科技有限公司 | Image recognition based information collection method, mobile terminal and storage medium |
CN110111387A (en) * | 2019-04-19 | 2019-08-09 | 南京大学 | A kind of pointer gauge positioning and reading algorithm based on dial plate feature |
-
2019
- 2019-12-04 CN CN201911228413.4A patent/CN112906681A/en active Pending
Patent Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102840948A (en) * | 2012-09-28 | 2012-12-26 | 长庆石油勘探局技术监测中心 | Batch calibration equipment and batch calibration method for intelligent pointer-type pressure gages |
CN104410829A (en) * | 2014-11-27 | 2015-03-11 | 无锡北斗星通信息科技有限公司 | Method for automatically reading meter |
CN204229230U (en) * | 2014-11-27 | 2015-03-25 | 无锡北斗星通信息科技有限公司 | For the Intelligent Mobile Robot of automatic meter reading |
CN104597903A (en) * | 2014-11-27 | 2015-05-06 | 无锡北斗星通信息科技有限公司 | Transformer substation routing inspection robot for automatic meter reading |
WO2018120238A1 (en) * | 2016-12-30 | 2018-07-05 | 华为技术有限公司 | File processing device and method, and graphical user interface |
WO2018201638A1 (en) * | 2017-05-05 | 2018-11-08 | 深圳市科迈爱康科技有限公司 | Image recognition based information collection method, mobile terminal and storage medium |
CN108182433A (en) * | 2017-12-29 | 2018-06-19 | 北京易达图灵科技有限公司 | A kind of meter reading recognition methods and system |
CN108764257A (en) * | 2018-05-23 | 2018-11-06 | 郑州金惠计算机系统工程有限公司 | A kind of pointer instrument recognition methods of various visual angles |
CN110111387A (en) * | 2019-04-19 | 2019-08-09 | 南京大学 | A kind of pointer gauge positioning and reading algorithm based on dial plate feature |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113792727A (en) * | 2021-07-30 | 2021-12-14 | 华能大理风力发电有限公司 | Reading estimation method, device and system based on pointer instrument video image |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110245654B (en) | Pointer reading identification method and device, computer device and readable storage medium | |
US20240036658A1 (en) | Pointer positioning method and apparatus, and instrument | |
CN110796095B (en) | Instrument template establishing method, terminal equipment and computer storage medium | |
US11721229B2 (en) | Question correction method, device, electronic equipment and storage medium for oral calculation questions | |
CN111259890A (en) | Water level identification method, device and equipment of water level gauge | |
CN107766836A (en) | A kind of circular deflection readings of pointer type meters antidote | |
CN111126268A (en) | Key point detection model training method and device, electronic equipment and storage medium | |
CN108235777B (en) | Calibration method and device of ADAS camera, storage medium and terminal equipment | |
JP2017224252A (en) | Measured value reading device, measured value reading method and program | |
CN110646134A (en) | Calibration method and calibration device for air pressure sensor | |
CN108286946A (en) | The method and system of sensing station mark fixed sum data splicing | |
CN112906681A (en) | Meter reading method and device, electronic equipment and storage medium | |
CN110865785A (en) | Method and device for acquiring pixel size and electronic equipment | |
CN111461098B (en) | Method, device and system for processing modeling data of instrument panel | |
CN110672058B (en) | On-line calibration data sequence matching method and device of sensor for structure monitoring | |
CN108332779B (en) | Reading method of liquid column type instrument and related device | |
CN111141217A (en) | Object measuring method, device, terminal equipment and computer storage medium | |
CN113358226A (en) | Temperature measuring method, electronic equipment and storage medium | |
CN112464986B (en) | Reading method and device for pointer type disc instrument | |
CN114565911B (en) | Instrument reading method and device, computer equipment and storage medium | |
CN115452101A (en) | Instrument verification method, device, equipment and medium | |
CN115035481A (en) | Image object distance fusion method, device, equipment and storage medium | |
CN114972714A (en) | Dial reading method, device, system and computer readable storage medium | |
CN108693164B (en) | Temperature demodulation method, device and system based on optical fiber Raman scattering signal | |
CN111579102A (en) | Body temperature reporting management method based on APP module |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |