Disclosure of Invention
In view of this, the present invention aims to provide a high-altitude parabolic detection method, apparatus and device, so as to overcome the problem that the high-altitude parabolic detection has certain difficulty due to the low accuracy, reliability and real-time property of the current algorithm applied to the high-altitude parabolic detection.
In order to achieve the purpose, the invention adopts the following technical scheme:
a high altitude parabolic detection method comprising:
acquiring video information; the video information comprises a moving foreground image;
extracting the foreground image in the video information;
recognizing the foreground image by using a pre-trained high-altitude parabolic detection model to obtain an output image recognition type;
determining a high altitude parabolic result based on the image recognition type.
Further, the above high-altitude parabolic detection method, where the extracting the foreground image from the video information includes:
and extracting the foreground image from the video information by using a GarbCut algorithm.
Further, before the identification of the foreground image by using the pre-trained high-altitude parabolic detection model to obtain the output image identification type, the method for detecting a high-altitude parabolic image further includes:
determining a training data set; each training data set comprises a sample image and a corresponding sample identification type;
and inputting the sample image and the corresponding sample identification type into a preset convolutional neural network model for training to obtain the high-altitude parabolic detection model.
Further, in the above high-altitude parabolic detection method, the identifying the foreground image by using a pre-trained high-altitude parabolic detection model to obtain an output image identification type includes:
preprocessing the foreground image to obtain an input image;
and inputting the input image into the high-altitude parabolic detection model to obtain the image identification type.
Further, the above high-altitude parabolic detection method, where the preprocessing is performed on the foreground image to obtain an input image, includes:
performing down-sampling processing on the foreground image to obtain a down-sampled image;
performing local normalization processing on the downsampled picture to obtain a local normalized picture;
and dividing the local normalized picture into image blocks with preset specifications, and taking the image blocks as the input picture.
Further, in the above high altitude parabolic detection method, the inputting the input image into the high altitude parabolic detection model to obtain the image recognition type includes:
inputting each image block into the convolution layer of the high-altitude parabolic detection model, and respectively extracting features;
transforming the extracted features through an activation function to form a convolution feature map;
forming a pooling feature map by downsampling the convolution feature map;
performing vector transformation on the pooled feature map to form a feature vector;
classifying the characteristic vectors by using a Softmax classifier to obtain an identification result;
and integrating the identification results of all the image blocks to obtain the image identification type.
Further, in the above high altitude parabolic detection method, the sample identification type includes at least one of leaves, birds, plastic bottles, eggs, flowerpots, glass cups, masonry, and banana peels; correspondingly, the image recognition type comprises at least one of leaves, birds, plastic bottles, eggs, flowerpots, glass cups, masonry and banana peels;
the determining a high altitude parabolic result based on the image recognition type comprises:
if the image identification type comprises leaves and/or birds, indicating that the high-altitude parabolic result is that high-altitude parabolic does not occur; if the image recognition type comprises at least one of plastic bottles, eggs, flowerpots, glass cups, masonry and banana skins, the high-altitude parabolic result is that high-altitude parabolic occurs.
Further, the above high-altitude parabolic detection method, if the high-altitude parabolic result is a high-altitude parabolic occurrence, after determining the high-altitude parabolic result based on the image recognition type, includes:
a high altitude parabolic alert is generated.
In another aspect, the present invention further provides a high altitude parabolic detection apparatus, including:
the acquisition module is used for acquiring video information; the video information comprises a moving foreground image;
the extraction module is used for extracting the foreground image in the video information;
the recognition module is used for recognizing the foreground image by utilizing a pre-trained high-altitude parabolic detection model to obtain an output image recognition type;
and the determining module is used for determining a high-altitude parabolic result based on the image recognition type.
In another aspect, the present invention further provides a high altitude parabolic detection apparatus, including a processor and a memory, where the processor is connected to the memory:
the processor is used for calling and executing the program stored in the memory;
the memory for storing the program for performing at least the high altitude parabolic detection method of any one of the above.
The invention relates to a high-altitude parabolic detection method, a device and equipment, wherein the method comprises the steps of obtaining video information; the video information comprises moving foreground images; extracting a foreground image in video information; recognizing the foreground image by using a pre-trained high-altitude parabolic detection model to obtain an output image recognition type; based on the image recognition type, a high altitude parabolic result is determined. By adopting the technical scheme of the invention, the foreground image is extracted, then the foreground image is subjected to feature extraction and identification through the convolutional neural network, and finally whether the foreground image is a parabola or not is determined and the specific type of the high-altitude parabola is determined, so that the difficulty of checking and searching the high-altitude parabola is reduced, the efficiency of judging the high-altitude parabola is improved, and the convenience of high-altitude parabola detection is improved.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the technical solutions of the present invention will be described in detail below. It is to be understood that the described embodiments are merely exemplary of the invention, and not restrictive of the full scope of the invention. All other embodiments, which can be derived by a person skilled in the art from the examples given herein without any inventive step, are within the scope of the present invention.
Fig. 1 is a flow chart provided by an embodiment of the high altitude parabolic detection method according to the present invention. Referring to fig. 1, the present embodiment may include the following steps:
and S11, acquiring the video information.
The high-speed camera or other types of cameras may be installed on a high-rise building, and the embodiment is not limited. The installation height of the camera is set according to actual conditions, for example, the installation height of the camera can be set to be 10 meters away from the ground, and the shooting direction of the camera is upward, so that video information of an article falling from high altitude can be acquired.
Generally, when an object moves, a foreground image in a video is a moving object, such as leaves, birds, plastic bottles, eggs, flowerpots, glass cups, masonry, banana skins, and the like, and a background image in the video is a static object, such as buildings and the like.
In this embodiment, the video information shot by the camera may be obtained first.
And S12, extracting the foreground image in the video information.
And after the video information is acquired, extracting a foreground image in the video information. In some alternative embodiments, the foreground image in the video information may be extracted by:
and extracting a foreground image from the video information by using a GarbCut algorithm.
Specifically, in high-altitude parabolic detection, stationary backgrounds such as buildings need to be deleted, moving objects with foreground are left, and foreground extraction can be performed by adopting a foreground extraction algorithm GrabCut in OpenCV.
And S13, recognizing the foreground image by using a pre-trained high-altitude parabolic detection model to obtain an output image recognition type.
In this embodiment, a high-altitude parabolic detection model is trained in advance, and the foreground image is identified by using the high-altitude parabolic detection model trained in advance, so as to obtain an output image identification type.
In some alternative embodiments, the foreground image may be identified by:
firstly, preprocessing a foreground image to obtain an input image;
and step two, inputting the input image into a high-altitude parabolic detection model to obtain an image identification type.
In some optional embodiments, the step of preprocessing the foreground image is as follows:
performing down-sampling processing on the foreground image to obtain a down-sampled image; performing local normalization processing on the downsampled picture to obtain a local normalized picture; and dividing the local normalized picture into image blocks with preset specifications, and taking the image blocks as input pictures.
Specifically, the foreground image may be down-sampled to a size of 64 × 64, to obtain a down-sampled picture; then, local comparison normalization operation is carried out to obtain a local normalization picture; and then, dividing the local normalized picture into image blocks with a preset specification of 8 × 8 as input pictures.
In some alternative embodiments, after the input image is input into the high altitude parabolic detection model, the determination of the image recognition type may be performed by:
inputting each image block into a convolution layer of a high-altitude parabolic detection model, and respectively extracting features; transforming the extracted features through an activation function to form a convolution feature map; forming a pooling feature map by downsampling the convolution feature map; performing vector transformation on the pooled feature map to form feature vectors; classifying the feature vectors by using a Softmax classifier to obtain an identification result; and integrating the identification results of all the image blocks to obtain the image identification type.
Specifically, firstly, inputting a convolution layer of a high-altitude parabolic detection model into each image block for feature extraction, and transforming the extracted features through an activation function to form a convolution feature map (response to the features of the input image); then, performing feature mapping by adopting a corresponding maximum pooling layer, and forming a pooling feature map by performing downsampling on the convolution feature map; and finally, carrying out vector transformation on the obtained pooled feature map by adopting a full-connection layer to form a feature vector, conveying the feature vector to a classification layer, classifying the image by utilizing a Softmax classifier so as to obtain an identification result of each image block, and comprehensively summing the identification results of all the image blocks to obtain an image identification type so as to obtain high-altitude parabolic and non-parabolic results.
And S14, determining a high-altitude parabolic result based on the image recognition type.
In some alternative embodiments, the image recognition type includes at least one of leaves, birds, plastic bottles, eggs, flowerpots, glasses, masonry, banana peels.
If the image identification type comprises leaves and/or birds, the high-altitude parabolic result is that high-altitude parabolic does not occur; if the image recognition type comprises at least one of plastic bottles, eggs, flowerpots, glass cups, masonry and banana skins, the high-altitude parabolic result is that high-altitude parabolic occurs.
The high-altitude parabolic detection method comprises the steps of obtaining video information; the video information comprises moving foreground images; extracting a foreground image in video information; recognizing the foreground image by using a pre-trained high-altitude parabolic detection model to obtain an output image recognition type; based on the image recognition type, a high altitude parabolic result is determined. By adopting the technical scheme of the embodiment, the foreground image is extracted, then the foreground image is subjected to feature extraction and identification through the convolutional neural network, whether the foreground image is a parabola or not is finally determined, the specific type of the high-altitude parabola is determined, the difficulty of checking and searching the high-altitude parabola is reduced, the efficiency of high-altitude parabola judgment is improved, and the convenience of high-altitude parabola detection is improved.
In some optional embodiments, the foreground image is identified by using a pre-trained high-altitude parabolic detection model, and before the output image identification type is obtained, the high-altitude parabolic detection model needs to be trained, wherein the training process includes the following steps:
the method comprises the following steps: determining a training data set;
step two: and inputting the sample image and the corresponding sample identification type into a preset convolutional neural network model for training to obtain a high-altitude parabolic detection model.
Specifically, training data sets may be first determined, each training data set including a sample image and a corresponding sample identification type. The sample identification type comprises at least one of leaves, birds, plastic bottles, eggs, flowerpots, glass cups, masonry and banana skins. For example, when the sample identification type is a leaf, the corresponding training data set includes a large number of leaf images, when the sample identification type is a bird, the corresponding training data set includes a large number of bird images, when the sample identification type is a plastic bottle, the corresponding training data set includes a large number of plastic bottle images, and so on.
By classifying the training set into the above categories, when foreground image recognition is performed by using the trained high-altitude parabolic detection model, the obtained image recognition type is also in the above categories, namely, the image recognition type may be at least one of leaves, birds, plastic bottles, eggs, flowerpots, glass cups, masonry and banana peels.
After the training data set is determined, inputting the sample images and the corresponding sample identification types into a preset convolutional neural network model for training, specifically, the training data set can be divided into a test set, a training set and a verification set, the model can be trained by using the data of the training set, then the error on the test set is used as the generalization error of the final model in the real scene, the final effect of the model is verified by using the test set, and the high-altitude parabolic detection model is obtained.
Specifically, the training process is similar to the image recognition process of the trained high-altitude parabolic detection model, and specifically comprises the following steps:
because the sample images in the data set may have different resolutions, the sample images may be down-sampled to a size of 64 × 64, resulting in a down-sampled picture; then, local comparison normalization operation is carried out to obtain a local normalization picture; and then, dividing the local normalized picture into image blocks with a preset specification of 8 × 8 as input pictures. Firstly, inputting a convolution layer of a high-altitude parabolic detection model into each image block for feature extraction, and transforming the extracted features through an activation function to form a convolution feature map (response to the features of the input image); then, performing feature mapping by adopting a corresponding maximum pooling layer, and forming a pooling feature map by performing downsampling on the convolution feature map; and finally, carrying out vector transformation on the obtained pooled feature map by adopting a full-connection layer to form a feature vector, conveying the feature vector to a classification layer, classifying the image by utilizing a Softmax classifier so as to obtain the identification result of each image block, and comprehensively summing the identification results of all the image blocks to obtain an output result.
In some optional embodiments, if the high-altitude parabolic result is that high-altitude parabolic occurs, after determining the high-altitude parabolic result based on the image recognition type, the following steps may be further included:
a high altitude parabolic alert is generated.
Specifically, if the high-altitude object throwing is determined, a high-altitude object throwing alarm can be generated immediately to remind pedestrians under the building to evade in time, and the high-altitude object throwing and damaging are avoided.
In addition, the throwing point of the high-altitude parabolic object can be estimated according to the falling route of the high-altitude parabolic object, so that a resident of the high-altitude parabolic object can be locked, and the landing point of the high-altitude parabolic object can be predicted according to the falling route of the high-altitude parabolic object, so that pedestrians at the landing point can be reminded to dodge in time when the high-altitude parabolic object does not fall yet, and injury caused by the high-altitude parabolic object is avoided.
Optionally, by using the high-altitude parabolic detection method of this embodiment, a high-altitude parabolic detection experiment is performed on 1000 images including 700 high-altitude parabolic images and 300 non-parabolic images, and the experimental result is shown in table 1.
TABLE 1
As can be seen from table 1, the high altitude parabolic detection method of the present embodiment has a high recognition accuracy and a fast recognition time.
Optionally, the high-altitude parabolic detection method of the present embodiment is compared with the existing high-altitude parabolic detection algorithm — ViBe algorithm for comparison, the experimental data set is 700 images in total of parabolic images, and the experimental results are shown in table 2.
TABLE 2
As can be seen from table 2, the high-altitude parabolic detection method of the present embodiment has a higher recognition accuracy and is faster in time than the existing high-altitude parabolic detection algorithm.
Fig. 2 is a schematic structural diagram provided by an embodiment of the high altitude parabolic detection apparatus of the present invention.
The invention also provides a high-altitude parabolic detection device which is used for realizing the method embodiment.
As shown in fig. 2, the high altitude parabola detection device of the present embodiment includes:
an obtaining module 21, configured to obtain video information; the video information comprises moving foreground images;
the extraction module 22 is configured to extract a foreground image in the video information;
the recognition module 23 is configured to recognize the foreground image by using a pre-trained high-altitude parabolic detection model to obtain an output image recognition type;
and the determining module 24 is used for determining the high-altitude parabolic result based on the image recognition type.
In the high-altitude parabolic detection device of this embodiment, the acquisition module 21 includes video information of a moving foreground image; the extraction module 22 extracts foreground images in the video information; the recognition module 23 recognizes the foreground image by using a pre-trained high-altitude parabolic detection model to obtain an output image recognition type; the determination module 24 determines a high altitude parabolic result based on the image recognition type. By adopting the technical scheme of the embodiment, the foreground image is extracted, then the foreground image is subjected to feature extraction and identification through the convolutional neural network, whether the foreground image is a parabola or not is finally determined, the specific type of the high-altitude parabola is determined, the difficulty of checking and searching the high-altitude parabola is reduced, the efficiency of high-altitude parabola judgment is improved, and the convenience of high-altitude parabola detection is improved.
In some optional embodiments, the extracting module 22 is specifically configured to extract the foreground image from the video information by using a GarbCut algorithm.
In some optional embodiments, a training module is further included;
a training module for determining a training data set; each training data set comprises a sample image and a corresponding sample identification type; and inputting the sample image and the corresponding sample identification type into a preset convolutional neural network model for training to obtain a high-altitude parabolic detection model.
In some optional embodiments, the recognition module 23 is specifically configured to perform preprocessing on the foreground image to obtain an input image; and inputting the input image into a high-altitude parabolic detection model to obtain an image identification type.
In some optional embodiments, the identification module 23 is specifically configured to perform downsampling processing on the foreground image to obtain a downsampled picture; performing local normalization processing on the downsampled picture to obtain a local normalized picture; and dividing the local normalized picture into image blocks with preset specifications, and taking the image blocks as input pictures.
In some optional embodiments, the identification module 23 inputs each image block into the convolution layer of the high-altitude parabolic detection model, and performs feature extraction respectively; transforming the extracted features through an activation function to form a convolution feature map; forming a pooling feature map by downsampling the convolution feature map; performing vector transformation on the pooled feature map to form feature vectors; classifying the feature vectors by using a Softmax classifier to obtain an identification result; and integrating the identification results of all the image blocks to obtain the image identification type.
In some alternative embodiments, the sample identification types include at least one of leaves, birds, plastic bottles, eggs, flowerpots, glass cups, masonry, banana peels; correspondingly, the image identification type comprises at least one of leaves, birds, plastic bottles, eggs, flowerpots, glass cups, masonry and banana peels;
the determining module 24 is specifically configured to indicate that the high-altitude parabolic result is that high-altitude parabolic does not occur if the image recognition type includes leaves and/or birds; if the image recognition type comprises at least one of plastic bottles, eggs, flowerpots, glass cups, masonry and banana skins, the high-altitude parabolic result is that high-altitude parabolic occurs.
In some optional embodiments, further comprising an alarm module;
and if the high-altitude parabolic result is that high-altitude parabolic occurs, determining the high-altitude parabolic result based on the image identification type, and then generating a high-altitude parabolic alarm by using an alarm module.
With regard to the apparatus in the above-described embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.
Fig. 3 is a schematic structural diagram provided by an embodiment of the high altitude parabolic detection apparatus of the present invention.
Based on a general inventive concept, the present invention further provides a high altitude parabolic detection apparatus for implementing the above method embodiments.
As shown in fig. 3, the high altitude parabolic detection apparatus of the present embodiment includes a processor 31 and a memory 32, and the processor 31 is connected to the memory 32. Wherein, the processor 31 is used for calling and executing the program stored in the memory 32; the memory 32 is used for storing a program for executing at least the high altitude parabola detection method in the above embodiment.
It is understood that the same or similar parts in the above embodiments may be mutually referred to, and the same or similar parts in other embodiments may be referred to for the content which is not described in detail in some embodiments.
It should be noted that the terms "first," "second," and the like in the description of the present invention are used for descriptive purposes only and are not to be construed as indicating or implying relative importance. Further, in the description of the present invention, the meaning of "a plurality" means at least two unless otherwise specified.
Any process or method descriptions in flow charts or otherwise described herein may be understood as representing modules, segments, or portions of code which include one or more executable instructions for implementing specific logical functions or steps of the process, and alternate implementations are included within the scope of the preferred embodiment of the present invention in which functions may be executed out of order from that shown or discussed, including substantially concurrently or in reverse order, depending on the functionality involved, as would be understood by those reasonably skilled in the art of the present invention.
It should be understood that portions of the present invention may be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, the various steps or methods may be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, any one or combination of the following techniques, which are known in the art, may be used: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, an application specific integrated circuit having an appropriate combinational logic gate circuit, a Programmable Gate Array (PGA), a Field Programmable Gate Array (FPGA), or the like.
It will be understood by those skilled in the art that all or part of the steps carried by the method for implementing the above embodiments may be implemented by hardware related to instructions of a program, which may be stored in a computer readable storage medium, and when the program is executed, the program includes one or a combination of the steps of the method embodiments.
In addition, functional units in the embodiments of the present invention may be integrated into one processing module, or each unit may exist alone physically, or two or more units are integrated into one module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode. The integrated module, if implemented in the form of a software functional module and sold or used as a stand-alone product, may also be stored in a computer readable storage medium.
The storage medium mentioned above may be a read-only memory, a magnetic or optical disk, etc.
In the description herein, references to the description of the term "one embodiment," "some embodiments," "an example," "a specific example," or "some examples," etc., mean that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. In this specification, the schematic representations of the terms used above do not necessarily refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
Although embodiments of the present invention have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present invention, and that variations, modifications, substitutions and alterations can be made to the above embodiments by those of ordinary skill in the art within the scope of the present invention.