CN110796095B - Instrument template establishing method, terminal equipment and computer storage medium - Google Patents

Instrument template establishing method, terminal equipment and computer storage medium Download PDF

Info

Publication number
CN110796095B
CN110796095B CN201911046359.1A CN201911046359A CN110796095B CN 110796095 B CN110796095 B CN 110796095B CN 201911046359 A CN201911046359 A CN 201911046359A CN 110796095 B CN110796095 B CN 110796095B
Authority
CN
China
Prior art keywords
template
instrument
image
graph
polar coordinate
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.)
Active
Application number
CN201911046359.1A
Other languages
Chinese (zh)
Other versions
CN110796095A (en
Inventor
李宁钏
熊剑平
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhejiang Dahua Technology Co Ltd
Original Assignee
Zhejiang Dahua Technology Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Zhejiang Dahua Technology Co Ltd filed Critical Zhejiang Dahua Technology Co Ltd
Priority to CN201911046359.1A priority Critical patent/CN110796095B/en
Publication of CN110796095A publication Critical patent/CN110796095A/en
Application granted granted Critical
Publication of CN110796095B publication Critical patent/CN110796095B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V20/00Scenes; Scene-specific elements
    • G06V20/20Scenes; Scene-specific elements in augmented reality scenes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • G06V10/24Aligning, centring, orientation detection or correction of the image
    • G06V10/242Aligning, centring, orientation detection or correction of the image by image rotation, e.g. by 90 degrees
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V2201/00Indexing scheme relating to image or video recognition or understanding
    • G06V2201/02Recognising information on displays, dials, clocks

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Multimedia (AREA)
  • Theoretical Computer Science (AREA)
  • Image Analysis (AREA)

Abstract

The application provides an instrument template establishing method, terminal equipment and a computer storage medium. The instrument template establishing method comprises the following steps: acquiring a first template image, and identifying scale points on the first template image; generating a fitting graph based on the scale points; correcting the first template image based on the fitting graph and the preset graph to obtain a second template image; performing polar coordinate conversion on the second template image based on the fitting graph to obtain a polar coordinate value corresponding to the polar coordinate graph and the scale point information; saving the polar coordinate graph and the corresponding relation between the scale points and the polar coordinate values as an instrument template; and identifying the image of the instrument to be detected based on the instrument template so as to obtain the scale value indicated in the image of the instrument to be detected. The instrument template establishing method can improve the identification precision and identification efficiency of the instrument degree.

Description

Instrument template establishing method, terminal equipment and computer storage medium
Technical Field
The present application relates to the field of digital image processing technologies, and in particular, to an instrument template establishing method, a terminal device, and a computer storage medium.
Background
As a traditional metering instrument, the pointer type meter is still widely applied to various fields such as electric power, transportation, scientific experiments, resident life and the like at present due to the advantages of simple structure, low price, convenient maintenance, corrosion resistance, no magnetic field interference, low temperature resistance, high reliability and the like.
The pointer type meter needs to be read or accurately identified periodically. The identification technology of the pointer type instrument is developed to present, the instrument can be detected by means of combining machine vision with image processing, the most important processing means and method is the searching of the position of a pointer on the instrument, and the automatic identification of the degree of the instrument can be realized only by accurately identifying the position of the pointer. Some current methods require knowledge of a priori, such as the center of rotation of the marker, i.e., the center of rotation of the pointer, or other information. Some methods directly perform identification through image processing, remove interference factors step by step, and then find the pointer, but the methods are usually only used for instrument identification of a single scene and cannot be used universally.
Disclosure of Invention
The application provides an instrument template establishing method, terminal equipment and a computer storage medium, and mainly solves the technical problem of how to improve the identification precision and the identification efficiency of instrument degrees.
In order to solve the technical problem, the present application provides an instrument template establishing method, where the template establishing method includes:
acquiring a first template image, and identifying scale points on the first template image;
generating a fitting graph based on the scale points;
correcting the first template image based on the fitted graph and a preset graph to obtain a second template image;
performing polar coordinate conversion on the second template image based on the fitting graph to obtain a polar coordinate value corresponding to the polar coordinate graph and the scale point information;
saving the polar coordinate graph and the corresponding relation between the scale points and the polar coordinate values as the instrument template;
and identifying the image of the instrument to be detected based on the instrument template so as to obtain the scale value indicated in the image of the instrument to be detected.
In order to solve the above technical problem, the present application further provides a terminal device, where the terminal device includes a memory and a processor, where the memory is coupled to the processor;
wherein the memory is used for storing program data, and the processor is used for executing the program data to realize the instrument template establishing method.
In order to solve the above technical problem, the present application further provides a computer storage medium for storing program data, which when executed by a processor, is used to implement the above instrument template establishing method.
Compared with the prior art, the beneficial effect of this application is: the terminal equipment acquires a first template image and identifies scale points on the first template image; generating a fitting graph based on the scale points; correcting the first template image based on the fitting graph and the preset graph to obtain a second template image; performing polar coordinate conversion on the second template image based on the fitting graph to obtain a polar coordinate value corresponding to the polar coordinate graph and the scale point information; saving the polar coordinate graph and the corresponding relation between the scale points and the polar coordinate values as an instrument template; and identifying the image of the instrument to be detected based on the instrument template so as to obtain the scale value indicated in the image of the instrument to be detected. The instrument template establishing method can improve the identification precision and identification efficiency of the instrument degree.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts. Wherein:
FIG. 1 is a schematic flow chart diagram of a first embodiment of a method for building a meter template provided by the present application;
FIG. 2 is a schematic diagram of the present application setting a recognition box for a first template image;
FIG. 3 is a schematic flow chart diagram of a second embodiment of a method for creating a meter template provided by the present application;
FIG. 4 is an ellipse information of a first template image and a perfect circle information of a second template image according to the present application
A schematic diagram of (a);
FIG. 5 is a schematic illustration of a second template image of the present application.
FIG. 6 is a schematic flow chart diagram of a third embodiment of a method for creating a meter template provided by the present application;
FIG. 7 is a schematic illustration of a second template image marking pointer of the present application;
FIG. 8 is a schematic flow chart diagram illustrating a fourth embodiment of a method for creating a meter template provided by the present application;
fig. 9 is a schematic structural diagram of an embodiment of a terminal device provided in the present application;
fig. 10 is a schematic structural diagram of another embodiment of a terminal device provided by the present application
FIG. 11 is a schematic structural diagram of an embodiment of a computer storage medium according to the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be described clearly and completely with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only some embodiments of the present application, and not all 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.
In order to solve the above problem, the present application provides a method for establishing an instrument template, and specifically refer to fig. 1, where fig. 1 is a schematic flow chart of a first embodiment of the method for establishing an instrument template provided by the present application. The instrument template establishing method is applied to a terminal device, and can be a terminal device such as a smart phone, a tablet computer, a notebook computer, a computer or a wearable device.
As shown in fig. 1, the method for establishing an instrument template in this embodiment specifically includes the following steps:
s101: and acquiring a first template image, and identifying scale points on the first template image.
The terminal equipment can establish communication connection with an external camera device, the camera device collects and records information of a universal pointer instrument place in real time, and the collected information is used as source data of an instrument template establishing method and is sent to the terminal equipment.
In addition, the terminal device can also be accessed to an external storage device, and the external storage device can be a mobile hard disk, a floppy disk drive, a U disk or an optical disk drive, etc.; the external storage device stores a general pointer instrument image, and the terminal device can directly acquire the instrument image from the external storage device.
Through the mode, the terminal equipment acquires the first template image, performs key point identification on the first template image, and identifies all scale points of the instrument panel in the first template image.
Further, before identifying the scale points, the terminal device may also establish a frame selection rectangle on the first template image. As shown in fig. 2, the specific process is as follows: the terminal device first recognizes the position and size of the dashboard 21 in the first template image, and then sets the recognition frame 22 according to the position and size of the dashboard 21. Since the scale points all appear on the instrument panel 21, it can be ensured that all the scale points are included in the recognition frame 22; meanwhile, the identification frame 22 includes environment information, and the environment information inputs interference information in the instrument template establishing method, so that the terminal equipment can only identify the content in the identification frame 22 when identifying the scale points, and the identification efficiency of the instrument template establishing method can be effectively improved.
Further, before proceeding to the next step, the terminal device may also crop the first template image according to the recognition frame 22, and only store the image information in the recognition frame 22. Meanwhile, the terminal equipment can also store the identification frame information so as to process the image of the instrument to be detected in the subsequent identification process. The storage manner may be to store the coordinate information of the upper left corner point and the coordinate information of the lower right corner point of the identification frame 22, or to store the coordinate information of the upper left corner point of the identification frame 22, the width information and the height information of the identification frame.
S102: and generating a fitting graph based on the scale points.
The terminal device marks the scale points in the identification frame 22, and records the scale values corresponding to each scale point, for example, the scale values corresponding to the plurality of scale points in fig. 2 are recorded from small to large as follows: 0,10,20,30,40,50,60,70,80,90,100.
When the number of the marked scale points is more than or equal to 5, the terminal equipment can utilize the marked scale points to perform fitting to obtain a fitted graph, the boundary of the fitted graph is composed of a plurality of scale points, and the center is the rotation center of the instrument pointer.
S103: and correcting the first template image based on the fitting graph and the preset graph to obtain a second template image.
And the terminal equipment extracts a preset graph, and compares the preset graph with the fitting graph in the S102 to obtain a change relation between the fitting graph and the preset graph. The terminal equipment further corrects the first template image according to the transformation relation to obtain a second template image.
Because when obtaining the instrument image, the shooting angle of every instrument image probably is inequality, and in order to improve the recognition accuracy of instrument degree, terminal equipment need all correct every instrument image to same shooting angle, and the instrument image after correcting all can be based on the preset figure of scale point fitting promptly. The correction step can improve the similarity between the subsequently input instrument image to be detected and the template image, and can directly identify key points.
S104: and performing polar coordinate conversion on the second template image based on the fitting graph to obtain a polar coordinate value corresponding to the polar coordinate graph and the scale point information.
And the terminal equipment performs polar coordinate conversion on the second template image according to the relevant information of the fitting graph, such as the center information of the fitting graph.
Specifically, the coordinate systems used by the first template image and the second template image are rectangular coordinate systems, and the position points on the first template image and the second template image can be represented by (x, y), that is, to locate the position of the scale point, the terminal device needs to be located to at least two dimensions of information. Therefore, the instrument template establishing method of this embodiment converts the two-dimensional coordinates of the rectangular coordinate system into the one-dimensional coordinates of the polar coordinates by performing polar coordinate conversion on the template image, that is, the coordinate information of the scale points is converted into the height information or the angle information on the polar coordinate diagram.
S105: and saving the polar coordinate graph and the corresponding relation between the scale points and the polar coordinate values as an instrument template.
The terminal equipment stores the polar coordinate graph as an instrument template, and the instrument template further comprises a corresponding relation between scale points marked in the template image and polar coordinate values in the polar coordinate graph.
S106: and identifying the image of the instrument to be detected based on the instrument template so as to obtain the scale value indicated in the image of the instrument to be detected.
The terminal equipment acquires an image of the instrument to be detected, performs key point matching on the image of the instrument to be detected and a pre-stored instrument template, and acquires a polar coordinate value indicated by the image of the instrument to be detected in a polar coordinate graph. The terminal equipment further obtains the scale points corresponding to the polar coordinate values indicated by the to-be-measured instrument image in the polar coordinate graph according to the corresponding relation between the scale points and the polar coordinate values, and finally obtains the scale values indicated by the to-be-measured instrument image according to the scale points.
In the embodiment, the terminal device acquires a first template image and identifies scale points on the first template image; generating a fitting graph based on the scale points; correcting the first template image based on the fitting graph and the preset graph to obtain a second template image; performing polar coordinate conversion on the second template image based on the fitting graph to obtain a polar coordinate value corresponding to the polar coordinate graph and the scale point information; saving the polar coordinate graph and the corresponding relation between the scale points and the polar coordinate values as an instrument template; and identifying the image of the instrument to be detected based on the instrument template so as to obtain the scale value indicated in the image of the instrument to be detected. The instrument template establishing method can improve the identification precision and identification efficiency of the instrument degree.
For step S103 in the embodiment shown in fig. 1, the present application further proposes another specific method. Referring to fig. 3 in detail, fig. 3 is a schematic flowchart of a second embodiment of a method for creating an instrument template according to the present application. The fitting graph in the first embodiment of the instrument template establishing method may be an ellipse, and the preset graph may be a perfect circle.
As shown in fig. 3, the method for establishing an instrument template in this embodiment specifically includes the following steps:
s201: the center of the ellipse is used as the center of the perfect circle, and the major axis is used as the diameter of the perfect circle.
In the above embodiment, the terminal device performs ellipse fitting according to the scale points marked by the first template image to obtain corresponding ellipse information. The terminal device extracts preset perfect circle information based on the ellipse information, specifically, the center of the ellipse is used as the center of the perfect circle, and the major axis of the ellipse is used as the diameter of the perfect circle.
S202: and determining four points corresponding to the long axis and the short axis on the positive circle based on the circle center and the diameter.
S203: and calculating a transformation matrix required by the correction process based on the four points and the end points of the long axis and the short axis.
During the correction process, the terminal equipment firstly locates the end point of the long axis and the end point of the short axis on the ellipse, and then locates the center of the ellipse, namely the center of a positive circle, wherein the radius length of the positive circle is the same as the length of the long axis of the ellipse, so that four points corresponding to the long axis and the short axis on the positive circle are obtained. The terminal equipment substitutes the data into a perspective transformation formula respectively so as to calculate a transformation matrix required in the correction process, namely a homography matrix. As shown in FIG. 4, P 1 、P 2 、P 3 And P 4 Respectively the major and minor axis ends of the ellipse, P 1 '、P 2 '、P 3 ' and P 4 ' are the four endpoints of a perfect circle, respectively.
Wherein, the coordinate of the end point of the ellipse is (x, y), the coordinate of the end point of the perfect circle is (x ', y'), and the transformation relation between the ellipse and the perfect circle is expressed as:
Figure BDA0002254226110000071
wherein the content of the first and second substances,
Figure BDA0002254226110000072
for the transformation matrix, the parameter a, the parameter b, the parameter d, the parameter e are rotation parameters, and the parameter c and the parameter f are translation parameters.
S204: the first template image is rectified into a second template image based on the transformation matrix.
The terminal device corrects the first template image into a second template image based on the transformation matrix calculated in S203, and as shown in fig. 5, the corrected second template image may fit a perfect circle according to the scale points on the instrument panel.
In the embodiment, the terminal equipment only utilizes the scale point information to perform graph fitting and image correction, so that the accuracy of subsequent pointer matching and reading identification is improved; compared with the image correction method in the prior art, the acquired information quantity and the information acquisition difficulty are reduced, and the identification efficiency of the instrument template establishing method can be effectively improved.
For step S105 in the embodiment shown in fig. 1, the present application further proposes another specific method. Referring to fig. 6, fig. 6 is a schematic flowchart illustrating a method for creating a meter template according to a third embodiment of the present application.
As shown in fig. 6, the method for establishing an instrument template in this embodiment specifically includes the following steps:
s301: scale points and scale values in the second template image are identified.
The terminal device needs to mark the pointer information in the second template image, and this process may also occur in the first template image, which is not described herein again.
Specifically, for a general pointer instrument, the position of the tip of the pointer usually appears on the scale mark, and a certain blank area is left between the scale mark and the scale value. Therefore, in the process of identifying the pointer, the terminal device may determine the position of the pointer by identifying the scale points and the scale values in the meter image.
In the second template image, each scale point corresponds to a scale value, and a blank area exists between each scale point and the corresponding scale value. If the pointer does not point to a scale point, the terminal equipment identifies the blank area at the scale point; if the pointer points to a certain scale point, the terminal equipment recognizes that the scale point is a black area.
S302: a pointer is identified between each scale point and the corresponding scale value.
According to the principle, the terminal equipment only needs to identify a partial area in the second template image, namely a blank area between each scale point and the corresponding scale value. The terminal equipment can adopt chroma identification, and if the identification result is white, the area is indicated to have no pointer; if the recognition result is black, the pointer exists in the area.
S303: and cutting the polar coordinate graph according to the pointer, and storing the cut polar coordinate graph.
After the position of the pointer is obtained, the terminal device marks pointer information in the polar coordinate graph, and the mark content includes the length and the width of the pointer, as shown in fig. 7, the terminal device only needs to mark the length of the pointer between the scale point and the scale value. And the terminal equipment cuts the polar coordinate graph according to the length of the pointer mark and stores the cut polar coordinate graph, namely the cut polar coordinate graph at least comprises part of the marked pointer. And the cut polar coordinate graph is used for matching a pointer in the instrument graph to be measured.
Further, since the shapes and sizes of the pointers of most pointer type meters are basically consistent, the terminal device can also cut the shapes of the pointers from the polar coordinate graph according to the lengths and widths of the marked pointers and store the shapes of the pointers, so that the pointers in the meter graph to be detected can be matched in the subsequent identification process.
In this embodiment, the terminal device identifies and marks the pointer in the polar coordinate graph, cuts the polar coordinate graph through the marked pointer, and then saves the cut polar coordinate graph. In this way, the terminal device can reduce the memory required for storing the polar coordinate graph on one hand, and can also reduce the interference information in the polar coordinate graph as much as possible before identification on the other hand.
For step S106 in the embodiment shown in fig. 1, another specific method is further proposed in the present application. Referring to fig. 8, fig. 8 is a schematic flowchart illustrating a method for creating a meter template according to a fourth embodiment of the present application.
As shown in fig. 8, the method for establishing an instrument template in this embodiment specifically includes the following steps:
s401: and performing key point matching on the image of the instrument to be tested according to the first template image so as to transform the image of the instrument to be tested.
The terminal device obtains an image of the instrument to be tested, and please refer to the process of obtaining the first template image in S101 in the first embodiment, which is not described herein again.
The terminal equipment firstly matches key points of the image of the instrument to be measured with the first template image, so that the image of the instrument to be measured is correspondingly corrected according to the first template image, such as translation, scaling and the like, and finally the image of the instrument to be measured is similar to the first template image, namely the circle center positions of the elliptic figures fitted through the scale points are close, and the sizes of the instruments are close.
Through the correction process of the step, the terminal equipment can directly identify the image of the instrument to be detected by using the pre-stored instrument template.
Furthermore, the terminal equipment can also directly utilize the pre-stored identification frame to perform frame selection identification on the scale points in the image of the instrument to be detected, so that the identification speed is increased.
S402: and correcting the transformed image of the instrument to be detected according to the preset graph.
The terminal equipment can directly utilize the ellipse graph stored in modeling to perform perspective transformation on the transformed image of the instrument to be tested.
S403: and carrying out polar coordinate conversion on the corrected image of the instrument to be measured according to the polar coordinate graph.
The terminal equipment can directly utilize the polar coordinate graph stored in modeling to perform polar coordinate conversion on the corrected image of the instrument to be measured.
S404: and identifying the scale value indicated by the converted image of the instrument to be detected according to the corresponding relation between the scale point and the polar coordinate value.
The terminal equipment intercepts a pointer target area in a polar coordinate graph stored in modeling, and performs key point matching on the polar coordinate graph of the instrument image to be detected and the pointer target area to obtain the position of the pointer in the polar coordinate graph of the instrument image to be detected. And then, the terminal equipment converts the position of the pointer in the polar coordinate graph of the image of the instrument to be measured into scale value information indicated in the image of the instrument to be measured according to the corresponding relation between the scale points and the polar coordinate values stored in modeling.
Further, if the shape of the pointer stored in the terminal device during the modeling process is the shape of the pointer, in this step, the terminal device may directly perform the key point matching with the polar coordinate diagram of the image of the meter to be measured according to the shape of the pointer stored during the modeling process.
Specifically, the terminal device obtains a scale value indicated in the instrument image to be measured, that is, the height position of the pointer of the instrument image to be measured, and then obtains the pointer position of the pointer on the instrument image to be measured through inverse polar coordinate transformation according to the matched height position of the pointer.
For example, the scale reading of the image of the meter to be measured can be identified by the height position of the pointer according to the height information and the scale information stored in the modeling process, and the specific formula is represented as follows:
Figure BDA0002254226110000091
wherein H is the height of the matched pointer, reading is the scale value reading of the image of the instrument to be measured, H n Is a height position of a scale mark on the pointer, H n+1 Read a location of a scale point height below the pointer n+1 Is H n+1 Corresponding scale reading, read n Is H n Corresponding scale reading.
To implement the method for establishing an instrument template according to the foregoing embodiment, the present application further provides a terminal device, and specifically refer to fig. 9, where fig. 9 is a schematic structural diagram of an embodiment of the terminal device according to the present application.
The terminal device 500 of the present embodiment includes an acquisition module 51, a conversion module 52, a modeling module 53, and an identification module 54.
The obtaining module 51 is configured to obtain a first template image and identify a scale point on the first template image.
And a conversion module 52 for generating a fitting graph based on the calibration points.
The conversion module 52 is further configured to correct the first template image based on the fitting graph and the preset graph to obtain a second template image.
The converting module 52 is further configured to perform polar coordinate conversion on the second template image based on the fitted graph, and obtain a polar coordinate value corresponding to the polar coordinate graph and the scale point information.
And the modeling module 53 is used for storing the polar coordinate graph and the corresponding relation between the scale points and the polar coordinate values as the instrument template.
And the identification module 54 is configured to identify the image of the meter to be measured based on the meter template to obtain the scale value indicated in the image of the meter to be measured.
To implement the method for establishing an instrument template according to the foregoing embodiment, the present application further provides a terminal device, and specifically refer to fig. 10, where fig. 10 is a schematic structural diagram of another embodiment of the terminal device provided in the present application.
The terminal device 600 of the present embodiment comprises a memory 61 and a processor 62, wherein the memory 61 and the processor 62 are coupled.
The memory 61 is used for storing program data, and the processor 62 is used for executing the program data to realize the instrument template establishing method of the above embodiment.
In the present embodiment, the processor 62 may also be referred to as a CPU (Central Processing Unit). The processor 62 may be an integrated circuit chip having signal processing capabilities. The processor 62 may also be a general purpose processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf programmable gate array (FPGA) or other programmable logic device, discrete gate or transistor logic, discrete hardware components. A general purpose processor may be a microprocessor or the processor 62 may be any conventional processor or the like.
The present application also provides a computer storage medium, as shown in fig. 11, the computer storage medium 700 is used for storing program data 71, and the program data 71, when executed by a processor, is used for implementing the method as described in the embodiment of the instrument template building method of the present application.
The method involved in the embodiment of the meter template establishing method of the present application, when implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a device, for example, a computer readable storage medium. Based on such understanding, the technical solution of the present application may be substantially implemented or contributed by the prior art, or all or part of the technical solution may be embodied in a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) or a processor (processor) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
The above description is only for the purpose of illustrating embodiments of the present application and is not intended to limit the scope of the present application, and all modifications of equivalent structures and equivalent processes, which are made by the contents of the specification and the drawings of the present application or are directly or indirectly applied to other related technical fields, are also included in the scope of the present application.

