CN108460331B - Robust pointer instrument reading automatic identification device and identification method thereof - Google Patents

Robust pointer instrument reading automatic identification device and identification method thereof Download PDF

Info

Publication number
CN108460331B
CN108460331B CN201810046784.XA CN201810046784A CN108460331B CN 108460331 B CN108460331 B CN 108460331B CN 201810046784 A CN201810046784 A CN 201810046784A CN 108460331 B CN108460331 B CN 108460331B
Authority
CN
China
Prior art keywords
cylinder
instrument
pointer
robust
camera
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
CN201810046784.XA
Other languages
Chinese (zh)
Other versions
CN108460331A (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.)
Hefei Yili Information Technology Co ltd
Original Assignee
Hefei Yili Information Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hefei Yili Information Technology Co ltd filed Critical Hefei Yili Information Technology Co ltd
Priority to CN201810046784.XA priority Critical patent/CN108460331B/en
Publication of CN108460331A publication Critical patent/CN108460331A/en
Application granted granted Critical
Publication of CN108460331B publication Critical patent/CN108460331B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V20/00Scenes; Scene-specific elements
    • G06V20/20Scenes; Scene-specific elements in augmented reality scenes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/10Image acquisition
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V2201/00Indexing scheme relating to image or video recognition or understanding
    • G06V2201/02Recognising information on displays, dials, clocks

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Multimedia (AREA)
  • Theoretical Computer Science (AREA)
  • Image Analysis (AREA)
  • Image Processing (AREA)
  • Length Measuring Devices By Optical Means (AREA)

Abstract

The invention discloses a robust pointer instrument reading automatic identification device and an identification method thereof, belonging to the field of instruments, meters and machine vision. The invention relates the images of other parts of the instrument and the reading of the pointer by using a machine vision mode under the condition of changing the internal structure of the instrument without changing the performance of the instrument, thereby achieving the purpose of identifying the reading of the instrument and eliminating the influence of the dial environment when the pointer instrument reads from the outside; the automatic identification function of the reading of the pointer instrument can be completed by using a simple image processing algorithm, and the identification precision of the reading of the pointer instrument is improved.

Description

