CN115222817B - Pointer positioning method of pointer type pressure gauge - Google Patents

Pointer positioning method of pointer type pressure gauge Download PDF

Info

Publication number
CN115222817B
CN115222817B CN202211053147.8A CN202211053147A CN115222817B CN 115222817 B CN115222817 B CN 115222817B CN 202211053147 A CN202211053147 A CN 202211053147A CN 115222817 B CN115222817 B CN 115222817B
Authority
CN
China
Prior art keywords
pointer
circle center
sub
edge detection
img
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
CN202211053147.8A
Other languages
Chinese (zh)
Other versions
CN115222817A (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.)
Chengdu Qianjia Technology Co Ltd
Original Assignee
Chengdu Qianjia 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 Chengdu Qianjia Technology Co Ltd filed Critical Chengdu Qianjia Technology Co Ltd
Priority to CN202211053147.8A priority Critical patent/CN115222817B/en
Publication of CN115222817A publication Critical patent/CN115222817A/en
Application granted granted Critical
Publication of CN115222817B publication Critical patent/CN115222817B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/70Determining position or orientation of objects or cameras
    • G06T7/73Determining position or orientation of objects or cameras using feature-based methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/10Image enhancement or restoration using non-spatial domain filtering
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/20Image enhancement or restoration using local operators
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/13Edge detection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/168Segmentation; Edge detection involving transform domain methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • 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
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20024Filtering details
    • G06T2207/20032Median filtering
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20048Transform domain processing
    • G06T2207/20061Hough transform

Landscapes

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

Abstract

The invention relates to a pointer positioning method of a pointer type pressure gauge, which comprises the following steps: acquiring an image of a dial plate of the pointer type pressure gauge by using a camera; preprocessing the image, and carrying out edge detection on the preprocessed image to obtain a circle center edge detection point; carrying out Hough circle space voting based on the circle center edge detection point, calculating the circle center, and obtaining the initial positioning of the circle center; constructing a first sub-graph to obtain the accurate positioning of the circle center; constructing a second sub-graph, performing preprocessing and edge detection to obtain a pointer edge detection point, and calculating the direction of a pointer quadrant; and (4) carrying out Hough line space voting based on the pointer edge detection point, calculating a linear equation and obtaining the accurate positioning of the pointer. Aiming at the traditional gas pointer type pressure gauge, the camera is additionally arranged on hardware, after a dial plate of the pressure gauge is photographed, the position of the circle center of the pointer is determined, and then the pointer of the pressure gauge is accurately positioned, so that the aim of accurately and remotely sensing the pointer type pressure gauge is fulfilled.

Description

