Detection Method, Device and Storage Medium for Moving Objects
By background modeling and parabolic fitting of multi-frame image data, and using the support vector machine model to identify objects thrown high altitudes, the problem of being unable to quickly and accurately identify the location of objects thrown high altitudes in the prior art, achieving efficient and accurate detection effects.
Patent Information
- Application Number
- CN202110843785.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-07-26
- Publication Date
- 2025-07-22
- Estimated Expiration
- 2041-07-26
AI Technical Summary
The prior art cannot quickly and accurately identify the location of the person throwing objects from high altitudes, resulting in difficulty in law enforcement.
By acquiring multi-frame image data, selecting areas of interest, conducting background modeling and moving object detection, using the support vector machine model to fit the parabola, and determining whether the parabola meets the preset threshold to determine the target moving object.
It realizes rapid and accurate identification of objects thrown at high altitude, improves detection accuracy and efficiency, and can accurately locate the position of those thrown at high altitude.
Smart Images

Figure CN113506315B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of automatic measurement technology, and in particular to a detection method, device and storage medium for a moving object. Background Art
[0002] With the development of economy and society, the buildings in cities are getting higher and higher. While solving the housing problem of urban residents, it also brings severe challenges. More and more uncivilized behaviors are staged in cities. Throwing objects down from high-rise buildings (high-altitude throwing) is called "the pain of the sky hanging over the city", which brings great hidden dangers to social security.
[0003] Since high-altitude throwing often occurs on high floors, there are few witnesses, and objects falling from high altitudes take a short time to fall, making it difficult to track the specific location of the thrower, which causes great trouble for law enforcement agencies. Therefore, how to quickly and accurately identify the location of the person who throws objects from high altitudes has become one of the problems that need to be solved urgently. Summary of the invention
[0004] In view of the above-mentioned shortcomings of the prior art, the purpose of the present application is to provide a moving object detection method, device and storage medium, which are used to solve the problem that the prior art cannot quickly and accurately identify the position of a person throwing objects from a high altitude.
[0005] To achieve the above-mentioned object and other related objects, the first aspect of the present application provides a method for detecting a moving object, the method comprising:
[0006] Acquire multiple frames of image data, and select a region of interest from the image data;
[0007] Performing background modeling on a region of interest in the image data to obtain a moving object;
[0008] Match two adjacent frames of images of moving objects with the same ID to obtain the motion trajectory of each moving object;
[0009] Perform parabola fitting on the motion trajectory of each moving object, and train each fitted parabola through the support vector machine model;
[0010] It is determined whether the training results of each parabola meet a preset threshold, and the moving object corresponding to the parabola meeting the preset threshold is determined as the target moving object.
[0011] In certain embodiments of the first aspect of the present application, before the step of performing background modeling on the region of interest in the image data to obtain a moving object, the method further includes:
[0012] Performing jitter detection on a region of interest in the image data, and processing the jittered image;
[0013] Perform enhancement processing on the image after jitter processing;
[0014] Performing background modeling on the region of interest in the image data to obtain a moving object includes: performing background modeling on the enhanced image to obtain the moving object.
[0015] In some embodiments of the first aspect of the present application, the step of performing background modeling on the region of interest in the image data to obtain a moving object includes:
[0016] Matching the image data with a preset image type, the preset image type including a first image type and a second image type;
[0017] When the image data is of the first image type, perform three-channel background modeling on the region of interest in the image data to obtain a moving object;
[0018] When the image data is of the second image type, perform single-channel background modeling on the region of interest in the image data to obtain a moving object.
[0019] In some embodiments of the first aspect of the present application, after the step of performing background modeling on the region of interest in the image data to obtain a moving object, it further includes:
[0020] Filter the obtained moving object to obtain a filtered moving object;
[0021] Perform morphological processing on the filtered moving object and obtain the target contour of each moving object;
[0022] Filter out the moving objects that do not conform to the preset morphology according to the target contour of the moving object.
[0023] In some embodiments of the first aspect of the present application, the step of matching the moving objects with the same ID in two adjacent frames of images to obtain the motion trajectories of each moving object includes:
[0024] Respectively obtain the position boxes of the moving objects with the same ID in two adjacent frames of images;
[0025] Obtain the intersection over union of the position boxes;
[0026] When the intersection over union is greater than a preset overlap threshold, confirm the motion trajectory of the moving object.
[0027] In some embodiments of the first aspect of the present application, after the step of determining the moving object corresponding to the parabola that satisfies the preset threshold as the target moving object, it further includes:
[0028] Obtain the initial coordinates and movement trajectory coordinates of the target moving object, and obtain the floor average height information;
[0029] Based on the initial coordinates of the target moving object and the floor average height information, obtain the floor position information of the target moving object;
[0030] Display the floor position information and movement trajectory coordinates of the target moving object.
[0031] In some embodiments of the first aspect of the present application, the step of obtaining the floor average height information includes:
[0032] Obtain the edge binary information of the floor through an edge detection algorithm;
[0033] Perform a Hough transform on the edge binary information to obtain the straight line information of the floor;
[0034] Determine whether the straight line information meets a preset line segment threshold;
[0035] Based on the straight line information that meets the preset line segment threshold, obtain the edge information of the floor;
[0036] Obtain the floor average height information according to the edge information.
[0037] In the second aspect of the present application, there is provided a detection device for a moving object, the device includes: an image acquisition module, configured to acquire multiple frames of image data and select a region of interest in the image data; a moving object acquisition module, configured to perform background modeling on the region of interest in the image data to obtain a moving object; a movement trajectory acquisition module, configured to match adjacent two frames of images of the moving object with the same ID to obtain the movement trajectories of each moving object; a fitting module, configured to perform parabolic fitting on the movement trajectories of each moving object and train each fitted parabola through a support vector machine model; a determination module, configured to determine whether the training results of each parabola meet a preset threshold, and determine the moving object corresponding to the parabola that meets the preset threshold as the target moving object.
[0038] In some embodiments of the second aspect of the present application, the device further includes:
[0039] An average height acquisition module, configured to acquire the initial coordinates and movement trajectory coordinates of the target moving object, and acquire the floor average height information;
[0040] A position information acquisition module, configured to obtain the floor position information of the target moving object based on the initial coordinates of the target moving object and the floor average height information;
[0041] A display module for displaying the floor position information and movement trajectory coordinates of the target moving object.
[0042] In a third aspect of the present application, a storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of the method as described above are implemented.
[0043] As described above, the method, device, and storage medium for detecting a moving object of the present application have the following beneficial effects:
[0044] In the present application, after obtaining multiple frames of image data, first an area of interest is selected from the image data, then background modeling is performed on the area of interest to obtain a moving object. The moving trajectories of moving objects with the same ID are matched for two adjacent frames of images to obtain the moving trajectories of each moving object. Then, the moving trajectories of each moving object are fitted, and a support vector machine model is used to train each parabola. The moving object whose parabola meets the preset threshold is determined as the target moving object. Through the method of the present application, the moving object can be accurately obtained from the image data, thereby reducing the interference of other objects and improving the detection accuracy of the moving object.
[0045] Furthermore, in the present application, after quickly and accurately obtaining the moving object, the floor height information of the moving object can also be obtained through the average height information of the floor and the initial coordinates of the moving object, so that the position information of the high-altitude thrower can be accurately and efficiently obtained, improving the detection accuracy and efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] Figure 1 It shows a schematic flowchart of Embodiment 1 of the method for detecting a moving object of the present application.
[0047] Figure 2 It shows a schematic flowchart of Embodiment 2 of the method for detecting a moving object of the present application.
[0048] Figure 3 It shows a schematic flowchart of Embodiment 3 of the method for detecting a moving object of the present application.
[0049] Figure 4 It shows a schematic structural diagram of Embodiment 1 of the device for detecting a moving object of the present application.
[0050] Figure 5 It shows a schematic structural diagram of Embodiment 2 of the device for detecting a moving object of the present application. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0051] The following specific embodiments illustrate the implementation manners of the present application. Those skilled in the art can easily understand the other advantages and effects of the present application from the content disclosed in this specification.
[0052] In the following description, reference is made to the accompanying drawings, which describe several embodiments of the present application. It should be understood that other embodiments may also be used, and mechanical composition, structure, electrical, and operational changes may be made without departing from the spirit and scope of the present disclosure. The following detailed description should not be considered restrictive, and the scope of the embodiments of the present application is only defined by the claims of the published patent. The terms used herein are only for describing specific embodiments and are not intended to limit the present application. Spatially related terms, such as "upper", "lower", "left", "right", "below", "beneath", "lower part", "above", "upper part", etc., may be used in the text to facilitate the description of the relationship between one element or feature shown in the figure and another element or feature.
[0053] Although in some instances the terms first, second, etc. are used herein to describe various elements, these elements should not be limited by these terms. These terms are only used to distinguish one element from another. Furthermore, as used herein, the singular forms "a", "an", and "the" are also intended to include the plural forms, unless the context indicates otherwise. It should be further understood that the terms "comprising", "including" indicate the presence of the described features, steps, operations, elements, components, items, types, and / or groups, but do not exclude the presence, occurrence, or addition of one or more other features, steps, operations, elements, components, items, types, and / or groups. The terms "or" and "and / or" used herein are interpreted as inclusive, or meaning any one or any combination. Thus, "A, B, or C" or "A, B, and / or C" means "any one of the following: A; B; C; A and B; A and C; B and C; A, B, and C". An exception to this definition only occurs when the combination of elements, functions, steps, or operations is inherently mutually exclusive in some way.
[0054] As described in the background art, the existing phenomenon of high-altitude parabolic is becoming more and more serious. To solve the problem that the position of the high-altitude thrower cannot be quickly and accurately identified in the prior art, the present application provides a method, device, and storage medium for detecting moving objects. By processing image data, it can be accurately known which are the objects thrown from high altitude and which are interfering objects, so as to perform accurate identification and improve the detection efficiency at the same time.
[0055] Embodiment 1
[0056] Please refer to Figure 1 , Figure 1 which shows a schematic flowchart of Embodiment 1 of the method for detecting moving objects of the present application. As Figure 1 shown, the method for detecting moving objects includes:
[0057] Step S10: Obtain multiple frames of image data and select a region of interest from the image data;
[0058] Step S20: Perform background modeling on the region of interest in the image data to obtain moving objects;
[0059] Step S30: Match two adjacent frames of images of moving objects with the same ID to obtain the motion trajectories of each moving object;
[0060] Step S40: Perform parabolic fitting on the motion trajectories of each moving object, and train each fitted parabola through a support vector machine model;
[0061] Step S50: Determine whether the training results of each parabola meet a preset threshold, and determine the moving objects corresponding to the parabolas that meet the preset threshold as target moving objects.
[0062] In a specific application, to detect objects dropped from a high altitude, multiple monitoring cameras can be installed to capture moving objects. That is to say, the multiple frames of image data in step S10 can be obtained through monitoring cameras. The route of the monitoring cameras and the selection of the models of the monitoring cameras do not limit the protection scope of this application.
[0063] After the image data is obtained through the monitoring camera, a region of interest (ROI) can be selected from the image data according to the installation scenario of the monitoring camera and the specific application. In this embodiment, the region to be processed (region of interest) can be selected in various ways such as a rectangle, a circle, an ellipse, an irregular polygon, etc. In this way, the difficulty of image processing can be effectively reduced and the image processing time can be reduced, thereby improving the efficiency and accuracy of subsequent processing.
[0064] Then, step S20 is executed to perform background modeling on the region of interest in the image data. In this embodiment, the background modeling methods include, but are not limited to: Single Gaussian, Mixture of Gaussian Model, Running Gaussian average, CodeBook, SOBS-Self-organization background subtraction, SACON, VIBE algorithm, Color-based background modeling method, Temporal Median filter, W4 method, Eigenbackground method, Kernel Density Estimation method, etc. In this embodiment, an improved VIBE algorithm is used for background modeling. The moving objects can be effectively detected through background modeling and foreground detection methods.
[0065] In this embodiment, the steps of step S20 for performing background modeling on the region of interest in the image data to obtain moving objects specifically include: matching the image data with a preset image type, where the preset image type includes a first image type and a second image type; when the image data is of the first image type, performing three-channel background modeling on the region of interest in the image data to obtain moving objects; when the image data is of the second image type, performing single-channel background modeling on the region of interest in the image data to obtain moving objects.
[0066] In practical applications, the image data obtained by the monitoring camera may be obtained during the day or at night; even for the image data obtained during the day, due to different weather conditions (such as sunny or cloudy days, etc.), the gray level or contrast of the image data will also be different. For the image data obtained at different time periods or in different weather conditions, if the same method is used for background modeling, the quality of the processed image will be low, thus affecting the subsequent detection accuracy. Therefore, in this embodiment, different image type classifications are performed on the image data. For example, the image data with normal brightness during the day can be set as the first image type; while the images with low brightness and low contrast during the day or the images obtained at night can be set as the second image type. Of course, the number of image type classifications and the classification basis can be set otherwise according to actual needs, which should not limit the protection scope of this application.
[0067] After matching the image data collected by the monitoring camera with the preset image types, different background modeling can be performed according to the matching results. If the obtained image data is of the first image type, three-channel (RGB) background modeling is performed on the region of interest in the image data. Specifically, the differences between the background and the foreground can be judged through the three RGB channels respectively, and finally, target fusion extraction is performed according to the distance information to complete the background modeling and the acquisition of moving objects. Conversely, if the obtained image data is of the second image type, single-channel background modeling is performed on the region of interest in the image data, that is, background modeling and extraction of moving objects can be performed through grayscale images. That is to say, if the obtained image is an image with normal brightness during the day, RGB three-channel background modeling is adopted to improve the detection effect; while if the obtained image is an infrared image at night or an image with low contrast during the day, single-channel background modeling is used to adapt to the detection effect of infrared images. By classifying the types of images and adopting different modeling methods, the accuracy of background modeling is effectively improved, and thus the final detection accuracy is greatly improved.
[0068] After obtaining the moving objects through background modeling, step S30 is executed: matching the moving objects with the same ID in two adjacent frames of images to obtain the motion trajectories of each moving object. Specifically, the position frames of the moving objects with the same ID in two adjacent frames of images are obtained respectively; the intersection over union (IOU) of the position frames is obtained; when the intersection over union is greater than the preset overlap threshold, the motion trajectory of the moving object is confirmed.
[0069] Then step S40 is executed for parabola fitting and training of the parabola. In specific applications, the least squares method or the random sample consensus algorithm, etc. can be used for parabola fitting. This application does not limit this. In this embodiment, the random sample consensus algorithm (RANSAC algorithm) is used to perform parabola fitting on the motion trajectories of each moving object. In the RANSAC algorithm, it is assumed that the sample contains correct data (inliers, data that can be described by the model) and also contains abnormal data (outliers, data that deviates far from the normal range and cannot adapt to the mathematical model), that is, the data set contains noise. These abnormal data may be caused by incorrect measurements, incorrect assumptions, incorrect calculations, etc. At the same time, RANSAC also assumes that given a set of correct data, there is a method to calculate the model parameters that conform to these data. Specifically, first consider a model with the potential of a minimum sampling set of n (n is the minimum number of samples required to initialize the model parameters) and a sample set P, where the number of samples in the set P, #(P)>n, and a subset S of P containing n samples is randomly selected from P to initialize the model M;
[0070] Secondly, the sample set in the complementary set SC = P\S with an error less than a certain set threshold t from the model M and S form S*. S* is considered the inlier set, and they form the consensus set of S;
[0071] Then, if #(S*) ≥ N, it is considered that the correct model parameters are obtained, and the new model M* is recalculated using methods such as least squares with the set S* (inliers); randomly select a new S and repeat the above process.
[0072] Finally, after a certain number of sampling times, if no consensus set is found, the algorithm fails; otherwise, the largest consensus set obtained after sampling is selected to judge the inliers and outliers, and the algorithm ends.
[0073] By using the RANSAC algorithm to fit the parabola-like curve, it has better robustness to image noise, is not affected by individual noises, and improves the fitting accuracy and efficiency.
[0074] After fitting the parabolas of each moving object, each parabola is input into a Support Vector Machine (SVM) model for training. As a binary classification model, the purpose of the support vector machine is to find a hyperplane to segment the samples. The principle of segmentation is to maximize the margin, which is ultimately transformed into a convex quadratic programming problem for solution. The specific model can include: when the training samples are linearly separable, a linearly separable support vector machine is learned by maximizing the hard margin; when the training samples are approximately linearly separable, a linear support vector machine is learned by maximizing the soft margin; when the training samples are linearly inseparable, a non-linear support vector machine is learned by using the kernel trick and maximizing the soft margin. The specific training process is similar to the prior art and will not be elaborated here.
[0075] After the training of each parabola is completed, step S50 is executed to determine whether the training results of each parabola meet a preset threshold, and the moving object corresponding to the parabola that meets the preset threshold is determined as the target moving object. Through the judgment process of step S50, the objects dropped from a high altitude and other interfering objects can be accurately distinguished. Specifically, the moving object corresponding to the parabola that meets the preset threshold is the object dropped from a high altitude (target moving object); while the moving object corresponding to the parabola that does not meet the preset threshold is an interfering object. In practical applications, the interfering object can be a floating plastic bag, an animal such as a flying bird or dragonfly, or a dripping water droplet, etc. Through the method of this embodiment, the interfering objects can be accurately distinguished, effectively avoiding their interference with the objects dropped from a high altitude, thereby greatly improving the detection accuracy. Of course, the preset threshold can be specifically set according to actual needs, and this application does not limit it.
[0076] The detection method of a moving object in this embodiment can effectively obtain the moving object through image processing, and accurately filter out the interference of other objects. Therefore, the detection accuracy is high, and no manual participation is required, greatly improving the detection efficiency.
[0077] Embodiment 2
[0078] Please refer to Figure 2 , Figure 2 which shows the schematic flow diagram of Embodiment 2 of the moving object detection method of this application. As Figure 2 shown, the detection method of the moving object includes:
[0079] Step S10: Obtain multiple frames of image data, and select a region of interest in the image data;
[0080] Step S61: Perform jitter detection on the region of interest in the image data, and process the jittery images;
[0081] Step S62: Perform enhancement processing on the images after jitter processing;
[0082] Step S21: Perform background modeling on the enhanced images to obtain the moving objects;
[0083] Step S71: Filter the obtained moving objects to obtain the filtered moving objects;
[0084] Step S72: Perform morphological processing on the filtered moving objects, and obtain the target contours of each moving object;
[0085] Step S73: Filter out the moving objects that do not conform to the preset morphology according to the target contours of the moving objects;
[0086] Step S30: Match two adjacent frames of images of the moving objects with the same ID to obtain the movement trajectories of each moving object;
[0087] Step S40: Perform parabolic fitting on the movement trajectories of each moving object, and train each fitted parabola through a support vector machine model;
[0088] Step S50: Judge whether the training results of each parabola meet the preset threshold, and determine the moving objects corresponding to the parabolas that meet the preset threshold as the target moving objects.
[0089] Compared with Embodiment 1, the difference in this embodiment is that after performing Step S10: Selecting a region of interest in the image data, and before performing the step of background modeling to obtain the moving objects, it further includes:
[0090] Step S61: Perform jitter detection on the region of interest in the image data and process the jittery images. Specifically, optical flow can be used to track stable feature points in the image data, and the positions of the stable feature points are used as reference positions; if it is detected that the position change in the image data exceeds the reference threshold of the stable feature points, it is determined that the screen is jittering; when it is detected that the screen is jittering, the background modeling is not updated to avoid treating the background as a target.
[0091] Step S62: Perform enhancement processing on the images after jitter processing. In this embodiment, enhancement processing can be performed through the CLAHE algorithm (Contrast Limited Adaptive Histogram Equalization). Specifically, the image data can be first divided into blocks. Taking each block as a unit, first calculate the histogram, then trim the histogram, and finally perform equalization; then perform linear interpolation between blocks. For example, each image block can be traversed and operated on. During the interpolation process, the CDF function can be obtained, and thus the corresponding brightness transformation function can be obtained. The calculation amount can be reduced through the interpolation process when calculating the transformation function; finally, perform a layer screen blending operation with the original image. Through the CLAHE algorithm, the (local) contrast of the image can be effectively enhanced or improved, thereby obtaining more edge information related to the image.
[0092] After performing enhancement processing on the images, execute Step S21: Perform background modeling on the enhanced images to obtain the moving objects. It should be noted that in this embodiment, the step of obtaining multiple frames of image data in Step S10 and selecting the region of interest in the image data is similar to Step S10 in Embodiment 1 and will not be elaborated here. Compared with Embodiment 1, the difference in this embodiment is further that after obtaining the moving objects through Step S21, it further includes:
[0093] Step S71: Filter the obtained images to obtain the filtered moving objects;
[0094] Step S72: Perform morphological processing on the filtered moving objects and obtain the target contours of each moving object;
[0095] Step S73: Filter out the moving objects that do not conform to the preset morphology according to the target contours of the moving objects.
[0096] In this embodiment, the neighborhood averaging method can be used to perform mean filtering on the moving object, that is, using the mean value to replace each pixel value in the original image. Specifically, a 3*3 mean filter can be used to filter the image to remove interference noise. For example, for the target pixel point A(x, y) to be processed, a filtering template is selected. The filtering template can be composed of several adjacent pixels. Calculate the mean value of all pixels in the template, and then assign this mean value to the current pixel point A(x, y) as the gray value g(x, y) of the processed image at this point, that is, g(x, y) = ∑f(x, y) / m; where m is the total number of pixels including the current pixel in the template. For example, 8 pixels surrounding the target pixel point A(x, y) can be selected to form a filtering template (including the target pixel itself), and then the average value of all pixels in the filtering template is used to replace the original pixel value. In practical applications, different numbers of pixel points can be selected to form the filtering template according to actual needs, and this application does not limit this. By performing mean filtering on the moving object, the noise points in the moving object can be removed, thereby improving the accuracy of the image data.
[0097] After obtaining the target contour of the moving object, compare the obtained target contour with the preset shape, and filter out the moving objects that do not conform to the preset shape; in other words, the moving objects whose target contours do not conform to the preset shape are not high-altitude dropped objects. Through the method of this embodiment, noise can be effectively filtered out, thereby greatly improving the detection efficiency and accuracy.
[0098] In this embodiment, after the filtering is completed through step S73, in step S30: match two adjacent frames of images of the moving objects with the same ID to obtain the motion trajectories of each moving object. In this embodiment, since the filtering of the moving objects is performed through step S73, in step S30 of this embodiment, only the moving objects whose target contours meet the preset shape are matched for two adjacent frames of images to obtain their corresponding motion trajectories; the moving objects that do not conform to the preset shape are no longer matched, thereby effectively reducing the detection amount and improving the detection efficiency.
[0099] The other steps S40 and S50 of this embodiment are similar to those in Embodiment 1 and will not be elaborated here. By adding jitter detection, enhancement processing, filtering, morphological processing, etc. to the image, this embodiment effectively reduces the noise in the image data, improves the quality of the image, and effectively improves the accuracy and efficiency of subsequent processing.
[0100] Embodiment 3
[0101] Please refer to Figure 3 , Figure 3 which shows the schematic flowchart of Embodiment 3 of the moving object detection method of this application, as Figure 3As shown, the method for detecting a moving object includes:
[0102] Step S10: Obtain multiple frames of image data, and select a region of interest in the image data;
[0103] Step S20: Perform background modeling on the region of interest in the image data to obtain a moving object;
[0104] Step S30: Match adjacent two frames of images of the moving object with the same ID to obtain the motion trajectories of each moving object;
[0105] Step S40: Perform parabolic fitting on the motion trajectories of each moving object, and train each fitted parabola through a support vector machine model;
[0106] Step S50: Determine whether the training results of each parabola meet a preset threshold, and determine the moving object corresponding to the parabola that meets the preset threshold as the target moving object;
[0107] Step S81: Obtain the initial coordinates, motion trajectory coordinates of the target moving object, and obtain the floor average height information;
[0108] Step S82: Obtain the floor position information of the target moving object based on the initial coordinates of the target moving object and the floor average height information;
[0109] Step S83: Display the floor position information and motion trajectory coordinates of the target moving object.
[0110] Compared with the first embodiment, after determining the target moving object in step S50, this embodiment executes step S81 to obtain the initial coordinates, motion trajectory coordinates of the target moving object, and obtain the floor average height information. Specifically, the step of obtaining the floor average height information includes: obtaining the edge binary information of the floor through an edge detection algorithm; performing a Hough transform on the edge binary information to obtain the line information of the floor; determining whether the line information meets a preset line segment threshold; obtaining the edge information of the floor based on the line information that meets the preset line segment threshold; obtaining the floor average height information according to the edge information.
[0111] In this embodiment, the Canny algorithm is preferably used to obtain the edge data of the floor; in a specific application, the obtained image data is usually an RGB image. At this time, it is necessary to first perform grayscale processing on the RGB image to convert it into a grayscale image. The specific implementation method of converting an RGB image into a grayscale image can be realized by using the prior art, and this application will not elaborate on it. After converting to a grayscale image, the edge information is extracted, and then the straight-line information in the image is obtained through the Hough transform. Since a straight line in the image space corresponds one-to-one with a point in the parameter space, and a straight line in the parameter space also corresponds one-to-one with a point in the image space. Therefore, each straight line in the image space corresponds to a single point in the parameter space to represent; any part of the line segment on the straight line in the image space corresponds to the same point in the parameter space. In this way, the straight-line information can be obtained by finding the peak value in the parameter space. In this embodiment, the straight-line information is obtained by finding the peak value in the parameter space through the Hough transform. After obtaining the straight-line information, it is determined whether the straight-line information meets the preset line segment threshold, such as a preset length threshold or / and a preset angle threshold. The preset length threshold or the preset angle threshold can be set according to actual needs. For example, the preset length threshold can be set to be greater than or equal to 0.3 times the maximum straight-line information length, and the preset angle threshold can be set to ±5°. In this way, when the angle of the straight-line information is too large, exceeding ±5°, it does not meet the preset line segment threshold; similarly, if the length of the straight-line information is less than 0.3 times the maximum straight-line information length obtained, it also does not meet the preset line segment threshold. By comparing the straight-line information with the preset line segment threshold, the truly useful straight-line information can be effectively screened out, and unnecessary noise can be filtered out, thereby improving the processing efficiency and accuracy.
[0112] After obtaining the floor average height information, dividing the initial coordinate (ordinate) of the target moving object by the floor average height information can accurately obtain the floor position information of the target moving object. Finally, the floor position information and the movement trajectory can also be displayed. The specific display form can be adaptively adjusted according to the specific application scenario, and this application does not limit it.
[0113] It should be noted that the steps S81, S82, and S83 involved in this embodiment can also be applied to Figure 2 the embodiment shown, that is, after Figure 2 the target moving object is determined in the step S50 shown, then the steps S81, S82, and S83 are sequentially executed to confirm the floor position information of the target moving object and display it. The specific working process is similar to the foregoing content and will not be elaborated here.
[0114] After obtaining the target moving object, the detection method of the moving object in this embodiment further obtains the initial coordinates of the target moving object and the average floor height information, and finally obtains the floor position information where the target moving object is located. The acquisition method is simple and fast, and can accurately locate the floor position information of the object dropped from a height, greatly improving its practicability.
[0115] This application also provides a storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the foregoing detection method of the moving object are implemented. The specific implementation process can refer to the specific description of the foregoing detection method of the moving object, and will not be elaborated here. It should be noted that the storage medium may include a USB flash drive, a disk, a floppy disk, an optical disc, a DVD, a hard disk, a flash memory, a CF card, an SD card, an MMC card, an SM card, etc., and this application does not limit this. In addition, the storage medium may be a separate component or a part of a certain electronic device. For example, the electronic device may include, but is not limited to, a laptop computer, a tablet computer, a mobile phone, a smart phone, a media player, a personal digital assistant (PDA), etc., and also includes a combination of two or more of them. The electronic device may include a memory, a memory controller, one or more processing units (CPUs), a peripheral interface, an RF circuit, an audio circuit, a speaker, a microphone, an input / output (I / O) subsystem, a touch screen, other output or control devices, and an external port. These components communicate through one or more communication buses or signal lines. The electronic device also includes a power supply system for powering various components. The power supply system may include a power management system, one or more power supplies (such as a battery, alternating current (AC)), a charging system, a power failure detection circuit, a power converter or inverter, a power status indicator (such as a light-emitting diode (LED)), and any other components associated with the generation, management, and distribution of electrical energy in a portable device.
[0116] Please refer to Figure 4 , Figure 4 which shows a schematic structural diagram of Embodiment 1 of the moving object detection device of this application. As Figure 4 shown, the moving object detection device includes:
[0117] An image acquisition module 10, configured to acquire multiple frames of image data and select a region of interest in the image data;
[0118] A moving object acquisition module 20, configured to perform background modeling on the region of interest in the image data to acquire a moving object;
[0119] A moving trajectory acquisition module 30, configured to match two adjacent frames of images of the moving object with the same ID to acquire the moving trajectories of each moving object;
[0120] The fitting module 40 is configured to perform parabolic fitting on the motion trajectories of each moving object, and train each fitted parabola through a support vector machine model;
[0121] The determination module 50 is configured to determine whether the training results of each parabola meet a preset threshold, and determine the moving object corresponding to the parabola that meets the preset threshold as the target moving object.
[0122] In this embodiment, the working processes of each module can refer to Figure 1 the detailed descriptions of the foregoing relevant steps, which will not be elaborated herein. Additionally, in other embodiments, the device may further include:
[0123] The jitter detection and processing module is configured to perform jitter detection on the region of interest in the image data acquired by the image acquisition module 10, and process the jittery image;
[0124] The enhancement processing module is configured to perform enhancement processing on the image after jitter processing;
[0125] The moving object acquisition module 20 is configured to perform background modeling on the enhanced image to acquire the moving object.
[0126] The specific working manners of the above jitter detection and processing module and enhancement processing module can refer to Figure 2 the detailed descriptions of the corresponding steps S61 to S62, which will not be elaborated herein.
[0127] Furthermore, the moving object detection device may further include:
[0128] The filtering module is configured to filter the moving object acquired by the moving object acquisition module 20 to obtain a filtered moving object;
[0129] The morphological processing module is configured to perform morphological processing on the filtered moving object and obtain the target contour of each moving object;
[0130] The screening module is configured to filter out the moving objects that do not conform to the preset form according to the target contour of the moving object. The working manners of the above filtering module, morphological processing module and screening module can refer to Figure 2 the detailed descriptions of the relevant steps S71 to S73, which will not be elaborated herein.
[0131] Please refer to Figure 5 , Figure 5 which shows the structural schematic diagram of the second embodiment of the moving object detection device of the present application. As Figure 5 shown, compared with Figure 4 the first embodiment shown, the device of this embodiment further includes:
[0132] An average height acquisition module 60 is configured to acquire the initial coordinates and movement trajectory coordinates of the target moving object, and acquire floor average height information;
[0133] A position information acquisition module 70 is configured to acquire the floor position information of the target moving object based on the initial coordinates of the target moving object and the floor average height information;
[0134] A display module 80 is configured to display the floor position information and movement trajectory coordinates of the target moving object.
[0135] In this embodiment, the specific working modes of the average height acquisition module 60, the position information acquisition module 70, and the display module 80 can refer to Figure 3 and the detailed descriptions in steps S81 to S83; other modules of this embodiment are similar to those of the first embodiment shown in Figure 4 and will not be elaborated here.
[0136] The method, device, and storage medium for detecting a moving object of the present application obtain a moving object by performing background modeling on an area of interest, then match two adjacent frames of images of the moving object with the same ID to obtain the movement trajectory of each moving object, then fit the movement trajectories of each moving object, and train each parabola through a support vector machine model, and determine the moving object whose parabola meets a preset threshold as the target moving object. Through the method of the present application, a moving object can be accurately obtained from image data, thereby reducing the interference of other objects and improving the detection accuracy of the moving object. At the same time, after quickly and accurately obtaining the moving object in the present application, the floor height information of the moving object can also be obtained through the average height information of the floor and the initial coordinates of the moving object, so that the position information of the high-altitude thrower can be accurately and efficiently obtained, improving the detection accuracy and efficiency.
[0137] The above embodiments are only illustrative of the principles and effects of the present application, and are not used to limit the present application. Any person familiar with this technology can modify or change the above embodiments without departing from the spirit and scope of the present application. Therefore, all equivalent modifications or changes completed by those with ordinary knowledge in the technical field without departing from the spirit and technical idea disclosed by the present application should still be covered by the claims of the present application.
Claims
1. A method for detecting a moving object, characterized in that, Including: Obtain multiple frames of image data, and select a region of interest in the image data; Perform jitter detection on the region of interest in the image data, and process the jittery images; wherein, use optical flow to track stable feature points in the image data, and if the position change of the stable feature points in the image data is greater than a reference threshold, it is determined that the screen is jittering; when it is detected that the screen is jittering, the background modeling is not updated; Enhance the image after jitter processing through the CLAHE algorithm; Perform background modeling on the region of interest in the image data to obtain moving objects; wherein, perform background modeling on the enhanced image to obtain the moving objects; Match adjacent two-frame images of the moving objects with the same ID to obtain the motion trajectories of each moving object; Perform parabola fitting on the motion trajectories of each moving object through the RANSAC algorithm, and train each fitted parabola through a support vector machine model; Judge whether the training results of each parabola meet a preset threshold, and determine the moving objects corresponding to the parabolas that meet the preset threshold as target moving objects; the target moving objects are objects dropped from a high altitude.
2. The method according to claim 1, wherein The step of performing background modeling on the region of interest in the image data to obtain moving objects includes: Match the image data with a preset image type, and the preset image type includes a first image type and a second image type; When the image data is of the first image type, perform three-channel background modeling on the region of interest in the image data to obtain moving objects; When the image data is of the second image type, perform single-channel background modeling on the region of interest in the image data to obtain moving objects.
3. The method according to claim 1, wherein After the step of performing background modeling on the region of interest in the image data to obtain moving objects, it further includes: Filter the obtained moving objects to obtain filtered moving objects; Perform morphological processing on the filtered moving objects, and obtain the target contours of each moving object; Filter out the moving objects that do not conform to the preset morphology according to the target contours of the moving objects.
4. The method according to claim 1, characterized in that The step of matching adjacent two-frame images of the moving objects with the same ID to obtain the motion trajectories of each moving object includes: Respectively obtain the position frames of the moving objects with the same ID in adjacent two-frame images; Obtain the intersection over union of the position frames; When the intersection over union is greater than a preset overlap threshold, confirm the motion trajectory of the moving object.
5. The method according to claim 1, wherein After the step of determining the moving objects corresponding to the parabolas that meet the preset threshold as target moving objects, it further includes: Obtain the initial coordinates, motion trajectory coordinates of the target moving object, and obtain the floor average height information; Obtain the floor position information of the target moving object based on the initial coordinates of the target moving object and the floor average height information; Display the floor position information and motion trajectory coordinates of the target moving object.
6. The method according to claim 5, wherein The step of obtaining the floor average height information includes: Obtain the edge binary information of the floor through an edge detection algorithm; Perform Hough transform on the edge binary information to obtain the straight line information of the floor; Determine whether the straight line information meets the preset line segment threshold; Obtain the edge information of the floor based on the straight line information that meets the preset line segment threshold; Obtain the average floor height information according to the edge information.
7. A detection device for a moving object, characterized in that, It includes: An image acquisition module, configured to acquire multiple frames of image data and select a region of interest in the image data; A jitter detection and processing module, configured to perform jitter detection on the region of interest in the image data and process the jittery images; wherein, stable feature points in the image data are tracked using optical flow. If the position change of the stable feature points in the image data is greater than a reference threshold, it is determined that the picture is jittery; when it is detected that the picture is jittery, the background model is not updated; An enhancement processing module, configured to perform enhancement processing on the jitter-processed images through the CLAHE algorithm; a moving object acquisition module, configured to perform background modeling on the region of interest in the image data to obtain moving objects; wherein, background modeling is performed on the enhanced images to obtain moving objects; A motion trajectory acquisition module, configured to match adjacent two frames of images of moving objects with the same ID to obtain the motion trajectories of each moving object; A fitting module, configured to perform parabolic fitting on the motion trajectories of each moving object through the RANSAC algorithm and train each fitted parabola through a support vector machine model; A determination module, configured to determine whether the training results of each parabola meet the preset threshold, and determine the moving objects corresponding to the parabolas that meet the preset threshold as target moving objects; the target moving objects are objects dropped from a high altitude.
8. The device according to claim 7, characterized in that, The device further includes: An average height acquisition module, configured to obtain the initial coordinates, motion trajectory coordinates of the target moving object, and obtain the average floor height information; A position information acquisition module, configured to obtain the floor position information of the target moving object based on the initial coordinates of the target moving object and the average floor height information; A display module, configured to display the floor position information and motion trajectory coordinates of the target moving object.
9. A storage medium, on which a computer program is stored, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Method and device of video abstraction generation
CN103096185A
Moving object detection method
CN103456028A
Method and device for detecting high-altitude parabolic event and intelligent floor monitoring system
CN112016414A
High-altitude parabolic detection and recognition method and system based on machine vision
CN112257557A
High-altitude parabolic detection method
CN112509012A