Robust pointer instrument reading automatic identification device and identification method thereof
Technical Field
The invention relates to the field of instruments and meters and machine vision, in particular to a robust pointer instrument reading automatic identification device and an identification method thereof.
Background
The pointer type instrument is widely applied to the fields of machinery, medical treatment, military, civil engineering, chemical engineering and the like, such as locomotive instruments, water meters, pressure meters and the like, and can indicate the running state of a system in real time.
The pointer instrument has the irreplaceable advantage of a digital instrument, namely, the trend of variable quantity is intuitively reflected, for example, an automobile instrument can directly determine the speed change process according to the swing amplitude and the direction of a pointer, and the pointer instrument is clear at a glance, so the pointer instrument can exist for a long time and is not eliminated by the industry.
Pointer meters generally read in two ways: (1) directly and manually reading data on the dial plate; and (2) shooting a dial image and processing the dial image to obtain data. The mode (1) is time-consuming and labor-consuming, is influenced by human factors, and has large errors. The mode (2) is characterized in that the image of the shooting dial plate is influenced by factors such as the placement position and angle of the camera, illumination, unclean dial plate and the like, the image processing difficulty is high, the adaptability is poor, and the algorithm universality is low.
At present, most scholars obtain higher recognition accuracy by improving an image processing algorithm of a dial from the perspective of image processing, for example, the patent application number is as follows: 201510066208.8, the invention provides a robust pointer-type meter reading automatic identification method, which provides an information entropy algorithm based on a probability distribution image for eliminating shadows generated by the edge of a dial and an iterative optimization algorithm for determining the center of the dial, so that the meter reading identification precision is improved.
The pointer instrument has a problem of improving the identification precision by improving an image processing algorithm, if the dial plate is not clean, the annular scale area cannot be clearly shot, and a large error or even an impossible reading can be generated by image reading. There are situations where images taken from outside the meter can and cannot be handled, and likewise there is a problem with manual readings. Therefore, it is insufficient to consider how to more accurately identify the reading of the pointer instrument only from the viewpoint of improving the image processing algorithm, and it needs to be considered from the viewpoint of the instrument itself.
There are many disadvantages to both of the above approaches, reading from outside the meter, and therefore, taking images from inside the meter can be considered. However, the space available inside the meter is small, and to capture an image containing the scale of the meter, the camera is generally placed in two ways: (1) The lens is placed on the annular edge of the opposite end which is directly opposite to the scale mark in the middle of the measuring range of the instrument, and the surface of the lens forms a certain angle with the dial plate; (2) Placing the instrument cover in the middle, wherein the surface of the lens faces the dial plate and is parallel to the dial plate; with the method (1), the height of the camera which can be adjusted up and down is small, the focal distance is too short, so that the photographed dial is very fuzzy, and the perspective change is large. For the method (2), the camera is positioned on the instrument cover right above the dial plate, and the circuit for controlling the camera needs to be wired from the dial plate, so that the appearance of the instrument is influenced, and reading is not facilitated. Therefore, it is also not feasible to take a dial scale image inside the meter.
Disclosure of Invention
The invention aims to overcome the defects of the prior art, provides a robust pointer instrument reading automatic identification device and an identification method thereof, aims to overcome the defects of external reading of the existing pointer instrument, and aims to design a device which can not be influenced by dial environmental factors and can read the dial reading under any condition.
The invention is realized by the following technical scheme:
the invention provides a robust pointer instrument reading automatic identification device which comprises a cylinder, a camera and a circuit board for controlling the camera, wherein the cylinder and a connecting rotating shaft in the center of an instrument panel of a pointer instrument are integrated, the tail part of a pointer of the pointer instrument is arranged on the cylinder, the camera is arranged on the edge of the instrument panel of the pointer instrument, the outer surface of the cylinder surrounds a circle of characteristic patterns, and a lens of the camera is over against the characteristic patterns of the cylinder; the characteristic pattern is associated with the pointer reading by shooting the characteristic pattern, so that the purpose of identifying the meter reading is achieved.
Further, the optical axis of the camera is perpendicular to the rotating shaft of the cylinder and passes through the center of the cylinder, so that the cylinder is imaged in the center of the image, and subsequent processing of the image is facilitated.
Further, the size of the cylinder is related to the recognition accuracy of the meter reading, and determining the size of the cylinder is one of the key points of the present invention, and can be considered from the aspects of the meter accuracy and the spindle stepping size, wherein:
the diameter D of the cylinder, if considered from the aspect of meter accuracy, satisfies:
Figure BDA0001551125070000021
wherein A is the instrument precision, C is the angle corresponding to the range (range angle), FOV is the camera view, and M is the horizontal pixel of the camera;
if the shaft stepping size is considered, the diameter D of the cylinder satisfies the following condition:
Figure BDA0001551125070000022
in the formula, H is the step angle of the stepping motor, S is the subdivision number of the stepping motor, FOV is the camera visual field, and M is the horizontal pixel of the camera.
Further, the diameter of the cylinder needs to be designed according to actual requirements, and the cylinder cannot be too large or too small, so that the appearance and the weight of the cylinder are affected, the performance is affected, the cylinder cannot be too small, the cylinder does not accord with the design principle, and generally the diameter of the cylinder is 4-9 mm.
Further, the characteristic patterns are right-angled triangles and a group of parallel lines surrounding the periphery of the cylinder, one right-angled side of each right-angled triangle is parallel to the height of the cylinder, the other right-angled side of each right-angled triangle is parallel to the circumference of the bottom surface/top surface of the cylinder, and the parallel lines are parallel to or perpendicular to the circumference of the bottom surface/top surface of the cylinder.
Furthermore, the characteristic patterns are saw-toothed patterns surrounding the periphery of the cylinder and parallel lines parallel to the bottom surface of the saw-toothed patterns, the width of each saw tooth corresponds to the large scale of the instrument, and each saw tooth contains characters for distinguishing other saw teeth.
Further, one of the parallel lines coincides with a right-angle side of the right-angle triangle parallel to the circumference of the bottom/top surface of the cylinder, or one of the parallel lines coincides with a line on which the bottom surface of the sawtooth-shaped pattern is located.
The invention also provides a method for reading identification by using the robust pointer instrument reading automatic identification device, which comprises the following steps:
step S1: calibrating a camera, taking a certain fixed point in an image as a reference point, obtaining the pixel coordinates of the point, respectively shooting an image with 0 scale and the current scale, and correcting the image;
step S2: extracting edge pixels of the characteristic pattern in the image, making a vertical line by using the calibrated reference point, and calculating to obtain a line segment pixel value between the intersection point of the vertical line and the corresponding characteristic pattern edge when the scale is 0 and the current scale;
and step S3: calculating the rotation angle of the cylinder according to the 0 scale and the edge line segment pixel value of the corresponding characteristic pattern when the scale is currently scaled;
and step S4: because the rotating angle of the cylinder is equal to the rotating angle of the pointer, the current scale value can be obtained by conversion according to the rotating angle of the cylinder.
Further, in the step S1, the correction includes horizontal correction and perspective distortion correction of the image.
Further, in the step S1, a center point of the image is selected as a reference point.
Compared with the prior art, the invention has the following advantages: aiming at the defect that the pointer instrument reads from the outside, the invention provides a robust pointer instrument reading automatic identification device and an identification method thereof, wherein the method associates images of other parts of the instrument with the pointer reading in a machine vision mode under the condition of changing the internal structure of the instrument without changing the performance of the instrument so as to achieve the purpose of identifying the instrument reading, thereby eliminating the influence of a dial environment when the pointer instrument reads from the outside; the automatic identification function of the reading of the pointer instrument can be completed by using a simple image processing algorithm, and the identification precision of the reading of the pointer instrument is improved.
Drawings
Fig. 1 is a three-dimensional structural view of a robust pointer instrument reading automatic identification device;
FIG. 2 is a side view of the robust pointer instrument reading automatic identification device;
FIG. 3 is a flow chart of the steps of a robust pointer meter reading automatic identification device identification method;
FIG. 4 is an expanded view of the characteristic pattern of example 1 and its intersection with a straight line passing through the reference point;
FIG. 5 is a schematic diagram of a method for calculating pixel values of intersection points of edges of a feature image according to embodiment 1;
FIG. 6 is a development view of a characteristic image of example 2;
FIG. 7 is a characteristic image development view of example 3;
FIG. 8 is a grid diagram;
fig. 9 is a diagram showing the recognition results when the pointer is actually rotated by 2 °,4 °,10 °,15 °,20 °,60 ° (from left to right);
fig. 10 is a diagram showing the recognition results when the hand is actually rotated by 10 °,30 °,50 °,70 °,90 °,110 °,130 °,150 °,170 ° (from left to right).
Detailed Description
The invention provides a robust pointer instrument reading automatic identification device, which comprises a cylinder 300, a camera 200 and a circuit board 210 for controlling the camera 200, wherein the cylinder 300 is integrated with a connecting rotating shaft at the center of an instrument panel 100 of a pointer instrument, the tail part of a pointer of the pointer instrument is arranged on the cylinder 300 and rotates synchronously with the cylinder 300, the camera 200 is arranged at the edge of the instrument panel 100 of the pointer instrument, the outer surface of the cylinder 300 surrounds a circle of characteristic patterns, and a lens of the camera 200 is opposite to the characteristic patterns of the cylinder 300; the circuit board 210 is hidden under the instrument panel 100 of the pointer instrument, and may be disposed at other positions of the pointer instrument.
As shown in fig. 2, the optical axis of the camera 200 is perpendicular to the rotation axis of the cylinder 300 and passes through the center of the cylinder 300, so that the cylinder 300 is imaged at the center of the image, and the subsequent processing of the image is facilitated. The optical axis of the camera 200 may not be perpendicular to the rotation axis of the cylinder 300, or may not pass through the center of the cylinder 300, and at this time, the perspective distortion in the captured image is serious, and the grid image may be used to correct the image of the cylinder 300 to eliminate the perspective distortion and then perform the measurement.
The size of the cylinder 300 is related to the recognition accuracy of the reading of the instrument, and the determination of the size of the cylinder 300 is one of the key points of the present invention, and the size of the cylinder 300 is determined by considering the accuracy of the instrument and the step size of the rotating shaft respectively as follows:
A. from the aspect of instrument precision:
assuming that the instrument precision is A and the measuring range is B, the angle corresponding to the measuring range is called measuring range angle C. The general recognition accuracy is 3 times of the accuracy of the instrument, namely the recognition accuracy is A/3, the calculation formula of the recognition angle R is as follows:
Figure BDA0001551125070000041
deducing:
R=C*A/3 (2)
from image knowledge, the recognizable angle R needs at least one pixel on the image to be reflected (without considering the sub-pixel case), and assuming that the diameter of the cylinder 300 is D, the field of view of the camera 200 is FOV, and the resolution of the camera 200 is M × N, the relationship between the diameter of the cylinder 300 and the accuracy of the meter is:
Figure BDA0001551125070000051
substituting equation (2) into equation (3) yields:
Figure BDA0001551125070000052
the accuracy class of the industrial meter is generally 0.5 to 4, and Table 1 is prepared according to the formula (4), wherein Table 1 lists the diameter values of the cylinder of 0.5 to 2.5 in the speedometer with the measuring range of 210 km/h. As can be seen from table 1, when the range, the range angle, and the resolution of the camera 200 are fixed, the higher the accuracy of the instrument is, the larger the diameter of the cylinder 300 is required to be, and the larger the diameter variation of the cylinder 300 is; when the measuring range, the measuring range angle and the instrument precision are fixed, the larger the resolution of the camera 200 is, the smaller the diameter of the required cylinder 300 is; therefore, the diameter of the cylinder 300 needs to be designed according to actual requirements, and the diameter cannot be too large or too small, the too large diameter affects both appearance and weight and performance, and the too small diameter does not accord with design principles, and according to some common locomotive instrument pointer tail designs, the diameter of the cylinder is generally proper to be 14-20mm, and the larger the diameter is, the higher the instrument reading identification precision is.
Table 1: the diameter value of a 0.5-2.5-grade cylinder of a speedometer with the measuring range of 210km/h
Figure BDA0001551125070000053
B. From the step size of the shaft
The meter center axis of rotation is directly related to the rotation of the cylinder 300 structure, and the minimum angle of rotation of the axis of rotation, i.e., the minimum angle of rotation of the pointer, requires at least one pixel in the image to reflect (regardless of the sub-pixel case). Assuming that the minimum angle of pointer rotation is E, the diameter of the cylinder 300 is D, the field of view of the camera 200 is FOV, and the resolution of the camera 200 is M × N, the relationship between the diameter of the cylinder 300 and the angle of pointer rotation is:
Figure BDA0001551125070000054
deducing:
Figure BDA0001551125070000061
the rotation angle of the rotating shaft is related to the stepping motor, generally, the stepping motor rotates 360 degrees, the pointer rotates 1 degree, the minimum angle of the pointer rotation is related to the minimum angle that the stepping motor can step, and assuming that the stepping angle of the stepping motor is H and the subdivision number is S, the minimum stepping angle H/S of the stepping motor can be obtained by:
Figure BDA0001551125070000062
substituting equation (7) into equation (6) yields:
Figure BDA0001551125070000063
table 2 is prepared according to equation (8), and it can be seen from table 2 that, when the resolution and the subdivision number of the camera 200 are fixed, the smaller the step angle, the larger the diameter of the required cylinder 300; when the step angle is constant, the larger the camera 200 resolution, the smaller the diameter of the cylinder 300 required.
Table 2: cylinder diameter value determined according to the stepping size of central rotating shaft of instrument
Step angle ° Subdivision number Camera 200 resolution Field of vision mm 300 mm diameter cylinder
H S M*N FOV D
1.8 4 640*480 26 10.35
1.5 4 640*480 26 12.42
1.2 4 640*480 26 15.53
1.8 4 1280*960 35 6.97
1.5 4 1280*960 35 8.36
1.2 4 1280*960 35 10.45
Equation (7) shows that the ratio of the step angle to the number of subdivisions represents the minimum angle of pointer rotation, and table 1 is compared with table 2, where the ratio of the step angle to the number of subdivisions in table 2 corresponds to the identified angle in table 1, and the diameters of cylinders 300 calculated in table 1 and table 2 are both the maximum accuracy theoretically achievable for the identified angle under the corresponding parameters. In practice, since it is difficult to distinguish the change of the angle by one pixel, it is generally necessary to identify the corresponding angle by a value larger than a theoretically calculated value.
Through the above analysis, the diameter of the cylinder 300 can be designed from the consideration of the accuracy of the meter and the step size of the rotation shaft, but in the case of the consideration of the step size of the rotation shaft, there is a problem that when the minimum angle of the step of the rotation shaft is difficult to be recognized by naked eyes, the meaning of the diameter of the cylinder 300 is not large according to the design thereof, and the reading error is generally related to the accuracy of the meter, so the following embodiments all design the diameter of the cylinder 300 with the accuracy of the meter.
Knowing that if a cylinder 300 is of the same color as a whole and has no other characteristics, human eyes cannot distinguish the rotation angle, and the cylinder 300 and the pointer reading are identified by using an image, it is also a key point of the present invention to correspond the cylinder 300 and the pointer reading, and the present invention proposes to design a characteristic pattern on the cylinder 300, and to establish a relationship between the characteristic pattern and the pointer reading by identifying the characteristic pattern at 0 scale and the current scale, so as to achieve the purpose of identifying the meter reading, wherein the flow of the identification method is shown in fig. 3, and includes the following steps:
step S1: calibrating the camera 200, acquiring the coordinates of the central pixel of the image as a reference point, respectively shooting images at 0 scale and the current scale, and correcting the images;
step S2: extracting edge pixels of the feature patterns in the image, making a vertical line by using the calibrated reference point, and calculating to obtain a line segment pixel value between the intersection point of the edge of the feature pattern corresponding to the scale 0 and the current scale and the vertical line;
and step S3: calculating the rotation angle of the cylinder 300 according to the 0 scale and the pixel value of the edge line segment of the corresponding characteristic pattern when the scale is currently scaled;
and step S4: since the rotation angle of the cylinder 300 is equal to the rotation angle of the pointer, the current scale value can be obtained by performing conversion according to the rotation angle of the cylinder 300.
The technical solution of the present invention will be described in further detail with reference to specific examples.
Example 1
The embodiment provides a robust pointer instrument reading automatic identification device and an identification method thereof, wherein the diameter of a cylinder 300 of the identification device is D, an optical axis of a camera 200 is perpendicular to a rotating shaft of the cylinder 300 and passes through the center of the cylinder 300.
By means of laser lithography or label printing or film printing, a feature pattern is disposed on the periphery of the cylinder 300, and after the feature pattern of this embodiment is expanded, as shown in fig. 4, the feature pattern is a combination of a right triangle and a group of parallel lines, wherein one side of the right triangle is parallel to the height of the cylinder 300, the other side of the right triangle is parallel to the bottom circumference of the cylinder 300, the slope of the right triangle is K, the parallel lines are disposed below the right triangle and are two parallel lines parallel to the bottom circumference of the cylinder 300, and the distance between the two parallel lines is G.
Based on the characteristic pattern, the identification method of the embodiment comprises the following steps:
step S1: preprocessing of the image:
calibrating the camera 200 to obtain the pixel coordinate of the central point of the image, wherein one end of an angle formed by a right-angle side and a bevel edge of the right-angle triangle, which are parallel to the circumference of the bottom surface of the cylinder 300, faces the lens of the camera 200, the center of the image is aligned with the center of the side surface of the cylinder 300, and the upper bottom surface and the lower bottom surface of the cylinder 300 are parallel to the horizontal direction of the image; when the pointer rotates, the cylinder 300 rotates along with the pointer, and the right triangle on the cylinder also rotates along the direction highly parallel to the cylinder 300; shooting images when the pointer points to the 0 scale and the current scale;
the image is corrected such that the parallel lines in the image are parallel to the horizontal direction of the image to avoid the parallel lines on the cylinder 300 from being non-parallel to the horizontal direction of the image due to machining accuracy or assembly error.
Step S2: extracting image edge features:
a vertical line passing through the reference point is generated by taking the central point of the calibrated image as the reference point, the vertical line is intersected with the right triangle at two intersection points a and b and is intersected with the parallel line at two intersection points c and d, the line segment pixel value between the two intersection points ab and the line segment pixel value between the two intersection points cd are calculated,
ab. The method for calculating the pixel value between two line segments in the cd specifically comprises the following steps:
(1) knowing that the intersection point a is positioned on the hypotenuse of the triangle, the intersection points b, c and d are positioned on three parallel lines, a rectangle which is perpendicular to the hypotenuse is made by taking the intersection point a as the center, the direction which is perpendicular to the hypotenuse is the long axis of the rectangle, the intersection point c is taken as the center, the rectangle is made to be perpendicular to the parallel lines and comprises the three intersection points b, c and d, and the direction which is perpendicular to the parallel lines is the long axis of the rectangle, as shown in fig. 5;
(2) and (3) rectangle correction: when plotting, the rectangle may not be perpendicular to the edges and correction is required. In the rectangle, firstly carrying out edge detection to obtain an edge outline, then calculating the direction angle of each pixel point on the outline tangent to the outline, finally averaging all the angles to obtain the direction angle of the edge, and correcting the square of the rectangle by utilizing the direction angle to obtain the rectangle truly perpendicular to the edge;
(3) after the rectangle correction is finished, in the direction perpendicular to the edge along the center line of the rectangle in the rectangle, for each pixel point position, summing and averaging all image gray values in the width of the rectangle perpendicular to the long axis to obtain a graph similar to a square wave. The horizontal axis of the graph is the pixel coordinates along the central major axis of the rectangle, and the vertical axis is the mean of the gray values within the width of the rectangle perpendicular to the major axis of the rectangle. The method comprises the following steps that a, a valley corresponds to a low gray value in an image, a peak corresponds to a high gray value in the image, the position from the valley to the peak or from the peak to the valley is the edge position, a line has a certain width, so that two edge positions exist, coordinates of two edge points are averaged to obtain an accurate position of the center of the line, and accurate pixel coordinate values of four intersection points a, b, c and d are obtained according to the method;
(4) and calculating the line segment pixel values of the two points ab and the line segment pixel values of the two points cd according to the accurate pixel coordinate values of the four intersection points a, b, c and d.
And step S3: calculating the rotation angle of the cylinder 300:
when the scale of 0 is assumed, the pixel value between two intersection points ab in the image is Ia, and the pixel value between two intersection points cd in the image is Ib; when the scale is calibrated currently, the pixel value between two intersection points ab in the image is Ic, and the pixel value between two intersection points cd in the image is Ib'; calculating the mean value of the pixel values between two intersection points of cd
Figure BDA0001551125070000081
Knowing the slope K of the triangle and the distance G between two parallel lines, the size of each pixel is
Figure BDA0001551125070000082
Then the distance between the two intersection points of ab is P Ia on scale 0, and the distance between the two intersection points of ab after rotation is P Ic, and the arc length L of the rotation of the cylinder 300 is:
L=(P*I c -P*I a )/K (9)
the angle F of rotation of the cylinder 300 is:
Figure BDA0001551125070000091
and step S4: calculating dial scales:
because the relationship between the dial scale and the angle is known, the dial scale corresponding to each angle of rotation of the cylinder 300 is B/C, and the relationship between the cylinder 300 and the dial scale Z is:
Z=F*B/C (11)
similarly, when designing a feature pattern, two parallel lines may pass through the interior of the triangle, the distance between the two parallel lines being known; a line parallel to the base of the triangle may also be designed directly on the periphery of the cylinder 300, and the distance between the base of the triangle and the line is known (i.e. one of the parallel lines coincides with the bottom of the triangle).
Example 2
In the robust pointer instrument reading automatic identification device and the identification method thereof of the present embodiment, the diameter of the cylinder 300 of the identification device is D, the feature pattern is expanded and then is formed by a right triangle and two parallel line segments perpendicular to the base of the right triangle as shown in fig. 6, wherein the slope of the right triangle is K, one right side of the right triangle is parallel to the height of the cylinder 300, the other side (base) of the right triangle is parallel to the circumference of the bottom surface of the cylinder 300, the two parallel line segments are located in the right triangle, and the end points of the two parallel line segments are located on the edge of the right triangle.
The optical axis of the camera 200 is perpendicular to the rotation axis of the cylinder 300 and passes through the center of the cylinder 300. When the pointer is on the scale of 0, the center of the image corresponds to a short line segment, the pointer is rotated to enable the center of the image to correspond to a long line segment when the pointer is at a certain position, and the rotated angle T between the two line segments is obtained. Then, by using the method for calculating the pixel values between the line segments provided in step S2 of embodiment 1, the number of pixels of two parallel line segments obtained is Na, nb, respectively, and then the angle Q rotated by each pixel satisfies:
Figure BDA0001551125070000092
in the same embodiment 1, when the pointer is rotated to the current position, after the image preprocessing of step S1 and the image edge feature extraction of step S2 in embodiment 1 are utilized, the pixel number of the line segment located in the triangle of the reference point is counted by taking the calibrated image center as the reference point, and it is assumed that the pixel number of the line segment obtained at the current time is N' b Then, the rotated angle F is:
Figure BDA0001551125070000093
and finally, converting the F into dial scales Z according to the formula (11), and obtaining the reading of the instrument.
Example 3
The robust pointer instrument reading automatic identification device and the identification method thereof provided by the embodiment have the advantages that the diameter of the cylinder 300 of the identification device is D, the optical axis of the camera 200 is perpendicular to the rotating shaft of the cylinder 300 and passes through the center of the cylinder 300. After being unfolded, the characteristic patterns are zigzag patterns surrounding the periphery of the cylinder 300 and parallel lines parallel to the straight line of the bottom surface of the zigzag patterns, wherein the straight line of the bottom surface of each zigzag is parallel to the circumference of the bottom surface of the cylinder 300, the width of each zigzag corresponds to a large scale of the instrument, the bottom surface of each zigzag is provided with characters for distinguishing other zigzag, such as letters or numbers, and the like, and the characters are used for distinguishing in the embodiment.
During identification, the corresponding relation between the lower letter of each sawtooth and the large scale of the instrument is known, the slope K and the width W of each sawtooth, the corresponding scale size Y and the distance G between parallel lines are known, and the center of an image aligns to the scale of the sawtooth 0 when the pointer is at the scale of 0. In the measurement, the center of the image is still used as the reference point, wherein the size P of each pixel is as described in embodiment 1, and satisfies the following conditions:
Figure BDA0001551125070000101
after an image is shot, the characters under the sawtooth corresponding to the center of the image are firstly identified, and the large range (Zl, zr) pointed by the pointer can be known. Then calculating the accuracy of the pointerAnd pointing, acquiring a pixel value Ic between line segments intersected with the sawtooth, wherein the actual length of the line segments is P & ltic & gt, and a scale Z calculation formula corresponding to the pointer is as shown in a formula (14):
Figure BDA0001551125070000102
example 4
The embodiment provides a robust pointer instrument reading automatic identification device and an identification method thereof, wherein an optical axis of a camera 200 of the identification device is not vertically arranged with a rotating shaft of a cylinder 300 (300), or does not pass through the center of the cylinder 300. At this time, the perspective distortion in the shot image is serious, and the distance of a certain section in the triangle cannot be directly acquired.
The present embodiment corrects the image of the cylinder 300 using a grid image (gridding) to remove perspective distortion, and then performs measurement.
The grid is as shown in fig. 8, a projective map generated by a known grid image is used to correct images of the cylinder 300 shot by all subsequent cameras, the corrected images are equivalent to a planar image developed by the cylinder 300, the planar image has four line segments, two intersecting lines, two parallel lines, and angles corresponding to the two intersecting lines are arctangent values of slopes of the triangle, then the planar image is rotated according to the angles, so that the planar image looks the same as the plane shot by directly facing the cylinder 300, and finally, a certain point inside the triangle is selected as a reference point, and a perpendicular line passing through the reference point is generated. After the cylinder 300 rotates before and after the rotation, the pixel coordinates of the reference point are kept consistent, and the line segment distance of the reference point is calculated every time the image processing is performed. The corrected pattern eliminates perspective distortion, which is equivalent to an image photographed when the optical axis of the camera 200 is perpendicular to the rotation axis of the cylinder 300 and passes through the center of the cylinder 300, and the latter calculation is performed in the same manner as the correspondence between the triangle of the cylinder 300 and the instrument pointer-pointing scale of the foregoing embodiments 1 to 3.
Two sets of experiments were performed to verify the identification accuracy using the protocol of example 1, and the specific operating steps were as follows:
known experimental materials: a manual precision rotation stage, a camera 200OV5640 with resolution 2592 x 1944, a meter pointer, a cylinder 300 feature pattern. The range 210 and the range angle 270 of the instrument are known, and the accuracy of the instrument is 1.5%. According to the accuracy of the instrument, the identification accuracy is 3 times of the accuracy of the instrument, and the allowable maximum error range is 1.05.
The characteristic pattern of the cylinder 300 is printed in a printing mode and is pasted on the pointer of the cylinder 300, wherein parallel lines are positioned above the right triangle and are a group of thick solid lines, the upper edge and the lower edge of each thick solid line form a group of parallel lines, and the width of each thick solid line is 1mm, namely the distance between the parallel lines, and the thick solid lines are used for calibrating the pixel size. And fixing the pointer on a manual precision rotating platform, manually rotating the precision rotating platform during testing, shooting the 0-scale image and the image after the rotation angle, and comparing the image with the angle measured by using the image.
Experiment 1: as shown in fig. 9: in the figure, the red number of the first row represents the rotation angle of the measured current image and the 0-scale image, the second row represents the measured current scale value, the third row represents the measured absolute error, the absolute error is positive number and larger than the actual range, the absolute error is negative number and smaller than the actual range, and the fourth row represents the measured relative error. In the figure, compared with the scale of 0, the actual rotation angles are respectively 2 degrees, 4 degrees, 10 degrees, 15 degrees, 20 degrees and 60 degrees, and the absolute values of absolute errors are all less than 1.05 from the measured values in the figure, so that the requirement that the identification precision is 3 times of the instrument precision is met.
Experiment 2: in the same manner as experiment 1, the actual rotation angles are respectively 10 °,30 °,50 °,70 °,90 °,110 °,130 °,150 °, and 170 °, and the results are shown in fig. 10, and the absolute values of the absolute errors are all less than 1.05 in view of the measurement values in the graph, which meets the requirement that the identification precision is 3 times of the instrument precision.
The above is a detailed embodiment and a specific operation process of the present invention, which are implemented on the premise of the technical solution of the present invention, but the protection scope of the present invention is not limited to the above-mentioned examples.

