CN113076945A - Camera direct-reading meter reading instrument abnormal point removing method based on improved RANSAC - Google Patents

Camera direct-reading meter reading instrument abnormal point removing method based on improved RANSAC Download PDF

Info

Publication number
CN113076945A
CN113076945A CN202110285939.7A CN202110285939A CN113076945A CN 113076945 A CN113076945 A CN 113076945A CN 202110285939 A CN202110285939 A CN 202110285939A CN 113076945 A CN113076945 A CN 113076945A
Authority
CN
China
Prior art keywords
points
thr
digital
distance
reading
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202110285939.7A
Other languages
Chinese (zh)
Other versions
CN113076945B (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.)
Zhenxun Semiconductor Technology Shanghai Co ltd
Huaxiaxin Beijing General Processor Technology Co ltd
Original Assignee
Zhenxun Semiconductor Technology Shanghai Co ltd
Huaxiaxin Beijing General Processor 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 Zhenxun Semiconductor Technology Shanghai Co ltd, Huaxiaxin Beijing General Processor Technology Co ltd filed Critical Zhenxun Semiconductor Technology Shanghai Co ltd
Priority to CN202110285939.7A priority Critical patent/CN113076945B/en
Priority claimed from CN202110285939.7A external-priority patent/CN113076945B/en
Publication of CN113076945A publication Critical patent/CN113076945A/en
Application granted granted Critical
Publication of CN113076945B publication Critical patent/CN113076945B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V20/00Scenes; Scene-specific elements
    • G06V20/60Type of objects
    • G06V20/62Text, e.g. of license plates, overlay texts or captions on TV images
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/74Image or video pattern matching; Proximity measures in feature spaces
    • G06V10/75Organisation of the matching processes, e.g. simultaneous or sequential comparisons of image or video features; Coarse-fine approaches, e.g. multi-scale approaches; using context analysis; Selection of dictionaries
    • G06V10/757Matching configurations of points or features
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V2201/00Indexing scheme relating to image or video recognition or understanding
    • G06V2201/02Recognising information on displays, dials, clocks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V30/00Character recognition; Recognising digital ink; Document-oriented image-based pattern recognition
    • G06V30/10Character recognition

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Data Mining & Analysis (AREA)
  • Multimedia (AREA)
  • Artificial Intelligence (AREA)
  • Evolutionary Computation (AREA)
  • General Engineering & Computer Science (AREA)
  • Evolutionary Biology (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Computing Systems (AREA)
  • Databases & Information Systems (AREA)
  • General Health & Medical Sciences (AREA)
  • Medical Informatics (AREA)
  • Software Systems (AREA)
  • Image Analysis (AREA)

Abstract

The invention relates to the field of intelligent meter reading of instruments, in particular to a camera shooting direct-reading meter reading instrument abnormal point removing method based on improved RANSAC; the method comprises the following steps: step 1: inputting a digit point set S and algorithm parameters, and generating a digit pair index table P and a candidate index table P'; the digital point set S is all digital points and coordinates thereof obtained by front-end image recognition, and comprises 5-8 normal digits and a plurality of mistakenly recognized abnormal digits; step 2: searching whether the P contains the remaining number pairs to be selected; if yes, selecting a group of digital pairs in sequence, solving the absolute value | k | and the distance g of the slope of the connecting line of the two points, and executing in sequence; if not, jumping to step 6; and step 3: determining whether | k ¬ is satisfied>kThrOr g>gThr(ii) a If not, executing in sequence; otherwise, deleting the digit pair in the P and jumping to the step 2; the application universality of the camera direct-reading meter reading instrument can be improved; can improve the accuracy and stability of abnormal point eliminationQualitative operation can improve the operation speed and stability.

Description

Camera direct-reading meter reading instrument abnormal point removing method based on improved RANSAC
Technical Field
The invention relates to the field of intelligent meter reading of instruments, in particular to a camera direct-reading meter reading instrument abnormal point removing method based on improved RANSAC.
Background
In recent years, with the increasing promotion of the urbanization of the country, the demand of people for water, electricity and gas is gradually increased, so that the workload of meter reading and charging is increased, and the requirements of an energy department on meter reading speed and accuracy are more and more difficult to meet through the manual meter reading and counting. The appearance of the camera direct-reading meter reading instrument greatly reduces the working intensity and the operation cost of manual meter reading, improves the real-time performance, the accuracy and the reliability of data acquisition, and can also complete the intelligent management of the instrument. The camera direct-reading meter reading instrument collects data by taking a picture through the external camera on the basis of not changing the structure of the original meter, and then carries out front-end processing on the collected picture to obtain the reading of the current meter. However, because the dial plate often has numbers which are different from the numbers of the normal reading window, such as production batch numbers, index parameters, measurement units, scale numbers and the like, the numbers can be mistakenly identified by the camera direct-reading meter, and even stains on the dial plate can be mistakenly identified. These incorrectly identified abnormal numbers are mixed into the normal numbers and will cause erroneous readings if they cannot be accurately rejected.
The existing abnormal number eliminating method of the camera direct-reading meter reading instrument mainly comprises a preprocessing method and a post-processing method, wherein the preprocessing method needs to know the number of digits of a digital meter in advance and frames the position and the shape of a reading window in an image, so that the error identification of abnormal numbers is prevented from the source; the post-processing mainly adopts a straight line fitting method to remove abnormal digital points out of the normal digital straight lines. Generally, the preprocessing method has the defects of harsh installation conditions, more limitation conditions, incapability of adapting to all conventional digital meters and the like, so the application scene is limited; the post-processing method can make up the defects of the pre-processing method, so that the application universality of the camera direct-reading meter reading instrument is stronger. There are two main types of conventional post-treatment methods: one is a Least Squares (LS) based method, which is based on fitting a straight line to all the digital points and then rejecting outlier digital points that are further from the straight line. The method has simple principle and high running speed, but is sensitive to the proportion of the abnormal points, so that the method can only process the situation that the proportion of the abnormal points is less (less than or equal to 30 percent), and the accuracy rate of the method is sharply reduced when the proportion of the abnormal points is increased; the other method is based on RANSAC, and the principle is that a random sampling iteration method is adopted to find out a straight line formed by connecting lines of local points (normal numbers) as far as possible, and then abnormal number points far away from the straight line are eliminated. The adaptability of the method to the proportion of the abnormal points is much higher than that of the LS method, but with the increase of the number of the abnormal points, the required average iteration times are rapidly increased, the running speed is rapidly reduced, and the real-time requirement cannot be met. Meanwhile, the two methods cannot eliminate abnormal digital points which are in the same straight line with the normal digital points, and the two methods also fail when the collinear situation occurs.
Based on the above situation, there is an urgent need to develop an improved abnormal point rejection post-processing method, and simultaneously improve the application universality, abnormal point rejection accuracy and operation speed of the camera direct-reading meter reading instrument, so as to meet the actual requirements of industrial production.
Disclosure of Invention
The invention provides a camera direct-reading meter reading abnormal point removing method based on improved RANSAC, which is used for solving the problems of low running speed and low accuracy when a large number of abnormal points are removed by a conventional post-processing algorithm.
In order to achieve the purpose, the invention provides the following technical scheme: a camera shooting direct-reading meter reading instrument abnormal point removing method based on improved RANSAC comprises the following steps:
step 1: inputting a digit point set S and algorithm parameters, and generating a digit pair index table P and a candidate index table P'; the digital point set S is all digital points and coordinates thereof obtained by front-end image recognition, and comprises 5-8 normal digits and a plurality of mistakenly recognized abnormal digits;
step 2: searching whether the P contains the remaining number pairs to be selected; if yes, selecting a group of digital pairs in sequence, solving the absolute value | k | and the distance g of the slope of the connecting line of the two points, and executing in sequence; if not, jumping to step 6;
and step 3: determining whether | k ¬ is satisfied>kThrOr g>gThr(ii) a If not, executing in sequence; otherwise, deleting the digit pair in the P and jumping to the step 2;
and 4, step 4: judging whether g e [ g ] is satisfiedOpmin,gOpmax](ii) a If yes, sequentially executing; otherwise, supplementing the digit pair to P', and jumping to the step 2;
and 5: fitting the number to a straight line, and calculating the distance d from all points to the straight lineiStatistic satisfies di<dThrThe number of elements (c): if the current value is more than or equal to 5, jumping to the step 8; otherwise, deleting the digit pair in the P and jumping to the step 2;
step 6: searching whether the P' contains the remaining number pairs to be selected; if yes, selecting a group of digital pairs in sequence and executing in sequence; otherwise, the process is abnormally ended, and the S is judged not to contain all normal characters;
and 7: fitting the number to a straight line, and calculating the distance d from all points to the straight lineiStatistic satisfies di<dThrThe number of elements (c): if the number is more than or equal to 5, sequentially executing; otherwise, deleting the number pair in the P' and jumping to the step 6;
and 8: deleting d in step 5 or step 7i≥dThrAll corresponding points are calculated, and the distance g between the rest points from left to right is calculatedi
And step 9: four-interval sliding window analysis of adjacent five points is carried out, and 4 g are calculatediAverage value of (2)
Figure BDA0002980466600000031
And standard deviation σgAnd judging whether or not the conditions are satisfied
Figure BDA0002980466600000032
And sigmagThr: if yes, jumping to step 11; otherwise, executing in sequence;
step 10: judging whether the right side of the sliding window has residual points: if yes, the sliding window is shifted to the right by one bit, and the step 9 is skipped; otherwise, the process is abnormally ended, and the S is judged not to contain all normal characters;
step 11: judging whether the number of the sliding window intervals is less than or equal to 6 and whether the left points are on the right side; if yes, calculating the distance g between the right adjacent point and the rightmost point of the sliding windowrightAnd are executed sequentially; otherwise, jumping to step 13;
step 12: judging whether the requirements are met
Figure BDA0002980466600000041
If yes, the right adjacent point is counted as a normal point, the distance number of the sliding windows is increased by one, and the step 11 is skipped; otherwise, executing in sequence;
step 13: outputting a digital point set S 'formed by the current sliding window, wherein the digital points in the S' are all normal digital points from which abnormal digital points are removed; the process ends normally.
Preferably, the algorithm parameters in step 1 are as follows:
1)kThr: a digital pair connection line slope absolute value threshold; the value is determined according to the inclination angle of a reading window allowed by the actual camera shooting direct-reading meter reading instrument, and the value is larger than the absolute value of the slope corresponding to the maximum inclination angle;
2)gThr: a digit pair spacing threshold; the numerical value is determined according to the head-to-tail numerical distance of reading windows of all dials served by the actual camera direct-reading meter reading instrument, and the value is larger than the maximum value of the distance;
3)gOpmin: a digital pair optimal spacing lower threshold; take 0.3gThr~0.4gThr
4)gOpmax: the upper threshold value of the optimal distance of the digital pair; take 0.7gThr~0.8gThr
5)dThr: a distance threshold value between the normal point and the fitted straight line; the numerical value is determined according to the distance error of the coordinate estimation of the actual shooting direct-reading meter for the normal number deviating from the central point of the digital frame, and if the error is +/-delta d, d isThrTaking 1 delta d-2 delta d;
6)gThrmin: a lower threshold for adjacent digit spacing; the numerical value is according to the reading window phase of all the dial plates served by the actual camera shooting direct reading meter reading instrumentThe minimum distance between adjacent numbers is determined, and the value is smaller than the distance;
7)gThrmax: an upper threshold value of adjacent digit spacing; the numerical value is determined according to the maximum distance between adjacent numbers of reading windows of all dials served by the actual camera shooting direct reading meter, and the numerical value is usually slightly larger than the distance;
8)σThr: a sliding window spacing standard deviation threshold; the numerical value is determined according to the distance error of the coordinate estimation of the actual shooting direct reading meter for the normal number deviating from the central point of the digital frame, and if the error is +/-delta d, sigma isThrUsually, 1. delta. d to 1.5. delta. d is used.
Preferably, the index table P in step 1 is a pair index corresponding to all the combinations of two digits of the set S of digit points, and if there are N digits in S, the number of the pair indexes in P is equal to
Figure BDA0002980466600000051
The candidate index table P' is initially an empty table to be used by the algorithm to store index pairs having a spacing less than a threshold but not the optimal spacing.
The invention has the beneficial effects that: the actual digital dial plate is often attached with numbers, such as production batch numbers, index parameters, measurement units, scale numbers and the like, which are different from the numbers in a normal reading window, and the numbers, the production batch numbers, the index parameters, the measurement units, the scale numbers and the like are often wrongly recognized by a camera direct-reading meter, and even stains on the dial plate can be wrongly recognized. These incorrectly identified abnormal numbers are mixed into the normal numbers and will cause erroneous readings if they cannot be accurately rejected. In view of the defects of the conventional processing method, the invention is improved based on the RANSAC algorithm which is more commonly used in the industry, and the invention aims to have the following three points:
1) the application universality of the camera direct-reading meter reading instrument can be improved. The method is suitable for identifying common 5-8-bit digital meters in the market, and the accurate values of the positions and the inclination angles of the digital meter bits and the reading windows are not required to be obtained in advance. The algorithm parameters of the invention are designed according to the indexes of front-end image recognition and the common indexes of reading windows of all digital meters, and do not depend on the individual indexes of the current digital meter, once the design is reasonable, the algorithm parameters can be applied to various digital meters, and the universality is strong;
2) the accuracy and stability of abnormal point elimination can be improved. The accuracy and stability of the abnormal point elimination are obviously improved by referring to a traditional RANSAC-based method. Particularly, for the situation (80%) that the proportion of abnormal points is high, the simulation accuracy rate still exceeds 90%, the accuracy rate under the actual working condition is almost 100%, and the credibility is high;
3) the running speed and the stability can be improved. The method is suitable for the actual working condition with high real-time requirement, and referring to the traditional RANSAC-based method, the running speeds of the conditions with low abnormal point proportion (less than or equal to 40%) are equivalent, and the running speed of the method is not severely reduced and the stability is high under the conditions with high abnormal point proportion (more than or equal to 60%). In fact, for any abnormal point proportion, simulation shows that the running speed of the method is approximately half of that of the traditional LS method, and the application requirements of industrial occasions can be completely met.
Drawings
FIG. 1 is a process flow diagram of the method of the present invention;
FIG. 2 is a typical processing result of a frame of different scale outliers by the conventional LS method, the conventional RANSAC method and the method of the present invention under matlab simulation environment;
FIG. 2a shows an outlier ratio of about 40%;
FIG. 2b shows an anomaly ratio of about 60%;
the anomaly point ratio of fig. 2c is about 80%.
FIG. 3 is a process diagram of an embodiment of the method of the present invention;
FIG. 3a is a photograph of a 5-digit digital water meter taken by the camera direct-reading meter reading device;
fig. 3b is a coordinate distribution diagram of all digital points obtained after the front-end image recognition processing is performed on the photo;
wherein, "o" represents a normal number and "x" represents an abnormal number;
FIG. 3c is a schematic diagram of related numerical points and straight line labels in the embodiment.
Detailed Description
The preferred embodiments of the present invention will be described in conjunction with the accompanying drawings, and it will be understood that they are described herein for the purpose of illustration and explanation and not limitation.
The most similar prior art to the present invention is an abnormal point elimination post-processing method based on the conventional RANSAC. The principle of the method is as follows: all the identified digital points are used as a sample set, digital pairs are randomly selected from the sample set and connected, the number of the digital points which are less than a certain threshold value from the straight line is counted, the process is repeated until the number is not less than a certain value, and all the digital points forming the number are normal numbers. For example, for a camera direct-reading meter reading device processing 5-8 bit digital tables, the fixed value is often set to 5; the distance threshold is reasonably designed according to the coordinate evaluation of the front-end image recognition on the normal number and the distance error deviating from the central point of the digital frame.
Both simulation and actual measurement show that after a plurality of iterations, the prior art method can find out the number pairs formed by normal numbers, and exits after meeting the iteration end condition, thereby accurately eliminating abnormal points. And when the proportion of the abnormal points is not very high (less than or equal to 50 percent) and the normal numbers have no abnormal number points near the straight line, the average iteration times of the method is controllable (less than or equal to 20 times), the running speed is high, the accuracy is high (more than or equal to 98 percent), and the actual requirements can be basically met.
The existing abnormal point elimination post-processing method based on RANSAC has the defects that the running speed and the accuracy are still not stable enough, and particularly, when the proportion of abnormal points exceeds 50%, the running speed and the accuracy are both seriously reduced, and the specific description is as follows:
1) the running speed is still not stable enough. The core idea of the conventional RANSAC method is random iteration, and each iteration requires a large amount of calculation, including solving a straight line equation and distances from all points to the straight line and counting, so that the influence of the increase of the number of iterations on the running speed is obvious. The only factor affecting the number of iterations is the iteration success rate, and obviously, when the number pairs selected blindly are all normal numbers and the spacing is large, the success rate is the highest (when the spacing is small, especially adjacent numbers, the deviation of the connecting line from the actual straight line is large due to the coordinate error, and the success rate is not high). When the proportion of the abnormal points is increased, the iteration success rate is rapidly reduced, and the average iteration frequency is rapidly increased. Without loss of generality, assuming that the digital meter is a 6-bit water meter, and the success rate is 100% when the digital pair is set to be normal numbers at two or more intervals, and the rest are 0%, the iteration success rates when the abnormal point proportion is respectively 30% (3), 50% (6), and 70% (14) are respectively:
Figure BDA0002980466600000081
Figure BDA0002980466600000082
Figure BDA0002980466600000083
therefore, the iteration success rate is seriously influenced by the proportion of the abnormal points, the operation speed is unstable, and the real-time performance is difficult to guarantee;
2) the accuracy is still not stable enough. Especially, when the proportion of abnormal points exceeds 50%, the accuracy rate is obviously reduced. The accuracy rate is seriously reduced due to two reasons: firstly, when the proportion of abnormal points is high, the probability that abnormal digital points exist near a straight line where normal digital points are located is increased, and the abnormal digital points cannot be removed in the prior art; secondly, in the prior art, iteration is performed on all the blind selection number pairs without filtering, and the accuracy rate when iteration is successful is difficult to guarantee (for example, when the slope or the distance of the iteration does not satisfy the situation of the normal number pair, 5 points may be collinear, and the iteration is judged as successful by mistake), which is also particularly obvious when the proportion of abnormal points is high.
In summary, the running speed and accuracy of the conventional RANSAC-based abnormal point elimination post-processing method are still not stable enough, the algorithm robustness under the condition of different abnormal point distributions is poor, and the method has obvious limitations in use in actual working conditions with unsatisfactory conditions, variable environments and high-precision requirements.
Aiming at the problem of abnormal point elimination in a post-processing algorithm of a camera direct-reading meter reading instrument, the invention is improved based on a RANSAC algorithm which is more common in the industry, and mainly improves the following two points:
1) the random sampling iterative analysis process in the RANSAC algorithm is improved into the following steps that after random sampling, the reliability of a sampling digital pair is judged according to the distance and the slope, and then the following steps are executed according to the conditions: directly carrying out iterative analysis with high reliability; entering a candidate queue with medium credibility, and performing iterative analysis when the analysis with high credibility is finished and no correct result exists; the direct abandonment with low reliability. The effect of the improvement here is twofold: firstly, the iteration success rate of the high-reliability sampling digital pair is obviously increased, so that the average iteration times can be greatly reduced, and the calculation cost of reliability is far less than that of one-time iteration analysis, so that the operation speed of the algorithm can be greatly improved; secondly, the accuracy of the high-reliability sampling digit pair is higher than that of a pure random sampling digit pair when iteration is successful (the abnormal digits are more obvious), so that the accuracy of the algorithm can be improved macroscopically;
2) after the RANSAC algorithm abnormal point elimination is completed, a self-adaptive sliding window analysis method is additionally designed, abnormal points at two ends of the same straight line of the normal points are further eliminated, and 5-8 normal points are self-adaptively reserved. The problem that the traditional RANSAC algorithm cannot find abnormal points on the same straight line is solved, so that the camera direct-reading meter reading instrument can be universally applied to conventional 5-8-bit dials on the market, and the specific dial digit does not need to be known in advance.
To more accurately illustrate the technical effect of the present invention, a monte carlo simulation was performed using matlab. Specifically, the performance indexes of the camera direct-reading meter reading instrument are designed as follows: the allowable inclination angle of the reading window is [ -15 degrees, 15 degrees ], the distance error delta d of the coordinate evaluation of the positive numbers deviating from the central point of the digital frame is +/-3 pixels, the maximum value of the head-to-tail digital distance of the reading windows of all the service dials is 150 pixels, the adjacent digital distance is 16-24 pixels, and the algorithm parameters under the simulation environment are designed as follows:
1)kThr: the range of inclination angles [ -15 °,15 °]The maximum absolute value of the slope is determined to be 0.27, so k is takenThr=0.30;
2)gThr: the maximum value of the head-to-tail numerical distance of reading windows of all the service dials is 150 pixels, so g is takenThr=155;
3)gOpmin: get gOpmin=0.35×gThr=54;
4)gOpmax: get gOpmax=0.75×gThr=116;
5)dThr: Δ d is 3, so take dThr=1.5×Δd=4.5;
6)gThrmin: the minimum value of the adjacent digital spacing is 16 pixels, so g is takenThrmin=15;
7)gThrmax: the maximum value of the adjacent digital distance is 24 pixels, so g is takenThrmax=25;
8)σThr: Δ d is 3, so take σThr=1.2×Δd=3.6。
The specific point scattering mode is as follows: the number of normal digital points is 5-8 random, a numerical value is randomly selected among 16-24 pixels at intervals, a numerical value is randomly selected among-15 degrees at the inclination angle of a connecting line, and the coordinate of each point is within +/-3 pixels of the deviation from the central point and is random in direction. The abnormal digital points are randomly distributed in the whole image (256 multiplied by 256 pixels), and the nearest distance to the normal digital points is not less than 30 pixels (which is in accordance with the reality of a majority digital table). The proportion of the abnormal points is divided into three groups of 40%, 60% and 80%, each group simulates 1000 frames of images, the traditional LS method, the traditional RANSAC method and the method are respectively adopted for removing the abnormal points, and the statistical accuracy, the average iteration frequency and the total operation time are calculated (the typical processing result of each frame of three groups of simulation is shown in figure 2). The statistical results are shown in the following table:
TABLE 1 statistical table of matlab Monte Carlo simulation results (1000 frames) performed by three methods
Figure BDA0002980466600000101
Figure BDA0002980466600000111
As shown in the above table, the conventional LS method has the advantage of fast operation, but cannot handle the situation with a large proportion of outliers, and the accuracy thereof decreases rapidly as the proportion of outliers increases. The method is characterized in that the LS method does not specially process the abnormal points during the straight line fitting, and the fitted straight line can deviate from the connecting line of the normal points far when the proportion of the abnormal points is high, so that the abnormal point removing fails. The adaptability of the traditional RANSAC method to the proportion of abnormal points is far higher than that of the traditional LS method, but as the proportion of the abnormal points increases, the probability of selecting ideal digital pairs (which are all normal characters and have far intervals) in blind selection is greatly reduced, so that the average iteration frequency is sharply increased, and the running time consumption is greatly increased. The method is improved based on the traditional RANSAC method, reliability of the blind selection digital pair is judged in advance innovatively, and a scheme of iteration first with high reliability, iteration after medium reliability and direct discarding with low reliability is adopted, so that the iteration success rate and the accuracy in success are greatly improved, the average iteration frequency is reduced, and the running time consumption is greatly reduced. Meanwhile, after one round of abnormal point elimination is completed, the self-adaptive sliding window analysis is carried out, the abnormal points at two ends of the same straight line of the normal points are further eliminated, and 5-8 normal points are reserved in a self-adaptive mode, so that the accuracy of the algorithm is further improved and is higher than that of the traditional RANSAC method.
The invention discloses a camera shooting direct-reading meter reading instrument abnormal point removing method based on improved RANSAC, which comprises the following steps:
step 1: inputting a digit point set S and algorithm parameters, and generating a digit pair index table P and a candidate index table P'; the digital point set S is all digital points and coordinates thereof obtained by front-end image recognition, and comprises 5-8 normal digits and a plurality of mistakenly recognized abnormal digits;
step 2: searching whether the P contains the remaining number pairs to be selected; if yes, selecting a group of digital pairs in sequence, solving the absolute value | k | and the distance g of the slope of the connecting line of the two points, and executing in sequence; if not, jumping to step 6;
and step 3: determining whether | k ¬ is satisfied>kThrOr g>gThr(ii) a If not, executing in sequence; otherwiseDeleting the number pair in the P and jumping to the step 2;
and 4, step 4: judging whether g e [ g ] is satisfiedOpmin,gOpmax](ii) a If yes, sequentially executing; otherwise, supplementing the digit pair to P', and jumping to the step 2;
and 5: fitting the number to a straight line, and calculating the distance d from all points to the straight lineiStatistic satisfies di<dThrThe number of elements (c): if the current value is more than or equal to 5, jumping to the step 8; otherwise, deleting the digit pair in the P and jumping to the step 2;
step 6: searching whether the P' contains the remaining number pairs to be selected; if yes, selecting a group of digital pairs in sequence and executing in sequence; otherwise, the process is abnormally ended, and the S is judged not to contain all normal characters;
and 7: fitting the number to a straight line, and calculating the distance d from all points to the straight lineiStatistic satisfies di<dThrThe number of elements (c): if the number is more than or equal to 5, sequentially executing; otherwise, deleting the number pair in the P' and jumping to the step 6;
and 8: deleting d in step 5 or step 7i≥dThrAll corresponding points are calculated, and the distance g between the rest points from left to right is calculatedi
And step 9: four-interval sliding window analysis of adjacent five points is carried out, and 4 g are calculatediAverage value of (2)
Figure BDA0002980466600000121
And standard deviation σgAnd judging whether or not the conditions are satisfied
Figure BDA0002980466600000122
And sigmagThr: if yes, jumping to step 11; otherwise, executing in sequence;
step 10: judging whether the right side of the sliding window has residual points: if yes, the sliding window is shifted to the right by one bit, and the step 9 is skipped; otherwise, the process is abnormally ended, and the S is judged not to contain all normal characters;
step 11: judging whether the number of the sliding window intervals is less than or equal to 6 and the right side has residueResidual points; if yes, calculating the distance g between the right adjacent point and the rightmost point of the sliding windowrightAnd are executed sequentially; otherwise, jumping to step 13;
step 12: judging whether the requirements are met
Figure BDA0002980466600000131
If yes, the right adjacent point is counted as a normal point, the distance number of the sliding windows is increased by one, and the step 11 is skipped; otherwise, executing in sequence;
step 13: outputting a digital point set S 'formed by the current sliding window, wherein the digital points in the S' are all normal digital points from which abnormal digital points are removed; the process ends normally.
The process of the present invention is further illustrated by the following examples:
the method is applied to the camera direct-reading meter reading instrument, and the performance indexes of the camera direct-reading meter reading instrument are designed as follows: the allowable inclination angle of the reading window is [ -20 degrees, 20 degrees ], the distance error delta d of the coordinate evaluation of the positive numbers deviating from the central point of the digital frame is +/-4 pixels, the maximum value of the head-to-tail digital spacing of the reading windows of all the dial plates to be served is 150 pixels, the adjacent digital spacing is 16-24 pixels, and the algorithm parameters under the embodiment are designed as follows:
1)kThr: the range of inclination angles [ -20 °,20 °]Determining the maximum absolute value of the slope to be 0.36, so taking kThr=0.40;
2)gThr: the maximum value of the head-to-tail numerical distance of reading windows of all the service dials is 150 pixels, so g is takenThr=155;
3)gOpmin: get gOpmin=0.35×gThr=54;
4)gOpmax: get gOpmax=0.75×gThr=116;
5)dThr: Δ d is 4, so take dThr=1.5×Δd=6;
6)gThrmin: the minimum value of the adjacent digital spacing is 16 pixels, so g is takenThrmin=15;
7)gThrmax: maximum value of adjacent digit spacing24 pixels, so take gThrmax=25;
8)σThr: Δ d is 4, so take σThr=1.2×Δd=4.8。
Fig. 3a shows a frame of 5-digit digital water meter photo shot by the camera direct-reading meter reading instrument, and fig. 3b shows all digital points and coordinates thereof obtained by front-end image recognition, wherein "o" represents a normal number, and "x" represents an abnormal number. The actual processing of the method of the invention in this embodiment is described below (the relevant numerical points and lines are marked as shown in fig. 3 c):
1) a digit pair index table P and a candidate index table P' are generated. Since 18 digits are recognized in total, the index table P has the index number of the digit pairs of
Figure BDA0002980466600000141
The candidate index table P' is initially an empty table;
2) selecting digital pairs in P in sequence, solving the absolute value | k | and the distance g of the slope of the connecting line of two points, judging whether | k | is greater than 0.40 or g >155, and repeating the process if the absolute value | k | is greater than 0.40 or g > 155;
3) the two points that do not satisfy the condition in 2) first selected in this embodiment are a1(110,208) and a2(131,203), but the distance g between these two points is 21.6 and is not located at the optimal distance [54,116], so that the two points belong to the middle-reliability number pair and are placed in P', and the iteration is not executed once, and the procedure returns to step 2);
4) the two points which do not satisfy the condition in 2) selected next in this example are B1(123,113) and B2(208,106), and the distance g between these two points is 85.3, which is located at the optimum distance [54,116]]So, iteration is performed: fitting a straight line as the red line in FIG. 3c, and finding the distance d from all points to the straight lineiStatistic satisfies di<The number of elements of 6 is 3, and the condition of being more than or equal to 5 is not met, so the algorithm negates the assumption that B1 and B2 are normal number pairs, and returns to the step 2);
5) the two points not satisfying the condition in 2) selected again in this embodiment are a2(131,203) and a5(190,183), and the two-point distance g is 62.3, which is at the optimum distance [54,116]]So, iteration is performed: fitting a straight line such as the blue line in FIG. 3c, and finding the distance d from all points to the straight lineiStatistic satisfies di<The number of elements of 6 is 7(A1/A2/A3/A4/A5/B3/B4), and the condition that the number is more than or equal to 5 is met, so the algorithm determines that A2 and A5 are normal digital pairs, and 7 points are counted by the residual A1/A2/A3/A4/A5/B3/B4 after abnormal point elimination;
6) performing four-interval sliding window analysis, wherein the initial sliding window is composed of 5 points calculated by B3/A1/A2/A3/A4, the intervals are 33.1,21.6,21.2 and 20.6 from left to right respectively, and the mean value is
Figure BDA0002980466600000151
24.1, and a standard deviation σ of 6.0, which is not satisfied
Figure BDA0002980466600000152
Is located in [15,25 ]]And sigma<4.8, so the algorithm negates the B3/A1/A2/A3/A4 to form the normal digital permutation, requiring a sliding window shift. The new sliding window is formed by 5 points of A1/A2/A3/A4/A5, the intervals are 21.6,21.2,20.6 and 20.6 respectively from left to right, and the mean value is
Figure BDA0002980466600000153
21.0 and a standard deviation sigma of 0.5, satisfies
Figure BDA0002980466600000154
Is located in [15,25 ]]And sigma<4.8, so the algorithm assumes that A1/A2/A3/A4/A5 form a normal digital arrangement;
7) at this time, the number of the window pitches was 4 and the remaining point (B4) was left on the right, and the pitch g between A5(190,183) and B4(244,172) was calculatedrightIs 55.1, and is not located in [21.0-4.8,21.0+4.8 ]]So the algorithm negates B4 as the normal digit point. The final algorithm considers A1/A2/A3/A4/A5 which forms the current sliding window to be the final normal number, and the rest numbers are abnormal numbers and are removed.
The actual processing of the method of the invention in this embodiment is now complete. In the embodiment, 2 iterations and a plurality of times of digital pair credibility judgment are carried out, the calculation amount of the algorithm is small, and the operation speed is high. After longitudinal abnormal number rejection, two abnormal points B3 and B4 still exist, and the abnormal points are accurately rejected by using an adaptive sliding window analysis method. It should be noted that, in this embodiment, an example of a case with a large number of abnormal numbers is illustrated, and the proportion of the abnormal numbers is as high as 72.2%, which is much higher than the proportion of the abnormal numbers in the front-end image recognition result of the camera direct-reading meter. Therefore, the method can be deduced that the method has almost 100% of accuracy in eliminating the abnormal numbers of the actual camera direct-reading meter reading instrument, has high running speed and can completely meet the application requirements of industrial occasions.
The above description is only an example of the specific implementation form of the present invention, and it should be noted that the protection scope of the present invention is not limited to the specific form set forth in the present embodiment, and equivalent technical means or several modified techniques which can be conceived under the principle of the inventive concept also belong to the protection scope of the present invention.