Claims (9)

1. An instrument template establishing method is characterized by comprising the following steps:
acquiring a first template image, and identifying scale points on the first template image;
generating a fitting graph based on the scale points;
correcting the first template image based on the fitted graph and a preset graph to obtain a second template image, wherein the fitted graph is an ellipse, and the preset graph is a perfect circle;
performing polar coordinate conversion on the second template image based on the fitting graph to obtain a polar coordinate value corresponding to the polar coordinate graph and the scale point information;
saving the polar coordinate graph and the corresponding relation between the scale points and the polar coordinate values as the instrument template;
identifying an instrument image to be detected based on the instrument template to obtain a scale value indicated in the instrument image to be detected;
after the polar coordinate value corresponding to the polar coordinate graph and the scale point information is obtained, the establishing method comprises the following steps:
identifying scale points and scale values in the second template image;
identifying a pointer between each of the scale points and the corresponding scale value;
and cutting the polar coordinate graph according to the length of the pointer between the scale point and the scale value, and storing the cut polar coordinate graph, wherein the cut polar coordinate graph is used for matching the pointer in the image of the instrument to be detected.
2. The meter template establishing method according to claim 1,
the fitting graph is an ellipse and comprises a long axis and an ellipse center; the preset graph is a perfect circle;
the step of correcting the first template image based on the fitted graph and a preset graph to obtain a second template image comprises:
and correcting the first template image by taking the center of the ellipse as the center of the right circle and the long axis as the diameter of the right circle to obtain the second template image.
3. The meter template establishing method according to claim 2,
the step of correcting the first template image by taking the center of the ellipse as the center of the right circle and the long axis as the diameter of the right circle to obtain a second template image comprises:
determining four points on the perfect circle corresponding to the major axis and the minor axis based on the circle center and the diameter;
calculating a transformation matrix required by a correction process based on the four points, the end point of the long axis and the end point of the short axis;
rectifying the first template image into the second template image based on the transformation matrix.
4. The meter template establishing method according to claim 1,
the step of acquiring a first template image and identifying a scale point on the first template image includes:
acquiring the first template image, and establishing an identification frame based on the first module image, wherein the identification frame comprises all scale points and comprises environmental information;
and cutting the first template image based on the identification frame.
5. The meter template establishing method according to claim 1,
after the step of identifying a pointer between each of the scale points and the corresponding scale value, the method comprises:
and saving the shape of the pointer and the corresponding relation between the scale point and the polar coordinate value as the instrument template.
6. The meter template establishing method according to claim 1,
the step of identifying the image of the instrument to be measured based on the instrument template to obtain the scale value indicated in the image of the instrument to be measured comprises the following steps:
performing polar coordinate conversion on the instrument image to be detected according to the polar coordinate graph in the instrument template;
and identifying and indicating the scale value of the converted image of the instrument to be detected according to the corresponding relation between the scale point and the polar coordinate value.
7. The meter template creation method according to claim 6,
the meter template further comprises the first template image;
the step of performing polar coordinate conversion on the to-be-measured instrument image according to the polar coordinate graph in the instrument template comprises the following steps of:
performing key point matching on the instrument image to be detected according to the first template image so as to transform the instrument image to be detected;
correcting the transformed image of the instrument to be detected according to the preset graph;
and carrying out polar coordinate conversion on the corrected image of the instrument to be detected according to the polar coordinate graph.
8. A terminal device, comprising a memory and a processor, wherein the memory is coupled to the processor;
wherein the memory is used for storing program data and the processor is used for executing the program data to realize the instrument template establishing method of any one of claims 1-7.
9. A computer storage medium for storing program data which, when executed by a processor, is adapted to implement a meter template building method as claimed in any one of claims 1 to 7.
CN201911046359.1A 2019-10-30 2019-10-30 Instrument template establishing method, terminal equipment and computer storage medium Active CN110796095B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911046359.1A CN110796095B (en) 2019-10-30 2019-10-30 Instrument template establishing method, terminal equipment and computer storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911046359.1A CN110796095B (en) 2019-10-30 2019-10-30 Instrument template establishing method, terminal equipment and computer storage medium

