Search

CN-122023759-A - Smoke judging method and system based on edge area extraction technology and electronic equipment

CN122023759ACN 122023759 ACN122023759 ACN 122023759ACN-122023759-A

Abstract

The invention belongs to the field of smoke detection, and particularly relates to a smoke judging method, a system and electronic equipment based on an edge area extraction technology, which aim to solve the problem that an inaccurate detection result exists in the existing smoke judging method. The method comprises the steps of training smoke image data by utilizing a deep learning algorithm to obtain a smoke monitoring model, intercepting a given video on site into pictures by utilizing FFmpeg, cutting out a detection frame area of a current frame to obtain a first smoke picture, cutting out a detection frame area of a frame T seconds before or T seconds after the current frame to obtain a second smoke picture, respectively carrying out gray scale and morphological operation on the two smoke pictures to obtain a first morphology picture and a second morphology picture, respectively calculating edge areas of the two morphology pictures, and then judging whether smoke exists on the site or not based on the two edge areas. The smoke judgment method based on the edge area extraction technology has accurate detection results.

Inventors

  • WANG ZHEN
  • YUAN FEI
  • Shang Baoqi
  • WANG ZHONG
  • LIU GUANCHEN
  • LI NA
  • DONG FANG
  • CHEN XIAOJIN
  • Niu Changliang
  • SHEN FEI

Assignees

  • 中国石油天然气股份有限公司

Dates

Publication Date
20260512
Application Date
20241101

Claims (10)

  1. 1. The smoke judging method based on the edge area extraction technology is characterized by comprising the following steps of: acquiring smoke image data, and training the smoke image data by using a deep learning algorithm to obtain a smoke monitoring model; cutting out the detection frame area of the current frame to obtain a first smoke picture, and cutting out the detection frame area of the frame of T seconds before or T seconds after the current frame to obtain a second smoke picture; Respectively carrying out gray conversion on the two smoke pictures to obtain a first gray picture and a second gray picture; And respectively calculating the edge areas of the two morphological graphs, and then judging whether the scene has smoke or not based on the edge area of the first morphological graph and the edge area of the second morphological graph.
  2. 2. The smoke judging method based on the edge area extraction technology according to claim 1, wherein the method of respectively performing gray scale conversion on two smoke pictures comprises: For any smoke picture: Img=(R 2.2 *0.2126+G 2.2 *0.7152+B 2.2 *0.0722) 1/2.2 ; Wherein Img represents a gray-scale map after gray-scale conversion, R, G, B represents pixel values of red, green and blue channels of a smoke picture to be subjected to gray-scale conversion.
  3. 3. The smoke judgment method based on the edge area extraction technology according to claim 2, wherein the method of performing morphological operations on two gray-scale images respectively is as follows: for each gray scale map: where Img represents any one of gray-scale maps to be subjected to morphological operations, M represents a convolution template to be referred to, and o represents an open operation.
  4. 4. A smoke judging method based on an edge area extraction technique according to claim 3, wherein calculating edge areas of two morphology maps respectively comprises: Respectively extracting edges of the two morphological images in the horizontal direction and the vertical direction by using a Sobel operator to obtain a horizontal gradient image of the first morphological image and a vertical gradient image of the second morphological image; Thresholding is carried out on the horizontal gradient image and the vertical gradient image of the two morphological images respectively, and pixels higher than a threshold value are used as edge pixels of the morphological images; Edge areas of the two morphology maps are calculated based on the edge contours of the two morphology maps, respectively.
  5. 5. The smoke judgment method based on the edge area extraction technology according to claim 4, wherein the Sobel operator includes a convolution kernel in a horizontal direction and a convolution kernel in a vertical direction; The convolution kernel of the Sobel operator in the horizontal direction is as follows: the convolution kernel of the vertical direction of the Sobel operator is as follows: wherein, G x is the convolution kernel of the Sobel operator in the horizontal direction, and G y is the convolution kernel of the Sobel operator in the vertical direction.
  6. 6. The smoke judgment method based on the edge area extraction technique according to claim 5, wherein the method of calculating the edge areas of the two morphological images based on the edge pixels of the two morphological images respectively is: For any morphology map: C k denotes the contour Area of the Edge contour, (x i ,y i ) denotes the coordinates of the i-th point on the Edge contour, (x i+1 ,y i+1 ) denotes the coordinates of the i+1th point on the Edge contour, N k denotes the number of points on the k Edge contours, N is the number of Edge contours, edge_area is the Edge Area of the morphology map.
  7. 7. The smoke determination method according to claim 6, wherein the method for determining whether the scene has smoke based on the edge area of the first pattern and the edge area of the second pattern comprises: Calculating an edge area difference based on the edge area of the first morphology graph and the edge area of the second morphology graph; if the edge area difference is greater than a first threshold, then the scene is indicated to have smoke, otherwise there is no smoke.
  8. 8. The smoke judgment method based on the edge area extraction technique according to claim 6, wherein the method of calculating the edge area gap is: Where Δ is the edge area difference, A is the edge area of the first morphology and B is the edge area of the second morphology.
  9. 9. A smoke judgment system based on edge area extraction technology, the system comprising: The data acquisition module is used for acquiring smoke image data, and training the smoke image data by using a deep learning algorithm to obtain a smoke monitoring model; The picture cutting module is used for cutting a given video on site into pictures by using FFmpeg, inputting the cut pictures into a detection frame area of smoke of the smoke monitoring model, cutting out the detection frame area of a current frame to obtain a first smoke picture, and cutting out the detection frame area of a frame T seconds before or T seconds after the current frame to obtain a second smoke picture; The system comprises a gray level conversion module, a first morphological image processing module, a second morphological image processing module and a gray level conversion module, wherein the gray level conversion module is used for respectively carrying out gray level conversion on two smoke images to obtain a first gray level image and a second gray level image; And the smoke judging module is used for respectively calculating the edge areas of the two morphological graphs, and then judging whether the scene has smoke or not based on the edge area of the first morphological graph and the edge area of the second morphological graph.
  10. 10. An electronic device comprising at least one processor and a memory communicatively coupled to at least one of the processors, wherein the memory stores instructions executable by the processor for execution by the processor to implement the edge area extraction technique-based smoke determination method of any one of claims 1-8.