Claims (3)

1. A shooting direct-reading meter reading instrument abnormal point eliminating method based on improved RANSAC is characterized in that: the method comprises the following steps:
step 1: inputting a digit point set S and algorithm parameters, and generating a digit pair index table P and a candidate index table P'; the digital point set S is all digital points and coordinates thereof obtained by front-end image recognition, and comprises 5-8 normal digits and a plurality of mistakenly recognized abnormal digits;
step 2: searching whether the P contains the remaining number pairs to be selected; if yes, selecting a group of digital pairs in sequence, solving the absolute value | k | and the distance g of the slope of the connecting line of the two points, and executing in sequence; if not, jumping to step 6;
and step 3: determining whether | k ¬ is satisfied>kThrOr g>gThr(ii) a If not, executing in sequence; otherwise, deleting the digit pair in the P and jumping to the step 2;
and 4, step 4: judging whether g e [ g ] is satisfiedOpmin,gOpmax](ii) a If yes, sequentially executing; otherwise, supplementing the digit pair to P', and jumping to the step 2;
and 5: fitting the number to a straight line, and calculating the distance d from all points to the straight lineiStatistic satisfies di<dThrThe number of elements (c): if the current value is more than or equal to 5, jumping to the step 8; otherwise, deleting the digit pair in the P and jumping to the step 2;
step 6: searching whether the P' contains the remaining number pairs to be selected; if yes, selecting a group of digital pairs in sequence and executing in sequence; otherwise, the process is abnormally ended, and the S is judged not to contain all normal characters;
and 7: fitting the number to a straight line, and calculating the distance d from all points to the straight lineiStatistic satisfies di<dThrThe number of elements (c): if the number is more than or equal to 5, sequentially executing; otherwise, deleting the number pair in the P' and jumping to the step 6;
and 8: deleting d in step 5 or step 7i≥dThrAll corresponding points are calculated, and the distance g between the rest points from left to right is calculatedi
And step 9: four-interval sliding window analysis of adjacent five points is carried out, and 4 g are calculatediAverage value of (2)
Figure FDA0002980466590000021
And standard deviation σgAnd judging whether or not the conditions are satisfied
Figure FDA0002980466590000022
And sigmagThr: if yes, jumping to step 11; otherwise, executing in sequence;
step 10: judging whether the right side of the sliding window has residual points: if yes, the sliding window is shifted to the right by one bit, and the step 9 is skipped; otherwise, the process is abnormally ended, and the S is judged not to contain all normal characters;
step 11: judging whether the number of the sliding window intervals is less than or equal to 6 and whether the left points are on the right side; if yes, calculating the distance g between the right adjacent point and the rightmost point of the sliding windowrightAnd are executed sequentially; otherwise, jumping to step 13;
step 12: judging whether the requirements are met
Figure FDA0002980466590000023
If yes, the right adjacent point is counted as a normal point, the distance number of the sliding windows is increased by one, and the step 11 is skipped; otherwise, executing in sequence;
step 13: outputting a digital point set S 'formed by the current sliding window, wherein the digital points in the S' are all normal digital points from which abnormal digital points are removed; the process ends normally.
2. The method for eliminating abnormal points of camera shooting direct-reading meter reading instrument based on improved RANSAC as claimed in claim 1, wherein: the algorithm parameters in step 1 are as follows:
1)kThr: a digital pair connection line slope absolute value threshold; the value is determined according to the inclination angle of a reading window allowed by the actual camera shooting direct-reading meter reading instrument, and the value is larger than the absolute value of the slope corresponding to the maximum inclination angle;
2)gThr: a digit pair spacing threshold; the numerical value is determined according to the head-to-tail numerical distance of reading windows of all dials served by the actual camera direct-reading meter reading instrument, and the value is larger than the maximum value of the distance;
3)gOpmin: a digital pair optimal spacing lower threshold; take 0.3gThr~0.4gThr
4)gOpmax: the upper threshold value of the optimal distance of the digital pair; take 0.7gThr~0.8gThr
5)dThr: a distance threshold value between the normal point and the fitted straight line; the numerical value is determined according to the distance error of the coordinate estimation of the actual shooting direct-reading meter for the normal number deviating from the central point of the digital frame, and if the error is +/-delta d, d isThrTaking 1 delta d-2 delta d;
6)gThrmin: a lower threshold for adjacent digit spacing; the numerical value is determined according to the minimum distance between adjacent numbers of reading windows of all dials served by the actual camera shooting direct reading meter, and the value is smaller than the distance;
7)gThrmax: an upper threshold value of adjacent digit spacing; the numerical value is determined according to the maximum distance between adjacent numbers of reading windows of all dials served by the actual camera shooting direct reading meter, and the numerical value is usually slightly larger than the distance;
8)σThr: a sliding window spacing standard deviation threshold; the numerical value is determined according to the distance error of the coordinate estimation of the actual shooting direct reading meter for the normal number deviating from the central point of the digital frame, and if the error is +/-delta d, sigma isThrUsually, 1. delta. d to 1.5. delta. d is used.
3. The method for eliminating abnormal points of camera shooting direct-reading meter reading instrument based on improved RANSAC as claimed in claim 1, wherein: the index table P in step 1 refers to the number pair indexes corresponding to all the double-digit combinations of the digit point set S, and if there are N digits in S, the number of the digit pair indexes in P is
Figure FDA0002980466590000031
The candidate index table P' is initially an empty table to be used by the algorithm to store index pairs having a spacing less than a threshold but not the optimal spacing.
CN202110285939.7A 2021-03-17 Method for eliminating abnormal points of camera direct-reading meter reading instrument based on improved RANSAC Active CN113076945B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110285939.7A CN113076945B (en) 2021-03-17 Method for eliminating abnormal points of camera direct-reading meter reading instrument based on improved RANSAC

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110285939.7A CN113076945B (en) 2021-03-17 Method for eliminating abnormal points of camera direct-reading meter reading instrument based on improved RANSAC

