CN111209890B - Intelligent reading method of pointer angle and storage medium - Google Patents

Intelligent reading method of pointer angle and storage medium Download PDF

Info

Publication number
CN111209890B
CN111209890B CN202010042896.5A CN202010042896A CN111209890B CN 111209890 B CN111209890 B CN 111209890B CN 202010042896 A CN202010042896 A CN 202010042896A CN 111209890 B CN111209890 B CN 111209890B
Authority
CN
China
Prior art keywords
pointer
angle
image
real
pointer angle
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
CN202010042896.5A
Other languages
Chinese (zh)
Other versions
CN111209890A (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.)
Jiangxi Suirui Intelligent Technology Co ltd
Suirui Technology Group Co Ltd
Original Assignee
Jiangxi Suirui Intelligent Technology Co ltd
Suirui Technology Group 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 Jiangxi Suirui Intelligent Technology Co ltd, Suirui Technology Group Co Ltd filed Critical Jiangxi Suirui Intelligent Technology Co ltd
Priority to CN202010042896.5A priority Critical patent/CN111209890B/en
Publication of CN111209890A publication Critical patent/CN111209890A/en
Application granted granted Critical
Publication of CN111209890B publication Critical patent/CN111209890B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V20/00Scenes; Scene-specific elements
    • G06V20/10Terrestrial scenes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T11/002D [Two Dimensional] image generation
    • G06T11/40Filling a planar surface by adding surface attributes, e.g. colour or texture
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/20Image enhancement or restoration using local operators
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/70Denoising; Smoothing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/11Region-based segmentation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/155Segmentation; Edge detection involving morphological operators
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/187Segmentation; Edge detection involving region growing; involving region merging; involving connected component labelling
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • G06V10/25Determination of region of interest [ROI] or a volume of interest [VOI]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/40Extraction of image or video features
    • G06V10/44Local feature extraction by analysis of parts of the pattern, e.g. by detecting edges, contours, loops, corners, strokes or intersections; Connectivity analysis, e.g. of connected components
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/74Image or video pattern matching; Proximity measures in feature spaces
    • G06V10/75Organisation of the matching processes, e.g. simultaneous or sequential comparisons of image or video features; Coarse-fine approaches, e.g. multi-scale approaches; using context analysis; Selection of dictionaries
    • G06V10/751Comparing pixel values or logical combinations thereof, or feature values having positional relevance, e.g. template matching
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10004Still image; Photographic image
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20024Filtering details
    • 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)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Multimedia (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Computing Systems (AREA)
  • Databases & Information Systems (AREA)
  • Evolutionary Computation (AREA)
  • General Health & Medical Sciences (AREA)
  • Medical Informatics (AREA)
  • Software Systems (AREA)
  • Image Analysis (AREA)

Abstract

The invention discloses an intelligent reading method of pointer angle and a storage medium, wherein the method comprises the following steps: receiving a real-time image of an instrument, and preprocessing the real-time image to obtain a dial image acquired in real time; intercepting a target area in the dial image acquired in real time to acquire a coordinate O at a pointer rotating shaft in the target area; extracting pointer skeleton and detecting Hough straight line to obtain a first pointer angleAccording to the first pointer angleJudging whether the pointer is reverse or not if the preset condition is met; and when the pointer is in a reverse direction, the final angle of the pointer is the angle calculated by the first pointer angle according to a preset processing mode. The intelligent reading method and the storage medium for the pointer angle provided by the invention ensure the accuracy, can not cause the backward direction of the pointer angle, and improve the accuracy of the pointer instrument reading.

Description

Intelligent reading method of pointer angle and storage medium
Technical Field
The invention relates to the technical field of intelligent identification of instruments and meters, in particular to an intelligent reading method of pointer angles and a storage medium.
Background
The pointer type instrument has the advantages of convenient use, low price, high reliability, high dustproof and waterproof performance, strong electromagnetic interference resistance and the like, and is a measuring instrument used in a large amount in the current industrial measuring field. In an industrial field, in order to facilitate the determination of whether the equipment is operating properly, it is necessary to frequently perform a reading operation on the pointer meter.
At present, a machine vision method is widely applied in the field of industrial measurement, and a robot with a high-definition visible light camera is applied to automatic reading of a pointer instrument, so that the method has the advantages of high reading efficiency, all-weather inspection at any time, no influence of severe environment and the like. The method for automatically reading the pointer type instrument mainly comprises the following steps: the method comprises the following six steps of instrument positioning, instrument image preprocessing, pointer extraction, pointer conversion angle and angle conversion reading. The instrument positioning mainly comprises a Hough circle detection and template matching method; the instrument image preprocessing mainly comprises changing image resolution, histogram equalization, filtering smoothing, retinex image enhancement, morphological operation and the like; pointer extraction comprises a maximum connected region method, a region growing method and the like; the pointer conversion angle includes method 1: extracting a pointer skeleton, and obtaining an angle by adopting Hough straight line detection and slope calculation; method 2: extracting the minimum circumscribed rectangle of the pointer and calculating the slope to obtain an angle; the angular conversion reading includes the percentage of angle and range.
The inventor based on the application finds that in the existing pointer conversion angle, the method 1 has high precision, but in the process of calculating the angle, the angle is easy to reverse, so that meter reading errors are caused, and the high precision refers to that in the condition that the pointer is not reversed, the method 2 has low precision, but the problem of pointer reversal does not exist.
The information disclosed in this background section is only for enhancement of understanding of the general background of the invention and should not be taken as an acknowledgement or any form of suggestion that this information forms the prior art already known to a person of ordinary skill in the art.
Disclosure of Invention
The invention aims to provide an intelligent reading method of a pointer angle and a storage medium, which can improve the reading precision of an instrument.
In order to achieve the above object, the present invention provides an intelligent reading method for pointer angle, including: receiving a real-time image of an instrument, and preprocessing the real-time image to obtain a dial image acquired in real time; intercepting a target area in the dial image acquired in real time to acquire a coordinate O at a pointer rotating shaft in the target area; extracting pointer skeleton from dial images acquired in real time, and detecting Hough straight lines to obtain a first pointer angle of a pointerAccording to the first pointer angle +.>Judging whether the pointer is reverse or not if the preset condition is met; when the pointer is in a reverse direction, the final angle of the pointer is the angle calculated by the first pointer angle according to a preset processing mode, wherein the preset processing mode is ∈ ->
In a preferred embodiment, after the pointer skeleton extraction and Hough line detection are performed on the dial image acquired in real time, the method further includes: when the pointer is not reversed, the final angle of the pointer is the first pointer angle.
In a preferred embodiment, the preprocessing the real-time image to obtain a real-time acquired dial image includes: a template image of the instrument is obtained in advance; preprocessing the real-time image and the template image; and carrying out template matching on the preprocessed real-time image according to the preprocessed template image to obtain a dial image acquired in real time.
In a preferred embodiment, the capturing the target area in the dial image acquired in real time, after obtaining the coordinate O at the pointer rotation axis in the target area, further includes: and carrying out pixel filling and morphological processing on the dial image acquired in real time to obtain a pointer image.
In a preferred embodiment, the pixel filling and morphological processing are performed on the dial image acquired in real time, and after obtaining the pointer image, the method further includes: acquiring coordinates of four endpoints of a minimum circumscribed rectangle of the pointer image; respectively calculating coordinates of midpoints of all endpoints; respectively calculating the distance between the coordinate O at the rotating shaft and the point coordinate of each endpoint; and calculating the second pointer angle according to the maximum value in the distance between the coordinate O at the rotating shaft and the point coordinate in each endpoint.
In a preferred embodiment, the first pointer angle is based onWhether the preset condition is met or not, and judging whether the pointer is reverse or not comprises: when a first preset condition is met, the pointer is judged to be reverse, and the first preset condition comprises: the first pointer angle is between 180 ° and 360 ° and the second pointer angle is between 0 ° and 180 °; the first pointer angle and the second pointer angle are both between 0 and 180 degrees; the first pointer angle is between 0 ° and 180 ° and the second pointer angle is between 180 ° and 360 °; or the first pointer angle and the second pointer angle are both between 180 degrees and 360 degrees.
In a preferred embodiment, when the first pointer angle is between 180 ° and 360 ° and the second pointer angle is between 0 ° and 180 °, the preset processing manner is thatWhen the first pointer angle and the second pointer angle are both between 0 and 180 degrees, the preset processing mode is +.>When the first pointer angle is between 0 and 180 DEG and the first pointer angle isWhen the angle of the pointer is between 180 and 360 degrees, the preset treatment mode is +.>Or when the first pointer angle and the second pointer angle are both between 180 degrees and 360 degrees, the preset processing mode is +.>
In a preferred embodiment, the first pointer angle is based onWhether the preset condition is met or not, and judging whether the pointer is reverse or not comprises: when a second preset condition is met, the pointer is judged not to be reversed, and the second preset condition comprises: the angle difference value between the first pointer angle and the second pointer angle is smaller than an angle difference threshold value; />Less than an angle difference threshold; or->Less than the angle difference threshold.
To achieve the above object, the present invention also provides a storage medium storing computer-executable instructions for performing the above-described intelligent reading method of the pointer angle.
Compared with the prior art, according to the intelligent reading method and the storage medium of the pointer angle, the pointer skeleton extraction and Hough straight line detection are carried out on the dial plate image acquired in real time, so that the first pointer angle of the pointer is obtainedAccording to the first pointer angle +.>Judging whether the pointer is reverse or not if the preset condition is met; when the pointer is in a reverse direction, the final angle of the pointer is the angle of the first pointer angle calculated according to a preset processing mode, so that the precision is ensured, the pointer angle cannot be reversed, and the accuracy of the pointer type instrument reading is improved.
Drawings
Fig. 1 is a flowchart of a method for reading a pointer angle according to an embodiment of the present invention.
Fig. 2 is a schematic representation of a real-time image of a meter according to an embodiment of the invention.
Fig. 3 is a schematic diagram of a real-time image after Retinex image enhancement processing according to an embodiment of the present invention.
Fig. 4 is a schematic diagram of a template image for instrument panel area extraction after image enhancement processing according to an embodiment of the present invention.
Fig. 5 is a schematic diagram of a Surf algorithm matched according to an embodiment of the present invention.
Fig. 6 is a schematic diagram of a real-time acquired dial image according to an embodiment of the present invention.
Fig. 7 is a schematic diagram of a pixel after filling in accordance with an embodiment of the present invention.
Fig. 8 is a schematic diagram after thresholding according to an embodiment of the present invention.
Fig. 9 is a schematic diagram after an open operation process according to an embodiment of the present invention.
Fig. 10 is a schematic diagram of a pointer segmentation extracted according to an embodiment of the present invention.
Fig. 11 is a schematic diagram after the closed-loop processing according to an embodiment of the present invention.
Fig. 12 is a flowchart of a method of reading a pointer angle according to another embodiment of the present invention.
Fig. 13 is a schematic diagram after Hough straight line detection according to an embodiment of the present invention.
FIG. 14 is a schematic diagram of a pointer minimum bounding rectangle in accordance with an embodiment of the present invention.
Fig. 15 is a schematic view of the correct pointer forward direction according to an embodiment of the present invention.
FIG. 16 is a reverse direction of an error pointer according to an embodiment of the present invention.
Fig. 17 is a flowchart of a method of calculating a final angle of a pointer according to an embodiment of the present invention.
Detailed Description
The following detailed description of embodiments of the invention is, therefore, to be taken in conjunction with the accompanying drawings, and it is to be understood that the scope of the invention is not limited to the specific embodiments.
Throughout the specification and claims, unless explicitly stated otherwise, the term "comprise" or variations thereof such as "comprises" or "comprising", etc. will be understood to include the stated element or component without excluding other elements or components.
As shown in fig. 1, a flowchart of a method for reading a pointer angle according to a preferred embodiment of the present invention includes: steps S1-S7.
Step S1 may include: the method comprises the steps of obtaining a template image of an instrument in advance, receiving a real-time image of the instrument, and preprocessing the received real-time image of the instrument and the template image; and carrying out template matching on the preprocessed real-time image according to the preprocessed template image to obtain a dial image acquired in real time.
Specifically, step S1 may be implemented by: firstly, collecting a template image of a pointer instrument to be identified, and storing the template image to ensure that the template image is clear. In the process of inspection, a real-time image of the instrument is acquired, as shown in fig. 2, which is a schematic diagram of the real-time image of the instrument provided by the embodiment of the invention. The acquisition may be performed by an image acquisition robot. Retinex image enhancement processing is performed on the acquired template image and the acquired real-time image for inspection, as shown in fig. 3, which is a schematic diagram of the real-time image after the Retinex image enhancement processing provided by the embodiment of the invention, so as to reduce the influence of different illumination on the acquired image in the actual inspection process. The extraction of the region of interest of the meter dial is performed on the template image obtained by the Retinex image enhancement processing, as shown in fig. 4, which is a schematic diagram of the template image obtained by the extraction of the meter dial region after the image enhancement processing provided by the embodiment of the present invention, and coordinates are saved in a database, so that the template image is conveniently called from the database during actual inspection. The region of interest refers to a key region and a target region in one image, which can embody the content of the whole image, and in this step refers to a dial region of one image, so as to ensure that the feature matrix is correctly calculated without consuming too much time. The captured dial image of the region of interest and the real-time acquired image obtained by the Retinex image enhancement processing are subjected to Surf algorithm matching to obtain a matched image, and a 2*3 matching matrix is obtained through calculation, as shown in fig. 5, which is a schematic diagram after Surf algorithm matching provided by the embodiment of the invention. Affine transformation is carried out on the dial image of the region of interest and the real-time acquisition instrument image obtained by the Retinex image enhancement processing through a matrix of 2*3 to obtain a real-time acquisition dial image, as shown in fig. 6, which is a schematic diagram of the real-time acquisition dial image provided by the embodiment of the invention.
In step S2, the target area is captured in the dial image acquired in real time, and the coordinates O (x Center ,y Center )。
The dial image acquired in real time is intercepted in the region of interest, and the coordinates are stored in a database so as to be conveniently called from the database when the robot is actually patrolled and examined, in the step, the region of interest refers to the pointer and scale region of the image, and the coordinates O (x Center ,y Center ). The content of the whole image can be reflected, so that the influence of the pointer and the area outside the scale area on the extraction pointer is eliminated as much as possible.
In one embodiment, step S2 may be followed by step S3.
In step S3, pixel filling and morphological processing are performed on the dial image acquired in real time, and a pointer image is obtained according to the maximum connected area method.
Specifically, pixel filling is performed on the intercepted target area, and a filled image is shown in fig. 7, which is a schematic diagram after pixel filling provided by the embodiment of the present invention; the pixel values of the pivot region and the pixel values of the pointer are brought into proximity, and the fill pixel values and fill region coordinates are saved into a database. Filling in black the same as the pointer, otherwise the pointer will be interrupted, resulting in inaccurate data.
The filled image is subjected to gaussian filtering to improve the image quality, and filtering smoothing is not limited to gaussian filtering, but may be median filtering, simple filtering, bilateral filtering, and the like, and different filtering is adopted according to the image. The filtered image is subjected to adaptive thresholding, and the processing result is a white pointer and a black background, as shown in fig. 8, which is a schematic diagram after thresholding provided by the embodiment of the invention. The image obtained by thresholding is subjected to morphological open operation denoising processing, so that the rotation axis of the white pointer is as long as possible from the first end, namely the far-end, so that noise is as little as possible, as shown in fig. 9, which is a schematic diagram after open operation processing provided by the embodiment of the invention. For the denoised image, the pointer is split and extracted according to the maximum connected area method, as shown in fig. 10, which is a schematic diagram of the pointer split and extracted according to the embodiment of the present invention. Morphological closing operation is performed on the split pointers to fill holes of the split pointers, so that the integrity of the pointers is ensured, and the pointer skeleton extraction is facilitated later, as shown in fig. 11, which is a schematic diagram after the closing operation provided by the embodiment of the invention.
In step S4, performing pointer skeleton extraction and Hough line detection on the dial image acquired in real time to obtain a first pointer angleThe coordinates (x) of the first end of the pointer can also be obtained Long_End ,y Long_End ) And the coordinates (x Short_End ,y Short_End ) The pointer comprises a rotating shaft, the first end can be one end far away from the rotating shaft, and the second end can be one end close to the rotating shaft.
In the step S5 of the process of the present invention,according to the first pointer angleWhether a preset condition is met or not, and whether the pointer is reverse or not is judged. Wherein, the pointer backward refers to that the distance between the actual coordinate and the coordinate O used for representing the farthest end of the pointer is smaller than the distance between the actual coordinate and the coordinate O of the nearest end of the pointer.
In step S6, when the pointer is in the backward direction, the final angle of the pointer is the angle calculated by the first pointer angle according to the preset processing manner, where the preset processing manner is that
In step S7, when the pointer is not reversed, the final angle of the pointer is the first pointer angle.
Therefore, according to the intelligent reading method for the pointer angle, pointer skeleton extraction and Hough straight line detection are carried out on the dial plate image acquired in real time, and a first pointer angle is obtainedAccording to the first pointer angle +.>Judging whether the pointer is reverse or not if the preset condition is met; when the pointer is in a reverse direction, the final angle of the pointer is the angle of the first pointer angle calculated according to a preset processing mode, so that the precision is ensured, the pointer angle cannot be reversed, and the accuracy of the pointer type instrument reading is ensured.
Compared with the prior art, the angle calculated by the method 2 is combined with the angle calculated by the method 1, whether the angle calculated by the method 1 is reverse or not is judged by comparing the angle difference calculated by the method 2 and the angle calculated by the method 1, if so, the angle calculated by the method 1 is calibrated in the forward direction, and the method is applicable to various types of meters, including meters of single pointer type and multi-pointer type, and has high universality and good robustness.
On the basis of the above embodiment, after step S4, a second pointer angle calculating process is further included, and fig. 12 is a flowchart of a pointer angle reading method according to another embodiment of the present invention, and referring to fig. 12, the process specifically includes steps S81-S84.
In step S81, coordinates of four endpoints of the minimum circumscribed rectangle of the pointer image are acquired;
in step S82, coordinates of points in the respective endpoints are calculated;
in step S83, the distances between the coordinates O at the rotation axis and the coordinates of the points at the end points are calculated respectively;
in step S84, the second pointer angle is calculated from the maximum value of the distance between the coordinates O at the rotation axis and the coordinates of the midpoint of each endpoint.
The steps are described in detail below.
The step S4 specifically comprises the following steps:
and (3) extracting the pointer skeleton of the processed image, and only retaining the pointer skeleton of a single pixel. And performing Hough line detection on the pointer skeleton image, as shown in FIG. 13, which is a schematic diagram after Hough line detection provided by the embodiment of the invention, to obtain a coordinate (x) of the first end of the pointer Long_End ,y Long_End ) And the coordinates (x) Short_End ,y Short_End ) Then respectively calculating the distance between the coordinate O at the rotating shaft and the coordinate of the first end of the pointerAnd the distance between the coordinate O at the rotating shaft and the coordinate of the second end of the pointerIf Distance is Long_End >=Distance Short_End The slope k of the pointer is the slope of the coordinate at the axis of rotation and the coordinate at the first end of the pointer, i.eFirst pointer angle->If Distance is Long_End <Distance Short_End The pointer slope k is the slope of the coordinate at the rotation axis and the second end of the pointer, namely +.>First pointer angle
Specifically, steps S81 to S84 may include: as shown in fig. 14, a schematic diagram of a minimum bounding rectangle of pointers according to an embodiment of the present invention is shown: acquiring the minimum circumscribed rectangle of the pointer to obtain four endpoint coordinates of the minimum circumscribed rectangle, which are A (x 1 ,y 1 ),B(x 2 ,y 2 ),C(x 3 ,y 3 ),D(x 4 ,y 4 ) The midpoints of endpoints A and B are then calculated separatelyMidpoint of endpoints B and C->Midpoint of endpoints C and DMidpoint of endpoints D and A->Then respectively calculating coordinates O and AB of the transfer position in the step 6 center ,BC center ,CD center ,DA center The distance between the two plates is set to be equal,
distance is taken ABO ,Distance BCO ,Distance CDO ,Distance DAO The Distance is the largest, assuming Distance ABO The distance is maximum, the slope of the pointer +.>Second pointer angle-> Wherein x is center ,y center Refers to the coordinate O at the pointer rotation axis.
FIG. 15 is a diagram showing the forward direction of the correct pointer according to the embodiment of the present invention, FIG. 16 is a diagram showing the backward direction of the incorrect pointer, i.e. the backward direction of the pointer according to the embodiment of the present invention, and the Distance calculated by Hough line detection is normally Distance Long_End >=Distance Short_End The correct pointer angle can be obtained as shown in FIG. 15, but in many cases, the pointer is not exactly a straight line after the refinement, resulting in a Distance calculated by detecting the Hough straight line Long_End <Distance Short_End This results in a backward direction of the calculated pointer angle, resulting in erroneous calculation of the pointer angle, as shown in fig. 16; the pointer angle calculated by the minimum bounding rectangle of the pointer in S84 does not cause the backward direction of the pointer, but the calculated pointer angle has larger deviation from the actual angle of the pointer, so the angle calculated by S84 and the angle calculated by S4 are combined to calculate in S4The obtained error reverse angle is converted into forward direction, so that the precision is ensured.
In one implementation, step S5 is based on the first pointer angleWhether a preset condition is satisfied or not, determining whether the pointer is reverse may include: when the minimum included angle between the first pointer and the second pointer<An angle difference threshold value, judging that the pointer is forward; when the angle difference is threshold<Minimum included angle between first pointer and second pointer<(180 degrees-angle difference threshold), an error is determined, and the process of step S1 or other steps is re-executed. When the minimum included angle between the first pointer and the second pointer>(180 degrees-angle difference threshold), the pointer is determined to be inverted.
In one implementation, step S5 is based on the first pointer angleWhether a preset condition is satisfied or not, determining whether the pointer is reverse may include: when a first preset condition is met, determining that the pointer is reversed, wherein the first preset condition comprises: the first pointer angle is between 180 ° and 360 ° and the second pointer angle is between 0 ° and 180 °; the first pointer angle and the second pointer angle are both between 0 and 180 degrees; the first pointer angle is between 0 ° and 180 ° and the second pointer angle is between 180 ° and 360 °; or the first pointer angle and the second pointer angle are both between 180 degrees and 360 degrees.
In particular, ifAt the same time-> If->At the same time->Final calculation of the pointerIf->At the same time-> If->At the same time->
Step S5 according to the first pointer angleWhether a preset condition is satisfied, determining whether the pointer is reverse may further include: when a second preset condition is met, the pointer is judged not to be reversed, and the second preset condition comprises: the angle difference value between the first pointer angle and the second pointer angle is smaller than an angle difference threshold value; />Less than an angle difference threshold; or->Less than the angle difference threshold.
Wherein the angle difference threshold may be any angle value between 25 and 30 degrees, preferably 30 degrees.
In particular, ifAnd->Difference of-> If->At the same time->Then->And->Is equal to->If-> If->At the same timeThen->And->Is equal to-> If->
As shown in fig. 17, the flowchart of the method for calculating the final angle of the pointer according to the embodiment of the present invention further ensures the accuracy of the pointer meter reading.
The embodiment of the present invention also provides a storage medium storing computer-executable instructions containing a program for executing the intelligent reading method of the pointer angle described above, where the computer-executable instructions can execute the method of any of the method embodiments described above.
The storage medium may be any available medium or data storage device that can be accessed by a computer, including, but not limited to, magnetic storage (e.g., floppy disks, hard disks, magnetic tape, magneto-optical disks (MOs), etc.), optical storage (e.g., CD, DVD, BD, HVD, etc.), and semiconductor storage (e.g., ROM, EPROM, EEPROM, nonvolatile storage (NAND FLASH), solid State Disk (SSD)), etc.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
The foregoing descriptions of specific exemplary embodiments of the present invention are presented for purposes of illustration and description. It is not intended to limit the invention to the precise form disclosed, and obviously many modifications and variations are possible in light of the above teaching. The exemplary embodiments were chosen and described in order to explain the specific principles of the invention and its practical application to thereby enable one skilled in the art to make and utilize the invention in various exemplary embodiments and with various modifications as are suited to the particular use contemplated. It is intended that the scope of the invention be defined by the claims and their equivalents.