Description

Smoke judging method and system based on edge area extraction technology and electronic equipment Technical Field The invention belongs to the field of smoke detection, and particularly relates to a smoke judging method and system based on an edge area extraction technology and electronic equipment. Background Smoke is one of the potential safety hazards appearing in the oilfield production field, and the occurrence of smoke is accompanied with fire disaster frequently, and the detection of smoke in the first time can effectively guarantee the personal safety of oilfield operation personnel and the smooth progress of operation. At present, the smoke detection method is mainly divided into two modes of monitoring picture analysis and smoke detection probe analysis, and in recent years, the application of the image-based smoke monitoring picture analysis method is widely applied, wherein the method is divided into a traditional image processing method and an image processing method based on deep learning. The current method for detecting smoke is mainly composed of a distinguishing method based on color characteristics, and the principle of the method is that smoke, cloud and dust can have some subtle differences in color. For example, smoke may appear off-white or grey, while clouds generally appear brighter white or grey. An attempt may be made to distinguish between color features by analyzing them. The advantage of this method is that it can distinguish clouds from smoke when the weather is clear, the disadvantage being that the colour of smoke, clouds and dust may vary considerably under different environmental conditions. For example, smoke may appear a different color than during the day, at sunrise or sunset. In addition, factors such as lighting conditions, weather conditions, etc. also affect the perception of color, so relying on color features alone may not be robust. The principle of the distinguishing method based on texture features is that the textures of smoke, cloud and dust can be different. Smoke may be softer without clear boundaries, while clouds may have more structure and texture, and by analysis of texture features, an attempt may be made to distinguish them. This approach has the advantage of being unaffected by weather factors, but has the disadvantage that, like color features, texture features may also be affected by environmental conditions and viewing angles. The texture of the smoke may be altered by factors such as air turbulence, making the texture feature less stable. Therefore, the existing smoke judging method based on the edge area extraction technology has the problems that the detection result is affected by weather and the detection result is inaccurate. Disclosure of Invention In order to solve the above problems in the prior art, that is, the existing smoke judging method based on the edge area extraction technology has the problem that the detection result is affected by weather and the detection result is inaccurate, the invention provides a smoke judging method based on the edge area extraction technology, which comprises the following steps: acquiring smoke image data, and training the smoke image data by using a deep learning algorithm to obtain a smoke monitoring model; cutting out the detection frame area of the current frame to obtain a first smoke picture, and cutting out the detection frame area of the frame of T seconds before or T seconds after the current frame to obtain a second smoke picture; respectively converting the two smoke pictures into a first gray level picture and a second gray level picture, respectively performing morphological operation on the two gray level pictures to obtain a first morphological picture and a second morphological picture' And respectively calculating the edge areas of the two morphological graphs, and then judging whether the scene has smoke or not based on the edge area of the first morphological graph and the edge area of the second morphological graph. In a preferred embodiment, the method for respectively performing gray scale conversion on two smoke pictures comprises the following steps: For any smoke picture: Img=(R2.2*0.2126+G2.2*0.7152+B2.2*0.0722)1/2.2; Wherein Img represents a gray-scale map after gray-scale conversion, R, G, B represents pixel values of red, green and blue channels of a smoke picture to be subjected to gray-scale conversion. In a preferred embodiment, the method for performing morphological operations on two gray scales respectively is as follows: For each gray scale map there is: where Img represents any one of gray-scale maps to be subjected to morphological operations, M represents a convolution template to be referred to, and o represents an open operation. In a preferred embodiment, calculating the edge areas of the two morphology maps separately comprises: Respectively extracting edges of the two morphological images in the horizontal direction and the vertical direction by using a Sob