Background
With the rapid development of computer vision technology in the information age, the fields of human production and life and the like, the application of video image acquisition and processing presents a burst growth state, and the foreground target detection method is based on a background image, performs differential calculation through a global image and filters background noise by using various filtering methods in the common video monitoring from the air satellite remote sensing image to the ground unmanned surface, so as to realize the judgment of an interested target. Or detecting through the speed characteristic of the moving object by using a two-dimensional optical flow field calculation method of the video image. Or the foreground target is detected and judged by using a method based on image recognition, target classification and deep learning. Due to the environmental influences such as changes in illumination, changes in background images, shaking of a camera platform, shaking of leaves in a natural scene and the like, the traditional video image detection methods need to adopt algorithms such as background updating, image shaking removal, sample image learning, a deep neural network and the like, and are completed through large-data-volume operation. The method has large calculated amount, needs to process the image global pixel points in real-time detection, has complex data calculation process, has large calculated amount on each frame of image in real-time image processing, and has low timeliness of on-line monitoring.
For example, royal, et al propose a detection alarm system for foreign body invasion in railway construction departments (royal. jinghu high-speed railway crossing or parallel existing railway construction foreign body invasion alarm technology research [ D ]. beijing: beijing university of transportation, 2010). The system is used for installing two-dimensional laser sensors at different angles on a railway construction site to form a laser light curtain, and the limit of foreign matter invasion in different directions can be detected. The author provides a foreign matter identification algorithm based on the least square method principle, and foreign matter identification is carried out according to the outer contour straight line characteristic parameters and the motion conditions of the invaded object, so that the normally running train and the invasion limit foreign matter are distinguished. On the other hand, the system comprises a wireless network based on ZigBee and GPRS, and remote configuration of field devices and remote access to alarm results are achieved. The method utilizes a two-dimensional laser scanning sensor and a scanning area point cloud distance mode to carry out detection and alarm on the intrusion of foreground targets and foreign matters in a monitoring area, and the method does not have the function of video playback and has a small detection area. And a single two-dimensional laser scanning sensor only detects the foreign matter condition of a sector area, and if a spatial area is monitored, a plurality of two-dimensional laser scanning sensors are required to be spliced into a three-dimensional area, so the cost is high.
For another example, the university of China and south has learned and proposed a railway intrusion detection method based on an intelligent video technology (learning can. railway intrusion detection [ D ] based on the intelligent video technology, Changsha: the university of China, 2010.), and the university of Beijing traffic, salix asahi, etc., and proposed a key algorithm of a train remote lookout system (the key algorithm research [ D ] of the train remote lookout system of salix asahi [ Beijing: the university of Beijing traffic, 2016). Most of the target detection and foreign object intrusion methods based on the video image processing technology are based on the traditional image processing algorithm, and the foreground target is detected by methods such as image difference or background image modeling. The intrusion detection algorithm of the systems comprises a plurality of steps of preprocessing, background extraction, automatic extraction of key monitoring areas, moving object detection, moving object intrusion detection, template matching and the like. The preprocessing includes lens distortion correction, image enhancement, and anti-shake processing. The background extraction is realized based on an optimized mathematical model, and the moving target detection comprises target feature extraction and moving target tracking. Finally, the detection of the target in the monitoring area and the extraction of the key video image can be realized. The method mainly utilizes the traditional image processing video processing mode to process more steps of images of each frame of image in the video stream, and has large data volume, large calculated amount and poor real-time video processing effectiveness. The technology needs to establish a dynamic background model, perform dynamic background updating according to the illumination change condition, and detect a foreground target through an image difference or other feature extraction methods, so the technology is sensitive to the external environment change, is easy to generate more noise interference, and affects the detection precision. Therefore, a new technical solution is needed to solve the problems in the prior art.
Disclosure of Invention
The invention aims to provide a method and a device for block signal conversion and target detection based on a video stream image. The invention uses the variance of the local image pixel value to represent the overall change condition of the video image data in the region. For the whole video image, the signal waveform can be converted into a plurality of one-dimensional signal waveforms for detection. The corresponding one-dimensional signal data is obtained for the block sub-images of each area of the image, so that the data is displayed by a real-time waveform method, noise reduction processing is performed by a smooth filtering method in digital signal processing, weak changes of the background in the sub-areas are eliminated, when a foreground target or an abnormal condition occurs, strong fluctuation changes of the one-dimensional signal occur, abnormal fluctuation existing in a video stream can be obviously judged, and the judgment of whether the foreground target occurs in the video detection area is realized.
In order to achieve the purpose, the technical scheme of the invention is as follows: a method for block signal conversion and target detection based on video stream images, the method comprising:
video data acquisition: collecting and storing video stream image data of a monitoring area by using video image data collecting equipment;
and (3) global video processing: carrying out graying processing on the video stream image, and carrying out global downsampling on the video stream image subjected to graying processing;
local signal conversion: performing video region segmentation on the video stream global image to form a sub-region, performing region mean filtering on the sub-region, and calculating the variance of the sub-region of the video stream image;
one-dimensional signal processing: and drawing the variance value of the sub-region image into a waveform according to the time lapse, carrying out signal mean filtering, calculating the difference value of the one-dimensional signal waveform, obtaining the reference value of the background image and realizing the detection of the foreground target video image.
The above method for block signal conversion and target detection based on video stream images, the global video processing method includes:
video stream image preprocessing, namely installing a monitoring camera on a fixed platform, receiving a video image acquired by the camera in real time by using a computer, and defining the video image as I (x, y, t), wherein the I (x, y) represents data of each frame of image, the I (x, y, t) is a video stream image corresponding to time t, the image width of the video stream image is W, and the image height of the video stream image is H;
performing image graying treatment, namely converting a three-channel RGB (red, green and blue) color digital image collected by a monitoring camera into a single-channel 8-bit grayscale image, namely recording the pixel grayscale value between 0 and 255 as: b (x, y, t);
the method comprises the following steps of video image global downsampling, dimensionality reduction and downsampling calculation are carried out on a global image, the scaling coefficient of the global image in the width direction and the height direction is w and h, a new downsampled image is L (x, y and t), the length and the height of the new downsampled image are M, N, and the formula is met:
M=W/w,N=H/h
performing Gaussian blur processing once on the image after the down sampling, finishing primary image filtering, obtaining an image G (x, y, t), wherein the gray value of a pixel in a new image G (x, y, t) and the early-stage down sampling image L (x, y, t) meet the formula:
the method for block signal conversion and target detection based on video stream images as described above, the local signal conversion method includes:
obtaining an image G (x, y, t) after Gaussian blur processing, dividing a global image G (x, y, t) into small windows with the same size by adopting a region grid dividing method, defining an image dividing coefficient as k, and dividing the global image into k multiplied by k subregions Rn(x, y, t), where n is 1, 2.., k × k, and the size of the partial image is Wn,HnSize of partial image Wn,Hn;
For sub-region R after grid blockingn(x, y, t), adopting a j multiplied by j mean filtering template to carry out noise filtering and smoothing processing on the sub-region image, and taking f (x, y, t) as the sub-region image RnMoving the smoothed window template in (x, y, t) to obtain a sub-region filtered image Fn(x,y,t):
Calculating the average value Ave of all pixels in the image subarea at the moment tn(t):
Calculating the variance D at the t moment by utilizing the gray values and the average values of all pixel points of the subregion imagen(t):
In the method for block signal conversion and target detection based on video stream images, in the one-dimensional signal processing process:
carrying out signal mean filtering processing to obtain one-dimensional signal of video image which is divided into blocks according to grids
Wherein λ
nThe value is an odd number within 3 to 10;
by formula San(t)=|Sn(t)-Sn(t-1) | calculating the difference of the one-dimensional signal waveforms;
by the formula
Obtaining a reference value, Sa, for the background image
n(T) is the signal value at the current time T, and when the signal value is greater than alpha times T
nWhen the threshold value is reached, the foreground object is judged to appear in the video monitoring area, and the automatic trigger switch trigger for generating and storing data of the video image is used for triggering the switch trigger
nSatisfy the formula
Then, automatically collecting the image of the current scene, and storing the important view when the foreground target appearsAnd (4) frequency image.
The invention also provides a device for block signal conversion and target detection based on video stream images, which comprises:
the video data acquisition unit acquires and stores video stream image data of the monitoring area by using video image data acquisition equipment;
the video image data acquisition device comprises: the camera is used for video acquisition; a computer: the system is used for collecting and storing video image data and executing the algorithm designed by the invention; a display: the device is used for storing and displaying the video image and the detection result;
the global video processing unit is used for carrying out graying processing on the video stream image and carrying out global downsampling on the video stream image after the graying processing;
the local signal conversion unit is used for carrying out video area segmentation on the video stream global image to form a sub-area, carrying out area mean filtering on the sub-area and calculating the variance of the video stream image sub-area;
and the one-dimensional signal processing unit is used for drawing the variance value of the sub-region image into a waveform according to the time lapse, carrying out signal mean value filtering, calculating the difference value of the one-dimensional signal waveform, obtaining the reference value of the background image and realizing the detection of the foreground target video image.
The device for block signal conversion and target detection based on video stream images as described above, the global video processing unit includes a global down-sampling module, the global down-sampling module is configured to down-sample the video images globally, and the global down-sampling satisfies the formula:
M=W/w,N=H/h
in the above equation, the scaling factor in the image width direction and the same scaling factor in the height direction are W and H, the image width is W and the image height is H, and the new downsampled image length and height are M, N.
The apparatus for block signal conversion and target detection based on video stream image as described above, the local signal conversion unit includes a video region segmentation module for segmenting the global video image into a plurality of sub-regions, defining a mapThe image segmentation coefficient is k, the global video image is divided into k multiplied by k sub-region local images R by the video region segmentation modulen(x,y,t)。
The apparatus for block signal conversion and target detection based on video stream images as described above, the local signal conversion unit includes a region mean filtering module, the region mean filtering module is configured to perform region mean filtering on the sub-region, and the region mean filtering formula is
j × j represents a mean filtering template, F
n(x, y, t) represents a subregion filtered image.
In the apparatus for block signal conversion and target detection based on video stream images, the one-dimensional signal processing unit includes a foreground target detection module, and the foreground target detection module is configured to obtain a reference value of a background image to achieve foreground target video image detection, and use a formula to achieve foreground target video image detection
Obtaining a reference value, Sa, for the background image
n(T) is the signal value at the current time T, and when the signal value is greater than alpha times T
nWhen the threshold value is reached, the foreground object is judged to appear in the video monitoring area, and the automatic trigger switch trigger for generating and storing data of the video image is used for triggering the switch trigger
nSatisfy the formula
And then, automatically acquiring the image of the current scene, and storing the important video image when the foreground target appears.
The invention has the following advantages: according to the invention, the global video image area monitored by the camera is divided into a plurality of sub-areas, and the two-dimensional image of the sub-area window is converted into a one-dimensional signal waveform, so that the data volume of real-time image processing can be simplified, and the detection speed of a video frame is improved; the invention divides the global video image into the sub-area windows to process locally, the blocking processing mode of the video stream image can provide a basis for the parallel processing of a plurality of subsequent sub-images, and the GPU can be used for processing the sub-images in parallel, thereby obviously reducing the processing time of the video stream image; the method aims at the image data of a video monitoring area, converts the image data into signal waveforms by using the mean value and the variance of the pixel values of the sub-areas, judges whether a foreground target appears in the image data or not through the fluctuation range of the pixel values in the area, and can eliminate a large amount of noise interference caused by a frame difference method or a background image difference method in the traditional image processing; the method for converting the two-dimensional image into the one-dimensional signal has better smoothing effect on obvious noise caused by illumination, micro motion and camera platform shake in the background image, and is simpler than the traditional image processing method; the invention uses the concept and method of signal processing to process the video stream image in blocks and to trigger and judge the corresponding waveform of the video stream image by the foreground object, so as to automatically detect the time of the object, automatically extract and store the video stream image when the object appears, and can be used for data playback.
Detailed Description
The following examples are intended to illustrate the invention but are not intended to limit the scope of the invention.
As shown in fig. 1 and fig. 2, a method for block signal conversion and object detection based on video stream images includes:
video data acquisition: collecting and storing video stream image data of a monitoring area by using video image data collecting equipment;
and (3) global video processing: carrying out graying processing on the video stream image, and carrying out global downsampling on the video stream image subjected to graying processing;
local signal conversion: performing video region segmentation on the video stream global image to form a sub-region, performing region mean filtering on the sub-region, and calculating the variance of the sub-region of the video stream image;
one-dimensional signal processing: and drawing the variance value of the sub-region image into a waveform according to the time lapse, carrying out signal mean filtering, calculating the difference value of the one-dimensional signal waveform, obtaining the reference value of the background image and realizing the detection of the foreground target video image.
In an embodiment of a method for block signal conversion and target detection based on video stream images, a global video processing method includes:
video stream image preprocessing, namely installing a monitoring camera on a fixed platform, receiving a video image acquired by the camera in real time by using a computer, and defining the video image as I (x, y, t), wherein the I (x, y) represents data of each frame of image, the I (x, y, t) is a video stream image corresponding to time t, the image width of the video stream image is W, and the image height of the video stream image is H;
performing image graying treatment, namely converting a three-channel RGB (red, green and blue) color digital image collected by a monitoring camera into a single-channel 8-bit grayscale image, namely recording the pixel grayscale value between 0 and 255 as: b (x, y, t);
the images collected by video monitoring have higher resolution, namely, a large number of pixel points are involved in calculation. In the real-time image processing, the invention utilizes the whole change of pixel values in the sub-area to calculate, so that the dimensionality reduction and down-sampling calculation is firstly carried out on the global image. Since the pixel value is an integer value, the scaling factor with the same image width direction and height direction is set to be w, h, the new downsampled image is L (x, y, t), the image length and height thereof are M, N, the global downsampling of the video image is met, dimensionality reduction and downsampling calculation are performed on the global image, the scaling factor with the same image width direction and height direction is w, h, the new downsampled image is L (x, y, t), the length and height of the new downsampled image is M, N, and the formula is met:
M=W/w,N=H/h
where, the image length M and the height N are integers, i.e. it means that W and H can be evenly divided by W and H, respectively. Then, performing a gaussian blur processing on the down-sampled image for once to complete the filtering of the primary image, obtaining an image G (x, y, t), and reducing the interference of background noise, wherein the pixel gray value in the new image and the down-sampled image L (x, y, t) in the previous period, performing a gaussian blur processing on the down-sampled image for once to complete the filtering of the primary image, obtaining an image G (x, y, t), and the pixel gray value in the new image G (x, y, t) and the down-sampled image L (x, y, t) in the previous period, and satisfying the formula:
in one embodiment of a method for block signal conversion and object detection based on video stream images, a local signal conversion method comprises:
referring to fig. 1 again, after gaussian blurring processing, an image G (x, y, t) is obtained, a region mesh division method is adopted to divide the global image G (x, y, t) into small windows with the same size, an image division coefficient is defined as k, and the global image is divided into k × k sub-regions Rn(x, y, t), where n is 1, 2.., k × k, and the size of the partial image is Wn,HnSize of partial image Wn,Hn(ii) a Referring to fig. 3, the effect of dividing a global video image into 2 x 2 grid windows according to the present invention is shown.
Referring to fig. 4, waveforms for processing the video image of fig. 3 using the present invention are shown. It can be seen that the background of the sub-window has dynamic backgrounds of trees, grasslands, vegetation, illumination change and the like, and the mean waveform of the background has narrow fluctuation before a foreground target appears; but do notWhen the foreground object appears, the foreground object has obvious fluctuation. For sub-region R after grid blockingn(x, y, t), adopting a j multiplied by j mean filtering template to carry out noise filtering and smoothing processing on the sub-region image, and taking f (x, y, t) as the sub-region image RnMoving the smoothed window template in (x, y, t) to obtain a sub-region filtered image Fn(x,y,t):
Calculating the average value Ave of all pixels in the image subarea at the moment tn(t):
Calculating the variance D at the t moment by utilizing the gray values and the average values of all pixel points of the subregion imagen(t):
Referring to fig. 5, according to the method, video stream image data is processed in a grid blocking manner, and a two-dimensional image in a sub-window area is converted into a one-dimensional signal through variance value calculation, which represents the fluctuation situation of the pixel value in the area of the monitored video at the time t. The variance value represents the energy fluctuation of pixel values in the area, and the fluctuation of the target appearance time can be more obvious than the average value waveform.
In an embodiment of a method for block signal conversion and target detection based on video stream images, in the process of one-dimensional signal processing:
one-dimensional signal D for a video image signaled in grid blocks
n(t), due to the occurrence of noise in actual detection, a larger first derivative deviation at adjacent moments is caused, and the normal judgment of the foreground target is influenced. Using λ in the embodiments of the invention
nThree neighborhood mean filtering of 3, where λ can be chosen to be larger thanAn odd number equal to 3, but the larger the range of neighborhood mean filtering, the more smooth the signal waveform is, and the judgment on the foreground target is reduced, generally lambda
nThe value is an odd number within 3 to 10; then, signal mean filtering processing is carried out to obtain one-dimensional signals of video images which are signalized according to grid blocks
By formula San(t)=|Sn(t)-Sn(t-1) | calculating the difference of the one-dimensional signal waveforms; the one-dimensional waveform obtained by calculating the variance of the video image subareas can smooth a small amount of noise interference after filtering, and the dynamic waveform of the corresponding window is obtained. When no foreground object appears, the dynamic waveform only changes slightly; when the foreground object appears, the waveform will generate larger fluctuation.
In the difference waveform of the adjacent data of the one-dimensional signal, when the foreground object appears, a larger step signal is generated, as shown in fig. 6, for the signal with such large fluctuation, it can be determined that it has exceeded the fluctuation range of the background tiny noise interference, that is, it is defined as the appearance of the foreground object. Definition of tau in the examples of the invention
nThe average value of the signal waveform corresponding to 10 frames of video images is calculated by the formula
Obtaining a reference value T of a background image
n,Sa
n(T) is the signal value at the current time T, and when the signal value is greater than alpha times T
nWhen the threshold value is reached, the foreground object is judged to appear in the video monitoring area, and the automatic trigger switch trigger for generating and storing data of the video image is used for triggering the switch trigger
nSatisfy the formula
And then, automatically acquiring the image of the current scene, and storing the important video image when the foreground target appears.
At this moment, the automatic trigger switch trigger for storing the video image generation datanThe current scene is automatically acquired, namelyAnd saving the important video image when the foreground object appears. Fig. 7 shows an example of a foreground object video image detected and stored by the present invention, in which the window 2 and the window 4 are sub-images of the whole monitoring area, corresponding to the mesh partition area in fig. 3. The one-dimensional signal waveform of the corresponding sub-region has obvious signal fluctuation with reference to fig. 4, 5 and 6 again, and according to the method of the present invention, the image when the foreground object appears can be accurately detected and stored.
The invention also provides a block signal conversion and target detection device based on video stream images, which comprises:
the video data acquisition unit acquires and stores video stream image data of the monitoring area by using video image data acquisition equipment; wherein, video image data acquisition equipment includes: the camera is used for video acquisition; a computer: the system is used for collecting and storing video image data and executing the algorithm designed by the invention; a display: the device is used for storing and displaying the video image and the detection result;
the global video processing unit is used for carrying out graying processing on the video stream image and carrying out global downsampling on the video stream image after the graying processing;
the local signal conversion unit is used for carrying out video area segmentation on the video stream global image to form a sub-area, carrying out area mean filtering on the sub-area and calculating the variance of the video stream image sub-area;
and the one-dimensional signal processing unit is used for drawing the variance value of the sub-region image into a waveform according to the time lapse, carrying out signal mean value filtering, calculating the difference value of the one-dimensional signal waveform, obtaining the reference value of the background image and realizing the detection of the foreground target video image.
As above, the global video processing unit includes a global down-sampling module, the global down-sampling module is used for global down-sampling the video image, and the global down-sampling satisfies the formula:
M=W/w,N=H/h
in the above equation, the scaling factor in the image width direction and the same scaling factor in the height direction are W and H, the image width is W and the image height is H, and the new downsampled image length and height are M, N.
In an embodiment of the apparatus for block signal conversion and target detection based on video stream image, the local signal conversion unit includes a video region segmentation module, the video region segmentation module is configured to segment the global video image into a plurality of sub-regions, an image segmentation coefficient is defined as k, and then the global video image is divided into k × k sub-region local images R by the video region segmentation modulen(x,y,t)。
In an embodiment of the apparatus for block signal conversion and target detection based on video stream images, the local signal conversion unit comprises a region mean filtering module, the region mean filtering module is configured to perform region mean filtering on the sub-regions, and the region mean filtering formula is
j × j represents a mean filtering template, F
n(x, y, t) represents a subregion filtered image.
In an embodiment of the apparatus for block signal conversion and target detection based on video stream images, the one-dimensional signal processing unit includes a foreground target detection module, the foreground target detection module is used for obtaining a reference value of a background image to realize foreground target video image detection, and the formula is used for detecting the foreground target video image
Obtaining a reference value, Sa, for the background image
n(T) is the signal value at the current time T, and when the signal value is greater than alpha times T
nWhen the threshold value is reached, the foreground object is judged to appear in the video monitoring area, and the automatic trigger switch trigger for generating and storing data of the video image is used for triggering the switch trigger
nSatisfy the formula
And then, automatically acquiring the image of the current scene, and storing the important video image when the foreground target appears.
According to the invention, the global video image area monitored by the camera is divided into a plurality of sub-areas, and the two-dimensional image of the sub-area window is converted into a one-dimensional signal waveform, so that the data volume of real-time image processing can be simplified, and the detection speed of a video frame is improved; the invention divides the global video image into the sub-area windows to process locally, the blocking processing mode of the video stream image can provide a basis for the parallel processing of a plurality of subsequent sub-images, and the GPU can be used for processing the sub-images in parallel, thereby obviously reducing the processing time of the video stream image; the method aims at the image data of a video monitoring area, converts the image data into signal waveforms by using the mean value and the variance of the pixel values of the sub-areas, judges whether a foreground target appears in the image data or not through the fluctuation range of the pixel values in the area, and can eliminate a large amount of noise interference caused by a frame difference method or a background image difference method in the traditional image processing; the method for converting the two-dimensional image into the one-dimensional signal has better smoothing effect on obvious noise caused by illumination, micro motion and camera platform shake in the background image, and is simpler than the traditional image processing method; the invention uses the concept and method of signal processing to process the video stream image in blocks and to trigger and judge the corresponding waveform of the video stream image by the foreground object, so as to automatically detect the time of the object, automatically extract and store the video stream image when the object appears, and can be used for data playback.
Although the invention has been described in detail above with reference to a general description and specific examples, it will be apparent to one skilled in the art that modifications or improvements may be made thereto based on the invention. Accordingly, such modifications and improvements are intended to be within the scope of the invention as claimed.