CN109063717B - Method for acquiring center point of instrument - Google Patents
Method for acquiring center point of instrument Download PDFInfo
- Publication number
- CN109063717B CN109063717B CN201810852790.4A CN201810852790A CN109063717B CN 109063717 B CN109063717 B CN 109063717B CN 201810852790 A CN201810852790 A CN 201810852790A CN 109063717 B CN109063717 B CN 109063717B
- Authority
- CN
- China
- Prior art keywords
- instrument
- ellipse
- point
- fitting
- points
- 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
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/40—Extraction of image or video features
- G06V10/42—Global feature extraction by analysis of the whole pattern, e.g. using frequency domain transformations or autocorrelation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/20—Image preprocessing
- G06V10/255—Detecting or recognising potential candidate objects based on visual cues, e.g. shapes
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V2201/00—Indexing scheme relating to image or video recognition or understanding
- G06V2201/02—Recognising information on displays, dials, clocks
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Multimedia (AREA)
- Theoretical Computer Science (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Image Analysis (AREA)
Abstract
The invention discloses a method for acquiring a central point of an instrument, and relates to the technical field of instrument detection. The invention comprises the following steps: s01: obtaining an instrument picture; s02: marking key points according to the outer frame of the dial plate; s03: judging whether the number of the mark points is more than or equal to 6; s04: fitting an ellipse and calculating the center point of the ellipse; s05: judging whether the result meets the requirements, if so, determining to obtain the best instrument central point; if not, the partial mark points are modified, and the loop of step S04 is repeated. According to the invention, the central point of the instrument panel is calculated by manually marking key points and combining software, the software automatically detects whether the central point position of the fitting ellipse meets the requirement of the central point of the instrument panel, and the manual detection is combined for identification, so that the acquisition error of the central point of the instrument is small, the stability is high, and the efficiency is high.
Description
Technical Field
The invention belongs to the technical field of instrument detection, and particularly relates to a method for acquiring a central point of an instrument.
Background
In the era of intelligent automation, many enterprises are also continuously introducing automation equipment, including combination meter equipment. The combined instrument equipment is used for automatically detecting the instruments of automobiles and motorcycles and has the function of automatically detecting whether the pointing scales of a pointer on the instrument are correct or not. In the function of detecting whether the pointer scale of the instrument is accurate, firstly, the central position of the instrument needs to be acquired, if the central point of the instrument is found manually, a great error is certainly caused, if the central point of the instrument can be found automatically and accurately, the optimal solution is undoubtedly provided, but under the condition that information is less or the rest of the information cannot be automatically acquired, an accurate and efficient method is needed for acquiring the central point of the instrument. The invention introduces a method for semi-automatically acquiring the center point of the instrument, namely provides a method for acquiring the center point of the instrument to solve the problems, and has important significance.
Disclosure of Invention
The invention aims to provide a method for acquiring a central point of an instrument, which is characterized in that the central point of an instrument panel is calculated by manually marking key points and combining software, the software automatically detects whether the position of the central point of a fitting ellipse meets the requirement of the central point of the instrument panel, and the manual detection is combined for identification, so that the problems of large error, low stability and low efficiency in manually searching the central point of the instrument are solved.
In order to solve the technical problems, the invention is realized by the following technical scheme:
the invention discloses a method for acquiring a center point of an instrument, which comprises the following steps:
s01: obtaining an instrument picture: the position, the visual field and the focal length of a camera are adjusted to be right in front of an instrument to be shot, shooting is carried out, and a shot picture is uploaded to a computer to obtain an electronic instrument picture;
s02: marking key points according to the outer frame of the dial: marking a plurality of key mark points on the instrument picture one by one to realize the approximate range detection of the instrument panel;
s03: judging whether the number of the mark points is more than or equal to 6;
if yes, carrying out the next step;
if not, returning to the step S02;
s04: fitting an ellipse and calculating the center point of the ellipse: performing ellipse fitting on each mark point on the instrument picture, drawing an ellipse at a corresponding position, and acquiring the position of a long-axis and short-axis intersection point between the intersection ellipses, namely the central point of the ellipse;
s05: judging whether the fitting result meets the requirement: judging whether the fitted ellipse center point meets the requirement of the instrument center point through software detection and manual detection;
if yes, determining to obtain an optimal instrument central point;
if not, modifying part of the mark points, and repeating the step S04 until the requirement of the instrument center point is met.
Further, the step S02 includes the following sub-steps:
s021: clicking the calibration key mark points on the instrument panel outer frame one by using a mouse on the instrument panel;
s022: and storing the key mark points, and drawing the crosshair at the mark point positions.
Further, the detection of the approximate range of the dial plate in step S02 is realized by the following method: the method comprises the steps of binding a mouse event through a set program, wherein the mouse event is a corresponding event for realizing a mouse clicking function in the program, the mouse event comprises the steps of obtaining the position information of a current mouse pointer when a left mouse button is pressed for a single time, generating coordinate points by using a Point method, storing the obtained position information of the mouse pointer into a vector object array, traversing the position information of all the coordinate points, drawing a crosshair at the position of each coordinate Point, and completing marking of the mark points.
Furthermore, the number of the marking points is at least three, and the distance between every two marking points is larger than 3 cm.
Further, the crosshair is 10 x 10 pixels in size.
Further, the drawing of the ellipse in the step S04 is implemented by: traversing each marking point, and then carrying out ellipse fitting on the marking points by using a fitEllipse ellipse fitting method; and then, connecting the outer side mark points of the obtained ellipse to generate a polygon, calculating the maximum width of the polygon through the vertexes of the polygon, then generating a minimum rectangle capable of containing the polygon, namely the minimum circumscribed rectangle of the ellipse according to the maximum width of the polygon, and then drawing the fitting ellipse to be obtained by using an ellips method according to the obtained minimum circumscribed rectangle.
Further, the software detection in step S05 includes detecting the length-width ratio of the fitting ellipse circumscribed rectangle by filtering out ellipses whose length-width ratio exceeds 5 and whose difference is very large, and detecting the ellipse circumscribed rectangle by filtering out ellipses whose length-width ratio exceeds one third of the size of the instrument picture and whose size is less than one third of the size of the instrument picture.
Further, it is manually detected in step S05 whether the instrument center point obtained by fitting the ellipse meets the requirement, i.e., whether the instrument center point is located at the center of the instrument.
The invention has the following beneficial effects:
according to the invention, the central point of the instrument panel is calculated by manually marking key points and combining software, the software automatically detects whether the central point position of the fitting ellipse meets the requirement of the central point of the instrument panel, and the identification is carried out by combining manual detection.
Of course, it is not necessary for any product in which the invention is practiced to achieve all of the above-described advantages at the same time.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art that other drawings can be obtained according to the drawings without creative efforts.
FIG. 1 is a flow chart of a method of obtaining a center point of a meter according to the present invention;
FIG. 2 is a flowchart illustrating the substeps of step S02 in FIG. 1;
FIG. 3 is a pictorial illustration of a meter marked with a mark point;
FIG. 4 is a diagram of a graph of a meter generating an ellipse and acquiring a center point of the meter;
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Referring to fig. 1 and fig. 3 to 4, a method for obtaining a center point of a meter according to the present invention includes the following steps:
s01: obtaining an instrument picture: the position, the visual field and the focal length of a camera are adjusted to be right in front of an instrument to be shot, shooting is carried out, and a shot picture is uploaded to a computer to obtain an electronic instrument picture;
s02: marking key points according to the outer frame of the dial: marking three key marking points on the instrument picture one by one to realize the approximate range detection of the instrument panel, as shown in figure 3;
s03: judging whether the number of the mark points is more than or equal to 6;
if yes, carrying out the next step;
if not, returning to the step S02;
s04: fitting an ellipse and calculating the center point of the ellipse: ellipse fitting is carried out on each mark point on the instrument picture, an ellipse is drawn at a corresponding position, and the position of a long axis and short axis intersection point between the intersection ellipses, namely the center point of the ellipse, is obtained, as shown in figure 4;
s05: judging whether the fitting result meets the requirement: judging whether the fitted ellipse center point meets the requirement of the instrument center point through software detection and manual detection;
if yes, determining to obtain an optimal instrument central point;
if not, modifying part of the mark points, and repeating the step S04 until the requirement of the instrument center point is met.
As shown in fig. 2, step S02 includes the following sub-steps:
s021: clicking the calibration key mark points on the instrument panel outer frame one by using a mouse on the instrument image;
s022: and storing the key mark points, and drawing the crosshair at the mark point positions.
In step S02, the rough range detection of the dial is realized by the following method: the method comprises the steps of binding a mouse event by setting a program, wherein the mouse event is a corresponding event for realizing a mouse click function in the program, the mouse event comprises the steps of obtaining the position information of a current mouse pointer when a left mouse button is pressed for a single time, generating coordinate points by using a Point method, storing the obtained position information of the mouse pointer into a vector object array, traversing the position information of all coordinate points, drawing a crosshair at the position of each coordinate Point, and finishing marking Point calibration.
Wherein, the number of the marking points is at least three, and the distance between every two marking points is more than 3 cm.
Wherein the crosshairs are 10 x 10 pixels in size.
The drawing of the ellipse in step S04 is implemented by the following method: traversing each marking point, and then carrying out ellipse fitting on the marking points by using a fitEllipse ellipse fitting method; and then, connecting the outer side mark points of the obtained ellipse to generate a polygon, calculating the maximum width of the polygon through the vertex of the polygon, then generating a minimum rectangle which can contain the polygon, namely the minimum circumscribed rectangle of the ellipse according to the maximum width of the polygon, and then drawing the fitting ellipse to be obtained by using an ellipsose method according to the obtained minimum circumscribed rectangle.
The method for extracting the etipase specifically comprises the following steps: according to the ellipse equation of x ^2/a ^2+ y ^2/b ^2 ^ 1, (a > b >0), the position of any point on the ellipse edge can be obtained under the condition that the length and width of the ellipse to be drawn are known, and the length and width of the minimum circumscribed rectangle is the length and width of the ellipse.
The software detection in step S05 includes detecting the length-width ratio of the fitting ellipse circumscribed rectangle and detecting the ellipse circumscribed rectangle, the length-width ratio of the fitting ellipse circumscribed rectangle is detected by filtering out ellipses with a length-width ratio exceeding 5 and a very large difference, the ellipse circumscribed rectangle is detected by filtering out ellipses with a length exceeding the size of the instrument picture and being smaller than one third of the size of the instrument picture, and under the condition that the effect is not ideal, the positions of some mark points can be modified to regenerate, and under the condition that the mark points meet the requirement, the best center point position of the instrument can be obtained.
In step S05, it is manually detected whether the instrument center point obtained by fitting the ellipse meets the requirement, i.e., whether the instrument center point is located at the center of the instrument.
In the description herein, references to the description of "one embodiment," "an example," "a specific example" or the like are intended to mean that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. In this specification, the schematic representations of the terms used above do not necessarily refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
The preferred embodiments of the invention disclosed above are intended to be illustrative only. The preferred embodiments are not intended to be exhaustive or to limit the invention to the precise embodiments disclosed. Obviously, many modifications and variations are possible in light of the above teaching. The embodiments were chosen and described in order to best explain the principles of the invention and the practical application, to thereby enable others skilled in the art to best utilize the invention. The invention is limited only by the claims and their full scope and equivalents.
Claims (4)
1. A method of obtaining a meter center point, comprising the steps of:
s01: obtaining an instrument picture: the position, the visual field and the focal length of a camera are adjusted to be right in front of an instrument to be shot, shooting is carried out, and a shot picture is uploaded to a computer to obtain an electronic instrument picture;
s02: marking key points according to the outer frame of the dial: marking a plurality of key mark points on the instrument picture one by one to realize the approximate range detection of the instrument panel;
s03: judging whether the number of the mark points is more than or equal to 6;
if yes, carrying out the next step;
if not, returning to the step S02;
s04: fitting an ellipse and calculating the center point of the ellipse: performing ellipse fitting on each mark point on the instrument picture, drawing an ellipse at a corresponding position, and acquiring the position of a long-axis and short-axis intersection point between the intersection ellipses, namely the central point of the ellipse;
s05: judging whether the fitting result meets the requirement: judging whether the fitted ellipse center point meets the requirement of the instrument center point through software detection and manual detection;
if yes, determining to obtain an optimal instrument central point;
if not, modifying part of the mark points, and repeating the step S04 until the requirement of the instrument central point is met;
the step S02 includes the following sub-steps:
s021: clicking the calibration key mark points on the instrument panel outer frame one by using a mouse on the instrument panel;
s022: storing the key mark points, and drawing a crosshair at the mark point position;
the detection of the approximate range of the dial in step S02 is realized by the following method: binding a mouse event by setting a program, wherein the mouse event is a corresponding event for realizing a mouse click function in the program, the mouse event comprises the steps of acquiring the position information of a current mouse pointer when a left mouse button is pressed for a single time, generating coordinate points by using a Point method, storing the acquired position information of the mouse pointer into a vector object array, traversing the position information of all the coordinate points, drawing a crosshair at the position of each coordinate Point, and completing the calibration of the mark points;
the software detection in the step S05 includes detecting the length-width ratio of the fitting ellipse circumscribed rectangle by filtering out ellipses whose length-width ratio exceeds 5 and whose difference is very large, and detecting the ellipse circumscribed rectangle by filtering out ellipses whose length-width ratio exceeds 5 and whose size is less than one third of the size of the instrument picture;
in step S05, it is manually detected whether the instrument center point obtained by fitting the ellipse meets the requirement, i.e., whether the instrument center point is located at the center of the instrument.
2. The method for obtaining the center point of a meter according to claim 1, wherein the number of the marking points is at least three, and the distance between each marking point is more than 3 cm.
3. The method of claim 1, wherein the crosshairs are 10 x 10 pixels in size.
4. The method for obtaining the center point of the meter according to claim 1, wherein the drawing of the ellipse in step S04 is performed by: traversing each marking point, and then carrying out ellipse fitting on the marking points by using a fitEllipse ellipse fitting method; and then, connecting the outer side mark points of the obtained ellipse to generate a polygon, calculating the maximum width of the polygon through the vertexes of the polygon, then generating a minimum rectangle capable of containing the polygon, namely the minimum circumscribed rectangle of the ellipse according to the maximum width of the polygon, and then drawing the fitting ellipse to be obtained by using an ellips method according to the obtained minimum circumscribed rectangle.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810852790.4A CN109063717B (en) | 2018-07-30 | 2018-07-30 | Method for acquiring center point of instrument |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810852790.4A CN109063717B (en) | 2018-07-30 | 2018-07-30 | Method for acquiring center point of instrument |
Publications (2)
Publication Number | Publication Date |
---|---|
CN109063717A CN109063717A (en) | 2018-12-21 |
CN109063717B true CN109063717B (en) | 2021-06-15 |
Family
ID=64831754
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810852790.4A Active CN109063717B (en) | 2018-07-30 | 2018-07-30 | Method for acquiring center point of instrument |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109063717B (en) |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110084251A (en) * | 2019-04-29 | 2019-08-02 | 北京史河科技有限公司 | A kind of Meter recognition method, apparatus and storage medium |
CN110929716B (en) * | 2019-11-29 | 2022-07-15 | 航天科技控股集团股份有限公司 | Pointer capture-based instrument panel center determination method and system |
CN111428563B (en) * | 2020-02-25 | 2022-04-01 | 吉林大学 | Image identification method for automobile full-liquid crystal instrument |
Family Cites Families (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
EP1176557A1 (en) * | 2000-07-24 | 2002-01-30 | Setrix AG | Method and arrangement for camera calibration |
CN106650697B (en) * | 2016-12-30 | 2019-11-15 | 亿嘉和科技股份有限公司 | A kind of meter dial recognition methods |
CN107133623B (en) * | 2017-05-11 | 2020-03-24 | 安徽慧视金瞳科技有限公司 | Pointer position accurate detection method based on background difference and circle center positioning |
CN107167169B (en) * | 2017-07-03 | 2019-04-26 | 吉林大学 | Readings of pointer type meters based on NI Vision Builder for Automated Inspection identifies measurement method |
CN107609557B (en) * | 2017-08-24 | 2020-09-08 | 华中科技大学 | Pointer instrument reading identification method |
-
2018
- 2018-07-30 CN CN201810852790.4A patent/CN109063717B/en active Active
Also Published As
Publication number | Publication date |
---|---|
CN109063717A (en) | 2018-12-21 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107993263B (en) | Automatic calibration method for panoramic system, automobile, calibration device and storage medium | |
CN107609557B (en) | Pointer instrument reading identification method | |
CN109948590B (en) | Attitude problem detection method and device | |
CN109063717B (en) | Method for acquiring center point of instrument | |
US8300920B2 (en) | System and method for measuring form and position tolerances of an object | |
CN111965624A (en) | Calibration method, device and equipment for laser radar and camera and readable storage medium | |
CN107239794B (en) | Point cloud data segmentation method and terminal | |
CN113592989B (en) | Three-dimensional scene reconstruction system, method, equipment and storage medium | |
CN112949624B (en) | Water gauge-based water level detection method and device, electronic equipment and storage medium | |
CN107464266B (en) | Bearing calibration, device, equipment and the storage medium of camera calibration parameter | |
CN109871829B (en) | Detection model training method and device based on deep learning | |
CN111612852A (en) | Method and apparatus for verifying camera parameters | |
CN103544492B (en) | Target identification method and device based on depth image three-dimension curved surface geometric properties | |
CN110738703B (en) | Positioning method and device, terminal and storage medium | |
CN112013921B (en) | Method, device and system for acquiring water level information based on water level gauge measurement image | |
CN106778587B (en) | State of flight detection method and device based on unmanned plane image | |
CN110675396A (en) | Remote sensing image cloud detection method, device and equipment and computer readable storage medium | |
CN109272546A (en) | A kind of fry length measurement method and system | |
CN108647264A (en) | A kind of image automatic annotation method and device based on support vector machines | |
CN109145929A (en) | One kind being based on SIFT scale space characteristics information extraction method | |
CN108052869B (en) | Lane line recognition method, lane line recognition device and computer-readable storage medium | |
CN112465893A (en) | Vegetation leaf area measuring method and device, terminal and storage medium | |
CN110458857B (en) | Central symmetry primitive detection method and device, electronic equipment and readable storage medium | |
CN114627186A (en) | Distance measuring method and distance measuring device | |
CN105740867B (en) | The selection method of image texture window shape and scale |
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 | ||
CB02 | Change of applicant information |
Address after: 230000 Yafu Park, Juchao Economic Development Zone, Chaohu City, Hefei City, Anhui Province Applicant after: ANHUI HUISHI JINTONG TECHNOLOGY Co.,Ltd. Address before: 230000 Room 102, 1st Floor, C District, Science Park, Hefei National University, 602 Huangshan Road, Hefei High-tech Zone, Anhui Province Applicant before: ANHUI HUISHI JINTONG TECHNOLOGY Co.,Ltd. |
|
CB02 | Change of applicant information | ||
GR01 | Patent grant | ||
GR01 | Patent grant |