CN115984898A - Object detection method, object detection device, storage medium, and electronic device - Google Patents

Object detection method, object detection device, storage medium, and electronic device Download PDF

Info

Publication number
CN115984898A
CN115984898A CN202211708519.6A CN202211708519A CN115984898A CN 115984898 A CN115984898 A CN 115984898A CN 202211708519 A CN202211708519 A CN 202211708519A CN 115984898 A CN115984898 A CN 115984898A
Authority
CN
China
Prior art keywords
target
frame
picture
determining
pictures
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211708519.6A
Other languages
Chinese (zh)
Inventor
王文超
张朋
郑春煌
周祥明
鲁逸峰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhejiang Dahua Technology Co Ltd
Original Assignee
Zhejiang Dahua Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhejiang Dahua Technology Co Ltd filed Critical Zhejiang Dahua Technology Co Ltd
Priority to CN202211708519.6A priority Critical patent/CN115984898A/en
Publication of CN115984898A publication Critical patent/CN115984898A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Image Analysis (AREA)

Abstract

The embodiment of the invention provides an object detection method, an object detection device, a storage medium and an electronic device, wherein the method comprises the following steps: under the condition that a target sensor detects that a target type object appears in a target area, acquiring a real-time video stream obtained by shooting the target area by target shooting equipment; determining whether a moving target object appears in a target area in a real-time video stream, wherein the type of the target object is a target type; and under the condition that the moving target object appears in the target area, sending a target signal, wherein the target signal is used for prompting the moving target object appearing in the target area. The embodiment of the invention solves the problem of low accuracy of object detection in the related technology.

Description

