A kind of Tunnel Fire detection method based on the early stage motion feature of smog
Technical field
The invention belongs to the video detection field, be specifically related to a kind of Tunnel Fire detection method based on the early stage motion feature of smog.
Background technology
In recent years, the safety problem of vcehicular tunnel is paid close attention to by common people day by day, and in the security incident that vcehicular tunnel occurs, fire is the maximum class of harm.But in the more abominable place of this large space, large tracts of land, environment, traditional fire detector can't carry out fire alarm in time, nor can provide information such as diffusion such as the particular location that catches fire, scale, flame, bring inconvenience to rescue operation, caused serious economic loss and casualties.The false alarm phenomenon also happens occasionally.
Along with developing rapidly of computer technology and machine vision technique, produced a kind of brand-new fire detector, namely based on the fire detection system of video.At present, the fire detection technology that the imaging-based fire smoke detection technology is relative and traditional still is in the starting stage.Existing technology is: detect smog by smog texture self-similarity; In conjunction with hidden Markov model, smog scene marginal information is changed and carry out modeling, thereby judge the existence whether smog is arranged in scene; Judge whether existence of smog etc. according to the spectral signature of smog.But the tunnel environment more complicated, tone is more gloomy, and the impact of light is particularly remarkable, only detects smog by texture and is inaccurate, and edge feature is also not obvious.
Summary of the invention
For shortcomings and deficiencies of the prior art, the object of the invention is to, a kind of Tunnel Fire detection method based on smog getting up early motion feature is provided, the method can carry out in real time the event of fire that occurs in range of video, detect reliably.
In order to realize above-mentioned task, the present invention adopts following technical scheme to be achieved:
A kind of Tunnel Fire detection method based on the early stage motion feature of smog, the method is carried out according to following steps:
The background of this image is obtained and upgraded to step 1 by the camera acquisition realtime graphic,, i.e. background image;
Step 2 all is divided into a plurality of with the background image of the first two field picture and the first two field picture under identical piece coordinate system;
Step 3 to each piece in the first two field picture, finds the background piece identical with this piece position in background image, and calculates the absolute value sum of the gray scale difference value of its corresponding background piece of this piece among same pixel position;
Greater than the threshold value A of setting, the value of described threshold value A is the area * 255 of (3/4) * piece when the absolute value sum of gained, and this piece is object block, is 255 with the gray-scale value assignment of all pixels in this object block;
The threshold value A that is less than or equal to setting when the absolute value sum of gained, this piece is the background piece, is 0 with the gray-scale value assignment of all pixels in the background piece;
At last the background in the first two field picture and target are separated, obtained the binary image of the first two field picture;
Step 4 for the binary image of the first two field picture, calibrates surveyed area in first zone of image, the object block that occurs in surveyed area is carried out connected component labeling, adjacent object block is labeled as same target, obtains detecting the connected domain of target, and determine and record delimitation;
Step 5, the method for repeating step two, step 3 and step 4 is processed all the continuous images from the second two field picture;
Step 6, the up-and-down boundary of a certain connected domain that detects when continuous n two field picture overlaps with the up-and-down boundary of surveyed area, and the side-play amount of centre of gravity place is less than certain distance L, with this target area as doubtful smog zone, wherein:
N ∈ [80,100], n are positive integer;
The value of L is 5 times of width of the piece divided in step 2;
step 7, the i two field picture detects doubtful smog zone in continuous n two field picture, the counter movement tracking and matching is processed, obtain i-j (i〉j, i and j are positive integer) gray level image of frame, the target area is divided into each fritter of fritter of m ' * n ' again as a template, think that the motion of interior each pixel of fritter is consistent, and delimit the hunting zone take the center of each fritter as starting point in image to be searched, position in the traversal search zone, calculating centered by each position and size be similarly the fritter of m ' * n ' and the similarity of template, the fritter the most similar to template is match block, and the direction of logging template motion, simultaneously with match block as mate needed formwork next time, j is added 2, being image to be searched differs with image as formwork 2 frames that can distinguish obvious motion change,
Step 8, as i〉during j, the process of repeating step seven is processed, when i=j, coupling finishes, and obtains the direction of motion of each match block, the motion principal direction as the target area piece that selecting frequency is the highest, when the motion principal direction that 3/4 object block is arranged is between 45° angle and 135 ° of angles, namely this detection target is smog, breaking out of fire herein.
Tunnel Fire detection method based on the early stage motion feature of smog of the present invention, compared with prior art, can the event of fire that occur in video monitoring range be detected, be not subjected to environmental restraint, can detect video in real time, and detection time is short, be easy to realize, accuracy is higher, is suitable for detecting in real time the Tunnel Fire event, has broad application prospects.
Description of drawings
Fig. 1 is the 1st two field picture.
Fig. 2 is the image of having demarcated surveyed area.
Fig. 3 is the 985th two field picture that smog occurs for the first time.
Fig. 4 (a), Fig. 4 (b) and Fig. 4 (c) are followed successively by the 1110th, 1120 and 1130 frame three width image binaryzation marking images, in figure, white object is the binaryzation target-marking of present frame, the white rectangle frame is the connected domain border, and the large rectangle frame is smoke target, and little rectangle frame is jamming target.
Fig. 5 is the video image of having demarcated smog movement principal direction, and black line is direction, and in figure, the motion principal direction of most of object block is between 45° angle and 135 ° of angles.
Below in conjunction with drawings and Examples, content of the present invention is described in further detail.
Embodiment
The present embodiment provides a kind of Tunnel Fire detection method based on the early stage motion feature of smog, differentiates whether breaking out of fire of vcehicular tunnel by block-based binarization segmentation, connected component labeling and target travel principal direction.Need to prove, in procedure of the present invention handled image be in video positive seasonal effect in time series the first two field picture in edge, the second two field picture, the 3rd two field picture ..., m (m is positive integer) two field picture.
If the size of each frame video image is W*H, the size of each piece is w*h, and wherein W is the pixel of each frame video video image horizontal direction, and H is the pixel of each frame video image vertical direction, w is the width in each piece zone, and h is the height in each piece zone.
The method of the present embodiment specifically adopts following steps to realize:
The background of this image is obtained and upgraded to step 1 by the camera acquisition realtime graphic,, i.e. background image;
Step 2 all is divided into a plurality of with the background image of the first two field picture and the first two field picture under identical piece coordinate system;
Step 3 to each piece in the first two field picture, finds the background piece identical with this piece position in background image, and calculates the absolute value sum of the gray scale difference value of its corresponding background piece of this piece among same pixel position;
Greater than the threshold value A of setting, the value of described threshold value A is (3/4) * (w*h) * 255 when the absolute value sum of gained, and this piece is object block, is 255 with the gray-scale value assignment of all pixels in this object block;
The threshold value A that is less than or equal to setting when the absolute value sum of gained, this piece is the background piece, is 0 with the gray-scale value assignment of all pixels in the background piece;
At last the background in the first two field picture and target are separated, obtained the binary image of the first two field picture;
Step 4 for the binary image of the first two field picture, calibrates surveyed area in first zone of image, the object block that occurs in surveyed area is carried out connected component labeling, adjacent object block is labeled as same target, obtains detecting the connected domain of target, and determine and record delimitation;
Step 5, the method for repeating step two, step 3 and step 4 is processed all the continuous images from the second two field picture;
Step 6, the up-and-down boundary of a certain connected domain that detects when continuous n two field picture overlaps with the up-and-down boundary of surveyed area, and the side-play amount of centre of gravity place is less than certain distance L, with this target area as doubtful smog zone, wherein:
N ∈ [80,100], n are positive integer;
The value of L is 5 times of width of the piece divided in step 2;
step 7, the i two field picture detects doubtful smog zone in continuous n two field picture, the counter movement tracking and matching is processed, obtain i-j (i〉j, i and j are positive integer) gray level image of frame, the target area is divided into each fritter of fritter of m ' * n ' again as a template, think that the motion of interior each pixel of fritter is consistent, and delimit the hunting zone take the center of each fritter as starting point in image to be searched, position in the traversal search zone, calculating centered by each position and size be similarly the fritter of m ' * n ' and the similarity of template, the fritter the most similar to template is match block, and the direction of logging template motion, simultaneously with match block as mate needed formwork next time, j is added 2, being image to be searched differs with image as formwork 2 frames that can distinguish obvious motion change,
Step 8, as i〉during j, the process of repeating step seven is processed, when i=j, coupling finishes, and obtains the direction of motion of each match block, the motion principal direction as the target area piece that selecting frequency is the highest, when the motion principal direction that 3/4 object block is arranged is between 45° angle and 135 ° of angles, namely this detection target is smog, breaking out of fire herein.
Below provide specific embodiments of the invention, need to prove that the present invention is not limited to following specific embodiment, all equivalents of doing on present techniques scheme basis all fall into protection scope of the present invention.
Embodiment:
In embodiment in processing procedure the sample frequency of video be 25 frame per seconds, the two field picture size is 720 * 288, the size in every zone is 4 * 3, two field picture is divided into 180 * 96 piece zones, and target area binarization segmentation threshold value is 2295, after obtaining the suspected target zone, should the zone piecemeal again, every block size is 5 * 5, and the region of search is 10 * 12, successively the 1st frame to the 1982 two field pictures is processed according to method of the present invention.
Known video positive sowing time, Fig. 1 is the 1st two field picture of this video; Fig. 2 is the image of having demarcated surveyed area; Smoke target appears in the 985th two field picture, as shown in Figure 3 for the first time; The as can be seen from Figure 4 morphological feature of smoke target motion, continual continuously from top to bottom, and barycentre offset is less, Fig. 4 (a), Fig. 4 (b) and Fig. 4 (c) are followed successively by the 1110th, 1120 and 1130 frame three width image binaryzation marking images, in figure, white object is the binaryzation target-marking of present frame, the white rectangle frame is the connected domain border, and the large rectangle frame is smoke target, and little rectangle frame is jamming target.Fig. 5 is the video image of having demarcated smog movement principal direction, and black line is direction, and in figure, the motion principal direction of most of object block is between 45° angle and 135 ° of angles.