Claims (5)

1. An intelligent reading method for pointer angle is characterized by comprising the following steps:
receiving a real-time image of an instrument, and preprocessing the real-time image to obtain a dial image acquired in real time;
intercepting a target area in the dial image acquired in real time to acquire a coordinate O at a pointer rotating shaft in the target area;
performing pixel filling and morphological processing on dial images acquired in real time to obtain pointer images;
extracting pointer skeleton from dial images acquired in real time, and detecting Hough straight lines to obtain a first pointer angle of a pointer
Acquiring coordinates of four endpoints of a minimum circumscribed rectangle of the pointer image; respectively calculating coordinates of midpoints of all endpoints; respectively calculating the distance between the coordinate O at the rotating shaft and the point coordinate of each endpoint; calculating a second pointer angle according to the maximum value of the distance between the coordinate O at the rotating shaft and the point coordinate in each end point
According to the first pointer angleJudging whether the pointer is reverse or not if the preset condition is met; the method specifically comprises the following steps: when a first preset condition is met, the pointer is judged to be reverse, and the first preset condition comprises:
the first pointer angle is between 180 ° and 360 ° and the second pointer angle is between 0 ° and 180 °;
the first pointer angle and the second pointer angle are both between 0 and 180 degrees;
the first pointer angle is between 0 ° and 180 ° and the second pointer angle is between 180 ° and 360 °; or alternatively
The first pointer angle and the second pointer angle are both between 180 degrees and 360 degrees;
when the first pointer angle is between 180 and 360 degrees and the second pointer angle is between 0 and 180 degrees, the preset processing mode is that
When the first pointer angle and the second pointer angle are both between 0 and 180 degrees, the preset processing mode is that
When the first pointer angle is between 0 and 180 degrees and the second pointer angle is between 180 and 360 degrees, the preset processing mode is thatOr alternatively
When the first pointer angle and the second pointer angle are both between 180 degrees and 360 degrees, the preset processing mode is that
2. The intelligent reading method as set forth in claim 1, wherein after the pointer skeleton extraction and Hough line detection are performed on the dial image acquired in real time, the method further comprises:
when the pointer is not reversed, the final angle of the pointer is the first pointer angle.
3. The intelligent reading method according to claim 1, wherein preprocessing the real-time image to obtain a real-time acquired dial image comprises:
a template image of the instrument is obtained in advance;
preprocessing the real-time image and the template image;
and carrying out template matching on the preprocessed real-time image according to the preprocessed template image to obtain a dial image acquired in real time.
4. The intelligent reading method of claim 1, wherein the first pointer angle is based onWhether the preset condition is met or not, and judging whether the pointer is reverse or not comprises:
when a second preset condition is met, the pointer is judged not to be reversed, and the second preset condition comprises:
the angle difference value between the first pointer angle and the second pointer angle is smaller than an angle difference threshold value;
less than an angle difference threshold; or alternatively
Less than the angle difference threshold.
5. A storage medium storing computer-executable instructions for performing the intelligent reading method of the pointer angle of any one of claims 1-4.
CN202010042896.5A 2020-01-15 2020-01-15 Intelligent reading method of pointer angle and storage medium Active CN111209890B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010042896.5A CN111209890B (en) 2020-01-15 2020-01-15 Intelligent reading method of pointer angle and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010042896.5A CN111209890B (en) 2020-01-15 2020-01-15 Intelligent reading method of pointer angle and storage medium

