CN112215060A - Hough transform-based high-precision mechanical instrument reading identification method - Google Patents

Hough transform-based high-precision mechanical instrument reading identification method Download PDF

Info

Publication number
CN112215060A
CN112215060A CN202010878057.7A CN202010878057A CN112215060A CN 112215060 A CN112215060 A CN 112215060A CN 202010878057 A CN202010878057 A CN 202010878057A CN 112215060 A CN112215060 A CN 112215060A
Authority
CN
China
Prior art keywords
pointer
center
circle
instrument
image
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202010878057.7A
Other languages
Chinese (zh)
Other versions
CN112215060B (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.)
Hohai University HHU
Original Assignee
Hohai University HHU
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 Hohai University HHU filed Critical Hohai University HHU
Priority to CN202010878057.7A priority Critical patent/CN112215060B/en
Publication of CN112215060A publication Critical patent/CN112215060A/en
Application granted granted Critical
Publication of CN112215060B publication Critical patent/CN112215060B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V20/00Scenes; Scene-specific elements
    • 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/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
    • G06V10/443Local 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 by matching or filtering
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V2201/00Indexing scheme relating to image or video recognition or understanding
    • G06V2201/02Recognising information on displays, dials, clocks

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Multimedia (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Image Analysis (AREA)
  • Image Processing (AREA)

Abstract

The invention discloses a Hough transform-based high-precision mechanical instrument reading identification method, which belongs to the field of image processing and specifically comprises the following steps; carrying out image preprocessing on the image: binarizing the image into a gray scale image, further filtering the image to remove noise points, and then performing edge detection to remove unnecessary information and simultaneously retain image edge information; detecting the center of the instrument through Hough transform; detecting edge characteristic straight lines of the pointer by using a straight line detection technology of Hough transform, and obtaining the vertex of the pointer by calculating and detecting the intersection point of the edge characteristic straight lines of the pointer, thereby obtaining an accurate pointer ray by combining the center of a circle of the instrument; and calculating a specific reading according to the angle of the vertex of the pointer and the angle of the straight line taking the center of the meter as the vertex and a corresponding formula. The invention improves the accuracy of identifying the reading of the high-precision mechanical instrument and improves the stability of identification.

Description

Hough transform-based high-precision mechanical instrument reading identification method
Technical Field
The invention belongs to the field of image processing, and particularly relates to a Hough transform-based high-precision mechanical instrument reading identification method.
Background
The pointer instrument is widely applied to the medical field due to the advantages of simple structure, convenient maintenance, high precision, strong electromagnetic resistance and the like, and the pointer instrument can directly observe the change direction and the change process of detected data. However, the pointer type meter generally has no data line interface function, the collection of the degree is mainly the reading of visual identification, and is easily affected by many human factors, and meanwhile, the precision of visual identification is very low under the condition that the scale of the meter is not fine enough. Meanwhile, in the medical field, changes before and after certain numerical values need to be comprehensively analyzed, the changes are observed, and the like, and tiny changes are difficult to distinguish by naked eyes, so that the automatic identification of the reading of the pointer instrument is of great practical significance.
The accuracy of the visual reading of the scale of the graduated reading of a sphygmomanometer in the particular field is not sufficient, and the variation of the reading over a period of time is not very large, so that it creates a practical problem that a more accurate digital image recognition means must be required instead of the visual recognition means. The current research has already had a lot of documents for identifying the number of meters, most of the applicable meters are semicircular voltmeters in the industry, full-circular meters rarely appear, and because the pointer used by some meters is large and different from the pointer used by electric meters is thin, the simple and simplified mode of detecting a single line cannot be used for determining the meter, meanwhile, in the actual situation, due to the real situation of shooting and other reasons, the mode of simply detecting a straight line cannot be used for shooting a meter from a complete front angle, so the mode of simply detecting a straight line loses some precision in the fine meters.
In medical treatment, accurate reading of blood pressure can be read by a numerical blood pressure instrument, but due to the limitation of the numerical instrument, a curve of the change of the blood pressure is difficult to continuously display, so that an indicator type mode is needed to display the change curve of the blood pressure, and the relative specific reading is not very important, but the accurate performance of the relative change curve is important.
Disclosure of Invention
The invention aims to solve the technical problem of providing a Hough transform-based high-precision mechanical instrument reading identification method aiming at the defects of the background art, and the method improves the accuracy of identifying the high-precision mechanical instrument reading and improves the stability of identification.
The invention adopts the following technical scheme for solving the technical problems:
a high-precision mechanical instrument reading identification method based on Hough transform specifically comprises the following steps;
step 1, image preprocessing is carried out on an image: binarizing the image into a gray scale image, further filtering the image to remove noise points, and then performing edge detection to remove unnecessary information and simultaneously retain image edge information;
step 2, detecting the center of the instrument through Hough transform;
step 3, detecting edge characteristic straight lines of the pointer through a straight line detection technology of Hough transform, and obtaining the vertex of the pointer by calculating and detecting intersection points of the edge characteristic straight lines of the pointer, so as to obtain an accurate pointer ray by combining the center of a circle of the instrument;
and 4, calculating a deflection angle formed by the pointer ray obtained in the step 3 and the scale mark of the meter 0, and calculating a final reading by combining the deflection angle with the measuring range of the meter.
As a further preferable scheme of the high-precision mechanical instrument index identification method based on hough transform, in step 1, a Canny edge detection operator is used to detect the edge of an image, specifically as follows:
step 1.1, processing the image through a Gaussian filter to remove noise interference;
step 1.2, calculating the amplitude and direction of the gradient by using a first-order differential convolution template;
step 1.3, carrying out maximum suppression on the amplitude of the gradient;
and 1.4, detecting and connecting the connection points on the graph through a double-threshold algorithm.
As a further preferable scheme of the high-precision mechanical instrument reading identification method based on hough transform, the step 2 is specifically as follows:
detecting the largest circle in all the diameters by using a Hough transform method to obtain a circle which is approximate to the outline of the dial plate, and calculating the center of a small circle which is closest to the center of a large circle in all the detected small circles by using the other characteristic of the instrument that the center of the circle on the pointer simultaneously has a small circle, wherein the center of the small circle is the correct center of the instrument;
wherein, the calculation formula for obtaining the most accurate circle center is as follows:
Figure RE-GDA0002830306040000021
wherein, CrIndicating the precise center of a circle of the instrument (c)a,cb) Is the center of one of the circles, (c)a,cb) E C, C represents the center of the circle except for the great circle
Figure RE-GDA0002830306040000022
And (3) collecting the centers of all the other small circles, and obtaining the small circles in a Hough transform detection circle mode with a certain threshold value.
As a further preferable scheme of the high-precision mechanical instrument reading identification method based on hough transform, in step 3, a corresponding threshold value is set by using the distance between a straight line and a circle center, and a plurality of straight lines close to the circle center are detected, wherein a specific calculation formula is as follows:
Figure RE-GDA0002830306040000023
wherein, the expression of the straight line is Ax + By + C as 0, and the center coordinate of the instrument is (x)0,y0) Dist represents the distance between the center of a circle of the instrument and a straight line, and A, B and C all represent parameters of the straight line;
by calculating the intersection points of the straight lines and taking the intersection point which intersects for the most times, the vertex of the corresponding pointer can be obtained, and the specific calculation formula is as follows:
(x1,y1)=argMax(Count(xi,yi))
wherein (x)i,yi) Represents the intersection of any two straight lines, Count (x)i,yi) Indicates the number of occurrences of the intersection, and (x)1,y1) The pointer vertex which is finally obtained is shown, namely the pointer vertex which has the largest occurrence frequency in all the intersection points;
and then, calculating a straight line combining the vertex of the pointer and the center of the meter to obtain an accurate pointer line.
As a further preferable scheme of the high-precision mechanical instrument reading identification method based on hough transform, the step 4 is specifically as follows,
step 4.1, setting the swing direction of the pointer to be anticlockwise, and setting a specific calculation formula of pointer number as follows:
Figure RE-GDA0002830306040000031
wherein the content of the first and second substances,
Figure RE-GDA0002830306040000032
the coordinates of the center of a circle of the instrument are represented,
Figure RE-GDA0002830306040000033
the coordinate of the vertex of the pointer, w is the measuring range of the instrument, b is the offset reading of the instrument, R is the detection result of the reading number indicated by the pointer, the angle obtained by arctan calculation is corrected by the s parameter, the value of s depends on the quadrant of the ray with the center of the circle of the instrument panel as the starting point, when the quadrant is the first quadrant, the value is 0, the value is 1 in the second quadrant and the third quadrant, and the value is 2 in the fourth quadrant; if the direction is clockwise, 2 pi is used for subtracting an index value obtained by the formula, namely 2 pi-R;
step 4.2, setting an initial 0-scale reference line, manually setting the initial 0-scale reference line, namely setting a bias value b for calibration, and if the initial position of the pointer in the actually shot video is the reference line where the 0 scale is located, using the reading at the moment as the bias reading b;
step 4.3, setting the range of the instrument, specifically the reading when the pointer rotates 360 degrees, and setting the maximum range value as w;
and 4.4, establishing a rectangular coordinate system by taking the center of the circle of the instrument as the origin of the coordinate axis and taking the 0-scale reference line as the direction of the x axis.
Step 4.5, calculating a quadrant where the vertex of the pointer is located according to the rectangular coordinate system obtained in the step 4.4, and setting a value of s according to the difference of the quadrants, wherein the first quadrant takes 0, the second and third quadrants take 1, and the fourth quadrant takes 2;
and 4.6, substituting the values into a formula to calculate to obtain an accurate reading.
Compared with the existing meter reading identification technology, the invention has the following advantages and beneficial effects.
1. According to the method, more image edge details can be reserved based on preprocessing modes such as median filtering, Canny edge detection and the like, so that the identification accuracy is improved;
2. the method is based on the identification mode of Hough transform and the mode of identifying a plurality of characteristics of the pointer, so that the method has better performance under the conditions of high-resolution images and scenes requiring higher identification precision, and is more suitable for scenes needing to detect dynamic data.
Drawings
In order to more clearly illustrate the implementation or prior art of the present invention, a brief description of the drawings needed to describe the embodiments or prior art is provided below. It is obvious that the drawings in the following description are only some embodiments of the invention, and that for a person skilled in the art, other drawings can be derived from them without any inventive effort.
FIG. 1 is a meter image for an example of the present invention;
fig. 2 is a flow chart of a high-precision mechanical instrument index identification method based on hough transform.
The specific implementation mode is as follows:
the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, 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 invention.
The invention adopts a Hough transform-based high-precision mechanical instrument reading identification method, as shown in figure 1, which specifically comprises the following steps:
data preprocessing: in order to reflect the change of the display number, a video of the measuring process of the meter needs to be collected, and each frame of the video is regarded as an image to identify the displayed numerical value. The picture first needs to be pre-processed for the image to be accurate and efficient for the subsequent recognition process. Firstly, the image is binarized into a gray scale image to reduce the calculation time, then the image is filtered to remove noise points, and then edge detection is carried out to remove unnecessary information and simultaneously retain the image edge information.
Identifying the instrument center: in order to determine the position of an instrument in an image, firstly, the overall characteristics of the instrument are defined, the mechanical instrument is circular, and the instrument can be detected in a Hough transform circle detection mode, but most instruments are made of stainless steel, so that when the circle in the instrument is detected, most of the circles are influenced by environmental factors such as light reflection, and at the moment, the circle detected by the Hough transform deviates from the true circular shape of the instrument, and other additional characteristics are required to be used for detecting the center of the circle of the instrument to increase the identification accuracy.
Identifying a meter pointer: the center of a circle of the instrument is detected in the steps, the vertex of the pointer needs to be detected in the next step, and the accurate pointer straight line can be obtained through the straight line connecting the vertex of the pointer and the center of the circle of the instrument. According to the method, the edge characteristic straight lines of the pointer are detected through a straight line detection technology of Hough transform, and the vertex of the pointer is obtained by calculating the intersection point of the straight lines, so that an accurate pointer ray is obtained by combining the center of a circle of the instrument. Because the mode of identifying a plurality of straight lines is adopted, the method has higher accuracy compared with the traditional mode of identifying a single pointer line.
Calculating specific readings: after the vertex of the pointer and the center of the meter are detected, a specific number can be calculated according to the angle of a straight line taking the vertex of the pointer and the center of the meter and a corresponding formula, wherein the specific number needs to be calculated according to the quadrant in which the pointer is located, the deflection direction of the pointer, namely anticlockwise or clockwise, the deviation value of an initial pointer zero scale datum line and the like.
The implementation process of the data preprocessing stage comprises the following steps: in the process of executing data preprocessing, a video shot by a camera is an RGB image, that is, each pixel point is composed of three vector spaces of R, G, and B, each vector space has 256 different values, and in order to reduce unnecessary calculation amount, binarization processing needs to be performed first to convert the RGB image into a gray-scale image. The purpose of filtering is to remove noise points so as to improve the identification accuracy, and the medical instrument needs to keep the edge details of the image to the maximum extent due to the high identification accuracy, so the median filtering is adopted in the invention. The image edge detection is an important link in image preprocessing, the obtained edge image can highlight the outline characteristics of the image, meanwhile, the interference factors and the data volume of the image can be reduced, the characteristic structure of the image is not damaged, and the integrity of the target in the image is kept. The Canny edge detection operator is adopted to detect the edges of the images, all edge detail information of the instrument images can be clearly detected, the detail information is well reserved, and the accuracy of identification is improved.
The implementation process of the central stage of the identification instrument comprises the following steps: the largest circle in all the circles is detected by using a Hough transform method, so that a circle which is approximate to the outline of the dial can be obtained, but the circle is not completely attached to the dial, the center of the circle is not positioned in the center of the dial and only approximately dissociates around the center of a right circle, meanwhile, a small circle exists at the center of the pointer by using another characteristic of the medical instrument, namely, the center of the circle on the pointer is calculated, and the center of the small circle which is closest to the center of the large circle in all the detected small circles is the correct center of the instrument.
The implementation process of identifying the meter pointer comprises the following steps: the distance between the straight line and the circle center is used for setting a corresponding threshold value, several straight lines which are close to the circle center can be detected, the corresponding vertex of the pointer can be obtained by calculating the intersection points of the straight lines and taking the intersection points which intersect for the most times, and then the accurate pointer ray can be obtained by calculating the straight line which combines the vertex of the pointer and the circle center.
The implementation process for calculating the specific readings comprises the following steps: after the vertex of the pointer and the center of the meter are detected, a rectangular coordinate system can be established, then the angle of a straight line taking the vertex of the pointer and the center of the meter as the vertex is calculated, and then the desired indication is finally calculated according to the direction, such as anticlockwise or clockwise, represented by the indication of the meter and the overall measuring range of the meter
In order to make the purpose and technical solution of the present invention more clearly understood, the present invention is further described in detail below with reference to fig. 1 and 2.
As shown in fig. 2, the method is an implementation step of the mechanical instrument index identification technology based on hough transform, and the specific method is as follows:
the implementation process of the data preprocessing comprises the following steps: the video shot by the camera is an RGB image, namely each pixel point is composed of three vector spaces of R, G and B, each space vector has 256 different values, in order to reduce unnecessary calculation amount, binarization processing is needed to be carried out firstly, the RGB image is converted into a gray-scale image, a weighting mode is adopted because the actual shooting is possibly influenced by the environment, and a weighting average method is adopted. The purpose of filtering is to remove noise points, so as to improve the accuracy of identification, the classical filtering method is a linear filtering method, such as a neighborhood average method, and the like, while the nonlinear filtering method represented by median filtering is widely applied due to the advantages in the aspect of protecting image edges and details. The median filtering is to give a template, move the template in a certain direction, and calculate the value of the center of the template by using the gray value around the template each time, as follows:
xk=med{xk-n,…,xk,…,xk+n}
wherein med represents the median and the range is x defined by the templatek-nTo xk+nThe result is x filled in the middlekAnd (4) partial.
Since medical meters require a high recognition accuracy, it is important to preserve the edge details of the image to the maximum extent, so median filtering is employed herein. The Canny edge detection operator is adopted to detect the edges of the images, all edge detail information of the instrument images can be clearly detected, the detail information is well reserved, and the accuracy of identification is improved. Canny edge detection is mainly divided into four basic steps:
(1) gaussian filter for processing image and removing noise interference
(2) Calculating magnitude and direction of gradient by using first order difference convolution template
(3) Gradient amplitude maxima suppression
(4) Dual threshold algorithm detection and join points on join graph
The implementation process of the identification instrument center comprises the following steps: the hough transform is a shape matching technique that uses a transformation between two coordinates to detect straight lines and regular curves in a plane, which has the property that the desired edges are clustered together in the transform space to form peaks. The hough transform is some form of coordinate transformation of an image. It concentrates all points on the curve and straight line of given shape in the original image to a certain point in the transformation space to form a peak point. Thus, the problem of detecting a given shape curve or line in the original image is evolved into finding a peak in the transform space. The circle which is approximate to the outline of the dial can be obtained by detecting the largest circle in all the diameters of the circles by using a Hough transform method, as shown in the largest dotted line circle in figure 1, but the circle is not completely attached to the dial, the center of the circle is not positioned in the center of the dial, and only approximately dissociated around the center of the right circle, meanwhile, by using another characteristic of the instrument, namely that a small circle exists at the center of the pointer at the same time, the center of the small circle which is closest to the center of the large circle in all the detected small circles is calculated, and the center of the small circle is the correct center of the instrument.
The calculation formula for obtaining the most accurate circle center is
Figure RE-GDA0002830306040000061
Wherein (c)a,cb) E C, C represents the center of the circle except for the great circle
Figure RE-GDA0002830306040000071
The circle centers of all the small circles except the circle center set can be obtained in a Hough transform circle detection mode with a certain threshold value set, (c)a,cb) The center of one of the circles. CrAnd expressing the accurate center of the meter, and obtaining a final result according to the formula, namely obtaining the accurate center of the meter.
The implementation process of identifying the meter pointer comprises the following steps: the invention uses Hough transform to detect straight line, the algorithm is a practical method, it has many advantages: whether the curve is a solid line or a dashed line, or is missing a portion; it does not matter if the width of the line is not uniform; when several lines are present in the image, they can be processed simultaneously. However, the above advantages cause corresponding disadvantages, that is, a plurality of straight lines meeting the conditions are detected, and a corresponding threshold value is set by using the distance between the straight line and the center of the circle, so that a plurality of straight lines close to the center of the circle can be detected, as shown in the following formula:
Figure RE-GDA0002830306040000072
wherein the expression of the straight line is Ax + By + C as 0, and the coordinate of the center of the meter obtained in the last step is (x)0,y0) Dist represents the distance between the center of a circle of the instrument and a straight line, and a straight line in a relatively short distance range can be obtained by setting a corresponding threshold, two straight lines, namely a pointer straight line 1 and a pointer straight line 2 in fig. 1, are illustrated in fig. 1, so that a situation that a plurality of coincident pointer straight lines are detected in actual operation occurs, which is caused by the detection characteristics of the hough transform algorithm.
By calculating the intersection points of these straight lines, and taking the intersection point where the intersection points are intersected the most times, the vertex of the corresponding pointer can be obtained, as shown in the following formula:
(x1,y1)=argMax(Count(xi,yi))
wherein (x)i,yi) Represents the intersection of any two straight lines, Count (x)i,yi) Indicates the number of occurrences of the intersection, and (x)1,y1) Indicating the pointer vertex finally obtained, i.e. the one with the highest occurrence among all the intersections.
And then, calculating a straight line combining the vertex and the circle center of the pointer to obtain an accurate pointer line. This line is the precise pointer ray in this example, as shown by the dashed line in the pointer in fig. 1.
The implementation process for calculating the specific readings comprises the following steps: after the vertex of the pointer and the center of the meter are detected, a specific index can be obtained according to the angle of a straight line taking the vertex of the pointer and the center of the meter as the vertex, and the calculation formula is as follows on the assumption that the swinging direction of the pointer is in a counterclockwise direction.
Figure RE-GDA0002830306040000073
And the value of s depends on the quadrant of the ray with the center of the instrument panel as the starting point, when the quadrant is the first quadrant, the value of s is 0, the value of s is 1 in the second quadrant and the value of s is 2 in the fourth quadrant.
Figure RE-GDA0002830306040000074
The coordinates of the center of a circle of the instrument are represented,
Figure RE-GDA0002830306040000075
is the coordinate of the pointer vertex, w is the range of the meter, b is the offset reading of the meter, and R is the measurement of the index pointed by the pointer. If the swing direction of the instrument panel is clockwise, the instrument panel can be used for 2 pi-R according to the situation. The quadrant in which the centre of the meter and the ray of the pointer vertex lie determines this parameter, which is used to correct the result of arctan, since arctan can only obtain angles in the (-pi/2, + pi/2) interval, plus sObtaining a result of (0, 2 × pi) after the pi parameter, wherein the value of s depends on a quadrant where a ray taking the center of the instrument panel as a starting point is located, when the quadrant is a first quadrant, the first quadrant takes 0, the second quadrant and the third quadrant take 1, and the fourth quadrant takes 2; if clockwise, 2 pi minus the exponential value obtained by the above formula, i.e. 2 pi-R, is used.
In particular embodiments, the following may be operated:
step 1: and setting the rotating direction of the pointer, keeping the formula unchanged if the pointer rotates anticlockwise, and subtracting the formula to obtain an index value by using 2 pi if the pointer rotates clockwise.
Step 2: setting an initial 0-scale reference line, in this step, an initial 0-scale reference line may be manually set, that is, an offset value b is set for calibration, and if the initial position of the pointer in the actually photographed video is the reference line where the 0-scale is located, as shown in fig. 1, the reading at this time may also be used as the offset reading b.
And step 3: and setting the range of the instrument, specifically the reading of the pointer rotating 360 degrees, and setting the maximum range value as w.
And 4, step 4: and establishing a rectangular coordinate system by taking the center of a circle of the instrument as the origin of a coordinate axis and taking a 0-scale reference line as the direction of an x axis.
And 5: and 4, calculating the quadrant where the vertex of the pointer is located by using the rectangular coordinate system obtained in the step 4, and setting the value of s according to the difference of the quadrants, wherein the first quadrant takes 0, the second and third quadrants take 1, and the fourth quadrant takes 2.
Step 6: and substituting the values into a formula to calculate to obtain an accurate reading.
The above embodiments may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When used in whole or in part, can be implemented in a computer program product that includes one or more computer instructions. When loaded or executed on a computer, cause the flow or functions according to embodiments of the invention to occur, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, the computer instructions may be transmitted from one website site, computer, server, or data center to another website site, computer, server, or data center via wire (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL), or wireless (e.g., infrared, wireless, microwave, etc.)). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that includes one or more of the available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., Solid State Disk (SSD)), among others.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents and improvements made within the spirit and principle of the present invention are intended to be included within the scope of the present invention.
It will be understood by those skilled in the art that, unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs. It will be further understood that terms, such as those defined in commonly used dictionaries, should be interpreted as having a meaning that is consistent with their meaning in the context of the prior art and will not be interpreted in an idealized or overly formal sense unless expressly so defined herein.
The above embodiments are only for illustrating the technical idea of the present invention, and the protection scope of the present invention is not limited thereby, and any modifications made on the basis of the technical scheme according to the technical idea of the present invention fall within the protection scope of the present invention. While the embodiments of the present invention have been described in detail, the present invention is not limited to the above embodiments, and various changes can be made without departing from the spirit of the present invention within the knowledge of those skilled in the art.