Publications (2)

Publication Number Publication Date
CN113076945A true CN113076945A (en) 2021-07-06
CN113076945B CN113076945B (en) 2024-05-14

Family

ID=

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103337064A (en) * 2013-04-28 2013-10-02 四川大学 Method for removing mismatching point in image stereo matching
WO2018018788A1 (en) * 2016-07-29 2018-02-01 深圳友讯达科技股份有限公司 Image recognition-based meter reading apparatus and method thereof
CN108124487A (en) * 2017-12-22 2018-06-05 深圳前海达闼云端智能科技有限公司 cloud meter reading method and device
CN108549894A (en) * 2018-04-03 2018-09-18 哈尔滨哈船智控科技有限责任公司 A kind of shipping depth gauge image automatic reading method based on deep learning algorithm
CN110458230A (en) * 2019-08-12 2019-11-15 江苏方天电力技术有限公司 A kind of distribution transforming based on the fusion of more criterions is with adopting data exception discriminating method
CN112257803A (en) * 2020-10-30 2021-01-22 青岛东软载波科技股份有限公司 Intelligent analysis method and system for transformer area faults

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103337064A (en) * 2013-04-28 2013-10-02 四川大学 Method for removing mismatching point in image stereo matching
WO2018018788A1 (en) * 2016-07-29 2018-02-01 深圳友讯达科技股份有限公司 Image recognition-based meter reading apparatus and method thereof
CN108124487A (en) * 2017-12-22 2018-06-05 深圳前海达闼云端智能科技有限公司 cloud meter reading method and device
CN108549894A (en) * 2018-04-03 2018-09-18 哈尔滨哈船智控科技有限责任公司 A kind of shipping depth gauge image automatic reading method based on deep learning algorithm
CN110458230A (en) * 2019-08-12 2019-11-15 江苏方天电力技术有限公司 A kind of distribution transforming based on the fusion of more criterions is with adopting data exception discriminating method
CN112257803A (en) * 2020-10-30 2021-01-22 青岛东软载波科技股份有限公司 Intelligent analysis method and system for transformer area faults