Pointer positioning method of pointer type pressure gauge
Technical Field
The invention relates to the technical field of pointer image identification of a gas pressure gauge, in particular to a pointer positioning method of a pointer type pressure gauge.
Background
The pressure monitoring on the gas pipe network plays an important role in the safe production of the gas and the scheduling of the gas pipe network. At present, the main types of gas pressure gauges are a digital display type and a pointer indication type. Among them, the pointer type pressure gauge is the most common, and is widely applied to various occasions needing pressure indication due to simple structure, visual indication value and low price. However, the conventional pointer type pressure gauge lacks the ability of being remotely sensed, and a large amount of manual work needs to be consumed for meter reading in actual production operation. Meanwhile, because the resolution of human eyes to the angle of the pointer is not high, even if a manual reading mode is adopted, the reading of the pressure indicating value is difficult to achieve accurately.
Disclosure of Invention
The invention aims to provide a pointer positioning method of a pointer type pressure gauge, aiming at the traditional pointer type pressure gauge, a camera is additionally arranged on hardware, a pointer of the pressure gauge is positioned after a photo of the pressure gauge is taken, and the purpose of accurate remote sensing of the pointer type pressure gauge is achieved.
In order to achieve the above object, the embodiments of the present invention provide the following technical solutions:
a pointer positioning method of a pointer type pressure gauge comprises the following steps:
s1, acquiring an image of a dial plate of a pointer type pressure gauge by using a camera;
s2, preprocessing the image, and performing edge detection on the preprocessed image to obtain a circle center edge detection point; performing Hough circle space voting based on the circle center edge detection point, calculating the circle center, and obtaining the initial positioning of the circle center;
s3, constructing a first sub-graph, and repeating the step S2 to obtain the accurate positioning of the circle center;
s4, constructing a second sub-graph, performing preprocessing and edge detection to obtain a pointer edge detection point, and calculating the direction of a pointer quadrant; and (4) carrying out Hough line space voting based on the pointer edge detection point, and calculating a linear equation so as to obtain the accurate positioning of the pointer.
The step of preprocessing the image in the step S2 includes:
the original image collected by the camera is img org Original pictureImage img org Has a size of L x Line, L y Columns;
for original image img org Down-sampling, then down-sampling the image img sub Has a size of S x =L x lines/S, S y =L y The column,/s, is:
img sub (i,j)=img org (i*s,j*s)
where i and j represent the down-sampled image img sub And (i, j) | i<S x ,j<S y S denotes a down-sampling factor;
for down-sampled image img sub Performing median filtering processing to obtain img image mead The method comprises the following steps:
img mead (i,j)=median(X)
wherein X = { X | X = img sub (i,j),i∈[i-1,i+1],j∈[j-1,j+1]}。
The step of performing circle center edge detection on the preprocessed image to obtain a circle center edge detection point comprises the following steps:
performing gradient calculation based on sobel operator on the preprocessed image, including G x Gradient sum of directions G y Gradient of direction:
Figure 11180DEST_PATH_IMAGE001
Figure 553020DEST_PATH_IMAGE002
wherein the content of the first and second substances,
Figure 786555DEST_PATH_IMAGE003
represents the image after the median filtering process,
Figure 164578DEST_PATH_IMAGE004
indicating that the image is in G x The gradient of the direction is that of the direction,
Figure 672920DEST_PATH_IMAGE005
indicating that the image is in G y A gradient of direction;
calculating the mode G and gradient direction of the gradient
Figure 69266DEST_PATH_IMAGE006
Figure 510522DEST_PATH_IMAGE007
Figure 421846DEST_PATH_IMAGE008
Wherein the modulus of the gradient uses the L1 norm;
Figure 202720DEST_PATH_IMAGE009
the mode of the gradient is represented by,
Figure 204305DEST_PATH_IMAGE006
represents a gradient direction;
performing non-maximum value suppression processing, initializing an edge detection value of the image to be Bw =0, judging whether a gradient modulus G (i, j) corresponding to each pixel point (i, j) in the image is maximum in a nine-grid range along a gradient direction, if so, then Bw (i, j) =1, otherwise, bw (i, j) =0; taking the pixel point of Bw (i, j) =1 as an edge detection point;
performing edge point detection of double thresholds, setting double thresholds T1 and T2, wherein T1> T2, if G (i, j) is greater than T1, setting the edge detection point corresponding to G (i, j) as a strong edge point, and if G (i, j) is less than or equal to T1 and greater than T2, setting the edge detection point corresponding to G (i, j) as a weak edge point;
and reserving all strong edge points, and reserving the weak edge points if the strong edge points appear in the range of the nine-square grid to form a first circular edge detection point.
The step of performing Hough circle space voting based on the circle center edge detection point, calculating the circle center and obtaining the initial positioning of the circle center comprises the following steps of:
initializing a circle center detection accumulator C (i, j) =0, wherein the size of the circle center detection accumulator is S x Line and S y Columns;
setting and detecting a minimum radius minr and a maximum radius maxr and an exploratory step size stepr, and establishing a set D = { D | D = minr + N × stepr of circle center exploring radii, wherein N belongs to N and D < maxr }, wherein D represents the circle center exploring radius, N represents the nth step size, and N represents the total number of the step sizes;
for any one first circle center edge detection point Bw (i, j) =1, calculating the normal direction k thereof, and deforming k to obtain a parameter t:
Figure 779643DEST_PATH_IMAGE010
Figure 115947DEST_PATH_IMAGE011
wherein k denotes that the image is in G y Gradient of direction and G x The ratio of the gradients of the directions; t represents an intermediate variable;
traversing the set D of circle center exploration radiuses, establishing a straight line exploration equation for any circle center exploration radius D, and calculating a point (x) through which the straight line passes loc ,y loc ) From
Figure 700512DEST_PATH_IMAGE012
And calculating:
Figure 71450DEST_PATH_IMAGE013
Figure 817689DEST_PATH_IMAGE014
wherein i represents the ith row, j represents the jth column, d represents the circle center exploration radius, and f represents an intermediate variable;
if x loc And y loc In the circle center exploration radius traversalAnd 1, adding 1 to the corresponding Hough circle center detection space:
C(x loc ,y loc )=C(x loc ,y loc )+1
obtaining the position of the maximum value of the Hough circle center detection space C after voting as the initial positioning of the circle center (C) px ,C py )。
The step of constructing the first sub-graph and repeating the step S2 to obtain the accurate positioning of the circle center comprises the following steps:
preliminary positioning of the centre of a circle (C) px ,C py ) Restored in the original image img org Thereby constructing a first sub-graph img ″ org
C x =C px *s,C y =C py *s
Wherein, C x 、C y Representing a first sub-graph img org The upper circle center is initially positioned, and s represents a down-sampling factor;
with C x And C y Centered at S x Rows and S y Column size, img' on the first sub-figure org Upper re-cut image img sub
img` sub (i,j)=img` org (i+S x /2,j+S y /2)
For image img sub Carrying out median filtering processing and then carrying out edge detection to obtain a second circle center edge detection point; performing Hough circle space voting based on the second circle center edge detection point, calculating the circle center, and obtaining the accurate positioning of the circle center (C) dx ,C dy )。
The step of constructing a second sub-graph, preprocessing and edge detection to obtain a pointer edge detection point, and calculating the direction of the pointer quadrant comprises the following steps:
accurately positioning the center of a circle (C) dx ,C dy ) Restored in the original image img org Thereby constructing a second sub-diagram img ″ org At a centered, precise location (C) dx ,C dy ) Second sub-figure img ″ org Above, with C dx And C dy Centered at S x Line and S y Is listed asSize, on the second sub-figure img org Upper re-clipped image img sub
For image img sub Carrying out median filtering processing and then carrying out edge detection to obtain a pointer edge detection point;
using image img sub Black block at the tail of the upper pointer, with C dx 、C dy Taking R as radius to make the image img ″) as the center of circle sub Dividing the image into 8 sub-areas with overlap between every two sub-areas, respectively counting the number of pixels of which the gray value of each sub-area is lower than a set threshold value, and taking the reverse direction of the sub-area with the largest number of pixels as the quadrant direction of the pointer.
The method for carrying out Hough line space voting based on the pointer edge detection point and calculating a linear equation so as to obtain the accurate positioning of the pointer comprises the following steps:
initializing a two-dimensional straight line detection accumulator L (r, theta) =0;
for any pointer edge detection point (i, j), r = i + cos (theta) + j + sin (theta) is respectively calculated according to a group of angles theta, and after calculation is finished, the corresponding straight line detection accumulator is added with 1, namely L (r, theta) = L (r, theta) +1;
selecting r and theta corresponding to the maximum value and the second maximum value in the linear detection accumulator as two linear equations of the detection result so as to obtain the accurate positioning of the pointer
Compared with the prior art, the invention has the beneficial effects that:
aiming at the traditional gas pointer type pressure gauge, the camera is additionally arranged on hardware, after a dial plate of the pressure gauge is photographed, the position of the circle center of the pointer is firstly determined, and then the pointer of the pressure gauge is accurately positioned, so that the aim of accurately and remotely sensing the pointer type pressure gauge is fulfilled.
The method is based on the algorithm of edge detection and Hough transform, reserves the advantages of rapid implementation and small calculation amount of non-training, is suitable for the environment of low power consumption and real-time pressure detection, strengthens the generalization capability of pointer identification, fully utilizes the sampling transform of the image and controls the whole calculation amount to a lower level.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the embodiments will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present invention and therefore should not be considered as limiting the scope, and for those skilled in the art, other related drawings can be obtained according to the drawings without inventive efforts.
FIG. 1 is a flow chart of the method of the present invention;
FIG. 2 is a schematic diagram of a dial plate image structure of a typical pointer type gas pressure gauge;
FIG. 3 is a diagram illustrating a result of performing a first edge detection according to an embodiment of the present invention;
FIG. 4 is a diagram illustrating a result of a first circle center vote according to an embodiment of the present invention;
FIG. 5 is a schematic diagram of obtaining a preliminary positioning of a circle center according to an embodiment of the present invention;
FIG. 6 is a diagram illustrating a second edge detection according to an embodiment of the present invention;
FIG. 7 is a schematic diagram of obtaining an accurate positioning of a center of a circle according to an embodiment of the present invention;
FIG. 8 is a diagram illustrating the division of 8 sub-regions according to an embodiment of the present invention;
FIG. 9 is a schematic diagram of obtaining precise positioning of a pointer according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. The components of embodiments of the present invention generally described and illustrated in the figures herein may be arranged and designed in a wide variety of different configurations. Thus, the following detailed description of the embodiments of the present invention, presented in the figures, is not intended to limit the scope of the invention, as claimed, but is merely representative of selected embodiments of the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments of the present invention without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined and explained in subsequent figures. Also, in the description of the present invention, the terms "first", "second", and the like are used for distinguishing between descriptions and not necessarily for describing a relative importance or implying any actual relationship or order between such entities or operations.
The utility model provides a pointer positioning system of pointer-type manometer, includes camera, treater, the camera sets up in the positive opposite face of gas pressure table's dial plate for gather the image of dial plate, the treater is arranged in discerning the centre of a circle and the pointer of pointer in the dial plate from the image, thereby obtains accurate pressure reading.
Referring to fig. 2, the structural features of the dial plate image of a typical pointer-type gas pressure gauge include:
1) The identification target comprises a group of concentric circles (at least one outer dial, one inner dial and one pointer circle center) and a pointer;
2) The distance between a target detection line represented by the pointer and the center of the pointer is close to 0, namely the detection line of the pointer penetrates through the center of the pointer;
3) The pointer consists of a thin pointer head part and a thick pointer tail part, and is also the part with the lowest gray value in the image.
The invention is realized by the following technical scheme, as shown in figure 1, a pointer positioning method of a pointer type pressure gauge comprises the following steps:
and S1, acquiring an image of a dial plate of the pointer type pressure gauge by using a camera.
The camera is over against the dial plate of the pointer type pressure gauge to collect the original image img with high resolution org Original image img org Has a size of L x Line, L y Columns, e.g. original image img org Has a size of 240 x 320.
S2, preprocessing the image, and carrying out edge detection on the preprocessed image to obtain a circle center edge detection point; and (4) carrying out Hough circle space voting based on the circle center edge detection point, calculating the circle center, and obtaining the initial positioning of the circle center.
For original image img org The preprocessing of (1) comprises down-sampling and median filtering, firstly, the img of the original image is processed org Down-sampling is carried out, and then the image img is down-sampled sub Has a size of S x =L x S line, S y =L y Columns/s, e.g. down-sampled image img sub Has a size of 60 x 80, having:
img sub (i,j)=img org (i*s,j*s)
where i and j represent the down-sampled image img sub And (i, j) | i<Sx,j<Sy, s represents a down-sampling factor;
for down-sampled image img sub Performing median filtering processing to obtain img image mead The method comprises the following steps:
img mead (i,j)=median(X)
wherein X = { X | X = img sub (i,j),i∈[i-1,i+1],j∈[j-1,j+1]}。
Carrying out gradient calculation based on sobel operator on the preprocessed image, including G x Gradient sum of directions G y Gradient of direction:
Figure 657600DEST_PATH_IMAGE001
Figure 45856DEST_PATH_IMAGE002
wherein the content of the first and second substances,
Figure 5722DEST_PATH_IMAGE003
represents the image after the median filtering process,
Figure 204754DEST_PATH_IMAGE004
indicating that the image is in G x The gradient of the direction is that of the direction,
Figure 515649DEST_PATH_IMAGE005
indicating that the image is in G y A gradient in direction.
Calculating the modulus G of the gradient and the gradient direction
Figure 176438DEST_PATH_IMAGE006
Figure 256389DEST_PATH_IMAGE007
Figure 610010DEST_PATH_IMAGE008
Wherein the modulus of the gradient uses the L1 norm;
Figure 408202DEST_PATH_IMAGE009
the mode of the representation of the gradient is,
Figure 151642DEST_PATH_IMAGE006
indicating the direction of the gradient.
Then, performing non-maximum value suppression processing, initializing an edge detection value of the image to be Bw =0, judging whether a gradient modulus G (i, j) corresponding to each pixel point (i, j) in the image is maximum in a nine-grid range along a gradient direction, if so, then Bw (i, j) =1, otherwise, bw (i, j) =0; the pixel point Bw (i, j) =1 is taken as an edge detection point, please refer to a white point in fig. 3, which represents an edge detection point.
And then, carrying out edge point detection of double thresholds, setting double thresholds T1 and T2, wherein T1> T2, if G (i, j) is greater than T1, setting the edge detection point corresponding to G (i, j) as a strong edge point, if G (i, j) is less than or equal to T1 and greater than T2, setting the edge detection point corresponding to G (i, j) as a weak edge point, and if G (i, j) is less than or equal to T2, setting the edge detection point corresponding to G (i, j) as a weak edge point and discarding.
And reserving all strong edge points, and reserving the weak edge points if the strong edge points appear in the range of the nine-square grid so as to form a first circular edge detection point.
Then voting is carried out, a circle center detection accumulator C (i, j) =0 is initialized, and the size of the circle center detection accumulator is S x Line and S y And (4) columns. Setting and detecting a minimum radius minr and a maximum radius maxr and an exploration step size stepr, and establishing a set D = { D | D = minr + N × stepr of circle center exploration radii, wherein N belongs to N, D<maxr, where d represents the circle center exploration radius, N represents the nth step, and N represents the total number of steps.
For any one first circle center edge detection point Bw (i, j) =1, calculating the normal direction k thereof, and deforming k to obtain a parameter t:
Figure 820521DEST_PATH_IMAGE010
Figure 876202DEST_PATH_IMAGE011
wherein k denotes that the image is in G y Gradient of direction and G x The ratio of the gradients of the directions; t represents an intermediate variable.
Traversing the set D of circle center exploration radiuses, establishing a straight line exploration equation for any circle center exploration radius D, and calculating a point (x) through which the straight line passes loc ,y loc ) From
Figure 912422DEST_PATH_IMAGE012
And calculating:
Figure 915013DEST_PATH_IMAGE013
Figure 703978DEST_PATH_IMAGE014
wherein i represents the ith row, j represents the jth column, d represents the circle center search radius, and f represents the intermediate variable.
If x loc And y loc And if the circle center occurs for the 1 st time in the circle center exploration radius traversal, adding 1 to the corresponding Hough circle center detection space:
C(x loc ,y loc )=C(x loc ,y loc )+1
please refer to fig. 4 as the circle center voting result, and the position of the maximum value of the hough circle center detection space C is obtained after voting as the initial positioning of the circle center (C) px ,C py ) Please refer to the initial positioning with a circle center in fig. 5, which is obviously inaccurate, so step S3 is performed to perform the precise positioning.
And S3, constructing a first sub-graph, and repeating the step S2, so as to obtain the accurate positioning of the circle center.
Preliminary positioning of the centre of a circle (C) px ,C py ) Restore original image img at size 240 × 320 org Thereby constructing a first sub-graph img ″ org
C x =C px *s,C y =C py *s
Wherein, C x 、C y Representing a first sub-graph img org The center of the circle above is initially positioned, and s represents a down-sampling factor.
With C x And C y Centered at S x Rows and S y Column size, img' on the first sub-figure org Upper re-cut image img sub The size of the truncated image is 60 × 80, and here only the image is truncated without changing the resolution of the image:
img` sub (i,j)=img` org (i+S x /2,j+S y /2)
for image img sub Performing median filtering processing, referring to fig. 6, and performing edge detection to obtain a second circle center edge detection point; performing Hough circle space voting based on the second circle center edge detection point, calculating the circle center, and obtaining the accurate positioning of the circle center (C) dx ,C dy ) Please refer to fig. 7 for the precise positioning of the existing circle center. It should be noted that, here, the edge detection and the hough circle space voting and the aforementioned preliminary positioning (C) for obtaining the center of the circle px ,C py ) The same way is used, and therefore, the description is omitted.
S4, constructing a second sub-graph, performing preprocessing and edge detection to obtain a pointer edge detection point, and calculating the direction of a pointer quadrant; and (4) carrying out Hough line space voting based on the pointer edge detection point, and calculating a linear equation so as to obtain the accurate positioning of the pointer.
Accurately positioning the center of a circle (C) dx ,C dy ) Restored in the original image img org Thereby constructing a second sub-diagram img ″ org At a centered, precise location (C) dx ,C dy ) Second sub-figure img ″ org Above, with C dx And C dy Centered at S x Line, S y Column size, img' on the second sub-figure org Upper recapture image img ″ sub Here, only the image is captured, and the resolution of the image is not changed.
For image img sub And carrying out median filtering processing and then carrying out edge detection to obtain a pointer edge detection point. It should be noted that, here, the manner of performing edge detection on the pointer to obtain the pointer edge detection point is the same as the manner of performing edge detection on the circle center to obtain the circle center edge detection point in step S3, and therefore, the description is omitted.
Using image img sub Black block at the tail of the upper pointer, with C dx 、C dy Taking R as radius to make the image img ″) as the center of circle sub The sub-regions are divided into 8 sub-regions with overlap between every two sub-regions, please refer to fig. 8, the number of pixels of which the gray value of each sub-region is lower than the set threshold value is respectively counted, and the reverse direction of the sub-region with the largest number of pixels is taken as the quadrant direction of the pointer.
A two-dimensional line detection accumulator L (r, θ) =0 is initialized, which is a polar coordinate expression. For any pointer edge detection point (i, j), r = i + cos (theta) + j + sin (theta) is calculated by a group of angles theta, and after calculation is finished, the corresponding straight line detection accumulator is added with 1, namely L (r, theta) = L (r, theta) +1.
R and theta corresponding to the maximum value and the second maximum value in the linear detection accumulator are selected as two linear equations of the detection result, so as to obtain the accurate positioning of the pointer, please refer to fig. 9 for the obtained accurate positioning of the pointer.
In summary, according to the traditional gas pointer type pressure gauge, the camera is additionally arranged on hardware, after a dial plate of the pressure gauge is photographed, the position of the center of a circle of the pointer is determined, and then the pointer of the pressure gauge is accurately positioned, so that the purpose of accurately and remotely sensing the pointer type pressure gauge is achieved. The method is based on the algorithm of edge detection and Hough transform, reserves the advantages of rapid implementation and small calculation amount of non-training, is suitable for the environment of low power consumption and real-time pressure detection, strengthens the generalization capability of pointer identification, fully utilizes the sampling transform of the image and controls the whole calculation amount to a lower level.
The above description is only for the specific embodiments of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present invention, and all the changes or substitutions should be covered within the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (5)

