CN114881869A - Inspection video image preprocessing method - Google Patents

Inspection video image preprocessing method Download PDF

Info

Publication number
CN114881869A
CN114881869A CN202210303079.XA CN202210303079A CN114881869A CN 114881869 A CN114881869 A CN 114881869A CN 202210303079 A CN202210303079 A CN 202210303079A CN 114881869 A CN114881869 A CN 114881869A
Authority
CN
China
Prior art keywords
picture
image
slope
line segment
value
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.)
Pending
Application number
CN202210303079.XA
Other languages
Chinese (zh)
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.)
Tianjin Sanyuan Electric Information Technology Co ltd
Original Assignee
Tianjin Sanyuan Electric Information 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 Tianjin Sanyuan Electric Information Technology Co ltd filed Critical Tianjin Sanyuan Electric Information Technology Co ltd
Priority to CN202210303079.XA priority Critical patent/CN114881869A/en
Publication of CN114881869A publication Critical patent/CN114881869A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/70Denoising; Smoothing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/214Generating training patterns; Bootstrap methods, e.g. bagging or boosting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • G06F18/241Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N7/00Television systems
    • H04N7/18Closed-circuit television [CCTV] systems, i.e. systems in which the video signal is not broadcast
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10016Video; Image sequence
    • 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

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Evolutionary Biology (AREA)
  • Evolutionary Computation (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • General Engineering & Computer Science (AREA)
  • Artificial Intelligence (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Image Analysis (AREA)

Abstract

The invention provides a method for preprocessing a patrol video image, which comprises the steps of collecting an image of a target object, identifying and classifying the image of the target object, and adopting a target modeling characteristic identification method to identify and process different types of images aiming at different types of target objects; the invention introduces advanced artificial intelligence technical idea, image intelligent analysis, video image identification algorithm based on video image intelligent analysis technical framework and based on deep neural network and traditional image processing technology, greatly improves the video image intelligent identification technical capability based on artificial intelligence, realizes the identification of common fault defect and risk of video image, is applied to typical scenes such as power grid equipment, and provides powerful information technology support for guaranteeing the stability of power grid and improving the safe production level of the power grid.

Description

Inspection video image preprocessing method
Technical Field
The invention relates to the technical field of image processing, in particular to a method for preprocessing a patrol video image.
Background
The effect of video image pre-processing is to improve the video image quality. Due to the influence of factors such as cost and environment, the quality of the obtained original video is not high or even low. For example, due to environmental, noise, lighting, motion, etc., images often appear blurred, distorted, noisy, too bright or too dark, unsharp in color, etc. often acquired images. For the video with poor comparison, compression, transmission, decoding and display are carried out, the observed monitoring video is often unsatisfactory, and further mining of video image information cannot be carried out. The key is how to improve the quality of the acquired and processed high-quality inspection video image under the existing conditions. Therefore, preprocessing the collected inspection video image is a very critical step, if the previous inspection video image can be processed well in advance, the quality of the collected image is improved, and the equipment characteristic information in the video image is extracted, so that the method is very beneficial to the subsequent processing of the video image information.
Disclosure of Invention
The object of the present invention is to solve at least one of the technical drawbacks mentioned.
Therefore, an object of the present invention is to provide a method for preprocessing a video image for inspection, so as to solve the problems mentioned in the background art and overcome the disadvantages in the prior art.
In order to achieve the above object, as shown in fig. 1, an embodiment of an aspect of the present invention provides a method for preprocessing an inspection video image, including acquiring an image of a target object, identifying and classifying the image of the target object, and for different types of target objects, performing feature identification processing on the different types of images by using a target modeling feature identification method;
the target modeling feature identification method comprises the steps of defogging an image, and defogging the image by adopting the following formula algorithm:
Figure BDA0003563610920000011
wherein J (x) is the recovered haze-free image, I (x) is the image to be dehazed, A is the global atmospheric optical component parameter, t (x) is the transmittance, t 0 Is a threshold value.
The target modeling feature identification method further comprises the step of filtering and denoising the image, wherein the filtering and denoising of the image comprises the following steps:
step S1, set f ij Is the gray scale of point (i, j), A ij For the current working window, f min Is S i,j Minimum value of middle gray, f max Is S i,j Maximum value of gray scale in (f) med Is S i,j Middle gray level median value, set as A max Is the preset maximum allowable door window opening.
Step S2, if f min <f med <f max Go to step S3; otherwise go to step S4.
Step S3, if f min <f ij <f max Then output f ij (ii) a Otherwise output f med
Step S4 increasing the Window A ij Size; if A ij <A max Go to step S2; otherwise output f ij
Preferably, the target modeling feature recognition method further includes debouncing the video image to obtain a stable video, including:
and C1, extracting the feature points in the image reference frame and the current frame by using a Scale Invariant Feature Transform (SIFT) algorithm, and matching.
And step C2, obtaining the global motion parameters through a random sampling consensus RANSAC algorithm.
And step C3, performing low-pass filtering of the adaptive size on the global motion parameter to obtain a stationary motion parameter, and using the difference value of the stationary motion parameter and the global motion parameter as a jitter parameter to realize motion compensation.
And step C4, repairing the blank area in the video frame after the de-jittering by combining the image texture synthesis algorithm to obtain a stable video.
In any of the above aspects, preferably, the target modeling feature identification method further includes identifying a smoke feature in the image, including:
and D1, acquiring the real-time video image and circularly acquiring each frame of picture in the real-time video.
And D2, acquiring the value of each pixel point in each frame of picture.
And D21, re-taking each pixel value as the minimum channel pixel value.
And D22, forming a minimum channel pixel picture according to the minimum channel pixel value.
And D23, carrying out averaging filtering on each pixel in the minimum channel pixel picture.
And D24, setting the value of each pixel point to be 0 if the value of each pixel point in the filtered minimum channel pixel picture is less than 150, and setting the value of each pixel point to be 255 if the value of each pixel point in the filtered minimum channel pixel picture is more than or equal to 150.
And D25, generating a first binarized picture according to the set value of each pixel point in the step D24.
And D3, converting the picture acquired in the step D1 into a gray picture.
And D31, identifying the moving object picture in the gray-scale picture.
And D32, converting the identified moving object picture into a second binary picture.
And D4, recognizing foreground and background in the gray picture and extracting a foreground picture.
And D41, converting the extracted foreground picture into a third binary picture.
And D5, performing an AND operation on the second binarized picture obtained in the step D32 and the third binarized picture obtained in the step D41 to form a fourth binarized picture.
And D6, performing AND operation on the first binary picture and the fourth binary picture to obtain a fifth binary picture, wherein when the value of a pixel point in the fifth binary picture is 255, the pixel point is indicated to have smoke.
In any of the above schemes, preferably, the target modeling feature identification method further includes determining an open/close state of a substation disconnecting switch, including:
and L1, acquiring a monitored video of the disconnecting switch in the video monitoring of the transformer substation.
And L2, extracting one frame in the video of the isolating switch and converting the frame into a picture format to form an isolating switch picture.
And L3, cutting the interference edge of the picture of the isolating switch and converting the interference edge into a grey-scale picture of the isolating switch.
And L4, filtering and smoothing the grey-scale picture of the isolating switch by adopting local gradient, and then performing image binarization processing to obtain a binary picture of the isolating switch.
And L5, performing line segment fitting on the binary pictures of the isolating switch in a 3x3 window mode to obtain a first line segment group of the isolating switch after fitting.
And L6, solving the length of the line segments in the line segment group, screening the line segments within a set length range to obtain a second line segment group of the isolating switch, solving the segmentation slope of each line segment in the second line segment group, further solving the average slope of each line segment, and screening the line segments within the set average slope range to obtain a third line segment group of the isolating switch.
L7, projecting the line segments in the third line segment group of the isolating switch according to the direction of the reference slope angle, and calculating the duty ratio and the interval number of the projection on the projected reference line after the projection; and judging the opening and closing state of the isolating switch according to the duty ratio and the interval number.
In any of the above schemes, preferably, the target modeling feature recognition method further includes determining an open/close state of a door of the mechanism, and includes:
and E1, connecting the camera to acquire the picture of the mechanism box contained by the camera.
And E2, converting the acquired image of the mechanism box into a gray image, cutting off part of the edge of the gray image, and obtaining the cut gray image.
Step E3: filtering the cut gray level picture in a 3x3 window average value mode, and extracting the filtered picture in a Canny edge extraction mode to obtain a mechanism box binarization picture.
Step E4: extracting line segments in the binaryzation picture of the mechanism box by adopting a cvHoughLines algorithm to obtain a first line segment group of the mechanism box, calculating the length of the first line segment group of the mechanism box, screening out line segments which are in accordance with the set length range of the mechanism box line to obtain a second line segment group of the mechanism box, and calculating the slope of the line segments in the second line segment group of the mechanism box.
And E5, screening out the line segments of which the slope of the line segments in the second line segment group of the mechanism box is within the set slope range, and counting the line segments into the same distribution section when the slope difference of the line segments in the second line segment group of the mechanism box is 0.5 to form a slope distribution section.
And E6, calculating the line segment number of the slope distribution section, screening the slope distribution section in a set range to form a residual slope distribution section, calculating the slope average value of the qualified line segment of the mechanism box, which is greater than the threshold value of the line segment number, in the slope distribution section, calculating the slope average value of the line segment in the residual slope distribution section, calculating the difference value of the slope average values, and judging the opening and closing state of the mechanism box door according to the difference value of the slope average values.
In any of the above schemes, preferably, the target modeling feature identification method further includes determining an open/close state of the circuit breaker, and the method includes:
and F1, acquiring a transformer substation breaker state picture.
And F2, converting the acquired breaker state picture into a gray picture, and cutting off part of the edge of the gray picture to obtain the cut-off breaker state gray picture.
Step F3: and filtering the cut breaker state gray level picture by adopting an average value mode of a 3x3 window, and extracting a Canny edge of the filtered picture to obtain a breaker binary picture.
And F4, adopting transverse segmentation lines at intervals of 10 pixels to segment the circuit breaker state binarization picture from top to bottom, recording edge points as cross points when intersection exists with the edge points binarized by the circuit breaker in the segmentation process, and recording all the cross points as a cross point array.
Step F5, adopting a 2x2 sliding window to check whether other connected edge points exist; if yes, checking whether the edge point is one point in the intersection point array, if yes, recording the intersection point as the same group of intersection points, and if not, continuing sliding window checking; if no other connected edge points exist, ending the sliding window checking process and starting the next checking process; and circularly executing the process to finally obtain a plurality of groups of cross point sets, wherein each group of cross points in the plurality of groups of cross point sets are on the same communicated edge line.
And F6, calculating the slope between adjacent intersections in each intersection group in the multi-group intersection set, and screening out line segments within a set slope value range according to the slope values between the intersections to obtain effective line segments.
F7, respectively counting the slope of each effective line segment, judging whether the effective line segment is reasonable data of the state of the circuit breaker, and if the effective line segment is not reasonable data, neglecting; and judging the opening and closing state of the circuit breaker according to the reasonable data of the state of the circuit breaker.
In any of the above aspects, preferably, the target modeling feature identification method further includes identifying a pointer reading on the pointer-type dial image, including:
g1, obtaining a pointer type dial plate picture and cutting edges; and converting the cut pointer type dial picture into a gray picture.
And G2, binarizing the pointer dial plate picture by adopting a threshold segmentation method, setting a gray threshold value, and dividing pixels in the pointer dial plate picture into a target area and a background area by utilizing the difference of the gray characteristics of the background in the pointer dial plate picture and a target to be acquired to form a refined pointer dial plate picture.
G3, carrying out Hough transformation on the refined pointer type dial picture, mapping data on the refined pointer type dial picture into a rho-theta transformation domain, and finding a peak point in the rho-theta transformation domain, namely, refining a straight line in the pointer type dial picture, namely, a pointer; detecting line segments by using a Hough transform method, and converting the line segments obtained by detection of the Hough line segment detection method into slope representation; and finding out the straight line where the pointer is located by using Hough transform, determining the end point of the straight line, calculating the slope of the straight line according to the coordinates of the end point, further calculating the angle of the straight line, and obtaining the quantity value shown by the dial.
In any of the above schemes, preferably, the target modeling feature recognition method further includes recognizing two-dimensional code identification and information, including:
and step H1, acquiring real-time video data in the patrol process.
Step H2, extracting pictures in the video frame by frame.
H3, filtering the picture; and then, carrying out binarization processing on the picture, and converting the picture into a two-dimensional code identification binarization picture.
H4, judging whether the two-dimensional code identification binary image has the characteristic region of the two-dimensional code: if so, go to step H5; if not, go to step H2.
H5, judging whether the proportion of the two-dimensional codes in the two-dimensional code identification binary image exceeds a set threshold value, if so, turning to the step H6; if not, go to step H51.
Step H51: and judging whether the lens of the binary image identified by the two-dimensional code is drawn up or not, if so, turning to the step H6, and if not, turning to the step H2.
And step H6, judging whether the two-dimensional code is the two-dimensional code judged before, if so, turning to step H2, and if not, turning to step H7.
And H7, saving the two-dimensional code identification binary image as the searched specified two-dimensional code binary image, judging whether the patrol video is finished, if so, turning to the step H8, and if not, turning to the step H2.
Step H8: and acquiring a two-dimensional code area in a binary image containing the specified two-dimensional code, and mapping the area to an actual image frame.
Step H9: and (3) dividing the picture into two-dimensional code area pictures, and performing angle conversion on the two-dimensional code according to the shape of the two-dimensional code area pictures to obtain standard two-dimensional code pictures.
Step H10: and identifying the two-dimension code information of the converted two-dimension code picture by adopting a two-dimension code identification algorithm, and storing the two-dimension code information.
In any of the above schemes, preferably, the target modeling feature identification method further includes identifying the inspection picture, and the identifying process is performed on the inspection picture acquired by the human or unmanned aerial vehicle, and includes:
step K1-establishing image-based object and defect classification criteria.
And K2, labeling the image sample library based on the established classification standard.
And step K3, dividing the sample library into a training set and a testing set, and performing sample expansion on the defect samples with insufficient quantity in the training set.
And K4, selecting different hyper-parameters to train the model by respectively using a Faster RCNN algorithm, an R-FCN algorithm, an SSD algorithm and a YOLO algorithm.
And K5, evaluating the trained model, and selecting the model meeting the highest limit precision for target recognition according to the limit of different scenes on the inference speed.
In any of the above schemes, preferably, the target modeling feature identification method further includes identifying a patrol video target, which is used for identifying a patrol video acquired by a human machine or an unmanned machine, and includes:
step P1, image-based object and defect classification criteria are established.
And P2, performing frame extraction on the video based on the established classification standard, and labeling the extracted image sample.
And step P3, dividing the sample library into a training set and a testing set, and performing sample expansion on the defect samples with insufficient quantity in the training set.
And step P4, respectively using a Faster RCNN algorithm, an R-FCN algorithm, an SSD algorithm and a YOLO algorithm to select different hyper-parameters to train the model.
And P5, evaluating the trained model, and processing the identification algorithm which does not meet the requirements in a frame skipping manner during evaluation and prediction.
Compared with the prior art, the invention has the advantages and beneficial effects that:
1. according to the method for preprocessing the patrol video image, the clear device scene image is obtained by defogging and filtering the image, the image quality of the acquisition device is improved, more detailed parts of the image are better reserved, and continuous image analysis is facilitated.
2. The inspection video image preprocessing method provided by the invention is used for acquiring the corresponding equipment image according to different equipment environments and characteristics thereof and by combining with a specific typical application scene, extracting the characteristics of the images of different equipment, and has the advantages of high processing efficiency, good image characteristic extraction effect and convenience for further processing the equipment image information in the follow-up process.
3. The routing inspection video image preprocessing method has low requirement on hardware equipment, high processing efficiency, high image processing precision and better image feature extraction effect.
Additional aspects and advantages of the invention will be set forth in part in the description which follows and, in part, will be obvious from the description, or may be learned by practice of the invention.
Drawings
The above and/or additional aspects and advantages of the present invention will become apparent and readily appreciated from the following description of the embodiments, taken in conjunction with the accompanying drawings of which:
fig. 1 is a schematic flow chart of a method for preprocessing an inspection video image according to an embodiment of the invention;
fig. 2a is a complete hardware picture in an application embodiment of a method for preprocessing an inspection video image according to an embodiment of the present invention;
fig. 2b is a partially enlarged view of a pin portion in the complete hardware fitting picture in fig. 2a according to an embodiment of the method for preprocessing the patrol video image;
fig. 3 is a partially enlarged view of a pin portion in the complete hardware fitting picture in fig. 2a according to an embodiment of the present invention;
FIG. 4 is an image before defogging in an embodiment of a method for preprocessing an inspection video image according to the present invention;
FIG. 5 is a defogged image of an applied embodiment of a method for preprocessing an inspection video image according to an embodiment of the present invention;
FIG. 6 is a diagram illustrating an image before filtering and denoising in an embodiment of a method for preprocessing an inspection video image according to the present invention;
fig. 7 is an image after filtering and denoising in an application embodiment of a method for preprocessing an inspection video image according to an embodiment of the present invention.
Detailed Description
Reference will now be made in detail to embodiments of the present invention, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to the same or similar elements or elements having the same or similar function throughout. The embodiments described below with reference to the drawings are illustrative and intended to be illustrative of the invention and are not to be construed as limiting the invention.
The inspection video image preprocessing method comprises the steps of collecting images of target objects, identifying and classifying the images of the target objects, and performing feature identification processing on the images of the different types of objects by adopting a target modeling feature identification method aiming at the different types of the target objects.
The target modeling feature identification method comprises the steps of defogging an image, and when the image needs to be defogged, adopting the following formula algorithm to defogg the image:
Figure BDA0003563610920000071
wherein J (x) is the recovered haze-free image, I (x) is the image to be dehazed, A is the global atmospheric optical component parameter, t (x) is the transmittance, t 0 Is a threshold value.
In most non-sky local areas, some pixels will always have at least one color channel with a very low value. In other words, the minimum value of the light intensity in this region is a very small number. The following gives a mathematical definition of the dark channel, which for an arbitrary input image J can be expressed by:
J dark (x)=min y∈Ω(x) [min c∈(r,g,b) J c (y)]
wherein J is dark Denotes the dark channel, J c Representing each channel of the color image and omega (x) represents a window centered on pixel x. The meaning of the above formula is also simple to express by using codes, the minimum value in each pixel RGB component is firstly calculated, and stored in a gray scale image with the same size as the original image, and then the minimum value filtering is performed on the gray scale image, the Radius of the filtering is determined by the window size, and generally, WindowSize is 2Radius + 1. That is to say, taking pixel point x as the center, respectively taking the minimum value in window Ω in the three channels, then taking the minimum value of the three channels as the value of the dark channel of pixel point x, the priori theory of the dark channel indicates that: j. the design is a square dark → 0, there are many factors that cause low channel values in the dark primary in real life. For example, shadows of glass windows in automobiles, buildings and cities, or projections of natural landscapes such as leaves, trees and rocks; the surface of an object with bright colors, wherein the values of some channels in three channels of RGB are very low, plants such as green grassland, trees and the like, red or yellow flowers, fruits or leaves, or blue and green water surfaces; darker objects or surfaces, such as dark trunks, stones, and road surfaces. In short, natural scenes are shaded or colored everywhere, and the dark primary colors of the images of the scenes always show a darker state, so that the foggy images are cleaned from the perspective of the physical modelTo understand the physical cause of the foggy image, the atmospheric scattering model for foggy weather is understood.
The atmospheric scattering physical model consists of two parts, the first part is called Direct Attenuation term (Direct Attenuation) and also called Direct propagation, and the second part is called atmospheric illumination (Airlight)
First, in computer vision and computer graphics, a fog map forming model described by the following equation is widely used:
I(x)=J(x)t(x)+A[1-t(x)]
where I (x) is the image to be dehazed, J (x) is the haze-free image to be restored, parameter A is the global atmospheric light component, and t (x) is the transmittance. The now known condition is i (x), requiring a target value j (x). This is an equation with numerous solutions, as known from basic algebraic knowledge. The solution can only be found on the basis of some a priori information. Slightly modifying the above formula as follows:
Figure BDA0003563610920000081
as described above, the superscript c means R, G, B three channels.
First, assuming that the transmittance t (x) is constant in each window, defined as t (x), and the value of a is given, two minimum operations are performed on both sides of the above equation to obtain the following equation:
Figure BDA0003563610920000082
in the above formula, J is a fog-free image to be obtained, and according to the dark channel prior theory:
Figure BDA0003563610920000083
thus, it can be deduced that:
Figure BDA0003563610920000091
bringing the conclusion of the above formula back to the formula, we obtain:
Figure BDA0003563610920000092
this is an estimated value of the transmittance t to (x).
In real life, even in a fine day, some particles exist in the air, so that the influence of fog can be felt by looking at a distant object. In addition, the existence of the fog gives a human feeling of the existence of the depth of field, and therefore a certain degree of fog remains at the time of defogging. This can be achieved by introducing a factor between [0,1] in the above equation, e.g. 0.95, and the above equation is modified to:
Figure BDA0003563610920000093
the above reasoning assumes that the global atmospheric light a value is known, and in practice, this value can be obtained from the foggy image by the dark channel image. The method comprises the following specific steps: the first brightest 0.1% pixel is first extracted from the dark channel image by the magnitude of the luminance. Then, the value of the point having the highest brightness at the corresponding position is found in the original foggy image I and taken as the value of a, and thus, the recovery of the fogless image can be performed.
Considering that when the value of the current transmission image t is small, the value of J may be too large, so that the image as a whole is over to the white field, a threshold t0 may be set, and when the value of t is smaller than t0, t is t0, for example, t0 is 0.1. Therefore, from the first equation, the final image restoration equation is as follows:
Figure BDA0003563610920000094
according to the above formula, the image defogging algorithm has an obvious result and a good defogging effect, and is an image before defogging as shown in fig. 4 and an image after defogging as shown in fig. 5.
Further, when the probability of occurrence of noise is high, the conventional median filtering is poor. Because the window size of the conventional median filter is fixed, both denoising and image detail protection cannot be taken into account. The target modeling feature identification method further comprises the step of filtering and denoising the image, wherein the filtering and denoising of the image comprises the following steps:
step S1, set f ij Is the gray scale of point (i, j), A ij For the current working window, f min Is S i,j Minimum value of middle gray, f max Is S i,j Maximum value of gray scale in (f) med Is S i,j Middle gray level median value, set as A max Is the preset maximum allowable door window opening.
Step S2, if f min <f med <f max Go to step S3; otherwise go to step S4.
Step S3, if f min <f ij <f max Then output f ij (ii) a Otherwise output f med
Step S4 increasing the Window A ij Size; if A ij <A max Go to step S2; otherwise output f ij
It can be seen that the noise point is monitored and identified as f in the algorithm min And f max Is taken as reference, if f min <f med <f max Indicates f med Not noise, then according to f min <f ij <f max Judgment of f ij Whether or not it is noise, when f ij And f med When neither is impulse noise, the output f is preferentially output ij
The image denoising method dynamically changes the size of a window of a filter in the filtering process according to preset conditions, changes the size of the filtering window according to the preset conditions, judges whether a current pixel is noise or not according to certain conditions, and replaces the current pixel with a neighborhood median value if the current pixel is noise; otherwise, no change is made. By the method, salt and pepper noise with high probability can be filtered, and details of the image can be better protected, which cannot be achieved by a conventional median filter, and fig. 6 shows the image before filtering and denoising, and fig. 7 shows the image after filtering and denoising.
Further, the target modeling feature recognition method further includes debouncing the video image to obtain a stable video, including:
and C1, extracting the feature points in the image reference frame and the current frame by using a Scale Invariant Feature Transform (SIFT) algorithm, and matching.
And C2, obtaining the global motion parameters by a random sample consensus RANSAC algorithm.
And step C3, performing low-pass filtering of the adaptive size on the global motion parameter to obtain a stationary motion parameter, and using the difference value of the stationary motion parameter and the global motion parameter as a jitter parameter to realize motion compensation.
And step C4, repairing the blank area in the video frame after the de-jittering by combining the image texture synthesis algorithm to obtain a stable video.
Firstly, extracting feature points in a reference frame and a current frame by using a Scale Invariant Feature Transform (SIFT) algorithm, and matching the feature points; then obtaining global motion parameters through random sample consensus (RANSAC) algorithm; then, carrying out low-pass filtering of self-adaptive size on the global motion parameters to obtain stable motion parameters, and using the difference value of the stable motion parameters as a jitter parameter to realize motion compensation; and finally, restoring the blank area in the video frame after the dithering is removed by combining an image texture synthesis algorithm, and finally obtaining the stable video.
The stable SIFT characteristics are adopted, so that the image matching result is accurate, and a good foundation is laid for the next global motion estimation; the RANSAC algorithm well removes the influence of foreground moving objects, so that a relatively accurate global motion estimation result is obtained, the low-pass filter with the self-adaptive size well separates unintentional jitter parameters and intentional motion parameters, and when the video jitter is detected, the steps are adopted to remove the video jitter.
Specifically, the target modeling feature identification method further includes identifying smoke features in the image, including:
and D1, acquiring the real-time video image and circularly acquiring each frame of picture in the real-time video.
And D2, acquiring the value of each pixel point in each frame of picture.
And D21, re-taking each pixel value as the minimum channel pixel value.
And D22, forming a minimum channel pixel picture according to the minimum channel pixel value.
D23, carrying out averaging filtering on each pixel in the minimum channel pixel picture; specifically, averaging filtering is performed in 8 gradient directions.
And D24, setting the value of each pixel point to be 0 if the value of each pixel point in the filtered minimum channel pixel picture is less than 150, and setting the value of each pixel point to be 255 if the value of each pixel point in the filtered minimum channel pixel picture is more than or equal to 150.
And D25, generating a first binarized picture according to the set value of each pixel point in the step D24.
And D3, converting the picture acquired in the step D1 into a gray picture.
D31, identifying moving object pictures in the gray level pictures; the moving object is identified.
And D32, converting the identified moving object picture into a second binary picture.
And D4, recognizing foreground and background in the gray level picture, extracting a foreground picture, and separating the foreground and the background.
And D41, converting the extracted foreground picture into a third binary picture.
And D5, performing an AND operation on the second binarized picture obtained in the step D32 and the third binarized picture obtained in the step D41 to form a fourth binarized picture.
And D6, performing AND operation on the first binary picture and the fourth binary picture to obtain a fifth binary picture, wherein when the value of a pixel point in the fifth binary picture is 255, the pixel point is indicated to have smoke.
When a smoke scene image needs to be identified, the steps are adopted to identify and judge smoke, the traditional processing technology usually identifies the smoke according to the shape dynamic characteristics, color characteristics and the like of the smoke, however, due to weather haze reasons, similar characteristic objects and the like, the smoke image identification method combining the lowest pixel characteristic value, regional gradient equalization, dynamic detection and foreground and background separation usually causes larger interference.
Further, the target modeling feature identification method further comprises the step of judging the opening and closing state of the substation disconnecting switch, and the step of:
l1, acquiring a monitored video of the disconnecting switch in the video monitoring of the transformer substation; a frame in the real-time video is acquired for subsequent detection.
And L2, extracting one frame in the video of the isolating switch and converting the frame into a picture format to form an isolating switch picture.
And L3, cutting the interference edge of the picture of the isolating switch and converting the interference edge into a grey-scale picture of the isolating switch.
And L4, filtering and smoothing the grey-scale picture of the isolating switch by adopting local gradient, and then performing image binarization processing to obtain a binary picture of the isolating switch.
L5, performing line segment fitting on the binary image of the isolating switch in a 3x3 window mode to obtain a first line segment group of the isolating switch after fitting; in the fitting process, only the binary point positions meeting a certain slope threshold value are used as the same line segment.
L6, solving the segment length in the segment group, and screening out the segments within the set length range, specifically, excluding the segments smaller than a certain length threshold value, and only keeping the segments meeting the conditions; obtaining a second line segment group of the isolating switch, further solving the sectional slope of each line segment in the second line segment group according to the distance of 5 pixels for each line segment, after the solution, further solving the average slope of each line segment, screening out the line segments within the set average slope range, specifically eliminating the line segments of which the solved average slope deviates from the reference slope and is greater than a certain threshold value, and only keeping the line segments meeting the conditions; and reserving all the line segments meeting the conditions to obtain a third line segment group of the isolating switch.
L7, projecting the line segments in the third line segment group of the isolating switch according to the direction of the reference slope angle, and calculating the duty ratio and the interval number of the projection on the projected reference line after the projection; and judging the opening and closing state of the isolating switch according to the duty ratio and the interval number.
Because a large number of close-range interference objects, windows, scaffolds and the like exist in the background, the device division state and the closing state can be accurately distinguished by setting the judgment threshold value, and when the opening and closing state of the substation disconnecting switch needs to be judged, the steps are adopted, so that the processing efficiency is high.
Optionally, the target modeling feature identification method further includes determining an opening/closing state of a door of the mechanism, including:
e1, connecting the camera to obtain the picture of the mechanism box contained in the camera; connecting the camera equipment by using an equipment interface library function provided by a manufacturer according to the type of the camera; calling a preset position corresponding to the mechanism box by using an equipment interface library function provided by a manufacturer according to a preset camera preset position; acquiring a video of a camera by using an equipment interface library function provided by a manufacturer; acquiring a frame of picture in a video of a camera, and taking the picture as the basis of subsequent image analysis; and according to the circulation period of 1 frame per second, circulating the step S14, circularly acquiring corresponding pictures and analyzing the door state of the mechanism through the pictures.
And E2, converting the acquired image of the mechanism box into a gray image, cutting off part of the edge of the gray image, and obtaining the cut gray image.
Step E3: filtering the cut gray level picture in a 3x3 window average value mode, and extracting the filtered picture in a Canny edge extraction mode to obtain a mechanism box binarization picture.
Step E4: extracting line segments in a binaryzation picture of the mechanism box by adopting a cvHoughLines algorithm to obtain a first line segment group of the mechanism box, calculating the length of the first line segment group of the mechanism box, and screening out line segments which are in accordance with a set length range of the mechanism box, namely when the length is smaller than a threshold range of the length of the line segments, ignoring the line segments, and setting the threshold of the length of the line segments to be 50; and obtaining a second line segment group of the mechanism box, and calculating the slope of the line segments in the second line segment group of the mechanism box.
E5, screening out the line segments of which the line segment slopes are within a set slope range in the second line segment group of the mechanism box, namely setting a slope threshold range of the line segment slopes, wherein the slope threshold range is larger than 8 and smaller than-8; judging whether the slope of the line segment is within a slope threshold range, and if so, ignoring the line segment; and when the slope difference value of the line segments in the second line segment group of the mechanism box is 0.5, counting the same distribution segment to form a slope distribution segment.
Step E6, calculating the line segment number of the slope distribution section, screening the slope distribution section in the set range, namely setting the threshold value of the line segment number of each slope distribution section to be 3, and deleting the slope distribution section when the line number is less than the threshold value; forming a residual slope distribution section, calculating the slope average value in the slope distribution section of the qualified line segment of the mechanism box which is greater than the threshold value of the number of the line segments, calculating the slope average value of the line segments in the residual slope distribution section, and calculating the difference value of the slope average values, wherein when the distribution section with the difference value greater than 1 exists, the state of the box door of the mechanism is opened, otherwise, the box door of the mechanism is closed, and the opening and closing state of the box door of the mechanism is judged according to the difference value of the slope average values.
The target modeling characteristic identification method comprises the step of judging the opening and closing state of the mechanism box door, and when the opening and closing state of the mechanism box door needs to be judged, the steps are adopted, so that the image data calculation amount is small, the performance requirement on hardware equipment is low, and the method can be widely applied to various mechanism boxes installed in a transformer substation. Compared with other methods, other electronic equipment does not need to be installed, and compared with a machine learning method, a large amount of data samples do not need to be collected and manufactured, and the performance requirement on hardware is low.
Further, the target modeling feature identification method further comprises the step of judging the opening and closing state of the circuit breaker, and the method comprises the following steps:
and F1, acquiring a transformer substation breaker state picture.
And F2, converting the acquired breaker state picture into a gray picture, and cutting off part of the edge of the gray picture to obtain the cut-off breaker state gray picture.
Step F3: and filtering the cut breaker state gray level picture by adopting an average value mode of a 3x3 window, and extracting a Canny edge of the filtered picture to obtain a breaker binary picture.
Step F4, adopting a transverse dividing line with the interval of 10 pixels to divide the binary image of the state of the circuit breaker from top to bottom, recording edge points as cross points when intersection exists with the edge points of the binary image of the circuit breaker in the dividing process, and recording all the cross points as a cross point array; the arrangement mode of the cross point array is from left to right and from top to bottom.
Step F5, adopting a 2x2 sliding window to check whether other connected edge points exist; if yes, checking whether the edge point is one point in the intersection point array, if yes, recording the intersection point as the same group of intersection points, and if not, continuing sliding window checking; if no other connected edge points exist, ending the sliding window checking process and starting the next checking process; and circularly executing the process to finally obtain a plurality of groups of intersection point sets, wherein each group of intersection points in the plurality of groups of intersection point sets are on the same communicated edge line.
And step F6, calculating the slope between adjacent intersections in each intersection group in the multi-group intersection set, screening out line segments within a set slope value range according to the slope values between the intersections, namely judging whether the intersection combination is an effective line segment or an invalid line segment according to the value in the slope, eliminating the invalid limit and keeping the effective line segment.
F7, respectively counting the slope of each effective line segment, judging whether the effective line segment is reasonable data of the state of the circuit breaker, and if the effective line segment is not reasonable data, neglecting; and judging the opening and closing state of the circuit breaker according to the reasonable data of the state of the circuit breaker. When the opening and closing state of the circuit breaker needs to be judged, the steps are adopted, and the method is simple, reliable, convenient and practical.
Further, the target modeling feature recognition method further comprises recognizing a pointer reading on the pointer dial image, and the method comprises the following steps:
g1, obtaining a pointer type dial plate picture and cutting edges; and converting the cut pointer type dial picture into a gray picture.
And G2, binarizing the pointer dial picture by adopting a threshold segmentation method, realizing image binarization by adopting the threshold segmentation method, regarding the image as two or more types of areas with different gray levels by utilizing the obvious difference of the gray characteristics of the background and the target in the image, and selecting one or more appropriate threshold values to classify the pixels in the image into the target or background area. Setting a gray threshold value, and dividing pixels in the pointer type dial plate picture into a target area and a background area by using the difference of the gray characteristics of the background in the pointer type dial plate picture and a target to be acquired to form a refined pointer type dial plate picture.
Threshold segmentation based on the initial single threshold segmentation algorithm, various methods such as gradient-based edge strength algorithm, iterative threshold algorithm, local multi-threshold segmentation algorithm, maximum inter-class variance method, maximum entropy method, moment keeping method, etc. have been developed, and they are different in that the selection method of the threshold is not very same.
G3, carrying out Hough transformation on the refined pointer type dial picture, mapping data on the refined pointer type dial picture into a rho-theta transformation domain, and finding a peak point in the rho-theta transformation domain, namely, refining a straight line in the pointer type dial picture, namely, a pointer; detecting line segments by using a Hough transform method, and converting the line segments obtained by detection of the Hough line segment detection method into slope representation; and finding out the straight line where the pointer is located by using Hough transform, determining the end point of the straight line, calculating the slope of the straight line according to the coordinates of the end point, further calculating the angle of the straight line, and obtaining the quantity value shown by the dial. When the pointer reading on the pointer dial plate image needs to be identified, the steps are adopted, the processing efficiency is high, the extraction of the features is more accurate and reliable, and the method is convenient and practical.
Specifically, the target modeling feature recognition method further includes recognizing two-dimensional code identification and information, including:
and step H1, acquiring real-time video data in the patrol process.
Step H2, extracting pictures in the video frame by frame.
H3, filtering the picture; and then, carrying out binarization processing on the picture, and converting the picture into a two-dimensional code identification binarization picture.
H4, judging whether the two-dimensional code identification binary image has the characteristic region of the two-dimensional code: if so, go to step H5; if not, go to step H2.
H5, judging whether the proportion of the two-dimensional codes in the two-dimensional code identification binary image exceeds a set threshold value, if so, turning to the step H6; if not, go to step H51.
Step H51: and judging whether the lens of the binary image identified by the two-dimensional code is drawn up or not, if so, turning to the step H6, and if not, turning to the step H2.
And step H6, judging whether the two-dimensional code is the two-dimensional code judged before, if so, turning to step H2, and if not, turning to step H7.
And H7, saving the two-dimensional code identification binary image as the searched specified two-dimensional code binary image, judging whether the patrol video is finished, if so, turning to the step H8, and if not, turning to the step H2.
Step H8: and acquiring a two-dimensional code area in a binary image containing the specified two-dimensional code, and mapping the area to an actual image frame.
Step H9: the method comprises the steps of dividing a picture into two-dimensional code area pictures, and performing angle conversion on a two-dimensional code according to the shape of the two-dimensional code area pictures to obtain standard two-dimensional code pictures; because the visual angle of the camera cannot be directly opposite to the two-dimensional code label plane under normal conditions, the two-dimensional code sub-image detected in the video frame image has certain perspective deformation. But according to the characteristic that the two-dimensional code is square, the projective geometric transformation can be utilized to carry out image plane correction on the two-dimensional code window, and the standard shape is recovered. Assuming that the imaging plane captured by the camera is the standard plane to be solved is the standard plane, the four vertexes of the two-dimensional code on the plane can be normalized through one projective transformation. And acquiring four vertexes of the two-dimensional code on the plane by using a Harris angular point detection algorithm, solving a homography matrix by using a direct linear transformation algorithm, and transforming the imaging plane to obtain a standard two-dimensional code image.
Step H10: and (3) for the converted two-dimensional code picture, adopting a two-dimensional code recognition algorithm, specifically, adopting a zxing open source library to carry out two-dimensional code label recognition, and storing two-dimensional code information.
Two-dimensional code label identification technology has been widely used in many fields such as commodity circulation and social contact. Due to the influence of the visual angle of the camera and the imaging quality, a clear front image of the two-dimensional code cannot be acquired generally.
The method mainly adopts two-dimensional code detection based on LBP (local binary pattern) characteristics and a nearest neighbor algorithm; then, projective correction is carried out on the detected two-dimensional code part; and finally, performing two-dimensional code label identification by using a zxing open source library.
The two-dimensional code has rich shape gradient, LBP characteristics are used as detectors, a sliding window scanning mode is adopted in the detection process, namely all sub-windows are extracted from the input video frame image from left to right and from top to bottom. And considering that the visual angle of the monitoring camera is uncertain, parameters and configurations with different scales and proportions are adopted. The acquired sub-windows are normalized into a standard window, and then LBP characteristics of each pixel are extracted to serve as characteristic description of the window. In the application, each window is characterized by a 256-dimensional vector.
In consideration of the complexity of a scene, the distribution of all sub-windows in a feature vector space is complex, and a common binary classifier such as a linear classifier cannot effectively divide a two-dimensional code window and a non-two-dimensional code window. Thus, the nearest neighbor algorithm is employed herein for example-based classification learning. In order to improve the searching efficiency, a locality sensitive hashing algorithm is adopted to carry out indexing and nearest neighbor searching on the vectors. When the two-dimensional code identification and information need to be identified, the steps are adopted, the image preprocessing effect is good, the identification precision is high, and the identification is more accurate and reliable.
Further, the target modeling feature identification method further includes identifying the inspection picture, and is used for identifying and processing the inspection picture acquired by the manned machine or the unmanned machine, and the method includes the following steps:
step K1, image-based object and defect classification criteria are established. Existing defect classification and classification methods do not take into account differences in the number of defects and similarities between different defects. For example, the pin holes in the grading shield ring and the ground wire suspension type hardware fitting can be regarded as similar defects; however, the type of foreign matter type defect needs to be classified into a finer particle size according to the form of the foreign matter.
And K2, labeling the image sample library based on the established classification standard.
Step K3, dividing the sample library into a training set and a testing set, and carrying out sample expansion on the defect samples with insufficient quantity in the training set;
k4, respectively using a Faster RCNN algorithm, an R-FCN algorithm, an SSD algorithm and a YOLO algorithm, and selecting different hyper-parameters to train the model; during training, the picture is scaled down or cut based on the characteristics of the inspection picture and the limitation of hardware such as a GPU, so that the size of the picture can meet the limitation of a GPU memory. And (3) training the model by adopting a multi-GPU combined training method and a small specific random gradient descent (mini-batch SGD), and placing different areas of each picture in the same batch (batch) for training so as to reduce the influence of a cutting strategy on the accuracy of the algorithm. In addition, a plurality of methods are adopted to enhance the deep network model so as to improve the algorithm precision.
And K5, evaluating the trained model, and selecting the model meeting the highest limit precision for target recognition according to the limit of different scenes on the inference speed.
In model training and target recognition, the adopted improved algorithms comprise a deformable convolution network layer, an elastic non-maximum suppression method and the like.
When the inspection picture needs to be identified, the steps are adopted, and the defect distribution of different types in the inspection picture has a long tail effect. Taking a defect image database collected by helicopter inspection as an example, the defect of a facility with missing pins accounts for about 50% of the total defect amount, the rest defects comprise that an insulator is automatically exploded or damaged by about 10%, a bird nest is generated by about 10%, the total defect amount accounts for 20% of the total defect amount due to the occurrence of foreign matters, missing nuts, missing bolts, damage or inclination of a grading ring, slippage of a vibration damper and discharge gap faults, and the rest 20 types of faults account for the rest 10%. The existing method needs a large number of training samples for each category of defects to achieve high precision, and the number of image samples of a large number of categories of defects positioned at the long tail part cannot meet the training requirement. The method can realize efficient processing and compensation of a large number of class defect images, meets the requirements of training and target identification, and is high in processing efficiency.
In the field of picture inspection and identification, the accuracy of target identification is generally evaluated by adopting an mAP index. It is defined as follows: firstly, the predicted target box is sorted from high to low according to probability, then a 'true box' (group route) with the overlapping degree exceeding a given threshold is sequentially found, and the target box is taken as the prediction of the 'true box'. When each "real box" is predicted by only one prediction box and each prediction box predicts only one "real box", the unmatched boxes are treated as false reports or false reports. The average of the accuracy at each recall (0 to 1) level calculated by the rules in turn is called the mAP. We use 0.5 as the threshold and call the ap at this time as ap @ 0.5.
As an application embodiment of the inspection picture identification in the target modeling feature identification method, the following multi-target identification scenes in the aspect of power equipment inspection are researched from simple to complex and from few to many according to the differences of image characteristics, target identification scenes and actual data:
(1) class 11 power multi-target detection
First, we select the target to be identified. Due to the limitation of GPU video memory, there is a limitation on the picture size for training, and usually 1800 × 1200 cannot be exceeded. Due to the fact that multi-scale pictures are used for training and medium-scale pictures are used for predicting, adaptability of the model to targets with different sizes can be effectively improved, and recognition accuracy is further improved, and images under 1296 x 864 resolution are used for prediction. Under the resolution, the tower targets which are clearly visible comprise tension string iron tower ends, ground wire transverse pull type hardware fittings, ground wire suspension type hardware fittings, sub-conductor spacers, suspension string conductor end hardware fittings, grading and shielding rings, grading rings, insulator strings, vibration dampers and the like. In addition, the bird nest and the insulator spontaneous explosion can be clearly seen once occurring. Therefore, the 11 types of targets are selected as the reference of electric power multi-target detection. Wherein, once two types of targets, namely the bird nest and the damaged part of the insulator, are identified, the targets are the defects.
5095 full labeled pictures, 4445 training sets and 650 test sets. The size of the picture is uniformly scaled to 1296 × 864. We trained and predicted it using yolov2, SSD, and the R-FCN algorithm. The prediction speeds of the three algorithms are 33fps,30fps and 13fps respectively, and the prediction precision (mAP @0.5) is shown in the following table 1:
Figure BDA0003563610920000171
Figure BDA0003563610920000181
TABLE 1
(2) Class 14 power multi-target detection
On the basis of the multi-target detection, more pictures and more types of targets are labeled to obtain a data set of 14 types of power targets. The object categories include: the device comprises a grading ring, a vibration damper, a suspension hammer string iron tower end, a sub-conductor spacer, an insulator damaged part, an insulator string, a weight hammer and accessory hardware, a ground wire insulator, a bird nest, a ground wire suspension type hardware, a ground wire cross-pull type hardware, a strain string conductor end, a suspension string conductor end, a strain string iron tower end and the like. The number of the pictures marked completely is 8000, a training set 6812 and a testing set 1188. The size of the picture is uniformly scaled to 1296 × 864. We trained and predicted it using yolov2, SSD, and the R-FCN algorithm. The prediction speeds of the three algorithms are 30fps,26fps and 9fps respectively, and the prediction precision (mAP @0.5) is shown in a table 2:
Figure BDA0003563610920000182
Figure BDA0003563610920000191
TABLE 2
(3) Bolt missing pin detection
The 14-type electric power multi-target detection is used for detecting that bolt heads with pin defects in all hardware fittings pictures of suspension hammer string iron tower ends, heavy hammers, accessory hardware fittings and the like are marked, and finally 3000 sample pictures including at least one pin defect are obtained in total. We divided these pictures into training set and testing set, including 2552 and 448 pictures, respectively, and the example of the missing pin is shown in fig. 2a and 2b, fig. 2a is a complete hardware picture, and fig. 2b is an enlargement of the missing pin part:
then, the model is trained using the fast R-CNN algorithm, in which DPN-92 is used as the feature extraction network, the 3 × 3 convolutional network in the 5 th stage of the DPN network is replaced with a deformable convolutional network, the ROIPooling layer is replaced with a deformable ROIPooling layer, and the non-maximum suppression is replaced with soft nms. And (3) expanding samples in the training set in a mode of turning left and right and randomly cutting 20%, and randomly selecting the maximum lengths of the long sides and the short sides as [1296,864], [800,600] and [1600,1200 ]. In the prediction, the maximum length of the long and short sides is set to [1296,864 ]. The prediction accuracy (mAP @0.5) is as in Table 3:
target Faster R-CNN
Pin without pin 0.8416
TABLE 3
(4) Hammer blade fault detection
Common failures of the weight piece include pin absence and through pin absence. Wherein the missing nail is shown in figure 3.
Firstly, detecting all heavy hammers and accessory fittings by using 14 types of image targets, and labeling faults of pin missing, through pins missing and bolt missing in heavy hammer images to finally obtain 1400 images containing at least one defect, wherein 217 images contain the fault of through pins missing. We divided the 1400 pictures into training and testing sets, containing 1203 and 197 pictures, respectively.
The R-FCN model is then trained based on the training set. Because the number of the faults of the piercing-piercing pins is small, before training, the pictures containing the faults of the piercing-piercing pins are expanded, the number of the pictures is expanded to be 2 times of the original number by a random cutting method, then the whole training set is expanded by a horizontal turning method, and the maximum lengths of the long sides and the short sides are randomly selected to be [1296,864], [800,600] and [1600,1200 ]. In the prediction, the maximum length of the long and short sides is set to [1296,864 ]. The prediction accuracy (mAP @0.5) is as in Table 4:
Figure BDA0003563610920000192
Figure BDA0003563610920000201
TABLE 4
Further, the target modeling feature identification method further includes identifying the inspection video target, and is used for identifying and processing the inspection video acquired by the unmanned aerial vehicle or the manned vehicle, and the method includes the following steps:
step P1, establishing image-based target and defect classification criteria; existing defect classification and classification methods do not take into account differences in the number of defects and similarities between different defects. For example, the pin holes in the grading shield ring and the ground wire suspension type hardware fitting can be regarded as similar defects; however, the type of the foreign object defect needs to be classified into finer particles according to the form of the foreign object.
Step P2, performing frame extraction on the video based on the established classification standard, and labeling the extracted image sample;
step P3, dividing the sample library into a training set and a testing set, and carrying out sample expansion on the defect samples with insufficient quantity in the training set;
step P4, respectively using fast RCNN algorithm, R-FCN algorithm, SSD algorithm and YOLO algorithm, selecting different hyper-parameters to train the model; during training, the picture is scaled down or cut based on the characteristics of the inspection picture and the limitation of hardware such as a GPU, so that the size of the picture can meet the limitation of a GPU memory. And (3) training the model by adopting a multi-GPU combined training method and a small specific random gradient descent (mini-batch SGD), and placing different areas of each picture in the same batch (batch) for training so as to reduce the influence of a cutting strategy on the accuracy of the algorithm. In addition, a plurality of methods are adopted to enhance the deep network model so as to improve the algorithm precision.
And P5, evaluating the trained model, and processing the identification algorithm which does not meet the requirements in a frame skipping manner during evaluation and prediction. For example, the recognition rate of R-FCN at 800X1200 resolution is 9fps, then taking 6.75 frames of images per second of video and recognizing these images, taking into account 25% redundancy. And for the images of the residual frames, calculating the position of each target by adopting a target tracking algorithm.
When the inspection video needs to be identified, the steps are adopted, the inspection video target identification precision is high, the identification effect is good, and a good data basis is provided for subsequent image analysis.
The target modeling feature identification method further comprises the application of an embodiment of inspection video target identification, and according to the differences of video characteristics, target identification scenes and actual data, the following scenes of inspection video targets are researched:
(1) unmanned aerial vehicle video multi-target detection
The unmanned aerial vehicle video multi-target detection is based on 11 types of electric power multi-target detection of image target detection. The unmanned aerial vehicle video has 15 segments and the total time length is about 190 seconds. Taking 10 segments of the images as a training set, extracting 1 frame per second from the training set as pictures for labeling, and taking 132 pictures in total; the remaining 5 segments were used as test sets from which we extracted 2 frames per second as pictures to label, 127 in total. A model obtained by picture 11 type electric power multi-target detection is used as a pre-training model, and total 6 rounds of tuning are carried out on the basis of 132 training set pictures. Training and prediction are performed based on three algorithms, Yolov2, SSD and R-FCN, with the precision (mapp @0.5) as in table 5:
target Yolov2 SSD R-FCN
Strain insulator-string iron tower end 0.6971 0.7110 0.7871
Bird nest 0.7223 0.7665 0.8386
Ground wire horizontal pulling type hardware fitting 0.5613 0.5896 0.6727
Ground wire suspension type hardware fitting 0.8014 0.8079 0.8728
Damaged part of insulator 0.7104 0.7534 0.8525
Sub-conductor spacer 0.7026 0.7671 0.8537
Suspension string wire end fitting 0.8431 0.8872 0.8976
Grading shield ring 0.8410 0.8784 0.9470
Grading ring 0.8184 0.8080 0.8799
Insulator string 0.8125 0.8870 0.9003
Vibration damper 0.8332 0.8199 0.8907
Mean value of 0.7635 0.7887 0.8539
TABLE 5
The routing inspection video image preprocessing method introduces an advanced artificial intelligence technical idea, intelligently analyzes the video image, and based on a video image intelligent analysis technical framework and a video image recognition algorithm based on a deep neural network and a traditional image processing technology, greatly improves the video image intelligent recognition technical capability based on artificial intelligence, realizes the recognition of common fault defects and risks of the video image, is applied to typical scenes such as power grid equipment, and provides powerful information technical support for guaranteeing the stability of a power grid and improving the safety production level of the power grid.
In the description herein, references to the description of the term "one embodiment," "some embodiments," "an example," "a specific example," or "some examples," etc., mean that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. In this specification, the schematic representations of the terms used above do not necessarily refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
It will be understood by those skilled in the art that the present invention includes any combination of the summary and detailed description of the invention described above and those illustrated in the accompanying drawings, which is not intended to be limited to the details and which, for the sake of brevity of this description, does not describe every aspect which may be formed by such combination. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (10)

1. A method for preprocessing an inspection video image is characterized by comprising the steps of collecting an image of a target object, identifying and classifying the image of the target object, and adopting a target modeling characteristic identification method to identify and process different types of object images aiming at different types of target objects;
the target modeling feature identification method comprises the steps of defogging an image, and defogging the image by adopting the following formula algorithm:
Figure FDA0003563610910000011
wherein J (x) is the recovered haze-free image, I (x) is the image to be dehazed, A is the global atmospheric optical component parameter, t (x) is the transmittance, t 0 Is a threshold value;
the target modeling feature identification method further comprises the step of denoising the image by filtering, wherein the denoising by filtering comprises the following steps:
step S1, set f ij Is the gray scale of point (i, j), A ij For the current working window, f min Is S i,j Minimum value of middle gray, f max Is S i,j Maximum value of gray scale in (f) med Is S i,j Middle gray level median value, set as A max The door window is a preset maximum allowable door window;
step S2, if f min <f med <f max Go to step S3; otherwise go to step S4;
step S3, if f min <f ij <f max Then output f ij (ii) a Otherwise output f med
Step S4 increasing the Window A ij Size; if A ij <A max Go to step S2; otherwise output f ij
2. The inspection video image preprocessing method according to claim 1, wherein the target modeling feature recognition method further includes debouncing the video image to obtain a stable video, including:
c1, extracting feature points in the image reference frame and the current frame by using a Scale Invariant Feature Transform (SIFT) algorithm, and matching;
step C2, obtaining global motion parameters through random sampling consensus RANSAC algorithm;
step C3, carrying out low-pass filtering of self-adaptive size on the global motion parameter to obtain a stationary motion parameter, and using the difference value between the stationary motion parameter and the global motion parameter as a jitter parameter to realize motion compensation;
and step C4, repairing the blank area in the video frame after the de-jittering by combining the image texture synthesis algorithm to obtain a stable video.
3. The inspection video image preprocessing method according to claim 1, wherein the target modeling feature recognition method further includes recognizing smoke features in the image, including:
d1, circularly obtaining each frame of picture in the video image;
d2, obtaining the value of each pixel point in each frame of picture;
step D21, re-taking each pixel value as the minimum channel pixel value;
d22, forming a minimum channel pixel picture according to the minimum channel pixel value;
d23, carrying out averaging filtering on each pixel in the minimum channel pixel picture;
step D24, if the value of each pixel point in the minimum channel pixel picture after filtering is less than 150, setting the value of each pixel point to be 0, and if the value of each pixel point in the minimum channel pixel picture after filtering is more than or equal to 150, setting the value of each pixel point to be 255;
d25, generating a first binary picture according to the value set to each pixel point in the step D24;
step D3, converting the picture acquired in the step D1 into a gray picture;
d31, identifying moving object pictures in the gray level pictures;
step D32, converting the identified moving object picture into a second binary picture;
d4, recognizing foreground and background in the gray level picture, and extracting a foreground picture;
step D41, converting the extracted foreground picture into a third binary picture;
d5, performing AND operation on the second binarized picture in the step D32 and the third binarized picture in the step D41 to form a fourth binarized picture;
and D6, performing AND operation on the first binary picture and the fourth binary picture to obtain a fifth binary picture, wherein when the value of a pixel point in the fifth binary picture is 255, the pixel point is indicated to have smoke.
4. The inspection video image preprocessing method according to claim 1, wherein the target modeling feature recognition method further includes determining an open/close state of a substation disconnecting switch, including:
l1, acquiring a monitored video of the disconnecting switch in the video monitoring of the transformer substation;
l2, extracting a frame in the video of the isolating switch and converting the frame into a picture format to form an isolating switch picture;
l3, cutting the interference edge of the picture of the isolating switch, and converting the interference edge into a grey-scale picture of the isolating switch;
l4, filtering and smoothing the grey-scale picture of the isolating switch by adopting local gradient, and then performing image binarization processing to obtain a binary picture of the isolating switch;
l5, performing line segment fitting on the binary image of the isolating switch in a 3x3 window mode to obtain a first line segment group of the isolating switch after fitting;
l6, solving the length of the line segments in the line segment group, screening the line segments within a set length range to obtain a second line segment group of the isolating switch, solving the sectional slope of each line segment in the second line segment group, further solving the average slope of each line segment, screening the line segments within the set average slope range to obtain a third line segment group of the isolating switch;
l7, projecting the line segments in the third line segment group of the isolating switch according to the direction of the reference slope angle, and calculating the duty ratio and the interval number of the projection on the projected reference line after the projection; and judging the opening and closing state of the isolating switch according to the duty ratio and the interval number.
5. The inspection video image preprocessing method according to claim 1, wherein the target modeling feature recognition method further includes determining an open/close state of a door of the mechanism, including:
e1, connecting the camera to obtain the picture of the mechanism box contained in the camera;
e2, converting the acquired image of the mechanism box into a gray image, cutting off part of the edge of the gray image to obtain the cut gray image;
step E3: filtering the cut gray level picture in a 3x3 window average value mode, and extracting the filtered picture in a Canny edge extraction mode to obtain a mechanism box binaryzation picture;
step E4: extracting line segments in a binaryzation picture of the mechanism box by adopting a cvHoughLines algorithm to obtain a first line segment group of the mechanism box, calculating the length of the first line segment group of the mechanism box, screening out line segments which are in line with the set length range of the mechanism box to obtain a second line segment group of the mechanism box, and calculating the slope of the line segments in the second line segment group of the mechanism box;
e5, screening out line segments of which the line segment slopes are within a set slope range in the second line segment group of the mechanism box, and counting the line segments into the same distribution section when the slope difference of the line segments in the second line segment group of the mechanism box is 0.5 to form a slope distribution section;
and E6, calculating the line segment number of the slope distribution section, screening the slope distribution section in a set range to form a residual slope distribution section, calculating the slope average value of the qualified line segment of the mechanism box, which is greater than the threshold value of the line segment number, in the slope distribution section, calculating the slope average value of the line segment in the residual slope distribution section, calculating the difference value of the slope average values, and judging the opening and closing state of the mechanism box door according to the difference value of the slope average values.
6. The inspection video image preprocessing method according to claim 1, wherein the target modeling feature recognition method further includes determining an open/close state of a circuit breaker, which includes:
step F1, acquiring a transformer substation breaker state picture;
step F2, converting the acquired breaker state picture into a gray picture, cutting off part of the edge of the gray picture to obtain the cut-off breaker state gray picture;
step F3: filtering the cut breaker state gray level picture by adopting an average value mode of a 3x3 window, and obtaining a breaker binaryzation picture by adopting a Canny edge extraction mode on the filtered picture;
step F4, adopting a transverse dividing line with the interval of 10 pixels to divide the binary image of the state of the circuit breaker from top to bottom, recording edge points as cross points when intersection exists with the edge points of the binary image of the circuit breaker in the dividing process, and recording all the cross points as a cross point array;
step F5, adopting a 2x2 sliding window to check whether other connected edge points exist; if yes, checking whether the edge point is one point in the intersection point array, if yes, recording the intersection point as the same group of intersection points, and if not, continuing sliding window checking; if no other connected edge points exist, ending the sliding window checking process and starting the next checking process; by circularly executing the process, a plurality of groups of cross point sets are finally obtained, wherein each group of cross points in the plurality of groups of cross point sets are on the same communicated edge line;
step F6, calculating the slope between the adjacent intersections in each intersection in the multi-group intersection set, screening out the line segments within the range of the set slope value according to the slope value between the intersections, and obtaining effective line segments;
f7, respectively counting the slope of each effective line segment, judging whether the effective line segment is reasonable data of the state of the circuit breaker, and if the effective line segment is not reasonable data, neglecting; and judging the opening and closing state of the circuit breaker according to the reasonable data of the state of the circuit breaker.
7. The inspection video image preprocessing method according to claim 1, wherein the target modeling feature recognition method further includes recognizing a pointer reading on a pointer-type dial image, including:
g1, obtaining a pointer type dial plate picture and cutting edges; converting the cut pointer type dial picture into a gray picture;
g2, binarizing the pointer dial plate picture by adopting a threshold segmentation method, setting a gray threshold value, and dividing pixels in the pointer dial plate picture into a target area and a background area by utilizing the difference of the background in the pointer dial plate picture and the gray characteristic of a target to be acquired to form a refined pointer dial plate picture;
g3, carrying out Hough transformation on the refined pointer type dial picture, mapping data on the refined pointer type dial picture into a rho-theta transformation domain, and finding a peak point in the rho-theta transformation domain, namely, refining a straight line in the pointer type dial picture, namely, a pointer; detecting line segments by using a Hough transform method, and converting the line segments obtained by detection of the Hough line segment detection method into slope representation; and finding out the straight line where the pointer is located by using Hough transform, determining the end point of the straight line, calculating the slope of the straight line according to the coordinates of the end point, further calculating the angle of the straight line, and obtaining the quantity value shown by the dial.
8. The inspection video image preprocessing method according to claim 1, wherein the target modeling feature recognition method further includes recognizing two-dimensional code identification and information, including:
h1, acquiring real-time video data in the patrol process;
h2, extracting pictures in the video frame by frame;
h3, filtering the picture; then, carrying out binarization processing on the picture, and converting the picture into a two-dimensional code identification binarization picture;
h4, judging whether the two-dimensional code identification binary image has the characteristic area of the two-dimensional code: if so, go to step H5; if not, go to step H2;
h5, judging whether the proportion of the two-dimensional codes in the two-dimensional code identification binary image exceeds a set threshold value, if so, turning to the step H6; if not, go to step H51;
step H51: judging whether the lens of the two-dimensional code identification binary image is drawn up or not, if so, turning to the step H6, and if not, turning to the step H2;
step H6, judging whether the two-dimension code is the two-dimension code judged before, if yes, turning to step H2, if not, turning to step H7;
step H7, saving the two-dimensional code identification binary image as the searched specified two-dimensional code binary image, judging whether the patrol video is finished, if so, turning to step H8, and if not, turning to step H2;
step H8: acquiring a two-dimensional code area in a binary image containing a specified two-dimensional code, and mapping the area to an actual image frame;
step H9: the method comprises the steps of dividing a picture into two-dimensional code area pictures, and performing angle conversion on a two-dimensional code according to the shape of the two-dimensional code area pictures to obtain standard two-dimensional code pictures;
step H10: and identifying the two-dimension code information of the converted two-dimension code picture by adopting a two-dimension code identification algorithm, and storing the two-dimension code information.
9. The inspection video image preprocessing method according to claim 1, wherein the target modeling feature recognition method further includes recognizing an inspection picture, and is used for recognizing and processing the inspection picture acquired by a human or unmanned aerial vehicle, and includes:
k1, establishing an image-based target and defect classification standard;
k2, labeling the image sample library based on the established classification standard;
step K3, dividing the sample library into a training set and a testing set, and carrying out sample expansion on the defect samples with insufficient quantity in the training set;
k4, selecting different hyper-parameters to train the model by respectively using a Faster RCNN algorithm, an R-FCN algorithm, an SSD algorithm and a YOLO algorithm;
and K5, evaluating the trained model, and selecting the model meeting the highest limit precision for target recognition according to the limit of different scenes on the inference speed.
10. The inspection video image preprocessing method according to claim 1, wherein the target modeling feature recognition method further comprises inspection video target recognition, and is used for recognizing and processing inspection videos acquired by a human machine or an unmanned machine, and the method comprises the following steps:
step P1, establishing image-based target and defect classification criteria;
step P2, performing frame extraction on the video based on the established classification standard, and labeling the extracted image sample;
step P3, dividing the sample library into a training set and a testing set, and carrying out sample expansion on the defect samples with insufficient quantity in the training set;
step P4, respectively using fast RCNN algorithm, R-FCN algorithm, SSD algorithm and YOLO algorithm, selecting different hyper-parameters to train the model;
and P5, evaluating the trained model, and processing the identification algorithm which does not meet the requirements in a frame skipping manner during evaluation and prediction.
CN202210303079.XA 2022-03-24 2022-03-24 Inspection video image preprocessing method Pending CN114881869A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210303079.XA CN114881869A (en) 2022-03-24 2022-03-24 Inspection video image preprocessing method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210303079.XA CN114881869A (en) 2022-03-24 2022-03-24 Inspection video image preprocessing method

Publications (1)

Publication Number Publication Date
CN114881869A true CN114881869A (en) 2022-08-09

Family

ID=82667229

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210303079.XA Pending CN114881869A (en) 2022-03-24 2022-03-24 Inspection video image preprocessing method

Country Status (1)

Country Link
CN (1) CN114881869A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115272314A (en) * 2022-09-27 2022-11-01 广东晟腾地信科技有限公司 Agricultural low-altitude remote sensing mapping method and device
CN115830518A (en) * 2023-02-15 2023-03-21 南京瀚元科技有限公司 Intelligent frame extraction method for power inspection video in infrared scene
CN116310940A (en) * 2022-12-29 2023-06-23 苏州斯曼克磨粒流设备有限公司 Risk assessment method and system for running state of electromechanical equipment

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115272314A (en) * 2022-09-27 2022-11-01 广东晟腾地信科技有限公司 Agricultural low-altitude remote sensing mapping method and device
CN115272314B (en) * 2022-09-27 2022-12-23 广东晟腾地信科技有限公司 Agricultural low-altitude remote sensing mapping method and device
CN116310940A (en) * 2022-12-29 2023-06-23 苏州斯曼克磨粒流设备有限公司 Risk assessment method and system for running state of electromechanical equipment
CN115830518A (en) * 2023-02-15 2023-03-21 南京瀚元科技有限公司 Intelligent frame extraction method for power inspection video in infrared scene

Similar Documents

Publication Publication Date Title
CN111339882B (en) Power transmission line hidden danger detection method based on example segmentation
Kulkarni Color thresholding method for image segmentation of natural images
CN114881869A (en) Inspection video image preprocessing method
CN109636795B (en) Real-time non-tracking monitoring video remnant detection method
Tripathi et al. Single image fog removal using bilateral filter
CN111260616A (en) Insulator crack detection method based on Canny operator two-dimensional threshold segmentation optimization
Kuanar et al. Night time haze and glow removal using deep dilated convolutional network
CN107240084B (en) Method and device for removing rain from single image
CN111339883A (en) Method for identifying and detecting abnormal behaviors in transformer substation based on artificial intelligence in complex scene
CN110866879A (en) Image rain removing method based on multi-density rain print perception
CN109359554A (en) A kind of forest fire recognition methods based on more composograph processing techniques
CN111027475A (en) Real-time traffic signal lamp identification method based on vision
Xiong et al. Early smoke detection of forest fires based on SVM image segmentation
CN107705254A (en) A kind of urban environment appraisal procedure based on streetscape figure
CN114399734A (en) Forest fire early warning method based on visual information
CN107636724A (en) The adaptive demister of wavelength and method of image
CN111815528A (en) Bad weather image classification enhancement method based on convolution model and feature fusion
CN111274964B (en) Detection method for analyzing water surface pollutants based on visual saliency of unmanned aerial vehicle
CN114627269A (en) Virtual reality security protection monitoring platform based on degree of depth learning target detection
CN113569981A (en) Power inspection bird nest detection method based on single-stage target detection network
Sahu et al. Image dehazing based on luminance stretching
CN107038690B (en) Moving shadow removing method based on multi-feature fusion
CN115700737A (en) Oil spill detection method based on video monitoring
CN110738624B (en) Area-adaptive image defogging system and method
CN108830834B (en) Automatic extraction method for video defect information of cable climbing robot

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