Similar Documents

Publication Publication Date Title
US11900634B2 (en) Method for adaptively detecting chessboard sub-pixel level corner points
US10311322B2 (en) Character information recognition method based on image processing
CN110580480A (en) Meter reading identification method based on image processing
CN110599539B (en) Stripe center extraction method of structured light stripe image
CN109325510B (en) Image feature point matching method based on grid statistics
CN111784093B (en) Enterprise reworking auxiliary judging method based on power big data analysis
CN109190625A (en) A kind of container number identification method of wide-angle perspective distortion
CN105115573A (en) Correction method and device for flood flow forecasting
CN109559334A (en) Lane line method for tracing based on Kalman filter
CN107193782A (en) A kind of method of abnormal value removing and correction fitted based on multinomial
CN113076945A (en) Camera direct-reading meter reading instrument abnormal point removing method based on improved RANSAC
CN113076945B (en) Method for eliminating abnormal points of camera direct-reading meter reading instrument based on improved RANSAC
CN116823820B (en) Aluminum-carbon integral stopper rod contour bending detection method
CN112101468B (en) Method for judging abnormal sequence in sequence combination
CN114935388B (en) Correction method implemented by correction system based on ultrasonic gas meter
CN109145258A (en) Weibull distribution parameter confidence interval estimation method based on nonlinear fitting
CN106814608B (en) Predictive control adaptive filtering algorithm based on posterior probability distribution
CN115496893A (en) Pointer type water meter reading identification method
CN106778915A (en) A kind of target matching method towards multiple-camera
CN113936003A (en) Door and window manufacturing quality detection method
CN106777913A (en) The new method that a kind of approximate entropy and Sample Entropy common optimized parameter m, r determine
CN108898632B (en) Method and device for determining rotation angle of instrument pointer
CN105894000A (en) RANSAC-based laser network mark image feature extraction
CN108154501B (en) Spiral blade image segmentation quality self-adaptive evaluation method based on gray distribution
CN113658264B (en) Single image camera focal length estimation method based on distance information

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