Object detection method, object detection device, storage medium, and electronic device
Technical Field
The embodiment of the invention relates to the technical field of human shape detection, in particular to an object detection method, an object detection device, a storage medium and an electronic device.
Background
In recent years, human shape detection is used for detecting and reporting human shape target intrusion events occurring in the detection range of equipment, and is commonly used for unattended monitoring video and automatic alarm. Currently, most human body detection is performed by infrared motion detection through an infrared sensor. However, the infrared sensor is easily interfered by various heat sources and light sources, and when the ambient temperature is close to the temperature of the human body, the sensitivity of detection is reduced, and a false alarm phenomenon is easily generated. Therefore, the related art has a problem that the accuracy of object detection is not high.
Aiming at the problem of low accuracy of object detection in the related technology, no effective solution is provided at present.
Disclosure of Invention
The embodiment of the invention provides an object detection method, an object detection device, a storage medium and an electronic device, and aims to at least solve the problem that the accuracy of object detection is low in the related technology.
According to an embodiment of the present invention, there is provided an object detection method including: under the condition that a target sensor detects that a target type object appears in a target area, acquiring a real-time video stream obtained by shooting the target area by target shooting equipment; determining whether a moving target object appears in the target area in the real-time video stream, wherein the type of the target object is the target type; and sending a target signal under the condition that the moving target object appears in the target area, wherein the target signal is used for prompting the moving target object appearing in the target area.
According to still another embodiment of the present invention, there is also provided an object detection apparatus including: the acquisition module is used for acquiring a real-time video stream acquired by shooting a target area by target shooting equipment under the condition that a target sensor detects an object of a target type in the target area;
a determining module, configured to determine whether a moving target object appears in the target area in the real-time video stream, where a type of the target object is the target type;
a sending module, configured to send a target signal when it is determined that the moving target object appears in the target area, where the target signal is used to prompt that the moving target object appears in the target area.
According to a further embodiment of the present invention, there is also provided a computer-readable storage medium having a computer program stored thereon, wherein the computer program is arranged to perform the steps of any of the above method embodiments when executed.
According to yet another embodiment of the present invention, there is also provided an electronic device, comprising a memory in which a computer program is stored and a processor configured to run the computer program to perform the steps of any of the method embodiments described above.
According to the invention, under the condition that the target sensor detects that the target type object appears in the target area, a prompt signal is not directly sent to a worker or a user, but whether the moving target object appears in the target area is further judged according to the real-time video stream, and the judgment result of the target sensor is screened, so that the false alarm caused by the interference of the target sensor is reduced, the problem of low object detection accuracy in the related technology is solved, and the effect of improving the object detection accuracy is achieved.
Drawings
Fig. 1 is a block diagram of a hardware structure of a mobile terminal of an object detection method according to an embodiment of the present invention;
FIG. 2 is a flow chart of an object detection method according to an embodiment of the invention;
FIG. 3 is a schematic diagram of a binary image according to an embodiment of the invention;
FIG. 4 is a schematic diagram of a target box mapped into a binary image according to an embodiment of the invention;
FIG. 5 is a schematic diagram of an RTOS system architecture according to a specific embodiment of the present invention;
FIG. 6 is a schematic overall flow chart of object detection according to an embodiment of the present invention;
fig. 7 is a block diagram of a structure of an object detecting apparatus according to an embodiment of the present invention.
Detailed Description
Hereinafter, embodiments of the present invention will be described in detail with reference to the accompanying drawings in conjunction with the embodiments.
It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order.
The method embodiments provided in the embodiments of the present application may be executed in a mobile terminal, a computer terminal, or a similar computing device. Taking the operation on the mobile terminal as an example, fig. 1 is a block diagram of a hardware structure of the mobile terminal of the object detection method according to the embodiment of the present invention. As shown in fig. 1, the mobile terminal may include one or more (only one shown in fig. 1) processors 102 (the processor 102 may include, but is not limited to, a processing device such as a microprocessor MCU or a programmable logic device FPGA), and a memory 104 for storing data, wherein the mobile terminal may further include a transmission device 106 for communication functions and an input-output device 108. It will be understood by those skilled in the art that the structure shown in fig. 1 is only an illustration, and does not limit the structure of the mobile terminal. For example, the mobile terminal may also include more or fewer components than shown in FIG. 1, or have a different configuration than shown in FIG. 1.
The memory 104 may be used to store computer programs, for example, software programs and modules of application software, such as computer programs corresponding to the object detection method in the embodiment of the present invention, and the processor 102 executes various functional applications and data processing by running the computer programs stored in the memory 104, so as to implement the method described above. The memory 104 may include high speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include memory located remotely from the processor 102, which may be connected to the mobile terminal over a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The transmission device 106 is used for receiving or transmitting data via a network. Specific examples of the network described above may include a wireless network provided by a communication provider of the mobile terminal. In one example, the transmission device 106 includes a Network adapter (NIC), which can be connected to other Network devices through a base station so as to communicate with the internet. In one example, the transmission device 106 may be a Radio Frequency (RF) module, which is used to communicate with the internet in a wireless manner.
In the present embodiment, an object detection method is provided, and fig. 2 is a flowchart of an object detection method according to an embodiment of the present invention, as shown in fig. 2, the flowchart includes the following steps:
step S202, under the condition that a target sensor detects that a target type object appears in a target area, acquiring a real-time video stream obtained by shooting the target area by a target shooting device;
step S204, determining whether a moving target object appears in the target area in the real-time video stream, wherein the type of the target object is the target type;
step S206, sending a target signal when it is determined that the moving target object appears in the target area, where the target signal is used to prompt that the moving target object appears in the target area.
In this embodiment, the target sensor is an infrared sensor, the body temperature of a person is generally 36-37 degrees, the infrared sensor can emit infrared rays with specific wavelength about 10um, the infrared sensor captures the wavelength in a specific range in real time, detects the infrared rays emitted by the person and converts the infrared rays into electric signals to be output, and when the person enters a sensing range (namely a target area), the infrared sensor detects the infrared rays of the human body and emits a prompt signal. The detection of the object of the type of object to be present in the target area by the object sensor means the detection of the entry of a person into the target area.
The method comprises the steps that whether human figures appear in a target area or not is preliminarily detected through a target sensor, whether target objects of a target type appear in the target area or not is further determined through video streams shot by target shooting equipment for the target area under the condition that the target sensors detect that the target objects of the target type appear in the target area, and only under the condition that the target objects move, a target signal is sent out and used for prompting staff or users that the target objects move appear in the target area.
Through the steps, under the condition that the target sensor detects that the target type object appears in the target area, a prompt signal is not directly sent to a worker or a user, whether the moving target object appears in the target area is further judged according to the real-time video stream, the judgment result of the target sensor is screened, false alarm caused by interference of the target sensor is effectively filtered, the problem of low object detection accuracy in the related technology is solved, and the effect of improving the object detection accuracy is achieved.
The main body for executing the steps S202 to S206 may be a Real-Time Operating System (RTOS System), which can quickly respond and process data, schedule all available resources, and control all Real-Time tasks to run in a coordinated manner while completing the Real-Time tasks.
The target sensor has low power consumption, can continuously run for a long time, and has the advantages of quick start, high efficiency and low power consumption of the RTOS system.
In an optional embodiment, the determining whether a moving target object appears in the target area in the real-time video stream includes: acquiring multi-frame pictures in the real-time video stream, and identifying the object of the target type in the multi-frame pictures; under the condition that the same object of the target type is identified in continuous K frames of pictures of the multiple frames of pictures, determining the identified same object as the target object; and determining the target object with the movement in the target area when the motion state of the target object is the movement.
In this embodiment, a real-time video stream captured by a target capturing device is obtained, where the real-time video stream is a video stream obtained by the target capturing device while capturing and sending obtained video data to an RTOS system, that is, when the real-time video stream is obtained, a picture of a preset frame number is obtained one frame by one frame, or a real-time video stream is obtained every preset time, and the preset time needs to be as small as possible in order to ensure real-time performance.
In a multi-frame picture acquired from a real-time video stream, identifying an object of a target type in the picture frame by frame, and adding a target frame to the target object appearing in the picture, wherein the target frame is used for identifying the object.
In order to filter false reports caused by false detection in a single frame image and improve the accuracy of object detection reporting, an object identified by the same object in continuous K frame images is determined as a target object in a target area, namely a humanoid target appears in the target object, the motion state of the target object is judged under the condition that the target object appears in the target area, and a target signal is sent under the condition that the motion of the target object is moving.
Optionally, the obtained picture frames are cached while the real-time video stream is obtained, the cached picture frames are used for generating a video and storing the video when the target signal is sent, caching is started from the obtained 1 st frame picture, when a moving target object appears in the target region, all the cached picture frames are stored, and a new video frame obtained after the moving target object appears in the target region is determined is also stored until the time length of the video reaches a preset time length threshold or the stored picture frames reach a preset frame number threshold.
In an optional embodiment, in a case that the same object of the target type is identified in consecutive K frames of the multiple frames of pictures, determining that the identified same object is determined as the target object includes: in the case that a first object of the target type is identified for the first time in an ith frame of pictures in the multi-frame pictures, repeatedly executing the following steps until the first object is identified in all the continuous K-1 frame of pictures after the ith frame of pictures, or the first object is not identified in a frame of pictures after the ith frame of pictures, wherein the initial value of j is 1,i which is a positive integer greater than or equal to 1: judging whether an object matched with the first object exists in a jth object set, wherein the jth object set comprises objects of the target type identified in an i + j frame picture; determining that the first object is identified in the i + j frame picture if an object matching the first object exists in the j object sets; updating j to j +1; determining that the first object is not identified in the i + j frame picture in the case that there is no object matching the first object in the j object sets.
In the present embodiment, when determining whether or not the same object is recognized in the consecutive K frames of pictures, first, when a first object of a target type is recognized for the first time in the ith frame of image, it is determined whether or not the first object is recognized in consecutive K-1 frames following the ith frame of picture, and in a case where the first object is recognized, it is determined that the same object is recognized in the consecutive K frames of pictures.
Judging whether the first object is identified in the continuous K-1 frames after the ith frame of picture, and repeatedly executing the following operations on the continuous K-1 frames after the ith frame of picture: identifying all target type images in the (i + j) th frame of picture to obtain a j) th object set, searching whether an object matched with the first object exists in the j th object set, if so, determining that the first object is identified in the (i + j) th frame of picture, and recording the position information of the first object in the (i + j) th frame of picture, including the position of the target frame, the size of the target frame and other information.
When determining whether the same object appears in the continuous multiple frames, matching the object identified in the frame of picture with the object identified in the previous frame, wherein the object successfully matched indicates that the object is identified in both frames of picture, if the object identified in the frame of picture is not successfully matched, the object is indicated to appear in the frame of picture for the first time, and if the object identified in the previous frame is not successfully matched, the object is determined not to appear in the frame of picture.
In an optional embodiment, the determining whether there is an object in the jth object set that matches the first object includes: acquiring a first target frame and a first target frame set which are used for identifying the first object in the i + j-1 th frame of picture, wherein the first target frame set comprises target frames which are used for identifying each object in the first object set in the i + j frame of picture; determining the intersection ratio of the first target frame and each target frame in the first target frame set; and determining that an object matched with the first object exists in the jth object set under the condition that an object frame with the intersection ratio of the first object frame and the second object frame larger than a preset threshold exists in the first object frame set.
In this embodiment, when determining whether an object matching the first object exists in the jth object set, determining whether the object matching the first object exists according to a target frame, where the target frame of the first object in the (i + j) -1 th frame picture is the first target frame, and the target frames of the objects of all target types identified in the (i + j) -th frame picture constitute a target frame set, where the target frame set includes one or more target frames, and the first target frames are respectively calculated as cross-over ratios with respect to the target frames in the target frame set, and if the cross-over ratio is greater than a preset threshold, determining that an object matching the first object exists in the jth object set, and determining the object corresponding to the cross-over ratio as the first object, and determining the corresponding target frame as the target frame used for identifying the first object in the (i + j) -th frame picture.
It should be noted that the intersection ratio reflects the degree of coincidence between two target frames, and a larger intersection ratio indicates a larger overlapping area between two target frames.
In an optional embodiment, in a case that the motion state of the target object is moving, determining that the target object moving in the target area occurs includes: acquiring a target picture set, wherein the target object is identified in each picture in the target picture set, the target picture set comprises an ith picture in the multi-frame pictures, the ith picture is a picture in the multi-frame pictures, the target object is identified for the first time, and i is a positive integer greater than or equal to 1; determining the displacement of the target object in each picture in the target picture set, and determining the motion direction of the target object in each picture in the target picture set; and determining the target object moving in the target area under the condition that pictures with the target object displacement larger than preset displacement exist in the target picture set and the number of the pictures with the same target object motion direction in the target picture set is larger than a preset number threshold.
In this embodiment, when it is determined that the target object exists in the target area, the motion state of the target object is further determined, and the target signal is transmitted only when the motion state is moving, whereas the target signal is not transmitted when the motion state is stationary.
When the motion state of the target object is judged, whether the displacement of the target object is larger than a threshold value and whether the main motion direction of the target object exists are determined.
And acquiring a target picture set, wherein pictures in the target set comprise all or part of images of the identified target object, and a first frame picture of the target picture set is a 1 st picture which is the ith frame picture. The displacement of the target object in each picture in the target set refers to a distance between a target point on a target frame corresponding to the target object in each picture and a target point on a target frame corresponding to the target object in the first picture, where the target points may be the same point in the target frame, for example, a center point or an upper left corner of the target frame.
And when judging whether the main motion direction exists in the target object, determining the motion direction of the target object in each picture, and determining the motion direction of the target object in each picture according to the relative position direction between the target frame of the target object in each picture and the target frame of the target object in the previous picture.
Judging whether the motion directions of the target objects in the pictures are the same or not, and determining that the main motion direction exists in the target objects when the number of the pictures with the same motion direction is larger than a preset number threshold, for example, determining that the main motion direction exists in the target objects when the motion direction of the target objects in the pictures with the preset number threshold is determined to be the right motion, wherein the main motion direction is the right motion.
In an optional embodiment, the determining the displacement of the target object in each picture in the target picture set includes: acquiring the mth position of the target object in the mth picture in the target picture set and the 1 st position of the target object in the 1 st picture in the target picture set, wherein the 1 st picture is the ith frame picture, and m is a positive integer greater than or equal to 1; and determining the displacement of the target object in the mth picture according to the distance between the mth position and the 1 st position.
In this embodiment, the mth position is a position of a target point on a target frame corresponding to the target object in the mth picture, for example, a central point of the target frame is selected as the mth position. And determining the displacement of the target object in the mth picture according to the distance between the mth position and the 1 st position.
In an optional embodiment, the determining the motion direction of the target object in each picture of the target picture set comprises: acquiring an mth target frame in an mth picture in the target picture set for identifying the target object, and an m +1 th target frame in an m +1 picture for identifying the target object, wherein m is a positive integer greater than or equal to 1; and determining the motion direction of the target object in the (m + 1) th picture according to the (m + 1) th target frame and the (m + 1) th target frame.
In this embodiment, the motion direction may be along the direction after the decomposition of the horizontal and vertical directions, i.e. four directions, i.e. up, down, left, and right, and the motion direction of the target object in the m +1 th picture is obtained by examining the m +1 th target frame and the m +1 th target frame of the target object.
Optionally, the difference between the coordinates of the top left corner, the bottom right corner, and the center point of the mth target frame and the (m + 1) th target frame is used to obtain whether the target object moves rightward or leftward, and the determination is performed in the following manner:
△X_m+1_left_up=X_m+1_left_up–X_m_left_up;
△X_m+1_center=X_m+1_center–X_m_center;
△X_m+1_right_low=X_m+1_right_low–X_m_right_low;
wherein X represents an abscissa, left _ up represents an upper left corner, right _ low represents a lower right corner, center represents a center point, X _ m +1_left _ up represents an abscissa of an upper left corner coordinate of an m +1 th target frame of a target object in an m +1 th picture, X _ m +1_left _uprepresents an abscissa of the upper left-hand corner coordinate of the m-th target frame of the target object in the m-th picture, X _ m +1 _centerrepresents an abscissa of the center point coordinate of the m + 1-th target frame of the target object in the m + 1-th picture, X _ m _ center represents an abscissa of a center point coordinate of an mth target frame of the target object in the mth picture, X _ m +1_right _lowrepresents an abscissa of a center point coordinate of an m +1 th target frame of the target object in the m +1 th picture, and X _ m _ right _ low represents an abscissa of a center point coordinate of an mth target frame of the target object in the mth picture.
If two or more of Δ X _ m +1 left u up, Δx _ m +1 u center, and Δ X _ m +1 u right low are greater than 0, it is determined that the target object moves rightward; if two or more of the three are smaller than 0, the target object is judged to move leftwards, otherwise, the movement direction cannot be judged.
Similarly, by examining the ordinate Y, the upward or downward movement state of the target object can be determined.
Optionally, the motion state of the target object may also be determined by calculating a foreground point pixel ratio in the target frame, specifically, each pixel point is classified into two categories, each pixel point is divided into a foreground point and a background point by analyzing a pixel value change of a pixel at the same position between consecutive frames, and the foreground point is a pixel point on the target object.
That is, each pixel point in the mth picture is compared with the corresponding pixel point in the m +1 th picture, a difference value of pixel values between the two pixel points is determined, the pixel point in the m +1 th picture is determined as a foreground point under the condition that the difference value is greater than a preset pixel threshold value, otherwise, the pixel point is determined as a background point, and fig. 3 is a schematic diagram of a binary image according to an embodiment of the present invention, and as shown in fig. 3, a binary image having the same size as an original image is finally output.
Fig. 4 is a schematic diagram of mapping a target frame into a binary image according to an embodiment of the present invention, where as shown in fig. 4, an mth target frame of a target object in an mth picture is mapped into the binary image, the number of foreground point pixels in the mth target frame is divided by the number of all pixel points surrounded by the target frame to obtain a foreground point pixel proportion of the mth target frame, and when the foreground point pixel proportion of the mth target frame is greater than a preset proportion threshold, it is determined that the target object is moving.
It is to be understood that the above-described embodiments are only a few, but not all, embodiments of the present invention.
The present invention will be described in detail with reference to the following examples:
fig. 5 is a schematic diagram of a structure of an RTOS system according to an embodiment of the present invention, as shown in fig. 5, the RTOS system includes: the device comprises a target detection module, a background modeling module, a target tracking module and a target signal judging module.
The target detection module is mainly used for identifying and positioning the target type object in the target area to obtain the target type object position information. In this embodiment, a neural network-based YOLO target detection algorithm is used to detect target categories such as pedestrians, animals, and vehicles, which are relatively common in a monitoring scene. Other target detection algorithms such as the RCNN series, SSD, etc. may also achieve similar effects. Due to the data-driven deep learning algorithm, the targets which are possibly subjected to PIR false alarm and are caused by animals, light sources, heat sources and the like can be effectively filtered.
The background modeling module mainly has the function of detecting a moving object. The background modeling algorithm adopted in the proposal is the vibe, but is not limited to the vibe, and other background modeling algorithms such as Gaussian Mixture Model (GMM), vibeplus and the like can achieve similar effects. Background modeling can be regarded as a process for classifying pixels two, and each pixel is divided into a foreground point and a background point by analyzing the pixel value change of the pixels at the same position between continuous frames, wherein the foreground point is a moving target. The background modeling module outputs a result as a foreground image which is a binary image with the same size as the original image.
The target tracking module is mainly used for performing inter-frame association on target frames detected in different pictures, determining the same target in adjacent frames and maintaining target state, historical track information and the like. .
The target state of the target object can be divided into init, create, update, lost and delete 5 types, the first occurring target is the init state, the continuous k frames of the target in the init state are successfully matched, the target in the create state enters the create state, if the target in the create state is still successfully matched in the subsequent frames, the target in the update state is changed into the update state, otherwise, the target in the lost state is changed into the lost state. The target of the lost state can still participate in the subsequent frame matching until the continuous n-frame matching fails to reach the delete state. In the embodiment, only the target in the update state is possible to trigger the alarm, so that the condition of false alarm caused by false detection and missing detection of the single-frame image can be effectively filtered. And for the same target object, recording the position information of the same target object if the matching is successful, so that the motion trail of the target can be obtained for the subsequent module analysis.
The target signal determination module determines whether to emit a target signal based on an output result based on the target tracking and the background modeling.
Sending out the target signal requires that 3 conditions are simultaneously satisfied: condition 1: is an object of the target type (filtering false positives caused by animals, heat sources, light sources, etc.). Condition 2: and (4) filtering false alarm and false negative report caused by false detection and false negative detection of a single-frame image for the target object in the update state. Condition 3: objects in motion (filtering false positives caused by stationary objects).
Wherein the condition for determining that the object is in a motion state: condition 1: the target displacement is greater than a set threshold; condition 2: the target has a primary direction of motion; condition 3: the pixel proportion of the foreground point of the target frame is larger than a set threshold value. And if two of the 3 conditions are met, the target is judged to be in a motion state.
Fig. 6 is a schematic overall flow chart of object detection according to an embodiment of the present invention, as shown in fig. 6, including:
step 601: capturing the wavelength in a specific range in real time through an infrared sensor, and carrying out primary detection on an object of a target type;
step 602: judging whether the infrared sensor detects an object of a target type, if so, executing step 603, and if not, executing step 601;
step 603: waking up the RTOS system;
step 604: starting video stream pushing, acquiring a shot real-time video stream and caching an image frame;
step 605: intelligent video analysis to determine whether a moving target object appears in the target area;
step 605: judging whether a moving target object appears in the target area, if so, executing step 606, and if not, executing step 607;
step 606: transmitting a target signal;
step 607: the method comprises the steps that an RTOS system is dormant, and after a target signal is sent, the running of a video algorithm is finished; or after the video is stored or when the target signal is not triggered to be sent, ending the video stream pushing, then sleeping the RTOS system, and then executing step 601 to wait for the next time the infrared sensor detects the target type object.
Through the above description of the embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but the former is a better implementation mode in many cases. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which is stored in a storage medium (e.g., ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal device (e.g., a mobile phone, a computer, a server, or a network device) to execute the method according to the embodiments of the present invention.
There is also provided in this embodiment an object detection apparatus, and fig. 7 is a block diagram of a structure of an object detection apparatus according to an embodiment of the present invention, as shown in fig. 7, the apparatus including:
an obtaining module 702, configured to obtain a real-time video stream obtained by shooting, by a target shooting device, a target area when a target sensor detects an object of a target type in the target area;
a determining module 704, configured to determine whether a moving target object appears in the target area in the real-time video stream, where a type of the target object is the target type;
a sending module 706, configured to send a target signal when it is determined that the moving target object appears in the target area, where the target signal is used to prompt that the moving target object appears in the target area.
In an optional embodiment, the apparatus is further configured to obtain multiple frames of pictures in the real-time video stream, and identify the object of the target type in the multiple frames of pictures; under the condition that the same object of the target type is identified in continuous K frames of pictures of the multiple frames of pictures, determining the identified same object as the target object; and determining the target object with the movement in the target area when the motion state of the target object is the movement.
In an optional embodiment, the apparatus is further configured to, in a case where a first object of the target type is identified for the first time in an ith frame of pictures in the multiple frames of pictures, repeatedly perform the following steps until the first object is identified in all of the consecutive K-1 frames of pictures after the ith frame of pictures, or the first object is not identified in a frame of pictures after the ith frame of pictures, where an initial value of j is 1,i which is a positive integer greater than or equal to 1: judging whether an object matched with the first object exists in a jth object set, wherein the jth object set comprises objects of the target type identified in an i + j frame picture; determining that the first object is identified in the i + j frame picture if an object matching the first object exists in the j object sets; updating j to j +1; determining that the first object is not identified in the i + j frame picture in the case that there is no object matching the first object in the j object sets.
In an optional embodiment, the apparatus is further configured to obtain a first target frame and a first target frame set, which are used to identify the first object, in the i + j-1 th frame of picture, where the first target frame set includes target frames, which are used to identify each object in the first object set, in the i + j-th frame of picture; determining the intersection ratio of the first target frame and each target frame in the first target frame set; and determining that an object matched with the first object exists in the jth object set under the condition that an object frame with the intersection ratio of the first object frame and the second object frame larger than a preset threshold exists in the first object frame set.
In an optional embodiment, the apparatus is further configured to obtain a target picture set, where the target object is identified in each picture in the target picture set, the target picture set includes an i-th picture in the multiple pictures, the i-th picture is a picture in the multiple pictures in which the target object is identified for the first time, and i is a positive integer greater than or equal to 1; determining the displacement of the target object in each picture in the target picture set, and determining the motion direction of the target object in each picture in the target picture set; and determining the target object moving in the target area under the condition that pictures with the target object displacement larger than preset displacement exist in the target picture set and the number of the pictures with the same target object motion direction in the target picture set is larger than a preset number threshold.
In an optional embodiment, the apparatus is further configured to obtain an mth position of the target object in an mth picture in the target picture set and a 1 st position of the target object in a 1 st picture in the target picture set, where the 1 st picture is the ith frame picture, and m is a positive integer greater than or equal to 1; determining the displacement of the target object in the mth picture according to the distance between the mth position and the 1 st position.
In an optional embodiment, the apparatus is further configured to acquire an mth target frame in an mth picture in the target picture set for identifying the target object, and an m +1 th target frame in an m +1 th picture for identifying the target object, where m is a positive integer greater than or equal to 1; and determining the motion direction of the target object in the (m + 1) th picture according to the (m + 1) th target frame and the (m + 1) th target frame.
It should be noted that the above modules may be implemented by software or hardware, and for the latter, the following may be implemented, but not limited to: the modules are all positioned in the same processor; alternatively, the modules are respectively located in different processors in any combination.
Embodiments of the present invention also provide a computer-readable storage medium having a computer program stored thereon, wherein the computer program is arranged to perform the steps of any of the above-mentioned method embodiments when executed.
In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to: various media capable of storing computer programs, such as a usb disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic disk, or an optical disk.
Embodiments of the present invention also provide an electronic device comprising a memory having a computer program stored therein and a processor arranged to run the computer program to perform the steps of any of the above method embodiments.
In an exemplary embodiment, the electronic apparatus may further include a transmission device and an input/output device, wherein the transmission device is connected to the processor, and the input/output device is connected to the processor.
For specific examples in this embodiment, reference may be made to the examples described in the foregoing embodiments and exemplary implementations, and details of this embodiment are not repeated herein.
It will be apparent to those skilled in the art that the various modules or steps of the invention described above may be implemented using a general purpose computing device, they may be centralized on a single computing device or distributed across a network of computing devices, and they may be implemented using program code executable by the computing devices, such that they may be stored in a memory device and executed by the computing device, and in some cases, the steps shown or described may be performed in an order different than that described herein, or they may be separately fabricated into various integrated circuit modules, or multiple ones of them may be fabricated into a single integrated circuit module. Thus, the present invention is not limited to any specific combination of hardware and software.
The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, or improvement made within the principle of the present invention shall be included in the protection scope of the present invention.

Claims (10)

1. An object detection method, comprising:
under the condition that a target sensor detects that a target type object appears in a target area, acquiring a real-time video stream obtained by shooting the target area by target shooting equipment;
determining whether a moving target object appears in the target area in the real-time video stream, wherein the type of the target object is the target type;
and under the condition that the moving target object appears in the target area, sending a target signal, wherein the target signal is used for prompting the moving target object appearing in the target area.
2. The method of claim 1, wherein determining whether a moving target object is present in the target area in the real-time video stream comprises:
acquiring multi-frame pictures in the real-time video stream, and identifying the object of the target type in the multi-frame pictures;
under the condition that the same object of the target type is identified in continuous K frames of pictures of the multiple frames of pictures, determining the identified same object as the target object;
and determining the target object with the movement in the target area when the motion state of the target object is the movement.
3. The method according to claim 2, wherein in a case where the same object of the target type is identified in consecutive K frames of the multi-frame picture, determining that the identified same object is determined to be the target object comprises:
in the case that a first object of the target type is identified for the first time in an ith frame of pictures in the multi-frame pictures, repeatedly executing the following steps until the first object is identified in all the continuous K-1 frame of pictures after the ith frame of pictures, or the first object is not identified in a frame of pictures after the ith frame of pictures, wherein the initial value of j is 1,i which is a positive integer greater than or equal to 1:
judging whether an object matched with the first object exists in a jth object set, wherein the jth object set comprises objects of the target type identified in an i + j frame picture;
determining that the first object is identified in the i + j frame picture if an object matching the first object exists in the j object sets; updating j to j +1;
determining that the first object is not identified in the i + j frame picture in the case that there is no object matching the first object in the j object sets.
4. The method of claim 3, wherein the determining whether there is an object in the jth set of objects that matches the first object comprises:
acquiring a first target frame and a first target frame set which are used for identifying the first object in the i + j-1 th frame of picture, wherein the first target frame set comprises target frames which are used for identifying each object in the first object set in the i + j frame of picture;
determining the intersection ratio of the first target frame and each target frame in the first target frame set;
and determining that an object matched with the first object exists in the jth object set under the condition that an object frame with the intersection ratio of the first object frame and the second object frame larger than a preset threshold exists in the first object frame set.
5. The method according to claim 2, wherein in a case that the motion state of the target object is movement, determining the target object in which the movement occurs in the target area comprises:
acquiring a target picture set, wherein the target object is identified in each picture in the target picture set, the target picture set comprises an ith picture in the multi-frame pictures, the ith picture is a picture in the multi-frame pictures, the target object is identified for the first time, and i is a positive integer greater than or equal to 1;
determining the displacement of the target object in each picture in the target picture set, and determining the motion direction of the target object in each picture in the target picture set;
and determining the target object moving in the target area under the condition that pictures with the target object displacement larger than preset displacement exist in the target picture set and the number of the pictures with the same target object motion direction in the target picture set is larger than a preset number threshold.
6. The method of claim 5, wherein the determining the displacement of the target object in each picture of the set of target pictures comprises:
acquiring the mth position of the target object in the mth picture in the target picture set and the 1 st position of the target object in the 1 st picture in the target picture set, wherein the 1 st picture is the ith frame picture, and m is a positive integer greater than or equal to 1;
determining the displacement of the target object in the mth picture according to the distance between the mth position and the 1 st position.
7. The method of claim 5, wherein the determining the motion direction of the target object in each picture of the target picture set comprises:
acquiring an mth target frame used for identifying the target object in an mth picture in the target picture set and an m +1 th target frame used for identifying the target object in an m +1 th picture, wherein m is a positive integer greater than or equal to 1;
and determining the motion direction of the target object in the (m + 1) th picture according to the (m + 1) th target frame and the (m + 1) th target frame.
8. An object detecting apparatus, characterized by comprising:
the acquisition module is used for acquiring a real-time video stream acquired by shooting a target area by target shooting equipment under the condition that a target sensor detects an object of a target type in the target area;
a determining module, configured to determine whether a moving target object appears in the target area in the real-time video stream, where a type of the target object is the target type;
a sending module, configured to send a target signal when it is determined that the moving target object appears in the target area, where the target signal is used to prompt that the moving target object appears in the target area.
9. A computer-readable storage medium, in which a computer program is stored, which computer program, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 7.
10. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the steps of the method as claimed in any of claims 1 to 7 are implemented when the computer program is executed by the processor.
CN202211708519.6A 2022-12-28 2022-12-28 Object detection method, object detection device, storage medium, and electronic device Pending CN115984898A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211708519.6A CN115984898A (en) 2022-12-28 2022-12-28 Object detection method, object detection device, storage medium, and electronic device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211708519.6A CN115984898A (en) 2022-12-28 2022-12-28 Object detection method, object detection device, storage medium, and electronic device

Publications (1)

Publication Number Publication Date
CN115984898A true CN115984898A (en) 2023-04-18

Family

ID=85973699

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211708519.6A Pending CN115984898A (en) 2022-12-28 2022-12-28 Object detection method, object detection device, storage medium, and electronic device

Country Status (1)

Country Link
CN (1) CN115984898A (en)

Similar Documents

Publication Publication Date Title
US9652863B2 (en) Multi-mode video event indexing
CN109299703B (en) Method and device for carrying out statistics on mouse conditions and image acquisition equipment
Hampapur et al. Smart video surveillance: exploring the concept of multiscale spatiotemporal tracking
KR101877294B1 (en) Smart cctv system for crime prevention capable of setting multi situation and recognizing automatic situation by defining several basic behaviors based on organic relation between object, area and object's events
US7868772B2 (en) Flame detecting method and device
CN110321853A (en) Distribution cable external force damage prevention system based on video intelligent detection
Kumar et al. Study of robust and intelligent surveillance in visible and multi-modal framework
WO2021139049A1 (en) Detection method, detection apparatus, monitoring device, and computer readable storage medium
US20200226360A1 (en) System and method for automatically detecting and classifying an animal in an image
US10445885B1 (en) Methods and systems for tracking objects in videos and images using a cost matrix
CN107122743B (en) Security monitoring method and device and electronic equipment
US10713536B1 (en) Camera method with animal recognition function and monitoring camera
KR20190046351A (en) Method and Apparatus for Detecting Intruder
CA3196344A1 (en) Rail feature identification system
CN111274934A (en) Implementation method and system for intelligently monitoring forklift operation track in warehousing management
KR101454644B1 (en) Loitering Detection Using a Pedestrian Tracker
KR101979375B1 (en) Method of predicting object behavior of surveillance video
CN113723369B (en) Control method, control device, electronic equipment and storage medium
KR101842488B1 (en) Smart monitoring system applied with patten recognition technic based on detection and tracking of long distance-moving object
De Venâncio et al. Fire detection based on a two-dimensional convolutional neural network and temporal analysis
CN106303461A (en) Movable-type intelligent safety device based on video analysis
JP7282186B2 (en) situational awareness surveillance
CN116824641A (en) Gesture classification method, device, equipment and computer storage medium
CN115984898A (en) Object detection method, object detection device, storage medium, and electronic device
CN110135224B (en) Method and system for extracting foreground target of surveillance video, storage medium and terminal

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination