CN110796095A - Instrument template establishing method, terminal equipment and computer storage medium - Google Patents
Instrument template establishing method, terminal equipment and computer storage medium Download PDFInfo
- Publication number
- CN110796095A CN110796095A CN201911046359.1A CN201911046359A CN110796095A CN 110796095 A CN110796095 A CN 110796095A CN 201911046359 A CN201911046359 A CN 201911046359A CN 110796095 A CN110796095 A CN 110796095A
- Authority
- CN
- China
- Prior art keywords
- template
- instrument
- image
- polar coordinate
- scale
- 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.)
- Granted
Links
- 238000000034 method Methods 0.000 title claims abstract description 78
- 238000006243 chemical reaction Methods 0.000 claims abstract description 17
- 230000008569 process Effects 0.000 claims description 16
- 230000009466 transformation Effects 0.000 claims description 12
- 239000011159 matrix material Substances 0.000 claims description 8
- 238000012937 correction Methods 0.000 claims description 6
- 230000007613 environmental effect Effects 0.000 claims 1
- 238000010586 diagram Methods 0.000 description 13
- 238000012545 processing Methods 0.000 description 6
- 238000005516 engineering process Methods 0.000 description 2
- 239000000284 extract Substances 0.000 description 2
- 238000003702 image correction Methods 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 238000013519 translation Methods 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000008859 change Effects 0.000 description 1
- 238000004891 communication Methods 0.000 description 1
- 238000005260 corrosion Methods 0.000 description 1
- 230000007797 corrosion Effects 0.000 description 1
- 238000002474 experimental method Methods 0.000 description 1
- 238000012423 maintenance Methods 0.000 description 1
- 239000003550 marker Substances 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V20/00—Scenes; Scene-specific elements
- G06V20/20—Scenes; Scene-specific elements in augmented reality scenes
-
- 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/24—Aligning, centring, orientation detection or correction of the image
- G06V10/242—Aligning, centring, orientation detection or correction of the image by image rotation, e.g. by 90 degrees
-
- 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)
- 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
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 effects of this application are: 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 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.
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 positions the end point of the long axis and the end point of the short axis on the ellipse, and then positions the center of the ellipse, namely the center of a circle of a perfect circle, wherein the radius length of the perfect 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 perfect 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, P1、P2、P3And P4Respectively the major and minor axis ends of the ellipse, P1'、P2'、P3' and P4' 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:
wherein,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 fingertip position of the pointer generally 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 detected according to the first template image so as to transform the image of the instrument to be detected.
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:
wherein H is the height of the matched pointer, reading is the scale value reading of the image of the instrument to be measured, HnIs a height position of a scale mark on the pointer, Hn+1Read a location of a scale point height below the pointern+1Is Hn+1Corresponding scale reading, readnIs HnCorresponding 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 (11)
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;
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.
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, wherein the establishing method comprises:
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 index, and storing the cut polar coordinate graph.
6. The meter template creation method according to claim 5,
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.
7. 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.
8. The meter template creating method according to claim 7,
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.
9. The meter template creating method according to claim 7,
the step of 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 comprises the following steps of:
identifying a first polar coordinate value indicated by the instrument image to be detected, and acquiring a second polar coordinate value and a third polar coordinate value adjacent to the first polar coordinate value;
according to the corresponding relation between the scale points and the polar coordinate values, second scale points corresponding to the second polar coordinate values and third scale points corresponding to the third polar coordinate values are obtained;
calculating the ratio of the difference between the first polar coordinate value and the second polar coordinate value to the difference between the second polar coordinate value and the third polar coordinate value;
and calculating the difference value between the second scale point and the third scale point, and obtaining the scale value indicated by the instrument image to be measured according to the product of the difference value between the second scale point and the third scale point and the ratio.
10. 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-9.
11. 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 9.
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 true CN110796095A (en) | 2020-02-14 |
CN110796095B 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) |
Cited By (4)
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 |
CN112464986A (en) * | 2020-10-30 | 2021-03-09 | 济南浪潮高新科技投资发展有限公司 | Reading method and device for pointer type disc instrument |
CN113378663A (en) * | 2021-05-25 | 2021-09-10 | 武汉理工大学 | 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)
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 |
-
2019
- 2019-10-30 CN CN201911046359.1A patent/CN110796095B/en active Active
Patent Citations (7)
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)
Title |
---|
QI LI ET AL.: "Automatic reading system based on automatic alignment control for pointer meter", 《IECON 2014 - 40TH ANNUAL CONFERENCE OF THE IEEE INDUSTRIAL ELECTRONICS SOCIETY》 * |
邢浩强: "变电站指针式仪表检测与识别方法", 《仪器仪表学报》 * |
Cited By (4)
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 |
CN112464986A (en) * | 2020-10-30 | 2021-03-09 | 济南浪潮高新科技投资发展有限公司 | Reading method and device for pointer type disc instrument |
CN113378663A (en) * | 2021-05-25 | 2021-09-10 | 武汉理工大学 | 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 |
Also Published As
Publication number | Publication date |
---|---|
CN110796095B (en) | 2022-08-09 |
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 | |
Yang et al. | An image-based intelligent system for pointer instrument reading | |
CN109165657A (en) | A kind of image feature detection method and device based on improvement SIFT | |
CN106326802A (en) | Two-dimensional code correction method and device and terminal device | |
CN112446918A (en) | Method and device for positioning target object in image, computer device and storage medium | |
CN114494388A (en) | Three-dimensional image reconstruction method, device, equipment and medium in large-view-field environment | |
CN110245597B (en) | Pointer instrument universality identification method | |
CN112509135B (en) | Element labeling method, element labeling device, element labeling equipment, element labeling storage medium and element labeling computer program product | |
CN112102378B (en) | Image registration method, device, terminal equipment and computer readable storage medium | |
CN113050022B (en) | Image positioning method and device based on rotary antenna and terminal equipment | |
CN111336938A (en) | Robot and object distance detection method and device thereof | |
CN114565911B (en) | Instrument reading method and device, computer equipment and storage medium | |
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 | |
CN112417975A (en) | Method and device for obtaining reading of pointer instrument | |
CN112966719A (en) | Method and device for recognizing meter panel reading and terminal equipment | |
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 | |
CN110674817A (en) | License plate anti-counterfeiting method and device based on binocular camera | |
CN112233171A (en) | Target labeling quality inspection method and device, computer equipment and storage medium | |
CN116299368B (en) | Precision measuring method and device for laser scanner, scanner and storage medium | |
CN111062874B (en) | Text image display method, device, equipment and storage medium |
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 |