Claims (9)

1. A robust identification method for an automatic identification device of pointer instrument readings is characterized in that the robust automatic identification device of pointer instrument readings comprises the following steps: the pointer instrument comprises a cylinder (300), a camera (200) and a circuit board (210) for controlling the camera (200), wherein the cylinder (300) and a connecting rotating shaft at the center of an instrument panel (100) of the pointer instrument are integrated, the tail part of a pointer of the pointer instrument is arranged on the cylinder (300), the camera (200) is arranged at the edge of the instrument panel (100) of the pointer instrument, the outer surface of the cylinder (300) surrounds a circle of characteristic patterns, and a lens of the camera (200) faces the characteristic patterns of the cylinder (300);
the method steps of identifying include:
step S1: calibrating a camera (200), taking a certain fixed point in an image as a reference point, obtaining pixel coordinates of the reference point, respectively shooting images with 0 scale and the current scale, and correcting the images;
step S2: extracting edge pixels of the characteristic pattern in the image, making a vertical line by using the calibrated reference point, and calculating to obtain a line segment pixel value between the intersection point of the vertical line and the corresponding characteristic pattern edge when the scale is 0 and the current scale;
and step S3: calculating the rotation angle of the cylinder (300) according to the 0 scale and the edge line segment pixel value of the corresponding characteristic pattern when the scale is currently scaled;
and step S4: and converting the rotating angle of the cylinder (300) into a current scale value.
2. A robust pointer instrument reading automatic identification device identification method as claimed in claim 1, characterized in that the diameter D of the cylinder (300) satisfies:
Figure FDA0003927780760000011
wherein A is the instrument accuracy, C is the range angle corresponding to the range, FOV is the camera (200) field of view, and M is the horizontal pixel of the camera (200).
3. A robust pointer instrument reading automatic identification device identification method as claimed in claim 1, characterized in that the diameter D of the cylinder (300) satisfies:
Figure FDA0003927780760000012
wherein H is the step angle of the stepping motor, S is the subdivision number of the stepping motor, FOV is the visual field of the camera (200), and M is the horizontal pixel of the camera (200).
4. A robust pointer instrument reading automatic identification device identification method as claimed in claim 1, characterized in that the diameter of the cylinder (300) is 14-20mm.
5. A robust pointer instrument reading automatic identification device identification method as claimed in claim 1, characterized in that the characteristic pattern is a right triangle surrounding the cylinder (300) periphery and a set of parallel lines, one right side of the right triangle is parallel to the cylinder (300) height, the parallel lines are parallel or perpendicular to the cylinder (300) bottom/top circumference.
6. A robust identification method of pointer instrument reading automatic identification device, as claimed in claim 1, characterized in that the characteristic pattern is a saw tooth pattern surrounding the periphery of the cylinder (300) and parallel lines parallel to the bottom surface of the saw tooth pattern, the width of the saw tooth corresponds to the large scale of the instrument, each saw tooth contains characters distinguishing other saw teeth.
7. A robust pointer reading automatic identification device identification method as claimed in any of claims 5-6 characterized in that one of the parallel lines coincides with the right-angled side of the right triangle parallel to the bottom/top circumference of the cylinder (300) or one of the parallel lines coincides with the straight line where the bottom of the sawtooth pattern is located.
8. A robust pointer instrument reading automatic identification device identification method as claimed in claim 1, characterized in that in said step S1, the correction includes horizontal correction and perspective distortion correction of the image.
9. The method for identifying a robust pointer instrument reading automatic identification device as claimed in claim 1, wherein in the step S1, the center point of the image is selected as the reference point.
CN201810046784.XA 2018-01-18 2018-01-18 Robust pointer instrument reading automatic identification device and identification method thereof Active CN108460331B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810046784.XA CN108460331B (en) 2018-01-18 2018-01-18 Robust pointer instrument reading automatic identification device and identification method thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810046784.XA CN108460331B (en) 2018-01-18 2018-01-18 Robust pointer instrument reading automatic identification device and identification method thereof

