Detailed Description
In order to make the objects, technical solutions and effects of the present invention clearer and clearer, the present invention is further described in detail below with reference to the accompanying drawings and examples.
The object detection method provided by the application detects the candidate moving objects in the acquired image by using the image acquisition equipment, and determines whether the object is a target object to be detected in the scene or not based on the motion reference value of each candidate moving object. The object detection method provided by the application can be applied to object detection in various scenes, such as high-altitude parabolic detection. At present, in high altitude parabolic detection, a lens used for detecting a high altitude parabolic camera is usually installed on the ground and faces upward to a reference building, and is limited by the installation mode of the camera and the height of the reference building, the monitoring range of the camera is large, the pixel proportion of a target in an image is very small, for example, the pixel proportion of 800W high altitude parabolic camera is only 20 × 20 pixels or less, and in a single frame of image, human eyes cannot distinguish whether the target is a real parabolic camera or other interference objects. Therefore, the high-altitude parabolic detection method includes the steps that a binocular camera is used for obtaining a reference building and a foreground image of the reference building, all moving objects in the image are identified, the binocular parallax of the binocular camera is used for keeping away from the distance between the moving objects and the reference building, in consideration of the fact that in actual life, the high-altitude parabolic objects are within a certain range of the distance from the reference building, the moving objects far away from the reference building are judged to be non-high-altitude parabolic objects, the detection rate is improved, and false alarms are reduced. In the following embodiments, the high altitude parabolic detection method is described as an example, but is not limited to this object.
Referring to fig. 1, fig. 1 is a schematic flow chart of an object detection method according to an embodiment of the present disclosure. It should be noted that, if the result is substantially the same, the flow sequence shown in fig. 1 is not limited in this embodiment. As shown in fig. 1, the present embodiment includes:
s110: a set of images is acquired.
The method comprises the steps of shooting images of a reference building and a foreground thereof through an image acquisition device to obtain an image set, wherein the image set comprises at least one of image subsets acquired from different angles and depth images containing depth information. In an embodiment, when high-altitude projectile detection is performed, the image acquisition equipment can select a binocular camera, wherein a left camera of the binocular camera shoots a first binocular image to be detected, and a right camera shoots a second binocular image to be detected. When the binocular cameras are used for distance measurement, the two cameras are optionally placed in parallel, so that the imaging planes of the two cameras are approximately kept on the same horizontal plane, and further the measurement error is reduced. In the present embodiment, the camera device is not particularly limited to the device that acquires binocular image data, and only needs to be a parallel binocular stereo camera.
S130: each moving object candidate in the image set is detected.
The image set comprises a reference building and foreground objects of the reference building, wherein the foreground objects comprise static objects and moving objects, the moving candidate objects comprise objects which move under the traction of gravity, the detection is carried out on the moving candidate objects in the image set, a foreground image of each moving candidate object is obtained, and the object detection with the movement trend is marked. Each moving object candidate may be detected by a motion detection method such as an inter-frame difference method, a background difference method, and an optical flow method, and the specific detection method is not limited herein.
S150: motion reference values for respective motion candidate objects are determined based on the set of images.
The method comprises the steps of utilizing a reference building in an image set shot by a binocular camera and each marked candidate moving object to calculate a motion reference value of each candidate moving object, wherein the motion reference value comprises at least one of a first distance and a second distance of the corresponding candidate moving object, the first distance is determined based on the position relation between the corresponding candidate moving object and the reference building, and the second distance is determined based on the position relation between the corresponding candidate moving object and image acquisition equipment.
S170: and determining whether each candidate moving object contains the target object or not based on the motion reference value of each candidate moving object.
The velocity of the target object in the first direction is not zero based on the velocity component of the motion of the image set, and the velocity of the target object in the second direction is not zero, and the first direction is perpendicular to the second direction. In one embodiment, the first direction is a horizontal direction and the second direction is a vertical direction. In an actual scene, the binocular camera is far away from a reference building, candidate moving objects with various distances from the reference building to the camera are collected in a shot image, only the candidate moving objects within a certain distance range of the reference building are target objects, namely high-altitude parabolas, and the candidate moving objects far away from the reference building are not the high-altitude parabolas. And presetting a first distance threshold according to the actual situation, and judging that the moving object is a non-high-altitude parabola when the first distance between the moving object and the reference building is greater than the first distance threshold. And when the distance between the camera and the reference building is a fixed value, presetting a second distance threshold value according to the actual situation, and when the third distance between the moving object and the camera is smaller than the second distance threshold value, judging that the moving object is a non-high altitude parabola.
In the embodiment, the binocular camera is used for acquiring the reference building and the foreground image of the reference building, all moving objects in the image are identified, the binocular parallax of the binocular camera is used for calculating the distance between the moving objects and the reference building in a far-away mode, the fact that the high-altitude object is within a certain range of the reference building in actual life is considered, the moving objects far away from the reference building are judged to be non-high-altitude objects, the detection rate is improved, and false alarms are reduced.
Referring to fig. 2, fig. 2 is a schematic flow chart of another object detection method according to an embodiment of the present disclosure. It should be noted that, if the result is substantially the same, the flow sequence shown in fig. 2 is not limited in this embodiment. As shown in fig. 2, the present embodiment includes:
s210: a set of images is acquired.
S230: each moving object candidate in the image set is detected.
And detecting each candidate moving object in the image set to obtain a foreground image of the candidate moving object. The moving object can be detected by using a motion detection method such as an inter-frame difference method, a background difference method, an optical flow method, or the like. In one embodiment, the moving object is detected by using an inter-frame difference method, gray values of two adjacent frames or three adjacent frames of binocular images to be detected are obtained, an absolute value of a difference value of the gray values of the two frames of binocular images to be detected is calculated, when the absolute value is greater than or equal to a preset value, the object is determined to be the moving object, and when the absolute value is less than the preset value, the target is determined to be a non-moving object. In another embodiment, a moving object is detected by using a background difference method, and a binocular image to be detected is compared with a background reference image to learn to determine the moving object. In another embodiment, an optical flow method is used to detect a moving object, and when the optical flow value of an object is greater than or equal to a preset value, the object is determined to be a moving object, and when the optical flow value of an object is less than the preset value, the object is determined to be a stationary object.
And acquiring coordinates of the moving object by using a connected labeling algorithm, and detecting and labeling the target with the motion trend. In the embodiment, the pixel points belonging to the same moving object are marked by using a connected marking algorithm, and the moving object is framed by using a moving frame to obtain the coordinates of the moving object frame.
S250: and acquiring a local area image containing each candidate moving object in the image set, and identifying each candidate moving object to obtain the object type of each candidate moving object.
The local area image contains a moving object candidate. In this embodiment, the local area image of the candidate moving object included in step S230 may be directly acquired and the candidate moving object may be identified, or the candidate moving object in step S230 may be further screened and then the screened candidate moving object may be identified.
Referring to fig. 3, fig. 3 is a flowchart illustrating a method for identifying a candidate moving object according to an embodiment of the present disclosure. It should be noted that, if the result is substantially the same, the flow sequence shown in fig. 3 is not limited in this embodiment. As shown in fig. 3, the present embodiment includes:
s310: and tracking each candidate moving object by using a tracking algorithm to obtain the motion track of each candidate moving object.
S330: and screening each candidate moving object by utilizing the motion trail.
The candidate moving object comprises a high-altitude parabola and a non-high-altitude parabola, different motion tracks of the high-altitude parabola and the non-high-altitude parabola exist, and the candidate moving object is determined not to comprise the high-altitude parabola in response to the fact that the motion tracks do not meet preset parabola motion conditions. And screening all candidate moving objects which possibly meet the parabolic motion trail, and carrying out subsequent processing. In one embodiment, the preset parabolic motion condition is that the acceleration of the vertical downward motion component of the candidate moving object is gravity acceleration and the motion trajectory duration is greater than a preset time. And analyzing the motion trail of the candidate moving object, keeping the candidate moving object of which the acceleration of the vertical downward motion component is the gravity acceleration and the motion trail duration is longer than the preset time, judging other candidate moving objects which do not meet the parabolic motion condition as non-high altitude parabolas, and discarding the moving object.
S350: and acquiring the local area image of the candidate moving object after screening, and identifying the candidate moving object to obtain the object type of the candidate moving object.
And obtaining a local area image of the candidate moving object according to a candidate moving object frame obtained by motion detection, wherein the local area image comprises the complete candidate moving object. And classifying and identifying the candidate moving objects in the local area image by using a deep learning algorithm. The moving object candidates are classified into identifiable objects and unidentifiable objects, wherein whether the object that can be accurately identified is a preset object type is further determined. The preset object types comprise objects which can be parabolic, such as plastic bottles, glass bottles, flowerpots, food and the like, and the non-preset object types comprise objects which can not be parabolic, such as leaves, catkins, flying birds, insects and the like. In the embodiment, in order to ensure the accuracy of deep learning classification recognition, the object type recognition is respectively carried out on the multi-frame images of the two to-be-processed binocular images.
In the embodiment, the candidate moving objects which do not meet the parabolic motion rule are determined to be non-parabolic by tracking the trajectory of the candidate moving objects and utilizing the motion characteristics of parabolic motion and non-parabolic motion, data of the candidate moving objects are discarded, and the object types are identified in the candidate moving objects after further screening, so that the number of the candidate moving objects to be identified is small, and the identification accuracy is high. Meanwhile, in the embodiment, the moving object detection and deep learning target classification technology is combined, the parabolic object with the extremely small pixels can be detected, meanwhile, some non-parabolic objects with clear images and definite types are filtered, accurate identification can be achieved, and the detection rate is improved.
S270: obtaining a second distance between the candidate moving object and the image acquisition device; and calculating the difference value of the second distance and the third distance to obtain the first distance.
At the time of binocular camera installation, a third distance from the reference building has been determined. And calculating a disparity map with depth information by using the candidate moving object acquired from the two to-be-processed binocular images according to a binocular disparity principle by using the binocular camera, and calculating to obtain a third distance between the candidate moving object and the binocular camera. In an embodiment, further, a difference between the second distance and the third distance is calculated to obtain a first distance between the candidate moving object and the reference building.
Referring to fig. 4, fig. 4 is a schematic view illustrating installation of a binocular camera according to an embodiment of the present disclosure. As shown in the figure, the left side is a reference building C to be detected, the right side is an installed binocular camera B, when the binocular camera B is installed, it is confirmed that a second distance between the binocular camera B and the reference building C is S, the binocular camera B is used for shooting a binocular image to be processed, for a moving object a in the image, a third distance between the binocular camera B and the moving object a is calculated to be M by using binocular parallax distance, a first distance between the moving object a and the reference building C is calculated by using the second distance and the third distance, and the first distance is obtained to be N, wherein N is S-M.
In the embodiment of the present application, step S250 and step S270 may be performed simultaneously without interfering with each other, or step S250 may be performed first and step S270 may be performed later, or step S270 may be performed first and step S250 may be performed later. The specific execution order is not limited herein.
S290: and judging whether the candidate moving object is the target object by using the object type and the first distance or by using the object type and the third distance.
When the object type is identified, the specific type of the candidate moving object may not be identified due to the small target pixel, or the identification has an error, and the identification types of the same candidate moving object in the multi-frame image are different, so that whether the candidate moving object is the target object cannot be accurately obtained only by using the object type. Meanwhile, when the first distance or the third distance is determined, the positions of some non-parabolic moving objects are random and may be located at positions close to the reference building, such as birds and leaves, which may interfere with the determination of the target object. Therefore, the method combines the object type of the moving object and the first distance or the third distance between the moving object and the reference building, and judges whether the moving object is the target object by utilizing the comprehensive logic.
Before the combination judgment is performed, the data may be preprocessed, in an embodiment, the object type of the moving candidate in the image set and the first distance between the moving candidate and the reference building are obtained, whether the object type data and the first distance data are abnormal or not is detected, and if the data are abnormal, the data are discarded.
In one embodiment, in response to the object type not being the preset object type or the first distance being greater than the preset distance, determining that the moving object candidate is not the target object; and judging that the candidate moving object is a target object, namely a high altitude parabola, in response to the fact that the object type is a preset object type and the first distance is smaller than or equal to the preset distance.
In another embodiment, in response to the object type not being the preset object type or the third distance being smaller than the preset distance, it is determined that the moving object candidate is not the target object; and in response to the object type being the preset object unfortunately and the third distance being greater than or equal to the preset distance, determining that the moving object candidate is the target object, i.e., the high altitude parabola.
In another embodiment, the probability that the moving object contains the target object and does not contain the moving object is calculated by using a voting method in combination with a plurality of frames of binocular images to be processed, and a result with higher probability is selected as a judgment result.
When the target object in the image set is detected, namely the high-altitude object exists, the image is stored in the operation background and an alarm is given.
In the embodiment, all moving objects in the image set are detected firstly, so that missing detection is reduced, and meanwhile, the object type identification and the distance calculation between the moving objects and a reference building are carried out on the moving objects. When the object type is identified, the motion characteristics of a parabolic motion and a non-parabolic motion are considered, the complete motion track of the moving object is utilized, the moving object which does not meet the parabolic motion rule is judged to be the non-parabolic motion, data of the moving object is discarded, the object type is identified by using a deep learning algorithm after primary screening is carried out, the identification number is reduced, and the identification efficiency and the identification accuracy are improved. The method can detect the parabolic target with the minimum pixel, and simultaneously filter some non-parabolic targets with clear images and definite types, so that the method can accurately identify and improve the detection rate. For small or unclear targets which cannot be identified by deep learning, a moving object far away from a reference building is filtered by using the binocular parallax principle of a binocular camera. Finally, the method and the device are combined with object type identification and distance calculation to comprehensively judge whether the moving object is a parabolic event, so that misjudgment caused by errors when a single judging method is used can be avoided, the detection rate can be improved, and false alarm can be reduced.
Referring to fig. 5, fig. 5 is a schematic structural diagram of an object detection device according to an embodiment of the present disclosure. In this embodiment, the high altitude parabolic detection device includes anacquisition module 51, adetection module 52, acalculation module 53 and ajudgment module 54.
The obtainingmodule 51 is configured to obtain an image set; thedetection module 52 is configured to detect each of the candidate moving objects in the image set; thecalculation module 53 is configured to determine a motion reference value for each candidate moving object based on the image set; the judgingmodule 54 is configured to determine whether each of the candidate moving objects includes the target object based on the reference value of the hungry motion of each of the candidate moving objects. The object detection device identifies all moving objects in the image by acquiring the reference building and the foreground image of the reference building, calculates the distance between the moving object and the reference building, and judges whether the target object is included according to the distance between the reference building and the moving object in consideration of the actual life so as to reduce false alarm.
Referring to fig. 6, fig. 6 is a schematic structural diagram of an object detection apparatus according to an embodiment of the present disclosure. In this embodiment, theobject detection device 61 comprises aprocessor 62.
Theprocessor 62 may also be referred to as a CPU (Central Processing Unit). Theprocessor 62 may be an integrated circuit chip having signal processing capabilities. Theprocessor 62 may also be a general purpose processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other programmable logic device, discrete gate or transistor logic, discrete hardware components. A general purpose processor may be a microprocessor or theprocessor 62 may be any conventional processor or the like.
The object-detectingdevice 61 may further include a memory (not shown) for storing instructions and data required for theprocessor 62 to operate.
Theprocessor 62 is configured to execute instructions to implement the methods provided by any of the embodiments of object detection and any non-conflicting combinations described above.
Referring to fig. 7, fig. 7 is a schematic structural diagram of a computer-readable storage medium according to an embodiment of the present disclosure. The computerreadable storage medium 71 of the embodiments of the present application stores instructions/program data 72 that when executed implement the methods provided by any of the embodiments of the object detection methods of the present application, as well as any non-conflicting combinations. The instructions/program data 72 may form a program file stored in thestorage medium 71 in the form of a software product, so as to enable a computer device (which may be a personal computer, a server, or a network device) or a processor (processor) to execute all or part of the steps of the method according to the embodiments of the present application. And theaforementioned storage medium 71 includes: various media capable of storing program codes, such as a usb disk, a mobile hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, or terminal devices, such as a computer, a server, a mobile phone, and a tablet.
In the several embodiments provided in the present application, it should be understood that the disclosed system, apparatus and method may be implemented in other manners. For example, the above-described apparatus embodiments are merely illustrative, and for example, a division of a unit is merely a logical division, and an actual implementation may have another division, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The above description is only an embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes performed by the present specification and drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.