1. A pointer positioning method of a pointer type pressure gauge is characterized by comprising the following steps: the method comprises the following steps:
s1, acquiring an image of a dial plate of a pointer type pressure gauge by using a camera;
s2, preprocessing the image, and carrying out edge detection on the preprocessed image to obtain a circle center edge detection point; carrying out Hough circle space voting based on the circle center edge detection point, calculating the circle center, and obtaining the initial positioning of the circle center;
s3, constructing a first sub-graph, and repeating the step S2 to obtain the accurate positioning of the circle center;
the step of constructing the first sub-graph and repeating the step S2 to obtain the accurate positioning of the circle center comprises the following steps:
preliminary positioning of the centre of a circle (C) px ,C py ) Restored in the original image img org Thereby constructing a first sub-graph img ″ org
C x =C px *s,C y =C py *s
Wherein, C x 、C y Representing a first sub-graph img org The upper circle center is initially positioned, and s represents a down-sampling factor;
with C x And C y Centered at S x Rows and S y Column size, img' on the first sub-figure org Upper recapture image img sub
img` sub (i,j)=img` org (i+S x /2,j+S y /2)
For image img sub Carrying out median filtering processing and then carrying out edge detection to obtain a second circle center edge detection point; performing Hough circle space voting based on the second circle center edge detection point, calculating the circle center, and obtaining the accurate positioning of the circle center (C) dx ,C dy );
S4, constructing a second sub-graph, performing pretreatment and edge detection to obtain a pointer edge detection point, and calculating the direction of a pointer quadrant; carrying out Hough line space voting based on a pointer edge detection point, and calculating a linear equation so as to obtain the accurate positioning of the pointer;
the step of constructing a second subgraph, carrying out pretreatment and edge detection to obtain a pointer edge detection point, and calculating the direction of a pointer quadrant comprises the following steps:
accurately positioning the center of a circle (C) dx ,C dy ) Restored in the original image img org Thereby constructing a second sub-diagram img ″ org At a centered, precise location (C) dx ,C dy ) Second sub-figure img ″ org Above, with C dx And C dy Centered at S x Line, S y Column size, img' on the second sub-figure org Upper recapture image img ″ sub
For image img sub Carrying out median filtering processing and then carrying out edge detection to obtain a pointer edge detection point;
using image img sub Black block at the tail of the upper pointer, with C dx 、C dy Taking R as radius to make the image img ″) as the center of circle sub Dividing the data into 8 sub-regions with overlap between every two sub-regions, and respectively counting each sub-regionAnd the number of pixels of which the area gray value is lower than the set threshold value is used as the direction of the quadrant of the pointer, and the opposite direction of the sub-area with the largest number of pixels is used as the direction of the quadrant of the pointer.
2. The pointer positioning method of the pointer type pressure gauge as claimed in claim 1, wherein: the step of preprocessing the image in the step S2 includes:
the original image collected by the camera is img org Original image img org Has a size of L x Line, L y Columns;
for original image img org Down-sampling is carried out, and then the image img is down-sampled sub Has a size of S x =L x lines/S, S y =L y The column,/s, is:
img sub (i,j)=img org (i*s,j*s)
where i and j represent the down-sampled image img sub And (i, j) | i<S x ,j<S y S denotes a down-sampling factor;
for down-sampled image img sub Performing median filtering processing to obtain img image mead The method comprises the following steps:
img mead (i,j)=median(X)
wherein X = { X | X = img sub (i,j),i∈[i-1,i+1],j∈[j-1,j+1]}。
3. The pointer positioning method of the pointer type pressure gauge as claimed in claim 2, wherein: the step of performing circle center edge detection on the preprocessed image to obtain a circle center edge detection point comprises the following steps:
performing gradient calculation based on sobel operator on the preprocessed image, including G x Gradient sum of directions G y Gradient of direction:
Figure 528066DEST_PATH_IMAGE001
Figure 375805DEST_PATH_IMAGE002
wherein the content of the first and second substances,
Figure 331123DEST_PATH_IMAGE003
represents the image after the median filtering process,
Figure 684744DEST_PATH_IMAGE004
indicating that the image is in G x The gradient of the direction is that of the direction,
Figure 905772DEST_PATH_IMAGE005
indicating that the image is in G y A gradient of direction;
calculating the mode G and gradient direction of the gradient
Figure 511197DEST_PATH_IMAGE006
Figure 711234DEST_PATH_IMAGE007
Figure 360390DEST_PATH_IMAGE008
Wherein the modulus of the gradient uses the L1 norm;
Figure 380298DEST_PATH_IMAGE009
the mode of the gradient is represented by,
Figure 523835DEST_PATH_IMAGE006
represents a gradient direction;
performing non-maximum value suppression processing, initializing an edge detection value of the image to be Bw =0, judging whether a gradient mode G (i, j) corresponding to each pixel point (i, j) in the image is the maximum in a squared range along a gradient direction, if so, determining that Bw (i, j) =1, otherwise, determining that Bw (i, j) =0; taking the pixel point of Bw (i, j) =1 as an edge detection point;
performing edge point detection of double thresholds, setting double thresholds T1 and T2, wherein T1> T2, if G (i, j) is greater than T1, setting the edge detection point corresponding to G (i, j) as a strong edge point, and if G (i, j) is less than or equal to T1 and greater than T2, setting the edge detection point corresponding to G (i, j) as a weak edge point;
and reserving all strong edge points, and reserving the weak edge points if the strong edge points appear in the range of the nine-square grid to form a first circular edge detection point.
4. The pointer positioning method of the pointer type pressure gauge as claimed in claim 3, wherein: the step of performing Hough circle space voting based on the circle center edge detection point, calculating the circle center and obtaining the initial positioning of the circle center comprises the following steps of:
initializing a circle center detection accumulator C (i, j) =0, wherein the size of the circle center detection accumulator is S x Line and S y A column;
setting and detecting a minimum radius minr and a maximum radius maxr and an exploratory step size stepr, and establishing a set D = { D | D = minr + N × stepr of circle center exploring radii, wherein N belongs to N and D < maxr }, wherein D represents the circle center exploring radius, N represents the nth step size, and N represents the total number of the step sizes;
for any one first circle center edge detection point Bw (i, j) =1, calculating the normal direction k thereof, and deforming k to obtain a parameter t:
Figure 578379DEST_PATH_IMAGE010
Figure 982726DEST_PATH_IMAGE011
wherein k denotes that the image is in G y Gradient of direction and G x The ratio of the gradients of the directions; t represents an intermediate variable;
search half circle centerD, for any circle center, searching radius D, establishing a straight line search equation, and calculating the point (x) passed by the straight line loc ,y loc ) From
Figure 630876DEST_PATH_IMAGE012
And calculating:
Figure 437158DEST_PATH_IMAGE013
Figure DEST_PATH_IMAGE014
wherein i represents the ith row, j represents the jth column, d represents the circle center exploration radius, and f represents an intermediate variable;
if x loc And y loc And if the circle center occurs for the 1 st time in the circle center exploration radius traversal, adding 1 to the corresponding Hough circle center detection space:
C(x loc ,y loc )=C(x loc ,y loc )+1
obtaining the position of the maximum value of the Hough circle center detection space C after voting as the initial positioning of the circle center (C) px ,C py )。
5. The pointer positioning method of the pointer type pressure gauge as claimed in claim 1, wherein: the method for carrying out Hough line space voting based on the pointer edge detection point and calculating a linear equation so as to obtain the accurate positioning of the pointer comprises the following steps:
initializing a two-dimensional straight line detection accumulator L (r, theta) =0;
for any pointer edge detection point (i, j), r = i + cos (theta) + j + sin (theta) is respectively calculated according to a group of angles theta, and after calculation is finished, the corresponding straight line detection accumulator is added with 1, namely L (r, theta) = L (r, theta) +1;
and selecting r and theta corresponding to the maximum value and the second maximum value in the linear detection accumulator as two linear equations of the detection result so as to obtain the accurate positioning of the pointer.
CN202211053147.8A 2022-08-31 2022-08-31 Pointer positioning method of pointer type pressure gauge Active CN115222817B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211053147.8A CN115222817B (en) 2022-08-31 2022-08-31 Pointer positioning method of pointer type pressure gauge

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211053147.8A CN115222817B (en) 2022-08-31 2022-08-31 Pointer positioning method of pointer type pressure gauge

