CN115311621A - Elevator smoke detection method and device, electronic equipment and storage medium - Google Patents

Elevator smoke detection method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN115311621A
CN115311621A CN202210949340.3A CN202210949340A CN115311621A CN 115311621 A CN115311621 A CN 115311621A CN 202210949340 A CN202210949340 A CN 202210949340A CN 115311621 A CN115311621 A CN 115311621A
Authority
CN
China
Prior art keywords
saturation
car
smoke
value
standard deviation
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
CN202210949340.3A
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.)
Hitachi Building Technology Guangzhou Co Ltd
Original Assignee
Hitachi Building Technology Guangzhou 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 Hitachi Building Technology Guangzhou Co Ltd filed Critical Hitachi Building Technology Guangzhou Co Ltd
Priority to CN202210949340.3A priority Critical patent/CN115311621A/en
Publication of CN115311621A publication Critical patent/CN115311621A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V20/00Scenes; Scene-specific elements
    • G06V20/50Context or environment of the image
    • G06V20/52Surveillance or monitoring of activities, e.g. for recognising suspicious objects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/40Extraction of image or video features
    • G06V10/50Extraction of image or video features by performing operations within image blocks; by using histograms, e.g. histogram of oriented gradients [HoG]; by summing image-intensity values; Projection analysis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/40Extraction of image or video features
    • G06V10/56Extraction of image or video features relating to colour
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/74Image or video pattern matching; Proximity measures in feature spaces
    • G06V10/75Organisation of the matching processes, e.g. simultaneous or sequential comparisons of image or video features; Coarse-fine approaches, e.g. multi-scale approaches; using context analysis; Selection of dictionaries
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/77Processing image or video features in feature spaces; using data integration or data reduction, e.g. principal component analysis [PCA] or independent component analysis [ICA] or self-organising maps [SOM]; Blind source separation
    • G06V10/774Generating sets of training patterns; Bootstrap methods, e.g. bagging or boosting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V20/00Scenes; Scene-specific elements
    • G06V20/40Scenes; Scene-specific elements in video content
    • G06V20/41Higher-level, semantic clustering, classification or understanding of video scenes, e.g. detection, labelling or Markovian modelling of sport events or news items

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Multimedia (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Software Systems (AREA)
  • Computing Systems (AREA)
  • Artificial Intelligence (AREA)
  • Databases & Information Systems (AREA)
  • Evolutionary Computation (AREA)
  • General Health & Medical Sciences (AREA)
  • Medical Informatics (AREA)
  • Health & Medical Sciences (AREA)
  • Computational Linguistics (AREA)
  • Image Analysis (AREA)

Abstract

The invention discloses an elevator smoke detection method, an elevator smoke detection device, electronic equipment and a storage medium. Obtaining a car RGB histogram of an elevator car; converting the car RGB histogram into a car HSV histogram to obtain a saturation channel pixel value and a brightness channel pixel value; inputting the car HSV histogram into a pre-constructed smoke detection Gaussian mixture model to obtain a background image and a foreground image corresponding to the car HSV histogram; calculating saturation standard deviation and brightness standard deviation of the HSV histogram of the car based on the saturation channel pixel value and the brightness channel pixel value; calculating the difference value of the saturation channel mean value of the background image and the saturation channel mean value of the HSV histogram of the car as the saturation mean value difference; and comparing the saturation standard deviation, the brightness standard deviation and the saturation mean deviation with a plurality of preset smoke judgment standards to obtain an elevator smoke judgment result. Can learn the smog existence condition in the elevator car, the staff can in time make different measures according to the severity that smog exists.

Description

Elevator smoke detection method and device, electronic equipment and storage medium
Technical Field
The invention relates to the technical field of image recognition, in particular to an elevator smoke detection method and device, electronic equipment and a storage medium.
Background
The smog condition in the real time monitoring elevator car can in time discover elevator car's abnormal conditions to in time deal with is made, to potential safety hazard or artificial crime early warning, thereby prevents that crime or calamity from taking place, provides the guarantee for people's the security of the lives and property.
At present, whether smoke conditions exist in an elevator car or not is pre-warned by a main smoke sensor in a smoke detection method in an elevator, the situation that the detection is insensitive can exist when the smoke sensor is used for detecting the smoke conditions in the elevator car in the prior technical scheme, the situation that the smoke sensor can not detect a small amount of smoke exists, meanwhile, the current smoke diffusion situation in the elevator car cannot be directly and quickly known by using the smoke sensor for detection, the severity of the smoke existence cannot be evaluated, and further, workers cannot quickly respond to the smoke sensor to make reasonable measures.
Disclosure of Invention
The invention provides an elevator smoke detection method, an elevator smoke detection device, electronic equipment and a storage medium, which are used for monitoring the smoke existence condition of an elevator car on line through an image shot by a camera and judging the severity of the current smoke existence so that working personnel can take different measures.
According to an aspect of the present invention, there is provided an elevator smoke detection method including:
obtaining a car RGB histogram of an elevator car;
converting the car RGB histogram into a car HSV histogram to obtain a saturation channel pixel value and a brightness channel pixel value;
inputting the car HSV histogram into a pre-constructed smoke detection Gaussian mixture model to obtain a background image and a foreground image corresponding to the car HSV histogram;
calculating saturation standard deviation and brightness standard deviation of the car HSV histogram based on the saturation channel pixel value and the brightness channel pixel value;
calculating the difference value between the saturation channel mean value of the background image and the saturation channel mean value of the HSV histogram of the car as a saturation mean value difference;
and comparing the saturation standard deviation, the brightness standard deviation and the saturation mean deviation with a plurality of preset smoke judgment standards to obtain an elevator smoke judgment result.
According to another aspect of the present invention, there is provided an elevator smoke detection apparatus comprising:
the elevator car RGB histogram acquisition module is used for acquiring an elevator car RGB histogram of an elevator car;
the histogram conversion module is used for converting the car RGB histogram into a car HSV histogram;
the background separation module is used for inputting the car HSV histogram into a pre-constructed smoke detection Gaussian mixture model to obtain a background image and a foreground image corresponding to the car HSV histogram;
the standard deviation calculation module is used for calculating the saturation standard deviation and the brightness standard deviation of the HSV histogram of the car;
the saturation mean value difference calculating module is used for calculating the difference value between the saturation channel mean value of the background image and the saturation channel mean value of the car HSV histogram to serve as the saturation mean value difference;
and the elevator smoke judgment result generation module is used for comparing the saturation standard deviation, the brightness standard deviation and the saturation mean value difference with a plurality of preset smoke judgment standards to obtain an elevator smoke judgment result.
According to another aspect of the present invention, there is provided an electronic apparatus including:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores a computer program executable by the at least one processor, the computer program being executable by the at least one processor to enable the at least one processor to perform the elevator smoke detection method of any of the embodiments of the present invention.
According to another aspect of the present invention, there is provided a computer readable storage medium having stored thereon computer instructions for causing a processor to execute a method of elevator smoke detection according to any of the embodiments of the present invention.
According to the technical scheme of the embodiment of the invention, the car RGB histogram of the elevator car is obtained; converting the car RGB histogram into a car HSV histogram to obtain a saturation channel pixel value and a brightness channel pixel value; inputting the car HSV histogram into a pre-constructed smoke detection Gaussian mixture model to obtain a background image and a foreground image corresponding to the car HSV histogram; calculating saturation standard deviation and brightness standard deviation of the HSV histogram of the car based on the saturation channel pixel value and the brightness channel pixel value; calculating the difference value of the saturation channel mean value of the background image and the saturation channel mean value of the HSV histogram of the car as the saturation mean value difference; and comparing the saturation standard deviation, the brightness standard deviation and the saturation mean deviation with a plurality of preset smoke judgment standards to obtain an elevator smoke judgment result. The method can rapidly reflect the smoke condition in the current elevator car by identifying and detecting the shot image in car monitoring, can obtain the mean value difference of the current image by performing foreground and background separation analysis on the image by using a mixed Gaussian distribution model based on a series of calculation and operation on the saturation channel pixel value and the brightness pixel channel value in the car HSV histogram, and can determine the judgment result of the smoke existence degree of the current elevator according to the smoke judgment standard so as to know the smoke existence condition in the current elevator car, so that a worker can take different measures according to the smoke existence severity in time, the safety of the elevator is protected as much as possible, and accidents are avoided in time.
It should be understood that the statements in this section are not intended to identify key or critical features of the embodiments of the present invention, nor are they intended to limit the scope of the invention. Other features of the present invention will become apparent from the following description.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1A is a flowchart of an elevator smoke detection method according to an embodiment of the present invention;
fig. 1B is an interface diagram of a monitoring visual interface corresponding to global smoke according to an embodiment of the present invention;
fig. 1C is an interface diagram of a monitoring visual interface corresponding to local smoke according to an embodiment of the present invention;
fig. 2 is a flowchart of a method for constructing a smoke detection gaussian mixture model according to a second embodiment of the present invention;
fig. 3 is a schematic structural diagram of an elevator smoke detection device provided according to a third embodiment of the invention;
fig. 4 is a schematic structural diagram of an electronic device for implementing the elevator smoke detection method according to the embodiment of the present invention.
Detailed Description
In order to make the technical solutions of the present invention better understood, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
Example one
Fig. 1A is a flowchart of an elevator smoke detection method according to an embodiment of the present invention, which is applicable to online monitoring of smoke in an elevator car through an image captured by a camera, and determining a severity of current smoke, so that a worker can take different measures. As shown in fig. 1A, the method includes:
s101, obtaining a car RGB histogram of an elevator car.
A camera is usually provided in the elevator car for monitoring the implementation in the elevator car. A video image sequence is obtained from a camera of an elevator car, and a plurality of frames of video sequence images are obtained at the moment, wherein the images exist in the form of a car RGB (Red-Green-BLue) histogram.
The color space of the car RGB histogram has the characteristics of intuition and robustness, and consists of three basic colors of red, green and blue; the RGB histogram is a physical feature of the image retrieval system, and the three basic colors are highly correlated and are not suitable for describing the target object in the image, so S102 needs to be executed to convert the car RGB histogram into a car HSV (Hue-Saturation-Value) histogram suitable for image processing.
It should be noted that, in the embodiment of the present invention, acquiring a video image sequence is an exemplary description of the embodiment of the present invention, and in other embodiments of the present invention, a single-frame car RGB histogram may also be acquired.
And S102, converting the car RGB histogram into a car HSV histogram to obtain a saturation channel pixel value and a brightness channel pixel value.
In the closed space of the elevator car, the smoke moves rapidly and irregularly, is scattered and distributed in the whole space in disorder, and has optical phenomena of refraction, reflection, scattering and the like. From these phenomena, two physical characteristics of the smoke are obtained, respectively a colour characteristic and a movement characteristic.
The HSV color histogram is the hierarchical description of the RGB color histogram, can effectively capture perceived colors, is simple to calculate, has obvious advantages in the aspect of image processing, has the characteristics of different brightness, saturation and hue elements, and can be separated from each other.
And calculating pixel values of red, green and blue channels in the car RGB histogram, and converting the pixel values into pixel values of hue, saturation and brightness channels in the HSV model to obtain the corresponding car HSV histogram.
The saturation channel pixel value and the brightness channel pixel value in the HSV histogram of the elevator car obtained through conversion can be subjected to further operation and analysis subsequently to obtain smoke color characteristics in the elevator car, and the smoke existence condition of the elevator car is further determined through the smoke color characteristics.
It should be noted that, the method for obtaining the saturation channel pixel value and the luminance channel pixel value in the embodiment of the present invention is only an example, and is not limited.
In some embodiments of the invention, S102 comprises:
s1021, calculating the pixel value of the saturation channel through the following formula:
Figure BDA0003788510740000061
where R (x, y) represents a pixel value of a red channel, G (x, y) represents a pixel value of a green channel, and B (x, y) represents a pixel value of a blue channel.
And calculating the red channel pixel value, the green channel pixel value and the blue channel pixel value of each pixel point in the car RGB histogram according to the formula to obtain the saturation channel pixel value of each pixel point in the car HSV histogram.
S1022, calculating a pixel value of the luminance channel by the following formula:
Figure BDA0003788510740000062
and calculating the red channel pixel value, the green channel pixel value and the blue channel pixel value of each pixel point in the obtained car RGB histogram according to the formula to obtain the saturation channel pixel value of each pixel point in the car HSV histogram.
The embodiment of the invention can also obtain the hue channel pixel value in the HSV histogram of the car according to the actual requirement, and the embodiment of the invention is only used for example and is not limited.
S103, inputting the car HSV histogram into a pre-constructed smoke detection Gaussian mixture model to obtain a background image and a foreground image corresponding to the car HSV histogram.
Because smoke is a random moving object, in order to detect, identify and track the random motion characteristics of the smoke in the elevator car, a pre-constructed smoke detection Gaussian mixture model is required to distinguish the foreground and the background in the HSV histogram of the elevator car, so that the randomly moving smoke foreground is distinguished according to the background model of the elevator car.
A gaussian mixture model is a model that accurately quantifies things using a probability density function, which decomposes an image into several models based on gaussian functions that easily distinguish between foreground and background. The foreground is that any meaningful moving object is the foreground under the condition that the background is assumed to be static.
And inputting the HSV histogram of the lift car into a smoke detection Gaussian mixture model which is trained by using a plurality of pictures in advance, and further separating out a corresponding background image and a corresponding foreground image so as to analyze the irregular movement of the smoke according to the background image or the foreground image subsequently, and further obtaining the smoke condition of the elevator.
It should be noted that, in the embodiment of the present invention, how to construct the smoke detection gaussian mixture model, and specifically how to use the smoke detection gaussian mixture model are only exemplified and not limited.
In some embodiments of the invention, S103 comprises:
and S1031, inputting the HSV histogram of the car into a pre-constructed smoke detection Gaussian mixture model to obtain weights, mean values and variances corresponding to a plurality of Gaussian functions.
The smoke detection Gaussian mixture model is provided with a plurality of Gaussian functions, and the Gaussian functions are provided with corresponding weights, mean values and variances.
Before elevator smoke detection is carried out, smoke detection mixed Gaussian models are constructed for each pixel point in a car HSV histogram in advance in the elevator smoke detection device, illustratively, if the size of the car HSV histogram is H multiplied by W, H multiplied by W smoke detection mixed Gaussian models are constructed in the elevator smoke detection device in advance, each smoke detection mixed Gaussian model comprises a preset number of Gaussian functions, and each Gaussian function has corresponding weight, mean value and variance.
And respectively inputting each pixel point of the converted HSV histogram of the car to a corresponding pre-constructed smoke detection Gaussian mixture model, matching the pixel point with the smoke detection Gaussian mixture model according to a preset matching rule, and updating the weight, the mean value and the variance of each Gaussian function in the smoke detection Gaussian mixture model corresponding to the pixel point. The specific matching method and the method for determining the weight, the mean and the variance corresponding to the gaussian functions in the smoke detection gaussian mixture model are not described in detail herein, and a second embodiment of the present invention is described in detail.
It should be noted that, the embodiment of the present invention does not limit the process of determining the weight, the mean value, and the variance corresponding to a plurality of gaussian functions in the smoke detection gaussian mixture model.
S1032, calculating weights corresponding to the Gaussian functions to divide the square difference to obtain parameter values corresponding to the Gaussian functions.
And calculating the ratio of the weight and the variance of each Gaussian function in the smoke detection Gaussian mixture model corresponding to a certain pixel point as the parameter value corresponding to each Gaussian function.
It should be noted that, the specific evaluation process of the parameter value in the embodiment of the present invention is only an example, and is not limited, and the parameter value may be further calculated in other embodiments of the present invention.
And S1033, arranging the Gaussian functions according to the corresponding parameter values in a descending order.
In the smoke detection gaussian mixture model, some gaussian functions represent the background and others represent the foreground. When the moving object enters the background, the new pixel value cannot be matched with any Gaussian model, and the variance value is increased until the moving object stops moving. Therefore, a plurality of gaussian distribution functions in the smoke detection gaussian model need to be arranged in a descending order according to parameter values, so as to select the former gaussian functions as the background.
S1034, selecting a first number of Gaussian functions in the smoke detection mixed Gaussian model as background points, and generating a background image, wherein the first number meets the following conditions:
Figure BDA0003788510740000081
wherein B is a first number, ω i Is the weight corresponding to the ith Gaussian function, T is a preset critical threshold value, omega i Is the weight of the ith gaussian function.
And sequentially executing a plurality of Gaussian functions corresponding to the first quantity before the pixel point is selected as background points for each pixel point in the car HSV model, and finally generating a background image.
The first number of the Gaussian functions selected for generating the background image is self-adaptive and adjustable, and the foreground and background of the corresponding image are separated more accurately.
And S1035, taking the rest Gaussian functions as foreground points, and generating a foreground image.
And sequentially executing the Gaussian functions corresponding to the pixel point in the HSV model of the car, wherein the Gaussian functions except the first Gaussian function are used as foreground points, and finally generating a foreground image.
And S1036, updating the smoke detection Gaussian mixture model.
The weights, the mean values and the variances corresponding to the Gaussian functions in the original smoke detection Gaussian mixture model of each pixel are replaced by the weights, the mean values and the variances corresponding to the Gaussian functions obtained in the smoke detection Gaussian mixture model corresponding to each pixel obtained in the step S1031 through matching and updating, the weights, the mean values and the variances are used as the updated smoke detection Gaussian mixture model, when smoke detection is carried out on the HSV histogram of the next frame of the lift car, the foreground and the background can be distinguished more accurately, and the accuracy of elevator smoke detection is further improved.
It should be noted that, in the embodiments of the present invention, how to update the smoke detection gaussian mixture model is only exemplified and not limited, and in some embodiments of the present invention, whether a pixel with a foreground and background property changed or not may be marked, a pixel with a foreground and background property unchanged is kept unchanged in current weight, mean, and variance, and the weight, mean, and variance of the pixel with the foreground and background property changed are updated.
And S104, calculating saturation standard deviation and brightness standard deviation of the HSV histogram of the car based on the saturation channel pixel value and the brightness channel pixel value.
And calculating by using the saturation channel pixel value and the brightness channel pixel value in the HSV histogram of the lift car to obtain the saturation standard deviation and the brightness standard deviation corresponding to the current HSV histogram of the lift car. The saturation pixel value and the discrete degree of the brightness pixel value of the current car HSV histogram can be analyzed through the saturation standard deviation and the brightness standard deviation, the color characteristic of the current smoke can be judged through the discrete degree, and the severity of the smoke can be further judged, wherein the severity is, for example, the smoke is distributed globally, the smoke is generated locally or no smoke exists in an elevator car.
In some embodiments of the present invention, S104 comprises:
and S1041, adding the saturation channel pixel values of all pixels in the HSV histogram to obtain a total saturation channel pixel value.
And adding the saturation channel pixel values of all the pixel points in the saturation channel obtained by conversion in the HSV histogram of the car to obtain the total saturation channel pixel value corresponding to the HSV histogram of the car.
Illustratively, if the width of the HSV histogram of the car is W and the height of the HSV histogram of the car is H, the saturation channel pixel values corresponding to the H × W pixel points are added to obtain a total saturation channel pixel value.
And S1042, dividing the total value of the saturation channel pixels by the total number of the saturation channel pixels to obtain a saturation channel pixel average value.
Illustratively, the car HSV histogram has H × W pixels, and the saturation channel pixel average value is obtained by dividing the total saturation channel pixel value by the total saturation channel pixel amount H × W.
S1043, calculating a saturation standard deviation by the following formula based on the saturation channel pixel value and the saturation channel pixel mean value:
Figure BDA0003788510740000101
wherein, P n The total number of saturation channel pixel points, beta (x, y) represents a saturation channel pixel value corresponding to a pixel, mean beta represents a saturation channel pixel Mean value, and H and W represent the height and width of the HSV histogram of the car respectively.
And calculating the saturation standard deviation of the current car HSV histogram through the formula to obtain the color characteristics expressed on the saturation channel.
And S1044, adding the brightness channel pixel values of all the pixels in the HSV histogram to obtain a total brightness channel pixel value.
And adding the brightness channel pixel values of all pixel points in the brightness channel obtained by conversion in the car HSV histogram to obtain the total brightness channel pixel value corresponding to the car HSV histogram.
Illustratively, if the width of the HSV histogram of the car is W and the height of the HSV histogram of the car is H, the luminance channel pixel values corresponding to the H × W pixel points are added to obtain the total luminance channel pixel value.
And S1045, dividing the total value of the brightness channel pixels by the total quantity of the brightness channel pixels to obtain a brightness channel pixel average value.
Illustratively, H × W pixels are shared in the car HSV histogram, and the luminance channel pixel average value is obtained by dividing the total luminance channel pixel value by the total luminance channel pixel amount H × W.
S1046, calculating a luminance standard deviation by the following formula based on the luminance channel pixel value and the luminance channel pixel mean value:
Figure BDA0003788510740000111
wherein Q is n Is the total value of the pixels of the brightness channel, phi (x, y) represents the pixel value of the brightness channel corresponding to the pixel, mean phi represents the Mean value of the pixels of the brightness channel, and H and W respectively represent the height of the HSV histogram of the carAnd a width.
And calculating the brightness standard deviation of the current HSV histogram of the car by the formula to obtain the color characteristics expressed on the brightness channel.
It should be noted that, the method for calculating the saturation standard deviation and the brightness standard deviation of the car HSV histogram in the embodiment of the present invention is only an example, and is not limited thereto, and in other embodiments of the present invention, the pixel points in the car HSV histogram may also be extracted at equal intervals, and the saturation standard deviation and the brightness standard deviation are calculated by using the extracted pixel points.
And S105, calculating a difference value between the saturation channel mean value of the background image and the saturation channel mean value of the HSV histogram of the car as a saturation mean value difference.
Comparing the saturation channel mean value of the background image obtained by the Gaussian mixture model with the saturation channel mean value of the original car HSV histogram, wherein when the difference between the saturation channel mean values of the pixels of the background image and the original car HSV histogram is smaller, the more similar the states of the background image and the original image obtained by the Gaussian mixture model are; when the difference between the background image and the saturation mean value of the original HSV histogram is larger, it is indicated that the HSV histogram may have a foreground image with the changed saturation mean value, that is, smoke may exist in the car.
It should be noted that, in the embodiment of the present invention, how to calculate the difference between the saturation channel mean of the background image and the saturation channel mean of the HSV histogram of the car is an exemplary description of the embodiment of the present invention, and in other embodiments of the present invention, the saturation channel mean of the background image and the saturation channel mean of the HSV histogram of the car may be multiplied by related weights respectively and then compared, which is only an example and is not limited in the embodiment of the present invention.
In some embodiments of the invention, S105 comprises:
s1051, adding the background saturation channel pixel values of all pixels in the background image to obtain the total background saturation channel pixel value.
And adding the background saturation channel pixel values corresponding to each pixel point in the background image obtained by the Gaussian mixture model to obtain a background saturation channel pixel total value corresponding to the background image.
And S1052, dividing the total value of the background saturation channel pixels by the total number of the background saturation channel pixels to obtain a background saturation channel pixel average value.
Illustratively, the background image has H × W pixels, and the total value of the background saturation channel pixels is divided by the total number H × W of the background saturation channel pixels to obtain a background saturation channel pixel average value.
S1053, calculating the background saturation pixel mean value minus the saturation channel pixel mean value to obtain the saturation mean value difference.
And subtracting the saturation channel pixel mean value corresponding to the original car HSV histogram from the background saturation pixel mean value corresponding to the background image to obtain the saturation mean value difference of the two images, and using the saturation mean value difference as a comparison result of the two images. And the calculated saturation mean difference is used as the motion characteristic of smoke in the HSV histogram of the car.
And S106, comparing the saturation standard deviation, the brightness standard deviation and the saturation mean value deviation with a plurality of preset smoke judgment standards to obtain an elevator smoke judgment result.
A plurality of smoke judgment standards are preset in the elevator smoke detection device, each smoke judgment standard is provided with a threshold of a saturation standard deviation, a threshold of a brightness standard deviation and a threshold of a saturation mean value difference, and each preset smoke judgment standard represents the existence degree of smoke in different elevator cars.
And the saturation standard deviation and the brightness standard deviation are used as the color characteristics of smoke in the elevator car, and the saturation mean deviation is used as the motion characteristics of the smoke in the elevator car. And comparing the reference data representing the color characteristics and the motion characteristics of the smoke with a plurality of preset judgment standards to obtain the elevator smoke judgment result detected according to the current car HSV histogram. According to the invention, the condition that smoke exists in the elevator car can be further subdivided by setting a plurality of preset smoke judgment standards, the severity of the smoke existing in the elevator car can be obtained by calculating and analyzing the pictures acquired by the camera, so that workers can conveniently take corresponding protection measures according to different severity, meanwhile, the smoke in the elevator car can be sensitively detected, and the accuracy of smoke detection is increased.
Illustratively, two smoke judgment standards are preset, namely a global smoke judgment standard and a local smoke judgment standard, and the elevator smoke judgment result is divided into three degrees, namely global smoke, local smoke and no smoke, through the two smoke judgment standards.
It should be noted that, in the embodiment of the present invention, two kinds of smoke determination criteria are preset to distinguish three kinds of elevator smoke determination results, which is an exemplary description of the embodiment of the present invention, in other embodiments of the present invention, other numbers of smoke determination criteria may also be set to refine and distinguish more elevator smoke determination results of different degrees, and the embodiment of the present invention is only an example, and is not limited.
In some embodiments of the invention, S106 comprises:
s1061, judging whether the saturation standard deviation, the brightness standard deviation and the saturation mean value deviation meet a preset global smoke judgment standard or not.
Firstly, judging whether the current reference data meets a preset global smoke judgment standard, wherein the specific global smoke judgment standard at least comprises the following steps: the saturation standard deviation is smaller than a preset global saturation standard deviation threshold value, the brightness standard deviation is smaller than a preset global brightness standard deviation threshold value, and the saturation mean difference is larger than a preset global mean difference; if the smoke meets the preset global smoke judgment standard, executing S1062; if the smoke does not meet the preset global smoke judgment standard, S1063 is performed.
For example, whether the reference data meets a car standard that the saturation standard deviation is less than 20 preset, the brightness standard deviation is less than 45 preset, and the saturation mean difference is greater than 5 preset is judged, that is, whether the color features in the current car HSV histogram meet the car standard that the elevator car is full of smoke is judged, when the calculated reference data meets the threshold condition of the global smoke judgment standard, S1062 is executed to determine that the current elevator smoke judgment result is global smoke, and if any value in the reference data does not meet the threshold of the global judgment standard, S1063 is executed to further judge whether the current elevator smoke is local smoke.
And S1062, determining the elevator smoke judgment result as global smoke.
And when the saturation standard deviation, the brightness standard deviation and the saturation mean value deviation all accord with preset global smoke judgment standards, determining that the smoke judgment result is global smoke, and prompting in a monitoring visual interface corresponding to elevator smoke detection to inform a worker of the abnormal condition of the current global smoke.
For example, fig. 1B is an interface diagram of a monitoring visual interface corresponding to global smoke according to an embodiment of the present invention, as shown in fig. 1B, when the elevator smoke determination result is global smoke, a character "smoke-flag" indicating whether smoke exists in the monitoring visual interface is modified to "True" to remind a worker that smoke exists in the current elevator car, and a red border contour is added in the monitoring visual interface to further remind the worker of a current emergency situation, so that the worker can find the current emergency situation in the elevator as soon as possible and timely take measures corresponding to the degree to reduce life risks of the worker and loss of property as far as possible.
And S1063, judging whether the saturation standard deviation, the brightness standard deviation and the saturation mean deviation accord with a preset local smoke judgment standard or not.
And when the reference data does not meet the preset global smoke judgment standard, further judging whether the reference data meets the global smoke judgment standard. Specifically, the local smoke judgment criteria at least include: the saturation standard deviation is smaller than a preset local saturation standard deviation threshold, the brightness standard deviation is smaller than a preset local brightness standard deviation threshold, and the saturation mean difference is larger than a preset local mean difference. If the smoke meets the preset local smoke judgment standard, executing S1064; if the smoke does not meet the preset local smoke judgment standard, the process goes to step S1065.
For example, it is determined whether the reference data meets the criterion that the saturation standard deviation is less than the preset 10, the brightness standard deviation is less than the preset 22.5, and the saturation mean difference is greater than the preset 10, that is, it is determined whether the color feature in the HSV histogram of the current car meets the criterion that smoke exists in a small range of a partial region of the elevator car, when the calculated reference data meets the threshold condition of the local smoke determination criterion, S1064 is performed to determine that the current elevator smoke determination result is local smoke, and if any one of the values in the reference data does not meet the threshold of the global determination criterion, S1065 is performed to determine that the current elevator smoke determination result is no smoke.
And S1064, determining that the elevator smoke judgment result is local smoke.
And when the saturation standard deviation, the brightness standard deviation and the saturation mean value deviation all accord with the preset local smoke judgment standard and do not meet the preset global smoke judgment standard, determining that the smoke judgment result is local smoke, and prompting in a monitoring visual interface corresponding to elevator smoke detection to inform a worker of the abnormal condition of the current local smoke.
For example, fig. 1C is an interface diagram of a monitoring visual interface corresponding to local smoke according to an embodiment of the present invention, as shown in fig. 1C, when an elevator smoke determination result is local smoke, a character "smoke-flag" in the monitoring visual interface indicating whether smoke exists is modified to "True", and a position where smoke exists is marked to remind a worker that smoke exists in a current elevator car, so that the worker can find an abnormal situation in the current elevator as soon as possible and make an emergency measure corresponding to the degree.
And S1065, determining that the elevator smoke judgment result is no smoke.
When the saturation standard deviation, the brightness standard deviation and the saturation mean deviation do not meet the preset global smoke judgment standard and the preset local smoke judgment standard, determining that the smoke judgment result is smoke-free, namely that the current elevator has no abnormal condition, and prompting that the current elevator is in a normal condition in a monitoring visual interface corresponding to elevator smoke detection.
Illustratively, when the elevator smoke judgment result is no smoke, modifying the character 'smoke-flag' which indicates whether smoke exists in the monitoring visual interface into 'Flase' to indicate that no abnormality exists in the elevator car.
It should be noted that, in the embodiment of the present invention, specific threshold data of the global smoke determination criterion and the local smoke determination criterion are only exemplified and not limited, and in other embodiments of the present invention, a numerical value in the smoke determination criterion may also be modified according to an actual requirement of a manager.
According to the technical scheme of the embodiment of the invention, the car RGB histogram of the elevator car is obtained; converting the car RGB histogram into a car HSV histogram to obtain a saturation channel pixel value and a brightness channel pixel value; inputting the car HSV histogram into a pre-constructed smoke detection Gaussian mixture model to obtain a background image and a foreground image corresponding to the car HSV histogram; calculating saturation standard deviation and brightness standard deviation of the HSV histogram of the car based on the saturation channel pixel value and the brightness channel pixel value; calculating the difference value of the saturation channel mean value of the background image and the saturation channel mean value of the HSV histogram of the lift car as the saturation mean value difference; and comparing the saturation standard deviation, the brightness standard deviation and the saturation mean value deviation with a plurality of preset smoke judgment standards to obtain an elevator smoke judgment result. The method can quickly reflect the smoke condition in the current elevator car by identifying and detecting the image shot in car monitoring, can obtain the mean value difference of the current image by performing foreground and background separation analysis on the image by using a mixed Gaussian distribution model based on a series of calculation and operation in a saturation channel pixel value and a brightness pixel channel value in a car HSV histogram, and can determine the judgment result of the smoke existence degree of the current elevator according to the smoke judgment standard so as to know the smoke existence condition in the current elevator car, so that a worker can make different measures according to the smoke existence severity degree in time, the safety of the elevator is protected as much as possible, and accidents are avoided in time.
Example two
Fig. 2 is a flowchart of a method for constructing a smoke detection gaussian mixture model according to a second embodiment of the present invention, which is the method for constructing a gaussian mixture model used in the second embodiment. As shown in fig. 2, the method includes:
s201, initializing the number of Gaussian functions of the smoke detection mixed Gaussian model and the weight, the mean value and the variance corresponding to each Gaussian function.
Initializing smoke detection Gaussian mixture models with corresponding numbers according to the size of the HSV histogram of the lift car, namely the total number of pixel points, wherein the formula of each smoke detection Gaussian mixture model is as follows:
Figure BDA0003788510740000161
wherein K is the number of Gaussian functions in the smoke detection mixed Gaussian model, omega i,t Representing the weight occupied by the ith gaussian function at time t.
Specifically, the formula of the gaussian function in the smoke detection gaussian mixture model is as follows:
Figure BDA0003788510740000171
where i is the number of the Gaussian function, x t Is the pixel approximate value of the current t moment, sigma i,t A covariance matrix of the pixel at the ith Gaussian function representing the time t; mu.s i,t The mean matrix representing the ith gaussian function at time t.
Illustratively, the number of gaussian functions in the smoke detection gaussian mixture model is set, the weight of each gaussian function is initialized to 1, the mean value is set to be a preset initial mean value, and the variance is set to be a preset initial variance, so as to complete initialization of the smoke detection gaussian mixture model.
It should be noted that, the specific initialization of the smoke detection gaussian mixture model is only an example, and is not limited, and other initialization methods may be used in other embodiments of the present invention.
In addition, the smoke detection gaussian mixture model and the formula of the gaussian function are only exemplified and not limited in the embodiment of the invention.
S202, obtaining a plurality of car smoke training pictures.
And obtaining a plurality of pictures of the elevator car for training and constructing a smoke detection Gaussian mixture model. For example, a video clip with a preset frame number can be obtained from a video of a monitoring camera, and a picture sequence in the video clip is used as a car smoke training picture.
It should be noted that, in the embodiment of the present invention, the manner of obtaining the car smoke training picture is only an example, and is not limited.
S203, matching each pixel point of the car smoke training picture with a Gaussian function in the smoke detection Gaussian mixture model according to a preset matching rule, wherein the matching rule is as follows:
|X ti,t |<Sσ i,t
wherein S is a preset background threshold value, u i,t Is the mean of the gaussian function.
S204, sequentially judging whether the pixel points are matched with the Gaussian function; if the pixel point is matched with the gaussian function, executing S205; if the pixel point and the gaussian function are not matched, S206 is performed.
S205, updating the weight, the mean value and the variance of the Gaussian function with the maximum parameter value according to the following formula:
ω i,t =ω i,t-1 +α(1-ω i,t-1 )
u t =(1-ρ)u t-1 +ρX t
Figure BDA0003788510740000181
wherein, ω is i,t 、μ t
Figure BDA0003788510740000182
The weight, mean and variance, omega, of the ith Gaussian function of the pixel point at the time t i,t-1 、μ t
Figure BDA0003788510740000183
The weight, the mean value and the variance of the ith Gaussian function of the pixel point at the corresponding position in the image at the time t-1 are shown, alpha represents a preset learning rate, and rho represents a parameter learning rate, wherein the parameter learning rate is rho = alpha/omega i,t-1
S206, maintaining the mean value and the variance of the Gaussian function with the minimum parameter value unchanged, and modifying the weight of the Gaussian function with the minimum parameter value as follows:
ω i,t =(1-α)ω i,t-1
S203-S206, judging whether a certain pixel point of the car smoke training picture is matched with a Gaussian function in a corresponding smoke detection mixed Gaussian model, if so, executing S205 to update the weight, the mean value and the variance of the Gaussian function with the largest parameter value; and if the pixel point is not matched with all Gaussian functions in the smoke detection mixed Gaussian model, executing S206 to the Gaussian function with the minimum parameter value, keeping the mean value and the variance unchanged, and modifying the weight of the Gaussian function. And sequentially modifying the weight, the mean value and the variance of each Gaussian function in the smoke detection Gaussian mixture model by using the car smoke training picture to construct the smoke detection Gaussian mixture model of each pixel point.
It should be noted that, the training process of the smoke detection gaussian mixture model in the embodiment of the present invention is only an example, and is not limited.
In addition, in the first embodiment, in S103, the car HSV histogram is input into a pre-constructed smoke detection gaussian mixture model to obtain weights, mean values, and variances corresponding to a plurality of gaussian functions, and the specific implementation manner is as follows: the car HSV histogram is used as a car smoke training picture, and S203 to S206 in the second embodiment are executed to obtain the weight, mean value and variance corresponding to each gaussian function. The smoke detection mixed Gaussian model is in the process of continuous updating and learning, the newly obtained weight, mean value and variance are updated while the new weight, mean value and variance are determined by using the constructed smoke detection mixed Gaussian model to calculate parameter values, the sensitivity of the smoke detection mixed Gaussian model for detecting the foreground and the background is kept, and the timeliness and the accuracy of elevator smoke detection can be ensured.
EXAMPLE III
Fig. 3 is a schematic structural diagram of an elevator smoke detection device provided in the third embodiment of the present invention. As shown in fig. 3, the apparatus includes:
a car RGB histogram acquisition module 301, configured to acquire a car RGB histogram of an elevator car;
a histogram conversion module 302, configured to convert the car RGB histogram into a car HSV histogram;
the background separation module 303 is configured to input the car HSV histogram into a pre-constructed smoke detection gaussian mixture model to obtain a background image and a foreground image corresponding to the car HSV histogram;
a standard deviation calculation module 304, configured to calculate a saturation standard deviation and a brightness standard deviation of the HSV histogram of the car;
a saturation mean difference calculation module 305, configured to calculate a difference between a saturation channel mean of the background image and a saturation channel mean of the car HSV histogram, as a saturation mean difference;
and the elevator smoke judgment result generation module 306 is used for comparing the saturation standard deviation, the brightness standard deviation and the saturation mean value deviation with a plurality of preset smoke judgment standards to obtain an elevator smoke judgment result.
Optionally, the histogram conversion module 302 includes:
a saturation channel pixel value operator module for calculating a saturation channel pixel value by the following formula:
Figure BDA0003788510740000201
wherein R (x, y) represents a pixel value of an R channel, G (x, y) represents a pixel value of a G channel, and B (x, y) represents a pixel value of a B channel;
a luminance channel pixel value operator module for calculating a luminance channel pixel value by the following formula:
Figure BDA0003788510740000202
optionally, elevator smoke detection device includes:
the smoke detection mixed Gaussian model initialization module initializes the number of Gaussian functions of the smoke detection mixed Gaussian model and the weight, the mean value and the variance corresponding to each Gaussian function, wherein the formula of the Gaussian function is as follows:
Figure BDA0003788510740000203
where i is the number of the Gaussian function, x t Is the pixel approximate value of the current t moment, sigma i,t A covariance matrix of the pixel at the ith Gaussian function representing the time t; mu.s i,t A mean matrix representing the ith Gaussian function at time t;
the formula of the smoke detection Gaussian mixture model is as follows:
Figure BDA0003788510740000204
wherein K is the number of Gaussian functions, omega, in the smoke detection mixed Gaussian model i,t Representing the weight occupied by the ith Gaussian function at the time t;
the training picture acquisition module is used for acquiring a plurality of car smoke training pictures;
the image model matching module is used for matching each pixel point of the car smoke training image with a Gaussian function in the smoke detection Gaussian mixture model according to a preset matching rule, wherein the matching rule is as follows:
|X ti,t |<Sσ i,t
wherein S is a preset background threshold value, u i,t Is the mean of the gaussian function;
the matching judgment module is used for sequentially judging whether the pixel points are matched with the Gaussian function;
a first updating module of the gaussian function, configured to update the weight, the mean and the variance of the gaussian function with the largest parameter value according to the following formula:
ω i,t =ω i,t-1 +α(1-ω i,t-1 )
u t =(1-ρ)u t-1 +ρX t
Figure BDA0003788510740000211
wherein, the ω is i,t 、μ t
Figure BDA0003788510740000212
The weight, mean and variance, omega, of the ith Gaussian function of the pixel point at the time t i,t-1 、μ t
Figure BDA0003788510740000213
The weight, the mean value and the variance of the ith Gaussian function of the pixel point at the corresponding position in the image at the time t-1 are shown, alpha represents a preset learning rate, and rho represents a parameter learning rate, wherein the parameter learning rate is rho = alpha/omega i,t-1
A second updating module of the gaussian function, configured to maintain the mean and the variance of the gaussian function with the minimum parameter value unchanged, and modify the weight of the gaussian function with the minimum parameter value to be:
ω i,t =(1-α)ω i,t-1
optionally, the background separation module 303 includes:
the weight variance determining submodule is used for inputting the HSV histogram of the lift car into a pre-constructed smoke detection Gaussian mixture model to obtain weights, mean values and variances corresponding to a plurality of Gaussian functions;
the parameter value calculation submodule is used for calculating the weight corresponding to the Gaussian functions and dividing the weight by the variance to obtain parameter values corresponding to the Gaussian functions;
the parameter value arrangement submodule is used for arranging the Gaussian functions in a descending order according to the corresponding parameter values;
a background image generation sub-module, configured to select a first number of the gaussian functions in the smoke detection gaussian mixture model as background points, and generate the background image, where the first number satisfies:
Figure BDA0003788510740000221
wherein B is a first number, ω i Is the weight corresponding to the ith Gaussian function, T is a preset critical threshold value, omega i The weight of the ith Gaussian function;
the foreground image generation submodule is used for generating the foreground image by taking the rest Gaussian functions as foreground points;
and the mixed Gaussian model updating submodule is used for updating the smoke detection mixed Gaussian model.
Optionally, the standard deviation calculating module includes:
the saturation channel pixel total value calculation submodule is used for adding the saturation channel pixel values of all pixels in the car HSV histogram to obtain the saturation channel pixel total value;
the saturation channel pixel mean value calculating submodule is used for dividing the total saturation channel pixel value by the total saturation channel pixel number to obtain the saturation channel pixel mean value;
a saturation standard deviation calculation submodule, configured to calculate a saturation standard deviation based on the saturation channel pixel value and the saturation channel pixel mean value by using the following formula:
Figure BDA0003788510740000222
wherein, P n Is the total number of pixels in the saturation channel, β: (x, y) represents a saturation channel pixel value corresponding to the pixel, mean β represents a saturation channel pixel Mean value, and H and W represent the height and width of the car HSV histogram, respectively;
the brightness channel pixel total value calculation submodule is used for adding the brightness channel pixel values of all pixels in the car HSV histogram to obtain the brightness channel pixel total value;
the luminance channel pixel mean value calculation submodule is used for dividing the total value of the luminance channel pixels by the total number of the luminance channel pixels to obtain the luminance channel pixel mean value;
a luminance standard deviation calculation sub-module for calculating a luminance standard deviation based on the luminance channel pixel value and the luminance channel pixel mean value by the following formula:
Figure BDA0003788510740000231
wherein Q is n Is the total number of pixels of the luminance channel,
Figure BDA0003788510740000232
representing the luminance channel pixel value to which the pixel corresponds,
Figure BDA0003788510740000233
representing the luminance channel pixel mean, H and W representing the height and width of the car HSV histogram, respectively.
Optionally, the saturation mean difference calculating module 305 includes:
the background saturation channel pixel total value calculation submodule is used for adding the background saturation channel pixel values of all pixels in the background image to obtain the background saturation channel pixel total value;
the background saturation channel pixel mean value calculating submodule is used for dividing the total background saturation channel pixel value by the total background saturation channel pixel number to obtain the background saturation channel pixel mean value;
and the saturation mean difference calculating submodule is used for calculating the background saturation pixel mean value minus the saturation channel pixel mean value to obtain the saturation mean difference.
Optionally, the elevator smoke determination result generating module 306 includes:
a first smoke judgment submodule, configured to judge whether the saturation standard deviation, the brightness standard deviation, and the saturation mean difference meet a preset global smoke judgment standard, where the global smoke judgment standard at least includes: the saturation standard deviation is smaller than a preset global saturation standard deviation threshold, the brightness standard deviation is smaller than a preset global brightness standard deviation threshold, and the saturation mean difference is larger than a preset global mean difference;
the global smoke determining submodule is used for determining that the elevator smoke judgment result is global smoke;
the second smoke judgment submodule is used for judging whether the saturation standard deviation, the brightness standard deviation and the saturation mean value deviation accord with a preset local smoke judgment standard or not, wherein the local smoke judgment standard at least comprises: the saturation standard deviation is smaller than a preset local saturation standard deviation threshold, the brightness standard deviation is smaller than a preset local brightness standard deviation threshold, and the saturation mean difference is larger than a preset local mean difference;
the local smoke determining submodule is used for determining that the elevator smoke judgment result is local smoke;
and the smoke-free determining submodule is used for determining that the elevator smoke judgment result is smoke-free.
The elevator smoke detection device provided by the embodiment of the invention can execute the elevator smoke detection method provided by any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the execution method.
Example four
FIG. 4 shows a schematic block diagram of an electronic device 10 that may be used to implement an embodiment of the invention. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smart phones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the inventions described and/or claimed herein.
As shown in fig. 4, the electronic device 10 includes at least one processor 11, and a memory communicatively connected to the at least one processor 11, such as a Read Only Memory (ROM) 12, a Random Access Memory (RAM) 13, and the like, wherein the memory stores a computer program executable by the at least one processor, and the processor 11 can perform various suitable actions and processes according to the computer program stored in the Read Only Memory (ROM) 12 or the computer program loaded from a storage unit 18 into the Random Access Memory (RAM) 13. In the RAM 13, various programs and data necessary for the operation of the electronic apparatus 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other via a bus 14. An input/output (I/O) interface 15 is also connected to bus 14.
A number of components in the electronic device 10 are connected to the I/O interface 15, including: an input unit 16 such as a keyboard, a mouse, or the like; an output unit 17 such as various types of displays, speakers, and the like; a storage unit 18 such as a magnetic disk, an optical disk, or the like; and a communication unit 19 such as a network card, modem, wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information/data with other devices via a computer network, such as the internet, and/or various telecommunication networks.
Processor 11 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized Artificial Intelligence (AI) computing chips, various processors running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, or the like. The processor 11 performs the various methods and processes described above, such as an elevator smoke detection method.
In some embodiments, the elevator smoke detection method may be implemented as a computer program tangibly embodied in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and/or installed onto the electronic device 10 via the ROM 12 and/or the communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the elevator smoke detection method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to perform the elevator smoke detection method by any other suitable means (e.g., by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuitry, field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), system on a chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, receiving data and instructions from, and transmitting data and instructions to, a storage system, at least one input device, and at least one output device.
A computer program for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the computer programs, when executed by the processor, cause the functions/acts specified in the flowchart and/or block diagram block or blocks to be performed. A computer program can execute entirely on a machine, partly on a machine, as a stand-alone software package partly on a machine and partly on a remote machine or entirely on a remote machine or server.
In the context of the present invention, a computer-readable storage medium may be a tangible medium that can contain, or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. A computer readable storage medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. Alternatively, the computer readable storage medium may be a machine readable signal medium. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which a user can provide input to the electronic device. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic, speech, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a back-end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back-end, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), wide Area Networks (WANs), blockchain networks, and the internet.
The computing system may include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server can be a cloud server, also called a cloud computing server or a cloud host, and is a host product in a cloud computing service system, so that the defects of high management difficulty and weak service expansibility in the traditional physical host and VPS service are overcome.
It should be understood that various forms of the flows shown above may be used, with steps reordered, added, or deleted. For example, the steps described in the present invention may be executed in parallel, sequentially, or in different orders, and are not limited herein as long as the desired results of the technical solution of the present invention can be achieved.
The above-described embodiments should not be construed as limiting the scope of the invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may be made in accordance with design requirements and other factors. 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 present invention.

