CN117058390B - High-robustness circular pointer type dial plate image state segmentation method - Google Patents

High-robustness circular pointer type dial plate image state segmentation method Download PDF

Info

Publication number
CN117058390B
CN117058390B CN202311089010.2A CN202311089010A CN117058390B CN 117058390 B CN117058390 B CN 117058390B CN 202311089010 A CN202311089010 A CN 202311089010A CN 117058390 B CN117058390 B CN 117058390B
Authority
CN
China
Prior art keywords
connected domain
pointer
dial
point
image
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202311089010.2A
Other languages
Chinese (zh)
Other versions
CN117058390A (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.)
Beihang University
Original Assignee
Beihang University
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 Beihang University filed Critical Beihang University
Priority to CN202311089010.2A priority Critical patent/CN117058390B/en
Publication of CN117058390A publication Critical patent/CN117058390A/en
Application granted granted Critical
Publication of CN117058390B publication Critical patent/CN117058390B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • G06V10/26Segmentation of patterns in the image field; Cutting or merging of image elements to establish the pattern region, e.g. clustering-based techniques; Detection of occlusion
    • G06V10/267Segmentation of patterns in the image field; Cutting or merging of image elements to establish the pattern region, e.g. clustering-based techniques; Detection of occlusion by performing operations on regions, e.g. growing, shrinking or watersheds
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/187Segmentation; Edge detection involving region growing; involving region merging; involving connected component labelling
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/60Analysis of geometric attributes
    • G06T7/62Analysis of geometric attributes of area, perimeter, diameter or volume
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/60Analysis of geometric attributes
    • G06T7/66Analysis of geometric attributes of image moments or centre of gravity
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • G06V10/24Aligning, centring, orientation detection or correction of the image
    • G06V10/242Aligning, centring, orientation detection or correction of the image by image rotation, e.g. by 90 degrees
    • 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/762Arrangements for image or video recognition or understanding using pattern recognition or machine learning using clustering, e.g. of similar faces in social networks
    • G06V10/763Non-hierarchical techniques, e.g. based on statistics of modelling distributions
    • 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/764Arrangements for image or video recognition or understanding using pattern recognition or machine learning using classification, e.g. of video objects
    • 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
    • G06V30/14Image acquisition
    • G06V30/148Segmentation of character regions
    • G06V30/15Cutting or merging image elements, e.g. region growing, watershed or clustering-based techniques
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20112Image segmentation details
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V2201/00Indexing scheme relating to image or video recognition or understanding
    • G06V2201/02Recognising information on displays, dials, clocks

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Multimedia (AREA)
  • Software Systems (AREA)
  • Computing Systems (AREA)
  • Artificial Intelligence (AREA)
  • Databases & Information Systems (AREA)
  • Evolutionary Computation (AREA)
  • General Health & Medical Sciences (AREA)
  • Medical Informatics (AREA)
  • Health & Medical Sciences (AREA)
  • Geometry (AREA)
  • Probability & Statistics with Applications (AREA)
  • Image Processing (AREA)
  • Image Analysis (AREA)

Abstract

The invention discloses a high-robustness circular pointer type dial plate image state segmentation method. For the pointer type dial, dial preprocessing and dial segmentation are utilized, and finally, dial circle center coordinates, dial pointers, scale mark communication areas and pointer indications are obtained as the image state segmentation results of the circular pointer type dial, so that the image state segmentation of the circular pointer type dial is completed; finally, the method can be used for the identification of the subsequent dial numbers and the reading of pointer readings. The invention breaks through the limitation of the mainstream image segmentation or detection algorithm based on the deep learning on the computational power, is realized based on the traditional image processing, and has stronger robustness and processing speed.

Description