Claims (5)

1. A Hough transform-based high-precision mechanical instrument reading identification method is characterized by comprising the following steps: the method specifically comprises the following steps;
step 1, image preprocessing is carried out on an image: binarizing the image into a gray scale image, further filtering the image to remove noise points, and then performing edge detection to remove unnecessary information and simultaneously retain image edge information;
step 2, detecting the center of the instrument through Hough transform;
step 3, detecting edge characteristic straight lines of the pointer through a straight line detection technology of Hough transform, and obtaining the vertex of the pointer by calculating and detecting intersection points of the edge characteristic straight lines of the pointer, so as to obtain an accurate pointer ray by combining the center of a circle of the instrument;
and 4, calculating a deflection angle formed by the pointer ray obtained in the step 3 and the scale mark of the meter 0, and calculating a final reading by combining the deflection angle with the measuring range of the meter.
2. The Hough transform-based high-precision mechanical instrument reading identification method according to claim 1, characterized in that: in step 1, a Canny edge detection operator is used to detect the edges of the image, which is specifically as follows:
step 1.1, processing the image through a Gaussian filter to remove noise interference;
step 1.2, calculating the amplitude and direction of the gradient by using a first-order differential convolution template;
step 1.3, carrying out maximum suppression on the amplitude of the gradient;
and 1.4, detecting and connecting the connection points on the graph through a double-threshold algorithm.
3. The Hough transform-based high-precision mechanical instrument reading identification method according to claim 1, characterized in that: the step 2 is specifically as follows:
detecting the largest circle in all the diameters by using a Hough transform method to obtain a circle which is approximate to the outline of the dial plate, and calculating the center of a small circle which is closest to the center of a large circle in all the detected small circles by using the other characteristic of the instrument that the center of the circle on the pointer simultaneously has a small circle, wherein the center of the small circle is the correct center of the instrument;
wherein, the calculation formula for obtaining the most accurate circle center is as follows:
Figure RE-FDA0002830306030000011
wherein, CrIndicating the precise center of a circle of the instrument (c)a,cb) Is the center of one of the circles, (c)a,cb) E C, C represents the center of the circle except for the great circle
Figure RE-FDA0002830306030000012
And (3) collecting the centers of all the other small circles, and obtaining the small circles in a Hough transform detection circle mode with a certain threshold value.
4. The Hough transform-based high-precision mechanical instrument reading identification method according to claim 1, characterized in that: in step 3, setting corresponding threshold values by using the distance between the straight line and the circle center, and detecting a plurality of straight lines close to the circle center, wherein the specific calculation formula is as follows:
Figure RE-FDA0002830306030000013
wherein, the expression of the straight line is Ax + By + C as 0, and the center coordinate of the instrument is (x)0,y0) Dist represents the distance between the center of a circle of the instrument and a straight line, and A, B and C all represent parameters of the straight line;
by calculating the intersection points of the straight lines and taking the intersection point which intersects for the most times, the vertex of the corresponding pointer can be obtained, and the specific calculation formula is as follows:
(x1,y1)=argMax(Count(xi,yi))
wherein (x)i,yi) Represents the intersection of any two straight lines, Count (x)i,yi) Indicates the number of occurrences of the intersection, and (x)1,y1) The pointer vertex which is finally obtained is shown, namely the pointer vertex which has the largest occurrence frequency in all the intersection points;
and then, calculating a straight line combining the vertex of the pointer and the center of the meter to obtain an accurate pointer line.
5. The Hough transform-based high-precision mechanical instrument reading identification method according to claim 1, characterized in that: the step 4 is specifically as follows,
step 4.1, setting the swing direction of the pointer to be anticlockwise, and setting a specific calculation formula of pointer number as follows:
Figure RE-FDA0002830306030000021
wherein the content of the first and second substances,
Figure RE-FDA0002830306030000022
the coordinates of the center of a circle of the instrument are represented,
Figure RE-FDA0002830306030000023
the coordinate of the vertex of the pointer, w is the measuring range of the instrument, b is the offset reading of the instrument, R is the detection result of the reading number indicated by the pointer, the angle obtained by arctan calculation is corrected by the s parameter, the value of s depends on the quadrant of the ray with the center of the circle of the instrument panel as the starting point, when the quadrant is the first quadrant, the value is 0, the value is 1 in the second quadrant and the third quadrant, and the value is 2 in the fourth quadrant; if the direction is clockwise, 2 pi is used for subtracting an index value obtained by the formula, namely 2 pi-R;
step 4.2, setting an initial 0-scale reference line, manually setting the initial 0-scale reference line, namely setting a bias value b for calibration, and if the initial position of the pointer in the actually shot video is the reference line where the 0 scale is located, using the reading at the moment as the bias reading b;
step 4.3, setting the range of the instrument, specifically the reading when the pointer rotates 360 degrees, and setting the maximum range value as w;
and 4.4, establishing a rectangular coordinate system by taking the center of the circle of the instrument as the origin of the coordinate axis and taking the 0-scale reference line as the direction of the x axis.
Step 4.5, calculating a quadrant where the vertex of the pointer is located according to the rectangular coordinate system obtained in the step 4.4, and setting a value of s according to the difference of the quadrants, wherein the first quadrant takes 0, the second and third quadrants take 1, and the fourth quadrant takes 2;
and 4.6, substituting the values into a formula to calculate to obtain an accurate reading.
CN202010878057.7A 2020-08-27 2020-08-27 Hough transform-based high-precision mechanical instrument reading identification method Active CN112215060B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010878057.7A CN112215060B (en) 2020-08-27 2020-08-27 Hough transform-based high-precision mechanical instrument reading identification method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010878057.7A CN112215060B (en) 2020-08-27 2020-08-27 Hough transform-based high-precision mechanical instrument reading identification method