Publications (2)

Publication Number Publication Date
CN110796095A CN110796095A (en) 2020-02-14
CN110796095B true CN110796095B (en) 2022-08-09

Family

ID=69442126

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911046359.1A Active CN110796095B (en) 2019-10-30 2019-10-30 Instrument template establishing method, terminal equipment and computer storage medium

Country Status (1)

Country Link
CN (1) CN110796095B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111488874A (en) * 2020-04-03 2020-08-04 中国农业大学 Method and system for correcting inclination of pointer instrument
CN112464986B (en) * 2020-10-30 2023-01-24 山东浪潮科学研究院有限公司 Reading method and device for pointer type disc instrument
CN113378663B (en) * 2021-05-25 2023-03-24 武汉理工大学 Inspection pointer type circular instrument identification method and device
CN113537153A (en) * 2021-08-20 2021-10-22 杭州灵伴科技有限公司 Meter image identification method and device, electronic equipment and computer readable medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104729460A (en) * 2014-12-25 2015-06-24 北京林业大学 Novel photographing level gauge and use method thereof
CN106778823A (en) * 2016-11-22 2017-05-31 国网湖北省电力公司宜昌供电公司 A kind of readings of pointer type meters automatic identifying method
CN107292871A (en) * 2017-06-08 2017-10-24 国网青海省电力公司检修公司 A kind of real-time correction algorithm of transformer station's round meter
CN107563368A (en) * 2017-09-08 2018-01-09 清华大学 The High Precision Automatic reading plotter and method of double hand of dial formula instrument
CN108121985A (en) * 2017-11-21 2018-06-05 武汉中元华电科技股份有限公司 A kind of double pointer meters number reading methods based on machine vision
CN109558871A (en) * 2018-10-26 2019-04-02 中国科学院长春光学精密机械与物理研究所 A kind of readings of pointer type meters recognition methods and device
CN110245654A (en) * 2018-11-20 2019-09-17 浙江大华技术股份有限公司 Total indicator reading recognition methods and device, computer installation and readable storage medium storing program for executing

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104729460A (en) * 2014-12-25 2015-06-24 北京林业大学 Novel photographing level gauge and use method thereof
CN106778823A (en) * 2016-11-22 2017-05-31 国网湖北省电力公司宜昌供电公司 A kind of readings of pointer type meters automatic identifying method
CN107292871A (en) * 2017-06-08 2017-10-24 国网青海省电力公司检修公司 A kind of real-time correction algorithm of transformer station's round meter
CN107563368A (en) * 2017-09-08 2018-01-09 清华大学 The High Precision Automatic reading plotter and method of double hand of dial formula instrument
CN108121985A (en) * 2017-11-21 2018-06-05 武汉中元华电科技股份有限公司 A kind of double pointer meters number reading methods based on machine vision
CN109558871A (en) * 2018-10-26 2019-04-02 中国科学院长春光学精密机械与物理研究所 A kind of readings of pointer type meters recognition methods and device
CN110245654A (en) * 2018-11-20 2019-09-17 浙江大华技术股份有限公司 Total indicator reading recognition methods and device, computer installation and readable storage medium storing program for executing

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
Automatic reading system based on automatic alignment control for pointer meter;Qi Li et al.;《IECON 2014 - 40th Annual Conference of the IEEE Industrial Electronics Society》;20150226;全文 *
变电站指针式仪表检测与识别方法;邢浩强;《仪器仪表学报》;20171115;第38卷(第11期);全文 *