High-robustness circular pointer type dial plate image state segmentation method
Technical Field
The invention relates to the field of image processing, in particular to a high-robustness circular pointer dial image state segmentation method.
Background
For pointer indication recognition of a pointer dial, the method of depth image segmentation, object detection and OCR recognition is generally adopted directly for processing. However, for the pointer type dial plate, the method has various forms, complex prospects, time and labor waste for data set production, and meanwhile, a method based on deep learning is adopted, so that on one hand, the hardware resource requirement is high, the reasoning speed is low, and on the other hand, the segmentation of the pointer type dial plate is difficult to finish tasks on various dial plates due to various scene forms and poor generalization capability.
Disclosure of Invention
The invention aims to overcome the defects of the prior art, and provides a high-robustness circular pointer type dial image state segmentation method which can realize automatic segmentation and extraction of circular pointer type dial readings and can obtain a very robust effect under various scenes and dial scenes.
The aim of the invention is realized by the following technical scheme: a high-robustness circular pointer dial image state segmentation method comprises the following steps:
S1, giving a round pointer dial, separating multiple channels, performing local self-adaptive binarization, and performing logical OR operation on a binarization result to obtain a binarization chart;
s2, carrying out connected domain detection on the binarization map, and carrying out preliminary screening on the binarization map according to the connected domain area by utilizing a first-order difference to preliminarily obtain a scale line connected domain set containing noise connected domains;
s3, performing least square fitting on the obtained connected domains, obtaining a direction vector of each connected domain, and solving intersection points of all the connected domains;
S4, clustering the acquired intersection points of the connected domains by using a KPCA and GMM algorithm to acquire two categories of the connected domains, selecting the cluster with the smallest variance as a circle center cluster, and calculating circle center coordinates;
S5, acquiring a connected domain where the pointer is located by using a vector outer product formula, and completing pointer segmentation;
S6, calculating the radius of the primary screening connected domain by using periodic compression, and screening according to the radius by using first-order difference to obtain a connected domain set of the final scale mark;
S7, expanding by utilizing the polar coordinates to obtain an expanded circular dial, calculating polar coordinate transformation coordinates of two scale marks closest to the pointer in the clockwise direction and the anticlockwise direction, and combining the expanded image coordinates with the ROI according to affine transformation to finish final pointer registration positioning.
Further, the step S1 includes:
For an input pointer dial, setting a foreground of the pointer dial to comprise scale marks, scale values and pointer parts; three-channel separation is carried out on an input image, local self-adaptive binarization is carried out on each channel, and then logic OR operation is carried out on the binarization result to obtain an output binarization image:
binary=Ad(R)∨Ad(G)∨Ad(B)
Wherein v represents "logical OR", ad represents adaptive binarization operation, and is mainly influenced by window size parameter blockSize in local adaptive binarization and constant parameter for window mean subtraction. By adjusting bloackSize, the foreground extraction capacity of the algorithm can be adjusted, the smaller blockSize is, the larger the local cavity effect is, and the stronger the foreground extraction capacity is, but the weaker the locality is; by adjusting the constant parameter, the background inhibition capability of the algorithm can be adjusted, and the smaller the constant is, the stronger the background inhibition capability is, otherwise, the easier the front background adhesion condition is.
Further, the step S2 includes:
Detecting connected domains of the binarized image obtained through processing to obtain a plurality of connected domains;
Numbering each connected domain, and obtaining the circumscribed rectangular state and centroid parameters of each connected domain as the serial number of the connected domain; the circumscribed matrix state includes: the length and the width of the connected outer joint matrix and the included angle relative to the horizontal direction; the centroid parameter refers to the coordinates of the centroid of the connected domain in an image coordinate system;
assuming that n connected domains are detected in total, the areas thereof are arranged in descending order to obtain a group of sequence examples The connected domain with the area of A k is marked as C k, the set window length is w, the area threshold is T A, and then the goal of the first order difference is to find a group of continuous subsequences with adjacent area difference values smaller than the threshold and the length at least being the set window length, namely, the following is satisfied:
The subsequences meeting the conditions and appearing in the first group are used as the smooth subsequences of the connected domain of the preliminary screening, and the connected domain corresponding to the smooth subsequences is expressed as a set C, namely:
C={Ca,Ca+1,...,Cb}
Since the connected domain of the preliminary sieve contains background or noise, set C is denoted as:
where T represents a set of scale line connected domains and B represents a set of background or noise connected domains.
Preferably, before sorting the connected domain areas, background noise which obviously does not accord with the scale mark or pointer characteristic can be artificially removed for each detected connected domain;
further, the step S3 includes:
Aiming at the connected domain C obtained by the primary screening, the scale marks of the pointer dial point to the circle center, and firstly, the least square method is utilized to carry out straight line fitting on all the connected domains of the connected domain C, so as to obtain the direction vector of each connected domain;
For any two-direction vector, the slope k 1,k2 is known to be equal to two points (x 1,y1),(x2,y2) on the straight line, and the intersection point of the two straight lines is obtained by using the sloping section:
The intersection set obtained at this time includes intersection points of the connected domain fitting straight lines in the set T, and intersection points of the connected domain fitting straight lines between the set T and the set B and between the set B and the set B, and these intersection points are classified as noise points, and the intersection point set can be expressed as:
Wherein I circle represents the intersection point set, I C represents the intersection point set of the circle center cluster, and I E represents the irrelevant intersection point set, namely the noise point.
Further, the step S4 includes: for the obtained intersection point set, firstly, the intersection point set is mapped to an infinite dimension space by using a KPCA algorithm, and the dimension is reduced to a three-dimensional space:
wherein X represents input data, K represents a predetermined kernel function matrix, Representing a centralized kernel function matrix, wherein 1 N represents an N-dimensional column vector, and the elements are all 1; /(I)Representing a centralized nonlinear mapping function for mapping input data to an infinite dimensional space and then projecting in the direction of the a-th principal component direction vector p a;
t a denotes that the input data X is in Projection vectors on the a-th principal component, lambda aa respectively represent kernel function matrix/>The eigenvalue and eigenvector of the a-th principal component direction after eigenvalue decomposition, p a represents/>A direction vector in the a-th principal component direction;
the intersection set I contains N two-dimensional data, the intersection set I is expressed as an N multiplied by 2 matrix X N×2, and X N×2 is utilized to centralize nonlinear mapping functions when a=1, 2 and 3 After mapping, projection is carried out on the three principal component directions of p 1,p2,p3 to obtain an Nx 3 matrix X N×3;
Taking the nth row in the N multiplied by 3 matrix X N×3 as the nth sample point X n, performing data distribution fitting on the nth sample point X n in a three-dimensional feature space by using a Gaussian mixture model GMM algorithm, and obtaining a probability density function p (X n):
G represents the number of Gaussian components used for fitting, pi g represents the prior probability of the G-th Gaussian component, μ g,∑g represents the mean and variance of the G-th Gaussian component, Representing a conditional probability of generating data x n given a g-th gaussian component;
At n=1, 2,., N, respectively calculating the corresponding probability density functions p (x n);
For the input data X N×3 of N sample points, the log likelihood function of the probability density function is obtained as:
Solving the unknown variable pi gg,∑g in the above equation by using maximum likelihood estimation, and obtaining a contribution value gamma ng of the g-th Gaussian component to the generation of the n-th sample point x n:
And (3) carrying out iterative solution on all parameters pi gg,∑gng by using an EM algorithm until the log-likelihood function converges (the error of two adjacent iterations is smaller than a set threshold value, which is generally a very small positive number), thus completing the training of the GMM algorithm.
Selecting g=2, training and parameter solving the three-dimensional data after dimension reduction by using two gaussian components, and calculating KPCA three-dimensional representation data x n of each sample in a set I by using a trained GMM model in a prediction stage to obtain a contribution value gamma ng of each gaussian component G to the data point, wherein the gaussian component with the largest value is used as a classification label of the sample;
Dividing the set I into two types of data sets by using two types of label pairs;
And finally, calculating the variance of the two types of collection data points, wherein the collection with smaller variance is the circle center cluster, and taking the average value to obtain the circle center position.
Further, after the circle center coordinates are obtained, finding out the connected domain where the pointer is located in the connected domain set C according to the position of the circle center, and three conditions need to be satisfied:
First, the pointer is closest to the center: for each connected domain, selecting the nearest corner point of the connected domain and the central point of the dial plate and the circle center to form a vector v 1, and meeting the requirement of the condition, the smaller the modulus |v 1 | is, the better the condition is;
secondly, the included angle between the vector |v 1 | and the vector v 2 formed by the center of the circle and the centroid of the connected domain is the smallest, namely the vector diameter formed by the center of the circle and the centroid of the connected domain is required to be perpendicular to the short side of the smallest circumscribed rectangle of the connected domain as much as possible, and if the included angle is theta, the included angle is equivalent to enabling sin theta to be the smallest, and meanwhile, even if the center point falls between the intersection point of the connected domain and the centroid, the theta is an obtuse angle, the larger the angle can still be ensured, and the smaller the value is;
thirdly, the connecting area is the longest and the smallest long side l of the circumscribed rectangle.
When the target value is expressed as t, the above relation can be expressed as t to v 1, sin theta,The above relation is expressed as:
traversing each connected domain, calculating according to the above formula, and selecting the connected domain with the smallest value as the connected domain where the pointer is located;
And refining the pointer by using ZhangSuen refining algorithm, and then fitting by using least square method to obtain the pointing direction of the pointer.
Further, after the circle center is acquired, for all the connected domains in the primary screening set C, the rotation angle θ of the external rectangle inclination angle phi and the positive x-axis direction of the connecting line of the scale line center and the disc center is acquired, and the four quadrants are discussed as follows: the relation between the rotation angle of a certain scale line of the first quadrant around the center of the disc and the inclination angle is transformed into:
φ→φ+90°→φ+180°→φ+270°
If the center point of the disk is set as (o x,oy) in the image coordinate system, any point (x ', y') in the image coordinate system can be transformed into a rectangular coordinate system with the center of the disk as the origin of coordinates, assuming that the coordinates are (x, y). The transformation matrix from image coordinates to polar coordinates can be expressed as:
Where ρ represents the disk radius. And (3) performing periodic compression on the expression by using a double-angle formula to obtain a periodic compression transformation formula:
And (2) calculating the radiuses of all the connected domains in the set C by the formula, and adopting the first-order difference method which is the same as that in the step (S2), namely, finding a group of continuous subsequences with adjacent radius difference values smaller than a threshold value and at least the length of a set window length, wherein the connected domain subsequences can be regarded as the final scale line connected domain T.
Further, taking the circle center of the dial as a polar coordinate origin, taking the 3 o 'clock direction as a polar axis, and establishing a 3 o' clock coordinate system X 'Y' by taking the anticlockwise direction as a rotation direction; meanwhile, taking the circle center of the dial as a polar coordinate origin, taking the 6 o 'clock direction as a polar axis, and taking the clockwise direction as a rotation direction to establish a 6 o' clock coordinate system XY; setting an image coordinate system as X 'Y';
Given any point (X ', Y') in the image coordinate system, the next point (ρ ", θ") in the dial 6 o 'clock clockwise polar coordinate system X "Y", the counterclockwise rotation angle α of the dial 3 o' clock to 6 o 'clock can be established, the transformation matrix from the 6 o' clock coordinate to the image coordinate system is:
(o x,oy) is the coordinates of the disk center point on the image coordinate system. Expanding the circle center dial of the polar coordinate into a straight ruler-shaped image coordinate by utilizing the coordinate transformation;
After the polar coordinate expansion diagram is obtained, the digital connected domain nearby the polar coordinate expansion diagram is searched according to the position of the initial scale in the expansion diagram, and due to the fact that polar coordinate transformation, the circumscribed rectangles of the numbers have intersection in the vertical direction or are very compact in the horizontal direction, and the digital connected domain nearby the scale line can be obtained through vertical and horizontal distance screening;
taking each digital connected domain as an ROI, dividing the numbers for each ROI for subsequent digital identification, firstly rotating each inclined ROI according to the center of the inclined ROI to enable the inclined ROI to be changed into a horizontal ROI, and correspondingly converting the image into a matrix:
Wherein (x, y) represents an arbitrary point in the image coordinate system, and (x ', y') represents a point after affine transformation, at which time a horizontal ROI is obtained;
After affine transformation, truncated different parts of numbers appear, but as the numbers are intersected in the vertical direction, the numbers are combined in the vertical direction by the connected domain, the left and right boundaries of the numbers are found out, the numbers are intercepted, and pointer indication positioning is completed.
Finally, dividing the circle center coordinates of the dial plate obtained in the step S4, dial pointers obtained in the step S5, scale line connected areas obtained in the step S6, and pointer indications obtained in the step S7 as dividing results, namely finishing image state division of the circular pointer type dial plate;
the beneficial effects of the invention are as follows:
(1) By utilizing the traditional digital image processing, the lazy property of the data set based on the deep learning method is avoided, so that the time and labor cost for labeling a large number of data sets are avoided;
(2) Based on the digital image processing technology, the method has small calculation resource dependence and can be used for monitoring scenes by a pointer instrument in real time;
(3) The whole algorithm scheme has few adjustable parameters, and is very easy to adjust related parameters in an actual scene, so that the generalization performance and the robustness of the algorithm are ensured.
Drawings
FIG. 1 is a flow chart of the present invention;
FIG. 2 is a schematic diagram of an image to be segmented;
FIG. 3 is a segmentation result of an image;
FIG. 4 shows the polar expansion of the dial and the pointer indication positioning result;
fig. 5 is the result of affine transformation of positioning numbers.
Detailed Description
The technical solution of the present invention will be described in further detail with reference to the accompanying drawings, but the scope of the present invention is not limited to the following description.
Further details will be described below with reference to the drawings and examples. As shown in fig. 1, a flow chart of the present solution is shown. First, an input image is given, as shown in fig. 2, which is an example of a circular pointer type dial. For an input image, which is a three-channel RGB image, firstly, carrying out three-channel separation on the image, and carrying out local self-adaptive binarization on each separated channel by using a window blockSize which is 9; meanwhile, a threshold value threshC of-16 is used for subtracting the average value of pixels in the block, so that the background is conveniently restrained. And after the three channels are subjected to local binarization, taking OR operation on the three channels to obtain a final binarized image.
For the extracted binarized image, firstly, detecting connected domains, marking serial numbers on each connected domain, and screening out the background and noise which obviously do not accord with the scale mark or pointer characteristic through specific screening conditions. And (3) performing primary screening on the screened connected domains by utilizing first-order difference, and preliminarily obtaining a connected domain set of the scale marks.
In this case, the connected domain also includes related interfering connected domains, and in order to determine the center of the circle, it is first required to determine the intersection point of all connected domains. Fitting the connected domains of the primary screen by least square fitting, obtaining direction vectors of all the connected domains, and solving intersection points among all the connected domains by using the oblique section for all the direction vectors. The intersection points obtained at this time include circle center clusters around the circle center, and stray intersection points brought by the interfering connected domain. The data are mapped to a high-dimensional space by using KPCA, then the data are subjected to dimension reduction in the high-dimensional space and dimension reduction to a 3-dimensional space, the data are approximately linearly separable at the moment, clustering is performed in the three-dimensional space by using a Gaussian mixture model GMM, all points are divided into two types, and prediction is performed by using a trained Gaussian mixture model to obtain two final clusters. And selecting the cluster with smaller variance as a circle center cluster, and taking the average value of all coordinates as the circle center.
After the circle center is acquired, all the connected domains can be traversed, the outer product value of all the connected domains is calculated by using a vector outer product formula, and the smallest connected domain is taken as the pointer connected domain.
Meanwhile, in order to fully utilize the information between the rotation angle and the coordinate value of the scale mark, the radius of each primary screen communicating domain relative to the center of the dial plate is calculated by using a periodic compression formula, and the final scale mark communicating domain can be screened out by using a first-order difference formula, as shown in fig. 3.
After the radius of the dial is obtained, the polar coordinates of the dial can be unfolded, the dial is unfolded to be in a bar-shaped ruler shape from the 6 o' clock direction of the dial by utilizing a coordinate transformation formula, and at the moment, scale line numbers from the center to two sides can incline to different degrees as shown in fig. 4. The two nearest connected domains on the left and right sides of the pointer are taken, and the final horizontal scale value can be segmented by utilizing ROI merging and affine transformation, as shown in fig. 5, so that the subsequent digital segmentation and recognition processing are facilitated.
While the algorithm of the present invention has been described in terms of preferred embodiments, it will be apparent to those skilled in the art from this disclosure that the method and process described herein can be modified or recombined to achieve the final manufacturing techniques without departing from the spirit and scope of the invention. It is expressly intended that all such similar substitutes and modifications apparent to those skilled in the art are deemed to be included within the spirit, scope and content of the invention.

