CN108898632B - Method and device for determining rotation angle of instrument pointer - Google Patents

Method and device for determining rotation angle of instrument pointer Download PDF

Info

Publication number
CN108898632B
CN108898632B CN201810608134.XA CN201810608134A CN108898632B CN 108898632 B CN108898632 B CN 108898632B CN 201810608134 A CN201810608134 A CN 201810608134A CN 108898632 B CN108898632 B CN 108898632B
Authority
CN
China
Prior art keywords
straight line
slope
target
reference coordinate
determining
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
CN201810608134.XA
Other languages
Chinese (zh)
Other versions
CN108898632A (en
Inventor
李宁钏
熊剑平
孙海涛
王枫
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhejiang Dahua Technology Co Ltd
Original Assignee
Zhejiang Dahua Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhejiang Dahua Technology Co Ltd filed Critical Zhejiang Dahua Technology Co Ltd
Priority to CN201810608134.XA priority Critical patent/CN108898632B/en
Publication of CN108898632A publication Critical patent/CN108898632A/en
Application granted granted Critical
Publication of CN108898632B publication Critical patent/CN108898632B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/70Determining position or orientation of objects or cameras
    • G06T7/73Determining position or orientation of objects or cameras using feature-based methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/13Edge detection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/168Segmentation; Edge detection involving transform domain methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20048Transform domain processing
    • G06T2207/20061Hough transform

Landscapes

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

Abstract

The invention discloses a method and a device for determining a rotation angle of an instrument pointer, wherein the method comprises the following steps: extracting each edge point in the acquired instrument image, and determining each straight line formed by the edge points through Hough transformation; determining a straight line with the minimum distance to each reference coordinate point as a target straight line according to at least three preset reference coordinate points; determining the corresponding relation between the slope of the straight line in the instrument image and the standard slope according to the slope of the target straight line corresponding to each reference coordinate point and the predetermined standard slope corresponding to each reference coordinate point; determining a straight line with the minimum distance from a preset pointer straight line reference coordinate point as a target pointer straight line; determining the standard slope of the target pointer straight line according to the slope of the target pointer straight line and the corresponding relation between the slope of the straight line in the instrument image and the standard slope; thereby determining the rotation angle of the pointer. A solution is provided for accurately determining the angle of rotation of a meter pointer.

Description

Method and device for determining rotation angle of instrument pointer
Technical Field
The invention relates to the technical field of image processing, in particular to a method and a device for determining a rotation angle of an instrument pointer.
Background
The pointer type instrument serving as a traditional metering instrument has the advantages of being simple in structure, low in price, convenient to maintain, corrosion-resistant, free of electromagnetic field interference, low-temperature resistant, high in reliability and the like, and is widely applied to the fields of electric power, transportation, petrochemical industry, scientific experiments, resident life and the like. In the use process of the instrument, the instrument needs to be artificially monitored in real time or regularly patrolled so as to obtain the reading of the instrument and ensure the normal and stable operation of a device or a system applying the instrument. However, real-time monitoring or regular inspection of the instrument by manpower is tedious and tedious work, a large amount of manpower is consumed, a monitoring result is easily affected subjectively, and a plurality of hidden dangers and inconvenience exist.
With the development of image processing technology, it becomes possible to monitor the instrument in real time or to periodically inspect the instrument by a computer instead of a human, for example, obtaining an image of the instrument, recognizing the slope of the pointer, calculating the rotation angle of the pointer, and further determining the reading of the instrument. However, the imaging process is essentially a transformation of several coordinate systems. Firstly, a point in the space is converted into a camera coordinate system from a world coordinate system, then the point is projected to an image physical coordinate system of an imaging plane, and finally the point is converted into an image pixel coordinate system of the image plane. Due to the influence of factors such as a shooting angle and a camera lens, a certain deformation exists between the finally obtained instrument image and a real instrument, namely the obtained instrument image has distortion, so that an error exists in the slope of the determined pointer, and an error exists in the rotation angle of the determined pointer, so that the reading precision of the instrument is influenced.
Disclosure of Invention
The invention provides a method and a device for determining a rotation angle of an instrument pointer, which are used for solving the problems that the rotation angle of the instrument pointer is inaccurate and the reading precision of an instrument is influenced due to the fact that an instrument image acquired in the prior art is distorted.
The embodiment of the invention discloses a method for determining a rotation angle of an instrument pointer, which comprises the following steps:
extracting each edge point in the acquired instrument image, and determining each straight line formed by the edge points through Hough transformation;
determining a straight line with the minimum distance to each reference coordinate point as a target straight line corresponding to the reference coordinate point according to at least three preset reference coordinate points; determining the corresponding relation between the slope of the straight line in the instrument image and the standard slope according to the slope of the target straight line corresponding to each reference coordinate point and the predetermined standard slope corresponding to each reference coordinate point;
determining a straight line with the minimum distance from a pointer straight line reference coordinate point as a target pointer straight line according to a preset pointer straight line reference coordinate point; determining the standard slope of the target pointer straight line according to the slope of the target pointer straight line and the corresponding relation between the slope of the straight line in the instrument image and the standard slope;
and determining the rotation angle of the pointer according to the standard slope of the target pointer straight line.
Further, if the target straight line corresponding to the reference coordinate point is a target vertical straight line, a target horizontal straight line and a target non-vertical non-horizontal straight line; the determining the corresponding relationship between the slope of the line in the instrument image and the standard slope according to the slope of the target line corresponding to each reference coordinate point and the predetermined standard slope corresponding to each reference coordinate point comprises:
according to
Figure BDA0001694858140000021
Determining the standard slope of the straight line in the instrument image, wherein k is the standard slope of the straight line in the instrument image, k' is the slope of the straight line in the instrument image, k1Is the slope, k, of the target vertical line2Is the slope, k, of the target horizontal line3Is the slope, k, of the target non-vertical non-horizontal linerIs the standard slope corresponding to the reference coordinate point corresponding to the target non-vertical non-horizontal straight line.
Further, before extracting each edge point in the acquired instrument image, the method further includes:
and carrying out binarization processing on the instrument image.
Further, the method further comprises:
and carrying out corrosion and expansion treatment on the instrument image after the binarization treatment.
Further, after each straight line formed by the edge points is determined through Hough transform, according to at least three preset reference coordinate points, before a straight line having a minimum distance from each reference coordinate point is determined as a target straight line corresponding to the reference coordinate point, the method further includes:
and filtering the straight line formed by the edge points according to a preset length threshold value.
Further, the method further comprises:
and determining the reading of the meter according to the rotation angle of the pointer.
The invention discloses a device for determining the rotation angle of an instrument pointer, which comprises:
the extraction module is used for extracting each edge point in the acquired instrument image and determining each straight line formed by the edge points through Hough transformation;
the first determining module is used for determining a straight line with the minimum distance with each reference coordinate point as a target straight line corresponding to the reference coordinate point according to at least three preset reference coordinate points; determining the corresponding relation between the slope of the straight line in the instrument image and the standard slope according to the slope of the target straight line corresponding to each reference coordinate point and the predetermined standard slope corresponding to each reference coordinate point;
the second determination module is used for determining a straight line with the minimum distance from the pointer straight line reference coordinate point as a target pointer straight line according to the preset pointer straight line reference coordinate point; determining the standard slope of the target pointer straight line according to the slope of the target pointer straight line and the corresponding relation between the slope of the straight line in the instrument image and the standard slope;
and the third determining module is used for determining the rotation angle of the pointer according to the standard slope of the target pointer straight line.
Further, the first determining module is specifically configured to determine, if the target straight line corresponding to the reference coordinate point is a target vertical straight line, a target horizontal straight line, or a target non-vertical non-horizontal straight line; according to
Figure BDA0001694858140000031
Determining the standard slope of the straight line in the instrument image, wherein k is the standard slope of the straight line in the instrument image, k' is the slope of the straight line in the instrument image, k1Is the slope, k, of the target vertical line2Is the slope, k, of the target horizontal line3Is the slope, k, of the target non-vertical non-horizontal linerIs the standard slope corresponding to the reference coordinate point corresponding to the target non-vertical non-horizontal straight line.
Further, the apparatus further comprises:
and the processing module is used for carrying out binarization processing on the instrument image.
Further, the processing module is further configured to perform erosion and expansion processing on the instrument image after the binarization processing.
Further, the apparatus further comprises:
and the filtering module is used for filtering the straight line formed by the edge points according to a preset length threshold value.
Further, the apparatus further comprises:
and the reading module is used for determining the reading of the instrument according to the rotation angle of the pointer.
The invention discloses a method and a device for determining a rotation angle of an instrument pointer, wherein the method comprises the following steps: the electronic equipment extracts each edge point in the acquired instrument image, and determines each straight line formed by the edge points through Hough transformation; determining a straight line with the minimum distance to each reference coordinate point as a target straight line corresponding to the reference coordinate point according to at least three preset reference coordinate points; determining the corresponding relation between the slope of the straight line in the instrument image and the standard slope according to the slope of the target straight line corresponding to each reference coordinate point and the predetermined standard slope corresponding to each reference coordinate point; determining a straight line with the minimum distance from a pointer straight line reference coordinate point as a target pointer straight line according to a preset pointer straight line reference coordinate point; determining the standard slope of the target pointer straight line according to the slope of the target pointer straight line and the corresponding relation between the slope of the straight line in the instrument image and the standard slope; and determining the rotation angle of the pointer according to the standard slope of the target pointer straight line. In the embodiment of the invention, according to at least three preset reference coordinate points, a straight line with the minimum distance from each reference coordinate point is determined as a target straight line corresponding to the reference coordinate point; and determining the corresponding relation between the slope of the straight line in the instrument image and the standard slope according to the slope of the target straight line corresponding to each reference coordinate point and the predetermined standard slope corresponding to each reference coordinate point, and determining the standard slope of the target pointer straight line according to the slope of the target pointer straight line and the corresponding relation between the slope of the straight line in the instrument image and the standard slope, thereby avoiding the error of the determined slope of the target pointer straight line caused by the distortion of the instrument image, further ensuring the accuracy of the determined rotation angle of the pointer and improving the reading precision of the instrument.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
FIG. 1 is a schematic diagram illustrating a process for determining a rotation angle of a pointer of a meter according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of a reference coordinate point set in an image of a meter according to an embodiment of the present invention;
FIG. 3 is a schematic view of a binarized instrument image after erosion and dilation processing according to the present invention;
FIG. 4 is a schematic diagram of the contour of a dial formed by edge points according to the present invention;
FIG. 5 is a schematic view of a straight line determined from edge points of an outline of a formed dial according to the present invention;
fig. 6 is a schematic structural diagram of a device for determining a rotation angle of a meter pointer according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention clearer, the present invention will be described in further detail with reference to the accompanying drawings, and it is apparent that the described embodiments are only a part of the embodiments of the present invention, 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.
Example 1:
fig. 1 is a schematic diagram of a process for determining a rotation angle of a meter pointer, which includes:
s101: extracting each edge point in the acquired instrument image, and determining each straight line formed by the edge points through Hough (Hough) transformation.
The method for determining the rotation angle of the instrument pointer provided by the embodiment of the invention is applied to electronic equipment, and the electronic equipment can be image acquisition equipment such as a video camera, a camera and the like, and can also be equipment such as a mobile phone, a Personal Computer (PC), a tablet personal computer and the like.
The meters used in daily production and life generally comprise a shell, a dial, a pointer and the like, and the gray values of the shell and the dial, the dial and the pointer, the hollow white area of the dial and the scale marks of the scales and the like in the meter image are different due to the fact that the colors and the brightness of the shell and the dial, the dial and the pointer, the hollow white area of the dial and the scale marks of the scales and the like are different. In the embodiment of the invention, the edge points of the shell and the dial plate, the edge points of the dial plate and the pointer, the edge points of the hollow white area of the dial plate and the scale marks of the marked scales and the like in the instrument image can be extracted according to the gray values of the pixel points in the instrument image.
Specifically, the electronic device acquires an instrument image of the instrument, identifies a gray value of each pixel point in the instrument image, identifies whether a pixel point which is adjacent to the pixel point and has a gray value difference value with the pixel point larger than a preset gray threshold exists for each pixel point, and if yes, determines that the pixel point is an edge point in the instrument image. For example: the gray value of the pixel point C is 50, the preset gray threshold value is 70, the pixel points adjacent to the pixel point C are a pixel point A, a pixel point B, a pixel point D and a pixel point E, wherein the gray value of the pixel point A is 48, the gray value of the pixel point B is 51, the gray value of the pixel point D is 227, the gray value of the pixel point E is 50, the difference value between the gray value of the pixel point D and the gray value of the pixel point C is larger than the preset gray threshold value, and the pixel point C is determined to be an edge point in the instrument image.
In addition, whether a pixel point which is adjacent to the pixel point and has a gray value difference value smaller than a preset gray threshold exists or not can be identified for each pixel point, and if yes, the pixel point is determined to be an edge point in the instrument image. Of course, each edge point in the meter image may also be extracted using an edge detector (Canny) transform.
After each edge point in the acquired instrument image is extracted, each straight line formed by the edge points is determined through Hough transformation. The Hough transformation is a parameter estimation technology using a voting principle, and the principle is that the detection problem in an image space is converted into the Hough parameter space by utilizing the point-line pair duality of the image space and the Hough parameter space, and a straight line is detected by a method of simply accumulating statistics in the Hough parameter space and then searching an accumulator peak value in the Hough parameter space. In the embodiment of the present invention, determining each straight line formed by edge points through Hough transformation is prior art and will not be described again.
Preferably, in order to improve efficiency and accuracy of the determined target straight line, after each straight line formed by the edge points is determined through Hough transformation, according to at least three preset reference coordinate points, the straight line with the minimum distance from each reference coordinate point is determined to be before the target straight line corresponding to the reference coordinate point, and the method further includes:
and filtering the straight line formed by the edge points according to a preset length threshold value, and filtering out the straight line smaller than the preset length threshold value.
S102: determining a straight line with the minimum distance to each reference coordinate point as a target straight line corresponding to the reference coordinate point according to at least three preset reference coordinate points; and determining the corresponding relation between the slope of the straight line in the instrument image and the standard slope according to the slope of the target straight line corresponding to each reference coordinate point and the predetermined standard slope corresponding to each reference coordinate point.
In the embodiment of the invention, corresponding reference coordinate points are respectively arranged in advance for at least three straight lines of straight lines formed by edge points of the casing and the dial plate, straight lines formed by edge points of the dial plate and the pointer, straight lines formed by a hollow white area of the dial plate and edge points of scale marks, and the like, and the reference coordinate points meet the condition that the distance between the straight lines corresponding to the reference coordinate points is minimum in all the straight lines formed by the edge points. In the embodiment of the invention, the reference coordinate point can be directly marked on the instrument. For example: the method comprises the steps that a reference coordinate point 1 corresponding to a straight line 1 and a straight line 2 corresponding to an edge point are marked on a meter by a red point aiming at the straight line 1 formed by the edge point, a reference coordinate point 2 corresponding to the straight line 2 is marked on the meter by a blue point, and after acquiring a meter image, an electronic device identifies the reference coordinate point 1 and the reference coordinate point 2 in the meter image through image recognition.
Of course, it is also possible to directly set the reference coordinate point in the meter image, as shown in fig. 2, wherein for convenience of explanation, a straight line in the meter image in which the reference coordinate point is set has been shown with an extended broken line, wherein the reference coordinate point a is set for the straight line 1, the reference coordinate point B is set for the straight line 2, the reference coordinate point C is set for the straight line 3, and the reference coordinate D is set for the straight line 4, the electronic device records coordinates of the reference coordinate point a, the reference coordinate point B, the reference coordinate point C, and the reference coordinate point D in the image coordinate system, and each set reference coordinate point is determined in each meter image to be subsequently acquired according to the set coordinates of each reference coordinate point in the image coordinate system.
In addition, in the embodiment of the present invention, a corresponding standard slope is preset for each reference coordinate point, where the standard slope corresponding to each reference coordinate point is a slope of a target straight line corresponding to the reference coordinate point in the meter image in the undistorted meter image. The method for determining the undistorted image corresponding to the image acquired by the image acquisition equipment according to the internal reference and the external reference of the image acquisition equipment is the prior art and is not repeated.
Specifically, for a target straight line corresponding to each reference coordinate point, the slope of the target straight line corresponding to the reference coordinate point is determined according to the coordinates of any two points on the target straight line corresponding to the reference coordinate point in the image coordinate system. And determining the corresponding relation between the slope of the straight line in the instrument image and the standard slope according to the slope of the target straight line corresponding to each reference coordinate point and the predetermined standard slope corresponding to each reference coordinate point. In an exemplary manner, the first and second electrodes are,the description will be given taking an example in which four reference coordinate points are set in advance. Wherein, the slope of the reference coordinate point 1 corresponding to the target straight line 1 is k1Corresponding to a standard slope of kw(ii) a The slope of the reference coordinate point 2 corresponding to the target straight line 2 is k2Corresponding to a standard slope of ke(ii) a The reference coordinate point 3 has a slope k corresponding to the target straight line 33Corresponding to a standard slope of kr(ii) a The reference coordinate point 4 has a slope k corresponding to the target straight line 44Corresponding to a standard slope of kt. . The corresponding relation determination process of the slope of the straight line in the instrument image and the standard slope is as follows:
the corresponding relation of the coordinates (x ', y') of the pixel points in the instrument image and the coordinates (x, y) of the pixel points in the undistorted instrument image is as follows:
Figure BDA0001694858140000081
where a is a first distortion coefficient, b is a second distortion coefficient, c is a third distortion coefficient, d is a fourth distortion coefficient, h1 is a first translation coefficient, and h2 is a second translation coefficient.
The calculation formula of the standard slope K of the straight line in the undistorted instrument image is as follows:
Figure BDA0001694858140000082
the calculation formula of the slope k' of the straight line in the meter image is:
Figure BDA0001694858140000083
according to the system of equations
Figure BDA0001694858140000084
Determining the values of a, b, c, d, substituting the values of a, b, c, d into a formula
Figure BDA0001694858140000091
And determining the corresponding relation between the slope k' of the straight line in the instrument image and the standard slope k.
S103: determining a straight line with the minimum distance from a pointer straight line reference coordinate point as a target pointer straight line according to a preset pointer straight line reference coordinate point; and determining the standard slope of the target pointer straight line according to the slope of the target pointer straight line and the corresponding relation between the slope of the straight line in the instrument image and the standard slope.
In the embodiment of the present invention, a pointer straight line reference coordinate point is also preset, for example: the method comprises the steps of setting the center point of an instrument image as a reference coordinate point of a pointer straight line, determining a straight line with the minimum distance from the pointer straight line as a target pointer straight line, determining the slope of the target pointer straight line according to the coordinates of any two points on the target pointer straight line in image coordinates, and determining the standard slope of the target pointer straight line according to the corresponding relation between the slope of the straight line in the instrument image and the standard slope.
S104: and determining the rotation angle of the pointer according to the standard slope of the target pointer straight line.
Specifically, the included angle between the target pointer straight line and the image coordinate system horizontal axis (x) is determined according to the standard slope of the target pointer straight line, and the rotation angle of the pointer is determined according to the difference value between the included angle between the target pointer straight line and the image coordinate system horizontal axis (x) and the included angle between the target pointer straight line and the image coordinate system horizontal axis (x) in the undistorted instrument image when the pointer is not rotated. In addition, after the rotation angle of the pointer is determined, the reading of the instrument can be determined according to the rotation angle information of the pointer corresponding to each scale in the dial and the rotation angle of the pointer.
In the embodiment of the invention, according to at least three preset reference coordinate points, a straight line with the minimum distance from each reference coordinate point is determined as a target straight line corresponding to the reference coordinate point; and determining the corresponding relation between the slope of the straight line in the instrument image and the standard slope according to the slope of the target straight line corresponding to each reference coordinate point and the predetermined standard slope corresponding to each reference coordinate point, and determining the standard slope of the target pointer straight line according to the slope of the target pointer straight line and the corresponding relation between the slope of the straight line in the instrument image and the standard slope, thereby avoiding the error of the determined slope of the target pointer straight line caused by the distortion of the instrument image, further ensuring the accuracy of the determined rotation angle of the pointer and improving the reading precision of the instrument.
Example 2:
in order to improve the rotation angle determination efficiency of the instrument pointer, on the basis of the above embodiment, in the embodiment of the present invention, if the target straight line corresponding to the reference coordinate point is a target vertical straight line, a target horizontal straight line, or a target non-vertical non-horizontal straight line; the determining the corresponding relationship between the slope of the line in the instrument image and the standard slope according to the slope of the target line corresponding to each reference coordinate point and the predetermined standard slope corresponding to each reference coordinate point comprises:
according to
Figure BDA0001694858140000101
Determining the standard slope of the straight line in the instrument image, wherein k is the standard slope of the straight line in the instrument image, k' is the slope of the straight line in the instrument image, k1Is the slope, k, of the target vertical line2Is the slope, k, of the target horizontal line3Is the slope, k, of the target non-vertical non-horizontal linerIs the standard slope corresponding to the reference coordinate point corresponding to the target non-vertical non-horizontal straight line.
In the embodiment of the invention, if three reference coordinate points are preset, wherein the target straight lines corresponding to the three reference coordinate points are respectively a target vertical straight line parallel to a longitudinal axis (y) of an image coordinate system in the undistorted instrument image, a target horizontal straight line parallel to a transverse axis of the image coordinate system in the undistorted instrument image, and a target non-vertical non-horizontal straight line which is not parallel to both the transverse axis and the longitudinal axis of the image coordinate system in the undistorted instrument image. Can be based on
Figure BDA0001694858140000102
Determining the standard slope of the straight line in the instrument image, wherein k is the standard slope of the straight line in the instrument image, k' is the slope of the straight line in the instrument image, k1Is the slope, k, of the target vertical line2Is a target horizontal straight lineSlope of (a), k3Is the slope, k, of the target non-vertical non-horizontal linerIs the standard slope corresponding to the reference coordinate point corresponding to the target non-vertical non-horizontal straight line.
Formula (II)
Figure BDA0001694858140000103
The determination process of (2) is as follows:
if the target straight line is the target vertical straight line, the standard slope k corresponding to the reference coordinate point corresponding to the target vertical straight linewInfinite, then this is obtained by the above equation (3): k is a radical of1=bd(4);
If the target straight line is the target horizontal straight line, the standard slope k corresponding to the reference coordinate point corresponding to the target horizontal straight lineeZero, then it can be obtained by the above equation (3):
Figure BDA0001694858140000111
if the target straight line is a target non-vertical non-horizontal straight line, the standard slope k corresponding to the reference coordinate point corresponding to the target non-vertical non-horizontal straight linerThen, the following formula (3) can be used:
Figure BDA0001694858140000112
from (4), (5), and (6):
Figure BDA0001694858140000113
transforming the above equation (3) to obtain the equation:
Figure BDA0001694858140000114
substituting a, b, c and d in (7) into formula (8) to obtain
Figure BDA0001694858140000115
Example 3:
in order to improve the accuracy of determining the rotation angle of the meter pointer, on the basis of the foregoing embodiments, in an embodiment of the present invention, before extracting each edge point in the acquired meter image, the method further includes:
and carrying out binarization processing on the instrument image.
The method further comprises the following steps:
and carrying out corrosion and expansion treatment on the instrument image after the binarization treatment.
Specifically, the gray value of a pixel point with the gray value larger than a set gray threshold value in the instrument image is determined as 1, the gray value of a pixel point with the gray value smaller than or equal to the set gray threshold value in the instrument image is determined as 0, and the instrument image after the binarization processing is corroded and expanded, so that convex points and concave points in the instrument image after the binarization processing are eliminated. FIG. 3 is a schematic diagram of a binarized instrument image after erosion and expansion processing according to the present invention. When extracting edge points in the instrument image, determining pixel points adjacent to the pixel point with the gray value of 0 and the pixel point with the gray value of 1 as the edge points; of course, it may also be determined that the pixel point with the gray value of 0 adjacent to the pixel point with the gray value of 1 is the edge point.
In addition, referring to fig. 2, if the straight line 2 is parallel to the horizontal axis in the image coordinate system in the undistorted instrument image, the target vertical straight line, the target horizontal straight line, and the target non-vertical non-horizontal straight line corresponding to the reference coordinate point respectively correspond to the straight lines 1, 2, and 3 formed by the edge points of the dial and the case in fig. 2, in order to improve efficiency, after the edge points in the instrument image are obtained, the contour of the dial formed by the edge points can be extracted according to the contour of the dial in the instrument, wherein the contour of the dial formed by the edge points is as shown in fig. 4. After the contour of the dial formed by the edge points is obtained, each straight line formed by the edge is determined in the edge points forming the contour of the dial through Hough transformation, preferably, the straight lines formed by the edge points can be filtered according to a preset length threshold value, the straight lines smaller than the preset length threshold value are filtered, and the straight lines determined from the edge points forming the contour of the dial are shown in fig. 5. After straight lines are specified from edge points of the contour of the dial, straight lines 1, 2, and 3 corresponding to reference coordinate points are specified from preset reference coordinate points. In the embodiment of the invention, the extraction of the profile of the dial plate in the instrument image is performed according to the profile of the dial plate in the instrument, which is the prior art and is not described again.
Example 4:
fig. 6 is a schematic structural diagram of a device for determining a rotation angle of a meter pointer, provided in an embodiment of the present invention, where the device includes:
the extraction module 61 is configured to extract each edge point in the acquired instrument image, and determine each straight line formed by the edge points through Hough transformation;
the first determining module 62 is configured to determine, according to at least three preset reference coordinate points, a straight line with a minimum distance from each reference coordinate point as a target straight line corresponding to the reference coordinate point; determining the corresponding relation between the slope of the straight line in the instrument image and the standard slope according to the slope of the target straight line corresponding to each reference coordinate point and the predetermined standard slope corresponding to each reference coordinate point;
a second determining module 63, configured to determine, according to a preset pointer straight line reference coordinate point, a straight line having a minimum distance from the pointer straight line reference coordinate point as a target pointer straight line; determining the standard slope of the target pointer straight line according to the slope of the target pointer straight line and the corresponding relation between the slope of the straight line in the instrument image and the standard slope;
and a third determining module 64, configured to determine the rotation angle of the pointer according to the standard slope of the target pointer straight line.
The first determining module 62 is specifically configured to determine, if the target straight line corresponding to the reference coordinate point is a target vertical straight line, a target horizontal straight line, or a target non-vertical non-horizontal straight line; according to
Figure BDA0001694858140000131
Determining the standard slope of the straight line in the instrument image, wherein k is the standard slope of the straight line in the instrument image, k' is the slope of the straight line in the instrument image, k1Is the slope of the target vertical line、k2Is the slope, k, of the target horizontal line3Is the slope, k, of the target non-vertical non-horizontal linerIs the standard slope corresponding to the reference coordinate point corresponding to the target non-vertical non-horizontal straight line.
The device further comprises:
and the processing module 65 is configured to perform binarization processing on the instrument image.
The processing module 65 is further configured to perform erosion and expansion processing on the instrument image after the binarization processing.
The device further comprises:
and the filtering module 66 is configured to filter the straight line formed by the edge points according to a preset length threshold.
The device further comprises:
and the reading module 67 is used for determining the reading of the instrument according to the rotation angle of the pointer.
The invention discloses a method and a device for determining a rotation angle of an instrument pointer, wherein the method comprises the following steps: the electronic equipment extracts each edge point in the acquired instrument image, and determines each straight line formed by the edge points through Hough transformation; determining a straight line with the minimum distance to each reference coordinate point as a target straight line corresponding to the reference coordinate point according to at least three preset reference coordinate points; determining the corresponding relation between the slope of the straight line in the instrument image and the standard slope according to the slope of the target straight line corresponding to each reference coordinate point and the predetermined standard slope corresponding to each reference coordinate point; determining a straight line with the minimum distance from a pointer straight line reference coordinate point as a target pointer straight line according to a preset pointer straight line reference coordinate point; determining the standard slope of the target pointer straight line according to the slope of the target pointer straight line and the corresponding relation between the slope of the straight line in the instrument image and the standard slope; and determining the rotation angle of the pointer according to the standard slope of the target pointer straight line. In the embodiment of the invention, according to at least three preset reference coordinate points, a straight line with the minimum distance from each reference coordinate point is determined as a target straight line corresponding to the reference coordinate point; and determining the corresponding relation between the slope of the straight line in the instrument image and the standard slope according to the slope of the target straight line corresponding to each reference coordinate point and the predetermined standard slope corresponding to each reference coordinate point, and determining the standard slope of the target pointer straight line according to the slope of the target pointer straight line and the corresponding relation between the slope of the straight line in the instrument image and the standard slope, thereby avoiding the error of the determined slope of the target pointer straight line caused by the distortion of the instrument image, further ensuring the accuracy of the determined rotation angle of the pointer and improving the reading precision of the instrument.
For the system/apparatus embodiments, since they are substantially similar to the method embodiments, the description is relatively simple, and reference may be made to some descriptions of the method embodiments for relevant points.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While the preferred embodiments of the present application have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all alterations and modifications as fall within the scope of the application.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present invention without departing from the spirit and scope of the invention. Thus, if such modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include such modifications and variations.

Claims (12)

1. A method for determining a rotation angle of a meter pointer, the method comprising:
extracting each edge point in the acquired instrument image, and determining each straight line formed by the edge points through Hough transformation;
determining a straight line with the minimum distance to each reference coordinate point as a target straight line corresponding to the reference coordinate point according to at least three preset reference coordinate points; determining the corresponding relation between the slope of the straight line in the instrument image and the standard slope according to the slope of the target straight line corresponding to each reference coordinate point and the predetermined standard slope corresponding to each reference coordinate point;
determining a straight line with the minimum distance from a pointer straight line reference coordinate point as a target pointer straight line according to a preset pointer straight line reference coordinate point; determining the standard slope of the target pointer straight line according to the slope of the target pointer straight line and the corresponding relation between the slope of the straight line in the instrument image and the standard slope;
determining the rotation angle of the pointer according to the standard slope of the target pointer straight line;
wherein, the at least three reference points comprise points on a vertical straight line, a horizontal straight line and a non-vertical non-horizontal straight line which are formed by the edge points of the dial plate and the shell in the instrument.
2. The method of claim 1, wherein if the target straight line corresponding to the reference coordinate point is a target vertical straight line, a target horizontal straight line, a target non-vertical non-horizontal straight line; the determining the corresponding relationship between the slope of the line in the instrument image and the standard slope according to the slope of the target line corresponding to each reference coordinate point and the predetermined standard slope corresponding to each reference coordinate point comprises:
according to
Figure FDA0002554318890000011
Determining the standard slope of the straight line in the instrument image, wherein k is the standard slope of the straight line in the instrument image, k' is the slope of the straight line in the instrument image, k1Is the slope, k, of the target vertical line2Is the slope, k, of the target horizontal line3Is the slope, k, of the target non-vertical non-horizontal linerIs the standard slope corresponding to the reference coordinate point corresponding to the target non-vertical non-horizontal straight line.
3. The method of claim 1, wherein prior to said extracting each edge point in the acquired meter image, the method further comprises:
and carrying out binarization processing on the instrument image.
4. The method of claim 3, wherein the method further comprises:
and carrying out corrosion and expansion treatment on the instrument image after the binarization treatment.
5. The method of claim 1, wherein after determining each straight line formed by the edge points through Hough transform, according to at least three preset reference coordinate points, a straight line having a minimum distance from each reference coordinate point is determined to be before a target straight line corresponding to the reference coordinate point, and the method further comprises:
and filtering the straight line formed by the edge points according to a preset length threshold value.
6. The method of claim 1, wherein the method further comprises:
and determining the reading of the meter according to the rotation angle of the pointer.
7. An apparatus for determining a rotation angle of a meter hand, the apparatus comprising:
the extraction module is used for extracting each edge point in the acquired instrument image and determining each straight line formed by the edge points through Hough transformation;
the first determining module is used for determining a straight line with the minimum distance with each reference coordinate point as a target straight line corresponding to the reference coordinate point according to at least three preset reference coordinate points; determining the corresponding relation between the slope of the straight line in the instrument image and the standard slope according to the slope of the target straight line corresponding to each reference coordinate point and the predetermined standard slope corresponding to each reference coordinate point;
the second determination module is used for determining a straight line with the minimum distance from the pointer straight line reference coordinate point as a target pointer straight line according to the preset pointer straight line reference coordinate point; determining the standard slope of the target pointer straight line according to the slope of the target pointer straight line and the corresponding relation between the slope of the straight line in the instrument image and the standard slope;
the third determining module is used for determining the rotation angle of the pointer according to the standard slope of the target pointer straight line;
wherein, the at least three reference points comprise points on a vertical straight line, a horizontal straight line and a non-vertical non-horizontal straight line which are formed by the edge points of the dial plate and the shell in the instrument.
8. The apparatus according to claim 7, wherein the first determining module is specifically configured to determine the target straight line if the target straight line corresponding to the reference coordinate point is a target vertical straight line, a target horizontal straight line, a target non-vertical non-horizontal straight line; according to
Figure FDA0002554318890000031
Determining the standard slope of the straight line in the instrument image, wherein k is the standard slope of the straight line in the instrument image, k' is the slope of the straight line in the instrument image, k1Is the slope, k, of the target vertical line2Is the slope, k, of the target horizontal line3Is the slope, k, of the target non-vertical non-horizontal linerIs the standard slope corresponding to the reference coordinate point corresponding to the target non-vertical non-horizontal straight line.
9. The apparatus of claim 7, wherein the apparatus further comprises:
and the processing module is used for carrying out binarization processing on the instrument image.
10. The apparatus of claim 9, wherein the processing module is further configured to perform erosion and dilation processing on the instrument image after binarization processing.
11. The apparatus of claim 7, wherein the apparatus further comprises:
and the filtering module is used for filtering the straight line formed by the edge points according to a preset length threshold value.
12. The apparatus of claim 7, wherein the apparatus further comprises:
and the reading module is used for determining the reading of the instrument according to the rotation angle of the pointer.
CN201810608134.XA 2018-06-13 2018-06-13 Method and device for determining rotation angle of instrument pointer Active CN108898632B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810608134.XA CN108898632B (en) 2018-06-13 2018-06-13 Method and device for determining rotation angle of instrument pointer

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810608134.XA CN108898632B (en) 2018-06-13 2018-06-13 Method and device for determining rotation angle of instrument pointer

Publications (2)

Publication Number Publication Date
CN108898632A CN108898632A (en) 2018-11-27
CN108898632B true CN108898632B (en) 2020-09-29

Family

ID=64345082

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810608134.XA Active CN108898632B (en) 2018-06-13 2018-06-13 Method and device for determining rotation angle of instrument pointer

Country Status (1)

Country Link
CN (1) CN108898632B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109753974B (en) * 2018-12-14 2020-09-22 歌尔股份有限公司 Method and device for detecting rotation angle of object and electronic equipment

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104615972A (en) * 2013-11-05 2015-05-13 深圳中兴力维技术有限公司 Intelligent indication method of pointer instrument and device thereof
CN105426809A (en) * 2015-08-18 2016-03-23 张大堃 Method for automatically identifying instrument pointer
CN105740829A (en) * 2016-02-02 2016-07-06 暨南大学 Scanning line processing based automatic reading method for pointer instrument

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104615972A (en) * 2013-11-05 2015-05-13 深圳中兴力维技术有限公司 Intelligent indication method of pointer instrument and device thereof
CN105426809A (en) * 2015-08-18 2016-03-23 张大堃 Method for automatically identifying instrument pointer
CN105740829A (en) * 2016-02-02 2016-07-06 暨南大学 Scanning line processing based automatic reading method for pointer instrument

Also Published As

Publication number Publication date
CN108898632A (en) 2018-11-27

Similar Documents

Publication Publication Date Title
CN110580480B (en) Meter reading identification method based on image processing
CN104392206A (en) Image processing method for automatic pointer-type instrument reading recognition
CN102176228B (en) Machine vision method for identifying dial plate information of multi-pointer instrument
CN103994786B (en) Image detecting method for arc ruler lines of pointer instrument scale
CN108955901B (en) Infrared temperature measurement method and system and terminal equipment
US10679094B2 (en) Automatic ruler detection
CN113570605A (en) Defect detection method and system based on liquid crystal display panel
CN108550166B (en) Spatial target image matching method
JP2011002919A (en) Method and device for detecting object
CN107092905B (en) Method for positioning instrument to be identified of power inspection robot
CN115294145B (en) Method and system for measuring sag of power transmission line
CN106815830B (en) Image defect detection method
CN109034170A (en) A kind of round readings of pointer type meters method of switch cubicle detection device
CN111223078A (en) Method for determining defect grade and storage medium
CN108898632B (en) Method and device for determining rotation angle of instrument pointer
JP2003216931A (en) Specific pattern recognizing method, specific pattern recognizing program, specific pattern recognizing program storage medium and specific pattern recognizing device
CN113705350A (en) Pointer instrument reading identification method and device for transformer substation, medium and electronic equipment
CN112560839A (en) Automatic identification method and system for reading of pointer instrument
CN107734324B (en) Method and system for measuring illumination uniformity of flash lamp and terminal equipment
CN115861801A (en) Pointer instrument identification method and system, electronic equipment and readable storage medium
CN115393838A (en) Pointer instrument reading identification method and device, electronic equipment and storage medium
CN115311624A (en) Slope displacement monitoring method and device, electronic equipment and storage medium
CN115631169A (en) Product detection method and device, electronic equipment and storage medium
CN111091910B (en) Intelligent evaluation system based on painting clock test
CN108332779B (en) Reading method of liquid column type instrument and related device

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