Also Published As

Publication number Publication date
CN110796095A (en) 2020-02-14

Similar Documents

Publication Publication Date Title
CN110796095B (en) Instrument template establishing method, terminal equipment and computer storage medium
CN107609451A (en) A kind of high-precision vision localization method and system based on Quick Response Code
CN110751149B (en) Target object labeling method, device, computer equipment and storage medium
CN113269193A (en) Pointer type meter reading method, device and storage medium
CN114897669A (en) Labeling method and device and electronic equipment
CN110245597B (en) Pointer instrument universality identification method
CN112966719B (en) Method and device for recognizing instrument panel reading and terminal equipment
CN113050022B (en) Image positioning method and device based on rotary antenna and terminal equipment
CN116188960A (en) Instrument intelligent reading method, device, equipment and medium based on key point identification
CN112668578B (en) Pointer type instrument reading method, pointer type instrument reading device, computer equipment and storage medium
CN115439626A (en) Data labeling method, device, equipment and storage medium
CN112417975A (en) Method and device for obtaining reading of pointer instrument
CN110210291B (en) Guide vane parameter acquisition method and device, electronic equipment and storage medium
CN112711965B (en) Drawing recognition method, device and equipment
CN112862676A (en) Image splicing method, device and storage medium
CN112464986A (en) Reading method and device for pointer type disc instrument
CN112233171A (en) Target labeling quality inspection method and device, computer equipment and storage medium
US11989908B2 (en) Visual positioning method, mobile machine using the same, and computer readable storage medium
CN116299368B (en) Precision measuring method and device for laser scanner, scanner and storage medium
CN116189192B (en) Intelligent reading identification method and system for pointer instrument
WO2023116620A1 (en) Gesture data annotation method and apparatus
CN114187460A (en) Pointer type instrument reading method, device, equipment and medium integrating marking information
CN111062874B (en) Text image display method, device, equipment and storage medium
CN116225236B (en) Intelligent home scene interaction method based on acousto-optic control
CN114387405B (en) Machine vision-based method and device for quickly positioning tiny features across orders of magnitude

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
GR01 Patent grant
GR01 Patent grant