Claims (6)

1. A high-robustness circular pointer dial image state segmentation method is characterized in that: the method comprises the following steps:
S1, giving a round pointer dial, separating multiple channels, performing local self-adaptive binarization, and performing logical OR operation on a binarization result to obtain a binarization chart;
s2, carrying out connected domain detection on the binarization map, and carrying out preliminary screening on the binarization map according to the connected domain area by utilizing a first-order difference to preliminarily obtain a scale line connected domain set containing noise connected domains;
s3, performing least square fitting on the obtained connected domains, obtaining a direction vector of each connected domain, and solving intersection points of all the connected domains;
S4, clustering the acquired intersection points of the connected domains by using a KPCA and GMM algorithm to acquire two categories of the connected domains, selecting the cluster with the smallest variance as a circle center cluster, and calculating circle center coordinates;
s5, acquiring a connected domain where the pointer is located by using a vector outer product formula, completing pointer segmentation, and acquiring pointer pointing;
After the circle center coordinates are obtained, finding out the connected domain where the pointer is located in the connected domain set C according to the position of the circle center, and three conditions are required to be met:
First, the pointer is closest to the center: for each connected domain, selecting the nearest corner point of the connected domain and the central point of the dial plate and the circle center to form a vector v 1, and meeting the requirement of the condition, the smaller the modulus |v 1 | is, the better the condition is;
secondly, the included angle between the vector |v 1 | and the vector v 2 formed by the center of the circle and the centroid of the connected domain is the smallest, namely the vector diameter formed by the center of the circle and the centroid of the connected domain is required to be perpendicular to the short side of the smallest circumscribed rectangle of the connected domain as much as possible, and if the included angle is theta, the included angle is equivalent to enabling sin theta to be the smallest, and meanwhile, even if the center point falls between the intersection point of the connected domain and the centroid, the theta is an obtuse angle, the larger the angle can still be ensured, and the smaller the value is;
thirdly, the long side l of the rectangle with the smallest external connection of the communication domain is longest;
the target value is expressed as t, and then expressed as according to the above three conditions Expressed according to the vector outer product relationship as:
traversing each connected domain, calculating according to the above formula, and selecting the connected domain with the smallest value as the connected domain where the pointer is located;
Firstly refining the pointer by using ZhangSuen refining algorithm, and then fitting by using least square method to obtain the pointing direction of the pointer;
S6, calculating the radius of the primary screening connected domain by using periodic compression, and screening according to the radius by using first-order difference to obtain a connected domain set of the final scale mark;
the step S6 includes: after the circle center is acquired, for all the connected domains in the primary screening set C, acquiring the rotation angle theta of the external rectangle inclination angle phi and the positive direction of the X-axis relative to the connecting line of the scale line center and the disc center, and discussing four quadrants: the relation between the rotation angle of a certain scale line of the first quadrant around the center of the disc and the inclination angle is transformed into:
φ→φ+90°→φ+180°→φ+270°
Assuming that the center point of the disk is the point (o x,oy) in the image coordinate system, for any point (x ', y') in the image coordinate system, the coordinate is transformed into a rectangular coordinate system with the center of the disk as the origin of the coordinate, and assuming that the coordinate is (x, y), the transformation matrix from the image coordinate to the polar coordinate is expressed as:
wherein ρ represents the radius of the disc, and the transformation matrix is periodically compressed by using a double-angle formula to obtain a periodic compression transformation formula:
calculating the radiuses of all the connected domains in the set C through the method, and adopting the first-order difference method which is the same as that in the step S2, namely finding a group of continuous subsequences with adjacent radius difference values smaller than a threshold value and the length at least equal to the length of a set window, wherein the connected domain subsequences can be regarded as the final scale line connected domain T;
S7, expanding by utilizing the polar coordinates to obtain an expanded circular dial, calculating polar coordinate transformation coordinates of two scale marks closest to the pointer in the clockwise direction and the anticlockwise direction, and combining the expanded image coordinates with the ROI according to affine transformation to finish final pointer registration positioning.
2. The high-robustness circular pointer type dial image state segmentation method according to claim 1, wherein the method comprises the following steps of: the step S1 includes:
for an input pointer dial, setting a foreground of the pointer dial to comprise scale marks, scale values and pointer parts;
Performing RGB three-channel separation on an input image, performing local self-adaptive binarization on each channel, and performing logical OR operation on a binarization result to obtain an output binarized image binary:
binary=Ad(R)∨Ad(G)∨Ad(B);
ad represents adaptive binarization operations, and the V.sub.v. represents "logical OR".
3. The high-robustness circular pointer type dial image state segmentation method according to claim 1, wherein the method comprises the following steps of: the step S2 includes:
Detecting connected domains of the binarized image obtained through processing to obtain a plurality of connected domains;
Numbering each connected domain, and obtaining the circumscribed rectangular state and centroid parameters of each connected domain as the serial number of the connected domain; the circumscribed matrix state includes: the length and the width of the connected outer joint matrix and the included angle relative to the horizontal direction; the centroid parameter refers to the coordinates of the centroid of the connected domain in an image coordinate system;
assuming that n connected domains are detected in total, the areas thereof are arranged in descending order to obtain a group of sequences The connected domain with the area of A k is marked as C k, the set window length is w, the area threshold is T A, and then the goal of the first order difference is to find a group of continuous subsequences with adjacent area difference values smaller than the threshold and the length at least being the set window length, namely, the following is satisfied:
The subsequences meeting the conditions and appearing in the first group are used as the smooth subsequences of the connected domain of the preliminary screening, and the connected domain corresponding to the smooth subsequences is expressed as a set C, namely:
C={Ca,Ca+1,…,Cb}
Since the connected domain of the preliminary sieve contains background or noise, set C is denoted as:
where T represents a set of scale line connected domains and B represents a set of background or noise connected domains.
4. A method for segmenting the image state of a circular pointer type dial with high robustness according to claim 3, wherein the method comprises the following steps: the step S3 includes:
Aiming at the connected domain C obtained by the primary screening, the scale marks of the pointer dial point to the circle center, and firstly, the least square method is utilized to carry out straight line fitting on all the connected domains of the connected domain C, so as to obtain the direction vector of each connected domain;
For any two-direction vector, the slope k 1,k2 is known to be equal to two points (x 1,y1),(x2,y2) on the straight line, and the intersection point of the two straight lines is obtained by using the sloping section:
y=k1(x-x2)+y1
The intersection set obtained at this time includes intersection points of the connected domain fitting straight lines in the set T, and intersection points of the connected domain fitting straight lines between the set T and the set B and between the set B and the set B, and these intersection points are classified as noise points, and the intersection point set can be expressed as:
Wherein I circle represents the intersection point set, I C represents the intersection point set of the circle center cluster, and I E represents the irrelevant intersection point set, namely the noise point.
5. The high-robustness circular pointer type dial image state segmentation method according to claim 4, wherein the method comprises the following steps of: the step S4 includes: for the obtained intersection point set, firstly, the intersection point set is mapped to an infinite dimension space by using a KPCA algorithm, and the dimension is reduced to a three-dimensional space:
wherein X represents input data, K represents a predetermined kernel function matrix, Representing a centralized kernel function matrix, wherein 1 N represents an N-dimensional column vector, and the elements are all 1; /(I)Representing a centralized nonlinear mapping function for mapping input data to an infinite dimensional space and then projecting in the direction of the a-th principal component direction vector p a;
t a denotes that the input data X is in Projection vectors on the a-th principal component, lambda aa respectively represent kernel function matrix/>The eigenvalue and eigenvector of the a-th principal component direction after eigenvalue decomposition, p a represents/>A direction vector in the a-th principal component direction;
The intersection set I contains N two-dimensional data, the intersection set I is expressed as an N multiplied by 2 matrix X N×2, and X N×2 is utilized to centralize nonlinear mapping functions when a=1, 2 and 3 After mapping, projection is carried out on the three principal component directions of p 1,p2,p3 to obtain an Nx 3 matrix X N×3;
Taking the nth row in the N multiplied by 3 matrix X N×3 as the nth sample point X n, performing data distribution fitting on the nth sample point X n in a three-dimensional feature space by using a Gaussian mixture model GMM algorithm, and obtaining a probability density function p (X n):
G represents the number of Gaussian components used for fitting, pi g represents the prior probability of the G-th Gaussian component, μ gg represents the mean and variance of the G-th Gaussian component, Representing a conditional probability of generating data x n given a g-th gaussian component;
When n=1, 2, …, N, respectively calculating the corresponding probability density function p (x n);
For the input data X N×3 of N sample points, the log likelihood function of the probability density function is obtained as:
Solving the unknown variable pi ggg in the above equation by using maximum likelihood estimation, and obtaining a contribution value gamma ng of the g-th Gaussian component to the generation of the n-th sample point x n:
Carrying out iterative solution on all parameters pi gggng by using an EM algorithm until the log likelihood function converges, thus finishing the training of the GMM algorithm;
selecting g=2, training and parameter solving the three-dimensional data after dimension reduction by using two gaussian components, and calculating KPCA three-dimensional representation data x n of each sample in a set I by using a trained GMM model in a prediction stage to obtain a contribution value gamma ng of each gaussian component G to the data point, wherein the gaussian component with the largest value is used as a classification label of the sample;
Dividing the set I into two types of data sets by using two types of label pairs;
And finally, calculating the variance of the two types of collection data points, wherein the collection with smaller variance is the circle center cluster, and taking the average value to obtain the circle center position.
6. The high-robustness circular pointer type dial image state segmentation method according to claim 1, wherein the method comprises the following steps of: the step S7 includes:
establishing a3 o 'clock coordinate system X' Y 'by taking the circle center of the dial as a polar coordinate origin, the 3 o' clock direction as a polar axis and the anticlockwise direction as a rotation direction; meanwhile, taking the circle center of the dial as a polar coordinate origin, taking the 6 o 'clock direction as a polar axis, and taking the clockwise direction as a rotation direction to establish a 6 o' clock coordinate system XY; setting an image coordinate system as X 'Y';
Given any point (X ,y) in the image coordinate system, the point (ρ ) next to the 6 o 'clock coordinate system X "Y", the counterclockwise rotation angle α from 3 o' clock to 6 o 'clock, a transformation matrix from 6 o' clock coordinates to the image coordinate system can be established as:
(o x,oy) is the coordinates of the center point of the disk on the image coordinate system; expanding the circle center dial of the polar coordinate into a straight ruler-shaped image coordinate by utilizing the coordinate transformation;
After the polar coordinate expansion diagram is obtained, the digital connected domain nearby the polar coordinate expansion diagram is searched according to the position of the initial scale in the expansion diagram, and due to the fact that polar coordinate transformation, the circumscribed rectangles of the numbers have intersection in the vertical direction or are very compact in the horizontal direction, and the digital connected domain nearby the scale line can be obtained through vertical and horizontal distance screening;
taking each digital connected domain as an ROI, dividing the numbers for each ROI for subsequent digital identification, firstly rotating each inclined ROI according to the center of the inclined ROI to enable the inclined ROI to be changed into a horizontal ROI, and correspondingly converting the image into a matrix:
Wherein (x, y) represents an arbitrary point in the image coordinate system, and (x ', y') represents a point after affine transformation, at which time a horizontal ROI is obtained;
After affine transformation, truncated different parts of numbers appear, but as the numbers are intersected in the vertical direction, the numbers are combined in the vertical direction by the connected domain, the left and right boundaries of the numbers are found out, the numbers are intercepted, and pointer indication positioning is completed.
CN202311089010.2A 2023-08-28 2023-08-28 High-robustness circular pointer type dial plate image state segmentation method Active CN117058390B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311089010.2A CN117058390B (en) 2023-08-28 2023-08-28 High-robustness circular pointer type dial plate image state segmentation method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311089010.2A CN117058390B (en) 2023-08-28 2023-08-28 High-robustness circular pointer type dial plate image state segmentation method