Publications (2)

Publication Number Publication Date
CN115222817A CN115222817A (en) 2022-10-21
CN115222817B true CN115222817B (en) 2022-11-29

Family

ID=83617864

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211053147.8A Active CN115222817B (en) 2022-08-31 2022-08-31 Pointer positioning method of pointer type pressure gauge

Country Status (1)

Country Link
CN (1) CN115222817B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115655576B (en) * 2022-12-13 2023-03-10 成都千嘉科技股份有限公司 Automatic sensing method for displacement abnormity of pointer type pressure gauge

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105741307A (en) * 2016-03-03 2016-07-06 深圳元启智能技术有限公司 Method for automatically identifying reading of pointer type pressure meter
CN106228170A (en) * 2016-09-20 2016-12-14 山东省计量科学研究院 A kind of pointer position extracting method of pointer instrument
CN109635806A (en) * 2018-12-12 2019-04-16 国网重庆市电力公司信息通信分公司 Ammeter technique for partitioning based on residual error network
CN109711253A (en) * 2018-11-19 2019-05-03 国家电网有限公司 Ammeter technique for partitioning based on convolutional neural networks and Recognition with Recurrent Neural Network
CN111325164A (en) * 2020-02-25 2020-06-23 北京眸视科技有限公司 Pointer indication number identification method and device and electronic equipment
CN112529840A (en) * 2020-11-06 2021-03-19 广东电网有限责任公司中山供电局 SF6 inflation equipment pressure drop defect image recognition device
CN112912781A (en) * 2018-08-29 2021-06-04 艾塔鲁玛公司 Illuminated display as an illumination source for microscopy
CN113592955A (en) * 2021-07-27 2021-11-02 中国科学院西安光学精密机械研究所 Circular workpiece plane coordinate high-precision positioning method based on machine vision
CN114648552A (en) * 2020-12-17 2022-06-21 英特尔公司 Accurate optical flow estimation in stereo-centering of equivalent rectangular images

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8253819B2 (en) * 2008-02-06 2012-08-28 Panasonic Corporation Electronic camera and image processing method
US9164625B2 (en) * 2012-10-14 2015-10-20 Neonode Inc. Proximity sensor for determining two-dimensional coordinates of a proximal object
CN107301412B (en) * 2017-05-08 2019-12-17 浙江工业大学 Pointer instrument reading method based on image processing
CN108460327B (en) * 2018-01-12 2021-09-28 河南大学 Automatic identification method for reading of pointer instrument based on image processing
CN109086763B (en) * 2018-07-23 2021-11-26 国网辽宁省电力有限公司信息通信分公司 Pointer instrument reading method and device

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105741307A (en) * 2016-03-03 2016-07-06 深圳元启智能技术有限公司 Method for automatically identifying reading of pointer type pressure meter
CN106228170A (en) * 2016-09-20 2016-12-14 山东省计量科学研究院 A kind of pointer position extracting method of pointer instrument
CN112912781A (en) * 2018-08-29 2021-06-04 艾塔鲁玛公司 Illuminated display as an illumination source for microscopy
CN109711253A (en) * 2018-11-19 2019-05-03 国家电网有限公司 Ammeter technique for partitioning based on convolutional neural networks and Recognition with Recurrent Neural Network
CN109635806A (en) * 2018-12-12 2019-04-16 国网重庆市电力公司信息通信分公司 Ammeter technique for partitioning based on residual error network
CN111325164A (en) * 2020-02-25 2020-06-23 北京眸视科技有限公司 Pointer indication number identification method and device and electronic equipment
CN112529840A (en) * 2020-11-06 2021-03-19 广东电网有限责任公司中山供电局 SF6 inflation equipment pressure drop defect image recognition device
CN114648552A (en) * 2020-12-17 2022-06-21 英特尔公司 Accurate optical flow estimation in stereo-centering of equivalent rectangular images
CN113592955A (en) * 2021-07-27 2021-11-02 中国科学院西安光学精密机械研究所 Circular workpiece plane coordinate high-precision positioning method based on machine vision

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
"一种适用于变电站巡检机器人的仪表识别算法";房桦等;《自动化与仪表》;20130515;第10-14页 *
"基于 ORB 和改进 Hough 变换的指针仪表智能识读方法";朱柏林等;《仪表技术与传感器》;20170131(第1期);正文第1-6页 *
"无先验知识的仪表自动检测与判读算法";董海等;《仪器仪表学报》;20200215;第41卷(第2期);第205-217页 *

