A kind of road tunnel fire detection method based on the early stage motion feature of smog
Technical field
The invention belongs to field of video detection, be specifically related to a kind of road 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 day by day by common people are paid close attention to, and in the security incident that vcehicular tunnel occurs, fire endangers a maximum class.But in the place that this large space, large area, environment are more severe, traditional fire detector cannot carry out fire alarm in time, nor can provide such as catch fire particular location, scale, flame the information such as diffusion, bring inconvenience to rescue operation, result in serious economic loss and casualties.False alarm phenomenon also happens occasionally.
Along with developing rapidly of computer technology and machine vision technique, create a kind of brand-new fire detector, namely based on the fire detection system of video.At present, imaging-based fire smoke detection technology is still in the starting stage with traditional fire detection technology relatively.Existing technology is: detect smog by smog texture self-similarity; In conjunction with hidden Markov model, modeling is carried out to the change of smog scene marginal information, thus judge the existence whether having smog in scene; The existence etc. of smog is judged whether according to the spectral signature of smog.But tunnel environment more complicated, tone is more gloomy, and the impact of light is particularly remarkable, and detect smog by means of only texture and be inaccurate, 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, provide a kind of road tunnel fire detection method based on smog getting up early motion feature, the method can carry out detecting in real time, reliably to the event of fire occurred in range of video.
In order to realize above-mentioned task, the present invention adopts following technical scheme to be achieved:
Based on a road tunnel fire detection method for the early stage motion feature of smog, the method is carried out according to following steps:
Step one, by camera acquisition realtime graphic, obtains and upgrades the background of this image, i.e. background image;
Step 2, is all divided into multiple pieces with the background image of the first two field picture by the first two field picture under identical block coordinate system;
Step 3, to each piece in the first two field picture, finds the background block identical with this block position in background image, and calculates the absolute value sum of the gray scale difference value of each same pixel position between this block its corresponding background block;
When the absolute value sum of gained is greater than the threshold value A of setting, the value of described threshold value A is area × 255 of (3/4) × block, then this block is object block, is 255 by the gray-scale value assignment of pixels all in this object block;
When the absolute value sum of gained is less than or equal to the threshold value A of setting, then this block is background block, is 0 by the gray-scale value assignment of pixels all in background block;
Finally the background in the first two field picture and target are separated, obtain 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 the upper half area of image, connected component labeling is carried out to the object block occurred in surveyed area, adjacent object block is labeled as same target, obtains the connected domain detecting target, and determine and record delimitation;
Step 5, the method repeating step 2, step 3 and step 4 processes all continuous print images from the second two field picture;
Step 6, the up-and-down boundary of a certain connected domain detected 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, then using this target area as doubtful smoke region, wherein:
N ∈ [80,100], n is positive integer;
The value of L is 5 times of the width of block of dividing in step 2;
Step 7, when in continuous n two field picture, the i-th two field picture detects doubtful smoke region, the process of counter movement tracking and matching, obtain the i-th-j (i>j, i and j is positive integer) gray level image of frame, target area is divided into again each fritter of fritter of m ' × n ' as a template, think that the motion of fritter each pixel interior is consistent, and with the center of each fritter for starting point delimit hunting zone in image to be searched, position in traversal search region, calculating is centered by each position and size is 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 using match block as mating required formwork next time, j is added 2, namely image to be searched differs 2 frames that can distinguish obvious motion change with the image as formwork,
Step 8, as i>j, the process repeating step 7 processes, as i=j, coupling terminates, and obtains the direction of motion of each match block, the motion principal direction as target area block that selecting frequency is the highest, when there being the motion principal direction of the object block of 3/4 to be between 45° angle and 135 ° of angles, namely this detection target is smog, herein breaking out of fire.
Road tunnel fire detection method based on the early stage motion feature of smog of the present invention, compared with prior art, the event of fire occurred in video monitoring range can be detected, not by environmental restraint, can detect video in real time, and detection time short, be easy to realize, accuracy is higher, be suitable for detecting Tunnel Fire event in real time, have broad application prospects.
Accompanying drawing explanation
Fig. 1 is the 1st two field picture.
Fig. 2 has demarcated the image of surveyed area.
Fig. 3 is the 985th two field picture occurred smog first time.
Fig. 4 (a), Fig. 4 (b) and Fig. 4 (c) are followed successively by the binaryzation marking image of the 1110th, 1120 and 1130 frame three width images, in figure, white object is the binaryzation target-marking of present frame, white rectangle frame is connected domain border, and large rectangle frame is smoke target, and little rectangle frame is jamming target.
Fig. 5 is the video image 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 road tunnel fire detection method based on the early stage motion feature of smog, differentiates vcehicular tunnel whether breaking out of fire by block-based binarization segmentation, connected component labeling and target travel principal direction.It should be noted that, image handled in procedure of the present invention be in video along positive seasonal effect in time series first two field picture, 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 in each frame video video image level direction, and H is the pixel of each frame video image vertical direction, w is the width in each piece of region, and h is the height in each piece of region.
The method of the present embodiment specifically adopts following steps to realize:
Step one, by camera acquisition realtime graphic, obtains and upgrades the background of this image, i.e. background image;
Step 2, is all divided into multiple pieces with the background image of the first two field picture by the first two field picture under identical block coordinate system;
Step 3, to each piece in the first two field picture, finds the background block identical with this block position in background image, and calculates the absolute value sum of the gray scale difference value of each same pixel position between this block its corresponding background block;
When the absolute value sum of gained is greater than the threshold value A of setting, the value of described threshold value A is (3/4) × (w*h) × 255, then this block is object block, is 255 by the gray-scale value assignment of pixels all in this object block;
When the absolute value sum of gained is less than or equal to the threshold value A of setting, then this block is background block, is 0 by the gray-scale value assignment of pixels all in background block;
Finally the background in the first two field picture and target are separated, obtain 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 the upper half area of image, connected component labeling is carried out to the object block occurred in surveyed area, adjacent object block is labeled as same target, obtains the connected domain detecting target, and determine and record delimitation;
Step 5, the method repeating step 2, step 3 and step 4 processes all continuous print images from the second two field picture;
Step 6, the up-and-down boundary of a certain connected domain detected 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, then using this target area as doubtful smoke region, wherein:
N ∈ [80,100], n is positive integer;
The value of L is 5 times of the width of block of dividing in step 2;
Step 7, when in continuous n two field picture, the i-th two field picture detects doubtful smoke region, the process of counter movement tracking and matching, obtain the i-th-j (i>j, i and j is positive integer) gray level image of frame, target area is divided into again each fritter of fritter of m ' × n ' as a template, think that the motion of fritter each pixel interior is consistent, and with the center of each fritter for starting point delimit hunting zone in image to be searched, position in traversal search region, calculating is centered by each position and size is 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 using match block as mating required formwork next time, j is added 2, namely image to be searched differs 2 frames that can distinguish obvious motion change with the image as formwork,
Step 8, as i>j, the process repeating step 7 processes, as i=j, coupling terminates, and obtains the direction of motion of each match block, the motion principal direction as target area block that selecting frequency is the highest, when there being the motion principal direction of the object block of 3/4 to be between 45° angle and 135 ° of angles, namely this detection target is smog, herein breaking out of fire.
Below provide specific embodiments of the invention, it should be noted that the present invention is not limited to following specific embodiment, all equivalents done on technical scheme basis all fall into protection scope of the present invention.
Embodiment:
In embodiment, in processing procedure, the sample frequency of video is that 25 frames are per second, two field picture size is 720 × 288, the size in every block region is 4 × 3, two field picture is divided into 180 × 96 block regions, target area binarization segmentation threshold value is 2295, after obtaining suspected target region, by this region again piecemeal, the size of every block is 5 × 5, and region of search is 10 × 12, processes successively according to method of the present invention to the 1st frame to the 1982nd two field picture.
Known video positive sowing time, Fig. 1 is the 1st two field picture of this video; Fig. 2 has demarcated the image of surveyed area; Smoke target first time appears in the 985th two field picture, as shown in Figure 3; As can be seen from Figure 4 the 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 binaryzation marking image of the 1110th, 1120 and 1130 frame three width images, in figure, white object is the binaryzation target-marking of present frame, white rectangle frame is connected domain border, and large rectangle frame is smoke target, and little rectangle frame is jamming target.Fig. 5 is the video image 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.