Publications (2)

Publication Number Publication Date
CN108460331A CN108460331A (en) 2018-08-28
CN108460331B true CN108460331B (en) 2022-12-23

Family

ID=63220634

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810046784.XA Active CN108460331B (en) 2018-01-18 2018-01-18 Robust pointer instrument reading automatic identification device and identification method thereof

Country Status (1)

Country Link
CN (1) CN108460331B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109543682A (en) * 2018-11-23 2019-03-29 电子科技大学 A kind of readings of pointer type meters method based on deep learning

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN2064926U (en) * 1989-12-09 1990-10-31 薛宏斌 Automatic range selector
CN104657711A (en) * 2015-02-09 2015-05-27 中国石油大学(华东) Robust pointer instrument reading automatic identification method
CN205090948U (en) * 2015-11-02 2016-03-16 长春师范大学 High accuracy corner locating support of straight line laser instrument
JP2017129531A (en) * 2016-01-22 2017-07-27 ファナック株式会社 Automatic reading device for micrometers

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN2064926U (en) * 1989-12-09 1990-10-31 薛宏斌 Automatic range selector
CN104657711A (en) * 2015-02-09 2015-05-27 中国石油大学(华东) Robust pointer instrument reading automatic identification method
CN205090948U (en) * 2015-11-02 2016-03-16 长春师范大学 High accuracy corner locating support of straight line laser instrument
JP2017129531A (en) * 2016-01-22 2017-07-27 ファナック株式会社 Automatic reading device for micrometers

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
"Detection system of meter pointer based on computer vision";Li Yanwen 等;《IEEE》;20110919;全文 *
"基于ADSP-2185m的嵌入式汉语语音合成系统";罗鑫 等;《信号处理》;20020630;第18卷(第3期);全文 *
"基于机器视觉的双排刻线器具自动读数研究";刘丽君;《中国优秀硕士学位论文全文数据库 信息科技辑》;20130315;全文 *

