Fire passage occupation recognition method and device and electronic equipment
By combining the long short-term Vibe algorithm with a convolutional neural network for fire lane occupancy detection, the problem of inaccurate identification of complex and untrained objects in existing technologies is solved. This enables fast and accurate identification and alarm of fire lane occupancy, reducing the risk of fire lane blockage and improving fire safety.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CHANGSHA HISENSE INTELLIGENT SYST RES INST CO LTD
- Filing Date
- 2022-08-01
- Publication Date
- 2026-05-19
AI Technical Summary
Existing algorithms for detecting the obstruction of fire lanes have poor real-time performance, making it difficult to identify complex and large objects. Furthermore, deep learning models are inaccurate in recognizing objects that have not been trained, which makes fire lanes prone to being blocked and increases fire hazards.
The system employs both long-term and short-term Vibe algorithms for dual-background modeling, combined with convolutional neural networks for human and vehicle recognition. Through multi-stage, multi-scale background detection and morphological judgment, human interference is eliminated. The system utilizes a YOLOv5 network model for target detection and generates alarms based on time-based timing.
It enables accurate identification and alarm of objects that have been stationary and obstructing fire lanes for extended periods, reducing the risk of blocked fire lanes and improving fire safety.
Smart Images

Figure CN115346166B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image recognition technology, and in particular to a method, device, and electronic device for identifying the occupancy of fire lanes. Background Technology
[0002] When indoor or outdoor fire lanes are blocked by debris or parked vehicles, it can hinder fire rescue efforts and prevent the evacuation of those in distress, significantly increasing fire hazards. In recent years, many residential communities have seen their fire lanes blocked by illegally parked private cars, and emergency staircases in many high-rise buildings have been obstructed by clutter, resulting in missed opportunities for timely rescue. The indirect loss of life and property caused by blocked fire lanes cannot be ignored.
[0003] In the field of computer vision, detecting fire lane obstruction using surveillance cameras and intelligent algorithms is becoming increasingly mainstream. Compared to hardware detection instruments, using surveillance video for detection is more cost-effective, allowing detection of obstruction to be performed using existing cameras in the scene without increasing equipment costs. Current algorithms for fire lane obstruction detection include: dual-background models using traditional Gaussian background models and frame difference methods, and object recognition models trained using deep learning. However, the dual-background model using traditional Gaussian background models and frame difference methods suffers from poor real-time performance, making it unsuitable for widespread application. It also performs poorly in recognizing complex, large objects with transparent glass reflections, such as vehicles, and the images generated by frame difference methods are prone to holes. Meanwhile, object recognition models trained using deep learning are limited by the types of objects in the training set; untrained objects or objects of the same type with low similarity to those in the training set may fail to be recognized with a high probability. Summary of the Invention
[0004] The purpose of this invention is to provide a method, device, and electronic device for identifying the obstruction of fire lanes. Compared with the prior art, it is more adaptable to a wider range of scenarios, operates faster, and is simpler and more accurate. It can effectively identify and alarm objects that have been stationary in fire lanes for a long time, effectively reducing the risk of fire lanes being blocked by objects and greatly improving fire safety in relevant application scenarios.
[0005] To achieve the above objectives, the present invention first provides a method for identifying the occupancy of fire lanes, comprising the following steps:
[0006] Step S1: Receive the monitoring video stream, preprocess the monitoring video stream to obtain the image to be detected;
[0007] Step S2: Input the image to be detected into a preset long-term Vibe algorithm model and a short-term Vibe algorithm model to obtain the pixel mask of the foreground object and the pixel mask of the moving foreground object in the image to be detected, respectively. The parameter change rate of the long-term Vibe algorithm model is smaller than that of the short-term Vibe algorithm model.
[0008] Step S3: Based on the difference between the pixel mask of the foreground object and the pixel mask of the moving foreground object, obtain the pixel mask of the stationary foreground object, and perform image morphological filtering and opening / closing operations on the pixel mask of the stationary foreground object to obtain the information of the object cluster.
[0009] Step S4: Input the image to be detected into the target recognition model to obtain information on human targets and vehicle targets in the image sequence to be detected;
[0010] Step S5: Combine the information of the vehicle target and the information of the object cluster to form the information of the stationary object, and perform tracking and timing on the stationary object;
[0011] Step S6: When the duration of stillness of a stationary object exceeds the preset alarm threshold, perform background similarity detection and morphological detection on the stationary object. When the stationary object meets the criteria for background similarity detection and morphological detection and is not a human target, issue an alarm for the stationary object and output the information of the stationary object.
[0012] Optionally, step S2 specifically includes:
[0013] A first background model is established for the long-term Vibe algorithm model, and the long-term background model stores a first background sample set for each pixel in the single-channel image;
[0014] When the distance between the pixel value of a pixel in the image to be detected and a sample in the first background sample set corresponding to that pixel is less than a preset distance threshold, the samples are considered to match.
[0015] If the number of samples in the first background sample set corresponding to a pixel that match the pixel value exceeds a preset first matching threshold, the pixel is considered a background pixel; otherwise, it is considered a foreground pixel.
[0016] Create a pixel mask for the foreground object based on the background and foreground pixels;
[0017] A second background model is established for the short-term Vibe algorithm model. The short-term background model stores a second background sample set for each pixel in the single-channel image. The number of samples in the second background sample set is less than the number of samples in the first background sample set.
[0018] When the distance between the pixel value of a pixel in the image to be detected and a sample in the second background sample set corresponding to that pixel is less than a preset distance threshold, the samples are considered to match.
[0019] If the number of samples in the second background sample set corresponding to a pixel that match the pixel value exceeds a preset second matching threshold, the pixel is considered a background pixel; otherwise, it is considered a foreground pixel.
[0020] Optionally, step S6, which involves background similarity detection of stationary objects, includes:
[0021] Obtain the bounding box of the stationary object;
[0022] Above and below the bounding box of the stationary object, take an upper inspection box and a lower inspection box respectively, close to the boundary of the bounding box;
[0023] To the left and right of the bounding box of the stationary object, take a left inspection box and a right inspection box respectively, close to the boundary of the bounding box.
[0024] Convert the areas containing the bounding box, upper inspection box, lower inspection box, left inspection box, and right inspection box to the HSV color space;
[0025] Obtain the average color saturation of pixels within the bounding box, upper check box, lower check box, left check box, and right check box;
[0026] If the difference between the average color saturation of any pixel in the upper, lower, left, and right check boxes and the average color saturation of the bounding box is greater than a preset difference threshold, the background similarity detection is deemed to have failed and the alarm is stopped; otherwise, the stationary object is deemed to meet the background similarity detection criteria.
[0027] Optionally, step S6, in the step of performing morphological detection on a stationary object, includes:
[0028] Obtain a color image of the pixel region where the stationary object is located;
[0029] Use vertical and horizontal detection lines to detect the number of edge line segments of a stationary object;
[0030] If the vertical detection line touches two or more edges, and the horizontal detection line also touches two or more edges, the stationary object is considered to meet the morphological inspection standard; otherwise, the morphological inspection is considered to fail.
[0031] Optionally, in step S2, the background update frequency of the long-term Vibe algorithm model is less than the background update frequency of the short-term Vibe algorithm model.
[0032] Optionally, when the average brightness of the global HSV channel of the image to be detected changes by more than 0.1, or when the difference in the number of foreground pixels in the image to be detected within two frames exceeds 50% of the total number of pixels in the image to be detected, the long-term Vibe algorithm model and the short-term Vibe algorithm model are reinitialized.
[0033] Optionally, step S2 involves setting the background pixels detected by the long-term Vibe algorithm model to 0 and the foreground pixels to 1 to establish the foreground object pixel mask.
[0034] The moving foreground object pixel mask is established by assigning the background pixels detected by the short-term Vibe algorithm model to 0 and the foreground pixels to 1.
[0035] Optionally, the number of samples in the first background sample set is at least four times the number of samples in the second background sample set, and the target recognition model is a YOLOv5 network model.
[0036] The present invention also provides a fire lane occupancy identification device, comprising:
[0037] A preprocessing unit is used to receive a surveillance video stream, preprocess the surveillance video stream, and obtain an image to be detected.
[0038] The Vibe detection unit is used to input the image to be detected into a preset long-term Vibe algorithm model and a short-term Vibe algorithm model to obtain the pixel mask of the foreground object and the pixel mask of the moving foreground object in the image to be detected, respectively. The parameter change rate of the long-term Vibe algorithm model is smaller than that of the short-term Vibe algorithm model.
[0039] The cluster recognition unit is used to obtain the pixel mask of the stationary foreground object based on the difference between the pixel mask of the foreground object and the pixel mask of the moving foreground object, and to perform image morphological filtering and opening and closing operations on the pixel mask of the stationary foreground object to obtain information about the object cluster.
[0040] The target recognition unit is used to input the image to be detected into the target recognition model to obtain information on human targets and vehicle targets in the image sequence to be detected;
[0041] The timing unit is used to combine the information of the vehicle target and the information of the object cluster to form the information of the stationary object, and to track and time the stationary object.
[0042] The alarm unit is used to perform background similarity detection and morphological detection on a stationary object when the stationary duration exceeds a preset alarm threshold. When the stationary object meets the criteria for background similarity detection and morphological detection and is not a human target, the alarm is triggered for the stationary object and the information of the stationary object is output.
[0043] The present invention also provides an electronic device, characterized in that it includes: a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor performs the steps of the above-described method.
[0044] The beneficial effects of this invention are as follows: This invention provides a method, device, and electronic device for identifying fire lane occupancy. By introducing a dual-background modeling method using short-term and long-term Vibe detection algorithms, it identifies stationary objects in the foreground. Combined with convolutional neural networks, it separately identifies people and vehicles, thereby obtaining information on all long-term occupied objects. Multi-stage, multi-scale background detection and morphological judgment are added, and human interference is eliminated. Dangerous occupied objects are then identified and alarms are triggered by timing them individually. Compared with existing stationary object detection algorithms, this invention is more adaptable to a wider range of scenarios, runs faster, and is simpler and more accurate. It can effectively identify and alarm on long-term stationary occupied objects in fire lanes, effectively reducing the risk of fire lanes being blocked by objects and greatly improving fire safety in relevant application scenarios. Attached Figure Description
[0045] To further understand the features and technical content of this invention, please refer to the following detailed description and accompanying drawings. However, the drawings are provided for reference and illustration only and are not intended to limit the invention.
[0046] In the attached diagram,
[0047] Figure 1 This is a flowchart of the fire lane occupancy identification method of the present invention;
[0048] Figure 2 This is a flowchart of step S1 of the fire lane occupancy identification method of the present invention;
[0049] Figure 3 This is a schematic diagram of background similarity detection in step S6 of the fire lane occupancy identification method of the present invention;
[0050] Figure 4 This is a schematic diagram of the morphological detection in step S6 of the fire lane occupancy identification method of the present invention;
[0051] Figure 5 This is a schematic diagram of the area to be detected and the items to be detected in the fire lane occupancy identification method of the present invention;
[0052] Figure 6 This is a schematic diagram of the area to be detected and the vehicle to be detected in the fire lane occupancy identification method of the present invention;
[0053] Figure 7 This is a schematic diagram of the fire lane occupancy identification device of the present invention;
[0054] Figure 8 This is a schematic diagram of the electronic device of the present invention;
[0055] Figure 9 This is a diagram illustrating the process of identifying stationary objects in the fire lane occupancy identification method of the present invention.
[0056] Figure 10 This is a diagram illustrating the object block identification process in the fire lane occupancy identification method of the present invention. Detailed Implementation
[0057] To further illustrate the technical means and effects of the present invention, the following detailed description is provided in conjunction with the preferred embodiments of the present invention and their accompanying drawings.
[0058] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0059] In the description of this application, it should be understood that the terms "center," "longitudinal," "lateral," "length," "width," "thickness," "upper," "lower," "front," "rear," "left," "right," "vertical," "horizontal," "top," "bottom," "inner," and "outer," etc., indicating orientation or positional relationships based on the orientation or positional relationships shown in the accompanying drawings, are used only for the convenience of describing this application and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of this application. Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Thus, features defined with "first" and "second" may explicitly or implicitly include one or more features. In the description of this application, "a plurality of" means two or more, unless otherwise explicitly specified.
[0060] In this application, the term "exemplary" is used to mean "used as an example, illustration, or description." Any embodiment described as "exemplary" in this application is not necessarily to be construed as being more preferred or advantageous than other embodiments. The following description is provided to enable any person skilled in the art to make and use this application. Details are set forth in the following description for purposes of explanation. It should be understood that those skilled in the art will recognize that this application can be made without using these specific details. In other instances, well-known structures and processes are not described in detail to avoid obscuring the description of this application with unnecessary detail. Therefore, this application is not intended to be limited to the embodiments shown, but is consistent with the broadest scope of the principles and features disclosed in this application.
[0061] Please see Figure 1 This invention provides a method for identifying the occupancy of fire lanes, comprising the following steps:
[0062] Step S1: Receive the monitoring video stream, preprocess the monitoring video stream, and obtain the image to be detected.
[0063] Specifically, in some embodiments of the present invention, step S1 includes:
[0064] Extract multiple frames of images from the surveillance video stream according to a preset pattern;
[0065] The dimensions of the multi-frame images are scaled.
[0066] The multi-frame images are converted from three-channel color images to single-channel grayscale images.
[0067] For example, in some embodiments of the present invention, step S1 includes:
[0068] Extract the first frame from every 10 frames to obtain multiple frames;
[0069] The multi-frame images are resized to 640*480;
[0070] The multi-frame images are converted from three-channel color images to single-channel grayscale images.
[0071] Furthermore, in some embodiments of the present invention, the monitoring video stream also needs to meet requirements such as resolution, video format, video length, camera installation angle, and the size of the object to be detected, in order to meet the requirements of subsequent detection.
[0072] For example, in one embodiment of the present invention, the monitoring video stream has the following requirements: First, the video resolution is 1920×1080, the video format is mp4, and the video length is greater than 60 seconds or it is a real-time video stream; second, the height and width of the object to be detected are not less than 100 pixels and not less than 100 pixels; finally, the tilt angle between the camera capturing the monitoring video stream and the boundary of the effective area is greater than 45 degrees and less than 85 degrees, and the camera's field of view distance is between 15 meters and 20 meters.
[0073] Step S2: Input the image to be detected into a preset long-term visual background extractor (vibe) algorithm model and a short-term vibe algorithm model to obtain the pixel mask of the foreground object and the pixel mask of the moving foreground object in the image to be detected, respectively. The parameter change rate of the long-term vibe algorithm model is smaller than that of the short-term vibe algorithm model.
[0074] Specifically, step S2 includes:
[0075] A first background model is established for the long-term Vibe algorithm model, and the long-term background model stores a first background sample set for each pixel in the single-channel image;
[0076] When the distance between the pixel value of a pixel in the image to be detected and a sample in the first background sample set corresponding to that pixel is less than a preset distance threshold, the samples are considered to match.
[0077] If the number of samples in the first background sample set corresponding to a pixel that match the pixel value exceeds a preset first matching threshold, the pixel is considered a background pixel; otherwise, it is considered a foreground pixel.
[0078] Create a pixel mask for the foreground object based on the background and foreground pixels;
[0079] A second background model is established for the short-term Vibe algorithm model. The short-term background model stores a second background sample set for each pixel in the single-channel image. The number of samples in the second background sample set is less than the number of samples in the first background sample set.
[0080] When the distance between the pixel value of a pixel in the image to be detected and a sample in the second background sample set corresponding to that pixel is less than a preset distance threshold, the samples are considered to match.
[0081] If the number of samples in the second background sample set corresponding to a pixel that match the pixel value exceeds a preset second matching threshold, the pixel is considered a background pixel; otherwise, it is considered a foreground pixel.
[0082] Create a pixel mask for the moving foreground object based on the background and foreground pixels.
[0083] It should be noted that, in this invention, background objects refer to stationary or very slowly moving objects, while foreground objects correspond to moving objects. The Vibe algorithm model is used to distinguish whether each pixel belongs to the background or the foreground.
[0084] In the Vibe algorithm model, the background model stores a first background sample set for each pixel in a single-channel image. For each pixel of a single-channel image... Suppose that its background pixel value M has N possible values:
[0085]
[0086] Wherein, the number of samples in the first background sample set is at least 4 times the number of samples in the second background sample set, such as N being 20 in the long-term Vibe algorithm model and N being 5 in the short-term Vibe algorithm model;
[0087] When the pixel value of a pixel in a frame of an image The pixel of the i-th sample in the corresponding background sample set distance Less than the distance threshold When the distance is considered a sample match, it is considered a sample match. The definition is as follows:
[0088]
[0089] A pixel is considered a background pixel if it matches at least K samples, and a foreground pixel otherwise. Both the foreground object pixel mask and the moving foreground object pixel mask are binary masks, constructed using the following formula:
[0090] .
[0091] That is, step S2 establishes the foreground object pixel mask by assigning the background pixels detected by the long-term Vibe algorithm model to 0 and the foreground pixels to 1.
[0092] The moving foreground object pixel mask is established by assigning the background pixels detected by the short-term Vibe algorithm model to 0 and the foreground pixels to 1.
[0093] Of course, as a Vibe algorithm model, a reliable update strategy needs to be set for it. In the update strategy described in this invention, the background update frequency of the long-term Vibe algorithm model is less than that of the short-term Vibe algorithm model, as follows:
[0094] In the long-term Vibe algorithm model, when a pixel is identified as a background pixel 100 times consecutively, there is... The probability of updating the background model for that pixel is determined by the probability of the long-term Vibe algorithm model. In the long-term Vibe algorithm model, when a pixel is consecutively identified as a background pixel three times, there is... The probability of updating the pixel background model is preferably found in some embodiments of the present invention. ;
[0095] When the background model needs to be updated, a sample is randomly selected from the pixel sample with equal probability, and the value of the sample is updated to the current pixel input value. Whether a sample value is replaced in the model is independent of its existence time.
[0096] The bounding boxes of all stationary objects will not be subject to the background update strategy described above, and the original background samples will be preserved.
[0097] In addition, as a Vibe algorithm model, a reliable remodeling rule needs to be set for it. Specifically, the remodeling rule is as follows: when the average brightness of the global HSV channel of the image to be detected changes by more than 0.1, or when the difference in the number of foreground pixels in the image to be detected within two frames exceeds 50% of the total number of pixels in the image to be detected, the long-term Vibe algorithm model and the short-term Vibe algorithm model are reinitialized.
[0098] The detailed rules for remodeling are as follows:
[0099] When the average brightness of the global HSV channel in a scene changes by more than 0.1, remodeling is performed, and the historical pixel values stored in the Vibe algorithm model are reset and reinitialized.
[0100] When the difference in the number of foreground pixels appearing in the detection area within two frames exceeds 50% of the total number of pixels in the effective area, remodeling is performed, and the historical pixel values stored in the Vibe algorithm model are reset and reinitialized.
[0101] During the reinitialization process of both of the above, if the average brightness of the global HSV channel changes by more than 0.01 between two frames, the current reinitialization will be performed again.
[0102] Reinitialization refers to performing a vibe update of 10 frames of images, with the update strategy described above.
[0103] Step S3, please refer to Figure 10Based on the difference between the pixel mask of the foreground object and the pixel mask of the moving foreground object, the pixel mask of the stationary foreground object is obtained. The pixel mask of the stationary foreground object is then processed by image morphological filtering and opening / closing operations to obtain information about the object cluster.
[0104] Step S4: Input the image to be detected into the target recognition model to obtain information on human targets and vehicle targets in the image sequence to be detected;
[0105] Step S5, Combining Figure 9 The information of the vehicle target and the information of the object cluster are combined to form the information of the stationary object, and the stationary object is tracked and timed.
[0106] Step S6, Combining Figure 5 and Figure 6 When the duration of stillness of a stationary object exceeds a preset alarm threshold, background similarity detection and morphological detection are performed on the stationary object. When the stationary object meets the criteria for background similarity detection and morphological detection and is not a human target, an alarm is triggered for the stationary object and the information of the stationary object is output.
[0107] Specifically, step S6, which involves background similarity detection of stationary objects, includes:
[0108] Obtain the bounding box of the stationary object;
[0109] Above and below the bounding box of the stationary object, take an upper inspection box and a lower inspection box respectively, close to the boundary of the bounding box;
[0110] To the left and right of the bounding box of the stationary object, take a left inspection box and a right inspection box respectively, close to the boundary of the bounding box.
[0111] Convert the areas containing the bounding box, upper inspection box, lower inspection box, left inspection box, and right inspection box to the HSV color space;
[0112] Obtain the average color saturation of pixels within the bounding box, upper check box, lower check box, left check box, and right check box;
[0113] If the difference between the average color saturation of any pixel in the upper, lower, left, and right check boxes and the average color saturation of the bounding box is greater than a preset difference threshold, the background similarity detection is deemed to have failed and the alarm is stopped; otherwise, the stationary object is deemed to meet the background similarity detection criteria.
[0114] Preferably, the preset difference threshold is 10% of the average color saturation of the bounding box.
[0115] For example, such as Figure 3As shown, in some embodiments of the present invention, the bounding box has a height of H and a width of W; the upper and lower detection boxes have a height of H / 2 and a width of W; the left and right detection boxes have a height of H and a width of W / 2; and the average color saturation of the pixels within the bounding box, upper detection box, lower detection box, left detection box, and right detection box are respectively... ;
[0116] The formula for determining the background similarity is:
[0117]
[0118] An alarm can be triggered when the value is 1, and cannot be triggered when the value is 0.
[0119] Specifically, such as Figure 4 As shown, step S6, the step of performing morphological detection on a stationary object, includes:
[0120] Obtain a color image of the pixel region where the stationary object is located;
[0121] Use vertical and horizontal detection lines to detect the number of edge line segments of a stationary object;
[0122] If the vertical detection line touches two or more edges, and the horizontal detection line also touches two or more edges, the stationary object is considered to meet the morphological inspection standard; otherwise, the morphological inspection is considered to fail.
[0123] Preferably, the target recognition model is a YOLOv5 network model.
[0124] It is important to emphasize that, compared to existing methods for detecting fire lane occupancy, this invention utilizes the Vibe algorithm, which has a slow background parameter update speed, to build a long-term background. This results in faster operation, lower memory usage, and greater accuracy. Algorithms commonly used in existing systems to build short-term background models, such as frame difference, are replaced with the fast-updating short-term Vibe algorithm, effectively avoiding holes in moving foreground objects and better eliminating moving foreground objects. Two universally applicable remodeling methods and morphological multi-scale judgment are incorporated, better addressing harsh environments with sudden lighting changes and common false detections caused by single-point light sources masquerading as objects. A publicly available pre-trained YOLOv5 network model can be used as the target detection model to detect vehicle targets that traditional algorithms struggle to detect accurately, while also eliminating human targets. Users do not need to train new network models for their specific scenarios, making this invention more user-friendly and universally applicable than simply using deep learning algorithms for occupancy detection.
[0125] Please see Figure 7 The present invention also provides a fire lane occupancy identification device, comprising:
[0126] The preprocessing unit 10 is used to receive the monitoring video stream, preprocess the monitoring video stream, and obtain the image to be detected.
[0127] Vibe detection unit 20 is used to input the image to be detected into a preset long-term Vibe algorithm model and a short-term Vibe algorithm model to obtain the pixel mask of the foreground object and the pixel mask of the moving foreground object in the image to be detected, respectively. The parameter change rate of the long-term Vibe algorithm model is smaller than that of the short-term Vibe algorithm model.
[0128] The clumping identification unit 30 is used to obtain the pixel mask of the stationary foreground object based on the difference between the pixel mask of the foreground object and the pixel mask of the moving foreground object, and to perform image morphological filtering and opening and closing operations on the pixel mask of the stationary foreground object to obtain information about the object clumping.
[0129] The target recognition unit 40 is used to input the image to be detected into the target recognition model to obtain information on human targets and vehicle targets in the image sequence to be detected;
[0130] The timing unit 50 is used to combine the information of the vehicle target and the information of the object cluster to form the information of the stationary object, and to track and time the stationary object.
[0131] The alarm unit 60 is used to perform background similarity detection and morphological detection on the stationary object when the stationary duration of the stationary object exceeds the preset alarm threshold. When the stationary object meets the standards of background similarity detection and morphological detection and is not a human target, the alarm is triggered on the stationary object and the information of the stationary object is output.
[0132] Please see Figure 8 The present invention also provides an electronic device, comprising: a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor performs the steps of the above-described method.
[0133] In summary, this invention provides a method, device, and electronic device for identifying fire lane occupancy. By introducing a dual-background modeling method using short-term and long-term Vibe detection algorithms, it identifies stationary objects in the foreground. Combined with convolutional neural networks for separate identification of people and vehicles, it obtains information on all long-term occupied objects. Multi-stage, multi-scale background detection and morphological judgment are incorporated, and human interference is eliminated. Dangerous occupancy is then identified and an alarm is triggered using a time-based method. Compared to existing stationary object detection algorithms, this method is more adaptable to a wider range of scenarios, operates faster, and is simpler and more accurate. It effectively identifies and alarms for long-term occupancy in fire lanes, significantly reducing the risk of fire lanes being blocked and greatly improving fire safety in relevant application scenarios.
[0134] As described above, those skilled in the art can make various other corresponding changes and modifications based on the technical solutions and concepts of this invention, and all such changes and modifications should fall within the protection scope of the claims of this invention.
Claims
1. A method for identifying the occupancy of fire lanes, characterized in that, Includes the following steps: Step S1: Receive the monitoring video stream, preprocess the monitoring video stream to obtain the image to be detected; Step S2: Input the image to be detected into a preset long-term Vibe algorithm model and a short-term Vibe algorithm model to obtain the pixel mask of the foreground object and the pixel mask of the moving foreground object in the image to be detected, respectively. The parameter change rate of the long-term Vibe algorithm model is smaller than that of the short-term Vibe algorithm model. Step S3: Based on the difference between the pixel mask of the foreground object and the pixel mask of the moving foreground object, obtain the pixel mask of the stationary foreground object, and perform image morphological filtering and opening / closing operations on the pixel mask of the stationary foreground object to obtain the information of the object cluster. Step S4: Input the image to be detected into the target recognition model to obtain information on human targets and vehicle targets in the image sequence to be detected; Step S5: Combine the information of the vehicle target and the information of the object cluster to form the information of the stationary object, and perform tracking and timing on the stationary object; Step S6: When the duration of stillness of a stationary object exceeds the preset alarm threshold, perform background similarity detection and morphological detection on the stationary object. When the stationary object meets the criteria for background similarity detection and morphological detection and is not a human target, issue an alarm for the stationary object and output the information of the stationary object.
2. The method for identifying the occupancy of fire lanes as described in claim 1, characterized in that, Step S2 specifically includes: A first background model is established for the long-term Vibe algorithm model. The first background model stores a first background sample set for each pixel in a single-channel image. When the distance between the pixel value of a pixel in the image to be detected and a sample in the first background sample set corresponding to that pixel is less than a preset distance threshold, the samples are considered to match. If the number of samples in the first background sample set corresponding to a pixel that match the pixel value exceeds a preset first matching threshold, the pixel is considered a background pixel; otherwise, it is considered a foreground pixel. Create a pixel mask for the foreground object based on the background and foreground pixels; A second background model is established for the short-term Vibe algorithm model. The second background model stores a second background sample set for each pixel in the single-channel image. The number of samples in the second background sample set is less than the number of samples in the first background sample set. When the distance between the pixel value of a pixel in the image to be detected and a sample in the second background sample set corresponding to that pixel is less than a preset distance threshold, the samples are considered to match. If the number of samples in the second background sample set corresponding to a pixel that match the pixel value exceeds a preset second matching threshold, the pixel is considered a background pixel; otherwise, it is considered a foreground pixel. Create a pixel mask for the moving foreground object based on the background and foreground pixels.
3. The method for identifying the occupancy of fire lanes as described in claim 1, characterized in that, Step S6, which involves background similarity detection of stationary objects, includes: Obtain the bounding box of the stationary object; Above and below the bounding box of the stationary object, take an upper inspection box and a lower inspection box respectively, close to the boundary of the bounding box; To the left and right of the bounding box of the stationary object, take a left inspection box and a right inspection box respectively, close to the boundary of the bounding box. Convert the areas containing the bounding box, upper inspection box, lower inspection box, left inspection box, and right inspection box to the HSV color space; Obtain the average color saturation of pixels within the bounding box, upper check box, lower check box, left check box, and right check box; If the difference between the average color saturation of any pixel in the upper, lower, left, and right check boxes and the average color saturation of the bounding box is greater than a preset difference threshold, the background similarity detection is deemed to have failed and the alarm is stopped; otherwise, the stationary object is deemed to meet the background similarity detection criteria.
4. The method for identifying the occupancy of fire lanes as described in claim 1, characterized in that, Step S6, which involves morphological detection of a stationary object, includes: Obtain a color image of the pixel region where the stationary object is located; Use vertical and horizontal detection lines to detect the number of edge line segments of a stationary object; If the vertical detection line touches two or more edges, and the horizontal detection line also touches two or more edges, the stationary object is considered to meet the morphological inspection standard; otherwise, the morphological inspection is considered to fail.
5. The method for identifying the occupancy of fire lanes as described in claim 1, characterized in that, In step S2, the background update frequency of the long-term Vibe algorithm model is less than that of the short-term Vibe algorithm model.
6. The method for identifying the occupancy of fire lanes as described in claim 1, characterized in that, When the average brightness of the global HSV channel of the image to be detected changes by more than 0.1, or when the difference in the number of foreground pixels in the image to be detected within two frames exceeds 50% of the total number of pixels in the image to be detected, the long-term Vibe algorithm model and the short-term Vibe algorithm model are reinitialized.
7. The method for identifying the occupancy of fire lanes as described in claim 2, characterized in that, Step S2 establishes the foreground object pixel mask by assigning the background pixels detected by the long-term Vibe algorithm model to 0 and the foreground pixels to 1. The moving foreground object pixel mask is established by assigning the background pixels detected by the short-term Vibe algorithm model to 0 and the foreground pixels to 1.
8. The method for identifying the occupancy of fire lanes as described in claim 2, characterized in that, The number of samples in the first background sample set is at least four times the number of samples in the second background sample set, and the target recognition model is a YOLOv5 network model.
9. A fire lane occupancy identification device, characterized in that, include: A preprocessing unit is used to receive a surveillance video stream, preprocess the surveillance video stream, and obtain an image to be detected. The Vibe detection unit is used to input the image to be detected into a preset long-term Vibe algorithm model and a short-term Vibe algorithm model to obtain the pixel mask of the foreground object and the pixel mask of the moving foreground object in the image to be detected, respectively. The parameter change rate of the long-term Vibe algorithm model is smaller than that of the short-term Vibe algorithm model. The cluster recognition unit is used to obtain the pixel mask of the stationary foreground object based on the difference between the pixel mask of the foreground object and the pixel mask of the moving foreground object, and to perform image morphological filtering and opening and closing operations on the pixel mask of the stationary foreground object to obtain information about the object cluster. The target recognition unit is used to input the image to be detected into the target recognition model to obtain information on human targets and vehicle targets in the image sequence to be detected; The timing unit is used to combine the information of the vehicle target and the information of the object cluster to form the information of the stationary object, and to track and time the stationary object. The alarm unit is used to perform background similarity detection and morphological detection on a stationary object when the stationary duration exceeds a preset alarm threshold. When the stationary object meets the criteria for background similarity detection and morphological detection and is not a human target, the alarm is triggered for the stationary object and the information of the stationary object is output.
10. An electronic device, characterized in that, include: A memory and a processor, the memory storing a computer program that, when executed by the processor, causes the processor to perform the steps of the method as described in any one of claims 1-8.