Oil leakage defect detection method and system
Technical Field
The invention relates to the technical field of oil leakage detection and identification, in particular to a method and a system for detecting oil leakage defects.
Background
At present, most of methods for detecting oil leakage adopt manual inspection, and require certain experience, and are distinguished by manual visual inspection and nasal smell. The manual inspection effect is greatly influenced by work experience, and a large amount of time is required to be occupied, so that the efficiency is low. In recent years, in the fields of petroleum exploration and development, monitoring of the content of oil pollutants in soil, monitoring of aircraft hydraulic oil leakage and sea surface oil spill and the like, a fluorescence detection technology is widely applied, a large number of research results are obtained, and the effectiveness of a petroleum fluorescence detection method is verified. But the method has the problems of lack of anti-interference capability to the environment and higher requirement on image acquisition equipment.
Chinese patent CN108844689A proposes a transformer oil leakage detection method. This patent utilizes the fluorescence characteristic of transformer oil composition, combines the transformer substation to patrol, to different oily formula equipment, carries out the rough search of large tracts of land at first, observes whether there is blue fluorescence phenomenon, carries out the accurate positioning to the region of oil blue fluorescence again to according to the depth and the scope of blue fluorescence, can judge the serious degree of seepage oil position and seepage. The method needs manual inspection, and requires certain experience of inspection personnel to interfere with other fluorescent substances to determine the oil leakage condition. The detection result is influenced by subjective consciousness and experience of the individual.
Chinese patent CN110455463A provides a transformer substation equipment oil stain detection system and method. The patent utilizes the characteristic that oil stains can generate fluorescence under the irradiation of ultraviolet laser, and determines a fluorescence area in a picture shot by an ultraviolet fluorescence camera as an oil stain area. The method needs to ensure that other fluorescent interferents can not exist in the environment, otherwise, false alarm can occur, and the anti-interference capability to the environment is lacked.
Chinese patent CN110174220a proposes a system and a method for detecting oil leakage of an on-load tap-changer of a transformer. According to the method, ultraviolet light is sent to the transformer on-load tap-changer to be detected, then fluorescence radiated after the transformer on-load tap-changer to be detected receives the ultraviolet light is received and processed, the fluorescence is converted into digital signals through a photoelectric signal sensor, and finally the received digital signals are analyzed through a data analysis device to obtain the oil leakage condition of the transformer on-load tap-changer to be detected. The method needs to filter fluorescence into monochromatic light through a monochromatic light filter, and then converts the monochromatic light into digital signals for analysis, and has higher requirements on image acquisition equipment.
At present, the following defects mainly exist in oil leakage defect detection and identification:
(1) The detection result is influenced by subjective consciousness and experience of the individual; other fluorescent substances generally appear in a patrol inspection place, when ultraviolet light is irradiated, the fluorescent substances of the non-oil liquid also emit fluorescence, certain interference is caused to oil leakage condition judgment, and a patrol worker needs to have certain experience to judge and eliminate the fluorescent substances of the non-oil liquid, so that the oil leakage condition is determined. The process and the detection result are influenced by subjective consciousness and experience of individuals, so that the detection result lacks stability.
(2) The anti-interference capability to the environment is lacked, the fluorescent area in the picture shot by the ultraviolet fluorescent camera is determined as the oil stain area, but the false alarm condition can occur when other non-oil fluorescent materials appear in the complex environment.
(3) The requirement on image acquisition equipment is high. New equipment needs to be designed or existing equipment needs to be modified, such as a monochromatic light filter is added, image acquisition is carried out, and then fluorescent substance detection and analysis are carried out to realize oil leakage condition detection.
Disclosure of Invention
The invention mainly aims to provide an oil leakage defect detection method, which can enhance the anti-interference capability of the environment, avoid the influence of personal subjective consciousness, experience and the like on the detection result and reduce the requirements on image acquisition equipment.
It is a further object of the present invention to provide an oil leakage defect detection and identification system.
In order to solve the technical problems, the technical scheme of the invention is as follows:
an oil leakage defect detection method comprises the following steps:
s1: fixing the relative positions of an ultraviolet light source module and a visible light imaging module, wherein the irradiation direction of the ultraviolet light source module and the shooting direction of the visible light imaging module both face to a region to be detected, the irradiation direction of the ultraviolet light source module and the shooting direction of the visible light imaging module are relatively parallel, a certain deflection angle is allowed to exist in the relative parallel directions, and the deflection angle ranges from 0 degree to 10 degrees in order to ensure the ultraviolet irradiation effect and the high-definition image acquisition effect, wherein the parameters of the visible light imaging module are set by using a parameter setting module, and after the ultraviolet light source module irradiates the region to be detected, the visible light imaging module acquires the high-definition image data of the region to be detected and transmits the high-definition image data to an image analysis module;
s2: the image analysis module receives the high-definition image data, and an oil leakage defect detection and identification result is obtained through image analysis processing;
s3: and transmitting the oil leakage defect detection and identification result to a display module for displaying, transmitting an oil leakage defect detection and identification result signal to an alarm module for alarming, and setting parameters of the display module and the alarm module by using a parameter setting module.
Preferably, the visible light imaging module is a high definition camera.
Preferably, in the step S1, the oil liquid at the oil leakage position in the region to be detected emits fluorescence due to a fluorescence effect under the irradiation of the ultraviolet light source, and the visible light imaging module acquires a high-definition fluorescence image.
Preferably, the image analysis processing step of the image analysis module in step S2 is specifically:
s21: extracting a fluorescence area as a suspected oil leakage area by utilizing the color and brightness characteristics of fluorescence of oil liquid in the high-definition fluorescence image through channel conversion and threshold processing, wherein if the fluorescence area does not exist, the oil leakage defect is judged to be absent, the shot high-definition fluorescence image is output, and an oil leakage signal is sent out; if there is a fluorescence region, the process proceeds to step S22;
s22: analyzing the area characteristics of a suspected oil leakage area, wherein fluorescent substances with small area interference detection, such as plastic fine scraps, residual oil stains and the like, exist in the area to be detected, the area to be detected is represented as a small-area fluorescent area under the ultraviolet irradiation, the small-area fluorescent area is removed by using area screening, and the influence of the fluorescent substances with small area interference detection is removed;
s23: performing shape characteristic analysis of the area, including eccentricity and rectangularity analysis, on the suspected oil leakage area judged by the area characteristic; if the oil leakage-like area is definitely in accordance with the shape characteristic analysis, judging that no oil leakage exists, outputting a shot high-definition fluorescence image, and sending an oil leakage-free signal; if the suspected oil leakage area conforms to the shape characteristic analysis, the oil leakage judgment and identification of the suspected oil leakage area are continuously carried out, and the step S24 is carried out;
s24: converting an original high-definition fluorescent multi-channel image into a single-channel gray image;
s25: performing regional gray level feature analysis, including gray level mean analysis, on the suspected oil leakage region judged and screened through the area feature and the shape feature in a single-channel gray level image; judging a suspected oil leakage area through gray scale characteristics, wherein the gray scale mean value is the gray scale mean value of a gray scale value set of a corresponding gray scale image at the suspected oil leakage area and reflects the brightness degree of the area, the oil leakage area is generally brighter, and the gray scale mean value is larger;
s26: integrating the judgment and identification results of the area characteristic, the shape characteristic and the gray characteristic to determine the oil leakage condition of the area to be detected; after the characteristic analysis and judgment of each suspected oil leakage area, if the oil leakage area exists, judging that the oil leakage defect exists, outputting a processing image for marking the oil leakage area, and sending an oil leakage alarm signal; if the oil leakage area does not exist, judging that no oil leakage defect exists, outputting a shot high-definition fluorescence image, and sending an oil leakage-free signal.
Preferably, the step S21 of extracting the fluorescence region specifically includes the following steps:
s211: the method comprises the steps of preprocessing an input high-definition fluorescence image, wherein the preprocessing comprises denoising and exponential transformation, in order to remove noise and keep image edge detail information as much as possible, denoising is carried out by using self-adaptive median filtering, and in order to further highlight a fluorescence area in the high-definition image, the contrast of a high-gray-value area is enhanced by using exponential transformation;
s212: the high-definition fluorescence image is an RGB three-channel image, and is decomposed into an R channel image, a G channel image and a B channel image;
s213: converting the R channel image, the G channel image and the B channel image to obtain an H (tone) channel image and a V (brightness) channel image in the HSV color model;
s214: obtaining an area 1 by carrying out threshold processing on an H (tone) channel image, wherein the area 1 is an area extracted according to the fluorescent color characteristics, and the identification of the oil fluorescent color is realized on the H (tone) channel image by carrying out threshold processing on the oil fluorescent color by utilizing the color characteristics of oil fluorescent light, so that the extraction of the area with the fluorescent color is realized; obtaining an area 2 by threshold processing on the V (brightness) channel image, wherein the area 2 is an area extracted according to the fluorescence brightness characteristic, and the oil fluorescence brightness is identified by the threshold processing on the V (brightness) channel image by utilizing the brightness characteristic of oil fluorescence, so that the extraction of the area with the fluorescence brightness is realized;
s215: and performing intersection operation on the region 1 and the region 2 to obtain an intersection region, which is the extracted fluorescence region.
Preferably, the conversion relationship for converting the R channel, G channel, and B channel images into the H (hue) channel image and the V (lightness) channel image in step S213 is:
R'=R/255
G'=G/255
B'=B/255
C max=max(R',G',B')
C min=mim(R',G',B')
Δ=C max-C min
V=C max
in the formula, R, G, B is an R channel image, a G channel image and a B channel image, R ', G ' and B ' are images of the R channel image, the G channel image and the B channel image after normalization processing, H is an H (hue) channel image in an HSV color model, and V is a V (brightness) channel image in the HSV color model.
Preferably, the shape feature analysis in step S23 includes eccentricity analysis, where the eccentricity can reflect the stretching degree of the region, and is specifically expressed as calculating the inertia spindle ratio, and the calculation formula is as follows:
in the above formula, R is the region point set, n is the number of point sets, x is the abscissa of the point set, y is the ordinate of the point set, S is the region area,
is an average vector, mu
ij The central moment of each step and the eccentricity calculation result are obtained, plastic products which play a role in fixing, such as nylon ribbons and the like, exist in the area to be detected, the plastic products are thin and long, and the eccentricity is generally large.
Preferably, the shape feature analysis in step S23 includes a squareness analysis, where the squareness represents how similar an object is to a rectangle, and the calculation formula is as follows:
in the above formula, A S Is the area of the region, A R For the minimum rectangular area surrounding the area, the rectangular label paper-pasted interference fluorescent substance is always present in the area to be detected, the squareness is generally close to 1, and the rectangular interference fluorescent substance can be removed by calculating the squareness.
Preferably, the conversion relationship of the original high-definition fluorescent multi-channel image into the single-channel gray-scale image in step S24 is:
Gray(i,j)=0.299*R(i,j)+0.578*G(i,j)+0.114*B(i,j)
in the formula, (i, j) is pixel coordinates, and R, G, B is an R channel image, a G channel image and a B channel image respectively.
Preferably, the step S26 of determining the oil leakage condition of the area to be measured specifically includes:
if the suspected oil leakage areas all meet the area characteristics, the shape characteristics and the gray level characteristics, judging that oil leakage occurs in the suspected oil leakage areas; and if the suspected steam leakage area does not meet one or more of the area characteristic, the shape characteristic and the gray characteristic, excluding the suspected oil leakage area from oil leakage.
A system applying the oil leakage defect detection method comprises the following steps:
the system comprises an image acquisition subsystem and an information interaction subsystem;
the image acquisition subsystem comprises an ultraviolet light source module and a visible light imaging module;
the information interaction subsystem comprises a parameter setting module, a display module, an alarm module and an image analysis module;
the ultraviolet light source module emits ultraviolet light to irradiate the area to be detected;
the visible light imaging module collects a high-definition visible light image of a region to be detected and transmits high-definition image data to the image analysis module;
the parameter setting module is used for setting parameters of the visible light imaging module, setting result display and setting alarm information by a user;
the display module displays an oil leakage defect detection recognition result image and prompts related information;
the alarm module sends an alarm prompt to the outside according to the oil leakage defect detection and identification result;
the image analysis module receives high-definition image data, and transmits the image character information and the alarm signal of the obtained oil leakage defect detection identification result to the display module and the alarm module respectively through image analysis processing.
According to the number of monitoring points and the complexity of the environment, the inspection robot, the fixed holder and the handheld device can be used as an image acquisition system carrying platform as required.
Compared with the prior art, the technical scheme of the invention has the beneficial effects that:
according to the method, ultraviolet light irradiation is carried out on a to-be-detected area, oil at an oil leakage point is visually displayed in a blue or purple fluorescence form, a high-definition camera is used for shooting an image of the area, hardware such as a monochromatic light filter is not needed to be added, requirements on image acquisition equipment are further increased, a digital image processing method is used for judging the area, the shape and the gray characteristic of the suspected oil leakage area, the influence of fluorescent substances of other non-oil liquids on a detection result is eliminated, the influence of personal subjective consciousness, experience and the like on the detection result is avoided, the influence of the fluorescent substances of other non-oil liquids on the detection result is eliminated, and meanwhile, the correctness and the stability of the detection result are guaranteed.
Drawings
FIG. 1 is a schematic flow chart of the method of the present invention.
Fig. 2 is a schematic flow chart of image analysis processing steps of the image analysis module.
FIG. 3 is a schematic flow chart of extracting fluorescence regions.
FIG. 4 is a schematic diagram of the system of the present invention.
Detailed Description
The drawings are for illustrative purposes only and are not to be construed as limiting the patent;
for the purpose of better illustrating the embodiments, certain features of the drawings may be omitted, enlarged or reduced, and do not represent the size of an actual product;
it will be understood by those skilled in the art that certain well-known structures in the drawings and descriptions thereof may be omitted.
The technical solution of the present invention is further described below with reference to the accompanying drawings and examples.
Example 1
The embodiment provides a method for detecting an oil leakage defect, which specifically includes the following steps, as shown in fig. 1:
s1: fixing the relative positions of an ultraviolet light source module and a visible light imaging module, wherein the irradiation direction of the ultraviolet light source and the shooting direction of a high-definition camera face to a region to be detected, and the directions of the ultraviolet light source and the shooting direction of the high-definition camera are relatively parallel, the parameters of the visible light imaging module are set by using a parameter setting module, and after the ultraviolet light source module irradiates the region to be detected, the visible light imaging module collects high-definition image data of the region to be detected and transmits the high-definition image data to an image analysis module;
s2: the image analysis module receives the high-definition image data, and an oil leakage defect detection and identification result is obtained through image analysis processing;
s3: and transmitting the image and the character information of the oil leakage defect detection identification result to a display module for displaying, transmitting an oil leakage defect detection identification result signal to an alarm module for alarming, and setting the parameters of the display module and the alarm module by using a parameter setting module.
Further, the relative parallelism in S1 allows a certain deflection angle, and the deflection angle range is preferably less than 10 ° to ensure the ultraviolet irradiation effect and the high-definition image capturing effect.
Furthermore, oil at the oil leakage position can emit fluorescence due to the fluorescence effect under the irradiation of ultraviolet laser, and the visible light imaging module acquires a high-definition fluorescence image.
As shown in fig. 2, the image analysis process S2 of the image analysis module specifically includes:
s21: and (3) extracting a fluorescence area as a suspected oil leakage area by channel transformation and threshold processing by using a high-definition fluorescence image and utilizing the color and brightness characteristics of oil fluorescence. If no fluorescence area exists, judging that no oil leakage defect exists, outputting a shot high-definition fluorescence image, and sending an oil leakage signal; and if the fluorescence area exists, oil leakage judgment and identification are continued.
As shown in fig. 3, extracting the fluorescence region specifically includes:
s211: preprocessing an input high-definition fluorescence image, which specifically comprises the following steps: denoising and exponential transformation. In order to remove noise and simultaneously keep image edge detail information as much as possible, carrying out denoising treatment by using self-adaptive median filtering; to further highlight the fluorescence regions in the high definition image, the contrast of the high gray value regions is enhanced using an exponential transformation.
S212: and decomposing the high-definition fluorescent RGB three-channel image into an R channel image, a G channel image and a B channel image.
S213: and obtaining an H (hue) channel image and a V (brightness) channel image in the HSV color model by using the R channel, the G channel and the B channel image conversion.
Further, the conversion relationship for converting the R channel image, the G channel image, and the B channel image into the H (hue) channel image and the V (lightness) channel image is:
R'=R/255
G'=G/255
B'=B/255
C max=max(R',G',B')
C min=min(R',G',B')
Δ=C max-C min
V=C max
in the formula, R, G, B is an R channel image, a G channel image and a B channel image, R ', G ' and B ' are images of the R channel image, the G channel image and the B channel image after normalization processing, H is an H (hue) channel image in an HSV color model, and V is a V (brightness) channel image in the HSV color model.
S214: obtaining an area 1 by carrying out threshold processing on an H (tone) channel image; the region 2 is acquired by thresholding on the V (brightness) channel image.
Further, by utilizing the color characteristics of oil fluorescence, the identification of the oil fluorescence color is realized through threshold processing on an H (tone) channel image, so that the extraction of the area with the fluorescence color is realized, the removable limit value is 170 degrees, and the upper limit value is 225 degrees.
Further, by utilizing the brightness characteristic of oil fluorescence, the oil fluorescence brightness is identified through threshold processing on a V (brightness) channel image, so that the extraction of the area with the fluorescence brightness is realized, and the removable limit value is 0.8 and the upper limit value is 0.98.
S215: and performing intersection operation on the region 1 and the region 2 to obtain an intersection region, which is the extracted fluorescence region.
S22: and analyzing the area characteristics of the suspected oil leakage area. Fluorescent substances which have small areas and interfere detection, such as plastic fine scraps, residual oil stains and the like, often exist in the detection area, and the fluorescent areas with small areas and the areas smaller than 1 square centimeter are actually represented under the ultraviolet irradiation. And removing small-area areas by using area screening to remove the influence of the fluorescent substance interfering the detection of the small areas.
S23: performing shape characteristic analysis of the area, including eccentricity and rectangularity analysis, on the suspected oil leakage area judged by the area characteristic; if the oil leakage-like area is definitely in accordance with the shape characteristic analysis, judging that no oil leakage exists, outputting a shot high-definition fluorescence image, and sending an oil leakage-free signal; and if the suspected oil leakage area conforms to the shape characteristic analysis, the oil leakage judgment and identification of the suspected oil leakage area are continuously carried out, and the step S24 is carried out.
Further, the eccentricity may reflect the degree of stretching of the region. Specifically, the inertia main shaft ratio is calculated by the following formula:
wherein R is a region point set, n is the number of the point set, x is the abscissa of the point set, y is the ordinate of the point set, S is the region area,
is an average vector, mu
ij The central moments of the respective orders, e, are the eccentricity calculation results. The detection area often has the plastic products of nylon ribbon etc. play the fixed action, all shows thin and long characteristic, and the eccentricity is generally greater than 7, and the regional eccentricity of oil leak is generally less than 4.
Further, the rectangle degree represents the similarity between an object and a rectangle, and represents the filling degree of the object to the external rectangle, and the calculation formula is as follows:
in the formula, A S Is the area of a region, A R Is the smallest rectangular area surrounding the region. Examination ofRectangular label pasting paper interference fluorescent substances often exist in the detection area, the rectangularity is generally larger than 0.9, and the rectangularity of an oil leakage area is generally smaller than 0.6.
S24: and converting the originally input high-definition fluorescent multi-channel image into a single-channel gray image.
Further, the conversion relationship of converting the high-definition image into the gray image is as follows:
Gray(i,j)=0.299*R(i,j)+0.578*G(i,j)+0.114*B(i,j)
in the formula, (i, j) is pixel coordinates, and R, G, B are an R channel image, a G channel image, and a B channel image, respectively.
S25: carrying out area gray scale characteristic including gray scale mean value analysis on the suspected oil leakage area judged and screened by the area and shape characteristic in a gray scale image; and judging the suspected oil leakage area through the gray characteristic.
Further, the gray average value is a gray average value of a gray value set of a gray map corresponding to the suspected oil leakage region, and reflects the brightness degree of the region, and the gray average value of the oil leakage region can be reduced by a limit value of 150 and an upper limit value of 255.
S26: and (4) integrating the judgment and identification results of the area characteristic, the shape characteristic and the gray characteristic to determine the oil leakage condition of the area to be detected. If the suspected oil leakage areas all meet the area characteristics, the shape characteristics and the gray level characteristics, judging that oil leakage occurs in the suspected oil leakage areas; and if the suspected steam leakage area does not meet one or more of the area characteristic, the shape characteristic and the gray characteristic, excluding the suspected oil leakage area from oil leakage. After the characteristic analysis and judgment of each suspected oil leakage area, if the oil leakage area exists, judging that the oil leakage defect exists, outputting a processing image for marking the oil leakage area, and sending an oil leakage alarm signal; if the oil leakage area does not exist, judging that no oil leakage defect exists, outputting a shot high-definition fluorescence image, and sending an oil leakage-free signal.
Example 2
The embodiment provides an oil leakage defect detection and identification system, as shown in fig. 4, which comprises an image acquisition subsystem and an information interaction subsystem;
the image acquisition subsystem comprises an ultraviolet light source module and a visible light imaging module;
the information interaction subsystem comprises a parameter setting module, a display module, an alarm module and an image analysis module;
the ultraviolet light source module emits ultraviolet light to irradiate the area to be detected;
the visible light imaging module collects a high-definition visible light image of a region to be detected and transmits high-definition image data to the image analysis module;
the parameter setting module is used for setting parameters of the visible light imaging module, displaying results and setting alarm information by a user;
the display module displays an oil leakage defect detection recognition result image and prompts related information;
the alarm module sends an alarm prompt to the outside according to the oil leakage defect detection and identification result;
the image analysis module receives high-definition image data, and transmits the image character information and the alarm signal of the obtained oil leakage defect detection identification result to the display module and the alarm module respectively through image analysis processing.
The same or similar reference numerals correspond to the same or similar parts;
the terms describing positional relationships in the drawings are for illustrative purposes only and are not to be construed as limiting the patent;
it should be understood that the above-described embodiments of the present invention are merely examples for clearly illustrating the present invention, and are not intended to limit the embodiments of the present invention. Other variations and modifications will be apparent to persons skilled in the art in light of the above description. And are neither required nor exhaustive of all embodiments. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention should be included in the protection scope of the claims of the present invention.