Publications (2)

Publication Number Publication Date
CN111209890A CN111209890A (en) 2020-05-29
CN111209890B true CN111209890B (en) 2024-02-13

Family

ID=70786605

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010042896.5A Active CN111209890B (en) 2020-01-15 2020-01-15 Intelligent reading method of pointer angle and storage medium

Country Status (1)

Country Link
CN (1) CN111209890B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116543376B (en) * 2023-07-03 2023-12-29 广东电网有限责任公司肇庆供电局 Pointer type instrument reading method and system

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2004271209A (en) * 2003-03-05 2004-09-30 Futaba Keiki Kogyo Kk Instrument of measurement numerical value indication type by pointer horizontal turning of spiral pressure gage or the like
JP2006106003A (en) * 2005-10-31 2006-04-20 Denso Corp Meter for automobile
CN104197900A (en) * 2014-09-16 2014-12-10 江苏天诚车饰科技有限公司 Meter pointer scale recognizing method for automobile
CN108681232A (en) * 2018-04-23 2018-10-19 广东乐芯智能科技有限公司 A method of wrist-watch metal finger is adjusted to predeterminated position

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7798026B2 (en) * 2006-01-11 2010-09-21 Continental Automotive Systems Us, Inc. Generated pointer image for an instrument cluster display

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2004271209A (en) * 2003-03-05 2004-09-30 Futaba Keiki Kogyo Kk Instrument of measurement numerical value indication type by pointer horizontal turning of spiral pressure gage or the like
JP2006106003A (en) * 2005-10-31 2006-04-20 Denso Corp Meter for automobile
CN104197900A (en) * 2014-09-16 2014-12-10 江苏天诚车饰科技有限公司 Meter pointer scale recognizing method for automobile
CN108681232A (en) * 2018-04-23 2018-10-19 广东乐芯智能科技有限公司 A method of wrist-watch metal finger is adjusted to predeterminated position

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
一种智能变电站指针式仪表读数识别方法;王东灿;;电脑知识与技术(第14期);全文 *

