CN108898632A - A kind of rotation angle of gauge pointer determines method and device - Google Patents
A kind of rotation angle of gauge pointer determines method and device Download PDFInfo
- Publication number
- CN108898632A CN108898632A CN201810608134.XA CN201810608134A CN108898632A CN 108898632 A CN108898632 A CN 108898632A CN 201810608134 A CN201810608134 A CN 201810608134A CN 108898632 A CN108898632 A CN 108898632A
- Authority
- CN
- China
- Prior art keywords
- straight line
- slope
- line
- reference coordinate
- pointer
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/70—Determining position or orientation of objects or cameras
- G06T7/73—Determining position or orientation of objects or cameras using feature-based methods
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/10—Segmentation; Edge detection
- G06T7/13—Edge detection
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/10—Segmentation; Edge detection
- G06T7/168—Segmentation; Edge detection involving transform domain methods
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/20—Special algorithmic details
- G06T2207/20048—Transform domain processing
- G06T2207/20061—Hough transform
Abstract
The invention discloses a kind of rotation angles of gauge pointer to determine method and device, the method includes:Each marginal point in the Instrument image got is extracted, every straight line that marginal point is constituted is determined by Hough transform;According to preset at least three reference coordinates point, target line will be determined as with each reference coordinate point apart from the smallest straight line;According to the slope of the corresponding target line of each reference coordinate point and the corresponding calibration slope of predetermined each reference coordinate point, the corresponding relationship of the slope of straight line and calibration slope in Instrument image is determined;It will be determined as object pointer straight line with preset pointer straight-line reference coordinate points apart from the smallest straight line;According to the slope of straight line and the corresponding relationship of calibration slope in the slope and Instrument image of object pointer straight line, the calibration slope of object pointer straight line is determined;So that it is determined that the rotation angle of pointer.Provide one kind scheme of the rotation angle of accurate determining gauge pointer.
Description
Technical field
The present invention relates to technical field of image processing more particularly to the rotation angle determination methods and dress of a kind of gauge pointer
It sets.
Background technique
Pointer instrument is as a kind of traditional metrical instrument, simple, cheap, the easy to maintain, anti-corrosion with structure
Erosion, not by the interference of electromagnetic field, low temperature resistant, high reliablity many advantages, such as, be widely used in electric power, communications and transportation, petrochemical industry,
The fields such as scientific experiment and resident living.In the use process of instrument, need that artificially instrument is monitored in real time or determined
When inspection to know the reading of instrument guarantee that the device or system using instrument is normal, smoothly operation.However it relies on artificial
Real time monitoring is carried out to instrument or timing inspection is a uninteresting cumbersome job, needs to expend a large amount of manpower, and supervise
It surveys result to be easy by subjective impact, there are many hidden danger and inconvenience.
With the development of image processing techniques, real time monitoring or timing inspection are manually carried out to instrument by computer generation
It is possibly realized, such as obtains Instrument image, identify the slope of pointer, calculate the rotation angle of pointer, and then determine the reading of instrument.
It however is the conversion of several coordinate systems on the process nature of imaging.Camera shooting is a little transformed by world coordinate system first in space
Machine coordinate system, is subsequently projected to the image physical coordinates system of imaging plane, and the image pixel of last reconvert to the plane of delineation is sat
Mark system.Due to the influence of the factors such as shooting angle, camera lens, the Instrument image finally obtained can exist with true instrument
There is distortion, cause the slope of determining pointer there is error in certain deformation, that is, the Instrument image obtained, eventually lead to really
There are errors for the rotation angle of fixed pointer, affect the accuracy of reading of instrument.
Summary of the invention
The rotation angle that the present invention provides a kind of gauge pointer determines method and device, obtains in the prior art to solve
Instrument image the problem of there is distortion, causing determining gauge pointer to rotate angle inaccuracy, influence the accuracy of reading of instrument.
The embodiment of the invention discloses a kind of rotation angle determination method of gauge pointer, the method includes:
Each marginal point in the Instrument image got is extracted, the marginal point structure is determined by Hough Hough transform
At every straight line;
It, will be with each reference coordinate point apart from the smallest straight line, really according to preset at least three reference coordinates point
It is set to the corresponding target line of reference coordinate point;And according to the slope of the corresponding target line of each reference coordinate point and in advance
The determining corresponding calibration slope of each reference coordinate point, determines pair of the slope of straight line and calibration slope in the Instrument image
It should be related to;
It, will be with the pointer straight-line reference coordinate points apart from the smallest according to preset pointer straight-line reference coordinate points
Straight line is determined as object pointer straight line;According to the slope of straight line in the slope and the Instrument image of the object pointer straight line
With the corresponding relationship of calibration slope, the calibration slope of the object pointer straight line is determined;
According to the calibration slope of the object pointer straight line, the rotation angle of pointer is determined.
Further, if the corresponding target line of reference coordinate point is target vertical straight line, target level straight line, target
Non-vertical non-aqueous flat line;The slope according to the corresponding target line of each reference coordinate point and predetermined each ginseng
The corresponding calibration slope of coordinate points is examined, determines that the slope of straight line and the corresponding relationship of calibration slope include in the Instrument image:
According toDetermine the calibration slope of straight line in Instrument image, wherein k is instrument
The calibration slope of straight line, slope, k that k ' is straight line in Instrument image in image1Slope, k for target vertical straight line2For target
Slope, the k of horizontal linear3For slope, the k of the non-vertical non-aqueous flat line of targetrFor with the non-vertical non-horizontal line correspondences of target
The corresponding calibration slope of reference coordinate point.
Further, before each marginal point extracted in the Instrument image got, the method also includes:
Binary conversion treatment is carried out to the Instrument image.
Further, the method also includes:
Corrosion and expansion process are carried out to the Instrument image after binary conversion treatment.
Further, after every straight line that the marginal point composition is determined by Hough Hough transform, according to pre-
The 1 reference coordinate points first set will be determined as the reference coordinate with each reference coordinate point apart from the smallest straight line
Before the corresponding target line of point, the method also includes:
According to preset length threshold, the straight line constituted to the marginal point is filtered.
Further, the method also includes:
According to the rotation angle of the pointer, the reading of the instrument is determined.
The invention discloses a kind of rotation angle setting unit of gauge pointer, described device includes:
Extraction module is determined for extracting each marginal point in the Instrument image got by Hough Hough transform
Every straight line that the marginal point is constituted;
First determining module is used for according to preset at least three reference coordinates point, will be with each reference coordinate point
Apart from the smallest straight line, it is determined as the corresponding target line of reference coordinate point;And according to the corresponding mesh of each reference coordinate point
The slope and the corresponding calibration slope of predetermined each reference coordinate point for marking straight line, determine straight line in the Instrument image
The corresponding relationship of slope and calibration slope;
Second determining module, for that will join with the pointer straight line according to preset pointer straight-line reference coordinate points
Coordinate points are examined apart from the smallest straight line, are determined as object pointer straight line;According to the slope and the instrument of the object pointer straight line
The corresponding relationship of the slope of straight line and calibration slope in table image determines the calibration slope of the object pointer straight line;
Third determining module determines the rotation angle of pointer for the calibration slope according to the object pointer straight line.
Further, first determining module, if being specifically used for the corresponding target line of reference coordinate point is target
The non-vertical non-aqueous flat line of vertical straight line, target level straight line, target;According toIt determines
The calibration slope of straight line in Instrument image, wherein k is that the calibration slope of straight line, k ' are straight line in Instrument image in Instrument image
Slope, k1Slope, k for target vertical straight line2Slope, k for target level straight line3For the non-vertical non-aqueous flat line of target
Slope, krFor calibration slope corresponding with the reference coordinate point of the non-vertical non-horizontal line correspondences of target.
Further, described device further includes:
Processing module, for carrying out binary conversion treatment to the Instrument image.
Further, the processing module is also used to carry out the Instrument image after binary conversion treatment to corrode and swollen
Swollen processing.
Further, described device further includes:
Filtering module, for according to preset length threshold, the straight line constituted to the marginal point to be filtered.
Further, described device further includes:
It reads module and determines the reading of the instrument for the rotation angle according to the pointer.
The invention discloses a kind of rotation angles of gauge pointer to determine method and device, the method includes:Electronics is set
The standby each marginal point extracted in the Instrument image got determines that the marginal point is constituted every by Hough Hough transform
Straight line;According to preset at least three reference coordinates point, will be determined with each reference coordinate point apart from the smallest straight line
For the corresponding target line of reference coordinate point;And it is according to the slope of the corresponding target line of each reference coordinate point and true in advance
The fixed corresponding calibration slope of each reference coordinate point, determines that the slope of straight line is corresponding with calibration slope in the Instrument image
Relationship;It, will be with the pointer straight-line reference coordinate points apart from the smallest straight according to preset pointer straight-line reference coordinate points
Line is determined as object pointer straight line;According to the slope of straight line in the slope and the Instrument image of the object pointer straight line with
The corresponding relationship of calibration slope determines the calibration slope of the object pointer straight line;According to the standard of the object pointer straight line
Slope determines the rotation angle of pointer.Due in embodiments of the present invention, according to preset at least three reference coordinate
Point will be determined as the corresponding target line of reference coordinate point with each reference coordinate point apart from the smallest straight line;And according to every
The slope and the corresponding calibration slope of predetermined each reference coordinate point of the corresponding target line of a reference coordinate point, determine
The corresponding relationship of the slope of straight line and calibration slope in Instrument image, and according to the slope and Instrument image of object pointer straight line
The slope of middle straight line and the corresponding relationship of calibration slope, determine the calibration slope of object pointer straight line, avoid because of Instrument image
Existing distortion, leading to the slope of determining object pointer straight line, there are errors, and then ensure that the rotation angle of determining pointer
The accuracy of degree, to improve the precision of meter reading.
Detailed description of the invention
In order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology, to embodiment or will show below
There is attached drawing needed in technical description to be briefly described, it should be apparent that, the accompanying drawings in the following description is only this
Some embodiments of invention for those of ordinary skill in the art without creative efforts, can be with
It obtains other drawings based on these drawings.
Fig. 1 is a kind of rotation angle determination process schematic diagram for gauge pointer that present invention implementation provides;
Fig. 2 is that the present invention implements the schematic diagram that reference coordinate point is arranged in a kind of Instrument image provided;
Fig. 3 provides a kind of Instrument image schematic diagram for carrying out corrosion with the binaryzation after expansion process for the present invention;
Fig. 4 provides a kind of outline drawing of dial plate that marginal point is constituted for the present invention;
Fig. 5 provides a kind of straight line schematic diagram determined from the marginal point of the profile of the dial plate of composition for the present invention;
Fig. 6 is a kind of rotation angle setting unit structural schematic diagram of the gauge pointer provided in the embodiment of the present invention.
Specific embodiment
To make the objectives, technical solutions, and advantages of the present invention clearer, make below in conjunction with the attached drawing present invention into one
Step ground detailed description, it is clear that described embodiment is only a part of the embodiments of the present invention, rather than whole implementation
Example.Based on the embodiments of the present invention, obtained by those of ordinary skill in the art without making creative efforts
Every other embodiment, shall fall within the protection scope of the present invention.
Embodiment 1:
Fig. 1 is a kind of rotation angle determination process schematic diagram for gauge pointer that present invention implementation provides, which includes:
S101:Each marginal point in the Instrument image got is extracted, the side is determined by Hough (Hough) transformation
Every straight line that edge point is constituted.
The rotation angle determination method of gauge pointer provided in an embodiment of the present invention is applied to electronic equipment, the electronic equipment
It can be image capture device, such as video camera, camera, be also possible to mobile phone, PC (PC), tablet computer etc. and set
It is standby.
The instrument used in daily production and life is usually made of shell, dial plate, pointer etc., due to instrument shell with
Dial plate, dial plate are different with the color of the graduation mark of mark scale etc. and brightness from white space in pointer, dial plate, lead to meter diagram
Shell and dial plate, dial plate are different with the gray value of the graduation mark of mark scale etc. with white space in pointer, dial plate as in.At this
In inventive embodiments can according in Instrument image pixel gray value extract Instrument image in the marginal point of shell and dial plate,
The marginal point of graduation mark etc. of white space and mark scale in the marginal point of dial plate and pointer, dial plate.
Specifically, electronic equipment obtains the Instrument image of instrument, the gray value of each pixel in Instrument image is identified, and
It for each pixel, recognizes whether adjacent with the pixel, and is greater than with the difference of the gray value of the pixel pre-
If gray threshold pixel, if so, determine the pixel be Instrument image in marginal point.Such as:The ash of pixel C
Angle value 50, preset gray threshold are 70, and the pixel adjacent with pixel C has pixel A, pixel B, pixel D, pixel
Point E, wherein the gray value of pixel A is 48, the gray value of pixel B is 51, the gray value of pixel D is 227, pixel E
Gray value be 50, there are the differences of the gray value of pixel D and the gray value of pixel C to be greater than preset gray threshold, really
Determining pixel C is the marginal point in Instrument image.
Alternatively, it is also possible to be for each pixel, recognize whether it is adjacent with the pixel, and with the pixel
Gray value difference be less than preset gray threshold pixel, if so, determine the pixel be Instrument image in side
Edge point.It of courses, edge detection operator (Canny) transformation also can be used, extract each marginal point in Instrument image.
After extracting each marginal point in the Instrument image got, determine that marginal point is constituted every by Hough transform
Straight line.Hough transform is a kind of parameter estimation techniques using voting principle, and principle is to utilize image space and Hough
Test problems in image space are transformed into Hough parameter space, by Hough by the point of parameter space-line duality
Simple cumulative statistics is carried out in parameter space, then detects straight line in the method that Hough parameter space finds accumulator peak value.
In embodiments of the present invention, it is the prior art by every straight line that Hough transform determines that marginal point is constituted, no longer goes to live in the household of one's in-laws on getting married
It states.
Preferably, for the accuracy for the target line for improving efficiency and determining, by described in the determination of Hough Hough transform
It, will be with each reference coordinate point according to preset at least three reference coordinates point after every straight line that marginal point is constituted
Apart from the smallest straight line, it is determined as before the corresponding target line of reference coordinate point, the method also includes:
According to preset length threshold, the straight line constituted to the marginal point is filtered, and is filtered out to be less than and is set in advance
The straight line of fixed length threshold.
S102:It, will be with each reference coordinate point apart from the smallest straight according to preset at least three reference coordinates point
Line is determined as the corresponding target line of reference coordinate point;And according to the slope of the corresponding target line of each reference coordinate point
And the corresponding calibration slope of predetermined each reference coordinate point, determine that the slope of straight line and standard are oblique in the Instrument image
The corresponding relationship of rate.
In embodiments of the present invention, in advance for the side of the straight line of the marginal point of shell and dial plate composition, dial plate and pointer
At least three in straight line, straight line that the marginal point of the graduation mark of white space and mark scale is constituted in dial plate that edge point is constituted etc.
Straight line is respectively arranged with corresponding reference coordinate point, and the reference coordinate point meets in all straight lines that marginal point is constituted,
Linear distance corresponding with the reference coordinate point is minimum.It can be directly indicated in instrument in embodiments of the present invention with reference to seat
Punctuate.Such as:The corresponding reference coordinate point of straight line 1 is indicated with red point in instrument for the straight line 1 that marginal point is constituted
1, the straight line 2 constituted for marginal point indicates the corresponding reference coordinate point 2 of straight line 2 with blue dot in instrument, and electronic equipment obtains
Pass through image recognition after taking Instrument image, reference coordinate point 1, reference coordinate point 2 are identified in Instrument image.
It of courses, reference coordinate point can also be set directly in Instrument image, as shown in Fig. 2, wherein for the ease of saying
Bright, the straight line that reference coordinate point is provided in Instrument image is shown with extended dotted line, wherein for the setting of straight line 1 with reference to seat
Punctuate A, reference coordinate point B is set for straight line 2, reference coordinate point C is set for straight line 3, reference coordinate is set for straight line 4
D, electronic equipment record reference coordinate point A, reference coordinate point B, reference coordinate point C, reference coordinate point D in image coordinate system
Coordinate, according to coordinate of each reference coordinate point of setting in image coordinate system, in every Instrument image of subsequent acquisition
Determine each reference coordinate point of setting.
In addition, it is previously provided with corresponding calibration slope for each reference coordinate point in embodiments of the present invention, wherein
The corresponding calibration slope of each reference coordinate point, for reference coordinate point corresponding target line in Instrument image, non-abnormal
Slope in the Instrument image of change.Wherein according to the internal reference of image capture device, the outer figure for joining determining image capture device acquisition
As corresponding non-fault image is the prior art, no longer repeated.
Specifically, it is directed to the corresponding target line of each reference coordinate point, it is straight according to the corresponding target of reference coordinate point
Coordinate of any two points in image coordinate system on line determines the slope of the corresponding target line of reference coordinate point.And according to
The slope and the corresponding calibration slope of predetermined each reference coordinate point of the corresponding target line of each reference coordinate point, really
Determine the corresponding relationship of the slope of straight line and calibration slope in Instrument image.Illustratively, to preset, there are four reference coordinates
For point, it is illustrated.Wherein, the slope of the corresponding target line 1 of reference coordinate point 1 is k1, corresponding calibration slope be kw;Ginseng
The slope for examining the corresponding target line 2 of coordinate points 2 is k2, corresponding calibration slope be ke;The corresponding target line 3 of reference coordinate point 3
Slope is k3, corresponding calibration slope be kr;The slope of the corresponding target line 4 of reference coordinate point 4 is k4, corresponding calibration slope
For kt.The corresponding relationship determination process of the slope of straight line and calibration slope, as follows in Instrument image:
The coordinate (x ', y ') of pixel and the coordinate (x, y) of pixel in the Instrument image of non-distortion are right in Instrument image
Should be related to for:Wherein a is the first distortion factor, b is the second distortion factor, c is third distortion
Coefficient, d are the 4th distortion factor, h1 is the first translation coefficient, h2 is the second translation coefficient.
The calculation formula of the calibration slope K of straight line is in the Instrument image of non-distortion:
The slope k of straight line in Instrument image ' calculation formula be:
According to equation groupDetermine a, b, c, d
Value, brings the value of a, b, c, d into formulaIn can determine the slope k of straight line in Instrument image ' with calibration slope k's
Corresponding relationship.
S103:It, will be with the pointer straight-line reference coordinate points distance according to preset pointer straight-line reference coordinate points
The smallest straight line is determined as object pointer straight line;According to straight line in the slope and the Instrument image of the object pointer straight line
Slope and calibration slope corresponding relationship, determine the calibration slope of the object pointer straight line.
In embodiments of the present invention, pointer straight-line reference coordinate points are also preset with, such as:By the center of Instrument image
Point is set as the reference coordinate point of pointer straight line, will be determined as object pointer straight line with the smallest straight line of pointer linear distance, root
The slope that object pointer straight line is determined according to coordinate of any two points in image coordinate on object pointer straight line, according to Instrument image
The slope of middle straight line and the corresponding relationship of calibration slope, determine the calibration slope of object pointer straight line.
S104:According to the calibration slope of the object pointer straight line, the rotation angle of pointer is determined.
Specifically, determining object pointer straight line and image coordinate system horizontal axis (x) according to the calibration slope of object pointer straight line
The angle of axis, and according to the angle of object pointer straight line and image coordinate system horizontal axis (x) axis, when not rotating with pointer,
The difference of the angle of object pointer straight line and image coordinate system horizontal axis, determines the rotation angle of pointer in the Instrument image of non-distortion
Degree.In addition, after the rotation angle of determining pointer, it can also be according to the letter of the rotation angle of the corresponding pointer of scale each in dial plate
The rotation angle of breath and pointer, determines the reading of instrument.
Due to that in embodiments of the present invention, according to preset at least three reference coordinates point, will be sat with each reference
The smallest straight line of gauge length is determined as the corresponding target line of reference coordinate point;And it is corresponding according to each reference coordinate point
Target line slope and the corresponding calibration slope of predetermined each reference coordinate point, determine straight line in Instrument image
The corresponding relationship of slope and calibration slope, and according to the slope and mark of straight line in the slope and Instrument image of object pointer straight line
The corresponding relationship of quasi- slope determines the calibration slope of object pointer straight line, avoids because of distortion existing for Instrument image, causes really
There are errors for the slope of fixed object pointer straight line, and then ensure that the accuracy of the rotation angle of determining pointer, to mention
The high precision of meter reading.
Embodiment 2:
Efficiency is determined in order to improve the rotation angle of gauge pointer, on the basis of the above embodiments, is implemented in the present invention
In example, if the corresponding target line of reference coordinate point is that target vertical straight line, target level straight line, target are non-vertical non-horizontal
Straight line;It is described corresponding according to the slope of the corresponding target line of each reference coordinate point and predetermined each reference coordinate point
Calibration slope, determine that the slope of straight line and the corresponding relationship of calibration slope include in the Instrument image:
According toDetermine the calibration slope of straight line in Instrument image, wherein k is instrument
The calibration slope of straight line, slope, k that k ' is straight line in Instrument image in image1Slope, k for target vertical straight line2For target
Slope, the k of horizontal linear3For slope, the k of the non-vertical non-aqueous flat line of targetrFor with the non-vertical non-horizontal line correspondences of target
The corresponding calibration slope of reference coordinate point.
In embodiments of the present invention, if preset there are three reference coordinate point, wherein three reference coordinate points are corresponding
Target line, respectively target parallel with the longitudinal axis (y) axis of image coordinate system in the Instrument image of non-distortion is straight vertically
Line, in the Instrument image of non-distortion with the horizontal axis parallel object horizontal linear of image coordinate system, in the Instrument image of non-distortion
In the non-vertical non-aqueous flat line of horizontally and vertically not parallel target with image coordinate system.It can basisDetermine the calibration slope of straight line in Instrument image, wherein k is straight line in Instrument image
Calibration slope, slope, the k that k ' is straight line in Instrument image1Slope, k for target vertical straight line2For the oblique of target level straight line
Rate, k3For slope, the k of the non-vertical non-aqueous flat line of targetrFor the reference coordinate point pair with the non-vertical non-horizontal line correspondences of target
The calibration slope answered.
FormulaDetermination process it is as follows:
If target line is target vertical straight line, the corresponding calibration slope of the corresponding reference coordinate point of target vertical straight line
kwIt is infinity, then can be obtained by above-mentioned formula (3):k1=bd (4);
If target line is target level straight line, the corresponding calibration slope of reference coordinate point of target level line correspondences
keIt is zero, then can be obtained by above-mentioned formula (3):
If target line is the non-vertical non-aqueous flat line of target, the reference coordinate of the non-vertical non-horizontal line correspondences of target
The corresponding calibration slope k of pointr, then can be obtained by above-mentioned formula (3):
It can be obtained by (4), (5), (6):
Transformation above-mentioned formula (3) can obtain formula:
A, b, c, d in (7), which is substituted into formula (8), to be obtained
Embodiment 3:
In order to improve gauge pointer rotation angle determination precision, on the basis of the various embodiments described above, in the present invention
In embodiment, before each marginal point extracted in the Instrument image got, the method also includes:
Binary conversion treatment is carried out to the Instrument image.
The method also includes:
Corrosion and expansion process are carried out to the Instrument image after binary conversion treatment.
Specifically, the gray value that gray value in Instrument image is greater than the pixel of setting gray threshold is determined as 1, by instrument
The gray value of pixel that gray value is less than or equal to setting gray threshold in table image is determined as 0, and to binary conversion treatment after
Instrument image carries out corrosion and expansion process, to eliminate Instrument image bumps and concave point after binary conversion treatment.Fig. 3 is this
Invention provides a kind of Instrument image schematic diagram for carrying out the binaryzation after corrosion and expansion process.Extracting the side in Instrument image
When edge point, can determine with gray value be 0 pixel it is adjacent, the pixel that gray value is 1 is marginal point;It of courses,
Can determine with gray value be 1 pixel it is adjacent, the pixel that gray value is 0 is marginal point.
In addition, referring to fig. 2, if straight line 2 is parallel with the horizontal axis in image coordinate system in the Instrument image of non-distortion, ginseng
The corresponding target vertical straight line of coordinate points, target level straight line, the non-vertical non-aqueous flat line of target are examined, table in Fig. 2 is respectively corresponded
Straight line 1, the straight line 2, straight line 3 of the marginal point of disk and shell composition obtain the marginal point in Instrument image to improve efficiency
Afterwards, the profile for the dial plate that marginal point is constituted can also be extracted according to the profile of dial plate in instrument, the dial plate that wherein marginal point is constituted
Profile it is as shown in Figure 4.After the profile for obtaining the dial plate that marginal point is constituted, the profile of dial plate is being constituted by Hough transform
Every straight line that edge is constituted is determined in marginal point, preferably, can also be according to preset length threshold, to marginal point structure
At straight line be filtered, the straight line less than preset length threshold is filtered out, from the marginal point of the profile of the dial plate of composition
The straight line of middle determination is as shown in Figure 5.After determining straight line in the marginal point of the profile of the dial plate of composition, according to preset ginseng
Coordinate points are examined, that is, can determine straight line 1 corresponding with reference coordinate point, straight line 2, straight line 3.Pass through basis in embodiments of the present invention
The profile of dial plate in instrument, the profile for extracting dial plate in Instrument image is the prior art, is no longer repeated.
Embodiment 4:
Fig. 6 is a kind of rotation angle setting unit structural schematic diagram of the gauge pointer provided in the embodiment of the present invention, institute
Stating device includes:
Extraction module 61, it is true by Hough Hough transform for extracting each marginal point in the Instrument image got
Every straight line that the fixed marginal point is constituted;
First determining module 62 is used for according to preset at least three reference coordinates point, will be with each reference coordinate
Point is determined as the corresponding target line of reference coordinate point apart from the smallest straight line;And it is corresponding according to each reference coordinate point
The slope of target line and the corresponding calibration slope of predetermined each reference coordinate point, determine straight line in the Instrument image
Slope and calibration slope corresponding relationship;
Second determining module 63 is used for according to preset pointer straight-line reference coordinate points, will be with the pointer straight line
Reference coordinate point is determined as object pointer straight line apart from the smallest straight line;According to the slope of the object pointer straight line and described
The corresponding relationship of the slope of straight line and calibration slope in Instrument image determines the calibration slope of the object pointer straight line;
Third determining module 64 determines the rotation angle of pointer for the calibration slope according to the object pointer straight line.
First determining module 62, if being specifically used for the corresponding target line of reference coordinate point is that target is straight vertically
The non-vertical non-aqueous flat line of line, target level straight line, target;According toDetermine meter diagram
As in straight line calibration slope, wherein k be in Instrument image the calibration slope of straight line, k ' be the slope of straight line in Instrument image,
k1Slope, k for target vertical straight line2Slope, k for target level straight line3For the non-vertical non-aqueous flat line of target slope,
krFor calibration slope corresponding with the reference coordinate point of the non-vertical non-horizontal line correspondences of target.
Described device further includes:
Processing module 65, for carrying out binary conversion treatment to the Instrument image.
The processing module 65 is also used to carry out the Instrument image after binary conversion treatment corrosion and expansion process.
Described device further includes:
Filtering module 66, for according to preset length threshold, the straight line constituted to the marginal point to be filtered.
Described device further includes:
It reads module 67 and determines the reading of the instrument for the rotation angle according to the pointer.
The invention discloses a kind of rotation angles of gauge pointer to determine method and device, the method includes:Electronics is set
The standby each marginal point extracted in the Instrument image got determines that the marginal point is constituted every by Hough Hough transform
Straight line;According to preset at least three reference coordinates point, will be determined with each reference coordinate point apart from the smallest straight line
For the corresponding target line of reference coordinate point;And it is according to the slope of the corresponding target line of each reference coordinate point and true in advance
The fixed corresponding calibration slope of each reference coordinate point, determines that the slope of straight line is corresponding with calibration slope in the Instrument image
Relationship;It, will be with the pointer straight-line reference coordinate points apart from the smallest straight according to preset pointer straight-line reference coordinate points
Line is determined as object pointer straight line;According to the slope of straight line in the slope and the Instrument image of the object pointer straight line with
The corresponding relationship of calibration slope determines the calibration slope of the object pointer straight line;According to the standard of the object pointer straight line
Slope determines the rotation angle of pointer.Due in embodiments of the present invention, according to preset at least three reference coordinate
Point will be determined as the corresponding target line of reference coordinate point with each reference coordinate point apart from the smallest straight line;And according to every
The slope and the corresponding calibration slope of predetermined each reference coordinate point of the corresponding target line of a reference coordinate point, determine
The corresponding relationship of the slope of straight line and calibration slope in Instrument image, and according to the slope and Instrument image of object pointer straight line
The slope of middle straight line and the corresponding relationship of calibration slope, determine the calibration slope of object pointer straight line, avoid because of Instrument image
Existing distortion, leading to the slope of determining object pointer straight line, there are errors, and then ensure that the rotation angle of determining pointer
The accuracy of degree, to improve the precision of meter reading.
For systems/devices embodiment, since it is substantially similar to the method embodiment, so the comparison of description is simple
Single, the relevent part can refer to the partial explaination of embodiments of method.
It should be understood by those skilled in the art that, embodiments herein can provide as method, system or computer program
Product.Therefore, complete hardware embodiment, complete software embodiment or reality combining software and hardware aspects can be used in the application
Apply the form of example.Moreover, it wherein includes the computer of computer usable program code that the application, which can be used in one or more,
The computer program implemented in usable storage medium (including but not limited to magnetic disk storage, CD-ROM, optical memory etc.) produces
The form of product.
The application is referring to method, the process of equipment (system) and computer program product according to the embodiment of the present application
Figure and/or block diagram describe.It should be understood that every one stream in flowchart and/or the block diagram can be realized by computer program instructions
The combination of process and/or box in journey and/or box and flowchart and/or the block diagram.It can provide these computer programs
Instruct the processor of general purpose computer, special purpose computer, Embedded Processor or other programmable data processing devices to produce
A raw machine, so that being generated by the instruction that computer or the processor of other programmable data processing devices execute for real
The device for the function of being specified in present one or more flows of the flowchart and/or one or more blocks of the block diagram.
These computer program instructions, which may also be stored in, is able to guide computer or other programmable data processing devices with spy
Determine in the computer-readable memory that mode works, so that it includes referring to that instruction stored in the computer readable memory, which generates,
Enable the manufacture of device, the command device realize in one box of one or more flows of the flowchart and/or block diagram or
The function of being specified in multiple boxes.
These computer program instructions also can be loaded onto a computer or other programmable data processing device, so that counting
Series of operation steps are executed on calculation machine or other programmable devices to generate computer implemented processing, thus in computer or
The instruction executed on other programmable devices is provided for realizing in one or more flows of the flowchart and/or block diagram one
The step of function of being specified in a box or multiple boxes.
Although the preferred embodiment of the application has been described, it is created once a person skilled in the art knows basic
Property concept, then additional changes and modifications can be made to these embodiments.So it includes excellent that the following claims are intended to be interpreted as
It selects embodiment and falls into all change and modification of the application range.
Obviously, various changes and modifications can be made to the invention without departing from essence of the invention by those skilled in the art
Mind and range.In this way, if these modifications and changes of the present invention belongs to the range of the claims in the present invention and its equivalent technologies
Within, then the present invention is also intended to include these modifications and variations.
Claims (12)
1. a kind of rotation angle determination method of gauge pointer, which is characterized in that the method includes:
Each marginal point in the Instrument image got is extracted, determines what the marginal point was constituted by Hough Hough transform
Every straight line;
According to preset at least three reference coordinates point, will be determined as with each reference coordinate point apart from the smallest straight line
The corresponding target line of reference coordinate point;And it according to the slope of the corresponding target line of each reference coordinate point and predefines
The corresponding calibration slope of each reference coordinate point, determine in the Instrument image that the slope of straight line is corresponding with calibration slope and close
System;
It, will be with the pointer straight-line reference coordinate points apart from the smallest straight according to preset pointer straight-line reference coordinate points
Line is determined as object pointer straight line;According to the slope of straight line in the slope and the Instrument image of the object pointer straight line with
The corresponding relationship of calibration slope determines the calibration slope of the object pointer straight line;
According to the calibration slope of the object pointer straight line, the rotation angle of pointer is determined.
2. the method as described in claim 1, which is characterized in that if the corresponding target line of reference coordinate point is that target is vertical
The non-vertical non-aqueous flat line of straight line, target level straight line, target;It is described according to the corresponding target line of each reference coordinate point
Slope and the corresponding calibration slope of predetermined each reference coordinate point, determine the slope and mark of straight line in the Instrument image
The corresponding relationship of quasi- slope includes:
According toDetermine the calibration slope of straight line in Instrument image, wherein k is Instrument image
The calibration slope of middle straight line, slope, the k that k ' is straight line in Instrument image1Slope, k for target vertical straight line2For target level
Slope, the k of straight line3For slope, the k of the non-vertical non-aqueous flat line of targetrFor the reference with the non-vertical non-horizontal line correspondences of target
The corresponding calibration slope of coordinate points.
3. the method as described in claim 1, which is characterized in that each marginal point extracted in the Instrument image got
Before, the method also includes:
Binary conversion treatment is carried out to the Instrument image.
4. method as claimed in claim 3, which is characterized in that the method also includes:
Corrosion and expansion process are carried out to the Instrument image after binary conversion treatment.
5. the method as described in claim 1, which is characterized in that described to determine the marginal point structure by Hough Hough transform
At every straight line after, will be minimum with each reference coordinate point distance according to preset at least three reference coordinates point
Straight line, be determined as before the corresponding target line of reference coordinate point, the method also includes:
According to preset length threshold, the straight line constituted to the marginal point is filtered.
6. the method as described in claim 1, which is characterized in that the method also includes:
According to the rotation angle of the pointer, the reading of the instrument is determined.
7. a kind of rotation angle setting unit of gauge pointer, which is characterized in that described device includes:
Extraction module, for extracting each marginal point in the Instrument image got, by described in the determination of Hough Hough transform
Every straight line that marginal point is constituted;
First determining module is used for according to preset at least three reference coordinates point, will be with each reference coordinate point distance
The smallest straight line is determined as the corresponding target line of reference coordinate point;And it is straight according to the corresponding target of each reference coordinate point
The slope of line and the corresponding calibration slope of predetermined each reference coordinate point, determine the slope of straight line in the Instrument image
With the corresponding relationship of calibration slope;
Second determining module, for that will be sat with the pointer straight-line reference according to preset pointer straight-line reference coordinate points
The smallest straight line of gauge length, is determined as object pointer straight line;According to the slope and the meter diagram of the object pointer straight line
The slope of straight line and the corresponding relationship of calibration slope as in, determine the calibration slope of the object pointer straight line;
Third determining module determines the rotation angle of pointer for the calibration slope according to the object pointer straight line.
8. device as claimed in claim 7, which is characterized in that first determining module, if being specifically used for reference coordinate
The corresponding target line of point is target vertical straight line, target level straight line, the non-vertical non-aqueous flat line of target;According toDetermine the calibration slope of straight line in Instrument image, wherein k is straight line in Instrument image
Calibration slope, slope, the k that k ' is straight line in Instrument image1Slope, k for target vertical straight line2For the oblique of target level straight line
Rate, k3For slope, the k of the non-vertical non-aqueous flat line of targetrFor the reference coordinate point pair with the non-vertical non-horizontal line correspondences of target
The calibration slope answered.
9. device as claimed in claim 7, which is characterized in that described device further includes:
Processing module, for carrying out binary conversion treatment to the Instrument image.
10. device as claimed in claim 9, which is characterized in that the processing module is also used to the institute after binary conversion treatment
It states Instrument image and carries out corrosion and expansion process.
11. device as claimed in claim 7, which is characterized in that described device further includes:
Filtering module, for according to preset length threshold, the straight line constituted to the marginal point to be filtered.
12. device as claimed in claim 7, which is characterized in that described device further includes:
It reads module and determines the reading of the instrument for the rotation angle according to the pointer.
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 true CN108898632A (en) | 2018-11-27 |
CN108898632B 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) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109753974A (en) * | 2018-12-14 | 2019-05-14 | 歌尔股份有限公司 | Detection method, device and the electronic equipment of object rotation angle |
Citations (3)
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 |
-
2018
- 2018-06-13 CN CN201810608134.XA patent/CN108898632B/en active Active
Patent Citations (3)
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 |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109753974A (en) * | 2018-12-14 | 2019-05-14 | 歌尔股份有限公司 | Detection method, device and the electronic equipment of object rotation angle |
CN109753974B (en) * | 2018-12-14 | 2020-09-22 | 歌尔股份有限公司 | Method and device for detecting rotation angle of object and electronic equipment |
Also Published As
Publication number | Publication date |
---|---|
CN108898632B (en) | 2020-09-29 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111354042B (en) | Feature extraction method and device of robot visual image, robot and medium | |
US11900634B2 (en) | Method for adaptively detecting chessboard sub-pixel level corner points | |
CN107167169B (en) | Readings of pointer type meters based on NI Vision Builder for Automated Inspection identifies measurement method | |
CN103217438B (en) | Accurate circuit board element location and detection method based on image feature | |
CN109544628B (en) | Accurate reading identification system and method for pointer instrument | |
CN111383285B (en) | Sensor fusion calibration method and system based on millimeter wave radar and camera | |
CN104657711B (en) | A kind of readings of pointer type meters automatic identifying method of robust | |
CN102521560A (en) | Instrument pointer image identification method of high-robustness rod | |
CN105303168A (en) | Multi-view pointer type instrument identification method and device | |
CN104899609B (en) | A kind of mechanical meter recognition methods based on image registration | |
Yang et al. | An image-based intelligent system for pointer instrument reading | |
CN111784778A (en) | Binocular camera external parameter calibration method and system based on linear solving and nonlinear optimization | |
CN107092905B (en) | Method for positioning instrument to be identified of power inspection robot | |
JP2013113600A (en) | Stereo three-dimensional measuring apparatus | |
CN109508709B (en) | Single pointer instrument reading method based on machine vision | |
CN108924544A (en) | Camera distortion measurement method and test device | |
CN112560837A (en) | Reading method, device, equipment and storage medium of pointer instrument | |
CN104749801B (en) | High Precision Automatic optical detecting method and system | |
CN103795935A (en) | Camera shooting type multi-target locating method and device based on image rectification | |
CN112598747A (en) | Combined calibration method for monocular camera and projector | |
CN109949725A (en) | A kind of AOI system image grayscale standardized method and system | |
CN111311671A (en) | Workpiece measuring method and device, electronic equipment and storage medium | |
CN113705350A (en) | Pointer instrument reading identification method and device for transformer substation, medium and electronic equipment | |
CN108898632A (en) | A kind of rotation angle of gauge pointer determines method and device | |
CN101894369B (en) | Real-time method for computing focal length of camera from image sequence |
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 |