Also Published As

Publication number Publication date
CN108460331A (en) 2018-08-28

Similar Documents

Publication Publication Date Title
CN107590498B (en) Self-adaptive automobile instrument detection method based on character segmentation cascade two classifiers
CN110672040B (en) High-precision rotation angle measuring method based on vision
CN104657711B (en) A kind of readings of pointer type meters automatic identifying method of robust
CN107167169B (en) Readings of pointer type meters based on NI Vision Builder for Automated Inspection identifies measurement method
CN110189314B (en) Automobile instrument panel image positioning method based on machine vision
CN114549835B (en) Pointer instrument correction identification method and device based on deep learning
CN103759758A (en) Method for detecting position of automobile meter needle based on mechanical angle and scale identification
KR102089498B1 (en) Measuring apparatus for analogue gauge and method thereof
CN111368906B (en) Pointer type oil level meter reading identification method based on deep learning
CN110455222B (en) High-precision rotation angle measuring method, device and equipment
CN109558871B (en) Pointer instrument reading identification method and device
CN109712157B (en) Gravity field method accelerometer calibration method based on monocular vision
CN111637851B (en) Aruco code-based visual measurement method and device for plane rotation angle
CN106500619A (en) The camera internal imageing sensor alignment error separation method of view-based access control model measurement
JPH11248489A (en) Two-dimensional abolute encoder and device and method for measuring two-dimensional position
CN108460331B (en) Robust pointer instrument reading automatic identification device and identification method thereof
CN114047358A (en) Monocular vision-based line angle vibration calibration method
CN111914623B (en) Method for identifying scale marks of circular-arc scale dial image
CN112767494A (en) Precise measurement positioning method based on calibration algorithm
CN112488030A (en) Pointer instrument meter reading method based on machine vision
CN112464986B (en) Reading method and device for pointer type disc instrument
CN116880353A (en) Machine tool setting method based on two-point gap
CN114882487A (en) Pointer instrument reading method and system
CN114581915A (en) Noise robust multi-class dial plate pointer reading identification method and device
CN109740616B (en) Method for realizing automatic reading of double-pointer instrument by using computer vision

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