Publications (2)

Publication Number Publication Date
CN117058390A CN117058390A (en) 2023-11-14
CN117058390B true CN117058390B (en) 2024-05-14

Family

ID=88667446

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311089010.2A Active CN117058390B (en) 2023-08-28 2023-08-28 High-robustness circular pointer type dial plate image state segmentation method

Country Status (1)

Country Link
CN (1) CN117058390B (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106529519A (en) * 2016-09-19 2017-03-22 国家电网公司 Automatic number identification method and system of power pointer type instrument
CN107240109A (en) * 2017-05-11 2017-10-10 安徽慧视金瞳科技有限公司 A kind of meter dial line position automatic testing method
CN109801308A (en) * 2018-12-28 2019-05-24 西安电子科技大学 The dividing method of adhesion similar round target image
CN113269193A (en) * 2021-06-08 2021-08-17 上海高德威智能交通系统有限公司 Pointer type meter reading method, device and storage medium
WO2022057103A1 (en) * 2020-09-15 2022-03-24 浙江师范大学 Deep-learning-based method for automatically reading pointer instrument
CN114550149A (en) * 2022-02-08 2022-05-27 深圳市铁越电气有限公司 Pointer instrument reading method and system based on deep learning
CN114693705A (en) * 2022-04-08 2022-07-01 安徽农业大学 Method, device and system for reading measured value of pointer instrument
CN115601743A (en) * 2022-12-13 2023-01-13 南京瀚元科技有限公司(Cn) Power distribution room pointer type instrument registration automatic reading identification method

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107133627A (en) * 2017-04-01 2017-09-05 深圳市欢创科技有限公司 Infrared light spot center point extracting method and device

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106529519A (en) * 2016-09-19 2017-03-22 国家电网公司 Automatic number identification method and system of power pointer type instrument
CN107240109A (en) * 2017-05-11 2017-10-10 安徽慧视金瞳科技有限公司 A kind of meter dial line position automatic testing method
CN109801308A (en) * 2018-12-28 2019-05-24 西安电子科技大学 The dividing method of adhesion similar round target image
WO2022057103A1 (en) * 2020-09-15 2022-03-24 浙江师范大学 Deep-learning-based method for automatically reading pointer instrument
CN113269193A (en) * 2021-06-08 2021-08-17 上海高德威智能交通系统有限公司 Pointer type meter reading method, device and storage medium
CN114550149A (en) * 2022-02-08 2022-05-27 深圳市铁越电气有限公司 Pointer instrument reading method and system based on deep learning
CN114693705A (en) * 2022-04-08 2022-07-01 安徽农业大学 Method, device and system for reading measured value of pointer instrument
CN115601743A (en) * 2022-12-13 2023-01-13 南京瀚元科技有限公司(Cn) Power distribution room pointer type instrument registration automatic reading identification method

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
"A pointer location algorithm for computer visionbased automatic reading recognition of pointer gauges";Erlin Tian 等;《Open Physics》;20190405;第17卷(第1期);86-92 *
"基于刻度轮廓拟合的指针式仪表自动识别方法";孙顺远 等;《仪表技术与传感器》;20220831(第8期);51-57 *

Also Published As

Publication number Publication date
CN117058390A (en) 2023-11-14

Similar Documents

Publication Publication Date Title
Li et al. Automatic pavement crack detection by multi-scale image fusion
CN108805904B (en) Moving ship detection and tracking method based on satellite sequence image
CN110334762B (en) Feature matching method based on quad tree combined with ORB and SIFT
CN111626146B (en) Merging cell table segmentation recognition method based on template matching
CN107145829B (en) Palm vein identification method integrating textural features and scale invariant features
CN106778712B (en) Multi-target detection and tracking method
CN115018828A (en) Defect detection method for electronic component
CN112883850B (en) Multi-view space remote sensing image matching method based on convolutional neural network
CN112633382A (en) Mutual-neighbor-based few-sample image classification method and system
CN109472770B (en) Method for quickly matching image characteristic points in printed circuit board detection
CN110222661B (en) Feature extraction method for moving target identification and tracking
CN110942473A (en) Moving target tracking detection method based on characteristic point gridding matching
CN112364881B (en) Advanced sampling consistency image matching method
CN114358166B (en) Multi-target positioning method based on self-adaptive k-means clustering
CN110246165B (en) Method and system for improving registration speed of visible light image and SAR image
CN109508674B (en) Airborne downward-looking heterogeneous image matching method based on region division
CN108694411B (en) Method for identifying similar images
CN117870659A (en) Visual inertial integrated navigation algorithm based on dotted line characteristics
CN105761237B (en) Chip x-ray image Hierarchical Segmentation based on mean shift
CN117058390B (en) High-robustness circular pointer type dial plate image state segmentation method
CN109785318B (en) Remote sensing image change detection method based on facial line primitive association constraint
CN111292346A (en) Method for detecting contour of casting box body in noise environment
CN110969128A (en) Method for detecting infrared ship under sea surface background based on multi-feature fusion
CN117079272A (en) Bullet bottom socket mark feature identification method combining manual features and learning features
CN115620169A (en) Building main angle correction method based on regional consistency

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