Also Published As

Publication number Publication date
CN115222817A (en) 2022-10-21

Similar Documents

Publication Publication Date Title
CN110580480B (en) Meter reading identification method based on image processing
CN108460327B (en) Automatic identification method for reading of pointer instrument based on image processing
CN112818988B (en) Automatic identification reading method and system for pointer instrument
CN111368906B (en) Pointer type oil level meter reading identification method based on deep learning
CN110929710B (en) Method and system for automatically identifying meter pointer reading based on vision
CN111563896B (en) Image processing method for detecting abnormality of overhead line system
CN115222817B (en) Pointer positioning method of pointer type pressure gauge
CN108846402B (en) Automatic extraction method for terrace field ridges based on multi-source data
CN111476246A (en) Robust and efficient intelligent reading method for pointer instrument applied to complex environment
CN103778411A (en) Circle detection method and device based on raster image division
CN109636790A (en) A kind of recognition methods of pipeline structure and device
CN113095316B (en) Image rotation target detection method based on multilevel fusion and angular point offset
CN109117720A (en) A kind of readings of pointer type meters recognition methods based on machine vision
CN109784257B (en) Transformer thermometer detection and identification method
CN112529003A (en) Instrument panel digital identification method based on fast-RCNN
CN112652020A (en) Visual SLAM method based on AdaLAM algorithm
CN112560839A (en) Automatic identification method and system for reading of pointer instrument
CN117152727A (en) Automatic reading method of pointer instrument for inspection robot
CN112990190A (en) Method and device for identifying reading of pointer instrument
CN116612461A (en) Target detection-based pointer instrument whole-process automatic reading method
CN115588196A (en) Pointer type instrument reading method and device based on machine vision
CN116091818A (en) Pointer type instrument reading identification method based on multi-neural network cascading model
CN108955909A (en) A kind of oil temperature gauge identification number reading method based on machine vision
CN116399418B (en) Water level identification method and system based on fixed camera
Kang et al. Research on automatic recognition algorithm of pointer meter based on machine vision

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