Publications (2)

Publication Number Publication Date
CN112215060A true CN112215060A (en) 2021-01-12
CN112215060B CN112215060B (en) 2022-08-09

Family

ID=74058979

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010878057.7A Active CN112215060B (en) 2020-08-27 2020-08-27 Hough transform-based high-precision mechanical instrument reading identification method

Country Status (1)

Country Link
CN (1) CN112215060B (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113077392A (en) * 2021-03-17 2021-07-06 华夏芯(北京)通用处理器技术有限公司 High-accuracy automatic reading method for fuzzy photos of pointer table
CN113792727A (en) * 2021-07-30 2021-12-14 华能大理风力发电有限公司 Reading estimation method, device and system based on pointer instrument video image
CN113804116A (en) * 2021-09-10 2021-12-17 湖南捷力泰科技有限公司 Optical testing method and system for membrane thickness
CN116092091A (en) * 2023-02-23 2023-05-09 河北工程大学 Instrument reading identification method based on Labview vision system

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2019056346A1 (en) * 2017-09-25 2019-03-28 深圳传音通讯有限公司 Method and device for correcting tilted text image using expansion method
CN110580480A (en) * 2019-07-21 2019-12-17 天津大学 Meter reading identification method based on image processing

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2019056346A1 (en) * 2017-09-25 2019-03-28 深圳传音通讯有限公司 Method and device for correcting tilted text image using expansion method
CN110580480A (en) * 2019-07-21 2019-12-17 天津大学 Meter reading identification method based on image processing

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113077392A (en) * 2021-03-17 2021-07-06 华夏芯(北京)通用处理器技术有限公司 High-accuracy automatic reading method for fuzzy photos of pointer table
CN113077392B (en) * 2021-03-17 2024-05-10 华夏芯(北京)通用处理器技术有限公司 High-accuracy automatic reading method for fuzzy photo of pointer table
CN113792727A (en) * 2021-07-30 2021-12-14 华能大理风力发电有限公司 Reading estimation method, device and system based on pointer instrument video image
CN113804116A (en) * 2021-09-10 2021-12-17 湖南捷力泰科技有限公司 Optical testing method and system for membrane thickness
CN113804116B (en) * 2021-09-10 2022-06-10 湖南捷力泰科技有限公司 Optical testing method and system for membrane thickness
CN116092091A (en) * 2023-02-23 2023-05-09 河北工程大学 Instrument reading identification method based on Labview vision system

Also Published As

Publication number Publication date
CN112215060B (en) 2022-08-09

Similar Documents

Publication Publication Date Title
CN112215060B (en) Hough transform-based high-precision mechanical instrument reading identification method
CN110580480B (en) Meter reading identification method based on image processing
CN110659636B (en) Pointer instrument reading identification method based on deep learning
CN112818988B (en) Automatic identification reading method and system for pointer instrument
CN109635806B (en) Ammeter value identification method based on residual error network
CN112699876B (en) Automatic reading method for various meters of gas collecting station
CN112257676A (en) Pointer instrument reading method and system and inspection robot
CN105426809B (en) A kind of method of gauge pointer automatic identification
CN111368906B (en) Pointer type oil level meter reading identification method based on deep learning
CN111598109B (en) Intelligent identification method for reading of transformer substation pointer instrument
CN110211178B (en) Pointer instrument identification method using projection calculation
CN110852954B (en) Image inclination correction method and system for pointer instrument
CN109636790B (en) Pipeline structure identification method and device
CN110287887A (en) A kind of scale recognition methods, device and computer storage medium
CN111507186A (en) Substation pointer instrument reading identification method
CN115082658A (en) Method and device for identifying reading of pointer meter
Ye et al. Automatic Value Identification of Pointer-Type Pressure Gauge Based on Machine Vision.
CN112560839A (en) Automatic identification method and system for reading of pointer instrument
CN111950553A (en) Automatic alignment method and device for pointer instrument
CN112488030A (en) Pointer instrument meter reading method based on machine vision
CN116958983A (en) Pointer type pressure gauge automatic calibrator indication reading method based on machine vision
CN110751141A (en) Meter reading identification method and device, terminal equipment and storage medium
CN115588196A (en) Pointer type instrument reading method and device based on machine vision
CN113920305A (en) Lightning arrester instrument identification method and device
Zhai et al. An accurate reading algorithm for substation pointer meters based on improved 2-D gamma function and PA-RetinaNet

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