Claims (10)

1. An elevator smoke detection method, comprising:
obtaining a car RGB histogram of an elevator car;
converting the car RGB histogram into a car HSV histogram to obtain a saturation channel pixel value and a brightness channel pixel value;
inputting the car HSV histogram into a pre-constructed smoke detection Gaussian mixture model to obtain a background image and a foreground image corresponding to the car HSV histogram;
calculating a saturation standard deviation and a brightness standard deviation of the HSV histogram of the car based on the saturation channel pixel value and the brightness channel pixel value;
calculating the difference value between the saturation channel mean value of the background image and the saturation channel mean value of the HSV histogram of the car as a saturation mean value difference;
and comparing the saturation standard deviation, the brightness standard deviation and the saturation mean deviation with a plurality of preset smoke judgment standards to obtain an elevator smoke judgment result.
2. The method of claim 1, wherein converting the car RGB histogram to a car HSV histogram to obtain a saturation channel pixel value and a luminance channel pixel value comprises:
the pixel value of the saturation channel is calculated by the following formula:
Figure FDA0003788510730000011
wherein R (x, y) represents a pixel value of an R channel, G (x, y) represents a pixel value of a G channel, and B (x, y) represents a pixel value of a B channel;
the pixel value of the luminance channel is calculated by the following formula:
Figure FDA0003788510730000012
3. the method of claim 1, wherein the smoke detection Gaussian mixture model is constructed by a method comprising:
initializing the number of Gaussian functions of a smoke detection mixed Gaussian model and the weight, the mean value and the variance corresponding to each Gaussian function, wherein the formula of the Gaussian functions is as follows:
Figure FDA0003788510730000021
where i is the number of the Gaussian function, x t Is the pixel approximate value of the current t moment, sigma i,t A covariance matrix of the pixel at the ith Gaussian function representing the time t; mu.s i,t A mean matrix representing the ith Gaussian function at time t;
the formula of the smoke detection Gaussian mixture model is as follows:
Figure FDA0003788510730000022
wherein K is the number of Gaussian functions, omega, in the smoke detection mixed Gaussian model i,t Representing the weight occupied by the ith Gaussian function at the time t;
obtaining a plurality of car smoke training pictures;
matching each pixel point of the car smoke training picture with a Gaussian function in the smoke detection Gaussian mixture model according to a preset matching rule, wherein the matching rule is as follows:
|X ti,t |<Sσ i,t
wherein S is a preset background threshold value u i,t Is the mean of the gaussian function;
sequentially judging whether the pixel points are matched with the Gaussian function;
if the pixel point is matched with the Gaussian function, updating the weight, the mean value and the variance of the Gaussian function with the maximum parameter value according to the following formula:
ω i,t =ω i,t-1 +α(1-ω i,t-1 )
u t =(1-ρ)u t-1 +ρX t
Figure FDA0003788510730000023
wherein, the ω is i,t 、μ t
Figure FDA0003788510730000024
The weight, mean and variance, omega, of the ith Gaussian function of the pixel point at the time t i,t-1 、μ t
Figure FDA0003788510730000025
The weight, the mean value and the variance of the ith Gaussian function of the pixel point at the corresponding position in the image at the time t-1 are shown, alpha represents a preset learning rate, and rho represents a parameter learning rate, wherein the parameter learning rate is rho = alpha/omega i,t-1
If the pixel point is not matched with the Gaussian function, maintaining the mean value and the variance of the Gaussian function with the minimum parameter value unchanged, and modifying the weight of the Gaussian function with the minimum parameter value as follows:
ω i,t =(1-α)ω i,t-1
4. the method according to claim 3, wherein inputting the car HSV histogram into a pre-constructed smoke detection Gaussian mixture model to obtain a background image and a foreground image corresponding to the car HSV histogram comprises:
inputting the HSV histogram of the car into a pre-constructed smoke detection Gaussian mixture model to obtain weights, mean values and variances corresponding to a plurality of Gaussian functions;
calculating the weight corresponding to the Gaussian functions and dividing the weight by the variance to obtain parameter values corresponding to the Gaussian functions;
arranging a plurality of Gaussian functions in a descending order according to corresponding parameter values;
selecting a first number of the Gaussian functions in the smoke detection Gaussian mixture model as background points to generate the background image, wherein the first number satisfies:
Figure FDA0003788510730000031
wherein B is a first number, ω i Is the weight corresponding to the ith Gaussian function, T is a preset critical threshold value, omega i The weight of the ith Gaussian function;
taking the rest Gaussian functions as foreground points to generate the foreground image;
and updating the smoke detection Gaussian mixture model.
5. The method of any one of claims 1-4, wherein the calculating saturation standard deviation and brightness standard deviation of the car HSV histogram comprises:
adding the saturation channel pixel values of all pixels in the car HSV histogram to obtain a total saturation channel pixel value;
dividing the total value of the saturation channel pixels by the total number of the saturation channel pixels to obtain the average value of the saturation channel pixels;
calculating a saturation standard deviation based on the saturation channel pixel value and the saturation channel pixel mean by:
Figure FDA0003788510730000041
wherein, P n Is the total number of the saturation channel pixel points, beta (x, y) represents the saturation channel pixel value corresponding to the pixel, mean beta represents the saturation channel pixel Mean value, and H and W represent the height and width of the car HSV histogram, respectively;
adding the brightness channel pixel values of all pixels in the car HSV histogram to obtain a total brightness channel pixel value;
dividing the total value of the brightness channel pixels by the total quantity of the brightness channel pixels to obtain a mean value of the brightness channel pixels;
calculating a luminance standard deviation based on the luminance channel pixel value and the luminance channel pixel mean value by the following formula:
Figure FDA0003788510730000042
wherein Q is n Is the total number of pixels of the luminance channel,
Figure FDA0003788510730000043
representing the luminance channel pixel value to which the pixel corresponds,
Figure FDA0003788510730000044
representing the luminance channel pixel mean, H and W representing the height and width of the car HSV histogram, respectively.
6. The method of claim 5, wherein calculating a difference between a saturation channel mean of the background image and a saturation channel mean of the car HSV histogram as a saturation mean difference comprises:
adding the background saturation channel pixel values of all pixels in the background image to obtain a total background saturation channel pixel value;
dividing the total value of the background saturation channel pixels by the total number of the background saturation channel pixels to obtain a background saturation channel pixel average value;
and calculating the background saturation pixel average value minus the saturation channel pixel average value to obtain the saturation average value difference.
7. The method according to any one of claims 1-4, wherein comparing the saturation standard deviation, the brightness standard deviation, and the saturation mean deviation with a plurality of preset smoke determination criteria to obtain an elevator smoke determination result comprises:
judging whether the saturation standard deviation, the brightness standard deviation and the saturation mean deviation accord with a preset global smoke judgment standard or not, wherein the global smoke judgment standard at least comprises the following steps: the saturation standard deviation is smaller than a preset global saturation standard deviation threshold, the brightness standard deviation is smaller than a preset global brightness standard deviation threshold, and the saturation mean difference is larger than a preset global mean difference;
if the judgment result meets the preset global smoke judgment standard, determining the elevator smoke judgment result as global smoke;
if the current smoke standard deviation does not accord with a preset global smoke judgment standard, judging whether the saturation standard deviation, the brightness standard deviation and the saturation mean value deviation accord with a preset local smoke judgment standard or not, wherein the local smoke judgment standard at least comprises the following steps: the saturation standard deviation is smaller than a preset local saturation standard deviation threshold, the brightness standard deviation is smaller than a preset local brightness standard deviation threshold, and the saturation mean difference is larger than a preset local mean difference;
if the judgment result meets the preset local smoke judgment standard, determining that the elevator smoke judgment result is local smoke;
and if the judgment result does not meet the preset local smoke judgment standard, determining that the elevator smoke judgment result is no smoke.
8. An elevator smoke detection device, comprising:
the elevator car RGB histogram acquisition module is used for acquiring an elevator car RGB histogram of an elevator car;
the histogram conversion module is used for converting the car RGB histogram into a car HSV histogram;
the background separation module is used for inputting the car HSV histogram into a pre-constructed smoke detection Gaussian mixture model to obtain a background image and a foreground image corresponding to the car HSV histogram;
the standard deviation calculation module is used for calculating the saturation standard deviation and the brightness standard deviation of the HSV histogram of the car;
the saturation mean value difference calculating module is used for calculating the difference value between the saturation channel mean value of the background image and the saturation channel mean value of the car HSV histogram to serve as the saturation mean value difference;
and the elevator smoke judgment result generation module is used for comparing the saturation standard deviation, the brightness standard deviation and the saturation mean value deviation with a plurality of preset smoke judgment standards to obtain an elevator smoke judgment result.
9. An electronic device, characterized in that the electronic device comprises:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein, the first and the second end of the pipe are connected with each other,
the memory stores a computer program executable by the at least one processor, the computer program being executable by the at least one processor to enable the at least one processor to perform the elevator smoke detection method of any of claims 1-7.
10. A computer readable storage medium, characterized in that the computer readable storage medium stores computer instructions for causing a processor to implement the elevator smoke detection method of any of claims 1-7 when executed.
CN202210949340.3A 2022-08-09 2022-08-09 Elevator smoke detection method and device, electronic equipment and storage medium Pending CN115311621A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210949340.3A CN115311621A (en) 2022-08-09 2022-08-09 Elevator smoke detection method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210949340.3A CN115311621A (en) 2022-08-09 2022-08-09 Elevator smoke detection method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN115311621A true CN115311621A (en) 2022-11-08

