Background technique
Based on the considerations of reduce operating cost and save floor occupying area etc., with unattended operation transformer station (referred to as electricity
Power station, similarly hereinafter) be used more and more, various video monitoring systems are widely applied.
Since video monitoring can generate a large amount of live video or photograph image, then image processing, interpret or according to institute
Diagram piece is identified, is judged, is had become in the operation monitoring work of electric system necessary.
" visual analysis " technology is a kind of intelligence system, can by vision system (video camera) to locating environment into
The autonomous intellectualized technology observed and analyze of row is an important directions of artificial intelligence technology and machine vision technique development,
Substation inspection, remote centralized control, video image big data analysis and in terms of with boundless application before
Scape.
Pointer instrument is as measuring instrument most important in electric system, and there is no data-interfaces, can only be artificial
The drawbacks of reading reading.
For unmanned inspection, the unmanned operation for realizing electric power station, need to realize intelligence " the vision reason to pointer instrument
Solution ".
Since electric power station is not turned on light at the moment at nobody, single light source can only be carried by robotic arm, therefore shade becomes in electricity
Realize that the maximum of the identification to pointer hinders in power station.
For the research of shadow removing method, Wang Xiangyu et al. is " in conjunction with image area information in hsv color space
It is proposed first in target shadow removing method " (" computer engineering and application ", 2015:359-360-361-362-363.) text
It is converted using HSV space and determines shadow region, in conjunction with the area information elimination shadow region from outside to inside of image;Old tin
Et al. in " the shadow removing algorithm that bright spot, color and gradient combine " (Electronic Industry Press, 2010:556-557-558-
A kind of shadow removing for combining using bright spot, color and gradient and judging whether to cast shadow suppressing is proposed in 559-560-561.)
Algorithm;A kind of shadow removing method based on RGBY has been invented in eight-legged essay east et al., can accurately eliminate object in all cases
Shadow (referring to CN105869121A " a kind of shadow removing method based on RGBY ");King Wenxiang is of heap of stone et al. " one kind is based on YUV
It is proposed in the adaptive shadow removing algorithm of color space " (micro computer and application, 2016, (7)) " a kind of new based on YUV
The adaptive shadow removing algorithm of color space has preferable adaptivity, but needs acquisition background image in advance.
Above-mentioned technical proposal in actual application discovery there are certain deficiency, cannot adapt to completely based on " depending on
The requirement of the remote monitoriong of electric power system of feel understanding " method building.
Summary of the invention
Technical problem to be solved by the invention is to provide a kind of in remote monitoriong of electric power based on shadow removing optimization
Gauge pointer position detection recognition methods.Its contrast that pointer and shade are stretched using greyscale transformation, is carried out using big law
Binaryzation is finally filtered out the burr at pointer edge using opening operation, achievees the effect that shadow removing.In different shade degree
Under have preferable performance, can more accurately find pointer edge, calculate total indicator reading and have certain real-time.
The technical scheme is that provide it is a kind of in remote monitoriong of electric power based on shadow removing optimization instrument refer to
Pin position detection recognition method, the image including obtaining power control cabinet or instrument board by video monitoring system or video camera;It is special
Sign is:
1) first against the instrument of every a kind of or each model, the tilt angle and instrument degree of a pointer are constructed
Mapping table or correspondence database;
2) gray processing, denoising are carried out to image;
3) greyscale transformation is carried out to image using greyscale transformation function, draws high contrast;
4) binaryzation is carried out using big law;
5) burr is handled using opening operation, has the function that eliminate shade;
6) Morphological scale-space pointer edge is carried out;
7) Hough transform is carried out;
8) straight line where screening pointer edge;
9) according to pointer straight incline angle, pointer degree is calculated;
10) by the mapping table of the pointer tilt angle and instrument degree that obtain, the degree of pointer meters is obtained.
Further, the gauge pointer position detection recognition methods, is improved using adaptive threshold binarization
The effect of shadow removing improves the accuracy of identification of gauge pointer position.
Specifically, the greyscale transformation is realized using following formula:
S=T (r), A≤r, s≤A+L
Wherein, the gray scale interval of image is [A, A+L], and variable r represents the gray level of original image, and variable behalf stretched
The gray level of later image.
Further, the form of the transforming function transformation function of the greyscale transformation is as follows:
Wherein 0 < a, b < 1, takes a=0.2, b=0.4.
Specifically, when carrying out the binaryzation of described image, it is assumed that the gray level image of a width M*N size has L difference
Gray level, niIndicate the number of the pixel of i-th of gray level, n is total pixel number, i.e.,
N=M*N=n0+n1+…+nL-1
When threshold value is t, the number of the pixel in C1 and C2 accounts for overall percentage and is respectively as follows:
At this point, the average gray value of C1 and C2 class is respectively as follows:
Then, the overall average gray value of image are as follows:
U=w1u1+w2u2
Then, calculating inter-class variance is carried out with different t in L gray level, formula is as follows:
σ2(t)=w1(u1-u)2+w2(u2-u)2=w1w2(u1-u2)2
The corresponding t value of maximum inter-class variance is exactly optimal threshold.
Specifically, the Morphological scale-space pointer edge is carried out as follows:
If E (x, y) and D (x, y) are that structural element B (x, y) corrodes and expands to the image f (x, y) of m*n size respectively
As a result;
Specifically, described screened by the slope of straight line and the position of straight line, select straight where pointer edge
Line.
In the image that the technical program obtains after the Hough transform, by the position of the slope of straight line and straight line into
Row screening, selects the straight line where pointer edge.
Compared with the prior art, the invention has the advantages that
1, the technical program stretches the contrast of pointer and shade using greyscale transformation, carries out binaryzation using big law,
The burr that pointer edge is finally filtered out using opening operation, achievees the effect that shadow removing;
2, this algorithm has preferable performance under different shade degree, can more accurately find pointer edge, calculate
Total indicator reading and have certain real-time.
Specific embodiment
The present invention will be further described with reference to the accompanying drawing.
In Fig. 1, technical solution of the present invention provides a kind of instrument based on shadow removing optimization in remote monitoriong of electric power
List index position detection recognition methods, the image including obtaining power control cabinet or instrument board by video monitoring system or video camera;
Its inventive point is:
1) first against the instrument of every a kind of or each model, the tilt angle and instrument degree of a pointer are constructed
Mapping table or correspondence database;
2) image of instrument board is obtained;
3) gray processing, denoising are carried out to image;
4) greyscale transformation is carried out to image using greyscale transformation function, draws high contrast;
5) binaryzation is carried out using big law;
6) burr is handled using opening operation, has the function that eliminate shade;
7) Morphological scale-space pointer edge is carried out;
8) Hough transform is carried out;
9) straight line where screening pointer edge;
10) according to pointer straight incline angle, pointer degree is calculated;
11) by the mapping table of the pointer tilt angle and instrument degree that obtain, the degree of pointer meters is obtained.
For the technical program, it is specifically described as follows:
1, greyscale transformation:
The image of camera acquisition is usually 24 true color, and RGB accounts for 8 respectively.
Since the colouring information of image is little for subsequent processing recognition reaction, to accelerate the speed calculated, by image
Carry out gray processing processing.
In addition, image generally can all be denoised by the interference of noise using gaussian filtering, image shown in Fig. 2 is obtained.
As shown in Figure 2 it is found that the gray value of pointer and shade is very close, if directly will lead to can not be clear for binaryzation
Pointer is plucked out clearly, influences the identification of pointer.So must inhibit to shade, that is, stretch the contrast of image.
Histogram is the important feature of one kind of gray level image.It is demonstrated by the distribution feelings of 256 gray values in the picture
Condition.
From figure 3, it can be seen that the effect picture through gray processing and gaussian filtering is integrally darker, the component of grey level histogram
The middle lower curtate of gray level is concentrated on, and the pixel of middle part distribution is most.And our region of interest, that is, pointer gray value is concentrated
In the low side of gray level, so needing to carry out the purposive gray value for drawing high region of interest using greyscale transformation function, with this
To increase the contrast of pointer and shade.
Assuming that the gray scale interval of image is [A, A+L], variable r represents the gray level of original image, and variable behalf stretched
The gray level of later image, then greyscale transformation formula is answered are as follows:
S-T (r), A≤r, s≤A+L
Here, the main purpose of transformation exactly separates pointer and shade, therefore gray scale interval is divided into three subintervals point
It is not converted, has reached the maximized effect for increasing picture contrast.
The form of transforming function transformation function is as follows:
Wherein 0 < a, b < 1.Due to the difference very little of pointer and the gray value of shade, therefore a=0.2 is taken in the technical program, b
=0.4.
The curve graph of above-mentioned transforming function transformation function is as shown in Figure 4.
Fig. 5 is the image carried out after grey scale change using the function.It is apparent that the brightness of pointer is kept substantially
It is constant, and the brightness of shade significantly improves, contrast increases, and pointer is highlighted out.Meanwhile if after in conjunction with greyscale transformation
The histogram analysis of image, gray value have been concentrated in the both ends of former gray scale interval, threshold when binaryzation after being more convenient in this way
The selection of value.
2, image binaryzation:
Image binaryzation, which refers to, is set as 0 or 255 for the gray value of the pixel of gray level image by a certain threshold value, i.e., black
Color and white.
The feature that the bianry image that binaryzation is formed has data volume few, clear-cut, accounts in digital image processing field
There is critical role.The effect of binaryzation directly depends on the selection of threshold value.
Common threshold value calculation method has Two-peak method, p parametric method and maximum variance between clusters (also referred to as big law, Otus
Method).
As seen from Figure 6, it is separated by the image of greyscale transformation with foreground and background, it is on the one hand and not formed complete
It is bimodal, and peak valley is too wide, can not calculate suitable threshold value, on the other hand can not determine the percentage between prospect and background
Than so selection carries out the binary conversion treatment of image using big law in the technical program.
Big law is that the scholar for being named as Otus by one proposed in 1979, if main thought will be schemed according to threshold value t
Pixel as in is divided into two class of C1 and C2, can make have maximum inter-class variance between two classes, then it is assumed that the threshold value is most
Good global threshold.
It is now assumed that the gray level image of a width M*N size has L different gray levels, niIndicate the picture of i-th of gray level
The number of vegetarian refreshments, n are total pixel number, i.e.,
N=M*N=n0+n1+…+nL-1
When threshold value is t, the number of the pixel in C1 and C2 accounts for overall percentage and is respectively as follows:
At this point, the average gray value of C1 and C2 class is respectively as follows:
Then, the overall average gray value of image are as follows:
U=w1u1+w2u2
Calculating inter-class variance is carried out with different t in L gray level, formula is as follows:
σ2(t)=w1(u1-u)2+w2(u1-u)2=w1w2(u1-u2)2
The corresponding t value of maximum inter-class variance is exactly optimal threshold.
3, Morphological scale-space pointer edge:
So-called Morphological scale-space is namely based on a series of images processing of shape, expands (Dilation) and corrodes
It (Erosion) is two kinds of wherein most basic operations.
If E (x, y) and D (x, y) are that structural element B (x, y) corrodes and expands to the image f (x, y) of m*n size respectively
As a result.
Corrosion is mainly used for eliminating the boundary point of object, on the one hand can disconnect the tiny connection between two objects, separately
On the one hand isolated noise and burr that width is less than structural element can be filtered out.
On the contrary, the background dot around object is mainly merged into object by the effect of expansion, it is possible to for connecting
Two, apart from close object, are restored the connectivity of image.
Open and close operator is then the combinatorial operation of expansion and corrosion.Opening operation is first to corrode reflation, and closed operation is complete
In contrast.
Since the purpose in the technical program using Morphological scale-space is to eliminate the burr of image border, so selection is opened
Operation.The burr at edge is weakened first with corrosion and is eliminated, then will be restored the lines to attenuate by corrosion with expansion.
4, embodiment and analysis:
Due to will receive the influence of instrument frame, the straight line obtained after Hough transform may have frame wheel
It is wide.
It can be screened at this time by the slope of straight line and the position of straight line, select the straight line where pointer edge.
It can be obtained by Fig. 7 and Fig. 8 comparison, greyscale transformation has stretched the contrast of foreground and background really, and it is suitable to be also convenient for
The searching of binarization threshold.
Fig. 9 shows the image obtained after Canny edge detection.
The first edge 1 and second edge 2 of the pointer eventually found are shown in Figure 10, it can be clearly by pointer
It is separated with shade.
For the validity for verifying this method, pointer identification experiment has been carried out to the sample acquired from electric power station.
Experimental situation is Visual Studio 2013, OpenCV 2.4.13, Intel Core i5 2.60GHzCPU, 4G memory.
1 pointer recognition result table of table
Seen from table 1, this method can accurately read pointer registration to each sample, and reliability is higher and knows
Not relatively rapidly, there is certain accuracy and real-time.
Technical solution of the present invention, when realizing unmanned inspection for electric power station, shade hinders asking for readings of pointer type meters
Topic, for image obtained, the comparison of pointer and shade is stretched by using greyscale transformation after obtaining monitoring image
Degree, big law are carried out binaryzation, the burr at pointer edge are finally filtered out using opening operation, achievees the effect that shadow removing.
The technical program has preferable performance under different shade degree, can more accurately find pointer edge, calculates
Out total indicator reading and have certain real-time.
It the composite can be widely applied to the remote collection of various transformer and distribution power station operating statuses, automatically analyze and run pipe
The fields such as reason.