Also Published As

Publication number Publication date
CN111209890A (en) 2020-05-29

Similar Documents

Publication Publication Date Title
CN107679535B (en) Automatic reading identification system and method for pointer type water meter based on template matching
CN108921176B (en) Pointer instrument positioning and identifying method based on machine vision
CN110659636B (en) Pointer instrument reading identification method based on deep learning
US11900634B2 (en) Method for adaptively detecting chessboard sub-pixel level corner points
CN111931776B (en) Deep learning-based double-pointer instrument reading method
WO2022007431A1 (en) Positioning method for micro qr two-dimensional code
CN111862037A (en) Method and system for detecting geometric characteristics of precision hole type part based on machine vision
CN109434251B (en) Welding seam image tracking method based on particle filtering
CN109508709B (en) Single pointer instrument reading method based on machine vision
CN112257676A (en) Pointer instrument reading method and system and inspection robot
CN110852954B (en) Image inclination correction method and system for pointer instrument
CN116109637B (en) System and method for detecting appearance defects of turbocharger impeller based on vision
CN116168028B (en) High-speed rail original image processing method and system based on edge filtering under low visibility
CN112215060A (en) Hough transform-based high-precision mechanical instrument reading identification method
CN112651259A (en) Two-dimensional code positioning method and mobile robot positioning method based on two-dimensional code
CN111209890B (en) Intelligent reading method of pointer angle and storage medium
TW202127372A (en) Method for defect level determination and computer readable storage medium thereof
CN113705564B (en) Pointer type instrument identification reading method
CN112560839A (en) Automatic identification method and system for reading of pointer instrument
CN113310426A (en) Thread parameter measuring method and system based on three-dimensional profile
CN116385440B (en) Visual detection method for arc-shaped blade
CN111815580A (en) Image edge identification method and small module gear module detection method
Sun K-Cosine Corner Detection.
CN116152532A (en) Remote sensing image feature extraction and matching method and device and electronic equipment
CN108985160B (en) Method and device for determining reading of pointer instrument

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