Family

ID=83859877

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210949340.3A Pending CN115311621A (en) 2022-08-09 2022-08-09 Elevator smoke detection method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115311621A (en)

Similar Documents

Publication Publication Date Title
CN110807429B (en) Construction safety detection method and system based on tiny-YOLOv3
KR101081051B1 (en) A method for detecting fire-flame using fuzzy finite automata
Evangelio et al. Adaptively splitted GMM with feedback improvement for the task of background subtraction
CN104750768B (en) Method and system for identification, monitoring and ranking event from social media
CN109241896B (en) Channel safety detection method and device and electronic equipment
WO2022227772A1 (en) Method and apparatus for training human body attribute detection model, and electronic device and medium
CN111488799B (en) Falling object identification method and system based on image identification
WO2023125588A1 (en) Fire danger level determination method and apparatus
CN110057820B (en) Method, system and storage medium for on-line detection of chlorine-hydrogen ratio of hydrogen chloride synthesis furnace
CN112153373A (en) Fault identification method and device for bright kitchen range equipment and storage medium
CN101316371A (en) Flame detecting method and device
CN111461143A (en) Picture copying identification method and device and electronic equipment
KR101972055B1 (en) CNN based Workers and Risky Facilities Detection System on Infrared Thermal Image
CN117576632B (en) Multi-mode AI large model-based power grid monitoring fire early warning system and method
CN110796014A (en) Garbage throwing habit analysis method, system and device and storage medium
CN114222163A (en) Intelligent video analysis system for business hall
CN113361420A (en) Mine fire monitoring method, device and equipment based on robot and storage medium
CN115311621A (en) Elevator smoke detection method and device, electronic equipment and storage medium
KR102602439B1 (en) Method for detecting rip current using CCTV image based on artificial intelligence and apparatus thereof
JP2012246115A (en) Device and program for visualizing enter/exit history information
CN116503494A (en) Infrared image generation method, device, equipment and storage medium
CN116862845A (en) Brightness enhancement film quality evaluation system
CN116665305A (en) Method and system for detecting worker behaviors based on computer vision and knowledge graph
CN115641607A (en) Method, device, equipment and storage medium for detecting wearing behavior of power construction site operator
CN115690496A (en) Real-time regional intrusion detection method based on YOLOv5

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